Skip to content
Snippets Groups Projects
Commit 8666603b authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Change resource copying check to work in serial case.

parent 4dcc8808
No related branches found
No related tags found
No related merge requests found
......@@ -361,6 +361,7 @@ tests/test_cksum_service.in -text
tests/test_grib.c -text
tests/test_grib.sh -text
tests/test_resource_copy.c -text
tests/test_resource_copy_mpi_run.in -text
tests/var_cksum.c -text
tests/var_cksum.h -text
util/mpi_launch_poe -text
......
......@@ -692,6 +692,41 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# AM_PROG_CC_C_O
# --------------
# Like AC_PROG_CC_C_O, but changed for automake.
AC_DEFUN([AM_PROG_CC_C_O],
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
if test "$am_t" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
dnl Make sure AC_PROG_CC is never called again, or it will override our
dnl setting of CC.
m4_define([AC_PROG_CC],
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
......
......@@ -12122,6 +12122,132 @@ if test "x$ac_cv_prog_cc_c99" != xno; then :
fi
 
 
if test "x$CC" != xcc; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } &&
test -f conftest2.$ac_objext && { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
if { ac_try='cc -c conftest.$ac_ext >&5'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } &&
test -f conftest2.$ac_objext && { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; };
then
# cc works too.
:
else
# cc exists but doesn't like -o.
eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
fi
fi
else
eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
rm -f core conftest*
fi
if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
fi
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
if test "$am_t" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
......@@ -27557,7 +27683,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
 
 
ac_config_files="$ac_config_files tests/test_cksum_grib tests/test_cksum_nc tests/test_cksum_nc2 tests/test_cksum_nc4 tests/test_cksum_extra tests/test_cksum_service tests/test_cksum_ieg tests/test_chunk_cksum tests/pio_write_run tests/pio_cksum_mpinonb tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer tests/pio_cksum_cdf util/serialrun"
ac_config_files="$ac_config_files tests/test_cksum_grib tests/test_cksum_nc tests/test_cksum_nc2 tests/test_cksum_nc4 tests/test_cksum_extra tests/test_cksum_service tests/test_cksum_ieg tests/test_chunk_cksum tests/pio_write_run tests/pio_cksum_mpinonb tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer tests/pio_cksum_cdf tests/test_resource_copy_mpi_run util/serialrun"
 
 
ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings examples/pio/Makefile src/pkgconfig/cdi.pc src/pkgconfig/cdipio.pc"
......@@ -28913,6 +29039,7 @@ do
"tests/pio_cksum_asynch") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_asynch" ;;
"tests/pio_cksum_writer") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_writer" ;;
"tests/pio_cksum_cdf") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_cdf" ;;
"tests/test_resource_copy_mpi_run") CONFIG_FILES="$CONFIG_FILES tests/test_resource_copy_mpi_run" ;;
"util/serialrun") CONFIG_FILES="$CONFIG_FILES util/serialrun" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
......@@ -30744,6 +30871,7 @@ _LT_EOF
"tests/pio_cksum_asynch":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_writer":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_cdf":F) chmod a+x "$ac_file" ;;
"tests/test_resource_copy_mpi_run":F) chmod a+x "$ac_file" ;;
"util/serialrun":F) chmod a+x "$ac_file" ;;
 
esac
......
......@@ -22,6 +22,7 @@ LT_INIT([pic-only])
# Check building environment
AC_CHECK_TOOL([CC],[gcc],[:])
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_FC
AS_IF([test -n "$FC" && test "X$FC" != "Xno"],
[AC_FC_SRCEXT([f90])
......@@ -330,6 +331,7 @@ AC_CONFIG_FILES([tests/test_cksum_grib \
tests/pio_cksum_asynch \
tests/pio_cksum_writer \
tests/pio_cksum_cdf \
tests/test_resource_copy_mpi_run \
util/serialrun],[chmod a+x "$ac_file"])
AC_OUTPUT([Makefile src/Makefile interfaces/Makefile app/Makefile \
......
......@@ -173,6 +173,9 @@
*/
#undef LT_OBJDIR
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Name of package */
#undef PACKAGE
......
......@@ -19,17 +19,21 @@ cksum_read_SOURCES = cksum_read.c \
stream_cksum.c stream_cksum.h \
ensure_array_size.h ensure_array_size.c
pio_write_SOURCES = pio_write.c pio_write.h simple_model.c
test_resource_copy_SOURCES = test_resource_copy.c
test_resource_copy_SOURCES = test_resource_copy.c \
$(top_srcdir)/src/resource_unpack.c
test_resource_copy_mpi_SOURCES = test_resource_copy.c
#
AM_CFLAGS = $(YAXT_CFLAGS)
if USE_MPI
pio_write_LDADD= ../src/libcdipio.la
test_resource_copy_LDADD = ../src/libcdipio.la
pio_write_LDADD = ../src/libcdipio.la
TESTS += test_resource_copy_mpi_run
check_PROGRAMS += test_resource_copy_mpi
test_resource_copy_mpi_LDADD = ../src/libcdipio.la
test_resource_copy_mpi_CFLAGS = $(AM_CFLAGS) $(CFLAGS) -DMPI_MARSHALLING
else
pio_write_LDADD = $(LDADD)
test_resource_copy_SOURCES += $(top_srcdir)/src/resource_unpack.c
test_resource_copy_LDADD = ../src/libcdi.la
endif
LDADD = ../src/libcdi.la -lm
INCLUDES = -I$(top_srcdir)/src
#
......
......@@ -55,11 +55,13 @@ TESTS = test_grib.sh cksum_verify$(EXEEXT) test_cksum_grib \
test_cksum_nc2 test_cksum_nc4 test_cksum_ieg test_chunk_cksum \
pio_write_run pio_cksum_mpinonb pio_cksum_fpguard \
pio_cksum_asynch pio_cksum_writer pio_cksum_cdf \
test_resource_copy$(EXEEXT)
test_resource_copy$(EXEEXT) $(am__append_1)
check_PROGRAMS = cksum_verify$(EXEEXT) test_grib$(EXEEXT) \
cksum_write$(EXEEXT) cksum_read$(EXEEXT) pio_write$(EXEEXT) \
test_resource_copy$(EXEEXT) cksum_write_chunk$(EXEEXT)
@USE_MPI_FALSE@am__append_1 = $(top_srcdir)/src/resource_unpack.c
test_resource_copy$(EXEEXT) cksum_write_chunk$(EXEEXT) \
$(am__EXEEXT_1)
@USE_MPI_TRUE@am__append_1 = test_resource_copy_mpi_run
@USE_MPI_TRUE@am__append_2 = test_resource_copy_mpi
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/pio_cksum_asynch.in $(srcdir)/pio_cksum_cdf.in \
......@@ -68,7 +70,8 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/test_chunk_cksum.in $(srcdir)/test_cksum_extra.in \
$(srcdir)/test_cksum_grib.in $(srcdir)/test_cksum_ieg.in \
$(srcdir)/test_cksum_nc.in $(srcdir)/test_cksum_nc2.in \
$(srcdir)/test_cksum_nc4.in $(srcdir)/test_cksum_service.in
$(srcdir)/test_cksum_nc4.in $(srcdir)/test_cksum_service.in \
$(srcdir)/test_resource_copy_mpi_run.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
......@@ -90,8 +93,9 @@ CONFIG_CLEAN_FILES = test_cksum_grib test_cksum_nc test_cksum_nc2 \
test_cksum_nc4 test_cksum_extra test_cksum_service \
test_cksum_ieg test_chunk_cksum pio_write_run \
pio_cksum_mpinonb pio_cksum_fpguard pio_cksum_asynch \
pio_cksum_writer pio_cksum_cdf
pio_cksum_writer pio_cksum_cdf test_resource_copy_mpi_run
CONFIG_CLEAN_VPATH_FILES =
@USE_MPI_TRUE@am__EXEEXT_1 = test_resource_copy_mpi$(EXEEXT)
am_cksum_read_OBJECTS = cksum_read.$(OBJEXT) var_cksum.$(OBJEXT) \
stream_cksum.$(OBJEXT) ensure_array_size.$(OBJEXT)
cksum_read_OBJECTS = $(am_cksum_read_OBJECTS)
......@@ -118,14 +122,20 @@ am_test_grib_OBJECTS = test_grib.$(OBJEXT)
test_grib_OBJECTS = $(am_test_grib_OBJECTS)
test_grib_LDADD = $(LDADD)
test_grib_DEPENDENCIES = ../src/libcdi.la
am__test_resource_copy_SOURCES_DIST = test_resource_copy.c \
$(top_srcdir)/src/resource_unpack.c
@USE_MPI_FALSE@am__objects_1 = resource_unpack.$(OBJEXT)
am_test_resource_copy_OBJECTS = test_resource_copy.$(OBJEXT) \
$(am__objects_1)
resource_unpack.$(OBJEXT)
test_resource_copy_OBJECTS = $(am_test_resource_copy_OBJECTS)
@USE_MPI_FALSE@test_resource_copy_DEPENDENCIES = ../src/libcdi.la
@USE_MPI_TRUE@test_resource_copy_DEPENDENCIES = ../src/libcdipio.la
test_resource_copy_LDADD = $(LDADD)
test_resource_copy_DEPENDENCIES = ../src/libcdi.la
am_test_resource_copy_mpi_OBJECTS = \
test_resource_copy_mpi-test_resource_copy.$(OBJEXT)
test_resource_copy_mpi_OBJECTS = $(am_test_resource_copy_mpi_OBJECTS)
@USE_MPI_TRUE@test_resource_copy_mpi_DEPENDENCIES = \
@USE_MPI_TRUE@ ../src/libcdipio.la
test_resource_copy_mpi_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(test_resource_copy_mpi_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
......@@ -142,11 +152,13 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
SOURCES = $(cksum_read_SOURCES) $(cksum_verify_SOURCES) \
$(cksum_write_SOURCES) $(cksum_write_chunk_SOURCES) \
$(pio_write_SOURCES) $(test_grib_SOURCES) \
$(test_resource_copy_SOURCES)
$(test_resource_copy_SOURCES) \
$(test_resource_copy_mpi_SOURCES)
DIST_SOURCES = $(cksum_read_SOURCES) $(cksum_verify_SOURCES) \
$(cksum_write_SOURCES) $(cksum_write_chunk_SOURCES) \
$(pio_write_SOURCES) $(test_grib_SOURCES) \
$(am__test_resource_copy_SOURCES_DIST)
$(test_resource_copy_SOURCES) \
$(test_resource_copy_mpi_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
......@@ -366,13 +378,16 @@ cksum_read_SOURCES = cksum_read.c \
ensure_array_size.h ensure_array_size.c
pio_write_SOURCES = pio_write.c pio_write.h simple_model.c
test_resource_copy_SOURCES = test_resource_copy.c $(am__append_1)
test_resource_copy_SOURCES = test_resource_copy.c \
$(top_srcdir)/src/resource_unpack.c
test_resource_copy_mpi_SOURCES = test_resource_copy.c
#
AM_CFLAGS = $(YAXT_CFLAGS)
@USE_MPI_FALSE@pio_write_LDADD = $(LDADD)
@USE_MPI_TRUE@pio_write_LDADD = ../src/libcdipio.la
@USE_MPI_FALSE@test_resource_copy_LDADD = ../src/libcdi.la
@USE_MPI_TRUE@test_resource_copy_LDADD = ../src/libcdipio.la
@USE_MPI_TRUE@test_resource_copy_mpi_LDADD = ../src/libcdipio.la
@USE_MPI_TRUE@test_resource_copy_mpi_CFLAGS = $(AM_CFLAGS) $(CFLAGS) -DMPI_MARSHALLING
LDADD = ../src/libcdi.la -lm
INCLUDES = -I$(top_srcdir)/src
#
......@@ -443,6 +458,8 @@ pio_cksum_writer: $(top_builddir)/config.status $(srcdir)/pio_cksum_writer.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
pio_cksum_cdf: $(top_builddir)/config.status $(srcdir)/pio_cksum_cdf.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
test_resource_copy_mpi_run: $(top_builddir)/config.status $(srcdir)/test_resource_copy_mpi_run.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
......@@ -473,6 +490,9 @@ test_grib$(EXEEXT): $(test_grib_OBJECTS) $(test_grib_DEPENDENCIES) $(EXTRA_test_
test_resource_copy$(EXEEXT): $(test_resource_copy_OBJECTS) $(test_resource_copy_DEPENDENCIES) $(EXTRA_test_resource_copy_DEPENDENCIES)
@rm -f test_resource_copy$(EXEEXT)
$(LINK) $(test_resource_copy_OBJECTS) $(test_resource_copy_LDADD) $(LIBS)
test_resource_copy_mpi$(EXEEXT): $(test_resource_copy_mpi_OBJECTS) $(test_resource_copy_mpi_DEPENDENCIES) $(EXTRA_test_resource_copy_mpi_DEPENDENCIES)
@rm -f test_resource_copy_mpi$(EXEEXT)
$(test_resource_copy_mpi_LINK) $(test_resource_copy_mpi_OBJECTS) $(test_resource_copy_mpi_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
......@@ -491,6 +511,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_cksum.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_grib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_resource_copy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/var_cksum.Po@am__quote@
.c.o:
......@@ -528,6 +549,20 @@ resource_unpack.obj: $(top_srcdir)/src/resource_unpack.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o resource_unpack.obj `if test -f '$(top_srcdir)/src/resource_unpack.c'; then $(CYGPATH_W) '$(top_srcdir)/src/resource_unpack.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/resource_unpack.c'; fi`
test_resource_copy_mpi-test_resource_copy.o: test_resource_copy.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_resource_copy_mpi_CFLAGS) $(CFLAGS) -MT test_resource_copy_mpi-test_resource_copy.o -MD -MP -MF $(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Tpo -c -o test_resource_copy_mpi-test_resource_copy.o `test -f 'test_resource_copy.c' || echo '$(srcdir)/'`test_resource_copy.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Tpo $(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_resource_copy.c' object='test_resource_copy_mpi-test_resource_copy.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_resource_copy_mpi_CFLAGS) $(CFLAGS) -c -o test_resource_copy_mpi-test_resource_copy.o `test -f 'test_resource_copy.c' || echo '$(srcdir)/'`test_resource_copy.c
test_resource_copy_mpi-test_resource_copy.obj: test_resource_copy.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_resource_copy_mpi_CFLAGS) $(CFLAGS) -MT test_resource_copy_mpi-test_resource_copy.obj -MD -MP -MF $(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Tpo -c -o test_resource_copy_mpi-test_resource_copy.obj `if test -f 'test_resource_copy.c'; then $(CYGPATH_W) 'test_resource_copy.c'; else $(CYGPATH_W) '$(srcdir)/test_resource_copy.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Tpo $(DEPDIR)/test_resource_copy_mpi-test_resource_copy.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_resource_copy.c' object='test_resource_copy_mpi-test_resource_copy.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_resource_copy_mpi_CFLAGS) $(CFLAGS) -c -o test_resource_copy_mpi-test_resource_copy.obj `if test -f 'test_resource_copy.c'; then $(CYGPATH_W) 'test_resource_copy.c'; else $(CYGPATH_W) '$(srcdir)/test_resource_copy.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
......
......@@ -3,23 +3,26 @@
#endif
#include <stdio.h>
#include <string.h>
#ifdef USE_MPI
#include <mpi.h>
#include "cdi.h"
#include "cdipio.h"
#include "dmemory.h"
#include "error.h"
#include "resource_handle.h"
#include "resource_unpack.h"
#ifdef MPI_MARSHALLING
#include <mpi.h>
#include "cdipio.h"
#include "pio_serialize.h"
#include "pio_util.h"
#else
typedef int MPI_Comm;
#endif
extern void arrayDestroy ( void );
enum {
IOMode = PIO_NONE,
nProcsIO = 1,
nNamespaces = 2,
DOUBLE_PRECISION = 8,
nlon = 12,
nlat = 6,
......@@ -175,16 +178,18 @@ int defineModel ( int instID )
return modelID;
}
int modelRun ( MPI_Comm comm )
static int destNamespace;
int modelRun(MPI_Comm comm)
{
int gridID, zaxisID, taxisID, instID, modelID, vlistID, streamID;
char * recvBuffer, * sendBuffer;
int bufferSize, differ;
namespaceSetActive(0);
if (IOMode != PIO_NONE)
serializeSetMPI();
#ifdef MPI_MARSHALLING
serializeSetMPI();
#endif
gridID = defineGrid ();
zaxisID = defineZaxis ();
......@@ -198,13 +203,17 @@ int modelRun ( MPI_Comm comm )
reshPackBufferCreate ( &sendBuffer, &bufferSize, &comm );
recvBuffer = xmalloc(bufferSize);
#ifdef MPI_MARSHALLING
xmpi(MPI_Sendrecv(sendBuffer, bufferSize, MPI_PACKED, 0, 0,
recvBuffer, bufferSize, MPI_PACKED, 0, 0,
MPI_COMM_SELF, MPI_STATUS_IGNORE));
namespaceSetActive(1);
#else
memcpy(recvBuffer, sendBuffer, bufferSize);
#endif
namespaceSetActive(destNamespace);
reshUnpackResources(recvBuffer, bufferSize, &comm);
free ( recvBuffer );
reshPackBufferDestroy ( &sendBuffer );
free(recvBuffer);
reshPackBufferDestroy(&sendBuffer);
differ = reshListCompare ( 0, 1 );
......@@ -213,35 +222,22 @@ int modelRun ( MPI_Comm comm )
return differ;
}
#endif
int main (int argc, char *argv[])
{
int exitCode = 77;
#ifdef USE_MPI
int sizeGlob, pioNamespace;
MPI_Comm commGlob, commModel;
MPI_Comm commModel;
#ifdef MPI_MARSHALLING
MPI_Init(&argc, &argv);
xmpi ( MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob ));
xmpi ( MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN ));
xmpi ( MPI_Comm_size ( commGlob, &sizeGlob ));
if ( sizeGlob != 1 )
xabort ( "test transition of resource array only with 1 PE." );
if ( nProcsIO != 1 )
xabort ( "bad distribution of tasks on PEs" );
commModel = pioInit(commGlob, nProcsIO, IOMode, &pioNamespace, 1.0f,
cdiPioNoPostCommSetup);
namespaceSetActive(pioNamespace);
commModel = MPI_COMM_WORLD;
#else
commModel = 0;
#endif
destNamespace = namespaceNew();
exitCode = modelRun(commModel);
#ifdef MPI_MARSHALLING
xmpi(MPI_Finalize());
#else
printf ( "Use MPI for this testprogram.\n" );
#endif
return exitCode;
......
#! @SHELL@
set -e
mpi_task_num="${mpi_task_num-1}"
../libtool --mode=execute @MPI_LAUNCH@ -n ${mpi_task_num} \
./test_resource_copy_mpi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment