commits
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
April 2014
- 1 participants
- 35 discussions
[mpich] MPICH primary repository branch, master, updated. v3.1-156-gffcc490
by noreply@mpich.org 15 Apr '14
by noreply@mpich.org 15 Apr '14
15 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via ffcc4904c225bbf1349d23e1099218de5287fe5a (commit)
via 2957c845ff61e0dd334e93de137d966c66a7654b (commit)
via 5661cf2b348626fa9db0ee7561f3f66a47b7fd8a (commit)
from 59afcee791229fa9293ac1aba1d1b2fd02537b30 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/ffcc4904c225bbf1349d23e1099218de5…
commit ffcc4904c225bbf1349d23e1099218de5287fe5a
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat Apr 12 20:55:30 2014 -0500
Create a dummy function that calls all ROMIO public symbols.
All ROMIO public symbols are being added into the libromio convenience
library, which is LIBADD'ed into libmpi. The correct behavior would
be for libtool to add -Wl,--whole-archive to the link line, thus
forcing all symbols in libromio to end up in libmpi. However, in some
cases, this is not working out correctly. For example, with the
Absoft compiler, the linker flags were being reordered thus causing
the -Wl,--whole-archive flag to not correspond to libromio.
Consequently, only symbols that were used from within the other
functions of libmpi were being included.
For example, Absoft's linker reordering is below:
----8<----
% af77 -v -shared -fPIC src/mpi/attr/.libs/lib_libmpi_la-attrutil.o src/mpi_t/.libs/lib_libmpi_la-pvar_write.o \
-Wl,--whole-archive src/mpi/romio/.libs/libromio.a -Wl,--no-whole-archive \
-Wl,-rpath -Wl,/sandbox/balaji/build-absoft/src/mpl/.libs \
-Wl,-rpath -Wl,/sandbox/balaji/build-absoft/src/openpa/src/.libs \
-Wl,-rpath -Wl,/sandbox/balaji/build-absoft/install/lib \
-L/sandbox/balaji/build-absoft/src/mpl -L/sandbox/balaji/build-absoft/src/openpa/src \
/sandbox/balaji/build-absoft/src/mpl/.libs/libmpl.so /sandbox/balaji/build-absoft/src/openpa/src/.libs/libopa.so \
-lrt -lpthread -O0 -Wl,-soname -Wl,libmpi.so.12 -o lib/.libs/libmpi.so.12.0.0
gcc src/mpi/attr/.libs/lib_libmpi_la-attrutil.o src/mpi_t/.libs/lib_libmpi_la-pvar_write.o \
/sandbox/balaji/build-absoft/src/mpl/.libs/libmpl.so /sandbox/balaji/build-absoft/src/openpa/src/.libs/libopa.so \
-L/soft/com/packages/absoft11.0/shlib64 -Wl,--whole-archive -Wl,--no-whole-archive \
-Wl,-rpath -Wl,/sandbox/balaji/build-absoft/src/mpl/.libs \
-Wl,-rpath -Wl,/sandbox/balaji/build-absoft/src/openpa/src/.libs \
-Wl,-rpath -Wl,/sandbox/balaji/build-absoft/install/lib \
-L/sandbox/balaji/build-absoft/src/mpl -L/sandbox/balaji/build-absoft/src/openpa/src \
-Wl,-soname -Wl,libmpi.so.12 -shared -o lib/.libs/libmpi.so.12.0.0 src/mpi/romio/.libs/libromio.a \
-lrt -lpthread -laf90math -lafio -lamisc -laf77math -lm -lmv
----8<----
In the past, we got lucky in two ways:
1. We were including all the Fortran 77 symbols into libmpi. Since
the Fortran symbols were calling the C ROMIO symbols, those ROMIO
symbols were pulled in even without -Wl,--whole-archive.
2. The problem only showed up with absoft and nag, both of which are
Fortran-only compilers. If a C compiler has this issue, it should
have shown up when Fortran support is disabled.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/.gitignore b/.gitignore
index 6df55fc..4da8b8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -184,6 +184,7 @@ Makefile.am-stamp
/src/include/mpichinfo.h
/src/packaging/envmods/mpich.module
/src/packaging/pkgconfig/mpich.pc
+/src/glue/romio/all_romio_symbols.c
# stamp "witness" files from the new build system
/src/binding/fortran/use_mpi/buildiface.stamp
diff --git a/autogen.sh b/autogen.sh
index eb07ad8..d1e7d93 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -656,6 +656,15 @@ if [ "X$do_subcfg_m4" = Xyes ] ; then
echo "done"
fi
+
+########################################################################
+## Building ROMIO glue code
+########################################################################
+echo_n "Building ROMIO glue code... "
+( cd src/glue/romio && chmod a+x ./all_romio_symbols && ./all_romio_symbols ../../mpi/romio/include/mpio.h.in )
+echo "done"
+
+
########################################################################
## Building non-C interfaces
########################################################################
diff --git a/src/glue/romio/Makefile.mk b/src/glue/romio/Makefile.mk
index 7afc8a0..f93323c 100644
--- a/src/glue/romio/Makefile.mk
+++ b/src/glue/romio/Makefile.mk
@@ -7,3 +7,4 @@
mpi_core_sources += src/glue/romio/glue_romio.c
+mpi_sources += src/glue/romio/all_romio_symbols.c
diff --git a/src/glue/romio/all_romio_symbols b/src/glue/romio/all_romio_symbols
new file mode 100755
index 0000000..9ee6736
--- /dev/null
+++ b/src/glue/romio/all_romio_symbols
@@ -0,0 +1,205 @@
+#! /usr/bin/env perl
+#
+# (C) 2014 by Argonne National Laboratory.
+# See COPYRIGHT in top-level directory.
+#
+
+use warnings;
+use strict;
+
+# Check to make sure the file was passed in as a parameter
+if ($#ARGV != 0) {
+ print "Usage: buildiface <filename>\n";
+ exit 1;
+}
+
+open(FD, $ARGV[0]) || die "Could not open file " . $ARGV[0];
+
+while (<FD>) {
+ if (/\/\*\s*Begin Prototypes/) { last; }
+}
+
+my $eol = 1;
+my $fullline = "";
+my $tab = " ";
+my $retarg;
+my $routine;
+my $args;
+my @arglist;
+my $fname;
+my $cdesc_routine;
+my $x;
+my $y;
+my @argbits;
+my $num_dtypes;
+my @dtype_bind;
+my $io_header;
+my $make_exists = 0;
+
+open(OUTFD, ">all_romio_symbols.c") || die "Could not open file all_romio_symbols.c";
+print OUTFD <<EOT;
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ *
+ * This file is automatically generated by buildiface
+ * DO NOT EDIT
+ */
+
+/*
+ * This file is created for the sole purpose of referencing all the symbols
+ * in ROMIO.
+ *
+ * All ROMIO public symbols are being added into the libromio convenience
+ * library, which is LIBADD'ed into libmpi. The correct behavior would
+ * be for libtool to add -Wl,--whole-archive to the link line, thus
+ * forcing all symbols in libromio to end up in libmpi. However, in some
+ * cases, this is not working out correctly. For example, with the
+ * Absoft compiler, the linker flags were being reordered thus causing
+ * the -Wl,--whole-archive flag to not correspond to libromio.
+ * Consequently, only symbols that were used from within the other
+ * functions of libmpi were being included.
+ *
+ * In the past, we got lucky in two ways:
+ *
+ * 1. We were including all the Fortran 77 symbols into libmpi. Since
+ * the Fortran symbols were calling the C ROMIO symbols, those ROMIO
+ * symbols were pulled in even without -Wl,--whole-archive.
+ *
+ * 2. The problem only showed up with absoft and nag, both of which are
+ * Fortran-only compilers. If a C compiler has this issue, it should
+ * have shown up when Fortran support is disabled.
+ */
+
+#include <stdio.h>
+#include "mpi.h"
+
+void MPIR_All_romio_symbols(void);
+void MPIR_All_romio_symbols(void)
+{
+#ifdef MPI_MODE_RDONLY
+EOT
+
+while (<FD>) {
+ if (/\/\*\s*End Prototypes/) { last; }
+
+ if (/\/\*\s*Begin Skip Prototypes/) {
+ while (<FD>) {
+ if (/\/\*\s*End Skip Prototypes/) { last; }
+ }
+ }
+
+ # If we found a semi-colon at the end, that's the end of the line.
+ # This is not perfect (e.g., does not work when a single line has
+ # multiple semi-colon separated statements), but should be good
+ # enough for the MPICH mpi.h file
+ if (/.*;/) { $eol = 1; }
+ else { $eol = 0; }
+
+ chomp($_);
+ $fullline .= "$_";
+ if ($eol == 0) { next; }
+
+ # We got the entire prototype in a single line
+
+ # parse out comments
+ $fullline =~ s+/\*.*\*/++g;
+
+ # parse out attributes
+ $fullline =~ s/MPICH_ATTR_WEAK_ALIAS\(.*\)//g;
+ $fullline =~ s/MPICH_ATTR_POINTER_WITH_TYPE_TAG\(.*\)//g;
+
+ # cleanup pointer format
+ $fullline =~ s/\s*\*/* /g;
+
+ # parse out unnecessary spaces
+ $fullline =~ s/^\s*//g;
+ $fullline =~ s/\s*$//g;
+ $fullline =~ s/\s*;/;/g;
+ $fullline =~ s/\s\s*/ /g;
+
+ # split the line into the return type, routine name, and arguments
+ $fullline =~ m/([^ ]*) ([^(]*)\((.*)\)/;
+ $retarg = $1;
+ $routine = $2;
+ $args = $3;
+
+ # cleanup args
+ $args =~ s/^\s*//g;
+ $args =~ s/\s*$//g;
+
+ @arglist = split(/,/, $args);
+
+ for ($x = 0; $x <= $#arglist; $x++) {
+ $arglist[$x] =~ s/^\s*//g;
+ $arglist[$x] =~ s/\s*$//g;
+ }
+
+ print OUTFD "${tab}{\n";
+ for ($x = 0; $x <= $#arglist; $x++) {
+ print OUTFD "${tab}${tab}$arglist[$x]";
+ if ($arglist[$x] =~ /\*/) {
+ print OUTFD " = NULL;\n";
+ }
+ elsif ($arglist[$x] =~ /MPI_Comm/) {
+ print OUTFD " = MPI_COMM_NULL;\n";
+ }
+ elsif ($arglist[$x] =~ /MPI_Info/) {
+ print OUTFD " = MPI_INFO_NULL;\n";
+ }
+ elsif ($arglist[$x] =~ /MPI_File/) {
+ print OUTFD " = MPI_FILE_NULL;\n";
+ }
+ elsif ($arglist[$x] =~ /MPI_Datatype/) {
+ print OUTFD " = MPI_DATATYPE_NULL;\n";
+ }
+ elsif ($arglist[$x] =~ /MPI_Errhandler/) {
+ print OUTFD " = MPI_ERRHANDLER_NULL;\n";
+ }
+ elsif ($arglist[$x] =~ /MPI_Offset/) {
+ print OUTFD " = 0;\n";
+ }
+ elsif ($arglist[$x] =~ /int/) {
+ print OUTFD " = 0;\n";
+ }
+ else {
+ print "$arglist[$x]\n";
+ print OUTFD ";\n";
+ }
+ }
+ print OUTFD "\n${tab}${tab}$routine(";
+ for ($x = 0; $x <= $#arglist; $x++) {
+ @argbits = split(/ /, $arglist[$x]);
+
+ if ($x < $#arglist) {
+ print OUTFD "$argbits[$#argbits], ";
+ }
+ else {
+ print OUTFD "$argbits[$#argbits]);\n";
+ }
+ }
+ print OUTFD "${tab}}\n\n";
+
+ $fullline = "";
+}
+
+# A few symbols are not in mpio.h
+print OUTFD <<EOT;
+ {
+ MPI_Fint fh = 0;
+
+ MPI_File_f2c(fh);
+ }
+
+ {
+ MPI_File fh = MPI_FILE_NULL;
+
+ MPI_File_c2f(fh);
+ }
+#endif /* MPI_MODE_RDONLY */
+}
+EOT
+
+close FD;
+close OUTFD;
http://git.mpich.org/mpich.git/commitdiff/2957c845ff61e0dd334e93de137d966c6…
commit 2957c845ff61e0dd334e93de137d966c66a7654b
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Tue Apr 15 00:12:16 2014 -0500
Cleanup the symbol management to go into the right library.
We were adding both the ROMIO MPI_ and PMPI_ symbols into the
external_libs variable, which end up in the same library. This patch
separates them out. It also cleans up the variables to which other
libtool libraries (such as the debug library) are added.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/Makefile.am b/Makefile.am
index fc9e804..8576409 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,6 +50,8 @@ errnames_txt_files =
external_subdirs = @mplsrcdir@ @opasrcdir@
external_ldflags = -L@mpllibdir@ -L@opalibdir@
external_libs = -l@MPLLIBNAME@ -l@OPALIBNAME@
+mpi_convenience_libs =
+pmpi_convenience_libs =
# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
# The automake manual recommends thinking of DIST_SUBDIRS as the list of all
@@ -137,48 +139,35 @@ mpi_core_sources =
lib_LTLIBRARIES =
-if BUILD_PROFILING_LIB
-lib_lib@PMPILIBNAME@_la_LIBADD =
-endif BUILD_PROFILING_LIB
-
-lib_lib@MPILIBNAME@_la_SOURCES =
-lib_lib@MPILIBNAME@_la_LDFLAGS =
-lib_lib@MPILIBNAME@_la_CPPFLAGS =
-lib_lib@MPILIBNAME@_la_LIBADD =
-
-if BUILD_F77_BINDING
-lib_lib@MPIFCLIBNAME@_la_LIBADD =
-endif BUILD_F77_BINDING
-
-if BUILD_CXX_BINDING
-lib_lib@MPICXXLIBNAME@_la_LIBADD =
-endif BUILD_CXX_BINDING
-
# include our subdir automake fragments
include maint/Makefile.mk
include src/Makefile.mk
if BUILD_PROFILING_LIB
+# dropping mpi_fc_sources and mpi_cxx_sources from libmpmpi since they
+# don't contribute any PMPI symbols.
lib_LTLIBRARIES += lib/lib@[email protected]
-# dropping mpi_fc_sources and mpi_cxx_sources from the below PMPI list
-# since they don't contribute any PMPI symbols.
lib_lib@PMPILIBNAME@_la_SOURCES = $(mpi_sources) $(mpi_f77_sources) $(mpi_core_sources)
lib_lib@PMPILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
-lib_lib@PMPILIBNAME@_la_LIBADD += $(external_libs)
-lib_lib@MPILIBNAME@_la_CPPFLAGS += -DMPICH_MPI_FROM_PMPI
-lib_lib@MPILIBNAME@_la_LIBADD += lib/lib@[email protected]
-else !BUILD_PROFILING_LIB
-lib_lib@MPILIBNAME@_la_SOURCES += $(mpi_core_sources)
-lib_lib@MPILIBNAME@_la_LIBADD += $(external_libs)
-endif !BUILD_PROFILING_LIB
+lib_lib@PMPILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs)
# lib@[email protected] might depend on lib@[email protected]. We add them
# in that order to lib_LTLIBRARIES so libtool doesn't get
# confused. (see https://bugzilla.redhat.com/show_bug.cgi?id=91110)
lib_LTLIBRARIES += lib/lib@[email protected]
-lib_lib@MPILIBNAME@_la_SOURCES += $(mpi_sources)
-lib_lib@MPILIBNAME@_la_LDFLAGS += $(external_ldflags) $(ABIVERSIONFLAGS)
-lib_lib@MPILIBNAME@_la_CPPFLAGS += $(AM_CPPFLAGS)
+lib_lib@MPILIBNAME@_la_SOURCES = $(mpi_sources)
+lib_lib@MPILIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
+lib_lib@MPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPICH_MPI_FROM_PMPI
+lib_lib@MPILIBNAME@_la_LIBADD = lib/lib@[email protected] $(mpi_convenience_libs)
+
+else !BUILD_PROFILING_LIB
+
+lib_LTLIBRARIES += lib/lib@[email protected]
+lib_lib@MPILIBNAME@_la_SOURCES = $(mpi_sources) $(mpi_core_sources)
+lib_lib@MPILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
+lib_lib@MPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS)
+lib_lib@MPILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(mpi_convenience_libs)
+endif !BUILD_PROFILING_LIB
if BUILD_F77_BINDING
lib_LTLIBRARIES += lib/lib@[email protected]
@@ -191,14 +180,14 @@ if BUILD_FC_BINDING
lib_lib@MPIFCLIBNAME@_la_SOURCES += $(mpi_fc_sources)
endif BUILD_FC_BINDING
lib_lib@MPIFCLIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
-lib_lib@MPIFCLIBNAME@_la_LIBADD += lib/lib@[email protected]
+lib_lib@MPIFCLIBNAME@_la_LIBADD = lib/lib@[email protected]
endif BUILD_F77_BINDING
if BUILD_CXX_BINDING
lib_LTLIBRARIES += lib/lib@[email protected]
lib_lib@MPICXXLIBNAME@_la_SOURCES = $(mpi_cxx_sources)
lib_lib@MPICXXLIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
-lib_lib@MPICXXLIBNAME@_la_LIBADD += lib/lib@[email protected]
+lib_lib@MPICXXLIBNAME@_la_LIBADD = lib/lib@[email protected]
endif BUILD_CXX_BINDING
# build the current directory and then the examples directory after everything else
diff --git a/src/mpi/Makefile.mk b/src/mpi/Makefile.mk
index 4bf0ebc..7d7c021 100644
--- a/src/mpi/Makefile.mk
+++ b/src/mpi/Makefile.mk
@@ -26,13 +26,12 @@ SUBDIRS += src/mpi/romio
DIST_SUBDIRS += src/mpi/romio
MANDOC_SUBDIRS += src/mpi/romio
HTMLDOC_SUBDIRS += src/mpi/romio
-# FIXME is this the right place to put this?
-external_libs += src/mpi/romio/libromio.la
+mpi_convenience_libs += src/mpi/romio/libromio.la
# libpromio contains the PMPI symbols (unlike libpmpi, which contains MPI
# symbols) and should be added to libmpi as well
if BUILD_PROFILING_LIB
-external_libs += src/mpi/romio/libpromio.la
+pmpi_convenience_libs += src/mpi/romio/libpromio.la
endif BUILD_PROFILING_LIB
# This was previously a hard copy (not a symlink) performed by config.status
diff --git a/src/mpi/debugger/Makefile.mk b/src/mpi/debugger/Makefile.mk
index 4b38ab0..104793f 100644
--- a/src/mpi/debugger/Makefile.mk
+++ b/src/mpi/debugger/Makefile.mk
@@ -16,7 +16,7 @@ noinst_HEADERS += src/mpi/debugger/mpich_dll_defs.h
noinst_LTLIBRARIES += src/mpi/debugger/libdbginitdummy.la
src_mpi_debugger_libdbginitdummy_la_SOURCES = src/mpi/debugger/dbginit.c
src_mpi_debugger_libdbginitdummy_la_CFLAGS = -g
-lib_lib@MPILIBNAME@_la_LIBADD += $(top_builddir)/src/mpi/debugger/libdbginitdummy.la
+pmpi_convenience_libs += $(top_builddir)/src/mpi/debugger/libdbginitdummy.la
lib_LTLIBRARIES += lib/libtvmpich.la
# There is no static debugger interface library
diff --git a/src/util/logging/rlog/Makefile.mk b/src/util/logging/rlog/Makefile.mk
index 8f0f216..6f5473d 100644
--- a/src/util/logging/rlog/Makefile.mk
+++ b/src/util/logging/rlog/Makefile.mk
@@ -9,7 +9,7 @@
if BUILD_LOGGING_RLOG
lib_LTLIBRARIES += lib/librlogutil.la
-lib_lib@MPILIBNAME@_la_LIBADD += lib/librlogutil.la
+pmpi_convenience_libs += lib/librlogutil.la
lib_librlogutil_la_SOURCES = \
src/util/logging/rlog/rlog.c \
src/util/logging/rlog/rlogutil.c \
http://git.mpich.org/mpich.git/commitdiff/5661cf2b348626fa9db0ee7561f3f66a4…
commit 5661cf2b348626fa9db0ee7561f3f66a47b7fd8a
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Tue Apr 15 01:46:51 2014 -0500
Add an explicit application dependency on the profiling library.
We were not explicitly linking the application binaries to libpmpi
earlier. This works fine when the application uses the MPI_ symbols,
but not when the application uses the PMPI_ symbols. On mac, where a
separate profiling library is built, we were using -flat_namespace to
supress this issue. But on other platforms, without this flag, the
issue showed up when passing --disable-weak-symbols.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/env/mpicc.bash.in b/src/env/mpicc.bash.in
index 3b786c7..964ea4c 100644
--- a/src/env/mpicc.bash.in
+++ b/src/env/mpicc.bash.in
@@ -213,7 +213,7 @@ if [ -n "$profConf" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# -----------------------------------------------------------------------
@@ -244,7 +244,7 @@ if [ "$linking" = yes ] ; then
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
else
- $Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
+ $Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpicc.sh.in b/src/env/mpicc.sh.in
index 16b56d3..7af7dfa 100644
--- a/src/env/mpicc.sh.in
+++ b/src/env/mpicc.sh.in
@@ -222,7 +222,7 @@ if [ -n "$profConf" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# -----------------------------------------------------------------------
@@ -253,7 +253,7 @@ if [ "$linking" = yes ] ; then
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
rc=$?
else
- $Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
+ $Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpicxx.bash.in b/src/env/mpicxx.bash.in
index 8d6e0d9..f17bd31 100644
--- a/src/env/mpicxx.bash.in
+++ b/src/env/mpicxx.bash.in
@@ -219,7 +219,7 @@ if [ -n "$profConf" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# A temporary statement to invoke the compiler
@@ -242,7 +242,7 @@ if [ "$linking" = yes ] ; then
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
else
- $Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
+ $Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpicxx.sh.in b/src/env/mpicxx.sh.in
index a121386..d72d55b 100644
--- a/src/env/mpicxx.sh.in
+++ b/src/env/mpicxx.sh.in
@@ -228,7 +228,7 @@ if [ -n "$profConf" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# A temporary statement to invoke the compiler
@@ -251,7 +251,7 @@ if [ "$linking" = yes ] ; then
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
rc=$?
else
- $Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
+ $Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpif77.bash.in b/src/env/mpif77.bash.in
index b9d0430..c4b66c1 100644
--- a/src/env/mpif77.bash.in
+++ b/src/env/mpif77.bash.in
@@ -271,7 +271,7 @@ if [ -n "$profConf" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# A temporary statement to invoke the compiler
@@ -295,7 +295,7 @@ if [ "$linking" = yes ] ; then
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
else
- $Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
+ $Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpif77.sh.in b/src/env/mpif77.sh.in
index 8d815e4..f91f138 100644
--- a/src/env/mpif77.sh.in
+++ b/src/env/mpif77.sh.in
@@ -293,7 +293,7 @@ if [ -n "$profConf" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# A temporary statement to invoke the compiler
@@ -317,7 +317,7 @@ if [ "$linking" = yes ] ; then
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
rc=$?
else
- $Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
+ $Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpif90.bash.in b/src/env/mpif90.bash.in
index c14283b..7d0bcf7 100644
--- a/src/env/mpif90.bash.in
+++ b/src/env/mpif90.bash.in
@@ -314,7 +314,7 @@ elif [ -n "$FCMODINC" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# A temporary statement to invoke the compiler
@@ -339,7 +339,7 @@ if [ "$linking" = yes ] ; then
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}"
rc=$?
else
- $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
+ $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
rc=$?
fi
else
diff --git a/src/env/mpif90.sh.in b/src/env/mpif90.sh.in
index d27e2a6..e7e7962 100644
--- a/src/env/mpif90.sh.in
+++ b/src/env/mpif90.sh.in
@@ -331,7 +331,7 @@ elif [ -n "$FCMODINC" ] ; then
fi
if test "@INTERLIB_DEPS@" = "no" -o "$static_libs" = "yes" ; then
- extra_libs="@LPMPILIBNAME@ @WRAPPER_EXTRA_LIBS@"
+ extra_libs="@WRAPPER_EXTRA_LIBS@"
fi
# A temporary statement to invoke the compiler
@@ -355,7 +355,7 @@ if [ "$linking" = yes ] ; then
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ $allargs
rc=$?
else
- $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ $allargs $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
+ $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ $allargs $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $extra_libs $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
rc=$?
fi
else
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 1 +
Makefile.am | 51 ++++------
autogen.sh | 9 ++
src/env/mpicc.bash.in | 4 +-
src/env/mpicc.sh.in | 4 +-
src/env/mpicxx.bash.in | 4 +-
src/env/mpicxx.sh.in | 4 +-
src/env/mpif77.bash.in | 4 +-
src/env/mpif77.sh.in | 4 +-
src/env/mpif90.bash.in | 4 +-
src/env/mpif90.sh.in | 4 +-
src/glue/romio/Makefile.mk | 1 +
src/glue/romio/all_romio_symbols | 205 +++++++++++++++++++++++++++++++++++++
src/mpi/Makefile.mk | 5 +-
src/mpi/debugger/Makefile.mk | 2 +-
src/util/logging/rlog/Makefile.mk | 2 +-
16 files changed, 256 insertions(+), 52 deletions(-)
create mode 100755 src/glue/romio/all_romio_symbols
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-153-g59afcee
by noreply@mpich.org 14 Apr '14
by noreply@mpich.org 14 Apr '14
14 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 59afcee791229fa9293ac1aba1d1b2fd02537b30 (commit)
from d7de532de5e6a24217fe34005552c165f1f8ee2c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/59afcee791229fa9293ac1aba1d1b2fd0…
commit 59afcee791229fa9293ac1aba1d1b2fd02537b30
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Mon Apr 14 15:53:32 2014 -0500
correct validation of MPI_Info handle
MPIR_ERRTEST_ARGNULL is incorrect for validating an MPI_Info
handle, since MPI_INFO_NULL is not defined as 0. This updates the
test in MPI_Comm_set_info to match the one in MPI_Win_set_info.
Patch originally from thakur(a)mcs.anl.gov
diff --git a/src/mpi/comm/comm_set_info.c b/src/mpi/comm/comm_set_info.c
index 5afbc61..18df251 100644
--- a/src/mpi/comm/comm_set_info.c
+++ b/src/mpi/comm/comm_set_info.c
@@ -109,7 +109,7 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPIR_ERRTEST_ARGNULL(info, "info", mpi_errno);
+ MPIR_ERRTEST_INFO(info, mpi_errno);
}
MPID_END_ERROR_CHECKS;
}
-----------------------------------------------------------------------
Summary of changes:
src/mpi/comm/comm_set_info.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-152-gd7de532
by noreply@mpich.org 14 Apr '14
by noreply@mpich.org 14 Apr '14
14 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via d7de532de5e6a24217fe34005552c165f1f8ee2c (commit)
via c0b1427748378f0469f42232cdcf58b32db11c2b (commit)
via 74a3e759e004e87a00212fbefa2d3d7455174ebf (commit)
from b9ce079a6621faed2a8ac560af2fd8e0ab09a242 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/d7de532de5e6a24217fe34005552c165f…
commit d7de532de5e6a24217fe34005552c165f1f8ee2c
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Apr 14 13:40:34 2014 +0000
Bugfix: detected any fs as gpfs
if GPFS enabled, we were declaring all file systems GPFS. This holdover
from the old BlueGene-specific days does not belong here.
Signed-off-by: Paul Coffman <pkcoff(a)us.ibm.com>
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index e492b9f..f3f59e2 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -351,9 +351,10 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#ifdef ROMIO_GPFS
-
- *fstype = ADIO_GPFS;
- return;
+ if (fsbuf.f_type == GPFS_SUPER_MAGIC) {
+ *fstype = ADIO_GPFS;
+ return;
+ }
#endif
/* FPRINTF(stderr, "%d\n", fsbuf.f_type);*/
http://git.mpich.org/mpich.git/commitdiff/c0b1427748378f0469f42232cdcf58b32…
commit c0b1427748378f0469f42232cdcf58b32db11c2b
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Apr 14 13:38:50 2014 +0000
more comments for crazy ROMIO multi-platform stat
20 years of portability workarounds make for quite a tangle. Only one
of the four methods is ever used in practice now. Provide comments
about the older approaches and indicate which one we expect to be the
common case.
Signed-off-by: Paul Coffman <pkcoff(a)us.ibm.com>
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index cabf82d..e492b9f 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -253,6 +253,7 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
*error_code = MPI_SUCCESS;
#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
+ /* rare: old solaris machines */
retry_cnt=0;
do {
err = statvfs(filename, &vfsbuf);
@@ -311,6 +312,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif /* STATVFS APPROACH */
#if defined(HAVE_STRUCT_STATFS) && defined(HAVE_STATFS)
+ /* common automagic fs-detection logic for any modern POSX-compliant
+ * environment */
retry_cnt = 0;
do {
err = statfs(filename, &fsbuf);
@@ -339,6 +342,7 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
/* --END ERROR HANDLING-- */
# ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME
+ /* uncommon: maybe only on Darwin ? */
if ( !strncmp("nfs",fsbuf.f_fstypename,3) ) {
*fstype = ADIO_NFS;
return;
@@ -425,6 +429,7 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
#endif /* STATFS APPROACH */
#ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE
+ /* rare: maybe old NEC SX or SGI IRIX machines */
retry_cnt = 0;
do {
err = stat(filename, &sbuf);
http://git.mpich.org/mpich.git/commitdiff/74a3e759e004e87a00212fbefa2d3d745…
commit 74a3e759e004e87a00212fbefa2d3d7455174ebf
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Apr 14 13:36:56 2014 +0000
clean up stray declrations of GPFS_SUPER_MAGIC
only ad_fstype.c uses GPFS_SUPER_MAGIC now. Also, GPFS_SUPER_MAGIC is
properly provided by gpfs.h, but we can fall back to old way of
declaring it ourselves if gpfs.h is not around.
Signed-off-by: Paul Coffman <pkcoff(a)us.ibm.com>
diff --git a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.h b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.h
index e5b666e..4d0b0da 100644
--- a/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.h
+++ b/src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.h
@@ -19,9 +19,6 @@
#include "adio.h"
#include <sys/stat.h>
-#if !defined(GPFS_SUPER_MAGIC)
- #define GPFS_SUPER_MAGIC (0x47504653)
-#endif
/* overriding ADIOI_Calc_file_domains() to apply 'aligned file domain partitioning'. */
void ADIOI_GPFS_Calc_file_domains(ADIO_File fd,
diff --git a/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.h b/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.h
index cdd0497..d6baaed 100644
--- a/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.h
+++ b/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.h
@@ -20,9 +20,6 @@
#include "adio.h"
#include <sys/stat.h>
-#if !defined(GPFS_SUPER_MAGIC)
- #define GPFS_SUPER_MAGIC (0x47504653)
-#endif
/* generate a list of I/O aggregators that utilizes BG-PSET orginization. */
int ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset);
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index 26ad614..cabf82d 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -30,6 +30,10 @@
#include "zoidfs.h"
#endif
+#ifdef HAVE_GPFS_H
+#include "gpfs.h"
+#endif
+
/* Notes on detection process:
*
* There are three more "general" mechanisms that we use for detecting
@@ -74,6 +78,10 @@
#define PVFS2_SUPER_MAGIC (0x20030528)
#endif
+#if defined(ROMIO_GPFS) && !defined(GPFS_SUPER_MAGIC)
+# define GPFS_SUPER_MAGIC 0x47504653
+#endif
+
#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE
# ifdef HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/ad_gpfs/ad_gpfs_aggrs.h | 3 ---
src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.h | 3 ---
src/mpi/romio/adio/common/ad_fstype.c | 20 +++++++++++++++++---
3 files changed, 17 insertions(+), 9 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-149-gb9ce079
by noreply@mpich.org 11 Apr '14
by noreply@mpich.org 11 Apr '14
11 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via b9ce079a6621faed2a8ac560af2fd8e0ab09a242 (commit)
via fcdd7785beed5ea77c9641498784a6c543805b91 (commit)
via 8996387dd487b5c9fa6610c1c5f3fed1cd790c05 (commit)
via e824524f679bef5237c7336aa10f3681d5166149 (commit)
via 136e2e5ac70d018908e553f4d1f31c182247ccb6 (commit)
via 37e06c1cff6474c307ea037109d039d6dcf9a6f6 (commit)
via 46d51d517c3dd1e225acf7c09f8211f3775ca03f (commit)
from ba2493db4f8afd10507cce3a61c1a44764f0fcae (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/b9ce079a6621faed2a8ac560af2fd8e0a…
commit b9ce079a6621faed2a8ac560af2fd8e0ab09a242
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Wed Mar 12 15:06:23 2014 -0500
Fix compiler warning about missing fncn prototype
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index a3a5c31..099e76d 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -1217,6 +1217,9 @@ int MPIDI_Win_sync(MPID_Win *win);
void *MPIDI_Alloc_mem(size_t size, MPID_Info *info_ptr);
int MPIDI_Free_mem(void *ptr);
+/* Pvars */
+void MPIDI_CH3_RMA_Init_Pvars(void);
+
/* internal */
int MPIDI_CH3I_Release_lock(MPID_Win * win_ptr);
int MPIDI_CH3I_Try_acquire_win_lock(MPID_Win * win_ptr, int requested_lock);
diff --git a/src/mpid/ch3/src/ch3u_rma_acc_ops.c b/src/mpid/ch3/src/ch3u_rma_acc_ops.c
index eafa2ee..b0b5e54 100644
--- a/src/mpid/ch3/src/ch3u_rma_acc_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_acc_ops.c
@@ -8,7 +8,6 @@
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
-extern void MPIDI_CH3_RMA_Init_Pvars(void);
#undef FUNCNAME
#define FUNCNAME MPIDI_Get_accumulate
diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c
index e45fddd..f30c464 100644
--- a/src/mpid/ch3/src/ch3u_rma_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_ops.c
@@ -10,7 +10,6 @@ static int enableShortACC=1;
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
-extern void MPIDI_CH3_RMA_Init_Pvars(void);
#define MPIDI_PASSIVE_TARGET_DONE_TAG 348297
#define MPIDI_PASSIVE_TARGET_RMA_TAG 563924
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index 8183a71..caaebe6 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -16,8 +16,6 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_winfree_complete);
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
-extern void MPIDI_CH3_RMA_Init_Pvars(void);
-
static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
MPID_Comm *comm_ptr, MPID_Win **win_ptr);
http://git.mpich.org/mpich.git/commitdiff/fcdd7785beed5ea77c9641498784a6c54…
commit fcdd7785beed5ea77c9641498784a6c543805b91
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Tue Jan 21 16:04:54 2014 -0600
Compiler complains about uninitialized variable
Fixes compiler warnings in ch3u_rma_ops.c and ch3u_rma_acc_ops.c. Complains
were about "orig_vc" and "target_vc" of potentially being unused. This is a
false positive, as the conditional statements were correct. Warning fixed by just
initializing the pointers to NULL. gcc 4.6.3 complained in stomp, whereas gcc
4.7.4 did not on my laptop.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_rma_acc_ops.c b/src/mpid/ch3/src/ch3u_rma_acc_ops.c
index cc5ec8f..eafa2ee 100644
--- a/src/mpid/ch3/src/ch3u_rma_acc_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_acc_ops.c
@@ -25,7 +25,7 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
int dt_contig ATTRIBUTE((unused));
MPI_Aint dt_true_lb ATTRIBUTE((unused));
MPID_Datatype *dtp;
- MPIDI_VC_t *orig_vc, *target_vc;
+ MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET_ACCUMULATE);
@@ -140,7 +140,7 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
{
int mpi_errno = MPI_SUCCESS;
int rank;
- MPIDI_VC_t *orig_vc, *target_vc;
+ MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_COMPARE_AND_SWAP);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_COMPARE_AND_SWAP);
@@ -233,7 +233,7 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
{
int mpi_errno = MPI_SUCCESS;
int rank;
- MPIDI_VC_t *orig_vc, *target_vc;
+ MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_FETCH_AND_OP);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_FETCH_AND_OP);
diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c
index eda8201..e45fddd 100644
--- a/src/mpid/ch3/src/ch3u_rma_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_ops.c
@@ -122,7 +122,7 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
MPID_Datatype *dtp;
MPI_Aint dt_true_lb ATTRIBUTE((unused));
MPIDI_msg_sz_t data_sz;
- MPIDI_VC_t *orig_vc, *target_vc;
+ MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_PUT);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_PUT);
@@ -234,7 +234,7 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
int dt_contig ATTRIBUTE((unused)), rank;
MPI_Aint dt_true_lb ATTRIBUTE((unused));
MPID_Datatype *dtp;
- MPIDI_VC_t *orig_vc, *target_vc;
+ MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET);
@@ -344,7 +344,7 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
int dt_contig ATTRIBUTE((unused)), rank;
MPI_Aint dt_true_lb ATTRIBUTE((unused));
MPID_Datatype *dtp;
- MPIDI_VC_t *orig_vc, *target_vc;
+ MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_ACCUMULATE);
http://git.mpich.org/mpich.git/commitdiff/8996387dd487b5c9fa6610c1c5f3fed1c…
commit 8996387dd487b5c9fa6610c1c5f3fed1cd790c05
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Tue Jan 21 15:26:58 2014 -0600
Fix Intel compiler warnings in fdebug.c
Those were related to pragma weak alias without previous external definitions.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/binding/fortran/mpif_h/fdebug.c b/src/binding/fortran/mpif_h/fdebug.c
index 8171eb1..811d893 100644
--- a/src/binding/fortran/mpif_h/fdebug.c
+++ b/src/binding/fortran/mpif_h/fdebug.c
@@ -19,6 +19,28 @@ void mpir_is_statuses_ignore_( void *a, int *ierr );
void mpir_is_errcodes_ignore_( void *a, int *ierr );
void mpir_is_argvs_null_( void *a, int *ierr );
+extern void MPIR_IS_BOTTOM( void *a, int *ierr );
+extern void mpir_is_bottom( void *a, int *ierr );
+extern void mpir_is_bottom__( void *a, int *ierr );
+extern void MPIR_IS_IN_PLACE( void *a, int *ierr );
+extern void mpir_is_in_place( void *a, int *ierr );
+extern void mpir_is_in_place__( void *a, int *ierr );
+extern void MPIR_IS_UNWEIGHTED( void *a, int *ierr );
+extern void mpir_is_unweighted( void *a, int *ierr );
+extern void mpir_is_unweighted__( void *a, int *ierr );
+extern void MPIR_IS_STATUS_IGNORE( void *a, int *ierr );
+extern void mpir_is_status_ignore( void *a, int *ierr );
+extern void mpir_is_status_ignore__( void *a, int *ierr );
+extern void MPIR_IS_STATUSES_IGNORE( void *a, int *ierr );
+extern void mpir_is_statuses_ignore( void *a, int *ierr );
+extern void mpir_is_statuses_ignore__( void *a, int *ierr );
+extern void MPIR_IS_ERRCODES_IGNORE( void *a, int *ierr );
+extern void mpir_is_errcodes_ignore( void *a, int *ierr );
+extern void mpir_is_errcodes_ignore__( void *a, int *ierr );
+extern void MPIR_IS_ARGVS_NULL( void *a, int *ierr );
+extern void mpir_is_argvs_null( void *a, int *ierr );
+extern void mpir_is_argvs_null__( void *a, int *ierr );
+
#pragma weak MPIR_IS_BOTTOM = mpir_is_bottom_
#pragma weak mpir_is_bottom = mpir_is_bottom_
#pragma weak mpir_is_bottom__ = mpir_is_bottom_
http://git.mpich.org/mpich.git/commitdiff/e824524f679bef5237c7336aa10f3681d…
commit e824524f679bef5237c7336aa10f3681d5166149
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Tue Jan 21 14:34:52 2014 -0600
Fix incorrect declaration of string pointer
Fixes complain by icc
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/debugger/dll_mpich.c b/src/mpi/debugger/dll_mpich.c
index 526399e..d4cb084 100644
--- a/src/mpi/debugger/dll_mpich.c
+++ b/src/mpi/debugger/dll_mpich.c
@@ -956,7 +956,7 @@ static int rebuild_communicator_list (mqs_process *proc)
int send_ctx = fetch_int16 (proc, comm_base+i_info->comm_context_id_offs, p_info);
communicator_t *old = find_communicator (p_info, comm_base, recv_ctx);
- char *name = (char *)"--unnamed--";
+ const char *name = "--unnamed--";
char namebuffer[64];
/* In MPICH, the name is preallocated and of size MPI_MAX_OBJECT_NAME */
if (dbgr_fetch_data( proc, comm_base+i_info->comm_name_offs,64,
http://git.mpich.org/mpich.git/commitdiff/136e2e5ac70d018908e553f4d1f31c182…
commit 136e2e5ac70d018908e553f4d1f31c182247ccb6
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Tue Jan 21 14:29:06 2014 -0600
Fixed obsolete string format conversion
Complained by icc
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/ad_read_coll.c b/src/mpi/romio/adio/common/ad_read_coll.c
index 0eb8d90..35090a4 100644
--- a/src/mpi/romio/adio/common/ad_read_coll.c
+++ b/src/mpi/romio/adio/common/ad_read_coll.c
@@ -361,7 +361,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype
int ii;
DBG_FPRINTF(stderr, "flattened %3lld : ", flat_file->count );
for (ii=0; ii<flat_file->count; ii++) {
- DBG_FPRINTF(stderr, "%16qd:%-16qd", flat_file->indices[ii], flat_file->blocklens[ii] );
+ DBG_FPRINTF(stderr, "%16lld:%-16lld", flat_file->indices[ii], flat_file->blocklens[ii] );
}
DBG_FPRINTF(stderr, "\n" );
}
http://git.mpich.org/mpich.git/commitdiff/37e06c1cff6474c307ea037109d039d6d…
commit 37e06c1cff6474c307ea037109d039d6dcf9a6f6
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Mon Jan 20 17:19:47 2014 -0600
Linker warning multiple common of 'HYD_pmcd_pmip'
The variable is declared as external in pmip.h, but defined in three
different files. The linker warns that it's actually merging them. If we
want to use an only variable declared as 'extern', it should be only
defined in one place. This commit removes two out of the three
declarations. See #1966.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/pm/hydra/pm/pmiserv/pmip_cb.c b/src/pm/hydra/pm/pmiserv/pmip_cb.c
index 6880df8..906fdcd 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_cb.c
@@ -12,7 +12,6 @@
#include "topo.h"
#include "hydt_ftb.h"
-struct HYD_pmcd_pmip HYD_pmcd_pmip;
struct HYD_pmcd_pmip_pmi_handle *HYD_pmcd_pmip_pmi_handle = { 0 };
static int pmi_storage_len = 0;
diff --git a/src/pm/hydra/pm/pmiserv/pmip_utils.c b/src/pm/hydra/pm/pmiserv/pmip_utils.c
index bfac58f..e1fa33a 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_utils.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_utils.c
@@ -11,7 +11,6 @@
#include "demux.h"
#include "hydra.h"
-struct HYD_pmcd_pmip HYD_pmcd_pmip;
void HYD_pmcd_pmip_send_signal(int sig)
{
http://git.mpich.org/mpich.git/commitdiff/46d51d517c3dd1e225acf7c09f8211f37…
commit 46d51d517c3dd1e225acf7c09f8211f3775ca03f
Author: Antonio J. Pena <apenya(a)mcs.anl.gov>
Date: Mon Jan 20 16:12:44 2014 -0600
Fix compilation warning in bcast.c
Fixes the following warning when --enable-fast is enabled:
src/mpi/coll/bcast.c:1012:23: warning: suggest braces around empty body
in an 'if' statement [-Wempty-body]
See #1966.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index ce3be85..59e0396 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -1008,8 +1008,9 @@ static int MPIR_SMP_Bcast(
MPI_Status status;
int recvd_size;
- if (!MPIR_CVAR_ENABLE_SMP_COLLECTIVES || !MPIR_CVAR_ENABLE_SMP_BCAST)
+ if (!MPIR_CVAR_ENABLE_SMP_COLLECTIVES || !MPIR_CVAR_ENABLE_SMP_BCAST) {
MPIU_Assert(0);
+ }
MPIU_Assert(MPIR_Comm_is_node_aware(comm_ptr));
is_homogeneous = 1;
-----------------------------------------------------------------------
Summary of changes:
src/binding/fortran/mpif_h/fdebug.c | 22 ++++++++++++++++++++++
src/mpi/coll/bcast.c | 3 ++-
src/mpi/debugger/dll_mpich.c | 2 +-
src/mpi/romio/adio/common/ad_read_coll.c | 2 +-
src/mpid/ch3/include/mpidimpl.h | 3 +++
src/mpid/ch3/src/ch3u_rma_acc_ops.c | 7 +++----
src/mpid/ch3/src/ch3u_rma_ops.c | 7 +++----
src/mpid/ch3/src/mpid_rma.c | 2 --
src/pm/hydra/pm/pmiserv/pmip_cb.c | 1 -
src/pm/hydra/pm/pmiserv/pmip_utils.c | 1 -
10 files changed, 35 insertions(+), 15 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-142-gba2493d
by noreply@mpich.org 10 Apr '14
by noreply@mpich.org 10 Apr '14
10 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via ba2493db4f8afd10507cce3a61c1a44764f0fcae (commit)
via 688689c3efe2701c1789d95ffb03c952dc447202 (commit)
from 4d106d4b77560638cfae0c6b98259376d1394dbd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/ba2493db4f8afd10507cce3a61c1a4476…
commit ba2493db4f8afd10507cce3a61c1a44764f0fcae
Author: Wesley Bland <wbland(a)mcs.anl.gov>
Date: Wed Jan 22 11:06:01 2014 -0600
Add the universe check to the fortran spawn tests
This adds the same checks as the previous commit to the fortran tests. For the
most part, the F77 tests are copied over to the F90 tests so little was added
to the F90 directory.
Fixes #1699
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/test/mpi/f77/spawn/spawnargvf.f b/test/mpi/f77/spawn/spawnargvf.f
index edfbad0..7eea404 100644
--- a/test/mpi/f77/spawn/spawnargvf.f
+++ b/test/mpi/f77/spawn/spawnargvf.f
@@ -22,6 +22,7 @@ C implicit none
data inargv /"a", "b=c", "d e", "-pf", " Ss", " " /
data outargv /"a", "b=c", "d e", "-pf", " Ss", " " /
integer ierr
+ integer can_spawn
errs = 0
np = 2
@@ -29,6 +30,12 @@ C implicit none
call MTest_Init( ierr )
+ call MTestSpawnPossible( can_spawn, errs )
+ if ( can_spawn .eq. 0 ) then
+ call MTest_Finalize( errs )
+ goto 300
+ endif
+
call MPI_Comm_get_parent( parentcomm, ierr )
if (parentcomm .eq. MPI_COMM_NULL) then
@@ -115,5 +122,6 @@ C Note that the MTest_Finalize get errs only over COMM_WORLD
call MTest_Finalize( errs )
endif
+ 300 continue
call MPI_Finalize( ierr )
end
diff --git a/test/mpi/f77/spawn/spawnf.f b/test/mpi/f77/spawn/spawnf.f
index 0aef2fd..138bf60 100644
--- a/test/mpi/f77/spawn/spawnf.f
+++ b/test/mpi/f77/spawn/spawnf.f
@@ -13,12 +13,19 @@ C
integer parentcomm, intercomm
integer status(MPI_STATUS_SIZE)
integer ierr
+ integer can_spawn
errs = 0
np = 2
call MTest_Init( ierr )
+ call MTestSpawnPossible( can_spawn, errs )
+ if ( can_spawn .eq. 0 ) then
+ call MTest_Finalize( errs )
+ goto 300
+ endif
+
call MPI_Comm_get_parent( parentcomm, ierr )
if (parentcomm .eq. MPI_COMM_NULL) then
@@ -87,5 +94,6 @@ C Errors" if both call MTest_Finalize
call MTest_Finalize( errs )
endif
+ 300 continue
call MPI_Finalize( ierr )
end
diff --git a/test/mpi/f77/spawn/spawnmult2f.f b/test/mpi/f77/spawn/spawnmult2f.f
index 6ecd4c2..e8d1f00 100644
--- a/test/mpi/f77/spawn/spawnmult2f.f
+++ b/test/mpi/f77/spawn/spawnmult2f.f
@@ -22,10 +22,18 @@ C
integer appnum
logical flag
integer ierr
+ integer can_spawn
+
errs = 0
call MTest_Init( ierr )
+ call MTestSpawnPossible( can_spawn, errs )
+ if ( can_spawn .eq. 0 ) then
+ call MTest_Finalize( errs )
+ goto 300
+ endif
+
call MPI_Comm_get_parent( parentcomm, ierr )
if (parentcomm .eq. MPI_COMM_NULL) then
@@ -121,5 +129,6 @@ C Note that the MTest_Finalize get errs only over COMM_WORLD
call MTest_Finalize( errs )
endif
+ 300 continue
call MPI_Finalize( ierr )
end
diff --git a/test/mpi/f77/spawn/spawnmultf.f b/test/mpi/f77/spawn/spawnmultf.f
index f8ed9f4..353b64a 100644
--- a/test/mpi/f77/spawn/spawnmultf.f
+++ b/test/mpi/f77/spawn/spawnmultf.f
@@ -24,6 +24,7 @@ C implicit none
character*(80) argv(64)
integer argc
integer ierr
+ integer can_spawn
C
C Arguments are stored by rows, not columns in the vector.
C We write the data in a way that looks like the transpose,
@@ -45,6 +46,12 @@ C since Fortran stores by column
call MTest_Init( ierr )
+ call MTestSpawnPossible( can_spawn, errs )
+ if ( can_spawn .eq. 0 ) then
+ call MTest_Finalize( errs )
+ goto 300
+ endif
+
call MPI_Comm_get_parent( parentcomm, ierr )
if (parentcomm .eq. MPI_COMM_NULL) then
@@ -143,5 +150,6 @@ C Note that the MTest_Finalize get errs only over COMM_WORLD
call MTest_Finalize( errs )
endif
+ 300 continue
call MPI_Finalize( ierr )
end
diff --git a/test/mpi/f77/util/mtestf.f b/test/mpi/f77/util/mtestf.f
index 81edc25..9286464 100644
--- a/test/mpi/f77/util/mtestf.f
+++ b/test/mpi/f77/util/mtestf.f
@@ -111,3 +111,43 @@ C
print *, msg, ": Error class ", errclass, "
$ (", string(1:slen), ")"
end
+
+ subroutine MTestSpawnPossible( can_spawn, errs )
+ implicit none
+ include 'mpif.h'
+ integer can_spawn
+ integer errs
+ integer val, ierror
+ logical flag
+ integer comm_size
+
+ call mpi_comm_get_attr( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, val,
+ & flag, ierror )
+ if ( ierror .ne. MPI_SUCCESS ) then
+C MPI_UNIVERSE_SIZE keyval missing from MPI_COMM_WORLD attributes
+ can_spawn = -1
+ errs = errs + 1
+ else
+ if ( flag ) then
+ comm_size = -1
+
+ call mpi_comm_size( MPI_COMM_WORLD, comm_size, ierror )
+ if ( ierror .ne. MPI_SUCCESS ) then
+C MPI_COMM_SIZE failed for MPI_COMM_WORLD
+ can_spawn = -1
+ errs = errs + 1
+ return
+ endif
+
+ if ( val .le. comm_size ) then
+C no additional processes can be spawned
+ can_spawn = 0
+ else
+ can_spawn = 1
+ endif
+ else
+C No attribute associated with key MPI_UNIVERSE_SIZE of MPI_COMM_WORLD
+ can_spawn = -1
+ endif
+ endif
+ end
diff --git a/test/mpi/f90/spawn/spawnargvf03.f90 b/test/mpi/f90/spawn/spawnargvf03.f90
index 7f35990..24a0481 100644
--- a/test/mpi/f90/spawn/spawnargvf03.f90
+++ b/test/mpi/f90/spawn/spawnargvf03.f90
@@ -21,6 +21,8 @@
data inargv /"a", "b=c", "d e", "-pf", " Ss", " " /
data outargv /"a", "b=c", "d e", "-pf", " Ss", " " /
integer ierr
+ integer comm_size
+ integer can_spawn
errs = 0
np = 2
@@ -28,6 +30,12 @@
call MTest_Init( ierr )
+ call MTestSpawnPossible( can_spawn, errs )
+ if ( can_spawn .eq. 0 ) then
+ call MTest_Finalize( errs )
+ goto 300
+ endif
+
call MPI_Comm_get_parent( parentcomm, ierr )
if (parentcomm .eq. MPI_COMM_NULL) then
@@ -114,5 +122,6 @@
call MTest_Finalize( errs )
endif
+ 300 continue
call MPI_Finalize( ierr )
end
diff --git a/test/mpi/f90/spawn/spawnmultf03.f90 b/test/mpi/f90/spawn/spawnmultf03.f90
index a97f446..e381a9b 100644
--- a/test/mpi/f90/spawn/spawnmultf03.f90
+++ b/test/mpi/f90/spawn/spawnmultf03.f90
@@ -21,6 +21,7 @@
character*(80) argv(64)
integer argc
integer ierr
+ integer can_spawn
!
! Arguments are stored by rows, not columns in the vector.
! We write the data in a way that looks like the transpose,
@@ -42,6 +43,12 @@
call MTest_Init( ierr )
+ call MTestSpawnPossible( can_spawn, errs )
+ if ( can_spawn .eq. 0 ) then
+ call MTest_Finalize( errs )
+ goto 300
+ endif
+
call MPI_Comm_get_parent( parentcomm, ierr )
if (parentcomm .eq. MPI_COMM_NULL) then
@@ -140,5 +147,6 @@
call MTest_Finalize( errs )
endif
+ 300 continue
call MPI_Finalize( ierr )
end
http://git.mpich.org/mpich.git/commitdiff/688689c3efe2701c1789d95ffb03c952d…
commit 688689c3efe2701c1789d95ffb03c952dc447202
Author: Wesley Bland <wbland(a)mcs.anl.gov>
Date: Tue Jan 21 15:56:33 2014 -0600
Adds universe check to C spawn tests
The test suite assumes that it is running on a system where
MPI_COMM_SPAWN(_MULTIPLE) is possible. This isn't true on all systems and thus
prevents the test suite from being useful everywhere.
This check (contributed by Jeff H. - jhammond(a)alcf.anl.gov) looks to see if
the MPI_COMM_WORLD attribute MPI_UNIVERSE_SIZE is available and actually
greater than the size of MPI_COMM_WORLD.
If the spawn tests will fail because spawning is not possible on the system
(whether because the universe size is too small or spawning is not supported),
the tests will return success (unless there was some error in the detection
process).
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 056e333..292033a 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -68,6 +68,8 @@ const char *MTestGetIntracommName( void );
const char *MTestGetIntercommName( void );
void MTestFreeComm( MPI_Comm * );
+int MTestSpawnPossible( int * );
+
#ifdef HAVE_MPI_WIN_CREATE
int MTestGetWin( MPI_Win *, int );
const char *MTestGetWinName( void );
diff --git a/test/mpi/include/mpitestcxx.h b/test/mpi/include/mpitestcxx.h
index 57d15c2..32d3131 100644
--- a/test/mpi/include/mpitestcxx.h
+++ b/test/mpi/include/mpitestcxx.h
@@ -56,6 +56,8 @@ const char *MTestGetIntracommName( void );
const char *MTestGetIntercommName( void );
void MTestFreeComm( MPI::Comm &comm );
+int MTestSpawnPossible( int * );
+
#ifdef HAVE_MPI_WIN_CREATE
int MTestGetWin( MPI::Win &, bool );
const char *MTestGetWinName( void );
diff --git a/test/mpi/spawn/concurrent_spawns.c b/test/mpi/spawn/concurrent_spawns.c
index df82b13..389e517 100644
--- a/test/mpi/spawn/concurrent_spawns.c
+++ b/test/mpi/spawn/concurrent_spawns.c
@@ -47,6 +47,7 @@ int main(int argc, char *argv[])
MPI_Status status;
int verbose = 0;
char *env;
+ int can_spawn;
env = getenv("MPITEST_VERBOSE");
if (env)
@@ -57,75 +58,81 @@ int main(int argc, char *argv[])
MTest_Init( &argc, &argv );
- /* Set the num_spawns for the first process to MAX_NUM_SPAWNS */
- MPI_Comm_get_parent( &parentcomm );
- if (parentcomm == MPI_COMM_NULL)
- {
- num_spawns = MAX_NUM_SPAWNS;
- }
-
- /* If an argument is passed in use it for num_spawns */
- /* This is the case for all spawned processes and optionally the first
- process as well */
- if (argc > 1)
- {
- num_spawns = atoi(argv[1]);
- if (num_spawns < 0)
- num_spawns = 0;
- if (num_spawns > MAX_NUM_SPAWNS)
- num_spawns = MAX_NUM_SPAWNS;
- }
-
- /* Send num_spawns - 1 on the command line to the spawned children */
- sprintf(child_spawns, "%d", num_spawns-1 > 0 ? num_spawns-1 : 0);
-
- /* Spawn the children */
- IF_VERBOSE(("spawning %d\n", num_spawns));
- for (i=0; i<num_spawns; i++)
- {
- if (argc > 2)
- {
- sprintf(description, "%s:%d", argv[2], i);
- }
- else
- {
- sprintf(description, "%d", i);
- }
- IF_VERBOSE(("spawning %s\n", description));
- MPI_Comm_spawn((char*)"./concurrent_spawns", argv1, 1,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm[i], MPI_ERRCODES_IGNORE);
-
- MPI_Comm_remote_size(intercomm[i], &rsize);
- MPI_Comm_size(intercomm[i], &size);
- if (rsize != 1)
- {
- errs++;
- printf("Did not create 1 process (got %d)\n", rsize);
- fflush(stdout);
- }
- }
-
- /* Receive the error count from each of your children and add it to your
- error count */
- for (i=0; i<num_spawns; i++)
- {
- MPI_Recv(&child_errs, 1, MPI_INT, 0, 0, intercomm[i], &status);
- errs += child_errs;
- MPI_Comm_disconnect( &intercomm[i] );
- }
-
- /* If you are a spawned process send your errors to your parent */
- if (parentcomm != MPI_COMM_NULL)
- {
- MPI_Send(&errs, 1, MPI_INT, 0, 0, parentcomm);
- MPI_Comm_disconnect( &parentcomm );
- }
- else {
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ /* Set the num_spawns for the first process to MAX_NUM_SPAWNS */
+ MPI_Comm_get_parent( &parentcomm );
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ num_spawns = MAX_NUM_SPAWNS;
+ }
+
+ /* If an argument is passed in use it for num_spawns */
+ /* This is the case for all spawned processes and optionally the first
+ process as well */
+ if (argc > 1)
+ {
+ num_spawns = atoi(argv[1]);
+ if (num_spawns < 0)
+ num_spawns = 0;
+ if (num_spawns > MAX_NUM_SPAWNS)
+ num_spawns = MAX_NUM_SPAWNS;
+ }
+
+ /* Send num_spawns - 1 on the command line to the spawned children */
+ sprintf(child_spawns, "%d", num_spawns-1 > 0 ? num_spawns-1 : 0);
+
+ /* Spawn the children */
+ IF_VERBOSE(("spawning %d\n", num_spawns));
+ for (i=0; i<num_spawns; i++)
+ {
+ if (argc > 2)
+ {
+ sprintf(description, "%s:%d", argv[2], i);
+ }
+ else
+ {
+ sprintf(description, "%d", i);
+ }
+ IF_VERBOSE(("spawning %s\n", description));
+ MPI_Comm_spawn((char*)"./concurrent_spawns", argv1, 1,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm[i], MPI_ERRCODES_IGNORE);
+
+ MPI_Comm_remote_size(intercomm[i], &rsize);
+ MPI_Comm_size(intercomm[i], &size);
+ if (rsize != 1)
+ {
+ errs++;
+ printf("Did not create 1 process (got %d)\n", rsize);
+ fflush(stdout);
+ }
+ }
+
+ /* Receive the error count from each of your children and add it to your
+ error count */
+ for (i=0; i<num_spawns; i++)
+ {
+ MPI_Recv(&child_errs, 1, MPI_INT, 0, 0, intercomm[i], &status);
+ errs += child_errs;
+ MPI_Comm_disconnect( &intercomm[i] );
+ }
+
+ /* If you are a spawned process send your errors to your parent */
+ if (parentcomm != MPI_COMM_NULL)
+ {
+ MPI_Send(&errs, 1, MPI_INT, 0, 0, parentcomm);
+ MPI_Comm_disconnect( &parentcomm );
+ }
+ else {
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
IF_VERBOSE(("calling finalize\n"));
diff --git a/test/mpi/spawn/disconnect.c b/test/mpi/spawn/disconnect.c
index 64682f6..47aadc7 100644
--- a/test/mpi/spawn/disconnect.c
+++ b/test/mpi/spawn/disconnect.c
@@ -29,6 +29,7 @@ int main(int argc, char *argv[])
MPI_Comm parentcomm, intercomm;
int verbose = 0;
char *env;
+ int can_spawn;
env = getenv("MPITEST_VERBOSE");
if (env)
@@ -39,75 +40,81 @@ int main(int argc, char *argv[])
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
+ errs += MTestSpawnPossible(&can_spawn);
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("spawning %d processes\n", np));
- /* Create 3 more processes */
- MPI_Comm_spawn((char*)"./disconnect", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, MPI_ERRCODES_IGNORE);
- }
- else
- {
- intercomm = parentcomm;
- }
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
- /* We now have a valid intercomm */
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("spawning %d processes\n", np));
+ /* Create 3 more processes */
+ MPI_Comm_spawn((char*)"./disconnect", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, MPI_ERRCODES_IGNORE);
+ }
+ else
+ {
+ intercomm = parentcomm;
+ }
- MPI_Comm_remote_size(intercomm, &rsize);
- MPI_Comm_size(intercomm, &size);
- MPI_Comm_rank(intercomm, &rank);
+ /* We now have a valid intercomm */
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("parent rank %d alive.\n", rank));
- /* Parent */
- if (rsize != np)
- {
- errs++;
- printf("Did not create %d processes (got %d)\n", np, rsize);
- fflush(stdout);
- }
- IF_VERBOSE(("disconnecting child communicator\n"));
- MPI_Comm_disconnect(&intercomm);
-
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the children
- for (i=0; i<rsize; i++)
- {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- */
- }
- else
- {
- IF_VERBOSE(("child rank %d alive.\n", rank));
- /* Child */
- if (size != np)
- {
- errs++;
- printf("(Child) Did not create %d processes (got %d)\n", np, size);
- fflush(stdout);
- }
-
- IF_VERBOSE(("disconnecting communicator\n"));
- MPI_Comm_disconnect(&intercomm);
-
- /* Send the errs back to the master process */
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the parent */
- /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
- }
+ MPI_Comm_remote_size(intercomm, &rsize);
+ MPI_Comm_size(intercomm, &size);
+ MPI_Comm_rank(intercomm, &rank);
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL)
- {
- MTest_Finalize( errs );
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("parent rank %d alive.\n", rank));
+ /* Parent */
+ if (rsize != np)
+ {
+ errs++;
+ printf("Did not create %d processes (got %d)\n", np, rsize);
+ fflush(stdout);
+ }
+ IF_VERBOSE(("disconnecting child communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the children
+ for (i=0; i<rsize; i++)
+ {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ */
+ }
+ else
+ {
+ IF_VERBOSE(("child rank %d alive.\n", rank));
+ /* Child */
+ if (size != np)
+ {
+ errs++;
+ printf("(Child) Did not create %d processes (got %d)\n", np, size);
+ fflush(stdout);
+ }
+
+ IF_VERBOSE(("disconnecting communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+
+ /* Send the errs back to the master process */
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the parent */
+ /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
+ }
+
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
IF_VERBOSE(("calling finalize\n"));
diff --git a/test/mpi/spawn/disconnect2.c b/test/mpi/spawn/disconnect2.c
index 55a289c..d8259c4 100644
--- a/test/mpi/spawn/disconnect2.c
+++ b/test/mpi/spawn/disconnect2.c
@@ -34,6 +34,7 @@ int main(int argc, char *argv[])
MPI_Status status;
int verbose = 0;
char *env;
+ int can_spawn;
env = getenv("MPITEST_VERBOSE");
if (env)
@@ -44,102 +45,108 @@ int main(int argc, char *argv[])
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("spawning %d processes\n", np));
- /* Create 3 more processes */
- MPI_Comm_spawn((char*)"./disconnect2", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, MPI_ERRCODES_IGNORE);
- }
- else
- {
- intercomm = parentcomm;
- }
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size(intercomm, &rsize);
- MPI_Comm_size(intercomm, &size);
- MPI_Comm_rank(intercomm, &rank);
-
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("parent rank %d alive.\n", rank));
- /* Parent */
- if (rsize != np)
- {
- errs++;
- printf("Did not create %d processes (got %d)\n", np, rsize);
- fflush(stdout);
- }
- if (rank == SENDER_RANK)
- {
- IF_VERBOSE(("sending int\n"));
- i = DATA_VALUE;
- MPI_Send(&i, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm);
- MPI_Recv(&data, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm,
- &status);
- if (data != i)
- {
- errs++;
- }
- }
- IF_VERBOSE(("disconnecting child communicator\n"));
- MPI_Comm_disconnect(&intercomm);
-
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the children
- for (i=0; i<rsize; i++)
- {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- */
- }
- else
- {
- IF_VERBOSE(("child rank %d alive.\n", rank));
- /* Child */
- if (size != np)
- {
- errs++;
- printf("(Child) Did not create %d processes (got %d)\n", np, size);
- fflush(stdout);
- }
-
- if (rank == RECEIVER_RANK)
- {
- IF_VERBOSE(("receiving int\n"));
- i = -1;
- MPI_Recv(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm, &status);
- if (i != DATA_VALUE)
- {
- errs++;
- printf("expected %d but received %d\n", DATA_VALUE, i);
- fflush(stdout);
- MPI_Abort(intercomm, 1);
- }
- MPI_Send(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm);
- }
-
- IF_VERBOSE(("disconnecting communicator\n"));
- MPI_Comm_disconnect(&intercomm);
-
- /* Send the errs back to the master process */
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the parent */
- /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
- }
-
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL)
- {
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("spawning %d processes\n", np));
+ /* Create 3 more processes */
+ MPI_Comm_spawn((char*)"./disconnect2", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, MPI_ERRCODES_IGNORE);
+ }
+ else
+ {
+ intercomm = parentcomm;
+ }
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size(intercomm, &rsize);
+ MPI_Comm_size(intercomm, &size);
+ MPI_Comm_rank(intercomm, &rank);
+
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("parent rank %d alive.\n", rank));
+ /* Parent */
+ if (rsize != np)
+ {
+ errs++;
+ printf("Did not create %d processes (got %d)\n", np, rsize);
+ fflush(stdout);
+ }
+ if (rank == SENDER_RANK)
+ {
+ IF_VERBOSE(("sending int\n"));
+ i = DATA_VALUE;
+ MPI_Send(&i, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm);
+ MPI_Recv(&data, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm,
+ &status);
+ if (data != i)
+ {
+ errs++;
+ }
+ }
+ IF_VERBOSE(("disconnecting child communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the children
+ for (i=0; i<rsize; i++)
+ {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ */
+ }
+ else
+ {
+ IF_VERBOSE(("child rank %d alive.\n", rank));
+ /* Child */
+ if (size != np)
+ {
+ errs++;
+ printf("(Child) Did not create %d processes (got %d)\n", np, size);
+ fflush(stdout);
+ }
+
+ if (rank == RECEIVER_RANK)
+ {
+ IF_VERBOSE(("receiving int\n"));
+ i = -1;
+ MPI_Recv(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm, &status);
+ if (i != DATA_VALUE)
+ {
+ errs++;
+ printf("expected %d but received %d\n", DATA_VALUE, i);
+ fflush(stdout);
+ MPI_Abort(intercomm, 1);
+ }
+ MPI_Send(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm);
+ }
+
+ IF_VERBOSE(("disconnecting communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+
+ /* Send the errs back to the master process */
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the parent */
+ /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
+ }
+
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
IF_VERBOSE(("calling finalize\n"));
diff --git a/test/mpi/spawn/disconnect3.c b/test/mpi/spawn/disconnect3.c
index 7025d33..c4d6c92 100644
--- a/test/mpi/spawn/disconnect3.c
+++ b/test/mpi/spawn/disconnect3.c
@@ -34,6 +34,7 @@ int main(int argc, char *argv[])
MPI_Status status;
int verbose = 0;
char *env;
+ int can_spawn;
env = getenv("MPITEST_VERBOSE");
if (env)
@@ -44,102 +45,108 @@ int main(int argc, char *argv[])
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("spawning %d processes\n", np));
- /* Create 3 more processes */
- MPI_Comm_spawn((char*)"./disconnect3", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, MPI_ERRCODES_IGNORE);
- }
- else
- {
- intercomm = parentcomm;
- }
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size(intercomm, &rsize);
- MPI_Comm_size(intercomm, &size);
- MPI_Comm_rank(intercomm, &rank);
-
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("parent rank %d alive.\n", rank));
- /* Parent */
- if (rsize != np)
- {
- errs++;
- printf("Did not create %d processes (got %d)\n", np, rsize);
- fflush(stdout);
- }
- if (rank == SENDER_RANK)
- {
- IF_VERBOSE(("sending int\n"));
- i = DATA_VALUE;
- MPI_Send(&i, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm);
- MPI_Recv(&data, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm,
- &status);
- if (data != i)
- {
- errs++;
- }
- }
- IF_VERBOSE(("disconnecting child communicator\n"));
- MPI_Comm_disconnect(&intercomm);
-
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the children
- for (i=0; i<rsize; i++)
- {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- */
- }
- else
- {
- IF_VERBOSE(("child rank %d alive.\n", rank));
- /* Child */
- if (size != np)
- {
- errs++;
- printf("(Child) Did not create %d processes (got %d)\n", np, size);
- fflush(stdout);
- }
-
- if (rank == RECEIVER_RANK)
- {
- IF_VERBOSE(("receiving int\n"));
- i = -1;
- MPI_Recv(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm, &status);
- if (i != DATA_VALUE)
- {
- errs++;
- printf("expected %d but received %d\n", DATA_VALUE, i);
- fflush(stdout);
- MPI_Abort(intercomm, 1);
- }
- MPI_Send(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm);
- }
-
- IF_VERBOSE(("disconnecting communicator\n"));
- MPI_Comm_disconnect(&intercomm);
-
- /* Send the errs back to the master process */
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the parent */
- /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
- }
-
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL)
- {
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("spawning %d processes\n", np));
+ /* Create 3 more processes */
+ MPI_Comm_spawn((char*)"./disconnect3", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, MPI_ERRCODES_IGNORE);
+ }
+ else
+ {
+ intercomm = parentcomm;
+ }
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size(intercomm, &rsize);
+ MPI_Comm_size(intercomm, &size);
+ MPI_Comm_rank(intercomm, &rank);
+
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("parent rank %d alive.\n", rank));
+ /* Parent */
+ if (rsize != np)
+ {
+ errs++;
+ printf("Did not create %d processes (got %d)\n", np, rsize);
+ fflush(stdout);
+ }
+ if (rank == SENDER_RANK)
+ {
+ IF_VERBOSE(("sending int\n"));
+ i = DATA_VALUE;
+ MPI_Send(&i, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm);
+ MPI_Recv(&data, 1, MPI_INT, RECEIVER_RANK, DATA_TAG, intercomm,
+ &status);
+ if (data != i)
+ {
+ errs++;
+ }
+ }
+ IF_VERBOSE(("disconnecting child communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the children
+ for (i=0; i<rsize; i++)
+ {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ */
+ }
+ else
+ {
+ IF_VERBOSE(("child rank %d alive.\n", rank));
+ /* Child */
+ if (size != np)
+ {
+ errs++;
+ printf("(Child) Did not create %d processes (got %d)\n", np, size);
+ fflush(stdout);
+ }
+
+ if (rank == RECEIVER_RANK)
+ {
+ IF_VERBOSE(("receiving int\n"));
+ i = -1;
+ MPI_Recv(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm, &status);
+ if (i != DATA_VALUE)
+ {
+ errs++;
+ printf("expected %d but received %d\n", DATA_VALUE, i);
+ fflush(stdout);
+ MPI_Abort(intercomm, 1);
+ }
+ MPI_Send(&i, 1, MPI_INT, SENDER_RANK, DATA_TAG, intercomm);
+ }
+
+ IF_VERBOSE(("disconnecting communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+
+ /* Send the errs back to the master process */
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the parent */
+ /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
+ }
+
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
IF_VERBOSE(("calling finalize\n"));
diff --git a/test/mpi/spawn/disconnect_reconnect.c b/test/mpi/spawn/disconnect_reconnect.c
index eafe841..c827563 100644
--- a/test/mpi/spawn/disconnect_reconnect.c
+++ b/test/mpi/spawn/disconnect_reconnect.c
@@ -32,6 +32,7 @@ int main(int argc, char *argv[])
int verbose = 0;
int do_messages = 1;
char *env;
+ int can_spawn;
env = getenv("MPITEST_VERBOSE");
if (env)
@@ -42,146 +43,152 @@ int main(int argc, char *argv[])
MTest_Init( &argc, &argv );
- /* FIXME: Document arguments */
- if (argc > 1) {
- num_loops = atoi(argv[1]);
- if (num_loops < 0)
- num_loops = 0;
- if (num_loops > 100)
- num_loops = 100;
- }
- if (argc > 2)
- {
- do_messages = atoi(argv[2]);
- }
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL)
- {
- MPI_Comm_rank( MPI_COMM_WORLD, &rank ); /* Get rank for verbose msg */
- IF_VERBOSE(("[%d] spawning %d processes\n", rank, np));
- /* Create 3 more processes */
- MPI_Comm_spawn((char*)"./disconnect_reconnect",
- /*MPI_ARGV_NULL*/&argv[1], np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, MPI_ERRCODES_IGNORE);
- }
- else
- {
- intercomm = parentcomm;
- }
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size(intercomm, &rsize);
- MPI_Comm_size(intercomm, &size);
- MPI_Comm_rank(intercomm, &rank);
-
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("[%d] parent rank %d alive.\n", rank, rank));
- /* Parent */
- if (rsize != np)
- {
- errs++;
- printf("Did not create %d processes (got %d)\n", np, rsize);
- fflush(stdout);
- }
- if (rank == 0 && num_loops > 0)
- {
- MPI_Open_port(MPI_INFO_NULL, port);
- IF_VERBOSE(("[%d] port = %s\n", rank, port));
- MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, intercomm);
- }
- IF_VERBOSE(("[%d] disconnecting child communicator\n",rank));
- MPI_Comm_disconnect(&intercomm);
- for (i=0; i<num_loops; i++)
- {
- IF_VERBOSE(("[%d] accepting connection\n",rank));
- MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm);
- MPI_Comm_remote_size(intercomm, &rsize);
- if (do_messages && (rank == 0))
- {
- j = 0;
- for (j=0; j<rsize; j++)
- {
- data = i;
- IF_VERBOSE(("[%d]sending int to child process %d\n", rank, j));
- MPI_Send(&data, 1, MPI_INT, j, 100, intercomm);
- IF_VERBOSE(("[%d] receiving int from child process %d\n", rank, j));
- data = i-1;
- MPI_Recv(&data, 1, MPI_INT, j, 100, intercomm, &status);
- if (data != i)
- {
- errs++;
- }
- }
- }
- IF_VERBOSE(("[%d] disconnecting communicator\n", rank));
- MPI_Comm_disconnect(&intercomm);
- }
-
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the children
- for (i=0; i<rsize; i++)
- {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- */
- }
- else
- {
- IF_VERBOSE(("[%d] child rank %d alive.\n", rank, rank));
- /* Child */
- if (size != np)
- {
- errs++;
- printf("(Child) Did not create %d processes (got %d)\n", np, size);
- fflush(stdout);
- }
-
- if (rank == 0 && num_loops > 0)
- {
- IF_VERBOSE(("[%d] receiving port\n", rank));
- MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, intercomm, &status);
- }
-
- IF_VERBOSE(("[%d] disconnecting communicator\n", rank));
- MPI_Comm_disconnect(&intercomm);
- for (i=0; i<num_loops; i++)
- {
- IF_VERBOSE(("[%d] connecting to port (loop %d)\n",rank,i));
- MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm);
- if (do_messages)
- {
- IF_VERBOSE(("[%d] receiving int from parent process 0\n",rank));
- MPI_Recv(&data, 1, MPI_INT, 0, 100, intercomm, &status);
- if (data != i)
- {
- printf("expected %d but received %d\n", i, data);
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- IF_VERBOSE(("[%d] sending int back to parent process 1\n",rank));
- MPI_Send(&data, 1, MPI_INT, 0, 100, intercomm);
- }
- IF_VERBOSE(("[%d] disconnecting communicator\n",rank));
- MPI_Comm_disconnect(&intercomm);
- }
-
- /* Send the errs back to the master process */
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the parent */
- /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
- }
-
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL)
- {
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ /* FIXME: Document arguments */
+ if (argc > 1) {
+ num_loops = atoi(argv[1]);
+ if (num_loops < 0)
+ num_loops = 0;
+ if (num_loops > 100)
+ num_loops = 100;
+ }
+ if (argc > 2)
+ {
+ do_messages = atoi(argv[2]);
+ }
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ MPI_Comm_rank( MPI_COMM_WORLD, &rank ); /* Get rank for verbose msg */
+ IF_VERBOSE(("[%d] spawning %d processes\n", rank, np));
+ /* Create 3 more processes */
+ MPI_Comm_spawn((char*)"./disconnect_reconnect",
+ /*MPI_ARGV_NULL*/&argv[1], np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, MPI_ERRCODES_IGNORE);
+ }
+ else
+ {
+ intercomm = parentcomm;
+ }
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size(intercomm, &rsize);
+ MPI_Comm_size(intercomm, &size);
+ MPI_Comm_rank(intercomm, &rank);
+
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("[%d] parent rank %d alive.\n", rank, rank));
+ /* Parent */
+ if (rsize != np)
+ {
+ errs++;
+ printf("Did not create %d processes (got %d)\n", np, rsize);
+ fflush(stdout);
+ }
+ if (rank == 0 && num_loops > 0)
+ {
+ MPI_Open_port(MPI_INFO_NULL, port);
+ IF_VERBOSE(("[%d] port = %s\n", rank, port));
+ MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, intercomm);
+ }
+ IF_VERBOSE(("[%d] disconnecting child communicator\n",rank));
+ MPI_Comm_disconnect(&intercomm);
+ for (i=0; i<num_loops; i++)
+ {
+ IF_VERBOSE(("[%d] accepting connection\n",rank));
+ MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm);
+ MPI_Comm_remote_size(intercomm, &rsize);
+ if (do_messages && (rank == 0))
+ {
+ j = 0;
+ for (j=0; j<rsize; j++)
+ {
+ data = i;
+ IF_VERBOSE(("[%d]sending int to child process %d\n", rank, j));
+ MPI_Send(&data, 1, MPI_INT, j, 100, intercomm);
+ IF_VERBOSE(("[%d] receiving int from child process %d\n", rank, j));
+ data = i-1;
+ MPI_Recv(&data, 1, MPI_INT, j, 100, intercomm, &status);
+ if (data != i)
+ {
+ errs++;
+ }
+ }
+ }
+ IF_VERBOSE(("[%d] disconnecting communicator\n", rank));
+ MPI_Comm_disconnect(&intercomm);
+ }
+
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the children
+ for (i=0; i<rsize; i++)
+ {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ */
+ }
+ else
+ {
+ IF_VERBOSE(("[%d] child rank %d alive.\n", rank, rank));
+ /* Child */
+ if (size != np)
+ {
+ errs++;
+ printf("(Child) Did not create %d processes (got %d)\n", np, size);
+ fflush(stdout);
+ }
+
+ if (rank == 0 && num_loops > 0)
+ {
+ IF_VERBOSE(("[%d] receiving port\n", rank));
+ MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, intercomm, &status);
+ }
+
+ IF_VERBOSE(("[%d] disconnecting communicator\n", rank));
+ MPI_Comm_disconnect(&intercomm);
+ for (i=0; i<num_loops; i++)
+ {
+ IF_VERBOSE(("[%d] connecting to port (loop %d)\n",rank,i));
+ MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm);
+ if (do_messages)
+ {
+ IF_VERBOSE(("[%d] receiving int from parent process 0\n",rank));
+ MPI_Recv(&data, 1, MPI_INT, 0, 100, intercomm, &status);
+ if (data != i)
+ {
+ printf("expected %d but received %d\n", i, data);
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ IF_VERBOSE(("[%d] sending int back to parent process 1\n",rank));
+ MPI_Send(&data, 1, MPI_INT, 0, 100, intercomm);
+ }
+ IF_VERBOSE(("[%d] disconnecting communicator\n",rank));
+ MPI_Comm_disconnect(&intercomm);
+ }
+
+ /* Send the errs back to the master process */
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the parent */
+ /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
+ }
+
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
IF_VERBOSE(("[%d] calling finalize\n",rank));
diff --git a/test/mpi/spawn/disconnect_reconnect2.c b/test/mpi/spawn/disconnect_reconnect2.c
index 7a98909..c23d667 100644
--- a/test/mpi/spawn/disconnect_reconnect2.c
+++ b/test/mpi/spawn/disconnect_reconnect2.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "mpitest.h"
/* Note: In this program, the return codes from the MPI routines are checked.
Since the error handlers for the communicators are not set to
@@ -49,6 +50,7 @@ int main(int argc, char *argv[])
int i, num_loops = 100;
int data;
int verbose = 0;
+ int can_spawn, errs = 0;
if (getenv("MPITEST_VERBOSE"))
{
@@ -59,197 +61,206 @@ int main(int argc, char *argv[])
error = MPI_Init(&argc, &argv);
check_error(error, "MPI_Init");
- IF_VERBOSE(("size.\n"));
- error = MPI_Comm_size(MPI_COMM_WORLD, &size);
- check_error(error, "MPI_Comm_size");
+ errs += MTestSpawnPossible(&can_spawn);
+ if (!can_spawn) {
+ if (errs)
+ printf( " Found %d errors\n", errs );
+ else
+ printf( " No Errors\n" );
+ fflush(stdout);
+ } else {
+ IF_VERBOSE(("size.\n"));
+ error = MPI_Comm_size(MPI_COMM_WORLD, &size);
+ check_error(error, "MPI_Comm_size");
- IF_VERBOSE(("rank.\n"));
- error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- check_error(error, "MPI_Comm_rank");
+ IF_VERBOSE(("rank.\n"));
+ error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ check_error(error, "MPI_Comm_rank");
- if (argc == 1)
- {
- /* Make sure that the current directory is in the path.
- Not all implementations may honor or understand this, but
- it is highly recommended as it gives users a clean way
- to specify the location of the executable without
- specifying a particular directory format (e.g., this
- should work with both Windows and Unix implementations) */
- MPI_Info_create( &spawn_path );
- MPI_Info_set( spawn_path, (char*)"path", (char*)"." );
+ if (argc == 1)
+ {
+ /* Make sure that the current directory is in the path.
+ Not all implementations may honor or understand this, but
+ it is highly recommended as it gives users a clean way
+ to specify the location of the executable without
+ specifying a particular directory format (e.g., this
+ should work with both Windows and Unix implementations) */
+ MPI_Info_create( &spawn_path );
+ MPI_Info_set( spawn_path, (char*)"path", (char*)"." );
- IF_VERBOSE(("spawn connector.\n"));
- error = MPI_Comm_spawn((char*)"disconnect_reconnect2",
- argv1, numprocs, spawn_path, 0,
- MPI_COMM_WORLD, &comm_connector,
- MPI_ERRCODES_IGNORE);
- check_error(error, "MPI_Comm_spawn");
+ IF_VERBOSE(("spawn connector.\n"));
+ error = MPI_Comm_spawn((char*)"disconnect_reconnect2",
+ argv1, numprocs, spawn_path, 0,
+ MPI_COMM_WORLD, &comm_connector,
+ MPI_ERRCODES_IGNORE);
+ check_error(error, "MPI_Comm_spawn");
- IF_VERBOSE(("spawn acceptor.\n"));
- error = MPI_Comm_spawn((char*)"disconnect_reconnect2",
- argv2, numprocs, spawn_path, 0,
- MPI_COMM_WORLD, &comm_acceptor,
- MPI_ERRCODES_IGNORE);
- check_error(error, "MPI_Comm_spawn");
- MPI_Info_free( &spawn_path );
+ IF_VERBOSE(("spawn acceptor.\n"));
+ error = MPI_Comm_spawn((char*)"disconnect_reconnect2",
+ argv2, numprocs, spawn_path, 0,
+ MPI_COMM_WORLD, &comm_acceptor,
+ MPI_ERRCODES_IGNORE);
+ check_error(error, "MPI_Comm_spawn");
+ MPI_Info_free( &spawn_path );
- if (rank == 0)
- {
- IF_VERBOSE(("recv port.\n"));
- error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_acceptor, &status);
- check_error(error, "MPI_Recv");
+ if (rank == 0)
+ {
+ IF_VERBOSE(("recv port.\n"));
+ error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_acceptor, &status);
+ check_error(error, "MPI_Recv");
- IF_VERBOSE(("send port.\n"));
- error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_connector);
- check_error(error, "MPI_Send");
- }
+ IF_VERBOSE(("send port.\n"));
+ error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_connector);
+ check_error(error, "MPI_Send");
+ }
- IF_VERBOSE(("barrier acceptor.\n"));
- error = MPI_Barrier(comm_acceptor);
- check_error(error, "MPI_Barrier");
+ IF_VERBOSE(("barrier acceptor.\n"));
+ error = MPI_Barrier(comm_acceptor);
+ check_error(error, "MPI_Barrier");
- IF_VERBOSE(("barrier connector.\n"));
- error = MPI_Barrier(comm_connector);
- check_error(error, "MPI_Barrier");
+ IF_VERBOSE(("barrier connector.\n"));
+ error = MPI_Barrier(comm_connector);
+ check_error(error, "MPI_Barrier");
- error = MPI_Comm_free(&comm_acceptor);
- check_error(error, "MPI_Comm_free");
- error = MPI_Comm_free(&comm_connector);
- check_error(error, "MPI_Comm_free");
+ error = MPI_Comm_free(&comm_acceptor);
+ check_error(error, "MPI_Comm_free");
+ error = MPI_Comm_free(&comm_connector);
+ check_error(error, "MPI_Comm_free");
- if (rank == 0)
- {
- printf(" No Errors\n");
- fflush(stdout);
- }
- }
- else if ((argc == 2) && (strcmp(argv[1], "acceptor") == 0))
- {
- IF_VERBOSE(("get_parent.\n"));
- error = MPI_Comm_get_parent(&comm_parent);
- check_error(error, "MPI_Comm_get_parent");
- if (comm_parent == MPI_COMM_NULL)
- {
- printf("acceptor's parent is NULL.\n");fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -1);
- }
- if (rank == 0)
- {
- IF_VERBOSE(("open_port.\n"));
- error = MPI_Open_port(MPI_INFO_NULL, port);
- check_error(error, "MPI_Open_port");
+ if (rank == 0)
+ {
+ printf(" No Errors\n");
+ fflush(stdout);
+ }
+ }
+ else if ((argc == 2) && (strcmp(argv[1], "acceptor") == 0))
+ {
+ IF_VERBOSE(("get_parent.\n"));
+ error = MPI_Comm_get_parent(&comm_parent);
+ check_error(error, "MPI_Comm_get_parent");
+ if (comm_parent == MPI_COMM_NULL)
+ {
+ printf("acceptor's parent is NULL.\n");fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -1);
+ }
+ if (rank == 0)
+ {
+ IF_VERBOSE(("open_port.\n"));
+ error = MPI_Open_port(MPI_INFO_NULL, port);
+ check_error(error, "MPI_Open_port");
- IF_VERBOSE(("0: opened port: <%s>\n", port));
- IF_VERBOSE(("send.\n"));
- error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, comm_parent);
- check_error(error, "MPI_Send");
- }
+ IF_VERBOSE(("0: opened port: <%s>\n", port));
+ IF_VERBOSE(("send.\n"));
+ error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, comm_parent);
+ check_error(error, "MPI_Send");
+ }
- for (i=0; i<num_loops; i++)
- {
- IF_VERBOSE(("accept.\n"));
- error = MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &comm);
- check_error(error, "MPI_Comm_accept");
+ for (i=0; i<num_loops; i++)
+ {
+ IF_VERBOSE(("accept.\n"));
+ error = MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &comm);
+ check_error(error, "MPI_Comm_accept");
- if (rank == 0)
- {
- data = i;
- error = MPI_Send(&data, 1, MPI_INT, 0, 0, comm);
- check_error(error, "MPI_Send");
- error = MPI_Recv(&data, 1, MPI_INT, 0, 0, comm, &status);
- check_error(error, "MPI_Recv");
- if (data != i)
- {
- printf("expected %d but received %d\n", i, data);
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
+ if (rank == 0)
+ {
+ data = i;
+ error = MPI_Send(&data, 1, MPI_INT, 0, 0, comm);
+ check_error(error, "MPI_Send");
+ error = MPI_Recv(&data, 1, MPI_INT, 0, 0, comm, &status);
+ check_error(error, "MPI_Recv");
+ if (data != i)
+ {
+ printf("expected %d but received %d\n", i, data);
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ }
- IF_VERBOSE(("disconnect.\n"));
- error = MPI_Comm_disconnect(&comm);
- check_error(error, "MPI_Comm_disconnect");
- }
+ IF_VERBOSE(("disconnect.\n"));
+ error = MPI_Comm_disconnect(&comm);
+ check_error(error, "MPI_Comm_disconnect");
+ }
- if (rank == 0)
- {
- IF_VERBOSE(("close_port.\n"));
- error = MPI_Close_port(port);
- check_error(error, "MPI_Close_port");
- }
+ if (rank == 0)
+ {
+ IF_VERBOSE(("close_port.\n"));
+ error = MPI_Close_port(port);
+ check_error(error, "MPI_Close_port");
+ }
- IF_VERBOSE(("barrier.\n"));
- error = MPI_Barrier(comm_parent);
- check_error(error, "MPI_Barrier");
+ IF_VERBOSE(("barrier.\n"));
+ error = MPI_Barrier(comm_parent);
+ check_error(error, "MPI_Barrier");
- MPI_Comm_free( &comm_parent );
- }
- else if ((argc == 2) && (strcmp(argv[1], "connector") == 0))
- {
- IF_VERBOSE(("get_parent.\n"));
- error = MPI_Comm_get_parent(&comm_parent);
- check_error(error, "MPI_Comm_get_parent");
- if (comm_parent == MPI_COMM_NULL)
- {
- printf("acceptor's parent is NULL.\n");fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -1);
- }
+ MPI_Comm_free( &comm_parent );
+ }
+ else if ((argc == 2) && (strcmp(argv[1], "connector") == 0))
+ {
+ IF_VERBOSE(("get_parent.\n"));
+ error = MPI_Comm_get_parent(&comm_parent);
+ check_error(error, "MPI_Comm_get_parent");
+ if (comm_parent == MPI_COMM_NULL)
+ {
+ printf("acceptor's parent is NULL.\n");fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -1);
+ }
- if (rank == 0)
- {
- IF_VERBOSE(("recv.\n"));
- error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_parent, &status);
- check_error(error, "MPI_Recv");
- IF_VERBOSE(("1: received port: <%s>\n", port));
- }
+ if (rank == 0)
+ {
+ IF_VERBOSE(("recv.\n"));
+ error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_parent, &status);
+ check_error(error, "MPI_Recv");
+ IF_VERBOSE(("1: received port: <%s>\n", port));
+ }
- for (i=0; i<num_loops; i++)
- {
- IF_VERBOSE(("connect.\n"));
- error = MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &comm);
- check_error(error, "MPI_Comm_connect");
+ for (i=0; i<num_loops; i++)
+ {
+ IF_VERBOSE(("connect.\n"));
+ error = MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &comm);
+ check_error(error, "MPI_Comm_connect");
- if (rank == 0)
- {
- data = -1;
- error = MPI_Recv(&data, 1, MPI_INT, 0, 0, comm, &status);
- check_error(error, "MPI_Recv");
- if (data != i)
- {
- printf("expected %d but received %d\n", i, data);
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- error = MPI_Send(&data, 1, MPI_INT, 0, 0, comm);
- check_error(error, "MPI_Send");
- }
+ if (rank == 0)
+ {
+ data = -1;
+ error = MPI_Recv(&data, 1, MPI_INT, 0, 0, comm, &status);
+ check_error(error, "MPI_Recv");
+ if (data != i)
+ {
+ printf("expected %d but received %d\n", i, data);
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ error = MPI_Send(&data, 1, MPI_INT, 0, 0, comm);
+ check_error(error, "MPI_Send");
+ }
- IF_VERBOSE(("disconnect.\n"));
- error = MPI_Comm_disconnect(&comm);
- check_error(error, "MPI_Comm_disconnect");
- }
+ IF_VERBOSE(("disconnect.\n"));
+ error = MPI_Comm_disconnect(&comm);
+ check_error(error, "MPI_Comm_disconnect");
+ }
- IF_VERBOSE(("barrier.\n"));
- error = MPI_Barrier(comm_parent);
- check_error(error, "MPI_Barrier");
+ IF_VERBOSE(("barrier.\n"));
+ error = MPI_Barrier(comm_parent);
+ check_error(error, "MPI_Barrier");
- MPI_Comm_free( &comm_parent );
- }
- else
- {
- printf("invalid command line.\n");fflush(stdout);
- {
- int ii;
- for (ii=0; ii<argc; ii++)
- {
- printf("argv[%d] = <%s>\n", ii, argv[ii]);
- }
- }
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -2);
+ MPI_Comm_free( &comm_parent );
+ }
+ else
+ {
+ printf("invalid command line.\n");fflush(stdout);
+ {
+ int ii;
+ for (ii=0; ii<argc; ii++)
+ {
+ printf("argv[%d] = <%s>\n", ii, argv[ii]);
+ }
+ }
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -2);
+ }
}
MPI_Finalize();
diff --git a/test/mpi/spawn/disconnect_reconnect3.c b/test/mpi/spawn/disconnect_reconnect3.c
index dcf44bd..6ef155c 100644
--- a/test/mpi/spawn/disconnect_reconnect3.c
+++ b/test/mpi/spawn/disconnect_reconnect3.c
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
int verbose = 0;
int do_messages = 1;
char *env;
+ int can_spawn;
env = getenv("MPITEST_VERBOSE");
if (env)
@@ -98,143 +99,148 @@ int main(int argc, char *argv[])
MTest_Init( &argc, &argv );
- /* command line arguments can change the number of loop iterations and
- whether or not messages are sent over the new communicators */
- if (argc > 1)
- {
- num_loops = atoi(argv[1]);
- if (num_loops < 0)
- num_loops = 0;
- if (num_loops > 100)
- num_loops = 100;
- }
- if (argc > 2)
- {
- do_messages = atoi(argv[2]);
- }
-
- /* Spawn the child processes and merge them into a single communicator */
- MPI_Comm_get_parent( &parentcomm );
- if (parentcomm == MPI_COMM_NULL)
- {
- IF_VERBOSE(("spawning %d processes\n", np));
- /* Create 4 more processes */
- MPI_Comm_spawn((char*)"./disconnect_reconnect3",
- /*MPI_ARGV_NULL*/&argv[1], np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, MPI_ERRCODES_IGNORE);
- MPI_Intercomm_merge(intercomm, 0, &intracomm);
- }
- else
- {
- intercomm = parentcomm;
- MPI_Intercomm_merge(intercomm, 1, &intracomm);
- }
-
- checkReverseMergedComm(intracomm);
-
- /* We now have a valid intracomm containing all processes */
-
- MPI_Comm_rank(intracomm, &rank);
-
- /* Split the communicator so that the even ranks are in one communicator
- and the odd ranks are in another */
- even_odd = rank % 2;
- MPI_Comm_split(intracomm, even_odd, rank, &comm);
-
- /* Open a port on rank zero of the even communicator */
- /* rank 0 on intracomm == rank 0 on even communicator */
- if (rank == 0)
- {
- MPI_Open_port(MPI_INFO_NULL, port);
- IF_VERBOSE(("port = %s\n", port));
- }
- /* Broadcast the port to everyone. This makes the logic easier than
- trying to figure out which process in the odd communicator to send it
- to */
- MPI_Bcast(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, intracomm);
-
- IF_VERBOSE(("disconnecting parent/child communicator\n"));
- MPI_Comm_disconnect(&intercomm);
- MPI_Comm_disconnect(&intracomm);
-
- MPI_Comm_rank(comm, &rank);
-
- if (!even_odd)
- {
- /* The even group does the accepting */
- for (i=0; i<num_loops; i++)
- {
- IF_VERBOSE(("accepting connection\n"));
- MPI_Comm_accept(port, MPI_INFO_NULL, 0, comm, &intercomm);
- MPI_Comm_remote_size(intercomm, &rsize);
- if (do_messages && (rank == 0))
- {
- j = 0;
- for (j=0; j<rsize; j++)
- {
- data = i;
- IF_VERBOSE(("sending int to odd_communicator process %d\n", j));
- MPI_Send(&data, 1, MPI_INT, j, 100, intercomm);
- IF_VERBOSE(("receiving int from odd_communicator process %d\n", j));
- data = i-1;
- MPI_Recv(&data, 1, MPI_INT, j, 100, intercomm, &status);
- if (data != i)
- {
- errs++;
- }
- }
- }
- IF_VERBOSE(("disconnecting communicator\n"));
- MPI_Comm_disconnect(&intercomm);
- }
-
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the children
- for (i=0; i<rsize; i++)
- {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- */
- }
- else
- {
- /* The odd group does the connecting */
- for (i=0; i<num_loops; i++)
- {
- IF_VERBOSE(("connecting to port\n"));
- MPI_Comm_connect(port, MPI_INFO_NULL, 0, comm, &intercomm);
- if (do_messages)
- {
- IF_VERBOSE(("receiving int from even_communicator process 0\n"));
- MPI_Recv(&data, 1, MPI_INT, 0, 100, intercomm, &status);
- if (data != i)
- {
- printf("expected %d but received %d\n", i, data);
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- IF_VERBOSE(("sending int back to even_communicator process 0\n"));
- MPI_Send(&data, 1, MPI_INT, 0, 100, intercomm);
- }
- IF_VERBOSE(("disconnecting communicator\n"));
- MPI_Comm_disconnect(&intercomm);
- }
-
- /* Send the errs back to the master process */
- /* Errors cannot be sent back to the parent because there is no
- communicator connected to the parent */
- /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
- }
-
- MPI_Comm_free( &comm );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL)
- {
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+ if (can_spawn) {
+ /* command line arguments can change the number of loop iterations and
+ whether or not messages are sent over the new communicators */
+ if (argc > 1)
+ {
+ num_loops = atoi(argv[1]);
+ if (num_loops < 0)
+ num_loops = 0;
+ if (num_loops > 100)
+ num_loops = 100;
+ }
+ if (argc > 2)
+ {
+ do_messages = atoi(argv[2]);
+ }
+
+ /* Spawn the child processes and merge them into a single communicator */
+ MPI_Comm_get_parent( &parentcomm );
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ IF_VERBOSE(("spawning %d processes\n", np));
+ /* Create 4 more processes */
+ MPI_Comm_spawn((char*)"./disconnect_reconnect3",
+ /*MPI_ARGV_NULL*/&argv[1], np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, MPI_ERRCODES_IGNORE);
+ MPI_Intercomm_merge(intercomm, 0, &intracomm);
+ }
+ else
+ {
+ intercomm = parentcomm;
+ MPI_Intercomm_merge(intercomm, 1, &intracomm);
+ }
+
+ checkReverseMergedComm(intracomm);
+
+ /* We now have a valid intracomm containing all processes */
+
+ MPI_Comm_rank(intracomm, &rank);
+
+ /* Split the communicator so that the even ranks are in one communicator
+ and the odd ranks are in another */
+ even_odd = rank % 2;
+ MPI_Comm_split(intracomm, even_odd, rank, &comm);
+
+ /* Open a port on rank zero of the even communicator */
+ /* rank 0 on intracomm == rank 0 on even communicator */
+ if (rank == 0)
+ {
+ MPI_Open_port(MPI_INFO_NULL, port);
+ IF_VERBOSE(("port = %s\n", port));
+ }
+ /* Broadcast the port to everyone. This makes the logic easier than
+ trying to figure out which process in the odd communicator to send it
+ to */
+ MPI_Bcast(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, intracomm);
+
+ IF_VERBOSE(("disconnecting parent/child communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+ MPI_Comm_disconnect(&intracomm);
+
+ MPI_Comm_rank(comm, &rank);
+
+ if (!even_odd)
+ {
+ /* The even group does the accepting */
+ for (i=0; i<num_loops; i++)
+ {
+ IF_VERBOSE(("accepting connection\n"));
+ MPI_Comm_accept(port, MPI_INFO_NULL, 0, comm, &intercomm);
+ MPI_Comm_remote_size(intercomm, &rsize);
+ if (do_messages && (rank == 0))
+ {
+ j = 0;
+ for (j=0; j<rsize; j++)
+ {
+ data = i;
+ IF_VERBOSE(("sending int to odd_communicator process %d\n", j));
+ MPI_Send(&data, 1, MPI_INT, j, 100, intercomm);
+ IF_VERBOSE(("receiving int from odd_communicator process %d\n", j));
+ data = i-1;
+ MPI_Recv(&data, 1, MPI_INT, j, 100, intercomm, &status);
+ if (data != i)
+ {
+ errs++;
+ }
+ }
+ }
+ IF_VERBOSE(("disconnecting communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+ }
+
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the children
+ for (i=0; i<rsize; i++)
+ {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ */
+ }
+ else
+ {
+ /* The odd group does the connecting */
+ for (i=0; i<num_loops; i++)
+ {
+ IF_VERBOSE(("connecting to port\n"));
+ MPI_Comm_connect(port, MPI_INFO_NULL, 0, comm, &intercomm);
+ if (do_messages)
+ {
+ IF_VERBOSE(("receiving int from even_communicator process 0\n"));
+ MPI_Recv(&data, 1, MPI_INT, 0, 100, intercomm, &status);
+ if (data != i)
+ {
+ printf("expected %d but received %d\n", i, data);
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ IF_VERBOSE(("sending int back to even_communicator process 0\n"));
+ MPI_Send(&data, 1, MPI_INT, 0, 100, intercomm);
+ }
+ IF_VERBOSE(("disconnecting communicator\n"));
+ MPI_Comm_disconnect(&intercomm);
+ }
+
+ /* Send the errs back to the master process */
+ /* Errors cannot be sent back to the parent because there is no
+ communicator connected to the parent */
+ /*MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );*/
+ }
+
+ MPI_Comm_free( &comm );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL)
+ {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
IF_VERBOSE(("calling finalize\n"));
diff --git a/test/mpi/spawn/spaconacc.c b/test/mpi/spawn/spaconacc.c
index 2763fa4..8fe6078 100644
--- a/test/mpi/spawn/spaconacc.c
+++ b/test/mpi/spawn/spaconacc.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "mpitest.h"
#define IF_VERBOSE(a) if (verbose) { printf a ; fflush(stdout); }
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
MPI_Status status;
MPI_Info spawn_path = MPI_INFO_NULL;
int verbose = 0;
+ int can_spawn, errs = 0;
if (getenv("MPITEST_VERBOSE"))
{
@@ -45,158 +47,167 @@ int main(int argc, char *argv[])
error = MPI_Init(&argc, &argv);
check_error(error, "MPI_Init");
- /* To improve reporting of problems about operations, we
- change the error handler to errors return */
- MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
- MPI_Comm_set_errhandler( MPI_COMM_SELF, MPI_ERRORS_RETURN );
-
- IF_VERBOSE(("size.\n"));
- error = MPI_Comm_size(MPI_COMM_WORLD, &size);
- check_error(error, "MPI_Comm_size");
-
- IF_VERBOSE(("rank.\n"));
- error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- check_error(error, "MPI_Comm_rank");
-
- if (argc == 1)
- {
- /* Make sure that the current directory is in the path.
- Not all implementations may honor or understand this, but
- it is highly recommended as it gives users a clean way
- to specify the location of the executable without
- specifying a particular directory format (e.g., this
- should work with both Windows and Unix implementations) */
- error = MPI_Info_create( &spawn_path );
- check_error( error, "MPI_Info_create" );
- error = MPI_Info_set( spawn_path, (char*)"path", (char*)"." );
- check_error( error, "MPI_Info_set" );
-
- IF_VERBOSE(("spawn connector.\n"));
- error = MPI_Comm_spawn((char*)"spaconacc", argv1, 1, spawn_path, 0,
- MPI_COMM_SELF, &comm_connector,
- MPI_ERRCODES_IGNORE);
- check_error(error, "MPI_Comm_spawn");
-
- IF_VERBOSE(("spawn acceptor.\n"));
- error = MPI_Comm_spawn((char*)"spaconacc", argv2, 1, spawn_path, 0,
- MPI_COMM_SELF, &comm_acceptor,
- MPI_ERRCODES_IGNORE);
- check_error(error, "MPI_Comm_spawn");
- error = MPI_Info_free( &spawn_path );
- check_error( error, "MPI_Info_free" );
-
- MPI_Comm_set_errhandler( comm_connector, MPI_ERRORS_RETURN );
- MPI_Comm_set_errhandler( comm_acceptor, MPI_ERRORS_RETURN );
-
- IF_VERBOSE(("recv port.\n"));
- error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_acceptor, &status);
- check_error(error, "MPI_Recv");
-
- IF_VERBOSE(("send port.\n"));
- error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_connector);
- check_error(error, "MPI_Send");
-
- IF_VERBOSE(("barrier acceptor.\n"));
- error = MPI_Barrier(comm_acceptor);
- check_error(error, "MPI_Barrier");
-
- IF_VERBOSE(("barrier connector.\n"));
- error = MPI_Barrier(comm_connector);
- check_error(error, "MPI_Barrier");
-
- error = MPI_Comm_free(&comm_acceptor);
- check_error(error, "MPI_Comm_free");
- error = MPI_Comm_free(&comm_connector);
- check_error(error, "MPI_Comm_free");
-
- printf(" No Errors\n");
- }
- else if ((argc == 2) && (strcmp(argv[1], "acceptor") == 0))
- {
- IF_VERBOSE(("get_parent.\n"));
- error = MPI_Comm_get_parent(&comm_parent);
- check_error(error, "MPI_Comm_get_parent");
- if (comm_parent == MPI_COMM_NULL)
- {
- printf("acceptor's parent is NULL.\n");fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -1);
- }
- IF_VERBOSE(("open_port.\n"));
- error = MPI_Open_port(MPI_INFO_NULL, port);
- check_error(error, "MPI_Open_port");
-
- MPI_Comm_set_errhandler( comm_parent, MPI_ERRORS_RETURN );
-
- IF_VERBOSE(("0: opened port: <%s>\n", port));
- IF_VERBOSE(("send.\n"));
- error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, comm_parent);
- check_error(error, "MPI_Send");
-
- IF_VERBOSE(("accept.\n"));
- error = MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
- check_error(error, "MPI_Comm_accept");
-
- IF_VERBOSE(("close_port.\n"));
- error = MPI_Close_port(port);
- check_error(error, "MPI_Close_port");
-
- IF_VERBOSE(("disconnect.\n"));
- error = MPI_Comm_disconnect(&comm);
- check_error(error, "MPI_Comm_disconnect");
-
- IF_VERBOSE(("barrier.\n"));
- error = MPI_Barrier(comm_parent);
- check_error(error, "MPI_Barrier");
-
- MPI_Comm_free( &comm_parent );
- }
- else if ((argc == 2) && (strcmp(argv[1], "connector") == 0))
- {
- IF_VERBOSE(("get_parent.\n"));
- error = MPI_Comm_get_parent(&comm_parent);
- check_error(error, "MPI_Comm_get_parent");
- if (comm_parent == MPI_COMM_NULL)
- {
- printf("acceptor's parent is NULL.\n");fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -1);
- }
-
- MPI_Comm_set_errhandler( comm_parent, MPI_ERRORS_RETURN );
- IF_VERBOSE(("recv.\n"));
- error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_parent, &status);
- check_error(error, "MPI_Recv");
-
- IF_VERBOSE(("1: received port: <%s>\n", port));
- IF_VERBOSE(("connect.\n"));
- error = MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
- check_error(error, "MPI_Comm_connect");
-
- MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
- IF_VERBOSE(("disconnect.\n"));
- error = MPI_Comm_disconnect(&comm);
- check_error(error, "MPI_Comm_disconnect");
-
- IF_VERBOSE(("barrier.\n"));
- error = MPI_Barrier(comm_parent);
- check_error(error, "MPI_Barrier");
-
- MPI_Comm_free( &comm_parent );
- }
- else
- {
- printf("invalid command line.\n");fflush(stdout);
- {
- int i;
- for (i=0; i<argc; i++)
- {
- printf("argv[%d] = <%s>\n", i, argv[i]);
- }
- }
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -2);
+ errs += MTestSpawnPossible(&can_spawn);
+ if (!can_spawn) {
+ if (errs)
+ printf( " Found %d errors\n", errs );
+ else
+ printf( " No Errors\n" );
+ fflush( stdout );
+ } else {
+ /* To improve reporting of problems about operations, we
+ change the error handler to errors return */
+ MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+ MPI_Comm_set_errhandler( MPI_COMM_SELF, MPI_ERRORS_RETURN );
+
+ IF_VERBOSE(("size.\n"));
+ error = MPI_Comm_size(MPI_COMM_WORLD, &size);
+ check_error(error, "MPI_Comm_size");
+
+ IF_VERBOSE(("rank.\n"));
+ error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ check_error(error, "MPI_Comm_rank");
+
+ if (argc == 1)
+ {
+ /* Make sure that the current directory is in the path.
+ Not all implementations may honor or understand this, but
+ it is highly recommended as it gives users a clean way
+ to specify the location of the executable without
+ specifying a particular directory format (e.g., this
+ should work with both Windows and Unix implementations) */
+ error = MPI_Info_create( &spawn_path );
+ check_error( error, "MPI_Info_create" );
+ error = MPI_Info_set( spawn_path, (char*)"path", (char*)"." );
+ check_error( error, "MPI_Info_set" );
+
+ IF_VERBOSE(("spawn connector.\n"));
+ error = MPI_Comm_spawn((char*)"spaconacc", argv1, 1, spawn_path, 0,
+ MPI_COMM_SELF, &comm_connector,
+ MPI_ERRCODES_IGNORE);
+ check_error(error, "MPI_Comm_spawn");
+
+ IF_VERBOSE(("spawn acceptor.\n"));
+ error = MPI_Comm_spawn((char*)"spaconacc", argv2, 1, spawn_path, 0,
+ MPI_COMM_SELF, &comm_acceptor,
+ MPI_ERRCODES_IGNORE);
+ check_error(error, "MPI_Comm_spawn");
+ error = MPI_Info_free( &spawn_path );
+ check_error( error, "MPI_Info_free" );
+
+ MPI_Comm_set_errhandler( comm_connector, MPI_ERRORS_RETURN );
+ MPI_Comm_set_errhandler( comm_acceptor, MPI_ERRORS_RETURN );
+
+ IF_VERBOSE(("recv port.\n"));
+ error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_acceptor, &status);
+ check_error(error, "MPI_Recv");
+
+ IF_VERBOSE(("send port.\n"));
+ error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_connector);
+ check_error(error, "MPI_Send");
+
+ IF_VERBOSE(("barrier acceptor.\n"));
+ error = MPI_Barrier(comm_acceptor);
+ check_error(error, "MPI_Barrier");
+
+ IF_VERBOSE(("barrier connector.\n"));
+ error = MPI_Barrier(comm_connector);
+ check_error(error, "MPI_Barrier");
+
+ error = MPI_Comm_free(&comm_acceptor);
+ check_error(error, "MPI_Comm_free");
+ error = MPI_Comm_free(&comm_connector);
+ check_error(error, "MPI_Comm_free");
+
+ printf(" No Errors\n");
+ }
+ else if ((argc == 2) && (strcmp(argv[1], "acceptor") == 0))
+ {
+ IF_VERBOSE(("get_parent.\n"));
+ error = MPI_Comm_get_parent(&comm_parent);
+ check_error(error, "MPI_Comm_get_parent");
+ if (comm_parent == MPI_COMM_NULL)
+ {
+ printf("acceptor's parent is NULL.\n");fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -1);
+ }
+ IF_VERBOSE(("open_port.\n"));
+ error = MPI_Open_port(MPI_INFO_NULL, port);
+ check_error(error, "MPI_Open_port");
+
+ MPI_Comm_set_errhandler( comm_parent, MPI_ERRORS_RETURN );
+
+ IF_VERBOSE(("0: opened port: <%s>\n", port));
+ IF_VERBOSE(("send.\n"));
+ error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, comm_parent);
+ check_error(error, "MPI_Send");
+
+ IF_VERBOSE(("accept.\n"));
+ error = MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
+ check_error(error, "MPI_Comm_accept");
+
+ IF_VERBOSE(("close_port.\n"));
+ error = MPI_Close_port(port);
+ check_error(error, "MPI_Close_port");
+
+ IF_VERBOSE(("disconnect.\n"));
+ error = MPI_Comm_disconnect(&comm);
+ check_error(error, "MPI_Comm_disconnect");
+
+ IF_VERBOSE(("barrier.\n"));
+ error = MPI_Barrier(comm_parent);
+ check_error(error, "MPI_Barrier");
+
+ MPI_Comm_free( &comm_parent );
+ }
+ else if ((argc == 2) && (strcmp(argv[1], "connector") == 0))
+ {
+ IF_VERBOSE(("get_parent.\n"));
+ error = MPI_Comm_get_parent(&comm_parent);
+ check_error(error, "MPI_Comm_get_parent");
+ if (comm_parent == MPI_COMM_NULL)
+ {
+ printf("acceptor's parent is NULL.\n");fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -1);
+ }
+
+ MPI_Comm_set_errhandler( comm_parent, MPI_ERRORS_RETURN );
+ IF_VERBOSE(("recv.\n"));
+ error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_parent, &status);
+ check_error(error, "MPI_Recv");
+
+ IF_VERBOSE(("1: received port: <%s>\n", port));
+ IF_VERBOSE(("connect.\n"));
+ error = MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
+ check_error(error, "MPI_Comm_connect");
+
+ MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+ IF_VERBOSE(("disconnect.\n"));
+ error = MPI_Comm_disconnect(&comm);
+ check_error(error, "MPI_Comm_disconnect");
+
+ IF_VERBOSE(("barrier.\n"));
+ error = MPI_Barrier(comm_parent);
+ check_error(error, "MPI_Barrier");
+
+ MPI_Comm_free( &comm_parent );
+ }
+ else
+ {
+ printf("invalid command line.\n");fflush(stdout);
+ {
+ int i;
+ for (i=0; i<argc; i++)
+ {
+ printf("argv[%d] = <%s>\n", i, argv[i]);
+ }
+ }
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -2);
+ }
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spaconacc2.c b/test/mpi/spawn/spaconacc2.c
index bc4a05b..d084c22 100644
--- a/test/mpi/spawn/spaconacc2.c
+++ b/test/mpi/spawn/spaconacc2.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "mpitest.h"
/* Note: In this program, the return codes from the MPI routines are checked.
Since the error handlers for the communicators are not set to
@@ -42,6 +43,7 @@ int main(int argc, char *argv[])
MPI_Status status;
MPI_Info spawn_path = MPI_INFO_NULL;
int verbose = 0;
+ int can_spawn, errs = 0;
if (getenv("MPITEST_VERBOSE"))
{
@@ -52,161 +54,170 @@ int main(int argc, char *argv[])
error = MPI_Init(&argc, &argv);
check_error(error, "MPI_Init");
- IF_VERBOSE(("size.\n"));
- error = MPI_Comm_size(MPI_COMM_WORLD, &size);
- check_error(error, "MPI_Comm_size");
-
- IF_VERBOSE(("rank.\n"));
- error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- check_error(error, "MPI_Comm_rank");
-
- if (argc == 1)
- {
- /* Make sure that the current directory is in the path.
- Not all implementations may honor or understand this, but
- it is highly recommended as it gives users a clean way
- to specify the location of the executable without
- specifying a particular directory format (e.g., this
- should work with both Windows and Unix implementations) */
- MPI_Info_create( &spawn_path );
- MPI_Info_set( spawn_path, (char*)"path", (char*)"." );
-
- IF_VERBOSE(("spawn connector.\n"));
- error = MPI_Comm_spawn((char*)"spaconacc2", argv1, 1, spawn_path, 0,
- MPI_COMM_SELF, &comm_connector,
- MPI_ERRCODES_IGNORE);
- check_error(error, "MPI_Comm_spawn");
-
- IF_VERBOSE(("spawn acceptor.\n"));
- error = MPI_Comm_spawn((char*)"spaconacc2", argv2, 1, spawn_path, 0,
- MPI_COMM_SELF, &comm_acceptor,
- MPI_ERRCODES_IGNORE);
- check_error(error, "MPI_Comm_spawn");
- MPI_Info_free( &spawn_path );
-
- IF_VERBOSE(("recv port.\n"));
- error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_acceptor, &status);
- check_error(error, "MPI_Recv");
-
- IF_VERBOSE(("send port.\n"));
- error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_connector);
- check_error(error, "MPI_Send");
-
- IF_VERBOSE(("barrier acceptor.\n"));
- error = MPI_Barrier(comm_acceptor);
- check_error(error, "MPI_Barrier");
-
- IF_VERBOSE(("barrier connector.\n"));
- error = MPI_Barrier(comm_connector);
- check_error(error, "MPI_Barrier");
-
- error = MPI_Comm_free(&comm_acceptor);
- check_error(error, "MPI_Comm_free");
- error = MPI_Comm_free(&comm_connector);
- check_error(error, "MPI_Comm_free");
-
- printf(" No Errors\n");
- }
- else if ((argc == 2) && (strcmp(argv[1], "acceptor") == 0))
- {
- IF_VERBOSE(("get_parent.\n"));
- error = MPI_Comm_get_parent(&comm_parent);
- check_error(error, "MPI_Comm_get_parent");
- if (comm_parent == MPI_COMM_NULL)
- {
- printf("acceptor's parent is NULL.\n");fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -1);
- }
- IF_VERBOSE(("open_port.\n"));
- error = MPI_Open_port(MPI_INFO_NULL, port);
- check_error(error, "MPI_Open_port");
-
- IF_VERBOSE(("0: opened port: <%s>\n", port));
- IF_VERBOSE(("send.\n"));
- error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, comm_parent);
- check_error(error, "MPI_Send");
-
- IF_VERBOSE(("accept.\n"));
- error = MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
- check_error(error, "MPI_Comm_accept");
-
- IF_VERBOSE(("close_port.\n"));
- error = MPI_Close_port(port);
- check_error(error, "MPI_Close_port");
-
- /* Send some data before disconnecting */
- IF_VERBOSE(("sending int.\n"));
- i = 123;
- error = MPI_Send(&i, 1, MPI_INT, 0, 0, comm);
- check_error(error, "MPI_Send");
-
- IF_VERBOSE(("disconnect.\n"));
- error = MPI_Comm_disconnect(&comm);
- check_error(error, "MPI_Comm_disconnect");
-
- IF_VERBOSE(("barrier.\n"));
- error = MPI_Barrier(comm_parent);
- check_error(error, "MPI_Barrier");
-
- MPI_Comm_free( &comm_parent );
- }
- else if ((argc == 2) && (strcmp(argv[1], "connector") == 0))
- {
- IF_VERBOSE(("get_parent.\n"));
- error = MPI_Comm_get_parent(&comm_parent);
- check_error(error, "MPI_Comm_get_parent");
- if (comm_parent == MPI_COMM_NULL)
- {
- printf("acceptor's parent is NULL.\n");fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -1);
- }
-
- IF_VERBOSE(("recv.\n"));
- error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
- comm_parent, &status);
- check_error(error, "MPI_Recv");
-
- IF_VERBOSE(("1: received port: <%s>\n", port));
- IF_VERBOSE(("connect.\n"));
- error = MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
- check_error(error, "MPI_Comm_connect");
-
- /* Receive some data before disconnecting */
- IF_VERBOSE(("receiving int\n"));
- i = -1;
- error = MPI_Recv(&i, 1, MPI_INT, 0, 0, comm, &status);
- check_error(error, "MPI_Recv");
- if (i != 123)
- {
- printf("expected 123 but received %d\n", i);
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
-
- IF_VERBOSE(("disconnect.\n"));
- error = MPI_Comm_disconnect(&comm);
- check_error(error, "MPI_Comm_disconnect");
-
- IF_VERBOSE(("barrier.\n"));
- error = MPI_Barrier(comm_parent);
- check_error(error, "MPI_Barrier");
-
- MPI_Comm_free( &comm_parent );
- }
- else
- {
- printf("invalid command line.\n");fflush(stdout);
- {
- int ii;
- for (ii=0; ii<argc; ii++)
- {
- printf("argv[%d] = <%s>\n", ii, argv[ii]);
- }
- }
- fflush(stdout);
- MPI_Abort(MPI_COMM_WORLD, -2);
+ errs += MTestSpawnPossible(&can_spawn);
+ if (!can_spawn) {
+ if (errs)
+ printf( " Found %d errors\n", errs );
+ else
+ printf( " No Errors\n" );
+ fflush( stdout );
+ } else {
+ IF_VERBOSE(("size.\n"));
+ error = MPI_Comm_size(MPI_COMM_WORLD, &size);
+ check_error(error, "MPI_Comm_size");
+
+ IF_VERBOSE(("rank.\n"));
+ error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ check_error(error, "MPI_Comm_rank");
+
+ if (argc == 1)
+ {
+ /* Make sure that the current directory is in the path.
+ Not all implementations may honor or understand this, but
+ it is highly recommended as it gives users a clean way
+ to specify the location of the executable without
+ specifying a particular directory format (e.g., this
+ should work with both Windows and Unix implementations) */
+ MPI_Info_create( &spawn_path );
+ MPI_Info_set( spawn_path, (char*)"path", (char*)"." );
+
+ IF_VERBOSE(("spawn connector.\n"));
+ error = MPI_Comm_spawn((char*)"spaconacc2", argv1, 1, spawn_path, 0,
+ MPI_COMM_SELF, &comm_connector,
+ MPI_ERRCODES_IGNORE);
+ check_error(error, "MPI_Comm_spawn");
+
+ IF_VERBOSE(("spawn acceptor.\n"));
+ error = MPI_Comm_spawn((char*)"spaconacc2", argv2, 1, spawn_path, 0,
+ MPI_COMM_SELF, &comm_acceptor,
+ MPI_ERRCODES_IGNORE);
+ check_error(error, "MPI_Comm_spawn");
+ MPI_Info_free( &spawn_path );
+
+ IF_VERBOSE(("recv port.\n"));
+ error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_acceptor, &status);
+ check_error(error, "MPI_Recv");
+
+ IF_VERBOSE(("send port.\n"));
+ error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_connector);
+ check_error(error, "MPI_Send");
+
+ IF_VERBOSE(("barrier acceptor.\n"));
+ error = MPI_Barrier(comm_acceptor);
+ check_error(error, "MPI_Barrier");
+
+ IF_VERBOSE(("barrier connector.\n"));
+ error = MPI_Barrier(comm_connector);
+ check_error(error, "MPI_Barrier");
+
+ error = MPI_Comm_free(&comm_acceptor);
+ check_error(error, "MPI_Comm_free");
+ error = MPI_Comm_free(&comm_connector);
+ check_error(error, "MPI_Comm_free");
+
+ printf(" No Errors\n");
+ }
+ else if ((argc == 2) && (strcmp(argv[1], "acceptor") == 0))
+ {
+ IF_VERBOSE(("get_parent.\n"));
+ error = MPI_Comm_get_parent(&comm_parent);
+ check_error(error, "MPI_Comm_get_parent");
+ if (comm_parent == MPI_COMM_NULL)
+ {
+ printf("acceptor's parent is NULL.\n");fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -1);
+ }
+ IF_VERBOSE(("open_port.\n"));
+ error = MPI_Open_port(MPI_INFO_NULL, port);
+ check_error(error, "MPI_Open_port");
+
+ IF_VERBOSE(("0: opened port: <%s>\n", port));
+ IF_VERBOSE(("send.\n"));
+ error = MPI_Send(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0, comm_parent);
+ check_error(error, "MPI_Send");
+
+ IF_VERBOSE(("accept.\n"));
+ error = MPI_Comm_accept(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
+ check_error(error, "MPI_Comm_accept");
+
+ IF_VERBOSE(("close_port.\n"));
+ error = MPI_Close_port(port);
+ check_error(error, "MPI_Close_port");
+
+ /* Send some data before disconnecting */
+ IF_VERBOSE(("sending int.\n"));
+ i = 123;
+ error = MPI_Send(&i, 1, MPI_INT, 0, 0, comm);
+ check_error(error, "MPI_Send");
+
+ IF_VERBOSE(("disconnect.\n"));
+ error = MPI_Comm_disconnect(&comm);
+ check_error(error, "MPI_Comm_disconnect");
+
+ IF_VERBOSE(("barrier.\n"));
+ error = MPI_Barrier(comm_parent);
+ check_error(error, "MPI_Barrier");
+
+ MPI_Comm_free( &comm_parent );
+ }
+ else if ((argc == 2) && (strcmp(argv[1], "connector") == 0))
+ {
+ IF_VERBOSE(("get_parent.\n"));
+ error = MPI_Comm_get_parent(&comm_parent);
+ check_error(error, "MPI_Comm_get_parent");
+ if (comm_parent == MPI_COMM_NULL)
+ {
+ printf("acceptor's parent is NULL.\n");fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -1);
+ }
+
+ IF_VERBOSE(("recv.\n"));
+ error = MPI_Recv(port, MPI_MAX_PORT_NAME, MPI_CHAR, 0, 0,
+ comm_parent, &status);
+ check_error(error, "MPI_Recv");
+
+ IF_VERBOSE(("1: received port: <%s>\n", port));
+ IF_VERBOSE(("connect.\n"));
+ error = MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &comm);
+ check_error(error, "MPI_Comm_connect");
+
+ /* Receive some data before disconnecting */
+ IF_VERBOSE(("receiving int\n"));
+ i = -1;
+ error = MPI_Recv(&i, 1, MPI_INT, 0, 0, comm, &status);
+ check_error(error, "MPI_Recv");
+ if (i != 123)
+ {
+ printf("expected 123 but received %d\n", i);
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ IF_VERBOSE(("disconnect.\n"));
+ error = MPI_Comm_disconnect(&comm);
+ check_error(error, "MPI_Comm_disconnect");
+
+ IF_VERBOSE(("barrier.\n"));
+ error = MPI_Barrier(comm_parent);
+ check_error(error, "MPI_Barrier");
+
+ MPI_Comm_free( &comm_parent );
+ }
+ else
+ {
+ printf("invalid command line.\n");fflush(stdout);
+ {
+ int ii;
+ for (ii=0; ii<argc; ii++)
+ {
+ printf("argv[%d] = <%s>\n", ii, argv[ii]);
+ }
+ }
+ fflush(stdout);
+ MPI_Abort(MPI_COMM_WORLD, -2);
+ }
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spaiccreate.c b/test/mpi/spawn/spaiccreate.c
index 32967d8..873f613 100644
--- a/test/mpi/spawn/spaiccreate.c
+++ b/test/mpi/spawn/spaiccreate.c
@@ -24,70 +24,77 @@ int main( int argc, char *argv[] )
int np = 2;
int errcodes[2];
MPI_Comm parentcomm, intercomm, intercomm2;
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
- MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+ errs += MTestSpawnPossible(&can_spawn);
- MPI_Comm_get_parent( &parentcomm );
+ if (can_spawn) {
+ MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+ MPI_Comm_size( MPI_COMM_WORLD, &wsize );
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes, from process 0 in the original
- comm world */
- if (wrank == 0) {
- MPI_Comm_spawn( (char*)"./spaiccreate", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_SELF,
- &intercomm, errcodes );
- }
- else {
- intercomm = MPI_COMM_NULL;
- }
- }
- else
- intercomm = parentcomm;
+ MPI_Comm_get_parent( &parentcomm );
- /* We now have a valid intercomm. Use it to create a NEW intercomm
- that includes all processes */
- MPI_Intercomm_create( MPI_COMM_WORLD, 0, intercomm, 0, 123, &intercomm2 );
-
- /* Have the spawned processes send to rank 1 in the comm world of the
- parent */
- if (parentcomm == MPI_COMM_NULL) {
- MPI_Send( &wrank, 1, MPI_INT, 1, wrank, intercomm2 );
- }
- else {
- if (wrank == 1) {
- int i, rsize, rrank;
- MPI_Status status;
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes, from process 0 in the original
+ comm world */
+ if (wrank == 0) {
+ MPI_Comm_spawn( (char*)"./spaiccreate", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_SELF,
+ &intercomm, errcodes );
+ }
+ else {
+ intercomm = MPI_COMM_NULL;
+ }
+ }
+ else
+ intercomm = parentcomm;
- MPI_Comm_remote_size( intercomm2, &rsize );
- for (i=0; i<rsize; i++) {
- MPI_Recv( &rrank, 1, MPI_INT, i, i, intercomm2, &status );
- if (rrank != i) {
- errs++;
- printf( "Received %d from %d; expected %d\n",
- rrank, i, i );
- }
- }
- }
- }
+ /* We now have a valid intercomm. Use it to create a NEW intercomm
+ that includes all processes */
+ MPI_Intercomm_create( MPI_COMM_WORLD, 0, intercomm, 0, 123, &intercomm2 );
+
+ /* Have the spawned processes send to rank 1 in the comm world of the
+ parent */
+ if (parentcomm == MPI_COMM_NULL) {
+ MPI_Send( &wrank, 1, MPI_INT, 1, wrank, intercomm2 );
+ }
+ else {
+ if (wrank == 1) {
+ int i, rsize, rrank;
+ MPI_Status status;
+
+ MPI_Comm_remote_size( intercomm2, &rsize );
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &rrank, 1, MPI_INT, i, i, intercomm2, &status );
+ if (rrank != i) {
+ errs++;
+ printf( "Received %d from %d; expected %d\n",
+ rrank, i, i );
+ }
+ }
+ }
+ }
+
+ /* printf( "%sAbout to barrier on intercomm2\n",
+ (parentcomm == MPI_COMM_NULL) ? "<orig>" : "<spawned>" );
+ fflush(stdout);*/
+ MPI_Barrier( intercomm2 );
- /* printf( "%sAbout to barrier on intercomm2\n",
- (parentcomm == MPI_COMM_NULL) ? "<orig>" : "<spawned>" );
- fflush(stdout);*/
- MPI_Barrier( intercomm2 );
-
- /* It isn't necessary to free the intercomms, but it should not hurt */
- if (intercomm != MPI_COMM_NULL)
- MPI_Comm_free( &intercomm );
- MPI_Comm_free( &intercomm2 );
+ /* It isn't necessary to free the intercomms, but it should not hurt */
+ if (intercomm != MPI_COMM_NULL)
+ MPI_Comm_free( &intercomm );
+ MPI_Comm_free( &intercomm2 );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spaiccreate2.c b/test/mpi/spawn/spaiccreate2.c
index c56616c..20ca764 100644
--- a/test/mpi/spawn/spaiccreate2.c
+++ b/test/mpi/spawn/spaiccreate2.c
@@ -27,57 +27,64 @@ int main( int argc, char *argv[] )
int errcodes[2];
int rrank = -1;
MPI_Comm parentcomm, intercomm, intercomm2, even_odd_comm, merged_world;
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
- MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+ errs += MTestSpawnPossible(&can_spawn);
- if (wsize != 2) {
- printf( "world size != 2, this test will not work correctly\n" );
- errs++;
- }
+ if (can_spawn) {
+ MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+ MPI_Comm_size( MPI_COMM_WORLD, &wsize );
- MPI_Comm_get_parent( &parentcomm );
+ if (wsize != 2) {
+ printf( "world size != 2, this test will not work correctly\n" );
+ errs++;
+ }
- if (parentcomm == MPI_COMM_NULL) {
- MPI_Comm_spawn( (char*)"./spaiccreate2", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- }
- else {
- intercomm = parentcomm;
- }
+ MPI_Comm_get_parent( &parentcomm );
- MPI_Intercomm_merge( intercomm, (parentcomm == MPI_COMM_NULL ? 0 : 1), &merged_world );
- MPI_Comm_rank( merged_world, &mrank );
- MPI_Comm_size( merged_world, &msize );
-
- MPI_Comm_split( merged_world, mrank % 2, wrank, &even_odd_comm );
-
- MPI_Intercomm_create( even_odd_comm, 0, merged_world, (mrank + 1) % 2, 123, &intercomm2 );
- MPI_Comm_rank( intercomm2, &inter_rank );
-
- /* odds receive from evens */
- MPI_Sendrecv( &inter_rank, 1, MPI_INT, inter_rank, 456,
- &rrank, 1, MPI_INT, inter_rank, 456, intercomm2, MPI_STATUS_IGNORE );
- if (rrank != inter_rank) {
- printf( "Received %d from %d; expected %d\n",
- rrank, inter_rank, inter_rank );
- errs++;
- }
+ if (parentcomm == MPI_COMM_NULL) {
+ MPI_Comm_spawn( (char*)"./spaiccreate2", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ }
+ else {
+ intercomm = parentcomm;
+ }
+
+ MPI_Intercomm_merge( intercomm, (parentcomm == MPI_COMM_NULL ? 0 : 1), &merged_world );
+ MPI_Comm_rank( merged_world, &mrank );
+ MPI_Comm_size( merged_world, &msize );
+
+ MPI_Comm_split( merged_world, mrank % 2, wrank, &even_odd_comm );
+
+ MPI_Intercomm_create( even_odd_comm, 0, merged_world, (mrank + 1) % 2, 123, &intercomm2 );
+ MPI_Comm_rank( intercomm2, &inter_rank );
+
+ /* odds receive from evens */
+ MPI_Sendrecv( &inter_rank, 1, MPI_INT, inter_rank, 456,
+ &rrank, 1, MPI_INT, inter_rank, 456, intercomm2, MPI_STATUS_IGNORE );
+ if (rrank != inter_rank) {
+ printf( "Received %d from %d; expected %d\n",
+ rrank, inter_rank, inter_rank );
+ errs++;
+ }
+
+ MPI_Barrier( intercomm2 );
+
+ MPI_Comm_free( &intercomm );
+ MPI_Comm_free( &intercomm2 );
+ MPI_Comm_free( &merged_world );
+ MPI_Comm_free( &even_odd_comm );
- MPI_Barrier( intercomm2 );
-
- MPI_Comm_free( &intercomm );
- MPI_Comm_free( &intercomm2 );
- MPI_Comm_free( &merged_world );
- MPI_Comm_free( &even_odd_comm );
-
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
MTest_Finalize( errs );
}
diff --git a/test/mpi/spawn/spawn1.c b/test/mpi/spawn/spawn1.c
index 930002f..864f763 100644
--- a/test/mpi/spawn/spawn1.c
+++ b/test/mpi/spawn/spawn1.c
@@ -27,92 +27,98 @@ int main( int argc, char *argv[] )
int errcodes[2];
MPI_Comm parentcomm, intercomm;
MPI_Status status;
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
+ errs += MTestSpawnPossible(&can_spawn);
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes */
- MPI_Comm_spawn( (char*)"./spawn1", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- }
- else
- intercomm = parentcomm;
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes */
+ MPI_Comm_spawn( (char*)"./spawn1", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ }
+ else
+ intercomm = parentcomm;
- /* We now have a valid intercomm */
+ /* We now have a valid intercomm */
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- if (rank == 0) {
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- }
- }
- else {
- /* Child */
- char cname[MPI_MAX_OBJECT_NAME];
- int rlen;
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ if (rank == 0) {
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ }
+ }
+ else {
+ /* Child */
+ char cname[MPI_MAX_OBJECT_NAME];
+ int rlen;
- if (size != np) {
- errs++;
- printf( "(Child) Did not create %d processes (got %d)\n",
- np, size );
- }
- /* Check the name of the parent */
- cname[0] = 0;
- MPI_Comm_get_name( intercomm, cname, &rlen );
- /* MPI-2 section 8.4 requires that the parent have this
- default name */
- if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
- errs++;
- printf( "Name of parent is not correct\n" );
- if (rlen > 0 && cname[0]) {
- printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
- }
- else {
- printf( " Expected MPI_COMM_PARENT but no name set\n" );
- }
- }
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
+ if (size != np) {
+ errs++;
+ printf( "(Child) Did not create %d processes (got %d)\n",
+ np, size );
+ }
+ /* Check the name of the parent */
+ cname[0] = 0;
+ MPI_Comm_get_name( intercomm, cname, &rlen );
+ /* MPI-2 section 8.4 requires that the parent have this
+ default name */
+ if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
+ errs++;
+ printf( "Name of parent is not correct\n" );
+ if (rlen > 0 && cname[0]) {
+ printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
+ }
+ else {
+ printf( " Expected MPI_COMM_PARENT but no name set\n" );
+ }
+ }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
- /* It isn't necessary to free the intercomm, but it should not hurt */
- /* Using Comm_disconnect instead of free should provide a stronger
- * test, as a high-quality MPI implementation will be able to
- * recover some resources that it should hold on to in the case
- * of MPI_Comm_free */
- /* MPI_Comm_free( &intercomm ); */
- MPI_Comm_disconnect( &intercomm );
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ /* Using Comm_disconnect instead of free should provide a stronger
+ * test, as a high-quality MPI implementation will be able to
+ * recover some resources that it should hold on to in the case
+ * of MPI_Comm_free */
+ /* MPI_Comm_free( &intercomm ); */
+ MPI_Comm_disconnect( &intercomm );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawn2.c b/test/mpi/spawn/spawn2.c
index 88364f4..2f310d3 100644
--- a/test/mpi/spawn/spawn2.c
+++ b/test/mpi/spawn/spawn2.c
@@ -27,132 +27,139 @@ int main( int argc, char *argv[] )
int errcodes[2];
MPI_Comm parentcomm, intercomm, intercomm2;
MPI_Status status;
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes */
- /* This uses a Unix name for the program;
- Windows applications may need to use just spawn2 or
- spawn2.exe. We can't rely on using info to place . in the
- path, since info is not required to be followed. */
- MPI_Comm_spawn( (char*)"./spawn2", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- }
- else
- intercomm = parentcomm;
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- if (rank == 0) {
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- }
- }
- else {
- /* Child */
- char cname[MPI_MAX_OBJECT_NAME];
- int rlen;
-
- if (size != np) {
- errs++;
- printf( "(Child) Did not create %d processes (got %d)\n",
- np, size );
- }
- /* Check the name of the parent */
- cname[0] = 0;
- MPI_Comm_get_name( intercomm, cname, &rlen );
- /* MPI-2 section 8.4 requires that the parent have this
- default name */
- if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
- errs++;
- printf( "Name of parent is not correct\n" );
- if (rlen > 0 && cname[0]) {
- printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
- }
- else {
- printf( " Expected MPI_COMM_PARENT but no name set\n" );
- }
- }
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes */
- /* This uses a Unix name for the program;
- Windows applications may need to use just spawn2 or
- spawn2.exe. We can't rely on using info to place . in the
- path, since info is not required to be followed. */
- MPI_Comm_spawn( (char*)"./spawn2", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm2, MPI_ERRCODES_IGNORE );
- }
- else
- intercomm2 = parentcomm;
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size( intercomm2, &rsize );
- MPI_Comm_size( intercomm2, &size );
- MPI_Comm_rank( intercomm2, &rank );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- if (rank == 0) {
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm2 );
- }
- /* We could use intercomm2 reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm2, MPI_STATUS_IGNORE );
- errs += err;
- }
- }
-
- MPI_Comm_free( &intercomm2 );
- }
-
- /* It isn't necessary to free the intercomm, but it should not hurt */
- MPI_Comm_free( &intercomm );
-
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes */
+ /* This uses a Unix name for the program;
+ Windows applications may need to use just spawn2 or
+ spawn2.exe. We can't rely on using info to place . in the
+ path, since info is not required to be followed. */
+ MPI_Comm_spawn( (char*)"./spawn2", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ }
+ else
+ intercomm = parentcomm;
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ if (rank == 0) {
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ }
+ }
+ else {
+ /* Child */
+ char cname[MPI_MAX_OBJECT_NAME];
+ int rlen;
+
+ if (size != np) {
+ errs++;
+ printf( "(Child) Did not create %d processes (got %d)\n",
+ np, size );
+ }
+ /* Check the name of the parent */
+ cname[0] = 0;
+ MPI_Comm_get_name( intercomm, cname, &rlen );
+ /* MPI-2 section 8.4 requires that the parent have this
+ default name */
+ if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
+ errs++;
+ printf( "Name of parent is not correct\n" );
+ if (rlen > 0 && cname[0]) {
+ printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
+ }
+ else {
+ printf( " Expected MPI_COMM_PARENT but no name set\n" );
+ }
+ }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes */
+ /* This uses a Unix name for the program;
+ Windows applications may need to use just spawn2 or
+ spawn2.exe. We can't rely on using info to place . in the
+ path, since info is not required to be followed. */
+ MPI_Comm_spawn( (char*)"./spawn2", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm2, MPI_ERRCODES_IGNORE );
+ }
+ else
+ intercomm2 = parentcomm;
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size( intercomm2, &rsize );
+ MPI_Comm_size( intercomm2, &size );
+ MPI_Comm_rank( intercomm2, &rank );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ if (rank == 0) {
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm2 );
+ }
+ /* We could use intercomm2 reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm2, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ }
+
+ MPI_Comm_free( &intercomm2 );
+ }
+
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ MPI_Comm_free( &intercomm );
+
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawnargv.c b/test/mpi/spawn/spawnargv.c
index 5623934..95b52aa 100644
--- a/test/mpi/spawn/spawnargv.c
+++ b/test/mpi/spawn/spawnargv.c
@@ -27,88 +27,95 @@ int main( int argc, char *argv[] )
MPI_Status status;
char * inargv[] = { (char*)"a", (char*)"b=c", (char*)"d e", (char*)"-pf", (char*)" Ss", 0 };
char * outargv[] = { (char*)"a", (char*)"b=c", (char*)"d e", (char*)"-pf", (char*)" Ss", 0 };
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
+ errs += MTestSpawnPossible(&can_spawn);
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes */
- /* ./ is unix specific .
- The more generic approach would be to specify "spawnargv" as the
- executable and pass an info with ("path", ".") */
- MPI_Comm_spawn( (char*)"./spawnargv", inargv, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- }
- else
- intercomm = parentcomm;
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
- /* We now have a valid intercomm */
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes */
+ /* ./ is unix specific .
+ The more generic approach would be to specify "spawnargv" as the
+ executable and pass an info with ("path", ".") */
+ MPI_Comm_spawn( (char*)"./spawnargv", inargv, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ }
+ else
+ intercomm = parentcomm;
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
+ /* We now have a valid intercomm */
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- }
- else {
- /* Child */
- /* FIXME: This assumes that stdout is handled for the children
- (the error count will still be reported to the parent) */
- if (size != np) {
- errs++;
- printf( "(Child) Did not create %d processes (got %d)\n",
- np, size );
- }
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
- /* Check the command line */
- for (i=1; i<argc; i++) {
- if (!outargv[i-1]) {
- errs++;
- printf( "Wrong number of arguments (%d)\n", argc );
- break;
- }
- if (strcmp( argv[i], outargv[i-1] ) != 0) {
- errs++;
- printf( "Found arg %s but expected %s\n", argv[i],
- outargv[i-1] );
- }
- }
- if (outargv[i-1]) {
- /* We had too few args in the spawned command */
- errs++;
- printf( "Too few arguments to spawned command\n" );
- }
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ }
+ else {
+ /* Child */
+ /* FIXME: This assumes that stdout is handled for the children
+ (the error count will still be reported to the parent) */
+ if (size != np) {
+ errs++;
+ printf( "(Child) Did not create %d processes (got %d)\n",
+ np, size );
+ }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+ /* Check the command line */
+ for (i=1; i<argc; i++) {
+ if (!outargv[i-1]) {
+ errs++;
+ printf( "Wrong number of arguments (%d)\n", argc );
+ break;
+ }
+ if (strcmp( argv[i], outargv[i-1] ) != 0) {
+ errs++;
+ printf( "Found arg %s but expected %s\n", argv[i],
+ outargv[i-1] );
+ }
+ }
+ if (outargv[i-1]) {
+ /* We had too few args in the spawned command */
+ errs++;
+ printf( "Too few arguments to spawned command\n" );
+ }
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
- /* It isn't necessary to free the intercomm, but it should not hurt */
- MPI_Comm_free( &intercomm );
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ MPI_Comm_free( &intercomm );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawninfo1.c b/test/mpi/spawn/spawninfo1.c
index 928ebac..abd2a12 100644
--- a/test/mpi/spawn/spawninfo1.c
+++ b/test/mpi/spawn/spawninfo1.c
@@ -34,113 +34,120 @@ int main( int argc, char *argv[] )
MPI_Info spawninfo;
char curdir[1024], wd[1024], childwd[1024];
char *cerr;
+ int can_spawn;
MTest_Init( &argc, &argv );
- cerr = getcwd( curdir, sizeof(curdir) );
-
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL) {
- char *p;
- /* Create 2 more processes. Make the working directory the
- directory above the current running directory */
- strncpy( wd, curdir, sizeof(wd) );
- /* Lop off the last element of the directory */
- p = wd + strlen(wd) - 1;
- while (p > wd && *p != '/' && *p != '\\') p--;
- *p = 0;
-
- MPI_Info_create( &spawninfo );
- MPI_Info_set( spawninfo, (char*)"path", curdir );
- MPI_Info_set( spawninfo, (char*)"wdir", wd );
- MPI_Comm_spawn( (char*)"spawninfo1", MPI_ARGV_NULL, np,
- spawninfo, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- MPI_Info_free( &spawninfo );
- }
- else
- intercomm = parentcomm;
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- if (rank == 0) {
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- for (i=0; i<rsize; i++) {
- MPI_Recv( childwd, sizeof(childwd), MPI_CHAR, i, 2, intercomm,
- MPI_STATUS_IGNORE );
- if (strcmp( childwd, wd ) != 0) {
- printf( "Expected a working dir of %s but child is in %s\n",
- wd, childwd );
- errs ++;
- }
- }
- }
- }
- else {
- /* Child */
- char cname[MPI_MAX_OBJECT_NAME];
- int rlen;
-
- if (size != np) {
- errs++;
- printf( "(Child) Did not create %d processes (got %d)\n",
- np, size );
- }
- /* Check the name of the parent */
- cname[0] = 0;
- MPI_Comm_get_name( intercomm, cname, &rlen );
- /* MPI-2 section 8.4 requires that the parent have this
- default name */
- if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
- errs++;
- printf( "Name of parent is not correct\n" );
- if (rlen > 0 && cname[0]) {
- printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
- }
- else {
- printf( " Expected MPI_COMM_PARENT but no name set\n" );
- }
- }
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
- /* Send our notion of the current directory to the parent */
- MPI_Send( curdir, strlen(curdir)+1, MPI_CHAR, 0, 2, intercomm );
-
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ cerr = getcwd( curdir, sizeof(curdir) );
+
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ char *p;
+ /* Create 2 more processes. Make the working directory the
+ directory above the current running directory */
+ strncpy( wd, curdir, sizeof(wd) );
+ /* Lop off the last element of the directory */
+ p = wd + strlen(wd) - 1;
+ while (p > wd && *p != '/' && *p != '\\') p--;
+ *p = 0;
+
+ MPI_Info_create( &spawninfo );
+ MPI_Info_set( spawninfo, (char*)"path", curdir );
+ MPI_Info_set( spawninfo, (char*)"wdir", wd );
+ MPI_Comm_spawn( (char*)"spawninfo1", MPI_ARGV_NULL, np,
+ spawninfo, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ MPI_Info_free( &spawninfo );
+ }
+ else
+ intercomm = parentcomm;
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ if (rank == 0) {
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( childwd, sizeof(childwd), MPI_CHAR, i, 2, intercomm,
+ MPI_STATUS_IGNORE );
+ if (strcmp( childwd, wd ) != 0) {
+ printf( "Expected a working dir of %s but child is in %s\n",
+ wd, childwd );
+ errs ++;
+ }
+ }
+ }
+ }
+ else {
+ /* Child */
+ char cname[MPI_MAX_OBJECT_NAME];
+ int rlen;
+
+ if (size != np) {
+ errs++;
+ printf( "(Child) Did not create %d processes (got %d)\n",
+ np, size );
+ }
+ /* Check the name of the parent */
+ cname[0] = 0;
+ MPI_Comm_get_name( intercomm, cname, &rlen );
+ /* MPI-2 section 8.4 requires that the parent have this
+ default name */
+ if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
+ errs++;
+ printf( "Name of parent is not correct\n" );
+ if (rlen > 0 && cname[0]) {
+ printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
+ }
+ else {
+ printf( " Expected MPI_COMM_PARENT but no name set\n" );
+ }
+ }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+ /* Send our notion of the current directory to the parent */
+ MPI_Send( curdir, strlen(curdir)+1, MPI_CHAR, 0, 2, intercomm );
+
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
- /* It isn't necessary to free the intercomm, but it should not hurt */
- MPI_Comm_free( &intercomm );
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ MPI_Comm_free( &intercomm );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawnintra.c b/test/mpi/spawn/spawnintra.c
index bb9265e..41b6603 100644
--- a/test/mpi/spawn/spawnintra.c
+++ b/test/mpi/spawn/spawnintra.c
@@ -21,174 +21,181 @@ int main( int argc, char *argv[] )
MPI_Comm parentcomm, intercomm, intracomm, intracomm2, intracomm3;
int isChild = 0;
MPI_Status status;
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes */
- MPI_Comm_spawn( (char*)"./spawnintra", MPI_ARGV_NULL, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- }
- else
- intercomm = parentcomm;
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- if (rank == 0) {
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- }
- }
- else {
- /* Child */
- isChild = 1;
- if (size != np) {
- errs++;
- printf( "(Child) Did not create %d processes (got %d)\n",
- np, size );
- }
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
- }
-
- /* At this point, try to form the intracommunicator */
- MPI_Intercomm_merge( intercomm, isChild, &intracomm );
-
- /* Check on the intra comm */
- {
- int icsize, icrank, wrank;
-
- MPI_Comm_size( intracomm, &icsize );
- MPI_Comm_rank( intracomm, &icrank );
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
-
- if (icsize != rsize + size) {
- errs++;
- printf( "Intracomm rank %d thinks size is %d, not %d\n",
- icrank, icsize, rsize + size );
- }
- /* Make sure that the processes are ordered correctly */
- if (isChild) {
- int psize;
- MPI_Comm_remote_size( parentcomm, &psize );
- if (icrank != psize + wrank ) {
- errs++;
- printf( "Intracomm rank %d (from child) should have rank %d\n",
- icrank, psize + wrank );
- }
- }
- else {
- if (icrank != wrank) {
- errs++;
- printf( "Intracomm rank %d (from parent) should have rank %d\n",
- icrank, wrank );
- }
- }
- }
-
- /* At this point, try to form the intracommunicator, with the other
- processes first */
- MPI_Intercomm_merge( intercomm, !isChild, &intracomm2 );
-
- /* Check on the intra comm */
- {
- int icsize, icrank, wrank;
-
- MPI_Comm_size( intracomm2, &icsize );
- MPI_Comm_rank( intracomm2, &icrank );
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
-
- if (icsize != rsize + size) {
- errs++;
- printf( "(2)Intracomm rank %d thinks size is %d, not %d\n",
- icrank, icsize, rsize + size );
- }
- /* Make sure that the processes are ordered correctly */
- if (isChild) {
- if (icrank != wrank ) {
- errs++;
- printf( "(2)Intracomm rank %d (from child) should have rank %d\n",
- icrank, wrank );
- }
- }
- else {
- int csize;
- MPI_Comm_remote_size( intercomm, &csize );
- if (icrank != wrank + csize) {
- errs++;
- printf( "(2)Intracomm rank %d (from parent) should have rank %d\n",
- icrank, wrank + csize );
- }
- }
- }
-
- /* At this point, try to form the intracommunicator, with an
- arbitrary choice for the first group of processes */
- MPI_Intercomm_merge( intercomm, 0, &intracomm3 );
- /* Check on the intra comm */
- {
- int icsize, icrank, wrank;
-
- MPI_Comm_size( intracomm3, &icsize );
- MPI_Comm_rank( intracomm3, &icrank );
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
-
- if (icsize != rsize + size) {
- errs++;
- printf( "(3)Intracomm rank %d thinks size is %d, not %d\n",
- icrank, icsize, rsize + size );
- }
- /* Eventually, we should test that the processes are ordered
- correctly, by groups (must be one of the two cases above) */
- }
-
- /* Update error count */
- if (isChild) {
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
- else {
- if (rank == 0) {
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- }
- }
-
- /* It isn't necessary to free the intracomms, but it should not hurt */
- MPI_Comm_free( &intracomm );
- MPI_Comm_free( &intracomm2 );
- MPI_Comm_free( &intracomm3 );
-
- /* It isn't necessary to free the intercomm, but it should not hurt */
- MPI_Comm_free( &intercomm );
-
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes */
+ MPI_Comm_spawn( (char*)"./spawnintra", MPI_ARGV_NULL, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ }
+ else
+ intercomm = parentcomm;
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ if (rank == 0) {
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ }
+ }
+ else {
+ /* Child */
+ isChild = 1;
+ if (size != np) {
+ errs++;
+ printf( "(Child) Did not create %d processes (got %d)\n",
+ np, size );
+ }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+ }
+
+ /* At this point, try to form the intracommunicator */
+ MPI_Intercomm_merge( intercomm, isChild, &intracomm );
+
+ /* Check on the intra comm */
+ {
+ int icsize, icrank, wrank;
+
+ MPI_Comm_size( intracomm, &icsize );
+ MPI_Comm_rank( intracomm, &icrank );
+ MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+ if (icsize != rsize + size) {
+ errs++;
+ printf( "Intracomm rank %d thinks size is %d, not %d\n",
+ icrank, icsize, rsize + size );
+ }
+ /* Make sure that the processes are ordered correctly */
+ if (isChild) {
+ int psize;
+ MPI_Comm_remote_size( parentcomm, &psize );
+ if (icrank != psize + wrank ) {
+ errs++;
+ printf( "Intracomm rank %d (from child) should have rank %d\n",
+ icrank, psize + wrank );
+ }
+ }
+ else {
+ if (icrank != wrank) {
+ errs++;
+ printf( "Intracomm rank %d (from parent) should have rank %d\n",
+ icrank, wrank );
+ }
+ }
+ }
+
+ /* At this point, try to form the intracommunicator, with the other
+ processes first */
+ MPI_Intercomm_merge( intercomm, !isChild, &intracomm2 );
+
+ /* Check on the intra comm */
+ {
+ int icsize, icrank, wrank;
+
+ MPI_Comm_size( intracomm2, &icsize );
+ MPI_Comm_rank( intracomm2, &icrank );
+ MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+ if (icsize != rsize + size) {
+ errs++;
+ printf( "(2)Intracomm rank %d thinks size is %d, not %d\n",
+ icrank, icsize, rsize + size );
+ }
+ /* Make sure that the processes are ordered correctly */
+ if (isChild) {
+ if (icrank != wrank ) {
+ errs++;
+ printf( "(2)Intracomm rank %d (from child) should have rank %d\n",
+ icrank, wrank );
+ }
+ }
+ else {
+ int csize;
+ MPI_Comm_remote_size( intercomm, &csize );
+ if (icrank != wrank + csize) {
+ errs++;
+ printf( "(2)Intracomm rank %d (from parent) should have rank %d\n",
+ icrank, wrank + csize );
+ }
+ }
+ }
+
+ /* At this point, try to form the intracommunicator, with an
+ arbitrary choice for the first group of processes */
+ MPI_Intercomm_merge( intercomm, 0, &intracomm3 );
+ /* Check on the intra comm */
+ {
+ int icsize, icrank, wrank;
+
+ MPI_Comm_size( intracomm3, &icsize );
+ MPI_Comm_rank( intracomm3, &icrank );
+ MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+ if (icsize != rsize + size) {
+ errs++;
+ printf( "(3)Intracomm rank %d thinks size is %d, not %d\n",
+ icrank, icsize, rsize + size );
+ }
+ /* Eventually, we should test that the processes are ordered
+ correctly, by groups (must be one of the two cases above) */
+ }
+
+ /* Update error count */
+ if (isChild) {
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
+ else {
+ if (rank == 0) {
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ }
+ }
+
+ /* It isn't necessary to free the intracomms, but it should not hurt */
+ MPI_Comm_free( &intracomm );
+ MPI_Comm_free( &intracomm2 );
+ MPI_Comm_free( &intracomm3 );
+
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ MPI_Comm_free( &intercomm );
+
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawnmanyarg.c b/test/mpi/spawn/spawnmanyarg.c
index 1e69996..68d6c4e 100644
--- a/test/mpi/spawn/spawnmanyarg.c
+++ b/test/mpi/spawn/spawnmanyarg.c
@@ -32,85 +32,92 @@ int main( int argc, char *argv[] )
char *outargv[MAX_ARGV];
int narg = 40;
char *saveArgp = 0;
+ int can_spawn;
MTest_Init( &argc, &argv );
- /* Initialize the argument vectors */
- for (i=0; i<MAX_ARGV; i++) {
- char *p;
- p = (char *)malloc( 9 );
- if (!p) {
- fprintf( stderr, "Unable to allocated memory\n" );
- MPI_Abort( MPI_COMM_WORLD, 1 );
- }
- strcpy( p, "01234567" );
- inargv[i] = p;
- p = (char *)malloc( 9 );
- if (!p) {
- fprintf( stderr, "Unable to allocated memory\n" );
- MPI_Abort( MPI_COMM_WORLD, 1 );
- }
- strcpy( p, "01234567" );
- outargv[i] = p;
- }
+ errs += MTestSpawnPossible(&can_spawn);
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL) {
- for (narg=16; narg < 512; narg += narg) {
- /* Create 2 more processes */
- /* Set a null at argument length narg */
- saveArgp = inargv[narg];
- inargv[narg] = 0;
- /* ./ is unix specific .
- The more generic approach would be to specify "spawnmanyarg" as
- the executable and pass an info with ("path", ".") */
- MPI_Comm_spawn( (char*)"./spawnmanyarg", inargv, np,
- MPI_INFO_NULL, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- inargv[narg] = saveArgp;
- /* We now have a valid intercomm */
-
- /* Master */
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
-
- if (rsize != np) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", np, rsize );
- }
- /* Send the expected rank */
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* Send the number of arguments */
- for (i=0; i<rsize; i++) {
- MPI_Send( &narg, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
-
- /* Free the intercomm before the next round of spawns */
- MPI_Comm_free( &intercomm );
- }
- }
- else {
- /* Note that worker also send errs to the parent */
- errs += worker( argc, argv, parentcomm, outargv, np );
- MPI_Comm_free( &parentcomm );
- MPI_Finalize();
- return 0;
- }
+ if (can_spawn) {
+ /* Initialize the argument vectors */
+ for (i=0; i<MAX_ARGV; i++) {
+ char *p;
+ p = (char *)malloc( 9 );
+ if (!p) {
+ fprintf( stderr, "Unable to allocated memory\n" );
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ }
+ strcpy( p, "01234567" );
+ inargv[i] = p;
+ p = (char *)malloc( 9 );
+ if (!p) {
+ fprintf( stderr, "Unable to allocated memory\n" );
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ }
+ strcpy( p, "01234567" );
+ outargv[i] = p;
+ }
+
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ for (narg=16; narg < 512; narg += narg) {
+ /* Create 2 more processes */
+ /* Set a null at argument length narg */
+ saveArgp = inargv[narg];
+ inargv[narg] = 0;
+ /* ./ is unix specific .
+ The more generic approach would be to specify "spawnmanyarg" as
+ the executable and pass an info with ("path", ".") */
+ MPI_Comm_spawn( (char*)"./spawnmanyarg", inargv, np,
+ MPI_INFO_NULL, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ inargv[narg] = saveArgp;
+ /* We now have a valid intercomm */
+
+ /* Master */
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
+
+ if (rsize != np) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", np, rsize );
+ }
+ /* Send the expected rank */
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* Send the number of arguments */
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &narg, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+
+ /* Free the intercomm before the next round of spawns */
+ MPI_Comm_free( &intercomm );
+ }
+ }
+ else {
+ /* Note that worker also send errs to the parent */
+ errs += worker( argc, argv, parentcomm, outargv, np );
+ MPI_Comm_free( &parentcomm );
+ MPI_Finalize();
+ return 0;
+ }
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawnminfo1.c b/test/mpi/spawn/spawnminfo1.c
index 0b6abc8..11c27d2 100644
--- a/test/mpi/spawn/spawnminfo1.c
+++ b/test/mpi/spawn/spawnminfo1.c
@@ -35,121 +35,128 @@ int main( int argc, char *argv[] )
char curdir[1024], wd[1024], childwd[1024];
char *commands[2] = { (char*)"spawnminfo1", (char*)"spawnminfo1" };
char *cerr;
+ int can_spawn;
MTest_Init( &argc, &argv );
- cerr = getcwd( curdir, sizeof(curdir) );
-
- MPI_Comm_get_parent( &parentcomm );
-
- if (parentcomm == MPI_COMM_NULL) {
- char *p;
- /* Create 2 more processes. Make the working directory the
- directory above the current running directory */
- strncpy( wd, curdir, sizeof(wd) );
- /* Lop off the last element of the directory */
- p = wd + strlen(wd) - 1;
- while (p > wd && *p != '/' && *p != '\\') p--;
- *p = 0;
-
- MPI_Info_create( &spawninfos[0] );
- MPI_Info_set( spawninfos[0], (char*)"path", curdir );
- MPI_Info_set( spawninfos[0], (char*)"wdir", wd );
- MPI_Info_create( &spawninfos[1] );
- MPI_Info_set( spawninfos[1], (char*)"path", curdir );
- MPI_Info_set( spawninfos[1], (char*)"wdir", curdir );
- MPI_Comm_spawn_multiple( 2, commands, MPI_ARGVS_NULL, np,
- spawninfos, 0, MPI_COMM_WORLD,
- &intercomm, errcodes );
- MPI_Info_free( &spawninfos[0] );
- MPI_Info_free( &spawninfos[1] );
- }
- else
- intercomm = parentcomm;
-
- /* We now have a valid intercomm */
-
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
-
- if (parentcomm == MPI_COMM_NULL) {
- /* Master */
- if (rsize != sumnp) {
- errs++;
- printf( "Did not create %d processes (got %d)\n", sumnp, rsize );
- }
- if (rank == 0) {
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- children, but we'll use a simpler loop to make sure that
- we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
- errs += err;
- }
- for (i=0; i<rsize; i++) {
- char *expected = 0;
- MPI_Recv( childwd, sizeof(childwd), MPI_CHAR, i, 2, intercomm,
- MPI_STATUS_IGNORE );
- /* The first set uses wd the second set curdir */
- if (i <np[0]) expected = wd;
- else expected = curdir;
- if (strcmp( childwd, expected ) != 0) {
- printf( "Expected a working dir of %s but child is in %s for child rank %d\n",
- expected, childwd, i );
- errs ++;
- }
- }
- }
- }
- else {
- /* Child */
- char cname[MPI_MAX_OBJECT_NAME];
- int rlen;
-
- if (size != sumnp) {
- errs++;
- printf( "(Child) Did not create %d processes (got %d)\n",
- sumnp, size );
- }
- /* Check the name of the parent */
- cname[0] = 0;
- MPI_Comm_get_name( intercomm, cname, &rlen );
- /* MPI-2 section 8.4 requires that the parent have this
- default name */
- if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
- errs++;
- printf( "Name of parent is not correct\n" );
- if (rlen > 0 && cname[0]) {
- printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
- }
- else {
- printf( " Expected MPI_COMM_PARENT but no name set\n" );
- }
- }
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
- /* Send our notion of the current directory to the parent */
- MPI_Send( curdir, strlen(curdir)+1, MPI_CHAR, 0, 2, intercomm );
-
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (can_spawn) {
+ cerr = getcwd( curdir, sizeof(curdir) );
+
+ MPI_Comm_get_parent( &parentcomm );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ char *p;
+ /* Create 2 more processes. Make the working directory the
+ directory above the current running directory */
+ strncpy( wd, curdir, sizeof(wd) );
+ /* Lop off the last element of the directory */
+ p = wd + strlen(wd) - 1;
+ while (p > wd && *p != '/' && *p != '\\') p--;
+ *p = 0;
+
+ MPI_Info_create( &spawninfos[0] );
+ MPI_Info_set( spawninfos[0], (char*)"path", curdir );
+ MPI_Info_set( spawninfos[0], (char*)"wdir", wd );
+ MPI_Info_create( &spawninfos[1] );
+ MPI_Info_set( spawninfos[1], (char*)"path", curdir );
+ MPI_Info_set( spawninfos[1], (char*)"wdir", curdir );
+ MPI_Comm_spawn_multiple( 2, commands, MPI_ARGVS_NULL, np,
+ spawninfos, 0, MPI_COMM_WORLD,
+ &intercomm, errcodes );
+ MPI_Info_free( &spawninfos[0] );
+ MPI_Info_free( &spawninfos[1] );
+ }
+ else
+ intercomm = parentcomm;
+
+ /* We now have a valid intercomm */
+
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
+
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Master */
+ if (rsize != sumnp) {
+ errs++;
+ printf( "Did not create %d processes (got %d)\n", sumnp, rsize );
+ }
+ if (rank == 0) {
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ children, but we'll use a simpler loop to make sure that
+ we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm, MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ for (i=0; i<rsize; i++) {
+ char *expected = 0;
+ MPI_Recv( childwd, sizeof(childwd), MPI_CHAR, i, 2, intercomm,
+ MPI_STATUS_IGNORE );
+ /* The first set uses wd the second set curdir */
+ if (i <np[0]) expected = wd;
+ else expected = curdir;
+ if (strcmp( childwd, expected ) != 0) {
+ printf( "Expected a working dir of %s but child is in %s for child rank %d\n",
+ expected, childwd, i );
+ errs ++;
+ }
+ }
+ }
+ }
+ else {
+ /* Child */
+ char cname[MPI_MAX_OBJECT_NAME];
+ int rlen;
+
+ if (size != sumnp) {
+ errs++;
+ printf( "(Child) Did not create %d processes (got %d)\n",
+ sumnp, size );
+ }
+ /* Check the name of the parent */
+ cname[0] = 0;
+ MPI_Comm_get_name( intercomm, cname, &rlen );
+ /* MPI-2 section 8.4 requires that the parent have this
+ default name */
+ if (strcmp( cname, "MPI_COMM_PARENT" ) != 0) {
+ errs++;
+ printf( "Name of parent is not correct\n" );
+ if (rlen > 0 && cname[0]) {
+ printf( " Got %s but expected MPI_COMM_PARENT\n", cname );
+ }
+ else {
+ printf( " Expected MPI_COMM_PARENT but no name set\n" );
+ }
+ }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+ /* Send our notion of the current directory to the parent */
+ MPI_Send( curdir, strlen(curdir)+1, MPI_CHAR, 0, 2, intercomm );
+
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
- /* It isn't necessary to free the intercomm, but it should not hurt */
- MPI_Comm_free( &intercomm );
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ MPI_Comm_free( &intercomm );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- /* Note also that both the parent and child will generate "No Errors"
- if both call MTest_Finalize */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ /* Note also that both the parent and child will generate "No Errors"
+ if both call MTest_Finalize */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/spawnmult2.c b/test/mpi/spawn/spawnmult2.c
index 107403a..ab5b5a1 100644
--- a/test/mpi/spawn/spawnmult2.c
+++ b/test/mpi/spawn/spawnmult2.c
@@ -24,96 +24,103 @@ int main( int argc, char *argv[] )
int flag;
static int np[2] = { 1, 1 };
int *appnum_ptr;
+ int can_spawn;
MTest_Init( &argc, &argv );
- MPI_Comm_get_parent( &parentcomm );
- if (parentcomm == MPI_COMM_NULL) {
- /* Create 2 more processes */
- static char *cmds[2] = { (char*)"./spawnmult2", (char*)"./spawnmult2" };
- static MPI_Info infos[2] = { MPI_INFO_NULL, MPI_INFO_NULL };
- int errcodes[2];
+ MTestSpawnPossible(&can_spawn);
- MPI_Comm_spawn_multiple( 2, cmds, MPI_ARGVS_NULL, np, infos, 0,
- MPI_COMM_WORLD, &intercomm, errcodes );
+ if (can_spawn) {
+ MPI_Comm_get_parent( &parentcomm );
+ if (parentcomm == MPI_COMM_NULL) {
+ /* Create 2 more processes */
+ static char *cmds[2] = { (char*)"./spawnmult2", (char*)"./spawnmult2" };
+ static MPI_Info infos[2] = { MPI_INFO_NULL, MPI_INFO_NULL };
+ int errcodes[2];
- }
- else {
- intercomm = parentcomm;
- }
+ MPI_Comm_spawn_multiple( 2, cmds, MPI_ARGVS_NULL, np, infos, 0,
+ MPI_COMM_WORLD, &intercomm, errcodes );
- /* We now have a valid intercomm */
- MPI_Comm_remote_size( intercomm, &rsize );
- MPI_Comm_size( intercomm, &size );
- MPI_Comm_rank( intercomm, &rank );
+ }
+ else {
+ intercomm = parentcomm;
+ }
- if (parentcomm == MPI_COMM_NULL) {
- /* This is the master process */
- if (rsize != np[0] + np[1]) {
- errs++;
- printf( "Did not create %d processes (got %d)\n",
- np[0] + np[1], rsize );
- }
- if (rank == 0) {
- /* Tell each child process what rank we think they are */
- for (i=0; i<rsize; i++) {
- MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
- }
- /* We could use intercomm reduce to get the errors from the
- * children, but we'll use a simpler loop to make sure that
- * we get valid data */
- for (i=0; i<rsize; i++) {
- MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm,
- MPI_STATUS_IGNORE );
- errs += err;
- }
- }
- }
- else {
- /* Child process */
- /* FIXME: This assumes that stdout is handled for the children
- * (the error count will still be reported to the parent) */
- if (size != 2) {
- int wsize;
- errs++;
- printf( "(Child) Did not create 2 processes (got %d)\n", size);
- MPI_Comm_size( MPI_COMM_WORLD, &wsize );
- if (wsize == 2) {
- errs++;
- printf( "(Child) world size is 2 but local intercomm size is not 2\n" );
- }
- }
-
- MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
- if (i != rank) {
- errs++;
- printf( "Unexpected rank on child %d (%d)\n", rank, i );
- }
+ /* We now have a valid intercomm */
+ MPI_Comm_remote_size( intercomm, &rsize );
+ MPI_Comm_size( intercomm, &size );
+ MPI_Comm_rank( intercomm, &rank );
- /* Check for correct APPNUM */
- MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_APPNUM, &appnum_ptr, &flag );
- /* My appnum should be my rank in comm world */
- if (flag) {
- if (*appnum_ptr != rank) {
+ if (parentcomm == MPI_COMM_NULL) {
+ /* This is the master process */
+ if (rsize != np[0] + np[1]) {
errs++;
- printf( "appnum is %d but should be %d\n", *appnum_ptr, rank );
- }
- }
- else {
- errs++;
- printf( "appnum was not set\n" );
- }
+ printf( "Did not create %d processes (got %d)\n",
+ np[0] + np[1], rsize );
+ }
+ if (rank == 0) {
+ /* Tell each child process what rank we think they are */
+ for (i=0; i<rsize; i++) {
+ MPI_Send( &i, 1, MPI_INT, i, 0, intercomm );
+ }
+ /* We could use intercomm reduce to get the errors from the
+ * children, but we'll use a simpler loop to make sure that
+ * we get valid data */
+ for (i=0; i<rsize; i++) {
+ MPI_Recv( &err, 1, MPI_INT, i, 1, intercomm,
+ MPI_STATUS_IGNORE );
+ errs += err;
+ }
+ }
+ }
+ else {
+ /* Child process */
+ /* FIXME: This assumes that stdout is handled for the children
+ * (the error count will still be reported to the parent) */
+ if (size != 2) {
+ int wsize;
+ errs++;
+ printf( "(Child) Did not create 2 processes (got %d)\n", size);
+ MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+ if (wsize == 2) {
+ errs++;
+ printf( "(Child) world size is 2 but local intercomm size is not 2\n" );
+ }
+ }
- /* Send the errs back to the master process */
- MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
- }
+ MPI_Recv( &i, 1, MPI_INT, 0, 0, intercomm, &status );
+ if (i != rank) {
+ errs++;
+ printf( "Unexpected rank on child %d (%d)\n", rank, i );
+ }
+
+ /* Check for correct APPNUM */
+ MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_APPNUM, &appnum_ptr, &flag );
+ /* My appnum should be my rank in comm world */
+ if (flag) {
+ if (*appnum_ptr != rank) {
+ errs++;
+ printf( "appnum is %d but should be %d\n", *appnum_ptr, rank );
+ }
+ }
+ else {
+ errs++;
+ printf( "appnum was not set\n" );
+ }
+
+ /* Send the errs back to the master process */
+ MPI_Ssend( &errs, 1, MPI_INT, 0, 1, intercomm );
+ }
- /* It isn't necessary to free the intercomm, but it should not hurt */
- MPI_Comm_free( &intercomm );
+ /* It isn't necessary to free the intercomm, but it should not hurt */
+ MPI_Comm_free( &intercomm );
- /* Note that the MTest_Finalize get errs only over COMM_WORLD */
- if (parentcomm == MPI_COMM_NULL) {
- MTest_Finalize( errs );
+ /* Note that the MTest_Finalize get errs only over COMM_WORLD */
+ if (parentcomm == MPI_COMM_NULL) {
+ MTest_Finalize( errs );
+ }
+ } else {
+ MTest_Finalize( errs );
}
MPI_Finalize();
diff --git a/test/mpi/spawn/taskmaster.c b/test/mpi/spawn/taskmaster.c
index a68aab3..4a06629 100644
--- a/test/mpi/spawn/taskmaster.c
+++ b/test/mpi/spawn/taskmaster.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <pthread.h>
#include <mpi.h>
+#include "mpitest.h"
#define DEFAULT_TASKS 128
#define DEFAULT_TASK_WINDOW 2
@@ -65,6 +66,7 @@ int main(int argc, char *argv[])
#else
MPI_Comm * child;
#endif /* USE_THREADS */
+ int can_spawn, errs = 0;
#ifdef USE_THREADS
CHECK_SUCCESS(MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided));
@@ -76,6 +78,17 @@ int main(int argc, char *argv[])
CHECK_SUCCESS(MPI_Init(&argc, &argv));
#endif
+ errs += MTestSpawnPossible(&can_spawn);
+
+ if (!can_spawn) {
+ if (errs)
+ printf( " Found %d errors\n", errs );
+ else
+ printf( " No Errors\n" );
+ fflush( stdout );
+ goto fn_exit;
+ }
+
CHECK_SUCCESS(MPI_Comm_get_parent(&parent));
if (parent == MPI_COMM_NULL) { /* Parent communicator */
diff --git a/test/mpi/util/mtest.c b/test/mpi/util/mtest.c
index 553e533..43a1590 100644
--- a/test/mpi/util/mtest.c
+++ b/test/mpi/util/mtest.c
@@ -1711,3 +1711,59 @@ static void MTestRMACleanup( void )
#else
static void MTestRMACleanup( void ) {}
#endif
+
+/* ------------------------------------------------------------------------ */
+/* This function determines if it is possible to spawn addition MPI
+ * processes using MPI_COMM_SPAWN and MPI_COMM_SPAWN_MULTIPLE.
+ *
+ * It sets the can_spawn value to one of the following:
+ * 1 = yes, additional processes can be spawned
+ * 0 = no, MPI_UNIVERSE_SIZE <= the size of MPI_COMM_WORLD
+ * -1 = it is unknown whether or not processes can be spawned
+ * due to errors in the necessary query functions
+ *
+ */
+int MTestSpawnPossible(int * can_spawn)
+{
+ int errs = 0;
+
+ void * v = NULL;
+ int flag = -1;
+ int vval = -1;
+ int rc;
+
+ rc = MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &v, &flag );
+ if (rc!=MPI_SUCCESS) {
+ /* MPI_UNIVERSE_SIZE keyval missing from MPI_COMM_WORLD attributes */
+ *can_spawn = -1;
+ errs++;
+ }
+ else {
+ /* MPI_UNIVERSE_SIZE need not be set */
+ if (flag) {
+
+ int size = -1;
+ rc = MPI_Comm_size(MPI_COMM_WORLD, &size);
+ if (rc!=MPI_SUCCESS) {
+ /* MPI_Comm_size failed for MPI_COMM_WORLD */
+ *can_spawn = -1;
+ errs++;
+ }
+
+ vval = *(int *)v;
+ if (vval <= size) {
+ /* no additional processes can be spawned */
+ *can_spawn = 0;
+ }
+ else {
+ *can_spawn = 1;
+ }
+ }
+ else {
+ /* No attribute associated with key MPI_UNIVERSE_SIZE of MPI_COMM_WORLD */
+ *can_spawn = -1;
+ }
+ }
+ return errs;
+}
+/* ------------------------------------------------------------------------ */
-----------------------------------------------------------------------
Summary of changes:
test/mpi/f77/spawn/spawnargvf.f | 8 +
test/mpi/f77/spawn/spawnf.f | 8 +
test/mpi/f77/spawn/spawnmult2f.f | 9 +
test/mpi/f77/spawn/spawnmultf.f | 8 +
test/mpi/f77/util/mtestf.f | 40 ++++
test/mpi/f90/spawn/spawnargvf03.f90 | 9 +
test/mpi/f90/spawn/spawnmultf03.f90 | 8 +
test/mpi/include/mpitest.h | 2 +
test/mpi/include/mpitestcxx.h | 2 +
test/mpi/spawn/concurrent_spawns.c | 145 +++++++-------
test/mpi/spawn/disconnect.c | 135 +++++++------
test/mpi/spawn/disconnect2.c | 199 ++++++++++---------
test/mpi/spawn/disconnect3.c | 199 ++++++++++---------
test/mpi/spawn/disconnect_reconnect.c | 287 ++++++++++++++-------------
test/mpi/spawn/disconnect_reconnect2.c | 347 ++++++++++++++++---------------
test/mpi/spawn/disconnect_reconnect3.c | 280 +++++++++++++-------------
test/mpi/spawn/spaconacc.c | 315 +++++++++++++++--------------
test/mpi/spawn/spaconacc2.c | 321 +++++++++++++++--------------
test/mpi/spawn/spaiccreate.c | 117 ++++++-----
test/mpi/spawn/spaiccreate2.c | 93 +++++----
test/mpi/spawn/spawn1.c | 158 ++++++++-------
test/mpi/spawn/spawn2.c | 253 ++++++++++++-----------
test/mpi/spawn/spawnargv.c | 153 ++++++++-------
test/mpi/spawn/spawninfo1.c | 211 ++++++++++----------
test/mpi/spawn/spawnintra.c | 337 ++++++++++++++++---------------
test/mpi/spawn/spawnmanyarg.c | 155 ++++++++-------
test/mpi/spawn/spawnminfo1.c | 227 +++++++++++----------
test/mpi/spawn/spawnmult2.c | 163 ++++++++-------
test/mpi/spawn/taskmaster.c | 13 ++
test/mpi/util/mtest.c | 56 +++++
30 files changed, 2282 insertions(+), 1976 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-140-g4d106d4
by noreply@mpich.org 10 Apr '14
by noreply@mpich.org 10 Apr '14
10 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 4d106d4b77560638cfae0c6b98259376d1394dbd (commit)
from a80bf84aecfc6c6152474623d418b2a3cb71fd53 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/4d106d4b77560638cfae0c6b98259376d…
commit 4d106d4b77560638cfae0c6b98259376d1394dbd
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Wed Apr 9 16:21:37 2014 -0500
Added more information on mpiexec to the user guide.
Signed-off-by: Wesley Bland <wbland(a)anl.gov>
diff --git a/doc/userguide/user.tex.vin b/doc/userguide/user.tex.vin
index 80c2e8b..21b2b89 100644
--- a/doc/userguide/user.tex.vin
+++ b/doc/userguide/user.tex.vin
@@ -236,33 +236,35 @@ provides some extensions.
\label{sec:mpiexec-standard}
Here we describe the standard \texttt{mpiexec} arguments from the MPI
-Standard~\cite{mpi-forum:mpi2-journal}. The simplest form of a
-command to start an MPI job is
+Standard~\cite{mpi-forum:mpi2-journal}. To run a program with 'n'
+processes on your local machine, you can use:
\begin{verbatim}
- mpiexec -f machinefile -n 32 a.out
+ mpiexec -n <number> ./a.out
\end{verbatim}
-to start the executable \texttt{a.out} with 32 processes (providing an
-\texttt{MPI\_COMM\_WORLD} of size 32 inside the MPI application).
-Other options are supported, for search paths for executables, working
-directories, and even a more general way of specifying a number of
-processes. Multiple sets of processes can be run with different
-executables and different values for their arguments, with
-``\texttt{:}'' separating the sets of processes, as in:
+To test that you can run an 'n' process job on multiple nodes:
\begin{verbatim}
- mpiexec -f machinefile -n 1 ./master : -n 32 ./slave
+ mpiexec -f machinefile -n <number> ./a.out
\end{verbatim}
-It is also possible to start a one process MPI job (with a
-\texttt{MPI\_COMM\_WORLD} whose size is equal to 1), without using
-\texttt{mpiexec}. This process will become an MPI process when it
-calls \texttt{MPI\_Init}, and it may then call other MPI functions.
-Currently, MPICH does not fully support calling the dynamic process
-routines from the MPI standard (e.g., \texttt{MPI\_Comm\_spawn} or
-\texttt{MPI\_Comm\_accept}) from processes that are not started with
-\texttt{mpiexec}.
+The 'machinefile' is of the form:
+
+\begin{verbatim}
+ host1
+ host2:2
+ host3:4 # Random comments
+ host4:1
+\end{verbatim}
+
+'host1', 'host2', 'host3' and 'host4' are the hostnames of the
+machines you want to run the job on. The ':2', ':4', ':1' segments
+depict the number of processes you want to run on each node. If
+nothing is specified, ':1' is assumed.
+
+More details on interacting with Hydra can be found at
+\url{http://wiki.mpich.org/mpich/index.php/Using_the_Hydra_Process_Manager}
\subsection{Extensions for All Process Management Environments}
-----------------------------------------------------------------------
Summary of changes:
doc/userguide/user.tex.vin | 40 +++++++++++++++++++++-------------------
1 files changed, 21 insertions(+), 19 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-139-ga80bf84
by noreply@mpich.org 07 Apr '14
by noreply@mpich.org 07 Apr '14
07 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via a80bf84aecfc6c6152474623d418b2a3cb71fd53 (commit)
from e24b44a721b37a92cfc46baa12c037c25a25efb5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/a80bf84aecfc6c6152474623d418b2a3c…
commit a80bf84aecfc6c6152474623d418b2a3cb71fd53
Author: James Dinan <james.dinan(a)intel.com>
Date: Mon Mar 3 14:06:02 2014 -0500
Add RMA accumulate test with min/maxloc operator
Add a test to check for correct behavior of MPI_Accumulate operations
with the MPI_MINLOC and MPI_MAXLOC operations.
Signed-off-by: Xin Zhao <xinzhao3(a)illinois.edu>
diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 87b506c..61fb401 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -121,7 +121,8 @@ noinst_PROGRAMS = \
mutex_bench_shm \
rma-contig \
badrma \
- nb_test
+ nb_test \
+ acc-loc
strided_acc_indexed_LDADD = $(LDADD) -lm
strided_acc_onelock_LDADD = $(LDADD) -lm
diff --git a/test/mpi/rma/acc-loc.c b/test/mpi/rma/acc-loc.c
new file mode 100644
index 0000000..18c3e3a
--- /dev/null
+++ b/test/mpi/rma/acc-loc.c
@@ -0,0 +1,147 @@
+/*
+ * (C) 2006 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ *
+ * Portions of this code were written by Intel Corporation.
+ * Copyright (C) 2011-2012 Intel Corporation. Intel provides this material
+ * to Argonne National Laboratory subject to Software Grant and Corporate
+ * Contributor License Agreement dated February 8, 2012.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+typedef struct {
+ int val;
+ int loc;
+} twoint_t;
+
+static int errors = 0;
+
+int main(int argc, char **argv) {
+ int me, nproc;
+ twoint_t *data = NULL;
+ twoint_t mine;
+ MPI_Win win;
+
+ MTest_Init(&argc, &argv);
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &me);
+ MPI_Comm_size(MPI_COMM_WORLD, &nproc);
+
+ if (me == 0) {
+ MPI_Alloc_mem(sizeof(twoint_t), MPI_INFO_NULL, &data);
+ }
+
+ MPI_Win_create(data, me == 0 ? sizeof(twoint_t) : 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win);
+ MPI_Win_fence(MPI_MODE_NOPRECEDE, win);
+
+ /* All processes perform MAXLOC and MINLOC operations on a 2INT on rank 0.
+ * The loc is the origin process' rank, and the value is (nproc-me). In
+ * the case of MAXLOC, rank 0 should win and in the case of MINLOC, rank
+ * nproc-1 should win.
+ */
+
+ /** Test MAXLOC **/
+
+ if (me == 0) {
+ data->val = 0;
+ data->loc = -1;
+ }
+ MPI_Win_fence(0, win);
+
+ mine.loc = me;
+ mine.val = nproc - me;
+ MPI_Accumulate(&mine, 1, MPI_2INT, 0, 0, 1, MPI_2INT, MPI_MAXLOC, win);
+ MPI_Win_fence(0, win);
+
+ if (me == 0 && (data->loc != 0 || data->val != nproc)) {
+ errors++;
+ printf("Expected: { loc = %d, val = %d } Actual: { loc = %d, val = %d }\n",
+ 0, nproc, data->loc, data->val);
+ }
+
+ /** Test MINLOC **/
+
+ if (me == 0) {
+ data->val = nproc;
+ data->loc = -1;
+ }
+ MPI_Win_fence(0, win);
+
+ mine.loc = me;
+ mine.val = nproc - me;
+ MPI_Accumulate(&mine, 1, MPI_2INT, 0, 0, 1, MPI_2INT, MPI_MINLOC, win);
+ MPI_Win_fence(0, win);
+
+ if (me == 0 && (data->loc != nproc-1 || data->val != 1)) {
+ errors++;
+ printf("Expected: { loc = %d, val = %d } Actual: { loc = %d, val = %d }\n",
+ nproc-1, 1, data->loc, data->val);
+ }
+
+ /* All processes perform MAXLOC and MINLOC operations on a 2INT on rank 0.
+ * The loc is the origin process' rank, and the value is 1. In both cases,
+ * rank 0 should win because the values are equal and it has the lowest
+ * loc.
+ */
+
+ /** Test MAXLOC **/
+
+ if (me == 0) {
+ data->val = 0;
+ data->loc = -1;
+ }
+ MPI_Win_fence(MPI_MODE_NOSUCCEED, win);
+
+ mine.loc = me;
+ mine.val = 1;
+
+ MPI_Win_lock(MPI_LOCK_SHARED, 0, MPI_MODE_NOCHECK, win);
+ MPI_Accumulate(&mine, 1, MPI_2INT, 0, 0, 1, MPI_2INT, MPI_MAXLOC, win);
+ MPI_Win_unlock(0, win);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if (me == 0 && (data->loc != 0 || data->val != 1)) {
+ errors++;
+ printf("Expected: { loc = %d, val = %d } Actual: { loc = %d, val = %d }\n",
+ 0, 1, data->loc, data->val);
+ }
+ MPI_Win_fence(MPI_MODE_NOPRECEDE, win);
+
+ /** Test MINLOC **/
+
+ if (me == 0) {
+ data->val = nproc;
+ data->loc = -1;
+ }
+ MPI_Win_fence(MPI_MODE_NOSUCCEED, win);
+
+ mine.loc = me;
+ mine.val = 1;
+
+ MPI_Win_lock(MPI_LOCK_SHARED, 0, MPI_MODE_NOCHECK, win);
+ MPI_Accumulate(&mine, 1, MPI_2INT, 0, 0, 1, MPI_2INT, MPI_MINLOC, win);
+ MPI_Win_unlock(0, win);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if (me == 0 && (data->loc != 0 || data->val != 1)) {
+ errors++;
+ printf("Expected: { loc = %d, val = %d } Actual: { loc = %d, val = %d }\n",
+ 0, 1, data->loc, data->val);
+ }
+
+ MPI_Win_free(&win);
+
+ if (me == 0) {
+ MPI_Free_mem(data);
+ }
+
+ MTest_Finalize(errors);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/testlist.in b/test/mpi/rma/testlist.in
index f30f568..847689c 100644
--- a/test/mpi/rma/testlist.in
+++ b/test/mpi/rma/testlist.in
@@ -106,6 +106,7 @@ mutex_bench_shared 4 mpiversion=3.0
mutex_bench_shm 4 mpiversion=3.0
rma-contig 2 mpiversion=3.0 timeLimit=600
badrma 2 mpiversion=3.0
+acc-loc 4
## This test is not strictly correct. This was meant to test out the
## case when MPI_Test is not nonblocking. However, we ended up
-----------------------------------------------------------------------
Summary of changes:
test/mpi/rma/Makefile.am | 3 +-
test/mpi/rma/acc-loc.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++
test/mpi/rma/testlist.in | 1 +
3 files changed, 150 insertions(+), 1 deletions(-)
create mode 100644 test/mpi/rma/acc-loc.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-138-ge24b44a
by noreply@mpich.org 07 Apr '14
by noreply@mpich.org 07 Apr '14
07 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via e24b44a721b37a92cfc46baa12c037c25a25efb5 (commit)
from b912961fbd620568dd0ec36515720739f0fb0be9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/e24b44a721b37a92cfc46baa12c037c25…
commit e24b44a721b37a92cfc46baa12c037c25a25efb5
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat Apr 5 19:42:59 2014 -0500
Reorder libmpi and libpmpi builds.
libmpi depends on libpmpi. We need to build them in that order to
make sure the dependencies are satisfied. libtool should do this
automatically, but it does not. More description of the error is
available here: https://bugzilla.redhat.com/show_bug.cgi?id=91110
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/Makefile.am b/Makefile.am
index acf89f2..fc9e804 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -141,6 +141,9 @@ if BUILD_PROFILING_LIB
lib_lib@PMPILIBNAME@_la_LIBADD =
endif BUILD_PROFILING_LIB
+lib_lib@MPILIBNAME@_la_SOURCES =
+lib_lib@MPILIBNAME@_la_LDFLAGS =
+lib_lib@MPILIBNAME@_la_CPPFLAGS =
lib_lib@MPILIBNAME@_la_LIBADD =
if BUILD_F77_BINDING
@@ -155,24 +158,28 @@ endif BUILD_CXX_BINDING
include maint/Makefile.mk
include src/Makefile.mk
-lib_LTLIBRARIES += lib/lib@[email protected]
-lib_lib@MPILIBNAME@_la_SOURCES = $(mpi_sources)
-lib_lib@MPILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
-lib_lib@MPILIBNAME@_la_LIBADD += $(external_libs)
-lib_lib@MPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS)
-
if BUILD_PROFILING_LIB
lib_LTLIBRARIES += lib/lib@[email protected]
# dropping mpi_fc_sources and mpi_cxx_sources from the below PMPI list
# since they don't contribute any PMPI symbols.
lib_lib@PMPILIBNAME@_la_SOURCES = $(mpi_sources) $(mpi_f77_sources) $(mpi_core_sources)
-lib_lib@PMPILIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
+lib_lib@PMPILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
+lib_lib@PMPILIBNAME@_la_LIBADD += $(external_libs)
lib_lib@MPILIBNAME@_la_CPPFLAGS += -DMPICH_MPI_FROM_PMPI
lib_lib@MPILIBNAME@_la_LIBADD += lib/lib@[email protected]
else !BUILD_PROFILING_LIB
lib_lib@MPILIBNAME@_la_SOURCES += $(mpi_core_sources)
+lib_lib@MPILIBNAME@_la_LIBADD += $(external_libs)
endif !BUILD_PROFILING_LIB
+# lib@[email protected] might depend on lib@[email protected]. We add them
+# in that order to lib_LTLIBRARIES so libtool doesn't get
+# confused. (see https://bugzilla.redhat.com/show_bug.cgi?id=91110)
+lib_LTLIBRARIES += lib/lib@[email protected]
+lib_lib@MPILIBNAME@_la_SOURCES += $(mpi_sources)
+lib_lib@MPILIBNAME@_la_LDFLAGS += $(external_ldflags) $(ABIVERSIONFLAGS)
+lib_lib@MPILIBNAME@_la_CPPFLAGS += $(AM_CPPFLAGS)
+
if BUILD_F77_BINDING
lib_LTLIBRARIES += lib/lib@[email protected]
lib_lib@MPIFCLIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS)
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-137-gb912961
by noreply@mpich.org 03 Apr '14
by noreply@mpich.org 03 Apr '14
03 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via b912961fbd620568dd0ec36515720739f0fb0be9 (commit)
from cc50ed51a98bf1bf5e572bf32ac11f6d173bf701 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/b912961fbd620568dd0ec36515720739f…
commit b912961fbd620568dd0ec36515720739f0fb0be9
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Thu Apr 3 12:53:15 2014 -0500
Bug: Inverted logic for scalable resize check
if a file system supports scalable resize, we can continue to defer
open. I had the logic backwards and conduced the deferred open when we
did not need to (and did not when we did). Thanks, Paul Coffman.
Signed-off-by: Paul Coffman <pkcoff(a)us.ibm.com>
diff --git a/src/mpi/romio/mpi-io/set_size.c b/src/mpi/romio/mpi-io/set_size.c
index e36c1f9..b5c4e93 100644
--- a/src/mpi/romio/mpi-io/set_size.c
+++ b/src/mpi/romio/mpi-io/set_size.c
@@ -78,7 +78,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size)
}
/* --END ERROR HANDLING-- */
- if (ADIO_Feature(adio_fh, ADIO_SCALABLE_RESIZE)) {
+ if (!ADIO_Feature(adio_fh, ADIO_SCALABLE_RESIZE)) {
/* rare stupid file systems (like NFS) need to carry out resize on all
* processes */
ADIOI_TEST_DEFERRED(adio_fh, "MPI_File_set_size", &error_code);
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/mpi-io/set_size.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1-136-gcc50ed5
by noreply@mpich.org 03 Apr '14
by noreply@mpich.org 03 Apr '14
03 Apr '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via cc50ed51a98bf1bf5e572bf32ac11f6d173bf701 (commit)
from 1a6b652432cc85a976eeaaf011d13fe7dcf302a3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/cc50ed51a98bf1bf5e572bf32ac11f6d1…
commit cc50ed51a98bf1bf5e572bf32ac11f6d173bf701
Author: Paul Coffman <pkcoff(a)us.ibm.com>
Date: Tue Apr 1 06:27:14 2014 -0500
Balance-contig fix: wrong initial index
in the final sort on the bridgelist, was starting an index at -1
instead of 0, resulting in typically bizzare (occaional) memory errors.
Signed-off-by: Rob Latham <robl(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c b/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c
index 5c9c9bc..0812b78 100644
--- a/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c
+++ b/src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c
@@ -418,7 +418,7 @@ ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd,
// for each ion make sure bridgelist is in rank order
int startSortIndex = -1;
int endSortIndex = -1;
- int currentBridgeIndex = -1;
+ int currentBridgeIndex = 0;
while (endSortIndex < numbridges) {
int currentIonId = summaryranklistionids[currentBridgeIndex];
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0