diff --git a/ompi/mca/io/romio314/REFRESH_NOTES.txt b/ompi/mca/io/romio314/REFRESH_NOTES.txt deleted file mode 100644 index c21a5c36c7..0000000000 --- a/ompi/mca/io/romio314/REFRESH_NOTES.txt +++ /dev/null @@ -1,58 +0,0 @@ -1. prepare new romio directory - -cp -a -# cp -a ompi/mca/io/romio ompi/mca/io/romio314 -rm -rf /romio -# rm -rf ompi/mca/io/romio314/romio -git add -# git add ompi/mca/io/romio314 -# git commit - - -2. import new romio - -cp -a /src/mpi/romio -# cp -a /.../mpich-3.2b1/src/mpi/romio ompi/mca/io/romio314 -git add -# git add ompi/mca/io/romio314 -# git commit - -3. patch romio - -cd -# cd ompi/mca/io/romio314 -# git show 7ad376a7b202b45c8b4f574e873546ab8752e305 | patch -p5 -# cd ../../../.. -git add -# git add ompi/mca/io/romio314 -# git commit - - -4. apply post romio 3.1.4 patches -# cd ompi/mca/io/romio314 -# git show 53fd425a6a0843a5de0a8c544901fbf01246ed31 | patch -p5 -# git show 74a46863ca3d0806050e7a55377a4fbde612f3fe | patch -p5 -# git show 2b5c52fb05ab54e4fa72e948acabc42e3f979ebd | patch -p5 -# git show 24a6f1425734eb3e6ffb9e37f510507a4a65ebd1 | patch -p5 -# git show 23b27c510c2c626a09457abad7699cfc4740d1eb | patch -p5 -# cd ../../../.. -# git add ompi/mca/io/romio314 -# git commit - - -4. prepare ompi to use new romio - -vi /Makefile.am /configure.m4 /src/Makefile.extra -# vi ompi/mca/io/romio314/Makefile.am ompi/mca/io/romio314/configure.m4 ompi/mca/io/romio314/src/Makefile.extra -git add -# git add ompi/mca/io/romio314 -# git commit - - -5. remove old romio - -git rm -r -# git rm -r ompi/mca/io/romio -# git commit -rm -rf -# rm -rf ompi/mca/io/romio diff --git a/ompi/mca/io/romio314/romio/doc/users-guide.pdf b/ompi/mca/io/romio314/romio/doc/users-guide.pdf deleted file mode 100644 index be9359f04d..0000000000 Binary files a/ompi/mca/io/romio314/romio/doc/users-guide.pdf and /dev/null differ diff --git a/ompi/mca/io/romio314/romio/localdefs.in b/ompi/mca/io/romio314/romio/localdefs.in deleted file mode 100644 index 5b3d6706fb..0000000000 --- a/ompi/mca/io/romio314/romio/localdefs.in +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh -LIBS="@LIBS@" -MPI_OFFSET_TYPE="@MPI_OFFSET_TYPE@" -FORTRAN_MPI_OFFSET="@FORTRAN_MPI_OFFSET@" diff --git a/ompi/mca/io/romio314/.gitignore b/ompi/mca/io/romio321/.gitignore similarity index 100% rename from ompi/mca/io/romio314/.gitignore rename to ompi/mca/io/romio321/.gitignore diff --git a/ompi/mca/io/romio314/Makefile.am b/ompi/mca/io/romio321/Makefile.am similarity index 69% rename from ompi/mca/io/romio314/Makefile.am rename to ompi/mca/io/romio321/Makefile.am index 690ddfbd2d..09f192f9ac 100644 --- a/ompi/mca/io/romio314/Makefile.am +++ b/ompi/mca/io/romio321/Makefile.am @@ -11,6 +11,8 @@ # All rights reserved. # Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -23,7 +25,7 @@ EXTRA_DIST = autogen.subdirs sources = include src/Makefile.extra -if MCA_io_romio314_SHOULD_BUILD +if MCA_io_romio321_SHOULD_BUILD # Need to set both SUBDIRS and DIST_SUBDIRS due to oddities with AM SUBDIRS = romio DIST_SUBDIRS = romio @@ -33,13 +35,13 @@ endif # mca__.la (for DSO builds) or libmca__.la # (for static builds). -if MCA_BUILD_ompi_io_romio314_DSO +if MCA_BUILD_ompi_io_romio321_DSO lib = lib_sources = -component = mca_io_romio314.la +component = mca_io_romio321.la component_sources = $(sources) else -lib = libmca_io_romio314.la +lib = libmca_io_romio321.la lib_sources = $(sources) component = component_sources = @@ -49,14 +51,13 @@ libs = romio/libromio_dist.la mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component) -mca_io_romio314_la_SOURCES = $(component_sources) -mca_io_romio314_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ - $(libs) -mca_io_romio314_la_DEPENDENCIES = $(libs) -mca_io_romio314_la_LDFLAGS = -module -avoid-version +mca_io_romio321_la_SOURCES = $(component_sources) +mca_io_romio321_la_LIBADD = $(libs) +mca_io_romio321_la_DEPENDENCIES = $(libs) +mca_io_romio321_la_LDFLAGS = -module -avoid-version noinst_LTLIBRARIES = $(lib) -libmca_io_romio314_la_SOURCES = $(lib_sources) -libmca_io_romio314_la_LIBADD = $(libs) -libmca_io_romio314_la_DEPENDENCIES = $(libs) -libmca_io_romio314_la_LDFLAGS = -module -avoid-version +libmca_io_romio321_la_SOURCES = $(lib_sources) +libmca_io_romio321_la_LIBADD = $(libs) +libmca_io_romio321_la_DEPENDENCIES = $(libs) +libmca_io_romio321_la_LDFLAGS = -module -avoid-version diff --git a/ompi/mca/io/romio321/REFRESH_NOTES.txt b/ompi/mca/io/romio321/REFRESH_NOTES.txt new file mode 100644 index 0000000000..e4dfa70406 --- /dev/null +++ b/ompi/mca/io/romio321/REFRESH_NOTES.txt @@ -0,0 +1,39 @@ +1. prepare new romio directory +cp -a +# cp -a ompi/mca/io/romio ompi/mca/io/romio321 +rm -rf /romio +# rm -rf ompi/mca/io/romio321/romio +git add +# git add ompi/mca/io/romio321 +# git commit + +2. import new romio +cp -a /src/mpi/romio +# cp -a /.../mpich-3.2b1/src/mpi/romio ompi/mca/io/romio321 +git add +# git add ompi/mca/io/romio321 +# git commit + +3. patch romio +cd +# cd ompi/mca/io/romio321 +# git show 7a7968f02e2bad912426d1535119fb30d881b460 | patch -p5 +# cd ../../../.. +git add +# git add ompi/mca/io/romio321 +# git commit + +4. prepare ompi to use new romio +vi /Makefile.am /configure.m4 /src/Makefile.extra +# vi ompi/mca/io/romio321/Makefile.am ompi/mca/io/romio321/configure.m4 ompi/mca/io/romio321/src/Makefile.extra +git add +# git add ompi/mca/io/romio321 +# git commit + + +5. remove old romio +git rm -r +# git rm -r ompi/mca/io/romio +# git commit +rm -rf +# rm -rf ompi/mca/io/romio diff --git a/ompi/mca/io/romio314/autogen.subdirs b/ompi/mca/io/romio321/autogen.subdirs similarity index 100% rename from ompi/mca/io/romio314/autogen.subdirs rename to ompi/mca/io/romio321/autogen.subdirs diff --git a/ompi/mca/io/romio314/configure.m4 b/ompi/mca/io/romio321/configure.m4 similarity index 61% rename from ompi/mca/io/romio314/configure.m4 rename to ompi/mca/io/romio321/configure.m4 index b3c20fdec0..2ed89104b1 100644 --- a/ompi/mca/io/romio314/configure.m4 +++ b/ompi/mca/io/romio321/configure.m4 @@ -11,7 +11,7 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015 Research Organization for Information Science +# Copyright (c) 2015-2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # $COPYRIGHT$ # @@ -20,24 +20,24 @@ # $HEADER$ # -AC_DEFUN([MCA_ompi_io_romio314_POST_CONFIG], [ - AM_CONDITIONAL([MCA_io_romio314_SHOULD_BUILD], [test $1 -eq 1]) +AC_DEFUN([MCA_ompi_io_romio321_POST_CONFIG], [ + AM_CONDITIONAL([MCA_io_romio321_SHOULD_BUILD], [test $1 -eq 1]) ]) -# MCA_io_romio314_CONFIG([action-if-found], [action-if-not-found]) +# MCA_io_romio321_CONFIG([action-if-found], [action-if-not-found]) # ----------------------------------------------------------- -AC_DEFUN([MCA_ompi_io_romio314_CONFIG],[ - AC_CONFIG_FILES([ompi/mca/io/romio314/Makefile]) +AC_DEFUN([MCA_ompi_io_romio321_CONFIG],[ + AC_CONFIG_FILES([ompi/mca/io/romio321/Makefile]) - OPAL_VAR_SCOPE_PUSH([io_romio314_flags io_romio314_flags_define io_romio314_happy io_romio314_save_LIBS]) + OPAL_VAR_SCOPE_PUSH([io_romio321_flags io_romio321_flags_define io_romio321_happy io_romio321_save_LIBS]) AC_ARG_ENABLE([io-romio], [AC_HELP_STRING([--disable-io-romio], [Disable the ROMIO MPI-IO component])]) AC_ARG_WITH([io-romio-flags], [AC_HELP_STRING([--with-io-romio-flags=FLAGS], [Pass FLAGS to the ROMIO distribution configuration script])]) - AC_DEFINE_UNQUOTED([MCA_io_romio314_USER_CONFIGURE_FLAGS], ["$with_io_romio_flags"], [Set of user-defined configure flags given to ROMIOs configure script via --with-io-romio-flags]) + AC_DEFINE_UNQUOTED([MCA_io_romio321_USER_CONFIGURE_FLAGS], ["$with_io_romio_flags"], [Set of user-defined configure flags given to ROMIOs configure script via --with-io-romio-flags]) AC_MSG_CHECKING([if want ROMIO component]) AS_IF([test "$enable_io_romio" = "no"], [AC_MSG_RESULT([no]) @@ -53,50 +53,50 @@ AC_DEFUN([MCA_ompi_io_romio314_CONFIG],[ [AC_MSG_RESULT([yes]) AS_IF([test -n "$with_io_romio_flags" && test "$with_io_romio_flags" != "no"], - [io_romio314_flags="$with_io_romio_flags $io_romio314_flags"], - [io_romio314_flags=]) + [io_romio321_flags="$with_io_romio_flags $io_romio321_flags"], + [io_romio321_flags=]) # If ROMIO is going to end up in a DSO, all we need is # shared library-ized objects, as we're only building a # DSO (which is always shared). Otherwise, build with # same flags as OMPI, as we might need any combination of # shared and static-ized objects... AS_IF([test "$compile_mode" = "dso"], - [io_romio314_shared=enable - io_romio314_static=disable], + [io_romio321_shared=enable + io_romio321_static=disable], [AS_IF([test "$enable_shared" = "yes"], - [io_romio314_shared=enable], - [io_romio314_shared=disable]) + [io_romio321_shared=enable], + [io_romio321_shared=disable]) AS_IF([test "$enable_static" = "yes"], - [io_romio314_static=enable], - [io_romio314_static=disable])]) + [io_romio321_static=enable], + [io_romio321_static=disable])]) AS_IF([test -n "$prefix" && test "$prefix" != "NONE"], - [io_romio314_prefix_arg="--prefix=$prefix"], - [io_romio314_prefix_arg=]) + [io_romio321_prefix_arg="--prefix=$prefix"], + [io_romio321_prefix_arg=]) AS_IF([test "$cross_compiling" = "yes"], - [AS_IF([test ! -z $build], [io_romio314_flags="$io_romio314_flags --build=$build"]) - AS_IF([test ! -z $host], [io_romio314_flags="$io_romio314_flags --host=$host"]) - AS_IF([test ! -z $target], [io_romio314_flags="$io_romio314_flags --target=$target"])]) - io_romio314_flags_define="$io_romio314_flags FROM_OMPI=yes CC='$CC' CFLAGS='$CFLAGS -D__EXTENSIONS__' CPPFLAGS='$CPPFLAGS' FFLAGS='$FFLAGS' LDFLAGS='$LDFLAGS' --$io_romio314_shared-shared --$io_romio314_static-static $io_romio314_flags $io_romio314_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90" - AC_DEFINE_UNQUOTED([MCA_io_romio314_COMPLETE_CONFIGURE_FLAGS], ["$io_romio314_flags_define"], [Complete set of command line arguments given to ROMIOs configure script]) + [AS_IF([test ! -z $build], [io_romio321_flags="$io_romio321_flags --build=$build"]) + AS_IF([test ! -z $host], [io_romio321_flags="$io_romio321_flags --host=$host"]) + AS_IF([test ! -z $target], [io_romio321_flags="$io_romio321_flags --target=$target"])]) + io_romio321_flags_define="$io_romio321_flags FROM_OMPI=yes CC='$CC' CFLAGS='$CFLAGS -D__EXTENSIONS__' CPPFLAGS='$CPPFLAGS' FFLAGS='$FFLAGS' LDFLAGS='$LDFLAGS' --$io_romio321_shared-shared --$io_romio321_static-static $io_romio321_flags $io_romio321_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90" + AC_DEFINE_UNQUOTED([MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS], ["$io_romio321_flags_define"], [Complete set of command line arguments given to ROMIOs configure script]) - io_romio314_flags="$io_romio314_flags FROM_OMPI=yes CC="'"'"$CC"'"'" CFLAGS="'"'"$CFLAGS -D__EXTENSIONS__"'"'" CPPFLAGS="'"'"$CPPFLAGS"'"'" FFLAGS="'"'"$FFLAGS"'"'" LDFLAGS="'"'"$LDFLAGS"'"'" --$io_romio314_shared-shared --$io_romio314_static-static $io_romio314_flags $io_romio314_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90" + io_romio321_flags="$io_romio321_flags FROM_OMPI=yes CC="'"'"$CC"'"'" CFLAGS="'"'"$CFLAGS -D__EXTENSIONS__"'"'" CPPFLAGS="'"'"$CPPFLAGS"'"'" FFLAGS="'"'"$FFLAGS"'"'" LDFLAGS="'"'"$LDFLAGS"'"'" --$io_romio321_shared-shared --$io_romio321_static-static $io_romio321_flags $io_romio321_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90" opal_show_subtitle "Configuring ROMIO distribution" - OPAL_CONFIG_SUBDIR([ompi/mca/io/romio314/romio], - [$io_romio314_flags], - [io_romio314_happy=1], [io_romio314_happy=0]) + OPAL_CONFIG_SUBDIR([ompi/mca/io/romio321/romio], + [$io_romio321_flags], + [io_romio321_happy=1], [io_romio321_happy=0]) - AS_IF([test "$io_romio314_happy" = "1"], + AS_IF([test "$io_romio321_happy" = "1"], [ # grab the libraries list from ROMIO. We don't # need this for building the component, as libtool # will figure that part out. But we do need it for # the wrapper settings - io_romio314_save_LIBS="$LIBS" + io_romio321_save_LIBS="$LIBS" LIBS= - . ompi/mca/io/romio314/romio/localdefs - io_romio314_LIBS="$LIBS" - LIBS="$io_romio314_save_LIBS" + . ompi/mca/io/romio321/romio/localdefs + io_romio321_LIBS="$LIBS" + LIBS="$io_romio321_save_LIBS" echo "ROMIO distribution configured successfully" $1], diff --git a/ompi/mca/io/romio314/ompi.patch b/ompi/mca/io/romio321/ompi.patch similarity index 58% rename from ompi/mca/io/romio314/ompi.patch rename to ompi/mca/io/romio321/ompi.patch index e10089fa8d..9d6dd5ffc4 100644 --- a/ompi/mca/io/romio314/ompi.patch +++ b/ompi/mca/io/romio321/ompi.patch @@ -1,35 +1,16 @@ -diff --git a/ompi/mca/io/romio32b1/romio/.config_params b/ompi/mca/io/romio32b1/romio/.config_params +diff --git a/ompi/mca/io/romio321/romio/.config_params b/ompi/mca/io/romio321/romio/.config_params index 96f735f..fcc2f91 100644 ---- a/ompi/mca/io/romio32b1/romio/.config_params -+++ b/ompi/mca/io/romio32b1/romio/.config_params +--- a/ompi/mca/io/romio321/romio/.config_params ++++ b/ompi/mca/io/romio321/romio/.config_params @@ -36,3 +36,4 @@ __sgi_mpi __hp_mpi __cray_mpi __lam_mpi +__open_mpi -diff --git a/ompi/mca/io/romio32b1/romio/.gitignore b/ompi/mca/io/romio32b1/romio/.gitignore -new file mode 100644 -index 0000000..28f1e98 ---- /dev/null -+++ b/ompi/mca/io/romio32b1/romio/.gitignore -@@ -0,0 +1,13 @@ -+/Makefile -+/.deps -+/*.bb -+/*.bbg -+/*.gcda -+/*.gcno -+/.libs -+/.libstamp* -+/*.lo -+/.*-cache -+.state-cache -+version.m4 -+confdb/config.rpath -diff --git a/ompi/mca/io/romio32b1/romio/Makefile.am b/ompi/mca/io/romio32b1/romio/Makefile.am +diff --git a/ompi/mca/io/romio321/romio/Makefile.am b/ompi/mca/io/romio321/romio/Makefile.am index b9d4e25..69d7014 100644 ---- a/ompi/mca/io/romio32b1/romio/Makefile.am -+++ b/ompi/mca/io/romio32b1/romio/Makefile.am +--- a/ompi/mca/io/romio321/romio/Makefile.am ++++ b/ompi/mca/io/romio321/romio/Makefile.am @@ -1,9 +1,28 @@ # -*- Mode: Makefile; -*- +# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana @@ -52,7 +33,7 @@ index b9d4e25..69d7014 100644 # (C) 2011 by Argonne National Laboratory. # See COPYRIGHT in top-level directory. # - + +# OMPI: include a top level makefile with some options +include $(top_srcdir)/Makefile.options + @@ -60,12 +41,12 @@ index b9d4e25..69d7014 100644 ## 1) that ROMIO is being embedded within the MPI library, as in MPICH or Open ## MPI @@ -17,7 +36,6 @@ ACLOCAL_AMFLAGS = -I confdb - include_HEADERS = + include_HEADERS = nodist_include_HEADERS = - noinst_HEADERS = + noinst_HEADERS = -AM_CPPFLAGS = EXTRA_DIST = - SUFFIXES = + SUFFIXES = doc1_src_txt = @@ -46,7 +64,9 @@ AM_CPPFLAGS += $(MPI_H_INCLUDE) # handle the "include" directory here @@ -75,9 +56,9 @@ index b9d4e25..69d7014 100644 +# Open MPI: do not install mpio.h +noinst_HEADERS += include/mpio.h +noinst_HEADERS += include/io_romio_conv.h - + # ------------------------------------------------------------------------ - + @@ -63,8 +83,8 @@ EXTRA_DIST += autogen.sh if BUILD_ROMIO_EMBEDDED # Build a libtool convenience library that the enclosing MPI implementation can @@ -86,72 +67,13 @@ index b9d4e25..69d7014 100644 -libromio_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources) +noinst_LTLIBRARIES = libromio_dist.la +libromio_dist_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources) - + ## NOTE: ROMIO's old build system builds a bunch of _foo.o objects that contain ## PMPI_ implementations as well as calls to only other PMPI routines. In -diff --git a/ompi/mca/io/romio32b1/romio/Makefile.options b/ompi/mca/io/romio32b1/romio/Makefile.options -new file mode 100644 -index 0000000..0b72829 ---- /dev/null -+++ b/ompi/mca/io/romio32b1/romio/Makefile.options -@@ -0,0 +1,36 @@ -+# -*- makefile -*- -+# -+# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -+# University Research and Technology -+# Corporation. All rights reserved. -+# Copyright (c) 2004-2005 The University of Tennessee and The University -+# of Tennessee Research Foundation. All rights -+# reserved. -+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -+# University of Stuttgart. All rights reserved. -+# Copyright (c) 2004-2005 The Regents of the University of California. -+# All rights reserved. -+# $COPYRIGHT$ -+# -+# Additional copyrights may follow -+# -+# $HEADER$ -+# -+ -+AUTOMAKE_OPTIONS = foreign dist-bzip2 -+ -+# $(OMPI_TOP_SRCDIR) - mca_base_param.h -+# $(OMPI_TOP_SRCDIR)/opal/include - opal_config_bottom.h -+# $(OMPI_TOP_BUILDDIR)/opal/include - opal_config.h -+# $(OMPI_TOP_BUILDDIR)/ompi/include - mpi.h -+# $(top_srcdir)/include - vpath support -+# $(top_srcdir)/adio/include - vpath support -+ -+AM_CPPFLAGS = \ -+ -DOMPI_BUILDING=1 \ -+ -I$(OMPI_TOP_SRCDIR) \ -+ -I$(OMPI_TOP_SRCDIR)/opal/include \ -+ -I$(OMPI_TOP_BUILDDIR)/opal/include \ -+ -I$(OMPI_TOP_BUILDDIR)/ompi/include \ -+ -I$(top_srcdir)/include \ -+ -I$(top_srcdir)/adio/include -diff --git a/ompi/mca/io/romio32b1/romio/README_OMPI b/ompi/mca/io/romio32b1/romio/README_OMPI -new file mode 100644 -index 0000000..6dba412 ---- /dev/null -+++ b/ompi/mca/io/romio32b1/romio/README_OMPI -@@ -0,0 +1,11 @@ -+Please note that this is *NOT* a vanilla MPICH v3.2b1 -+distribution of the ROMIO package from Argonne National Labs. -+Various customizations had to be applied to the configuration process. -+More to the point -- if replace this copy of ROMIO with a newer version, -+it will likely not work. :-( -+ -+- The Open MPI Team -+ -+----------------------------------------------------------------------------- -+ -+Local modifications are in ompi.patch -diff --git a/ompi/mca/io/romio32b1/romio/adio/Makefile.mk b/ompi/mca/io/romio32b1/romio/adio/Makefile.mk +diff --git a/ompi/mca/io/romio321/romio/adio/Makefile.mk b/ompi/mca/io/romio321/romio/adio/Makefile.mk index 505d518..ffc05cb 100644 ---- a/ompi/mca/io/romio32b1/romio/adio/Makefile.mk -+++ b/ompi/mca/io/romio32b1/romio/adio/Makefile.mk +--- a/ompi/mca/io/romio321/romio/adio/Makefile.mk ++++ b/ompi/mca/io/romio321/romio/adio/Makefile.mk @@ -20,6 +20,7 @@ noinst_HEADERS += \ adio/include/mpipr.h \ adio/include/mpiu_greq.h \ @@ -159,13 +81,13 @@ index 505d518..ffc05cb 100644 + adio/include/romioconf-undefs.h \ adio/include/mpiu_external32.h \ adio/include/hint_fns.h - -diff --git a/ompi/mca/io/romio32b1/romio/adio/common/ad_end.c b/ompi/mca/io/romio32b1/romio/adio/common/ad_end.c + +diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_end.c b/ompi/mca/io/romio321/romio/adio/common/ad_end.c index ea4dfeb..066c65c 100644 ---- a/ompi/mca/io/romio32b1/romio/adio/common/ad_end.c -+++ b/ompi/mca/io/romio32b1/romio/adio/common/ad_end.c +--- a/ompi/mca/io/romio321/romio/adio/common/ad_end.c ++++ b/ompi/mca/io/romio321/romio/adio/common/ad_end.c @@ -16,7 +16,12 @@ void ADIO_End(int *error_code) - + /* if a default errhandler was set on MPI_FILE_NULL then we need to ensure * that our reference to that errhandler is released */ +/* Open MPI: The call to PMPI_File_set_errhandler has to be done in romio/src/io_romio_file_open.c @@ -174,50 +96,50 @@ index ea4dfeb..066c65c 100644 +#if 0 PMPI_File_set_errhandler(MPI_FILE_NULL, MPI_ERRORS_RETURN); +#endif - + /* delete the flattened datatype list */ curr = ADIOI_Flatlist; -diff --git a/ompi/mca/io/romio32b1/romio/adio/common/ad_iread_coll.c b/ompi/mca/io/romio32b1/romio/adio/common/ad_iread_coll.c -index b1311e6..6ae4359 100644 ---- a/ompi/mca/io/romio32b1/romio/adio/common/ad_iread_coll.c -+++ b/ompi/mca/io/romio32b1/romio/adio/common/ad_iread_coll.c +diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c +index 2ec23fb..8487c25 100644 +--- a/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c ++++ b/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c @@ -16,6 +16,8 @@ #include "mpe.h" #endif - + +#ifdef HAVE_MPI_GREQUEST_EXTENSIONS + /* ADIOI_GEN_IreadStridedColl */ struct ADIOI_GEN_IreadStridedColl_vars { /* requests */ -@@ -1315,3 +1317,4 @@ static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states, +@@ -1340,3 +1342,4 @@ static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states, return errcode; } - + +#endif /* HAVE_MPI_GREQUEST_EXTENSIONS */ -diff --git a/ompi/mca/io/romio32b1/romio/adio/common/ad_iwrite_coll.c b/ompi/mca/io/romio32b1/romio/adio/common/ad_iwrite_coll.c -index b456ec4..9178a8d 100644 ---- a/ompi/mca/io/romio32b1/romio/adio/common/ad_iwrite_coll.c -+++ b/ompi/mca/io/romio32b1/romio/adio/common/ad_iwrite_coll.c +diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c +index d275f78..9b27b42 100644 +--- a/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c ++++ b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c @@ -13,6 +13,8 @@ #include "mpe.h" #endif - + +#ifdef HAVE_MPI_GREQUEST_EXTENSIONS + /* ADIOI_GEN_IwriteStridedColl */ struct ADIOI_GEN_IwriteStridedColl_vars { /* requests */ -@@ -1539,3 +1541,4 @@ static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states, +@@ -1565,3 +1567,4 @@ static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states, return errcode; } - + +#endif /* HAVE_MPI_GREQUEST_EXTENSIONS */ -diff --git a/ompi/mca/io/romio32b1/romio/adio/include/adioi.h b/ompi/mca/io/romio32b1/romio/adio/include/adioi.h -index b20ca82..73dad0d 100644 ---- a/ompi/mca/io/romio32b1/romio/adio/include/adioi.h -+++ b/ompi/mca/io/romio32b1/romio/adio/include/adioi.h -@@ -429,18 +429,26 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, +diff --git a/ompi/mca/io/romio321/romio/adio/include/adioi.h b/ompi/mca/io/romio321/romio/adio/include/adioi.h +index 0e91ead..13c0f25 100644 +--- a/ompi/mca/io/romio321/romio/adio/include/adioi.h ++++ b/ompi/mca/io/romio321/romio/adio/include/adioi.h +@@ -440,18 +440,26 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); @@ -242,63 +164,12 @@ index b20ca82..73dad0d 100644 +#define ADIOI_GEN_IwriteStridedColl NULL +#endif void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype - datatype, int file_ptr_type, ADIO_Offset + datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Offset **offset_list_ptr, ADIO_Offset -diff --git a/ompi/mca/io/romio32b1/romio/adio/include/romioconf-undefs.h b/ompi/mca/io/romio32b1/romio/adio/include/romioconf-undefs.h -new file mode 100644 -index 0000000..5c21607 ---- /dev/null -+++ b/ompi/mca/io/romio32b1/romio/adio/include/romioconf-undefs.h -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -+ * University Research and Technology -+ * Corporation. All rights reserved. -+ * Copyright (c) 2004-2005 The University of Tennessee and The University -+ * of Tennessee Research Foundation. All rights -+ * reserved. -+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -+ * University of Stuttgart. All rights reserved. -+ * Copyright (c) 2004-2005 The Regents of the University of California. -+ * All rights reserved. -+ * $COPYRIGHT$ -+ * -+ * Additional copyrights may follow -+ * -+ * $HEADER$ -+ */ -+ -+#ifndef ROMIO_CONF_UNDEFS_H -+#define ROMIO_CONF_UNDEFS_H -+ -+/* Need to add some undefs here so that we don't conflict with the -+ * main ompi_config.h. Arrgh. Stupid autoconf not giving us the option -+ * to not define these macros... grumble... -+ */ -+#if defined(PACKAGE_BUGREPORT) -+#undef PACKAGE_BUGREPORT -+#endif -+#if defined(PACKAGE_NAME) -+#undef PACKAGE_NAME -+#endif -+#if defined(PACKAGE_STRING) -+#undef PACKAGE_STRING -+#endif -+#if defined(PACKAGE_TARNAME) -+#undef PACKAGE_TARNAME -+#endif -+#if defined(PACKAGE_VERSION) -+#undef PACKAGE_VERSION -+#endif -+#if defined(PACKAGE_URL) -+#undef PACKAGE_URL -+#endif -+ -+#endif /* ROMIOCONF_UNDEFS_H */ -diff --git a/ompi/mca/io/romio32b1/romio/configure.ac b/ompi/mca/io/romio32b1/romio/configure.ac -index f975e1c..4d51a3e 100644 ---- a/ompi/mca/io/romio32b1/romio/configure.ac -+++ b/ompi/mca/io/romio32b1/romio/configure.ac +diff --git a/ompi/mca/io/romio321/romio/configure.ac b/ompi/mca/io/romio321/romio/configure.ac +index 93f8b09..0b85d53 100644 +--- a/ompi/mca/io/romio321/romio/configure.ac ++++ b/ompi/mca/io/romio321/romio/configure.ac @@ -3,12 +3,21 @@ # autoconf --localdir=../confdb configure.ac # (or wherever the confdb is) @@ -307,7 +178,7 @@ index f975e1c..4d51a3e 100644 +# harmless and are left here solely for the sake of ease of future +# patching/importing. AC_PREREQ([2.63]) - + -m4_include([version.m4]) -dnl 2nd arg is intentionally underquoted +# Open MPI: Modifications to this file were done on an "let's do the @@ -327,15 +198,15 @@ index f975e1c..4d51a3e 100644 @@ -22,7 +31,7 @@ dnl scripts. AC_CONFIG_AUX_DIR([confdb]) AC_CONFIG_MACRO_DIR([confdb]) - + -AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability-recursive foreign 1.12.3 silent-rules subdir-objects]) +AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability-recursive foreign 1.12 silent-rules subdir-objects]) AM_MAINTAINER_MODE([enable]) - + dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC @@ -43,12 +52,15 @@ if test -n "$CONFIGURE_ARGS" ; then fi - + AC_CONFIG_HEADER(adio/include/romioconf.h) +# Open MPI: modified AH_TOP AH_TOP([/* @@ -352,7 +223,7 @@ index f975e1c..4d51a3e 100644 @@ -58,9 +70,37 @@ AH_BOTTOM([ #endif /* !defined(ROMIOCONF_H_INCLUDED) */ ]) - + +# Open MPI: this configure script doesn't seem to define these +# anywhere, so just do them manually here because "we know better" +# (i.e., Open MPI can be hard-wired to these values). @@ -392,7 +263,7 @@ index f975e1c..4d51a3e 100644 @@ -95,6 +135,10 @@ AC_ARG_VAR([FROM_OMPI],[set to "yes" if building ROMIO inside of Open MPI]) FROM_OMPI=${FROM_OMPI:-no} if test "$FROM_OMPI" = 1 ; then FROM_OMPI=yes ; fi - + +AC_ARG_VAR([FROM_OMPI],[set to "yes" if building ROMIO inside of Open MPI]) +FROM_OMPI=${FROM_OMPI:-no} +if test "$FROM_OMPI" = 1 ; then FROM_OMPI=yes ; fi @@ -410,7 +281,7 @@ index f975e1c..4d51a3e 100644 # foll. needed for f77 test programs F77GETARG="call getarg(i,str)" F77IARGC="iargc()" -@@ -133,6 +178,17 @@ MPI_OFFSET_KIND2="!" +@@ -133,6 +178,18 @@ MPI_OFFSET_KIND2="!" TEST_CC="" TEST_F77="" # @@ -425,10 +296,11 @@ index f975e1c..4d51a3e 100644 +MPIO_REQOBJECTS="iotest.o iotestall.o iotestany.o iotestsome.o iowait.o iowaitall.o iowaitany.o iowaitsome.o ioreq_c2f.o ioreq_f2c.o" +MPIO_REQ_TMP_POBJECTS="iotest.p iowait.p iowaitall.p iowaitany.p iotestall.p iotestany.p iowaitsome.p iotestsome.p" +MPIO_REQ_REAL_POBJECTS="_iotest.o _iowait.o _iowaitall.o _iowaitany.o _iotestall.o _iotestany.o _iowaitsome.o _iotestsome.o" - have_aio=no - # ++# known_mpi_impls="mpich_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi open_mpi_mpi" -@@ -171,7 +227,7 @@ AC_ARG_ENABLE(f77, + + dnl An m4 macro for use with m4_foreach_w and friends. You should modify this +@@ -169,7 +226,7 @@ AC_ARG_ENABLE(f77, AC_ARG_ENABLE(f90, [--enable-f90 - Turn on support for Fortran 90 (default)],,enable_f90=yes) AC_ARG_ENABLE(weak-symbols, @@ -437,7 +309,7 @@ index f975e1c..4d51a3e 100644 AC_ARG_ENABLE(debug, [--enable-debug - Build a debugging version],,) AC_ARG_WITH(file-system,[ -@@ -194,9 +250,10 @@ if test "$enable_debug" = "yes" ; then +@@ -192,9 +249,10 @@ if test "$enable_debug" = "yes" ; then DEBUG=yes fi MPI=$with_mpi @@ -448,22 +320,22 @@ index f975e1c..4d51a3e 100644 +#if test -n "$with_mpi"; then +# CC=$MPI/bin/mpicc +#fi - + # start with the set of file systems that the user asked for # FILE_SYSTEM=$with_file_system -@@ -259,6 +316,7 @@ top_build_dir=`pwd` +@@ -257,6 +315,7 @@ top_build_dir=`pwd` # used in romioinstall AC_SUBST(top_build_dir) - + +# Open MPI: these shouldn't be needed with AM # # Create the "autoconf" style directory names... # Most of these are done for us; add the documentation directories -@@ -380,8 +438,9 @@ if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then +@@ -378,8 +437,9 @@ if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then fi if test $DEBUG = "yes" ; then CFLAGS="$CFLAGS $C_DEBUG_FLAG" --else +-else - CFLAGS="$CFLAGS $C_OPT_FLAG" +# Open MPI: don't add optflags - they'll come from the top-level configure +#else @@ -471,28 +343,28 @@ index f975e1c..4d51a3e 100644 fi # --------------------------------------------------------------------------- # Here go the rest of the tests -@@ -428,7 +487,8 @@ else +@@ -426,7 +486,8 @@ else F77=":" fi # -AC_C_INLINE +# Open MPI: We already do this test top-level +dnl AC_C_INLINE - + AC_TYPE_SIZE_T AC_TYPE_SSIZE_T -@@ -651,7 +711,9 @@ AM_CONDITIONAL([BUILD_MPIO_ERRHAN],[false]) - +@@ -649,7 +710,9 @@ AM_CONDITIONAL([BUILD_MPIO_ERRHAN],[false]) + # if we don't have weak symbol support, we must build a separate convenience # library in order to provide the "PMPI_" symbols -AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0"]) +# Open MPI: Disable the profile library +#AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0"]) +AM_CONDITIONAL([BUILD_PROFILING_LIB],[false]) - + # weird: we have conflated "buid ROMIO's versions of the fortran bindings" and # "build ROMIO"s fortran I/O tests". Of course the common situaiton is that we -@@ -1565,8 +1627,10 @@ if test $FROM_OMPI = yes ; then +@@ -1447,8 +1510,10 @@ if test $FROM_OMPI = yes ; then HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY" # Open MPI: see comments in mpi-io/mpioprof.h AC_DEFINE(MPIO_BUILD_PROFILING, 1, [hack to make ROMIO build without profiling]) @@ -504,7 +376,7 @@ index f975e1c..4d51a3e 100644 elif test $FROM_LAM = yes ; then # LAM does have the status set bytes functionality AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes]) -@@ -1615,7 +1679,7 @@ elif test $FROM_MPICH = yes ; then +@@ -1497,7 +1562,7 @@ elif test $FROM_MPICH = yes ; then DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#define HAVE_MPI_GREQUEST_EXTENSIONS 1" AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH memory tracing macros defined]) AC_DEFINE(HAVE_MPIX_H, 1, []) @@ -513,10 +385,10 @@ index f975e1c..4d51a3e 100644 AC_DEFINE(HAVE_MPI_TYPE_SIZE_X, 1, [Define if MPI library provides MPI_TYPE_SIZE_X]) AC_DEFINE(HAVE_MPI_STATUS_SET_ELEMENTS_X, 1, [Define if MPI library provides MPI_STATUS_SET_ELEMENTS_X]) AC_DEFINE(HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK, 1, [Define if MPI library provides HINDEXED_BLOCK datatype]) -@@ -1751,9 +1815,22 @@ AC_CHECK_HEADERS(unistd.h, +@@ -1620,9 +1685,22 @@ fi echo "setting SYSDEP_INC to $SYSDEP_INC" AC_SUBST(SYSDEP_INC) - + +# Open MPI: use the exact same restrict test that we use in the +# upper-level Open MPI configure script so that we always get the same +# #define for "restrict" (there are a small number of files that will @@ -524,7 +396,7 @@ index f975e1c..4d51a3e 100644 +# need to #defines to agree). AC_C_RESTRICT PAC_C_GNU_ATTRIBUTE - + +# Open MPI: we need libtool +AM_PROG_LIBTOOL + @@ -535,11 +407,11 @@ index f975e1c..4d51a3e 100644 + # support gcov test coverage information PAC_ENABLE_COVERAGE - -@@ -1765,23 +1842,29 @@ echo "setting CFLAGS to $CFLAGS" + +@@ -1634,23 +1712,29 @@ echo "setting CFLAGS to $CFLAGS" echo "setting USER_CFLAGS to $USER_CFLAGS" echo "setting USER_FFLAGS to $USER_FFLAGS" - + +# Open MPI: Add on CFLAGS that we figured out up top. They have +# makefile macros in them, so we couldn't substitute them until now. +CFLAGS="$CFLAGS $OMPI_CFLAGS "'-I$(top_builddir)/include' @@ -572,7 +444,15 @@ index f975e1c..4d51a3e 100644 AC_SUBST(arch_IRIX) AC_SUBST(ROMIO_HOME) AC_SUBST(LIBNAME) -@@ -1825,24 +1908,25 @@ AC_SUBST(ROMIO_TCPPFLAGS) +@@ -1671,6 +1755,7 @@ AC_SUBST(HAVE_MPI_DARRAY_SUBARRAY) + AC_SUBST(BUILD_MPI_ARRAY) + AC_SUBST(DEFINE_MPI_OFFSET) + AC_SUBST(DEFINE_HAVE_MPI_GREQUEST) ++AC_SUBST(DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS) + AC_SUBST(MPI_OFFSET_TYPE) + AC_SUBST(MPI_FINFO1) + AC_SUBST(MPI_FINFO2) +@@ -1694,24 +1779,25 @@ AC_SUBST(ROMIO_TCPPFLAGS) AC_SUBST(ROMIO_TFFLAGS) AC_SUBST(MPIRUN) AC_SUBST(FORTRAN_TEST) @@ -611,10 +491,10 @@ index f975e1c..4d51a3e 100644 +#if test ! -d mpi2-other ; then mkdir mpi2-other ; fi +#if test ! -d mpi-io ; then mkdir mpi-io ; fi +#if test ! -d mpi-io/glue ; then mkdir mpi-io/glue ; fi - - # Create makefiles for all of the adio devices. Only the ones that + + # Create makefiles for all of the adio devices. Only the ones that # are active will be called by the top level ROMIO make -@@ -1850,8 +1934,6 @@ AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests]) +@@ -1719,8 +1805,6 @@ AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests]) AC_CONFIG_FILES([ Makefile localdefs @@ -623,7 +503,7 @@ index f975e1c..4d51a3e 100644 test/Makefile test/misc.c test/large_file.c -@@ -1859,14 +1941,17 @@ AC_CONFIG_FILES([ +@@ -1728,14 +1812,17 @@ AC_CONFIG_FILES([ test-internal/Makefile util/romioinstall include/mpio.h @@ -642,27 +522,27 @@ index f975e1c..4d51a3e 100644 +# mpi2-other/array/fortran/Makefile +# include/mpiof.h AC_OUTPUT - + dnl PAC_SUBDIR_CACHE_CLEANUP -diff --git a/ompi/mca/io/romio32b1/romio/doc/users-guide.tex b/ompi/mca/io/romio32b1/romio/doc/users-guide.tex +diff --git a/ompi/mca/io/romio321/romio/doc/users-guide.tex b/ompi/mca/io/romio321/romio/doc/users-guide.tex index b33d483..3715431 100644 ---- a/ompi/mca/io/romio32b1/romio/doc/users-guide.tex -+++ b/ompi/mca/io/romio32b1/romio/doc/users-guide.tex +--- a/ompi/mca/io/romio321/romio/doc/users-guide.tex ++++ b/ompi/mca/io/romio321/romio/doc/users-guide.tex @@ -807,13 +807,19 @@ to include the file {\tt mpio.h} for C or {\tt mpiof.h} for Fortran in - your MPI-IO program. - + your MPI-IO program. + Note that on HP machines running HPUX and on NEC SX-4, you need to -compile Fortran programs with {\tt mpifort}. +compile Fortran programs with {\tt mpifort}, because {\tt mpif77} does +not support 8-byte integers. - + With MPICH, HP MPI, or NEC MPI, you can compile MPI-IO programs as \\ \hspace*{.4in} {\tt mpicc foo.c}\\ or \\ +\hspace*{.4in} {\tt mpif77 foo.f }\\ +or\\ \hspace*{.4in} {\tt mpifort foo.f}\\ - + +As mentioned above, mpifort is preferred over mpif77 on HPUX and NEC +because the f77 compilers on those machines do not support 8-byte integers. + @@ -671,151 +551,21 @@ index b33d483..3715431 100644 or \\ @@ -863,7 +869,8 @@ file systems because they don't support {\tt fcntl} file locks, and ROMIO uses that feature to implement shared file pointers. - + \item On HP machines running HPUX and on NEC SX-4, you need to compile -Fortran programs with {\tt mpifort}. +Fortran programs with {\tt mpifort} instead of {\tt mpif77}, because +the {\tt f77} compilers on these machines don't support 8-byte integers. - + \item The file-open mode {\tt MPI\_MODE\_EXCL} does not work on Intel PFS file system, due to a bug in PFS. -diff --git a/ompi/mca/io/romio32b1/romio/include/io_romio_conv.h b/ompi/mca/io/romio32b1/romio/include/io_romio_conv.h -new file mode 100644 -index 0000000..c03873d ---- /dev/null -+++ b/ompi/mca/io/romio32b1/romio/include/io_romio_conv.h -@@ -0,0 +1,124 @@ -+/* -+ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -+ * University Research and Technology -+ * Corporation. All rights reserved. -+ * Copyright (c) 2004-2005 The University of Tennessee and The University -+ * of Tennessee Research Foundation. All rights -+ * reserved. -+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -+ * University of Stuttgart. All rights reserved. -+ * Copyright (c) 2004-2005 The Regents of the University of California. -+ * All rights reserved. -+ * $COPYRIGHT$ -+ * -+ * Additional copyrights may follow -+ * -+ * $HEADER$ -+ */ -+ -+#ifndef MCA_IO_ROMIO_CONV_H -+#define MCA_IO_ROMIO_CONV_H -+ -+/* Prefix that we add to all ROMIO symbols */ -+#ifdef ROMIO_PREFIX -+#undef ROMIO_PREFIX -+#endif -+#define ROMIO_PREFIX(foo) mca_io_romio_dist_##foo -+ -+/* Section 9.2 */ -+/* Begin Prototypes */ -+#define MPI_File_open ROMIO_PREFIX(MPI_File_open) -+#define MPI_File_close ROMIO_PREFIX(MPI_File_close) -+#define MPI_File_delete ROMIO_PREFIX(MPI_File_delete) -+#define MPI_File_set_size ROMIO_PREFIX(MPI_File_set_size) -+#define MPI_File_preallocate ROMIO_PREFIX(MPI_File_preallocate) -+#define MPI_File_get_size ROMIO_PREFIX(MPI_File_get_size) -+#define MPI_File_get_group ROMIO_PREFIX(MPI_File_get_group) -+#define MPI_File_get_amode ROMIO_PREFIX(MPI_File_get_amode) -+#define MPI_File_set_info ROMIO_PREFIX(MPI_File_set_info) -+#define MPI_File_get_info ROMIO_PREFIX(MPI_File_get_info) -+ -+/* Section 9.3 */ -+#define MPI_File_set_view ROMIO_PREFIX(MPI_File_set_view) -+#define MPI_File_get_view ROMIO_PREFIX(MPI_File_get_view) -+ -+/* Section 9.4.2 */ -+#define MPI_File_read_at ROMIO_PREFIX(MPI_File_read_at) -+#define MPI_File_read_at_all ROMIO_PREFIX(MPI_File_read_at_all) -+#define MPI_File_write_at ROMIO_PREFIX(MPI_File_write_at) -+#define MPI_File_write_at_all ROMIO_PREFIX(MPI_File_write_at_all) -+#define MPI_File_iread_at ROMIO_PREFIX(MPI_File_iread_at) -+#define MPI_File_iwrite_at ROMIO_PREFIX(MPI_File_iwrite_at) -+ -+/* Section 9.4.3 */ -+#define MPI_File_read ROMIO_PREFIX(MPI_File_read) -+#define MPI_File_read_all ROMIO_PREFIX(MPI_File_read_all) -+#define MPI_File_write ROMIO_PREFIX(MPI_File_write) -+#define MPI_File_write_all ROMIO_PREFIX(MPI_File_write_all) -+ -+#define MPI_File_iread ROMIO_PREFIX(MPI_File_iread) -+#define MPI_File_iwrite ROMIO_PREFIX(MPI_File_iwrite) -+ -+#define MPI_File_seek ROMIO_PREFIX(MPI_File_seek) -+#define MPI_File_get_position ROMIO_PREFIX(MPI_File_get_position) -+#define MPI_File_get_byte_offset ROMIO_PREFIX(MPI_File_get_byte_offset) -+ -+/* Section 9.4.4 */ -+#define MPI_File_read_shared ROMIO_PREFIX(MPI_File_read_shared) -+#define MPI_File_write_shared ROMIO_PREFIX(MPI_File_write_shared) -+#define MPI_File_iread_shared ROMIO_PREFIX(MPI_File_iread_shared) -+#define MPI_File_iwrite_shared ROMIO_PREFIX(MPI_File_iwrite_shared) -+#define MPI_File_read_ordered ROMIO_PREFIX(MPI_File_read_ordered) -+#define MPI_File_write_ordered ROMIO_PREFIX(MPI_File_write_ordered) -+#define MPI_File_seek_shared ROMIO_PREFIX(MPI_File_seek_shared) -+#define MPI_File_get_position_shared ROMIO_PREFIX(MPI_File_get_position_shared) -+ -+/* Section 9.4.5 */ -+#define MPI_File_read_at_all_begin ROMIO_PREFIX(MPI_File_read_at_all_begin) -+#define MPI_File_read_at_all_end ROMIO_PREFIX(MPI_File_read_at_all_end) -+#define MPI_File_write_at_all_begin ROMIO_PREFIX(MPI_File_write_at_all_begin) -+#define MPI_File_write_at_all_end ROMIO_PREFIX(MPI_File_write_at_all_end) -+#define MPI_File_read_all_begin ROMIO_PREFIX(MPI_File_read_all_begin) -+#define MPI_File_read_all_end ROMIO_PREFIX(MPI_File_read_all_end) -+#define MPI_File_write_all_begin ROMIO_PREFIX(MPI_File_write_all_begin) -+#define MPI_File_write_all_end ROMIO_PREFIX(MPI_File_write_all_end) -+#define MPI_File_read_ordered_begin ROMIO_PREFIX(MPI_File_read_ordered_begin) -+#define MPI_File_read_ordered_end ROMIO_PREFIX(MPI_File_read_ordered_end) -+#define MPI_File_write_ordered_begin ROMIO_PREFIX(MPI_File_write_ordered_begin) -+#define MPI_File_write_ordered_end ROMIO_PREFIX(MPI_File_write_ordered_end) -+ -+/* Section 9.5.1 */ -+#define MPI_File_get_type_extent ROMIO_PREFIX(MPI_File_get_type_extent) -+ -+/* Section 9.6.1 */ -+#define MPI_File_set_atomicity ROMIO_PREFIX(MPI_File_set_atomicity) -+#define MPI_File_get_atomicity ROMIO_PREFIX(MPI_File_get_atomicity) -+#define MPI_File_sync ROMIO_PREFIX(MPI_File_sync) -+ -+/* Section 4.13.3 */ -+#define MPI_File_set_errhandler ROMIO_PREFIX(MPI_File_set_errhandler) -+#define MPI_File_get_errhandler ROMIO_PREFIX(MPI_File_get_errhandler) -+/* End Prototypes */ -+ -+#define MPI_Register_datarep ROMIO_PREFIX(MPI_Register_datarep) -+ -+/* JMS these don't seem to work... */ -+#define MPI_File_f2c ROMIO_PREFIX(MPI_File_f2c) -+#define MPI_File_c2f ROMIO_PREFIX(MPI_File_c2f) -+ -+#define MPIO_Request_c2f ROMIO_PREFIX(MPIO_Request_c2f) -+#define MPIO_Request_f2c ROMIO_PREFIX(MPIO_Request_f2c) -+ -+/* Conversion of MPI_File and MPIO_Request */ -+#define MPI_File ROMIO_PREFIX(MPI_File) -+ -+/* Open MPI's mpi.h #define's MPI_FILE_NULL, so we need to undef it -+ here and allow it to be re-assigned to whatever ROMIO wants */ -+#undef MPI_FILE_NULL -+ -+/* Let's not use MPIR_Status_set_bytes */ -+#ifndef MPIR_Status_set_bytes -+#define MPIR_Status_set_bytes ROMIO_PREFIX(MPIR_Status_set_bytes) -+#endif -+ -+#endif /* MCA_IO_ROMIO_CONV_H */ -diff --git a/ompi/mca/io/romio32b1/romio/include/mpio.h.in b/ompi/mca/io/romio32b1/romio/include/mpio.h.in -index 2238f4b..8d1314c 100644 ---- a/ompi/mca/io/romio32b1/romio/include/mpio.h.in -+++ b/ompi/mca/io/romio32b1/romio/include/mpio.h.in +diff --git a/ompi/mca/io/romio321/romio/include/mpio.h.in b/ompi/mca/io/romio321/romio/include/mpio.h.in +index 1f3f382..9ef709d 100644 +--- a/ompi/mca/io/romio321/romio/include/mpio.h.in ++++ b/ompi/mca/io/romio321/romio/include/mpio.h.in @@ -11,6 +11,16 @@ #define MPIO_INCLUDE - + #include "mpi.h" +/* Open MPI: We need to rename almost all of these functions, as well + a the types to be names that conform to the prefix rule */ @@ -827,10 +577,19 @@ index 2238f4b..8d1314c 100644 +#define MPIIMPL_HAVE_MPI_TYPE_CREATE_DARRAY 1 +#define MPIIMPL_HAVE_MPI_COMBINER_DUP 1 +#define MPICH_ATTR_POINTER_WITH_TYPE_TAG(x,y) - + #if defined(__cplusplus) extern "C" { -@@ -279,9 +289,12 @@ int MPI_Type_create_darray(int size, int rank, int ndims, const int array_of_gsi +@@ -38,6 +48,8 @@ typedef struct ADIOI_RequestD *MPIO_Request; + #endif + #define MPIO_REQUEST_DEFINED + ++@DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS@ ++ + #ifndef HAVE_MPI_OFFSET + @DEFINE_MPI_OFFSET@ + /* If we needed to define MPI_Offset, then we also need to make +@@ -279,9 +291,12 @@ int MPI_Type_create_darray(int size, int rank, int ndims, const int array_of_gsi #endif #endif /* above needed for some versions of mpi.h in MPICH!! */ @@ -841,10 +600,10 @@ index 2238f4b..8d1314c 100644 MPI_Fint MPI_File_c2f(MPI_File file); - +#endif - + #ifndef HAVE_MPI_GREQUEST /* The following functions are required if generalized requests are not -@@ -329,15 +342,21 @@ int MPI_Info_free(MPI_Info *info); +@@ -329,15 +344,21 @@ int MPI_Info_free(MPI_Info *info); #endif #endif /* above needed for some versions of mpi.h in MPICH!! */ @@ -854,44 +613,31 @@ index 2238f4b..8d1314c 100644 MPI_Info MPI_Info_f2c(MPI_Fint info); #endif +#endif - + #endif /* HAVE_PRAGMA_HP_SEC_DEF */ - - + + /**************** BINDINGS FOR THE PROFILING INTERFACE ***************/ - + +/* Open MPI: We don't want any of the profiling layer */ +#if 0 + - + /* Section 9.2 */ int PMPI_File_open(MPI_Comm, const char *, int, MPI_Info, MPI_File *); -@@ -528,6 +547,8 @@ MPI_Fint PMPI_Info_c2f(MPI_Info); +@@ -528,6 +549,8 @@ MPI_Fint PMPI_Info_c2f(MPI_Info); MPI_Info PMPI_Info_f2c(MPI_Fint); #endif - + +#endif /* Open MPI: We don't want any of the profiling layer */ + #if defined(__cplusplus) } #endif -diff --git a/ompi/mca/io/romio32b1/romio/localdefs.in b/ompi/mca/io/romio32b1/romio/localdefs.in -index bf057d1..5b3d670 100644 ---- a/ompi/mca/io/romio32b1/romio/localdefs.in -+++ b/ompi/mca/io/romio32b1/romio/localdefs.in -@@ -1,7 +1,4 @@ - #! /bin/sh -- --# Append ROMIO library dependencies to the global list --EXTERNAL_LIBS="$EXTERNAL_LIBS @LIBS@" -- -+LIBS="@LIBS@" - MPI_OFFSET_TYPE="@MPI_OFFSET_TYPE@" - FORTRAN_MPI_OFFSET="@FORTRAN_MPI_OFFSET@" -diff --git a/ompi/mca/io/romio32b1/romio/mpi-io/Makefile.mk b/ompi/mca/io/romio32b1/romio/mpi-io/Makefile.mk +diff --git a/ompi/mca/io/romio321/romio/mpi-io/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/Makefile.mk index d4d5a29..264976e 100644 ---- a/ompi/mca/io/romio32b1/romio/mpi-io/Makefile.mk -+++ b/ompi/mca/io/romio32b1/romio/mpi-io/Makefile.mk +--- a/ompi/mca/io/romio321/romio/mpi-io/Makefile.mk ++++ b/ompi/mca/io/romio321/romio/mpi-io/Makefile.mk @@ -14,8 +14,6 @@ noinst_HEADERS += mpi-io/mpioimpl.h mpi-io/mpioprof.h romio_mpi_sources += \ mpi-io/close.c \ @@ -901,10 +647,10 @@ index d4d5a29..264976e 100644 mpi-io/fsync.c \ mpi-io/get_amode.c \ mpi-io/get_atom.c \ -diff --git a/ompi/mca/io/romio32b1/romio/mpi-io/close.c b/ompi/mca/io/romio32b1/romio/mpi-io/close.c -index 520f206..160b661 100644 ---- a/ompi/mca/io/romio32b1/romio/mpi-io/close.c -+++ b/ompi/mca/io/romio32b1/romio/mpi-io/close.c +diff --git a/ompi/mca/io/romio321/romio/mpi-io/close.c b/ompi/mca/io/romio321/romio/mpi-io/close.c +index 3f2b0b1..12d5c47 100644 +--- a/ompi/mca/io/romio321/romio/mpi-io/close.c ++++ b/ompi/mca/io/romio321/romio/mpi-io/close.c @@ -76,8 +76,13 @@ int MPI_File_close(MPI_File *fh) * somehow inform the MPI library that we no longer hold a reference to any * user defined error handler. We do this by setting the errhandler at this @@ -916,42 +662,42 @@ index 520f206..160b661 100644 error_code = PMPI_File_set_errhandler(*fh, MPI_ERRORS_RETURN); if (error_code != MPI_SUCCESS) goto fn_fail; +#endif - + ADIO_Close(adio_fh, &error_code); MPIO_File_free(fh); -diff --git a/ompi/mca/io/romio32b1/romio/mpi-io/glue/Makefile.mk b/ompi/mca/io/romio32b1/romio/mpi-io/glue/Makefile.mk +diff --git a/ompi/mca/io/romio321/romio/mpi-io/glue/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/glue/Makefile.mk index 05954a1..66f7f9e 100644 ---- a/ompi/mca/io/romio32b1/romio/mpi-io/glue/Makefile.mk -+++ b/ompi/mca/io/romio32b1/romio/mpi-io/glue/Makefile.mk +--- a/ompi/mca/io/romio321/romio/mpi-io/glue/Makefile.mk ++++ b/ompi/mca/io/romio321/romio/mpi-io/glue/Makefile.mk @@ -7,6 +7,7 @@ - + include $(top_srcdir)/mpi-io/glue/default/Makefile.mk include $(top_srcdir)/mpi-io/glue/mpich/Makefile.mk +include $(top_srcdir)/mpi-io/glue/openmpi/Makefile.mk - + if !BUILD_ROMIO_EMBEDDED romio_other_sources += \ -diff --git a/ompi/mca/io/romio32b1/romio/mpi-io/iread_all.c b/ompi/mca/io/romio32b1/romio/mpi-io/iread_all.c -index ba36161..32a48b8 100644 ---- a/ompi/mca/io/romio32b1/romio/mpi-io/iread_all.c -+++ b/ompi/mca/io/romio32b1/romio/mpi-io/iread_all.c -@@ -26,7 +26,7 @@ int MPIX_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype +diff --git a/ompi/mca/io/romio321/romio/mpi-io/iread_all.c b/ompi/mca/io/romio321/romio/mpi-io/iread_all.c +index 2615e56..00a0640 100644 +--- a/ompi/mca/io/romio321/romio/mpi-io/iread_all.c ++++ b/ompi/mca/io/romio321/romio/mpi-io/iread_all.c +@@ -26,7 +26,7 @@ int MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, #include "mpioprof.h" #endif - + -#ifdef HAVE_MPI_GREQUEST +#if HAVE_MPI_GREQUEST #include "mpiu_greq.h" #endif - -diff --git a/ompi/mca/io/romio32b1/romio/mpi-io/mpioprof.h b/ompi/mca/io/romio32b1/romio/mpi-io/mpioprof.h -index 15654ac..63dffd8 100644 ---- a/ompi/mca/io/romio32b1/romio/mpi-io/mpioprof.h -+++ b/ompi/mca/io/romio32b1/romio/mpi-io/mpioprof.h + +diff --git a/ompi/mca/io/romio321/romio/mpi-io/mpioprof.h b/ompi/mca/io/romio321/romio/mpi-io/mpioprof.h +index f3ee3b4..c74413d 100644 +--- a/ompi/mca/io/romio321/romio/mpi-io/mpioprof.h ++++ b/ompi/mca/io/romio321/romio/mpi-io/mpioprof.h @@ -10,6 +10,15 @@ building the profiling interface */ - + +/* + * Open MPI: Unfortunately, ROMIO doesn't seem to be able to build + * without a profiling interface, but we don't want a profiling @@ -962,10 +708,10 @@ index 15654ac..63dffd8 100644 + */ +#if 0 #ifdef MPIO_BUILD_PROFILING - + #undef MPI_File_open @@ -212,3 +221,4 @@ #define MPIX_Grequest_class_create PMPIX_Grequest_class_create - + #endif +#endif diff --git a/ompi/mca/io/romio314/owner.txt b/ompi/mca/io/romio321/owner.txt similarity index 100% rename from ompi/mca/io/romio314/owner.txt rename to ompi/mca/io/romio321/owner.txt diff --git a/ompi/mca/io/romio314/romio/.codingcheck b/ompi/mca/io/romio321/romio/.codingcheck similarity index 91% rename from ompi/mca/io/romio314/romio/.codingcheck rename to ompi/mca/io/romio321/romio/.codingcheck index c8d93615a2..9b52b35ce4 100644 --- a/ompi/mca/io/romio314/romio/.codingcheck +++ b/ompi/mca/io/romio321/romio/.codingcheck @@ -1,9 +1,9 @@ # Here are names that at least at one point were used within ROMIO. -# We should look at these and decide which we wish to allow and which +# We should look at these and decide which we wish to allow and which # should be replaced with something more ROMIO-specific. -%romioDefines = ( 'ROMIO_[A-Za-z0-9_]+' => romio, - 'PROFILE' => romio, - 'PRINT_ERR_MSG' => romio, +%romioDefines = ( 'ROMIO_[A-Za-z0-9_]+' => romio, + 'PROFILE' => romio, + 'PRINT_ERR_MSG' => romio, 'HPUX' => romio, 'SPPUX'=> romio, 'SX4'=> romio, @@ -51,5 +51,5 @@ if (defined(&PushDefinesNames)) { &PushDefinesNames( "romioDefines", "tree", "add" ); } - + 1; diff --git a/ompi/mca/io/romio314/romio/.config_params b/ompi/mca/io/romio321/romio/.config_params similarity index 100% rename from ompi/mca/io/romio314/romio/.config_params rename to ompi/mca/io/romio321/romio/.config_params diff --git a/ompi/mca/io/romio321/romio/.gitignore b/ompi/mca/io/romio321/romio/.gitignore new file mode 100644 index 0000000000..28f1e98219 --- /dev/null +++ b/ompi/mca/io/romio321/romio/.gitignore @@ -0,0 +1,13 @@ +/Makefile +/.deps +/*.bb +/*.bbg +/*.gcda +/*.gcno +/.libs +/.libstamp* +/*.lo +/.*-cache +.state-cache +version.m4 +confdb/config.rpath diff --git a/ompi/mca/io/romio321/romio/2.diff b/ompi/mca/io/romio321/romio/2.diff new file mode 100644 index 0000000000..6e2cbb43e5 --- /dev/null +++ b/ompi/mca/io/romio321/romio/2.diff @@ -0,0 +1,1032 @@ +commit 84765001aaee5e62e232cfcfd8a20e93e2d67e9f +Author: Nathan Hjelm +Date: Thu Mar 22 13:12:11 2018 -0600 + + io/romio: do not use removed functions + + This commit attempts to update the romio io component to not use + functions removed in MPI-3.0 (2012). This is a first cut and will + probably need to be reviewed for correctness. + + Signed-off-by: Nathan Hjelm + +diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c b/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c +index 48543ea..8e76dd4 100644 +--- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c ++++ b/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c +@@ -164,7 +164,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, + ADIO_Offset abs_off_in_filetype=0; + int req_len, partial_read; + MPI_Count filetype_size, etype_size, buftype_size; +- MPI_Aint filetype_extent, buftype_extent; ++ MPI_Aint filetype_extent, buftype_extent, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset userbuf_off; + ADIO_Offset off, req_off, disp, end_offset=0, readbuf_off, start_off; +@@ -187,9 +187,9 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, + return; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(datatype, &buftype_size); +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + bufsize = buftype_size * count; +diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c b/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c +index 0a4636b..794c06c 100644 +--- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c ++++ b/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c +@@ -267,7 +267,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, + ADIO_Offset abs_off_in_filetype=0; + int req_len; + MPI_Count filetype_size, etype_size, buftype_size; +- MPI_Aint filetype_extent, buftype_extent; ++ MPI_Aint filetype_extent, buftype_extent, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset userbuf_off; + ADIO_Offset off, req_off, disp, end_offset=0, writebuf_off, start_off; +@@ -289,9 +289,9 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, + return; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(datatype, &buftype_size); +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + bufsize = buftype_size * count; +diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c b/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c +index a6bca98..56d1043 100644 +--- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c ++++ b/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c +@@ -30,7 +30,7 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, + int size_in_filetype; + int filetype_is_contig; + MPI_Count filetype_size; +- MPI_Aint etype_size, filetype_extent; ++ MPI_Aint etype_size, filetype_extent, lb; + + *error_code = MPI_SUCCESS; + +@@ -47,7 +47,7 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, + flat_file = ADIOI_Flatlist; + while (flat_file->type != fd->filetype) flat_file = flat_file->next; + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(fd->filetype, &filetype_size); + if ( ! filetype_size ) { + *error_code = MPI_SUCCESS; +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c b/ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c +index a01a41c..59fee5b 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c +@@ -237,18 +237,18 @@ void ADIOI_Calc_file_realms_fsize (ADIO_File fd, int nprocs_for_coll, + void ADIOI_Create_fr_simpletype (int size, int nprocs_for_coll, + MPI_Datatype *simpletype) + { +- int count=2, blocklens[2]; +- MPI_Aint indices[2]; +- MPI_Datatype old_types[2]; ++ int count=1, blocklens[1]; ++ MPI_Aint indices[1]; ++ MPI_Datatype old_types[1]; ++ MPI_Datatype inttype; + + blocklens[0] = size; +- blocklens[1] = 1; + indices[0] = 0; +- indices[1] = size*nprocs_for_coll; + old_types[0] = MPI_BYTE; +- old_types[1] = MPI_UB; + +- MPI_Type_struct (count, blocklens, indices, old_types, simpletype); ++ MPI_Type_create_struct (count, blocklens, indices, old_types, &inttype); ++ MPI_Type_create_resized (inttype, 0, size*nprocs_for_coll, simpletype); ++ MPI_Type_free (&inttype); + + MPI_Type_commit (simpletype); + } +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c b/ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c +index a9be23c..2b6f29e 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c +@@ -279,7 +279,7 @@ static inline int get_next_fr_off(ADIO_File fd, + ADIO_Offset *fr_next_off_p, + ADIO_Offset *fr_max_len_p) + { +- MPI_Aint fr_extent = -1; ++ MPI_Aint fr_extent = -1, lb; + ADIO_Offset tmp_off, off_rem; + ADIOI_Flatlist_node *fr_node_p = ADIOI_Flatlist; + int i = -1, fr_dtype_ct = 0; +@@ -299,7 +299,7 @@ static inline int get_next_fr_off(ADIO_File fd, + + /* Calculate how many times to loop through the fr_type + * and where the next fr_off is. */ +- MPI_Type_extent(*fr_type_p, &fr_extent); ++ MPI_Type_get_extent(*fr_type_p, &lb, &fr_extent); + tmp_off = off - fr_st_off; + fr_dtype_ct = tmp_off / fr_extent; + off_rem = tmp_off % fr_extent; +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c b/ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c +index abe7d74..1815616 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c +@@ -127,7 +127,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, + MPI_Request *send_req_arr = NULL, *recv_req_arr = NULL; + MPI_Status *statuses = NULL; + ADIO_Offset disp_off_sz_ext_typesz[6]; +- MPI_Aint memtype_extent, filetype_extent; ++ MPI_Aint memtype_extent, filetype_extent, lb; + int ret = -1; + + /* parameters for datatypes */ +@@ -143,7 +143,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, + * freed in the close and should have been flattened in the file + * view. */ + MPI_Type_size_x(datatype, &memtype_sz); +- MPI_Type_extent(datatype, &memtype_extent); ++ MPI_Type_get_extent(datatype, &lb, &memtype_extent); + if (memtype_sz == memtype_extent) { + memtype_is_contig = 1; + flat_mem_p = ADIOI_Add_contig_flattened(datatype); +@@ -156,7 +156,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, + flat_mem_p = flat_mem_p->next; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(fd->filetype, &filetype_sz); + if (filetype_extent == filetype_sz) { + flat_file_p = ADIOI_Add_contig_flattened(fd->filetype); +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_darray.c b/ompi/mca/io/romio314/romio/adio/common/ad_darray.c +index 0437db8..cb1407b 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_darray.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_darray.c +@@ -24,11 +24,11 @@ int ADIO_Type_create_darray(int size, int rank, int ndims, + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype) + { +- MPI_Datatype type_old, type_new=MPI_DATATYPE_NULL, types[3]; +- int procs, tmp_rank, i, tmp_size, blklens[3], *coords; +- MPI_Aint *st_offsets, orig_extent, disps[3]; ++ MPI_Datatype type_old, type_new=MPI_DATATYPE_NULL, inttype; ++ int procs, tmp_rank, i, tmp_size, blklen, *coords; ++ MPI_Aint *st_offsets, orig_extent, disp, ub, lb; + +- MPI_Type_extent(oldtype, &orig_extent); ++ MPI_Type_get_extent(oldtype, &lb, &orig_extent); + + /* calculate position in Cartesian grid as MPI would (row-major + ordering) */ +@@ -77,11 +77,11 @@ int ADIO_Type_create_darray(int size, int rank, int ndims, + } + + /* add displacement and UB */ +- disps[1] = st_offsets[0]; ++ disp = st_offsets[0]; + tmp_size = 1; + for (i=1; i=0; i--) { + tmp_size *= array_of_gsizes[i+1]; +- disps[1] += (MPI_Aint)tmp_size*st_offsets[i]; ++ disp += (MPI_Aint)tmp_size*st_offsets[i]; + } + } + +- disps[1] *= orig_extent; ++ disp *= orig_extent; + +- disps[2] = orig_extent; +- for (i=0; idim; i--) stride *= (MPI_Aint)array_of_gsizes[i]; +- MPI_Type_hvector(mysize, 1, stride, type_old, type_new); ++ MPI_Type_create_hvector(mysize, 1, stride, type_old, type_new); + } + + } +@@ -217,7 +215,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc + rank = coordinate of this process in dimension dim */ + int blksize, i, blklens[3], st_index, end_index, local_size, rem, count; + MPI_Aint stride, disps[3]; +- MPI_Datatype type_tmp, types[3]; ++ MPI_Datatype type_tmp, type_tmp1, types[3]; + + if (darg == MPI_DISTRIBUTE_DFLT_DARG) blksize = 1; + else blksize = darg; +@@ -246,7 +244,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc + for (i=0; idim; i--) stride *= (MPI_Aint)array_of_gsizes[i]; + +- MPI_Type_hvector(count, blksize, stride, type_old, type_new); ++ MPI_Type_create_hvector(count, blksize, stride, type_old, type_new); + + if (rem) { + /* if the last block is of size less than blksize, include +@@ -259,7 +257,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc + blklens[0] = 1; + blklens[1] = rem; + +- MPI_Type_struct(2, blklens, disps, types, &type_tmp); ++ MPI_Type_create_struct(2, blklens, disps, types, &type_tmp); + + MPI_Type_free(type_new); + *type_new = type_tmp; +@@ -269,14 +267,12 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc + dimension correctly. */ + if ( ((order == MPI_ORDER_FORTRAN) && (dim == 0)) || + ((order == MPI_ORDER_C) && (dim == ndims-1)) ) { +- types[0] = MPI_LB; +- disps[0] = 0; +- types[1] = *type_new; +- disps[1] = (MPI_Aint)rank * (MPI_Aint)blksize * orig_extent; +- types[2] = MPI_UB; +- disps[2] = orig_extent * (MPI_Aint)array_of_gsizes[dim]; +- blklens[0] = blklens[1] = blklens[2] = 1; +- MPI_Type_struct(3, blklens, disps, types, &type_tmp); ++ types[0] = *type_new; ++ disps[0] = (MPI_Aint)rank * (MPI_Aint)blksize * orig_extent; ++ blklens[0] = 1; ++ MPI_Type_create_struct(1, blklens, disps, types, &type_tmp1); ++ MPI_Type_create_resized (type_tmp1, 0, orig_extent * (MPI_Aint)array_of_gsizes[dim], &type_tmp); ++ MPI_Type_free(&type_tmp1); + MPI_Type_free(type_new); + *type_new = type_tmp; + +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_end.c b/ompi/mca/io/romio314/romio/adio/common/ad_end.c +index 00725f5..b534e0c 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_end.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_end.c +@@ -72,13 +72,13 @@ int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void + ADIOI_UNREFERENCED_ARG(attribute_val); + ADIOI_UNREFERENCED_ARG(extra_state); + +- MPI_Keyval_free(&keyval); ++ MPI_Comm_free_keyval (&keyval); + + /* The end call will be called after all possible uses of this keyval, even + * if a file was opened with MPI_COMM_SELF. Note, this assumes LIFO + * MPI_COMM_SELF attribute destruction behavior mandated by MPI-2.2. */ + if (ADIOI_cb_config_list_keyval != MPI_KEYVAL_INVALID) +- MPI_Keyval_free(&ADIOI_cb_config_list_keyval); ++ MPI_Comm_free_keyval (&ADIOI_cb_config_list_keyval); + + ADIO_End(&error_code); + return error_code; +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c b/ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c +index 22b2da4..1f2573e 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c +@@ -54,7 +54,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, + int interleave_count = 0, i, nprocs, myrank, nprocs_for_coll; + int cb_enable; + ADIO_Offset bufsize; +- MPI_Aint extent; ++ MPI_Aint extent, lb; + #ifdef DEBUG2 + MPI_Aint bufextent; + #endif +@@ -191,7 +191,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, + return; + } + +- MPI_Type_extent(datatype, &extent); ++ MPI_Type_get_extent(datatype, &lb, &extent); + #ifdef DEBUG2 + bufextent = extent * count; + #endif +@@ -702,7 +702,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, + { + MPI_Count filetype_size, buftype_size, etype_size; + int sum; +- MPI_Aint filetype_extent; ++ MPI_Aint filetype_extent, lb; + ADIO_Offset total_io; + int filetype_is_contig; + ADIO_Offset i, remainder; +@@ -726,7 +726,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, + ADIOI_Datatype_iscontig (fd->filetype, &filetype_is_contig); + + MPI_Type_size_x (fd->filetype, &filetype_size); +- MPI_Type_extent (fd->filetype, &filetype_extent); ++ MPI_Type_get_extent (fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x (fd->etype, &etype_size); + MPI_Type_size_x (buftype, &buftype_size); + +@@ -884,7 +884,7 @@ void ADIOI_IOFiletype(ADIO_File fd, void *buf, int count, + int user_ind_rd_buffer_size; + int f_is_contig, m_is_contig; + int user_ds_read, user_ds_write; +- MPI_Aint f_extent; ++ MPI_Aint f_extent, lb; + MPI_Count f_size; + int f_ds_percent; /* size/extent */ + +@@ -894,7 +894,7 @@ void ADIOI_IOFiletype(ADIO_File fd, void *buf, int count, + else + MPE_Log_event(5008, 0, NULL); + #endif +- MPI_Type_extent(custom_ftype, &f_extent); ++ MPI_Type_get_extent(custom_ftype, &lb, &f_extent); + MPI_Type_size_x(custom_ftype, &f_size); + f_ds_percent = 100 * f_size / f_extent; + +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c b/ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c +index 60b409d..ea76f45 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c +@@ -307,8 +307,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype + ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); + + MPI_Type_size_x(fd->filetype, &filetype_size); +- MPI_Type_extent(fd->filetype, &filetype_extent); +- MPI_Type_lb(fd->filetype, &filetype_lb); ++ MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent); + MPI_Type_size_x(datatype, &buftype_size); + etype_size = fd->etype_size; + +@@ -524,7 +523,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype + int req_len, flag, rank; + MPI_Status status; + ADIOI_Flatlist_node *flat_buf=NULL; +- MPI_Aint buftype_extent; ++ MPI_Aint buftype_extent, lb; + int coll_bufsize; + + *error_code = MPI_SUCCESS; /* changed below if error */ +@@ -605,7 +604,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype + flat_buf = ADIOI_Flatlist; + while (flat_buf->type != datatype) flat_buf = flat_buf->next; + } +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + + done = 0; + off = st_loc; +@@ -685,7 +684,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype + if (req_off < real_off + real_size) { + count[i]++; + ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)read_buf)+req_off-real_off) == (ADIO_Offset)(MPIR_Upint)(read_buf+req_off-real_off)); +- MPI_Address(read_buf+req_off-real_off, ++ MPI_Get_address(read_buf+req_off-real_off, + &(others_req[i].mem_ptrs[j])); + ADIOI_Assert((real_off + real_size - req_off) == (int)(real_off + real_size - req_off)); + send_size[i] += (int)(ADIOI_MIN(real_off + real_size - req_off, +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_read_str.c b/ompi/mca/io/romio314/romio/adio/common/ad_read_str.c +index dc2ea71..bad948a 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_read_str.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_read_str.c +@@ -56,7 +56,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, + ADIO_Offset n_filetypes, etype_in_filetype, st_n_filetypes, size_in_filetype; + ADIO_Offset abs_off_in_filetype=0, new_frd_size, frd_size=0, st_frd_size; + MPI_Count filetype_size, etype_size, buftype_size, partial_read; +- MPI_Aint filetype_extent, buftype_extent; ++ MPI_Aint filetype_extent, buftype_extent, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset userbuf_off, req_len, sum; + ADIO_Offset off, req_off, disp, end_offset=0, readbuf_off, start_off; +@@ -94,9 +94,9 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, + return; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(datatype, &buftype_size); +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(MPI_Count)buftype_size * (ADIO_Offset)count)); +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c b/ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c +index 6ecebda..cb57489 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c +@@ -23,7 +23,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, + ADIO_Offset abs_off_in_filetype=0; + MPI_Count bufsize, filetype_size, buftype_size, size_in_filetype; + ADIO_Offset etype_size; +- MPI_Aint filetype_extent, buftype_extent; ++ MPI_Aint filetype_extent, buftype_extent, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset userbuf_off; + ADIO_Offset off, req_off, disp, end_offset=0, start_off; +@@ -43,9 +43,9 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, + return; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(buftype, &buftype_size); +- MPI_Type_extent(buftype, &buftype_extent); ++ MPI_Type_get_extent(buftype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)buftype_size * (ADIO_Offset)count)); +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_seek.c b/ompi/mca/io/romio314/romio/adio/common/ad_seek.c +index b987fe6..9a992dd 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_seek.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_seek.c +@@ -28,7 +28,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, + ADIO_Offset size_in_filetype, sum; + MPI_Count filetype_size, etype_size; + int filetype_is_contig; +- MPI_Aint filetype_extent; ++ MPI_Aint filetype_extent, lb; + + ADIOI_UNREFERENCED_ARG(whence); + +@@ -40,7 +40,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, + flat_file = ADIOI_Flatlist; + while (flat_file->type != fd->filetype) flat_file = flat_file->next; + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(fd->filetype, &filetype_size); + if ( ! filetype_size ) { + /* Since offset relative to the filetype size, we can't +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_subarray.c b/ompi/mca/io/romio314/romio/adio/common/ad_subarray.c +index e7984ac..6ae7015 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_subarray.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_subarray.c +@@ -16,11 +16,11 @@ int ADIO_Type_create_subarray(int ndims, + MPI_Datatype oldtype, + MPI_Datatype *newtype) + { +- MPI_Aint extent, disps[3], size; +- int i, blklens[3]; +- MPI_Datatype tmp1, tmp2, types[3]; ++ MPI_Aint extent, disp, size, lb, ub; ++ int i, blklen; ++ MPI_Datatype tmp1, tmp2, inttype; + +- MPI_Type_extent(oldtype, &extent); ++ MPI_Type_get_extent(oldtype, &lb, &extent); + + if (order == MPI_ORDER_FORTRAN) { + /* dimension 0 changes fastest */ +@@ -35,18 +35,18 @@ int ADIO_Type_create_subarray(int ndims, + size = (MPI_Aint)array_of_sizes[0]*extent; + for (i=2; i=0; i--) { + size *= (MPI_Aint)array_of_sizes[i+1]; +- MPI_Type_hvector(array_of_subsizes[i], 1, size, tmp1, &tmp2); ++ MPI_Type_create_hvector(array_of_subsizes[i], 1, size, tmp1, &tmp2); + MPI_Type_free(&tmp1); + tmp1 = tmp2; + } + } + + /* add displacement and UB */ +- disps[1] = array_of_starts[ndims-1]; ++ disp = array_of_starts[ndims-1]; + size = 1; + for (i=ndims-2; i>=0; i--) { + size *= (MPI_Aint)array_of_sizes[i+1]; +- disps[1] += size*(MPI_Aint)array_of_starts[i]; ++ disp += size*(MPI_Aint)array_of_starts[i]; + } + } + +- disps[1] *= extent; ++ disp *= extent; + +- disps[2] = extent; +- for (i=0; itype != datatype) flat_buf = flat_buf->next; + } +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + + + /* I need to check if there are any outstanding nonblocking writes to +@@ -468,7 +468,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype + if (req_off < off + size) { + count[i]++; + ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIR_Upint)(write_buf+req_off-off)); +- MPI_Address(write_buf+req_off-off, ++ MPI_Get_address(write_buf+req_off-off, + &(others_req[i].mem_ptrs[j])); + ADIOI_Assert((off + size - req_off) == (int)(off + size - req_off)); + recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c b/ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c +index 42b5ff2..e3371a7 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c +@@ -35,7 +35,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, + ADIO_Offset n_filetypes, etype_in_filetype, size, sum; + ADIO_Offset abs_off_in_filetype=0, size_in_filetype; + MPI_Count filetype_size, etype_size, buftype_size; +- MPI_Aint filetype_extent, buftype_extent, indx; ++ MPI_Aint filetype_extent, buftype_extent, indx, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset off, disp; + int flag, err_flag=0; +@@ -71,9 +71,9 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, + MPI_Comm_size(fd->comm, &nprocs); + #endif + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(datatype, &buftype_size); +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count)); +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_str.c b/ompi/mca/io/romio314/romio/adio/common/ad_write_str.c +index 624aeb1..9e4d7f7 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_write_str.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_write_str.c +@@ -122,7 +122,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, + ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes; + ADIO_Offset n_etypes_in_filetype, abs_off_in_filetype=0; + MPI_Count filetype_size, etype_size, buftype_size; +- MPI_Aint filetype_extent, buftype_extent; ++ MPI_Aint filetype_extent, buftype_extent, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset userbuf_off; + ADIO_Offset off, req_off, disp, end_offset=0, writebuf_off, start_off; +@@ -164,9 +164,9 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, + return; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(datatype, &buftype_size); +- MPI_Type_extent(datatype, &buftype_extent); ++ MPI_Type_get_extent(datatype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + ADIOI_Assert((buftype_size * count) == ((MPI_Count)buftype_size * (ADIO_Offset)count)); +diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c b/ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c +index 591c66f..d72f116 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c ++++ b/ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c +@@ -24,7 +24,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, + ADIO_Offset size, n_filetypes, etype_in_filetype; + ADIO_Offset abs_off_in_filetype=0, req_len; + MPI_Count filetype_size, etype_size, buftype_size; +- MPI_Aint filetype_extent, buftype_extent; ++ MPI_Aint filetype_extent, buftype_extent, lb; + int buf_count, buftype_is_contig, filetype_is_contig; + ADIO_Offset userbuf_off; + ADIO_Offset off, req_off, disp, end_offset=0, start_off; +@@ -44,9 +44,9 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, + return; + } + +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + MPI_Type_size_x(buftype, &buftype_size); +- MPI_Type_extent(buftype, &buftype_extent); ++ MPI_Type_get_extent(buftype, &lb, &buftype_extent); + etype_size = fd->etype_size; + + ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count)); +diff --git a/ompi/mca/io/romio314/romio/adio/common/byte_offset.c b/ompi/mca/io/romio314/romio/adio/common/byte_offset.c +index b7350f1..66f83ed 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/byte_offset.c ++++ b/ompi/mca/io/romio314/romio/adio/common/byte_offset.c +@@ -18,7 +18,7 @@ void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp) + ADIO_Offset n_filetypes, etype_in_filetype, sum, abs_off_in_filetype=0, size_in_filetype; + MPI_Count n_etypes_in_filetype, filetype_size, etype_size; + int filetype_is_contig; +- MPI_Aint filetype_extent; ++ MPI_Aint filetype_extent, lb; + + ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); + etype_size = fd->etype_size; +@@ -46,7 +46,7 @@ void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp) + } + + /* abs. offset in bytes in the file */ +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + *disp = fd->disp + n_filetypes * ADIOI_AINT_CAST_TO_OFFSET filetype_extent + abs_off_in_filetype; + } + } +diff --git a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c b/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c +index 468105c..718205b 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c ++++ b/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c +@@ -135,12 +135,12 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, + + if (ADIOI_cb_config_list_keyval == MPI_KEYVAL_INVALID) { + /* cleaned up by ADIOI_End_call */ +- MPI_Keyval_create((MPI_Copy_function *) ADIOI_cb_copy_name_array, ++ MPI_Comm_create_keyval((MPI_Copy_function *) ADIOI_cb_copy_name_array, + (MPI_Delete_function *) ADIOI_cb_delete_name_array, + &ADIOI_cb_config_list_keyval, NULL); + } + else { +- MPI_Attr_get(comm, ADIOI_cb_config_list_keyval, (void *) &array, &found); ++ MPI_Comm_get_attr(comm, ADIOI_cb_config_list_keyval, (void *) &array, &found); + if (found) { + ADIOI_Assert(array != NULL); + *arrayp = array; +@@ -255,8 +255,8 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, + * it next time an open is performed on this same comm, and on the + * dupcomm, so we can use it in I/O operations. + */ +- MPI_Attr_put(comm, ADIOI_cb_config_list_keyval, array); +- MPI_Attr_put(dupcomm, ADIOI_cb_config_list_keyval, array); ++ MPI_Comm_set_attr (comm, ADIOI_cb_config_list_keyval, array); ++ MPI_Comm_set_attr (dupcomm, ADIOI_cb_config_list_keyval, array); + *arrayp = array; + return 0; + } +diff --git a/ompi/mca/io/romio314/romio/adio/common/eof_offset.c b/ompi/mca/io/romio314/romio/adio/common/eof_offset.c +index 7247463..c503eaf 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/eof_offset.c ++++ b/ompi/mca/io/romio314/romio/adio/common/eof_offset.c +@@ -18,7 +18,7 @@ void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset) + ADIO_Offset fsize, disp, sum=0, size_in_file, n_filetypes, rem, etype_size; + int flag, i; + ADIO_Fcntl_t *fcntl_struct; +- MPI_Aint filetype_extent; ++ MPI_Aint filetype_extent, lb; + ADIOI_Flatlist_node *flat_file; + + /* find the eof in bytes */ +@@ -45,7 +45,7 @@ void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset) + flat_file = flat_file->next; + + MPI_Type_size_x(fd->filetype, &filetype_size); +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + + disp = fd->disp; + n_filetypes = -1; +diff --git a/ompi/mca/io/romio314/romio/adio/common/flatten.c b/ompi/mca/io/romio314/romio/adio/common/flatten.c +index 1b6ff95..89da527 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/flatten.c ++++ b/ompi/mca/io/romio314/romio/adio/common/flatten.c +@@ -198,7 +198,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + avoid >2G integer arithmetic problems */ + ADIO_Offset top_count; + MPI_Count j, old_size, prev_index, num; +- MPI_Aint old_extent;/* Assume extents are non-negative */ ++ MPI_Aint old_extent, lb;/* Assume extents are non-negative */ + int *ints; + MPI_Aint *adds; /* Make no assumptions about +/- sign on these */ + MPI_Datatype *types; +@@ -331,7 +331,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + num = *curr_index - prev_index; + + /* The noncontiguous types have to be replicated count times */ +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + for (m=1; mindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; +@@ -385,7 +385,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + + /* The noncontiguous types have to be replicated blocklen times + and then strided. Replicate the first one. */ +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + for (m=1; mindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; +@@ -448,7 +448,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + + /* The noncontiguous types have to be replicated blocklen times + and then strided. Replicate the first one. */ +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + for (m=1; mindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; +@@ -479,7 +479,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, + &old_ntypes, &old_combiner); + ADIOI_Datatype_iscontig(types[0], &old_is_contig); +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + + prev_index = *curr_index; + if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) +@@ -585,7 +585,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, + &old_ntypes, &old_combiner); + ADIOI_Datatype_iscontig(types[0], &old_is_contig); +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + + prev_index = *curr_index; + if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) +@@ -633,7 +633,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + if (is_hindexed_block) { + /* this is the one place the hindexed case uses the + * extent of a type */ +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + } + flat->indices[j] = flat->indices[j-num] + + ADIOI_AINT_CAST_TO_OFFSET old_extent; +@@ -708,7 +708,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + + /* The noncontiguous types have to be replicated blocklens[i] times + and then strided. Replicate the first one. */ +- MPI_Type_extent(types[0], &old_extent); ++ MPI_Type_get_extent(types[0], &lb, &old_extent); + for (m=1; mblocklens[j-num] > 0) { +@@ -775,7 +775,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + /* simplest case, current type is basic or contiguous types */ + /* By using ADIO_Offset we preserve +/- sign and + avoid >2G integer arithmetic problems */ +- if (ints[1+n] > 0 || types[n] == MPI_LB || types[n] == MPI_UB) { ++ if (ints[1+n] > 0) { + ADIO_Offset blocklength = ints[1+n]; + j = *curr_index; + flat->indices[j] = st_offset + adds[n]; +@@ -794,7 +794,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, + num = *curr_index - prev_index; + + /* The current type has to be replicated blocklens[n] times */ +- MPI_Type_extent(types[n], &old_extent); ++ MPI_Type_get_extent(types[n], &lb, &old_extent); + for (m=1; mindices[j] = +diff --git a/ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c b/ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c +index eb176b8..785b662 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c ++++ b/ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c +@@ -18,7 +18,7 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset) + int i, flag; + MPI_Count filetype_size, etype_size; + int filetype_is_contig; +- MPI_Aint filetype_extent; ++ MPI_Aint filetype_extent, lb; + ADIO_Offset disp, byte_offset, sum=0, size_in_file, n_filetypes, frd_size; + + ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); +@@ -31,7 +31,7 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset) + while (flat_file->type != fd->filetype) flat_file = flat_file->next; + + MPI_Type_size_x(fd->filetype, &filetype_size); +- MPI_Type_extent(fd->filetype, &filetype_extent); ++ MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); + + disp = fd->disp; + byte_offset = fd->fp_ind; +diff --git a/ompi/mca/io/romio314/romio/adio/include/mpipr.h b/ompi/mca/io/romio314/romio/adio/include/mpipr.h +index 21f208e..bfe8b5e 100644 +--- a/ompi/mca/io/romio314/romio/adio/include/mpipr.h ++++ b/ompi/mca/io/romio314/romio/adio/include/mpipr.h +@@ -12,8 +12,6 @@ + + #undef MPI_Abort + #define MPI_Abort PMPI_Abort +-#undef MPI_Address +-#define MPI_Address PMPI_Address + #undef MPI_Allgather + #define MPI_Allgather PMPI_Allgather + #undef MPI_Allgatherv +@@ -30,8 +28,6 @@ + #define MPI_Attr_delete PMPI_Attr_delete + #undef MPI_Attr_get + #define MPI_Attr_get PMPI_Attr_get +-#undef MPI_Attr_put +-#define MPI_Attr_put PMPI_Attr_put + #undef MPI_Barrier + #define MPI_Barrier PMPI_Barrier + #undef MPI_Bcast +@@ -68,10 +64,14 @@ + #define MPI_Comm_compare PMPI_Comm_compare + #undef MPI_Comm_create + #define MPI_Comm_create PMPI_Comm_create ++#undef MPI_Comm_create_keyval ++#define MPI_Comm_create_keyval PMPI_Comm_create_keyval + #undef MPI_Comm_dup + #define MPI_Comm_dup PMPI_Comm_dup + #undef MPI_Comm_free + #define MPI_Comm_free PMPI_Comm_free ++#undef MPI_Comm_free_keyval ++#define MPI_Comm_free_keyval PMPI_Comm_free_keyval + #undef MPI_Comm_group + #define MPI_Comm_group PMPI_Comm_group + #undef MPI_Comm_rank +@@ -80,6 +80,8 @@ + #define MPI_Comm_remote_group PMPI_Comm_remote_group + #undef MPI_Comm_remote_size + #define MPI_Comm_remote_size PMPI_Comm_remote_size ++#undef MPI_Comm_set_attr ++#define MPI_Comm_set_attr PMPI_Comm_set_attr + #undef MPI_Comm_size + #define MPI_Comm_size PMPI_Comm_size + #undef MPI_Comm_split +@@ -106,6 +108,8 @@ + #define MPI_Gather PMPI_Gather + #undef MPI_Gatherv + #define MPI_Gatherv PMPI_Gatherv ++#undef MPI_Get_address ++#define MPI_Get_address PMPI_Get_address + #undef MPI_Get_count + #define MPI_Get_count PMPI_Get_count + #undef MPI_Get_elements +@@ -170,10 +174,6 @@ + #define MPI_Isend PMPI_Isend + #undef MPI_Issend + #define MPI_Issend PMPI_Issend +-#undef MPI_Keyval_create +-#define MPI_Keyval_create PMPI_Keyval_create +-#undef MPI_Keyval_free +-#define MPI_Keyval_free PMPI_Keyval_free + #undef MPI_Name_get + #define MPI_Name_get PMPI_Name_get + #undef MPI_Name_put +@@ -248,14 +248,22 @@ + #define MPI_Type_contiguous PMPI_Type_contiguous + #undef MPI_Type_count + #define MPI_Type_count PMPI_Type_count ++#undef MPI_Type_create_struct ++#define MPI_Type_create_struct PMPI_Type_create_struct ++#undef MPI_Type_create_resized ++#define MPI_Type_create_resized PMPI_Type_create_resized + /* #define MPI_Type_create_darray PMPI_Type_create_darray */ + #undef MPI_Type_create_indexed_block + #define MPI_Type_create_indexed_block PMPI_Type_create_indexed_block ++#undef MPI_Type_create_hindexed ++#define MPI_Type_create_hindexed PMPI_Type_create_hindexed + #undef MPI_Type_create_hindexed_block + #define MPI_Type_create_hindexed_block PMPI_Type_create_hindexed_block ++#undef MPI_Type_create_hvector ++#define MPI_Type_create_hvector PMPI_Type_create_hvector + /* #define MPI_Type_create_subarray PMPI_Type_create_subarray */ +-#undef MPI_Type_extent +-#define MPI_Type_extent PMPI_Type_extent ++#undef MPI_Type_get_extent ++#define MPI_Type_get_extent PMPI_Type_get_extent + #undef MPI_Type_free + #define MPI_Type_free PMPI_Type_free + #undef MPI_Type_get_contents +@@ -264,20 +272,10 @@ + #define MPI_Type_get_envelope PMPI_Type_get_envelope + #undef MPI_Type_get_true_extent + #define MPI_Type_get_true_extent PMPI_Type_get_true_extent +-#undef MPI_Type_hindexed +-#define MPI_Type_hindexed PMPI_Type_hindexed +-#undef MPI_Type_hvector +-#define MPI_Type_hvector PMPI_Type_hvector + #undef MPI_Type_indexed + #define MPI_Type_indexed PMPI_Type_indexed +-#undef MPI_Type_lb +-#define MPI_Type_lb PMPI_Type_lb + #undef MPI_Type_size + #define MPI_Type_size PMPI_Type_size +-#undef MPI_Type_struct +-#define MPI_Type_struct PMPI_Type_struct +-#undef MPI_Type_ub +-#define MPI_Type_ub PMPI_Type_ub + #undef MPI_Type_vector + #define MPI_Type_vector PMPI_Type_vector + #undef MPI_Unpack +diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_extent.c b/ompi/mca/io/romio314/romio/mpi-io/get_extent.c +index 103f881..8b7ff15 100644 +--- a/ompi/mca/io/romio314/romio/mpi-io/get_extent.c ++++ b/ompi/mca/io/romio314/romio/mpi-io/get_extent.c +@@ -42,6 +42,7 @@ int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *exten + int error_code; + ADIO_File adio_fh; + static char myname[] = "MPI_FILE_GET_TYPE_EXTENT"; ++ MPI_Aint lb; + + adio_fh = MPIO_File_resolve(fh); + +@@ -52,7 +53,7 @@ int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *exten + + /* FIXME: handle other file data representations */ + +- error_code = MPI_Type_extent(datatype, extent); ++ error_code = MPI_Type_get_extent(datatype, &lb, extent); + + fn_exit: + return error_code; +diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c b/ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c +index 914b8d5..50d9d4e 100644 +--- a/ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c ++++ b/ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c +@@ -36,15 +36,15 @@ void MPIR_MPIOInit(int * error_code) { + } + /* --END ERROR HANDLING-- */ + +- MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval, +- (void *) 0); ++ MPI_Comm_create_keyval (MPI_COMM_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval, ++ (void *) 0); + + /* put a dummy attribute on MPI_COMM_SELF, because we want the delete + function to be called when MPI_COMM_SELF is freed. Clarified + in MPI-2 section 4.8, the standard mandates that attributes on + MPI_COMM_SELF get cleaned up early in MPI_Finalize */ + +- MPI_Attr_put(MPI_COMM_SELF, ADIO_Init_keyval, (void *) 0); ++ MPI_Comm_set_attr (MPI_COMM_SELF, ADIO_Init_keyval, (void *) 0); + + /* initialize ADIO */ + ADIO_Init( (int *)0, (char ***)0, error_code); diff --git a/ompi/mca/io/romio321/romio/3.diff b/ompi/mca/io/romio321/romio/3.diff new file mode 100644 index 0000000000..7c4af40741 --- /dev/null +++ b/ompi/mca/io/romio321/romio/3.diff @@ -0,0 +1,36 @@ +commit ae17908f35ee614071ec68eb4643286f7b707e86 +Author: Nathan Hjelm +Date: Tue May 1 15:11:34 2018 -0600 + + io/romio314: fix two more MPI-3 compliance issues + + Signed-off-by: Nathan Hjelm + +diff --git a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c b/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c +index 718205b..e9f3116 100644 +--- a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c ++++ b/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c +@@ -135,8 +135,8 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, + + if (ADIOI_cb_config_list_keyval == MPI_KEYVAL_INVALID) { + /* cleaned up by ADIOI_End_call */ +- MPI_Comm_create_keyval((MPI_Copy_function *) ADIOI_cb_copy_name_array, +- (MPI_Delete_function *) ADIOI_cb_delete_name_array, ++ MPI_Comm_create_keyval((MPI_Comm_copy_attr_function *) ADIOI_cb_copy_name_array, ++ (MPI_Comm_delete_attr_function *) ADIOI_cb_delete_name_array, + &ADIOI_cb_config_list_keyval, NULL); + } + else { +diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h b/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h +index a73561a..ff13723 100644 +--- a/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h ++++ b/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h +@@ -58,7 +58,7 @@ struct MPIR_Info { + + #define MPIR_INFO_COOKIE 5835657 + +-MPI_Delete_function ADIOI_End_call; ++MPI_Comm_delete_attr_function ADIOI_End_call; + + /* common initialization routine */ + void MPIR_MPIOInit(int * error_code); diff --git a/ompi/mca/io/romio314/romio/COPYRIGHT b/ompi/mca/io/romio321/romio/COPYRIGHT similarity index 90% rename from ompi/mca/io/romio314/romio/COPYRIGHT rename to ompi/mca/io/romio321/romio/COPYRIGHT index a058206a47..609bcfa4e8 100644 --- a/ompi/mca/io/romio314/romio/COPYRIGHT +++ b/ompi/mca/io/romio321/romio/COPYRIGHT @@ -7,11 +7,11 @@ all source listings of the code. Copyright (C) 1997 University of Chicago Permission is hereby granted to use, reproduce, prepare derivative -works, and to redistribute to others. +works, and to redistribute to others. -The University of Chicago makes no representations as to the suitability, -operability, accuracy, or correctness of this software for any purpose. -It is provided "as is" without express or implied warranty. +The University of Chicago makes no representations as to the suitability, +operability, accuracy, or correctness of this software for any purpose. +It is provided "as is" without express or implied warranty. This software was authored by: Rajeev Thakur: (630) 252-1682; thakur@mcs.anl.gov @@ -26,7 +26,7 @@ Government Contract and are subject to the following license: the Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable worldwide license in this computer software to reproduce, prepare derivative works, and perform publicly -and display publicly. +and display publicly. DISCLAIMER @@ -37,5 +37,5 @@ of their employees, makes any warranty express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately -owned rights. +owned rights. diff --git a/ompi/mca/io/romio314/romio/Makefile.am b/ompi/mca/io/romio321/romio/Makefile.am similarity index 98% rename from ompi/mca/io/romio314/romio/Makefile.am rename to ompi/mca/io/romio321/romio/Makefile.am index c0c226f6ff..69d70142df 100644 --- a/ompi/mca/io/romio314/romio/Makefile.am +++ b/ompi/mca/io/romio321/romio/Makefile.am @@ -33,11 +33,11 @@ include $(top_srcdir)/Makefile.options ACLOCAL_AMFLAGS = -I confdb # empty variable initializations so that later code can append (+=) -include_HEADERS = +include_HEADERS = nodist_include_HEADERS = -noinst_HEADERS = +noinst_HEADERS = EXTRA_DIST = -SUFFIXES = +SUFFIXES = doc1_src_txt = # ------------------------------------------------------------------------ @@ -47,14 +47,14 @@ doc1_src_txt = # In MPICH these will have an MPI_ and a PMPI_ version. Other implementations # (like OMPI) only want these to be MPI_ routines, possibly with some # name-shifting prefix. -romio_mpi_sources = +romio_mpi_sources = # regular old source files that implement ROMIO, such as ADIO code romio_other_sources = # code that may need to be "up" called from the MPI library and/or is # MPI-implementation-specific in some way -glue_sources = +glue_sources = # ------------------------------------------------------------------------ # when building under MPICH we must be able to find mpi.h @@ -102,7 +102,7 @@ if BUILD_PROFILING_LIB # won't work very well the other way around. noinst_LTLIBRARIES += libpromio.la libpromio_la_SOURCES = $(romio_mpi_sources) -libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING +libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING endif BUILD_PROFILING_LIB else !BUILD_ROMIO_EMBEDDED diff --git a/ompi/mca/io/romio314/romio/Makefile.options b/ompi/mca/io/romio321/romio/Makefile.options similarity index 100% rename from ompi/mca/io/romio314/romio/Makefile.options rename to ompi/mca/io/romio321/romio/Makefile.options diff --git a/ompi/mca/io/romio314/romio/README b/ompi/mca/io/romio321/romio/README similarity index 93% rename from ompi/mca/io/romio314/romio/README rename to ompi/mca/io/romio321/romio/README index bee37ec6c8..a6fb25a09a 100644 --- a/ompi/mca/io/romio314/romio/README +++ b/ompi/mca/io/romio321/romio/README @@ -23,11 +23,11 @@ Major Changes in this version: PanFS allows users to specify the layout of a file at file-creation time. Layout information includes the number of StorageBlades (SB) - across which the data is stored, the number of SBs across which a - parity stripe is written, and the number of consecutive stripes that - are placed on the same set of SBs. The panfs_layout_* hints are only + across which the data is stored, the number of SBs across which a + parity stripe is written, and the number of consecutive stripes that + are placed on the same set of SBs. The panfs_layout_* hints are only used if supplied at file-creation time. - + panfs_layout_type - Specifies the layout of a file: 2 = RAID0 3 = RAID5 Parity Stripes @@ -35,37 +35,37 @@ Major Changes in this version: panfs_layout_total_num_comps - The total number of StorageBlades a file is striped across. panfs_layout_parity_stripe_width - If the layout type is RAID5 Parity - Stripes, this hint specifies the + Stripes, this hint specifies the number of StorageBlades in a parity stripe. panfs_layout_parity_stripe_depth - If the layout type is RAID5 Parity Stripes, this hint specifies the - number of contiguous parity stripes written + number of contiguous parity stripes written across the same set of SBs. - panfs_layout_visit_policy - If the layout type is RAID5 Parity Stripes, - the policy used to determine the parity + panfs_layout_visit_policy - If the layout type is RAID5 Parity Stripes, + the policy used to determine the parity stripe a given file offset is written to: 1 = Round Robin - PanFS supports the "concurrent write" (CW) mode, where groups of cooperating - clients can disable the PanFS consistency mechanisms and use their own - consistency protocol. Clients participating in concurrent write mode use - application specific information to improve performance while maintaining - file consistency. All clients accessing the file(s) must enable concurrent - write mode. If any client does not enable concurrent write mode, then the - PanFS consistency protocol will be invoked. Once a file is opened in CW mode - on a machine, attempts to open a file in non-CW mode will fail with - EACCES. If a file is already opened in non-CW mode, attempts to open - the file in CW mode will fail with EACCES. The following hint is + PanFS supports the "concurrent write" (CW) mode, where groups of cooperating + clients can disable the PanFS consistency mechanisms and use their own + consistency protocol. Clients participating in concurrent write mode use + application specific information to improve performance while maintaining + file consistency. All clients accessing the file(s) must enable concurrent + write mode. If any client does not enable concurrent write mode, then the + PanFS consistency protocol will be invoked. Once a file is opened in CW mode + on a machine, attempts to open a file in non-CW mode will fail with + EACCES. If a file is already opened in non-CW mode, attempts to open + the file in CW mode will fail with EACCES. The following hint is used to enable concurrent write mode. - panfs_concurrent_write - If set to 1 at file open time, the file - is opened using the PanFS concurrent write + panfs_concurrent_write - If set to 1 at file open time, the file + is opened using the PanFS concurrent write mode flag. Concurrent write mode is not a persistent attribute of the file. Below is an example PanFS layout using the following parameters: - + - panfs_layout_type = 3 - panfs_layout_total_num_comps = 100 - panfs_layout_parity_stripe_width = 10 @@ -89,7 +89,7 @@ Major Changes in this version: ... * Initial support for the Globus GridFTP filesystem. Work contributed by Troy - Baer (troy@osc.edu). + Baer (troy@osc.edu). Major Changes in Version 1.2.5: ------------------------------ @@ -108,7 +108,7 @@ Major Changes in Version 1.2.5: Major Changes in Version 1.2.4: ------------------------------ -* Added section describing ROMIO MPI_FILE_SYNC and MPI_FILE_CLOSE behavior to +* Added section describing ROMIO MPI_FILE_SYNC and MPI_FILE_CLOSE behavior to User's Guide * Bug removed from PVFS ADIO implementation regarding resize operations @@ -136,7 +136,7 @@ Major Changes in Version 1.2.3: Major Changes in Version 1.0.3: ------------------------------- -* When used with MPICH 1.2.1, the MPI-IO functions return proper error codes +* When used with MPICH 1.2.1, the MPI-IO functions return proper error codes and classes, and the status object is filled in. * On SGI's XFS file system, ROMIO can use direct I/O even if the @@ -144,12 +144,12 @@ Major Changes in Version 1.0.3: direct I/O. ROMIO does this by doing part of the request with buffered I/O (until all the restrictions are met) and doing the rest with direct I/O. (This feature hasn't been tested rigorously. Please - check for errors.) + check for errors.) By default, ROMIO will use only buffered I/O. Direct I/O can be enabled either by setting the environment variables MPIO_DIRECT_READ and/or MPIO_DIRECT_WRITE to TRUE, or on a per-file basis by using - the info keys "direct_read" and "direct_write". + the info keys "direct_read" and "direct_write". Direct I/O will result in higher performance only if you are accessing a high-bandwidth disk system. Otherwise, buffered I/O is @@ -166,51 +166,51 @@ Major Changes Version 1.0.2: components of the MPI I/O chapter not yet implemented are file interoperability and error handling. -* Added support for using "direct I/O" on SGI's XFS file system. +* Added support for using "direct I/O" on SGI's XFS file system. Direct I/O is an optional feature of XFS in which data is moved - directly between the user's buffer and the storage devices, bypassing - the file-system cache. This can improve performance significantly on + directly between the user's buffer and the storage devices, bypassing + the file-system cache. This can improve performance significantly on systems with high disk bandwidth. Without high disk bandwidth, regular I/O (that uses the file-system cache) perfoms better. ROMIO, therefore, does not use direct I/O by default. The user can turn on direct I/O (separately for reading and writing) either by - using environment variables or by using MPI's hints mechanism (info). + using environment variables or by using MPI's hints mechanism (info). To use the environment-variables method, do setenv MPIO_DIRECT_READ TRUE setenv MPIO_DIRECT_WRITE TRUE - To use the hints method, the two keys are "direct_read" and "direct_write". - By default their values are "false". To turn on direct I/O, set the values + To use the hints method, the two keys are "direct_read" and "direct_write". + By default their values are "false". To turn on direct I/O, set the values to "true". The environment variables have priority over the info keys. In other words, if the environment variables are set to TRUE, direct I/O - will be used even if the info keys say "false", and vice versa. - Note that direct I/O must be turned on separately for reading + will be used even if the info keys say "false", and vice versa. + Note that direct I/O must be turned on separately for reading and writing. The environment-variables method assumes that the environment variables can be read by each process in the MPI job. This is not guaranteed by the MPI Standard, but it works with SGI's MPI and the ch_shmem device of MPICH. -* Added support (new ADIO device, ad_pvfs) for the PVFS parallel +* Added support (new ADIO device, ad_pvfs) for the PVFS parallel file system for Linux clusters, developed at Clemson University (see http://www.parl.clemson.edu/pvfs ). To use it, you must first install - PVFS and then when configuring ROMIO, specify "-file_system=pvfs" in + PVFS and then when configuring ROMIO, specify "-file_system=pvfs" in addition to any other options to "configure". (As usual, you can configure - for multiple file systems by using "+"; for example, - "-file_system=pvfs+ufs+nfs".) You will need to specify the path - to the PVFS include files via the "-cflags" option to configure, + for multiple file systems by using "+"; for example, + "-file_system=pvfs+ufs+nfs".) You will need to specify the path + to the PVFS include files via the "-cflags" option to configure, for example, "configure -cflags=-I/usr/pvfs/include". You will also need to specify the full path name of the PVFS library. - The best way to do this is via the "-lib" option to MPICH's - configure script (assuming you are using ROMIO from within MPICH). + The best way to do this is via the "-lib" option to MPICH's + configure script (assuming you are using ROMIO from within MPICH). * Uses weak symbols (where available) for building the profiling version, i.e., the PMPI routines. As a result, the size of the library is reduced - considerably. + considerably. * The Makefiles use "virtual paths" if supported by the make utility. GNU make supports it, for example. This feature allows you to untar the distribution in some directory, say a slow NFS directory, - and compile the library (the .o files) in another + and compile the library (the .o files) in another directory, say on a faster local disk. For example, if the tar file has been untarred in an NFS directory called /home/thakur/romio, one can compile it in a different directory, say /tmp/thakur, as follows: @@ -228,8 +228,8 @@ Major Changes Version 1.0.2: * This version is included in MPICH 1.2.0. If you are using MPICH, you need not download ROMIO separately; it gets built as part of MPICH. - The previous version of ROMIO is included in LAM, HP MPI, SGI MPI, and - NEC MPI. NEC has also implemented the MPI-IO functions missing + The previous version of ROMIO is included in LAM, HP MPI, SGI MPI, and + NEC MPI. NEC has also implemented the MPI-IO functions missing in ROMIO, and therefore NEC MPI has a complete implementation of MPI-IO. @@ -242,10 +242,10 @@ Major Changes in Version 1.0.1: * Added support for NEC SX-4 and created a new device ad_sfs for NEC SFS file system. -* New devices ad_hfs for HP/Convex HFS file system and ad_xfs for +* New devices ad_hfs for HP/Convex HFS file system and ad_xfs for SGI XFS file system. -* Users no longer need to prefix the filename with the type of +* Users no longer need to prefix the filename with the type of file system; ROMIO determines the file-system type on its own. * Added support for 64-bit file sizes on IBM PIOFS, SGI XFS, @@ -254,27 +254,27 @@ Major Changes in Version 1.0.1: * MPI_Offset is an 8-byte integer on machines that support 8-byte integers. It is of type "long long" in C and "integer*8" in Fortran. With a Fortran 90 compiler, you can use either integer*8 or - integer(kind=MPI_OFFSET_KIND). - If you printf an MPI_Offset in C, remember to use %lld - or %ld as required by your compiler. (See what is used in the test + integer(kind=MPI_OFFSET_KIND). + If you printf an MPI_Offset in C, remember to use %lld + or %ld as required by your compiler. (See what is used in the test program romio/test/misc.c.) -* On some machines, ROMIO detects at configure time that "long long" is +* On some machines, ROMIO detects at configure time that "long long" is either not supported by the C compiler or it doesn't work properly. In such cases, configure sets MPI_Offset to long in C and integer in Fortran. This happens on Intel Paragon, Sun4, and FreeBSD. -* Added support for passing hints to the implementation via the MPI_Info +* Added support for passing hints to the implementation via the MPI_Info parameter. ROMIO understands the following hints (keys in MPI_Info object): - /* on all file systems */ + /* on all file systems */ cb_buffer_size - buffer size for collective I/O cb_nodes - no. of processes that actually perform I/O in collective I/O ind_rd_buffer_size - buffer size for data sieving in independent reads /* on all file systems except IBM PIOFS */ ind_wr_buffer_size - buffer size for data sieving in independent writes - /* ind_wr_buffer_size is ignored on PIOFS because data sieving + /* ind_wr_buffer_size is ignored on PIOFS because data sieving cannot be done for writes since PIOFS doesn't support file locking */ /* on Intel PFS and IBM PIOFS only. These hints are understood only if @@ -285,16 +285,16 @@ Major Changes in Version 1.0.1: striping (between 0 and (striping_factor-1)) /* on Intel PFS only. */ - pfs_svr_buf - turn on or off PFS server buffering by setting the value + pfs_svr_buf - turn on or off PFS server buffering by setting the value to "true" or "false", case-sensitive. - + If ROMIO doesn't understand a hint, or if the value is invalid, the hint - will be ignored. The values of hints being used by ROMIO at any time + will be ignored. The values of hints being used by ROMIO at any time can be obtained via MPI_File_get_info. -General Information +General Information ------------------- ROMIO is a high-performance, portable implementation of MPI-IO (the @@ -311,7 +311,7 @@ accessing arrays stored in files. The functions MPI_File_f2c and MPI_File_c2f (Sec. 4.12.4) are also implemented. C, Fortran, and profiling interfaces are provided for all functions -that have been implemented. +that have been implemented. Please read the limitations of this version of ROMIO that are listed below (e.g., MPIO_Request object, restriction to homogeneous @@ -326,7 +326,7 @@ SFS, PVFS, NFS, and any Unix file system (UFS). This version of ROMIO is included in MPICH 1.2.3; an earlier version is included in at least the following MPI implementations: LAM, HP -MPI, SGI MPI, and NEC MPI. +MPI, SGI MPI, and NEC MPI. Note that proper I/O error codes and classes are returned and the status variable is filled only when used with MPICH 1.2.1 or later. @@ -358,16 +358,16 @@ performance, but it is necessary for correct behavior. The following are some instructions we received from Ian Wells of HP for setting the noac option on NFS. We have not tried them -ourselves. We are including them here because you may find +ourselves. We are including them here because you may find them useful. Note that some of the steps may be specific to HP systems, and you may need root permission to execute some of the -commands. - +commands. + >1. first confirm you are running nfs version 3 > >rpcnfo -p `hostname` | grep nfs > - >ie + >ie > goedel >rpcinfo -p goedel | grep nfs > 100003 2 udp 2049 nfs > 100003 3 udp 2049 nfs @@ -379,11 +379,11 @@ commands. > Here is an example of a correct fstab entry for /epm1: > > ie grep epm1 /etc/fstab - > + > > ROOOOT 11>grep epm1 /etc/fstab > gershwin:/epm1 /rmt/gershwin/epm1 nfs bg,intr,noac 0 0 > - > if the noac option is not present, add it + > if the noac option is not present, add it > and then remount this directory > on each of the machines that will be used to share MPIO files > @@ -394,7 +394,7 @@ commands. > >3. Confirm that the directory is mounted noac: > - >ROOOOT >grep gershwin /etc/mnttab + >ROOOOT >grep gershwin /etc/mnttab >gershwin:/epm1 /rmt/gershwin/epm1 nfs >noac,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0 0 0 899911504 @@ -424,8 +424,8 @@ THEN make Some example programs and a Makefile are provided in the romio/test directory. -Run the examples the way you would run any MPI program. Each program takes -the filename as a command-line argument "-fname filename". +Run the examples the way you would run any MPI program. Each program takes +the filename as a command-line argument "-fname filename". The configure script by default configures ROMIO for the file systems most likely to be used on the given machine. If you wish, you can @@ -440,7 +440,7 @@ For the entire list of options to configure do ./configure -h | more After building a specific version as above, you can install it in a -particular directory with +particular directory with make install PREFIX=/usr/local/romio (or whatever directory you like) @@ -448,14 +448,14 @@ or just make install (if you used -prefix at configure time) -If you intend to leave ROMIO where you built it, you should NOT install it -(install is used only to move the necessary parts of a built ROMIO to +If you intend to leave ROMIO where you built it, you should NOT install it +(install is used only to move the necessary parts of a built ROMIO to another location). The installed copy will have the include files, libraries, man pages, and a few other odds and ends, but not the whole source tree. It will have a test directory for testing the installation and a location-independent Makefile built during installation, which users can copy and modify to compile and link -against the installed copy. +against the installed copy. To rebuild ROMIO with a different set of configure options, do @@ -471,7 +471,7 @@ Testing ROMIO To test if the installation works, do - make testing + make testing in the romio/test directory. This calls a script that runs the test programs and compares the results with what they should be. By @@ -489,15 +489,15 @@ Compiling and Running MPI-IO Programs If ROMIO is not already included in the MPI implementation, you need to include the file mpio.h for C or mpiof.h for Fortran in your MPI-IO -program. +program. Note that on HP machines running HPUX and on NEC SX-4, you need to compile Fortran programs with mpifort, because the f77 compilers on -these machines don't support 8-byte integers. +these machines don't support 8-byte integers. -With MPICH, HP MPI, or NEC MPI, you can compile MPI-IO programs as +With MPICH, HP MPI, or NEC MPI, you can compile MPI-IO programs as mpicc foo.c -or +or mpif77 foo.f or mpifort foo.f @@ -505,14 +505,14 @@ or As mentioned above, mpifort is preferred over mpif77 on HPUX and NEC because the f77 compilers on those machines do not support 8-byte integers. -With SGI MPI, you can compile MPI-IO programs as +With SGI MPI, you can compile MPI-IO programs as cc foo.c -lmpi or f77 foo.f -lmpi or f90 foo.f -lmpi -With LAM, you can compile MPI-IO programs as +With LAM, you can compile MPI-IO programs as hcc foo.c -lmpi or hf77 foo.f -lmpi @@ -530,7 +530,7 @@ an SGI machine, make sure that you use MPICH's mpirun and not SGI's mpirun. The Makefile in the romio/test directory illustrates how to compile -and link MPI-IO programs. +and link MPI-IO programs. @@ -552,7 +552,7 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status); int MPIO_Wait(MPIO_Request *request, MPI_Status *status); The usual functions MPI_Test, MPI_Wait, MPI_Testany, etc., will not -work for nonblocking I/O. +work for nonblocking I/O. * This version works only on a homogeneous cluster of machines, and only the "native" file data representation is supported. @@ -582,11 +582,11 @@ message from SGI MPI: ``MPI has run out of internal datatype entries. Please set the environment variable MPI_TYPE_MAX for additional space.'' If you get this error message, add this line to your .cshrc file: - setenv MPI_TYPE_MAX 65536 + setenv MPI_TYPE_MAX 65536 Use a larger number if you still get the error message. * If a Fortran program uses a file handle created using ROMIO's C -interface, or vice-versa, you must use the functions MPI_File_c2f +interface, or vice-versa, you must use the functions MPI_File_c2f or MPI_File_f2c. Such a situation occurs, for example, if a Fortran program uses an I/O library written in C with MPI-IO calls. Similar functions MPIO_Request_f2c and @@ -595,12 +595,12 @@ MPIO_Request_c2f are also provided. * For Fortran programs on the Intel Paragon, you may need to provide the complete path to mpif.h in the include statement, e.g., include '/usr/local/mpich/include/mpif.h' -instead of +instead of include 'mpif.h' This is because the -I option to the Paragon Fortran compiler if77 -doesn't work correctly. It always looks in the default directories first +doesn't work correctly. It always looks in the default directories first and, therefore, picks up Intel's mpif.h, which is actually the -mpif.h of an older version of MPICH. +mpif.h of an older version of MPICH. diff --git a/ompi/mca/io/romio314/romio/README_OMPI b/ompi/mca/io/romio321/romio/README_OMPI similarity index 100% rename from ompi/mca/io/romio314/romio/README_OMPI rename to ompi/mca/io/romio321/romio/README_OMPI diff --git a/ompi/mca/io/romio314/romio/adio/Makefile.mk b/ompi/mca/io/romio321/romio/adio/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/.gitignore b/ompi/mca/io/romio321/romio/adio/ad_gpfs/.gitignore similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/.gitignore rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/.gitignore diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_gpfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs.c b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs.c rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs.c index ce80672dc0..f376150f0b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs.c @@ -7,8 +7,8 @@ */ /* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * Copyright (C) 2001 University of Chicago. +/* + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_gpfs.h" @@ -56,6 +56,8 @@ struct ADIOI_Fns_struct ADIO_GPFS_operations = { #elif PEPLATFORM "GPFS+PE: IBM GPFS for PE", #else - "GPFS: IBM GPFS" + "GPFS: IBM GPFS", #endif + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs.h b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs.h similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs.h rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs.h index 1bff707491..d64dcaeb99 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs.h @@ -7,8 +7,8 @@ */ /* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -24,7 +24,9 @@ #ifdef HAVE_SIGNAL_H #include #endif -#ifdef HAVE_AIO_H +#ifdef HAVE_AIO_LITE_H +#include +#elif defined HAVE_AIO_H #include #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_aggrs.c b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_aggrs.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_aggrs.c rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_aggrs.c index e403d9b1e5..3eb3d84969 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_aggrs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_aggrs.c @@ -719,9 +719,9 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs, others_req[i].lens = ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(ADIO_Offset)); - if ( (MPIR_Upint)others_req[i].offsets < (MPIR_Upint)recvBufForOffsets ) + if ( (MPIU_Upint)others_req[i].offsets < (MPIU_Upint)recvBufForOffsets ) recvBufForOffsets = others_req[i].offsets; - if ( (MPIR_Upint)others_req[i].lens < (MPIR_Upint)recvBufForLens ) + if ( (MPIU_Upint)others_req[i].lens < (MPIU_Upint)recvBufForLens ) recvBufForLens = others_req[i].lens; others_req[i].mem_ptrs = (MPI_Aint *) @@ -750,13 +750,13 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs, for (i=0; ihints->cb_pfr != ADIOI_HINT_DISABLE) { - ADIOI_IOStridedColl (fd, buf, count, ADIOI_READ, datatype, + ADIOI_IOStridedColl (fd, buf, count, ADIOI_READ, datatype, file_ptr_type, offset, status, error_code); return; } */ @@ -162,19 +163,48 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count, #ifdef RDCOLL_DEBUG for (i=0; icomm ); + for (ii=0; iicomm); MPI_Allgather(&end_offset, 1, ADIO_OFFSET, end_offsets, 1, ADIO_OFFSET, fd->comm); + if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) { + MPI_Allgather(&count_sizes, 1, ADIO_OFFSET, count_sizes, 1, + ADIO_OFFSET, fd->comm); + } } GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_PATANA, GPFSMPIO_CIO_T_GATHER ) /* are the accesses of different processes interleaved? */ for (i=1; ihints->cb_read == ADIOI_HINT_DISABLE - || (!interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO))) + || (!interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO))) { /* don't do aggregation */ if (fd->hints->cb_read != ADIOI_HINT_DISABLE) { @@ -259,18 +294,69 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count, * needs to be mapped to an actual rank in the communicator later. * */ - if (gpfsmpio_tuneblocking) + int currentNonZeroDataIndex = 0; + if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) { + /* Take out the 0-data offsets by shifting the indexes with data to the + * front and keeping track of the non-zero data index for use as the + * length. By doing this we will optimally use all available aggs + * and spread the actual data across them instead of having offsets + * with empty data potentially dilute the file domains and create + * problems for the one-sided aggregation. + */ + for (i=0; i 0) { + st_offsets[currentNonZeroDataIndex] = st_offsets[i]; + end_offsets[currentNonZeroDataIndex] = end_offsets[i]; + currentNonZeroDataIndex++; + } + } + } + if (gpfsmpio_tuneblocking) { + if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) { + ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, currentNonZeroDataIndex, + nprocs_for_coll, &min_st_offset, + &fd_start, &fd_end, &fd_size, fd->fs_ptr); + } + else { ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, nprocs, nprocs_for_coll, &min_st_offset, &fd_start, &fd_end, &fd_size, fd->fs_ptr); - else - ADIOI_Calc_file_domains(st_offsets, end_offsets, nprocs, + } + } + else { + if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) { + ADIOI_Calc_file_domains(st_offsets, end_offsets, currentNonZeroDataIndex, nprocs_for_coll, &min_st_offset, &fd_start, &fd_end, fd->hints->min_fdomain_size, &fd_size, fd->hints->striping_unit); + } + else { + ADIOI_Calc_file_domains(st_offsets, end_offsets, nprocs, + nprocs_for_coll, &min_st_offset, + &fd_start, &fd_end, + fd->hints->min_fdomain_size, &fd_size, + fd->hints->striping_unit); + } + } GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_MYREQ, GPFSMPIO_CIO_T_FD_PART ); + if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) { + /* If the user has specified to use a one-sided aggregation method then do that at + * this point instead of the two-phase I/O. + */ + ADIOI_OneSidedReadAggregation(fd, offset_list, len_list, contig_access_count, buf, + datatype,error_code, st_offsets, end_offsets, currentNonZeroDataIndex, fd_start, fd_end); + GPFSMPIO_T_CIO_REPORT( 0, fd, myrank, nprocs) + ADIOI_Free(offset_list); + ADIOI_Free(len_list); + ADIOI_Free(st_offsets); + ADIOI_Free(end_offsets); + ADIOI_Free(fd_start); + ADIOI_Free(fd_end); + ADIOI_Free(count_sizes); + goto fn_exit; + } if (gpfsmpio_p2pcontig==1) { /* For some simple yet common(?) workloads, full-on two-phase I/O is * overkill. We can establish sub-groups of processes and their @@ -304,7 +390,7 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count, } } - /* calculate where the portions of the access requests of this process + /* calculate where the portions of the access requests of this process * are located in terms of the file domains. this could be on the same * process or on other processes. this function fills in: * count_my_req_procs - number of processes (including this one) for which @@ -319,13 +405,13 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count, if (gpfsmpio_tuneblocking) ADIOI_GPFS_Calc_my_req(fd, offset_list, len_list, contig_access_count, min_st_offset, fd_start, fd_end, fd_size, - nprocs, &count_my_req_procs, + nprocs, &count_my_req_procs, &count_my_req_per_proc, &my_req, &buf_idx); else ADIOI_Calc_my_req(fd, offset_list, len_list, contig_access_count, min_st_offset, fd_start, fd_end, fd_size, - nprocs, &count_my_req_procs, + nprocs, &count_my_req_procs, &count_my_req_per_proc, &my_req, &buf_idx); @@ -345,15 +431,15 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count, &others_req); else - ADIOI_Calc_others_req(fd, count_my_req_procs, - count_my_req_per_proc, my_req, - nprocs, myrank, &count_others_req_procs, - &others_req); + ADIOI_Calc_others_req(fd, count_my_req_procs, + count_my_req_per_proc, my_req, + nprocs, myrank, &count_others_req_procs, + &others_req); GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_DEXCH, GPFSMPIO_CIO_T_OTHREQ ) - /* my_req[] and count_my_req_per_proc aren't needed at this point, so - * let's free the memory + /* my_req[] and count_my_req_per_proc aren't needed at this point, so + * let's free the memory */ ADIOI_Free(count_my_req_per_proc); for (i=0; icomm); + MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX, fd->comm); read_buf = fd->io_buf; - curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); + curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); /* its use is explained below. calloc initializes to 0. */ count = (int *) ADIOI_Malloc(nprocs * sizeof(int)); @@ -498,7 +584,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype in an iteration. */ partial_send = (int *) ADIOI_Calloc(nprocs, sizeof(int)); - /* if only a portion of the last off-len pair is sent to a process + /* if only a portion of the last off-len pair is sent to a process in a particular iteration, the length sent is stored here. calloc initializes to 0. */ @@ -514,14 +600,12 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype ADIOI_Fill_user_buffer. initialized to 0 here. */ start_pos = (int *) ADIOI_Malloc(nprocs*sizeof(int)); - /* used to store the starting value of curr_offlen_ptr[i] in + /* used to store the starting value of curr_offlen_ptr[i] in this iteration */ ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); if (!buftype_is_contig) { - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); } MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); @@ -540,9 +624,9 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype /* go through all others_req and check if any are satisfied by the current read */ - /* since MPI guarantees that displacements in filetypes are in + /* since MPI guarantees that displacements in filetypes are in monotonically nondecreasing order, I can maintain a pointer - (curr_offlen_ptr) to + (curr_offlen_ptr) to current off-len pair for each process in others_req and scan further only from there. There is still a problem of filetypes such as: (1, 2, 3 are not process nos. They are just numbers for @@ -552,7 +636,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype 2 -----!---- 3 --!----- - where ! indicates where the current read_size limitation cuts + where ! indicates where the current read_size limitation cuts through the filetype. I resolve this by reading up to !, but filling the communication buffer only for 1. I copy the portion left over for 2 into a tmp_buf for use in the next @@ -561,22 +645,22 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype other end, as only one off-len pair with incomplete data will be sent. I also don't need to send the individual offsets and lens along with the data, as the data is being - sent in a particular order. */ + sent in a particular order. */ - /* off = start offset in the file for the data actually read in - this iteration + /* off = start offset in the file for the data actually read in + this iteration size = size of data read corresponding to off real_off = off minus whatever data was retained in memory from previous iteration for cases like 2, 3 illustrated above real_size = size plus the extra corresponding to real_off - req_off = off in file for a particular contiguous request + req_off = off in file for a particular contiguous request minus what was satisfied in previous iteration req_size = size corresponding to req_off */ #ifdef PROFILE MPE_Log_event(13, 0, "start computation"); #endif - size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); + size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); real_off = off - for_curr_iter; real_size = size + for_curr_iter; @@ -585,7 +669,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype for (i=0; iio_buf); @@ -711,27 +795,27 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype #ifdef PROFILE MPE_Log_event(7, 0, "start communication"); #endif - for (m=ntimes; mcomm, requests+j); j++; buf_idx[i] += recv_size[i]; @@ -802,19 +886,19 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node else { /* allocate memory for recv_buf and post receives */ recv_buf = (char **) ADIOI_Malloc(nprocs * sizeof(char*)); - for (i=0; i < nprocs; i++) - if (recv_size[i]) recv_buf[i] = + for (i=0; i < nprocs; i++) + if (recv_size[i]) recv_buf[i] = (char *) ADIOI_Malloc(recv_size[i]); j = 0; - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (recv_size[i]) { - MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, + MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, myrank+i+100*iter, fd->comm, requests+j); j++; #ifdef RDCOLL_DEBUG - DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", - myrank, recv_size[i], myrank+i+100*iter); + DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", + myrank, recv_size[i], myrank+i+100*iter); #endif } } @@ -832,7 +916,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node } ADIOI_Type_create_hindexed_x(count[i], &(others_req[i].lens[start_pos[i]]), - &(others_req[i].mem_ptrs[start_pos[i]]), + &(others_req[i].mem_ptrs[start_pos[i]]), MPI_BYTE, &send_type); /* absolute displacement; use MPI_BOTTOM in send */ MPI_Type_commit(&send_type); @@ -845,7 +929,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node } statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+nprocs_recv+1) * \ - sizeof(MPI_Status)); + sizeof(MPI_Status)); /* +1 to avoid a 0-size malloc */ /* wait on the receives */ @@ -858,10 +942,10 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node #endif /* if noncontiguous, to the copies from the recv buffers */ - if (!buftype_is_contig) + if (!buftype_is_contig) ADIOI_Fill_user_buffer(fd, buf, flat_buf, recv_buf, - offset_list, len_list, (unsigned*)recv_size, - requests, statuses, recd_from_proc, + offset_list, len_list, (unsigned*)recv_size, + requests, statuses, recd_from_proc, nprocs, contig_access_count, min_st_offset, fd_size, fd_start, fd_end, buftype_extent); @@ -874,7 +958,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node ADIOI_Free(requests); if (!buftype_is_contig) { - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (recv_size[i]) ADIOI_Free(recv_buf[i]); ADIOI_Free(recv_buf); } @@ -908,7 +992,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node { \ while (size) { \ size_in_buf = ADIOI_MIN(size, flat_buf_sz); \ - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIR_Upint)(buf + user_buf_idx)); \ + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIU_Upint)(buf + user_buf_idx)); \ ADIOI_Assert(size_in_buf == (size_t)size_in_buf); \ memcpy(((char *) buf) + user_buf_idx, \ &(recv_buf[p][recv_buf_idx[p]]), size_in_buf); \ @@ -932,14 +1016,14 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node } static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **recv_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, - unsigned *recv_size, + *flat_buf, char **recv_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, + unsigned *recv_size, MPI_Request *requests, MPI_Status *statuses, int *recd_from_proc, int nprocs, - int contig_access_count, - ADIO_Offset min_st_offset, - ADIO_Offset fd_size, ADIO_Offset *fd_start, + int contig_access_count, + ADIO_Offset min_st_offset, + ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end, MPI_Aint buftype_extent) { @@ -958,9 +1042,9 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node /* curr_from_proc[p] = amount of data recd from proc. p that has already been accounted for so far - done_from_proc[p] = amount of data already recd from proc. p and + done_from_proc[p] = amount of data already recd from proc. p and filled into user buffer in previous iterations - user_buf_idx = current location in user buffer + user_buf_idx = current location in user buffer recv_buf_idx[p] = current location in recv_buf of proc. p */ curr_from_proc = (unsigned *) ADIOI_Malloc(nprocs * sizeof(unsigned)); done_from_proc = (unsigned *) ADIOI_Malloc(nprocs * sizeof(unsigned)); @@ -977,10 +1061,10 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node flat_buf_sz = flat_buf->blocklens[0]; /* flat_buf_idx = current index into flattened buftype - flat_buf_sz = size of current contiguous component in + flat_buf_sz = size of current contiguous component in flattened buf */ - for (i=0; i done_from_proc[p]) { if (done_from_proc[p] > curr_from_proc[p]) { - size = ADIOI_MIN(curr_from_proc[p] + len - + size = ADIOI_MIN(curr_from_proc[p] + len - done_from_proc[p], recv_size[p]-recv_buf_idx[p]); buf_incr = done_from_proc[p] - curr_from_proc[p]; ADIOI_BUF_INCR @@ -1034,7 +1118,7 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node rem_len -= len; } } - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (recv_size[i]) recd_from_proc[i] = curr_from_proc[i]; ADIOI_Free(curr_from_proc); @@ -1045,16 +1129,16 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node static void ADIOI_R_Exchange_data_alltoallv( ADIO_File fd, void *buf, ADIOI_Flatlist_node *flat_buf, ADIO_Offset *offset_list, ADIO_Offset - *len_list, int *send_size, int *recv_size, + *len_list, int *send_size, int *recv_size, int *count, int *start_pos, int *partial_send, int *recd_from_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, ADIOI_Access *others_req, int iter, MPI_Aint buftype_extent, int *buf_idx) -{ +{ int i, j, k=0, tmp=0, nprocs_recv, nprocs_send; char **recv_buf = NULL; MPI_Request *requests=NULL; @@ -1068,13 +1152,13 @@ static void ADIOI_R_Exchange_data_alltoallv( /* exchange send_size info so that each process knows how much to receive from whom and how much memory to allocate. */ MPI_Alltoall(send_size, 1, MPI_INT, recv_size, 1, MPI_INT, fd->comm); - + nprocs_recv = 0; for (i=0; icomm ); + fd->comm ); #if 0 DBG_FPRINTF(stderr, "\tall_recv_buf = " ); for (i=131072; i<131073; i++) { DBG_FPRINTF(stderr, "%2d,", all_recv_buf [i] ); } DBG_FPRINTF(stderr, "\n" ); #endif - + /* unpack at the receiver side */ - if (nprocs_recv) { + if (nprocs_recv) { if (!buftype_is_contig) ADIOI_Fill_user_buffer(fd, buf, flat_buf, recv_buf, offset_list, len_list, (unsigned*)recv_size, @@ -1161,11 +1245,11 @@ static void ADIOI_R_Exchange_data_alltoallv( } } } - + ADIOI_Free( all_send_buf ); ADIOI_Free( all_recv_buf ); ADIOI_Free( recv_buf ); ADIOI_Free( sdispls ); ADIOI_Free( rdispls ); - return; -} + return; +} diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_tuning.c b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_tuning.c similarity index 79% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_tuning.c rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_tuning.c index c99302143d..333612b0da 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_tuning.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_tuning.c @@ -37,9 +37,14 @@ long bglocklessmpio_f_type; int gpfsmpio_bg_nagg_pset; int gpfsmpio_pthreadio; int gpfsmpio_p2pcontig; +int gpfsmpio_write_aggmethod; +int gpfsmpio_read_aggmethod; int gpfsmpio_balancecontig; int gpfsmpio_devnullio; int gpfsmpio_bridgeringagg; +int gpfsmpio_onesided_no_rmw; +int gpfsmpio_onesided_always_rmw; +int gpfsmpio_onesided_inform_rmw; double gpfsmpio_prof_cw [GPFSMPIO_CIO_LAST+1]; double gpfsmpio_prof_cr [GPFSMPIO_CIO_LAST+1]; @@ -105,6 +110,40 @@ double gpfsmpio_prof_cr [GPFSMPIO_CIO_LAST+1]; * 3.) There are no gaps between the offsets. * 4.) No single rank has a data size which spans multiple file domains. * + * - GPFSMPIO_WRITE_AGGMETHOD/GPFSMPIO_READ_AGGMETHOD - Replaces the two-phase + * collective IO aggregation + * with a one-sided algorithm, significantly reducing communication and + * memory overhead. Fully + * supports all datasets and datatypes, the only caveat is that any holes in the data + * when writing to a pre-existing file are ignored -- there is no read-modify-write + * support to maintain the correctness of regions of pre-existing data so every byte + * must be explicitly written to maintain correctness. Users must beware of middle-ware + * libraries like PNETCDF which may count on read-modify-write functionality for certain + * features (like fill values). Possible values: + * - 0 - Normal two-phase collective IO is used. + * - 1 - A separate one-sided MPI_Put or MPI_Get is used for each contigous chunk of data + * for a compute to write to or read from the collective buffer on the aggregator. + * - 2 - An MPI derived datatype is created using all the contigous chunks and just one + * call to MPI_Put or MPI_Get is done with the derived datatype. On Blue Gene /Q + * optimal performance for this is achieved when paired with PAMID_TYPED_ONESIDED=1. + * - Default is 0 + * + * - GPFSMPIO_ONESIDED_NO_RMW - For one-sided aggregation (GPFSMPIO_WRITE_AGGMETHOD = 1 or 2) + * disable the detection of holes in the data when writing to a pre-existing + * file requiring a read-modify-write, thereby avoiding the communication + * overhead for this detection. + * - 0 (hole detection enabled) or 1 (hole detection disabled) + * - Default is 0 + * + * - GPFSMPIO_ONESIDED_INFORM_RMW - For one-sided aggregation + * (GPFSMPIO_AGGMETHOD = 1 or 2) generate an informational message informing + * the user whether holes exist in the data when writing to a pre-existing + * file requiring a read-modify-write, thereby educating the user to set + * GPFSMPIO_ONESIDED_NO_RMW=1 on a future run to avoid the communication + * overhead for this detection. + * - 0 (disabled) or 1 (enabled) + * - Default is 0 + * * - GPFSMPIO_BALANCECONTIG - Relevant only to BGQ. File domain blocks are assigned * to aggregators in a breadth-first fashion relative to the ions - additionally, * file domains on the aggregators sharing the same bridgeset and ion have contiguous @@ -165,6 +204,14 @@ void ad_gpfs_get_env_vars() { x = getenv( "GPFSMPIO_P2PCONTIG" ); if (x) gpfsmpio_p2pcontig = atoi(x); + gpfsmpio_write_aggmethod = 0; + x = getenv( "GPFSMPIO_WRITE_AGGMETHOD" ); + if (x) gpfsmpio_write_aggmethod = atoi(x); + + gpfsmpio_read_aggmethod = 0; + x = getenv( "GPFSMPIO_READ_AGGMETHOD" ); + if (x) gpfsmpio_read_aggmethod = atoi(x); + gpfsmpio_balancecontig = 0; x = getenv( "GPFSMPIO_BALANCECONTIG" ); if (x) gpfsmpio_balancecontig = atoi(x); @@ -176,6 +223,20 @@ void ad_gpfs_get_env_vars() { gpfsmpio_bridgeringagg = 0; x = getenv( "GPFSMPIO_BRIDGERINGAGG" ); if (x) gpfsmpio_bridgeringagg = atoi(x); + + gpfsmpio_onesided_no_rmw = 0; + x = getenv( "GPFSMPIO_ONESIDED_NO_RMW" ); + if (x) gpfsmpio_onesided_no_rmw = atoi(x); + + gpfsmpio_onesided_always_rmw = 0; + x = getenv( "GPFSMPIO_ONESIDED_ALWAYS_RMW" ); + if (x) gpfsmpio_onesided_always_rmw = atoi(x); + if (gpfsmpio_onesided_always_rmw) + gpfsmpio_onesided_no_rmw = 1; + + gpfsmpio_onesided_inform_rmw = 0; + x = getenv( "GPFSMPIO_ONESIDED_INFORM_RMW" ); + if (x) gpfsmpio_onesided_inform_rmw = atoi(x); } /* report timing breakdown for MPI I/O collective call */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_tuning.h b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_tuning.h similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_tuning.h rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_tuning.h index b82c6429e8..35fdc8d8c3 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_tuning.h +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_tuning.h @@ -23,6 +23,7 @@ * Global variables for the control of * 1. timing * 2. select specific optimizations + * 3. global flags for certain optimizations *-----------------------------------------*/ /* timing fields */ @@ -56,7 +57,6 @@ enum { extern double gpfsmpio_prof_cw [GPFSMPIO_CIO_LAST+1]; extern double gpfsmpio_prof_cr [GPFSMPIO_CIO_LAST+1]; - /* corresponds to environment variables to select optimizations and timing level */ extern int gpfsmpio_timing; extern int gpfsmpio_timing_cw_level; @@ -66,9 +66,14 @@ extern int gpfsmpio_tuneblocking; extern long bglocklessmpio_f_type; extern int gpfsmpio_pthreadio; extern int gpfsmpio_p2pcontig; +extern int gpfsmpio_write_aggmethod; +extern int gpfsmpio_read_aggmethod; extern int gpfsmpio_balancecontig; extern int gpfsmpio_devnullio; extern int gpfsmpio_bridgeringagg; +extern int gpfsmpio_onesided_no_rmw; +extern int gpfsmpio_onesided_always_rmw; +extern int gpfsmpio_onesided_inform_rmw; /* Default is, well, kind of complicated. Blue Gene /L and /P had "psets": one * i/o node and all compute nodes wired to it. On Blue Gene /Q that diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c similarity index 84% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c index 6e70624c70..301f78dc93 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_wrcoll.c @@ -7,8 +7,8 @@ */ /* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,7 +18,7 @@ #include "ad_gpfs_aggrs.h" #ifdef BGQPLATFORM -#include +#include "bg/ad_bg_pset.h" #endif #ifdef AGGREGATION_PROFILE @@ -47,32 +47,32 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype ADIO_Offset *fd_start, ADIO_Offset *fd_end, int *buf_idx, int *error_code); static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf, - ADIOI_Flatlist_node *flat_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, + ADIOI_Flatlist_node *flat_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, int *recv_size, ADIO_Offset off, int size, - int *count, int *start_pos, int *partial_recv, - int *sent_to_proc, int nprocs, + int *count, int *start_pos, int *partial_recv, + int *sent_to_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - ADIOI_Access *others_req, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + ADIOI_Access *others_req, int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int *hole, int iter, + int *done_to_proc, int *hole, int iter, MPI_Aint buftype_extent, int *buf_idx, int *error_code); static void ADIOI_W_Exchange_data_alltoallv( - ADIO_File fd, const void *buf, + ADIO_File fd, const void *buf, char *write_buf, /* 1 */ - ADIOI_Flatlist_node *flat_buf, - ADIO_Offset *offset_list, - ADIO_Offset *len_list, int *send_size, int *recv_size, + ADIOI_Flatlist_node *flat_buf, + ADIO_Offset *offset_list, + ADIO_Offset *len_list, int *send_size, int *recv_size, ADIO_Offset off, int size, /* 2 */ int *count, int *start_pos, int *partial_recv, - int *sent_to_proc, int nprocs, int myrank, + int *sent_to_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, ADIOI_Access *others_req, int *send_buf_idx, int *curr_to_proc, /* 3 */ @@ -80,28 +80,28 @@ static void ADIOI_W_Exchange_data_alltoallv( int iter, MPI_Aint buftype_extent, int *buf_idx, int *error_code); static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int iter, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, + int *done_to_proc, int iter, MPI_Aint buftype_extent); static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int iter, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, + int *done_to_proc, int iter, MPI_Aint buftype_extent); -static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, +static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, ADIO_Offset *srt_off, int *srt_len, int *start_pos, int nprocs, int nprocs_recv, int total_elements); @@ -112,15 +112,15 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, *error_code) { /* Uses a generalized version of the extended two-phase method described - in "An Extended Two-Phase Method for Accessing Sections of + in "An Extended Two-Phase Method for Accessing Sections of Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, - Scientific Programming, (5)4:301--317, Winter 1996. + Scientific Programming, (5)4:301--317, Winter 1996. http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ - ADIOI_Access *my_req; + ADIOI_Access *my_req; /* array of nprocs access structures, one for each other process in whose file domain this process's request lies */ - + ADIOI_Access *others_req; /* array of nprocs access structures, one for each other process whose request lies in this process's file domain. */ @@ -132,6 +132,7 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, ADIO_Offset *offset_list = NULL, *st_offsets = NULL, *fd_start = NULL, *fd_end = NULL, *end_offsets = NULL; ADIO_Offset *gpfs_offsets0 = NULL, *gpfs_offsets = NULL; + ADIO_Offset *count_sizes; int ii; int *buf_idx = NULL; @@ -164,18 +165,48 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, &offset_list, &len_list, &start_offset, - &end_offset, &contig_access_count); + &end_offset, &contig_access_count); GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_GATHER, GPFSMPIO_CIO_T_LCOMP ) - /* each process communicates its start and end offsets to other + /* each process communicates its start and end offsets to other processes. The result is an array each of start and end offsets stored - in order of process rank. */ + in order of process rank. */ st_offsets = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); end_offsets = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); + ADIO_Offset my_count_size=0; + /* One-sided aggregation needs the amount of data per rank as well because + * the difference in starting and ending offsets for 1 byte is 0 the same + * as 0 bytes so it cannot be distiguished. + */ + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + count_sizes = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); + MPI_Count buftype_size; + MPI_Type_size_x(datatype, &buftype_size); + my_count_size = (ADIO_Offset) count * (ADIO_Offset)buftype_size; + } if (gpfsmpio_tunegather) { + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + gpfs_offsets0 = (ADIO_Offset *) ADIOI_Malloc(3*nprocs*sizeof(ADIO_Offset)); + gpfs_offsets = (ADIO_Offset *) ADIOI_Malloc(3*nprocs*sizeof(ADIO_Offset)); + for (ii=0; iicomm ); + for (ii=0; iicomm); MPI_Allgather(&end_offset, 1, ADIO_OFFSET, end_offsets, 1, ADIO_OFFSET, fd->comm); + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + MPI_Allgather(&count_sizes, 1, ADIO_OFFSET, count_sizes, 1, + ADIO_OFFSET, fd->comm); + } } GPFSMPIO_T_CIO_SET_GET(w, 1, 1, GPFSMPIO_CIO_T_PATANA, GPFSMPIO_CIO_T_GATHER ) @@ -250,25 +286,109 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, done by (logically) dividing the file into file domains (FDs); each process may directly access only its own file domain. */ - if (gpfsmpio_tuneblocking) + int currentValidDataIndex = 0; + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + /* Take out the 0-data offsets by shifting the indexes with data to the front + * and keeping track of the valid data index for use as the length. + */ + for (i=0; i 0) { + st_offsets[currentValidDataIndex] = st_offsets[i]; + end_offsets[currentValidDataIndex] = end_offsets[i]; + currentValidDataIndex++; + } + } + } + + if (gpfsmpio_tuneblocking) { + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, + currentValidDataIndex, + nprocs_for_coll, &min_st_offset, + &fd_start, &fd_end, &fd_size, fd->fs_ptr); + } + else { + ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, nprocs, nprocs_for_coll, &min_st_offset, - &fd_start, &fd_end, &fd_size, fd->fs_ptr); - else + &fd_start, &fd_end, &fd_size, fd->fs_ptr); + } + } + else { + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + ADIOI_Calc_file_domains(st_offsets, end_offsets, currentValidDataIndex, + nprocs_for_coll, &min_st_offset, + &fd_start, &fd_end, + fd->hints->min_fdomain_size, &fd_size, + fd->hints->striping_unit); + } + else { ADIOI_Calc_file_domains(st_offsets, end_offsets, nprocs, nprocs_for_coll, &min_st_offset, &fd_start, &fd_end, fd->hints->min_fdomain_size, &fd_size, - fd->hints->striping_unit); + fd->hints->striping_unit); + } + } GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_MYREQ, GPFSMPIO_CIO_T_FD_PART ); + if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) { + /* If the user has specified to use a one-sided aggregation method then do that at + * this point instead of the two-phase I/O. + */ + int holeFound = 0; + ADIOI_OneSidedWriteAggregation(fd, offset_list, len_list, contig_access_count, + buf, datatype, error_code, st_offsets, end_offsets, + currentValidDataIndex, fd_start, fd_end, &holeFound); + int anyHolesFound = 0; + if (!gpfsmpio_onesided_no_rmw) + MPI_Allreduce(&holeFound, &anyHolesFound, 1, MPI_INT, MPI_MAX, fd->comm); + if (anyHolesFound == 0) { + GPFSMPIO_T_CIO_REPORT( 1, fd, myrank, nprocs) + ADIOI_Free(offset_list); + ADIOI_Free(len_list); + ADIOI_Free(st_offsets); + ADIOI_Free(end_offsets); + ADIOI_Free(fd_start); + ADIOI_Free(fd_end); + ADIOI_Free(count_sizes); + goto fn_exit; + } + else { + /* Holes are found in the data and the user has not set + * gpfsmpio_onesided_no_rmw --- set gpfsmpio_onesided_always_rmw to 1 + * and re-call ADIOI_OneSidedWriteAggregation and if the user has + * gpfsmpio_onesided_inform_rmw set then inform him of this condition + * and behavior. + */ + + if (gpfsmpio_onesided_inform_rmw && (myrank ==0)) + FPRINTF(stderr,"Information: Holes found during one-sided " + "write aggregation algorithm --- re-running one-sided " + "write aggregation with GPFSMPIO_ONESIDED_ALWAYS_RMW set to 1.\n"); + gpfsmpio_onesided_always_rmw = 1; + int prev_gpfsmpio_onesided_no_rmw = gpfsmpio_onesided_no_rmw; + gpfsmpio_onesided_no_rmw = 1; + ADIOI_OneSidedWriteAggregation(fd, offset_list, len_list, contig_access_count, buf, datatype, error_code, st_offsets, end_offsets, currentValidDataIndex, fd_start, fd_end, &holeFound); + gpfsmpio_onesided_no_rmw = prev_gpfsmpio_onesided_no_rmw; + GPFSMPIO_T_CIO_REPORT( 1, fd, myrank, nprocs) + ADIOI_Free(offset_list); + ADIOI_Free(len_list); + ADIOI_Free(st_offsets); + ADIOI_Free(end_offsets); + ADIOI_Free(fd_start); + ADIOI_Free(fd_end); + ADIOI_Free(count_sizes); + goto fn_exit; + } + } if (gpfsmpio_p2pcontig==1) { /* For some simple yet common(?) workloads, full-on two-phase I/O is overkill. We can establish sub-groups of processes and their aggregator, and then these sub-groups will carry out a simplified two-phase over that sub-group. * * First verify that the filetype is contig and the offsets are * increasing in rank order*/ - int i, inOrderAndNoGaps = 1; + int inOrderAndNoGaps = 1; for (i=0;i<(nprocs-1);i++) { if (end_offsets[i] != (st_offsets[i+1]-1)) inOrderAndNoGaps = 0; @@ -298,13 +418,13 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, if (gpfsmpio_tuneblocking) ADIOI_GPFS_Calc_my_req(fd, offset_list, len_list, contig_access_count, min_st_offset, fd_start, fd_end, fd_size, - nprocs, &count_my_req_procs, + nprocs, &count_my_req_procs, &count_my_req_per_proc, &my_req, - &buf_idx); + &buf_idx); else ADIOI_Calc_my_req(fd, offset_list, len_list, contig_access_count, min_st_offset, fd_start, fd_end, fd_size, - nprocs, &count_my_req_procs, + nprocs, &count_my_req_procs, &count_my_req_per_proc, &my_req, &buf_idx); @@ -313,7 +433,7 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, /* based on everyone's my_req, calculate what requests of other processes lie in this process's file domain. count_others_req_procs = number of processes whose requests lie in - this process's file domain (including this process itself) + this process's file domain (including this process itself) count_others_req_per_proc[i] indicates how many separate contiguous requests of proc. i lie in this process's file domain. */ @@ -323,8 +443,8 @@ void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, nprocs, myrank, &count_others_req_procs, &others_req); else - ADIOI_Calc_others_req(fd, count_my_req_procs, - count_my_req_per_proc, my_req, + ADIOI_Calc_others_req(fd, count_my_req_procs, + count_my_req_per_proc, my_req, nprocs, myrank, &count_others_req_procs, &others_req); @@ -379,7 +499,7 @@ fn_exit: bufsize = size * count; MPIR_Status_set_bytes(status, datatype, bufsize); } -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written during collective I/O. */ #endif @@ -445,7 +565,7 @@ static int gpfs_find_access_for_ion(ADIO_File fd, ADIO_Offset *fd_start, ADIO_Offset *fd_end, ADIO_Offset *start, ADIO_Offset *end) { - int my_ionode = MPIX_IO_node_id(); + int my_ionode = BGQ_IO_node_id(); int *rank_to_ionode; int i, nprocs, rank; ADIO_Offset group_start=LLONG_MAX, group_end=0; @@ -489,7 +609,7 @@ static int gpfs_find_access_for_ion(ADIO_File fd, * code is created and returned in error_code. */ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype - datatype, int nprocs, + datatype, int nprocs, int myrank, ADIOI_Access *others_req, ADIO_Offset *offset_list, @@ -499,7 +619,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype int *buf_idx, int *error_code) { /* Send data to appropriate processes and write in sizes of no more - than coll_bufsize. + than coll_bufsize. The idea is to reduce the amount of extra memory required for collective I/O. If all data were written all at once, which is much easier, it would require temp space more than the size of user_buf, @@ -533,7 +653,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype That gives the no. of communication phases as well. */ value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value, + ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value, &info_flag); coll_bufsize = atoi(value); ADIOI_Free(value); @@ -589,14 +709,14 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype #endif MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX, - fd->comm); + fd->comm); write_buf = fd->io_buf; if (gpfsmpio_pthreadio == 1) { write_buf2 = fd->io_buf + coll_bufsize; } - curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); + curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); /* its use is explained below. calloc initializes to 0. */ count = (int *) ADIOI_Malloc(nprocs*sizeof(int)); @@ -625,14 +745,12 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype /* Above three are used in ADIOI_Fill_send_buffer*/ start_pos = (int *) ADIOI_Malloc(nprocs*sizeof(int)); - /* used to store the starting value of curr_offlen_ptr[i] in + /* used to store the starting value of curr_offlen_ptr[i] in this iteration */ ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); if (!buftype_is_contig) { - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); } MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); @@ -662,15 +780,15 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype /* go through all others_req and check which will be satisfied by the current write */ - /* Note that MPI guarantees that displacements in filetypes are in + /* Note that MPI guarantees that displacements in filetypes are in monotonically nondecreasing order and that, for writes, the filetypes cannot specify overlapping regions in the file. This simplifies implementation a bit compared to reads. */ - /* off = start offset in the file for the data to be written in - this iteration + /* off = start offset in the file for the data to be written in + this iteration size = size of data written (bytes) corresponding to off - req_off = off in file for a particular contiguous request + req_off = off in file for a particular contiguous request minus what was satisfied in previous iteration req_size = size corresponding to req_off */ @@ -681,7 +799,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype #endif for (i=0; i < nprocs; i++) count[i] = recv_size[i] = 0; - size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); + size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); for (i=0; i < nprocs; i++) { if (others_req[i].count) { @@ -691,7 +809,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype /* this request may have been partially satisfied in the previous iteration. */ req_off = others_req[i].offsets[j] + - partial_recv[i]; + partial_recv[i]; req_len = others_req[i].lens[j] - partial_recv[i]; partial_recv[i] = 0; @@ -705,11 +823,11 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype } if (req_off < off + size) { count[i]++; - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIR_Upint)(write_buf+req_off-off)); - MPI_Get_address(write_buf+req_off-off, - &(others_req[i].mem_ptrs[j])); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIU_Upint)(write_buf+req_off-off)); + MPI_Get_address(write_buf+req_off-off, + &(others_req[i].mem_ptrs[j])); ADIOI_Assert((off + size - req_off) == (int)(off + size - req_off)); - recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, + recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, (unsigned)req_len)); if (off+size-req_off < (unsigned)req_len) @@ -717,9 +835,9 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype partial_recv[i] = (int) (off + size - req_off); /* --BEGIN ERROR HANDLING-- */ - if ((j+1 < others_req[i].count) && + if ((j+1 < others_req[i].count) && (others_req[i].offsets[j+1] < off+size)) - { + { *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, @@ -739,7 +857,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype curr_offlen_ptr[i] = j; } } - + #ifdef PROFILE MPE_Log_event(14, 0, "end computation"); MPE_Log_event(7, 0, "start communication"); @@ -753,7 +871,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype min_st_offset, fd_size, fd_start, fd_end, others_req, send_buf_idx, curr_to_proc, done_to_proc, &hole, m, buftype_extent, buf_idx, - error_code); + error_code); else if (gpfsmpio_comm == 0) ADIOI_W_Exchange_data_alltoallv(fd, buf, write_buf, flat_buf, offset_list, @@ -764,7 +882,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype min_st_offset, fd_size, fd_start, fd_end, others_req, send_buf_idx, curr_to_proc, done_to_proc, &hole, m, buftype_extent, buf_idx, - error_code); + error_code); if (*error_code != MPI_SUCCESS) return; #ifdef PROFILE MPE_Log_event(8, 0, "end communication"); @@ -800,7 +918,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype io_thread_args.io_kind = ADIOI_WRITE; io_thread_args.size = size; io_thread_args.offset = off; - io_thread_args.status = status; + io_thread_args.status = &status; io_thread_args.error_code = *error_code; if ( (pthread_create(&io_thread, NULL, ADIOI_IO_Thread_Func, &(io_thread_args))) != 0) @@ -826,7 +944,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype #ifdef PROFILE MPE_Log_event(7, 0, "start communication"); #endif - for (m=ntimes; matomicity) { /* bug fix from Wei-keng Liao and Kenin Coloma */ requests = (MPI_Request *) - ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request)); + ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request)); send_req = requests; } else { - requests = (MPI_Request *) - ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); + requests = (MPI_Request *) + ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); /* +1 to avoid a 0-size malloc */ /* post receives */ @@ -1041,10 +1159,10 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf #endif if (buftype_is_contig) { j = 0; - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) { - MPI_Isend(((char *) buf) + buf_idx[i], send_size[i], - MPI_BYTE, i, myrank+i+100*iter, fd->comm, + MPI_Isend(((char *) buf) + buf_idx[i], send_size[i], + MPI_BYTE, i, myrank+i+100*iter, fd->comm, send_req+j); j++; buf_idx[i] += send_size[i]; @@ -1053,16 +1171,16 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf else if (nprocs_send) { /* buftype is not contig */ send_buf = (char **) ADIOI_Malloc(nprocs*sizeof(char*)); - for (i=0; i < nprocs; i++) - if (send_size[i]) + for (i=0; i < nprocs; i++) + if (send_size[i]) send_buf[i] = (char *) ADIOI_Malloc(send_size[i]); ADIOI_Fill_send_buffer(fd, buf, flat_buf, send_buf, - offset_list, len_list, send_size, + offset_list, len_list, send_size, send_req, - sent_to_proc, nprocs, myrank, + sent_to_proc, nprocs, myrank, contig_access_count, - min_st_offset, fd_size, fd_start, fd_end, + min_st_offset, fd_size, fd_start, fd_end, send_buf_idx, curr_to_proc, done_to_proc, iter, buftype_extent); /* the send is done in ADIOI_Fill_send_buffer */ @@ -1083,16 +1201,16 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf for (i=0; iatomicity) { /* bug fix from Wei-keng Liao and Kenin Coloma */ statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+1) * \ - sizeof(MPI_Status)); + sizeof(MPI_Status)); /* +1 to avoid a 0-size malloc */ } else { statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+nprocs_recv+1) * \ - sizeof(MPI_Status)); + sizeof(MPI_Status)); /* +1 to avoid a 0-size malloc */ } @@ -1119,7 +1237,7 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf ADIOI_Free(statuses); ADIOI_Free(requests); if (!buftype_is_contig && nprocs_send) { - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) ADIOI_Free(send_buf[i]); ADIOI_Free(send_buf); } @@ -1151,7 +1269,7 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf { \ while (size) { \ size_in_buf = ADIOI_MIN(size, flat_buf_sz); \ - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + user_buf_idx)); \ + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + user_buf_idx)); \ ADIOI_Assert(size_in_buf == (size_t)size_in_buf); \ memcpy(&(send_buf[p][send_buf_idx[p]]), \ ((char *) buf) + user_buf_idx, size_in_buf); \ @@ -1175,14 +1293,14 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf } static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, - int contig_access_count, + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, + int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, int *done_to_proc, int iter, MPI_Aint buftype_extent) { @@ -1195,9 +1313,9 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist /* curr_to_proc[p] = amount of data sent to proc. p that has already been accounted for so far - done_to_proc[p] = amount of data already sent to proc. p in + done_to_proc[p] = amount of data already sent to proc. p in previous iterations - user_buf_idx = current location in user buffer + user_buf_idx = current location in user buffer send_buf_idx[p] = current location in send_buf of proc. p */ for (i=0; i < nprocs; i++) { @@ -1212,10 +1330,10 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist flat_buf_sz = flat_buf->blocklens[0]; /* flat_buf_idx = current index into flattened buftype - flat_buf_sz = size of current contiguous component in + flat_buf_sz = size of current contiguous component in flattened buf */ - for (i=0; i done_to_proc[p]) { if (done_to_proc[p] > curr_to_proc[p]) { - size = ADIOI_MIN(curr_to_proc[p] + len - + size = ADIOI_MIN(curr_to_proc[p] + len - done_to_proc[p], send_size[p]-send_buf_idx[p]); buf_incr = done_to_proc[p] - curr_to_proc[p]; ADIOI_BUF_INCR @@ -1255,7 +1373,7 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist ADIOI_BUF_COPY } if (send_buf_idx[p] == send_size[p]) { - MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p, + MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p, myrank+p+100*iter, fd->comm, requests+jj); jj++; } @@ -1275,13 +1393,13 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist rem_len -= len; } } - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) sent_to_proc[i] = curr_to_proc[i]; } -static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, +static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, ADIO_Offset *srt_off, int *srt_len, int *start_pos, int nprocs, int nprocs_recv, int total_elements) { @@ -1311,7 +1429,7 @@ static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, heapsize = nprocs_recv; for (i=heapsize/2 - 1; i>=0; i--) { /* Heapify(a, i, heapsize); Algorithm from Cormen et al. pg. 143 - modified for a heap with smallest element at root. I have + modified for a heap with smallest element at root. I have removed the recursion so that there are no function calls. Function calls are too expensive. */ k = i; @@ -1319,12 +1437,12 @@ static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, l = 2*(k+1) - 1; r = 2*(k+1); - if ((l < heapsize) && + if ((l < heapsize) && (*(a[l].off_list) < *(a[k].off_list))) smallest = l; else smallest = k; - if ((r < heapsize) && + if ((r < heapsize) && (*(a[r].off_list) < *(a[smallest].off_list))) smallest = r; @@ -1336,11 +1454,11 @@ static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, a[k].off_list = a[smallest].off_list; a[k].len_list = a[smallest].len_list; a[k].nelem = a[smallest].nelem; - + a[smallest].off_list = tmp.off_list; a[smallest].len_list = tmp.len_list; a[smallest].nelem = tmp.nelem; - + k = smallest; } else break; @@ -1370,12 +1488,12 @@ static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, l = 2*(k+1) - 1; r = 2*(k+1); - if ((l < heapsize) && + if ((l < heapsize) && (*(a[l].off_list) < *(a[k].off_list))) smallest = l; else smallest = k; - if ((r < heapsize) && + if ((r < heapsize) && (*(a[r].off_list) < *(a[smallest].off_list))) smallest = r; @@ -1387,11 +1505,11 @@ static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, a[k].off_list = a[smallest].off_list; a[k].len_list = a[smallest].len_list; a[k].nelem = a[smallest].nelem; - + a[smallest].off_list = tmp.off_list; a[smallest].len_list = tmp.len_list; a[smallest].nelem = tmp.nelem; - + k = smallest; } else break; @@ -1403,25 +1521,25 @@ static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, static void ADIOI_W_Exchange_data_alltoallv( - ADIO_File fd, const void *buf, + ADIO_File fd, const void *buf, char *write_buf, /* 1 */ - ADIOI_Flatlist_node *flat_buf, - ADIO_Offset *offset_list, - ADIO_Offset *len_list, int *send_size, int *recv_size, + ADIOI_Flatlist_node *flat_buf, + ADIO_Offset *offset_list, + ADIO_Offset *len_list, int *send_size, int *recv_size, ADIO_Offset off, int size, /* 2 */ int *count, int *start_pos, int *partial_recv, - int *sent_to_proc, int nprocs, int myrank, + int *sent_to_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, ADIOI_Access *others_req, int *send_buf_idx, int *curr_to_proc, /* 3 */ int *done_to_proc, int *hole, /* 4 */ int iter, MPI_Aint buftype_extent, int *buf_idx, int *error_code) -{ +{ int i, j, k=0, nprocs_recv, nprocs_send, *tmp_len, err; char **send_buf = NULL; MPI_Request *send_req=NULL; @@ -1443,12 +1561,12 @@ static void ADIOI_W_Exchange_data_alltoallv( gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_RECV_EXCH] += MPI_Wtime() - io_time; io_time = MPI_Wtime(); - + nprocs_recv = 0; for (i=0; icomm ); + fd->comm ); ADIOI_Free( all_send_buf ); ADIOI_Free(sdispls); @@ -1503,7 +1621,7 @@ static void ADIOI_W_Exchange_data_alltoallv( gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_NET] += MPI_Wtime() - io_time; io_time = MPI_Wtime(); /* data sieving pre-read */ - /* To avoid a read-modify-write, check if there are holes in the + /* To avoid a read-modify-write, check if there are holes in the data to be written. For this, merge the (sorted) offset lists others_req using a heap-merge. */ @@ -1518,7 +1636,7 @@ static void ADIOI_W_Exchange_data_alltoallv( /* check if there are any holes */ *hole = 0; /* See if there are holes before the first request or after the last request*/ - if((srt_off[0] > off) || + if((srt_off[0] > off) || ((srt_off[sum-1] + srt_len[sum-1]) < (off + size))) { *hole = 1; @@ -1577,25 +1695,25 @@ static void ADIOI_W_Exchange_data_alltoallv( k = start_pos[i] + count[i] - 1; others_req[i].lens[k] = tmp_len[i]; } - + } } - + ADIOI_Free( tmp_len ); ADIOI_Free( all_recv_buf ); ADIOI_Free(rdispls); - return; -} + return; +} static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, - int contig_access_count, + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, + int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, int *done_to_proc, int iter, MPI_Aint buftype_extent) { @@ -1608,9 +1726,9 @@ static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_F /* curr_to_proc[p] = amount of data sent to proc. p that has already been accounted for so far - done_to_proc[p] = amount of data already sent to proc. p in + done_to_proc[p] = amount of data already sent to proc. p in previous iterations - user_buf_idx = current location in user buffer + user_buf_idx = current location in user buffer send_buf_idx[p] = current location in send_buf of proc. p */ for (i=0; i < nprocs; i++) { @@ -1625,10 +1743,10 @@ static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_F flat_buf_sz = flat_buf->blocklens[0]; /* flat_buf_idx = current index into flattened buftype - flat_buf_sz = size of current contiguous component in + flat_buf_sz = size of current contiguous component in flattened buf */ - for (i=0; i done_to_proc[p]) { if (done_to_proc[p] > curr_to_proc[p]) { - size = ADIOI_MIN(curr_to_proc[p] + len - + size = ADIOI_MIN(curr_to_proc[p] + len - done_to_proc[p], send_size[p]-send_buf_idx[p]); buf_incr = done_to_proc[p] - curr_to_proc[p]; ADIOI_BUF_INCR @@ -1670,7 +1788,7 @@ static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_F /* moved to alltoallv */ /* if (send_buf_idx[p] == send_size[p]) { - MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p, + MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p, myrank+p+100*iter, fd->comm, requests+jj); jj++; } @@ -1691,6 +1809,6 @@ static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_F rem_len -= len; } } - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) sent_to_proc[i] = curr_to_proc[i]; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/Makefile.mk similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/Makefile.mk index baec508e54..1d957ef8f6 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/Makefile.mk +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/Makefile.mk @@ -13,6 +13,6 @@ noinst_HEADERS += \ romio_other_sources += \ adio/ad_gpfs/bg/ad_bg_aggrs.c \ - adio/ad_gpfs/bg/ad_bg_pset.c + adio/ad_gpfs/bg/ad_bg_pset.c endif BUILD_AD_BG diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c b/ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c index 90c97a20a9..f81e460fe9 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/ad_bg_aggrs.c @@ -7,8 +7,8 @@ */ /* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * Copyright (C) 1997-2001 University of Chicago. +/* + * Copyright (C) 1997-2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -46,14 +46,14 @@ * * The last three of these were originally in ad_read_coll.c, but they are * also shared with ad_write_coll.c. I felt that they were better kept with - * the rest of the shared aggregation code. + * the rest of the shared aggregation code. */ /* Discussion of values available from above: * * ADIO_Offset st_offsets[0..nprocs-1] * ADIO_Offset end_offsets[0..nprocs-1] - * These contain a list of start and end offsets for each process in + * These contain a list of start and end offsets for each process in * the communicator. For example, an access at loc 10, size 10 would * have a start offset of 10 and end offset of 19. * int nprocs @@ -63,26 +63,26 @@ * starting location of "file domain"; region that a given process will * perform aggregation for (i.e. actually do I/O) * ADIO_Offset fd_end[0..nprocs_for_coll-1] - * start + size - 1 roughly, but it can be less, or 0, in the case of + * start + size - 1 roughly, but it can be less, or 0, in the case of * uneven distributions */ /* forward declaration */ -static void -ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd, - const ADIOI_BG_ConfInfo_t *confInfo, +static void +ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd, + const ADIOI_BG_ConfInfo_t *confInfo, ADIOI_BG_ProcInfo_t *all_procInfo); /* * Compute the aggregator-related parameters that are required in 2-phase collective IO of ADIO. - * The parameters are + * The parameters are * . the number of aggregators (proxies) : fd->hints->cb_nodes * . the ranks of the aggregators : fd->hints->ranklist - * By compute these two parameters in a BG-PSET-aware way, the default 2-phase collective IO of + * By compute these two parameters in a BG-PSET-aware way, the default 2-phase collective IO of * ADIO can work more efficiently. */ -int -ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset) +int +ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset) { int r, s; ADIOI_BG_ProcInfo_t *procInfo, *all_procInfo; @@ -101,13 +101,13 @@ ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset) /* if (r == 0) */ all_procInfo = ADIOI_BG_ProcInfo_new_n (s); - MPI_Gather( (void *)procInfo, sizeof(ADIOI_BG_ProcInfo_t), MPI_BYTE, - (void *)all_procInfo, sizeof(ADIOI_BG_ProcInfo_t), MPI_BYTE, - 0, + MPI_Gather( (void *)procInfo, sizeof(ADIOI_BG_ProcInfo_t), MPI_BYTE, + (void *)all_procInfo, sizeof(ADIOI_BG_ProcInfo_t), MPI_BYTE, + 0, fd->comm ); /* Compute a list of the ranks of chosen IO proxy CN on process 0 */ - if (r == 0) { + if (r == 0) { ADIOI_BG_compute_agg_ranklist_serial (fd, confInfo, all_procInfo); /* ADIOI_BG_ProcInfo_free (all_procInfo);*/ } @@ -156,7 +156,7 @@ ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset) /* Maybe find which bridge node is closer (manhattan distance) and try to * distribute evenly. */ -/* +/* * Pick IO aggregators based on the under PSET organization and stores the ranks of the proxy CNs in tmp_ranklist. * The first order of tmp_ranklist is : PSET number * The secondary order of the list is determined in ADIOI_BG_select_agg_in_pset() and thus adjustable. @@ -181,9 +181,9 @@ static int intsort(const void *p1, const void *p2) return(i1->bridge - i2->bridge); } -static int -ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, - ADIOI_BG_ProcInfo_t *all_procInfo, +static int +ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, + ADIOI_BG_ProcInfo_t *all_procInfo, int *tmp_ranklist) { TRACE_ERR("Entering ADIOI_BG_compute_agg_ranklist_serial_do\n"); @@ -281,6 +281,14 @@ ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, } } currentNumHops++; + /* Handle the case where the numAggs is more than exists starting + * at gpfsmpio_bridgeringagg hops, wrap back and restart at 0 to + * assign the overrun - it is up to the user to realize this + * situation and adjust numAggs and gpfsmpio_bridgeringagg + * accordingly. + */ + if (currentNumHops > 16) + currentNumHops = 0; /* If 3 rounds go by without selecting an agg abort to avoid infinite loop. */ @@ -313,7 +321,7 @@ ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, bridgelist[i].rank = i; TRACE_ERR("bridgelist[%d].bridge: %d .rank: %d\n", i, bridgelist[i].bridge, i); } - + /* This list contains rank->bridge info. Now, we need to sort this list. */ qsort(bridgelist, confInfo->nProcs, sizeof(sortstruct), intsort); @@ -324,7 +332,7 @@ ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, if(numAggs == 1) aggTotal = 1; else - /* the number of aggregators is (numAggs per bridgenode) plus each + /* the number of aggregators is (numAggs per bridgenode) plus each * bridge node is an aggregator */ aggTotal = confInfo->numBridgeRanks * (numAggs+1); @@ -350,7 +358,7 @@ ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, if(lastBridge == bridgelist[procIndex].bridge) { psetSize++; - if(procIndex) continue; + if(procIndex) continue; else procIndex--;/* procIndex == 0 */ } /* Sets up a list of nodes which will act as aggregators. numAggs @@ -377,7 +385,7 @@ ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, aggList[nextAggr] = bridgelist[procIndex+j*distance+1].rank; TRACE_ERR("agglist[%d] -> bridgelist[%d] = %d\n", nextAggr, procIndex+j*distance+1,aggList[nextAggr]); if(aggList[nextAggr]==lastBridge) /* can't have bridge in the list twice */ - { + { aggList[nextAggr] = bridgelist[procIndex+psetSize].rank; /* take the last one in the pset */ TRACE_ERR("replacement agglist[%d] -> bridgelist[%d] = %d\n", nextAggr, procIndex+psetSize,aggList[nextAggr]); } @@ -409,17 +417,17 @@ ADIOI_BG_compute_agg_ranklist_serial_do (const ADIOI_BG_ConfInfo_t *confInfo, } -/* +/* * compute aggregators ranklist and put it into fd->hints struct - */ -static void -ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd, - const ADIOI_BG_ConfInfo_t *confInfo, + */ +static void +ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd, + const ADIOI_BG_ConfInfo_t *confInfo, ADIOI_BG_ProcInfo_t *all_procInfo) { TRACE_ERR("Entering ADIOI_BG_compute_agg_ranklist_serial\n"); - int i; - int naggs; + int i; + int naggs; int size; int *tmp_ranklist; @@ -428,23 +436,22 @@ ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd, # if AGG_DEBUG for (i=0; inProcs; i++) { - DBG_FPRINTF(stderr, "\tcpuid %1d, rank = %6d\n", all_procInfo[i].coreID, all_procInfo[i].rank ); + DBG_FPRINTF(stderr, "\trank = %6d\n", all_procInfo[i].rank ); } # endif - naggs= + naggs= ADIOI_BG_compute_agg_ranklist_serial_do (confInfo, all_procInfo, tmp_ranklist); # define VERIFY 1 # if VERIFY - DBG_FPRINTF(stderr, "\tconfInfo = min: %3d, max: %3d, naggrs: %3d, bridge: %3d, nprocs: %3d, vpset: %3d, tsize: %3d, ratio: %.4f; naggs = %d\n", + DBG_FPRINTF(stderr, "\tconfInfo = min: %3d, max: %3d, naggrs: %3d, bridge: %3d, nprocs: %3d, vpset: %3d, ratio: %.4f; naggs = %d\n", confInfo->ioMinSize , confInfo->ioMaxSize , confInfo->nAggrs , confInfo->numBridgeRanks , confInfo->nProcs , confInfo->ioMaxSize /*virtualPsetSize*/ , - confInfo->cpuIDsize, confInfo->aggRatio , naggs ); # endif @@ -462,7 +469,7 @@ ADIOI_BG_compute_agg_ranklist_serial ( ADIO_File fd, tmp_ranklist[i] = 0; } } - + # if AGG_DEBUG for (i=0; i +#include #include "../ad_gpfs.h" #include "ad_bg_pset.h" #include #include -#ifdef HAVE_MPIX_H -#include -#endif +#define BGQ_TORUS_MAX_DIMS 5 +#define BGQ_FULL_TORUS_SIZE 512 #ifndef TRACE_ERR # define TRACE_ERR(fmt...) @@ -81,8 +81,8 @@ static int intsort(const void *p1, const void *p2) return(i1->bridgeCoord - i2->bridgeCoord); } -unsigned torusSize[MPIX_TORUS_MAX_DIMS]; -unsigned dimTorus[MPIX_TORUS_MAX_DIMS]; +unsigned torusSize[BGQ_TORUS_MAX_DIMS]; +bool dimTorus[BGQ_TORUS_MAX_DIMS]; /* This function computes the number of hops between the torus coordinates of the * aggCoords and bridgeCoords parameters. @@ -91,7 +91,7 @@ static unsigned procManhattanDistance(unsigned *aggCoords, unsigned *bridgeCoord unsigned totalDistance = 0; int i; - for (i=0;i 0) { // could torus make it closer? if (dimTorus[i]) { @@ -111,10 +111,35 @@ static unsigned procManhattanDistance(unsigned *aggCoords, unsigned *bridgeCoord return totalDistance; } +int BGQ_IO_node_id () +{ + static unsigned long IO_node_id = ULONG_MAX; -void -ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, - ADIOI_BG_ProcInfo_t *proc, + if (IO_node_id != ULONG_MAX) + return (int)(IO_node_id>>32); + + int rc; + int fd; + char* uci_str; + char buffer[4096]; + + fd = open("/dev/bgpers", O_RDONLY, 0); + assert(fd>=0); + rc = read(fd, buffer, sizeof(buffer)); + assert(rc>0); + close(fd); + + uci_str = strstr(buffer, "BG_UCI="); + assert(uci_str); + uci_str += sizeof("BG_UCI=")-1; + + IO_node_id = strtoul(uci_str, NULL, 16); + return (int)(IO_node_id>>32); +} + +void +ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, + ADIOI_BG_ProcInfo_t *proc, int size, int rank, int n_aggrs, MPI_Comm comm) { int i, iambridge=0, bridgerank = -1, bridgeIndex; @@ -125,15 +150,13 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, TRACE_ERR("Entering BG_persInfo_init, size: %d, rank: %d, n_aggrs: %d, comm: %d\n", size, rank, n_aggrs, (int)comm); Personality_t pers; - MPIX_Hardware_t hw; - MPIX_Hardware(&hw); - TRACE_ERR("BG_persInfo_init, my coords{%u,%u,%u,%u,%u} rankInPset %u,sizeOfPset %u,idOfPset %u\n",hw.Coords[0],hw.Coords[1],hw.Coords[2],hw.Coords[3],hw.Coords[4],hw.rankInPset,hw.sizeOfPset,hw.idOfPset); Kernel_GetPersonality(&pers, sizeof(pers)); + Personality_Networks_t *net = &pers.Network_Config; + TRACE_ERR("BG_persInfo_init, my coords{%u,%u,%u,%u,%u}\n",net->Acoord,net->Bcoord,net->Ccoord,net->Dcoord,net->Ecoord); proc->rank = rank; - proc->coreID = hw.coreID; if (gpfsmpio_bridgeringagg > 0) { #ifdef bridgeringaggtrace @@ -143,26 +166,44 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, /* Set the numNodesInPartition and nodeRank for this proc */ - proc->numNodesInPartition = 1; + unsigned dimMaxArray[BGQ_TORUS_MAX_DIMS]; + dimMaxArray[0] = net->Anodes; + dimMaxArray[1] = net->Bnodes; + dimMaxArray[2] = net->Cnodes; + dimMaxArray[3] = net->Dnodes; + dimMaxArray[4] = net->Enodes; + + unsigned hwCoordsArray[BGQ_TORUS_MAX_DIMS]; + hwCoordsArray[0] = net->Acoord; + hwCoordsArray[1] = net->Bcoord; + hwCoordsArray[2] = net->Ccoord; + hwCoordsArray[3] = net->Dcoord; + hwCoordsArray[4] = net->Ecoord; + proc->numNodesInPartition = net->Anodes * net->Bnodes * net->Cnodes * net->Dnodes * net->Enodes; proc->nodeRank = 0; - for (i=0;inumNodesInPartition *= hw.Size[i]; + /* Set the indicator for if a dimension in the partitions is a torus or not. + */ + dimTorus[0] = (bool) (ND_ENABLE_TORUS_DIM_A & net->NetFlags); + dimTorus[1] = (bool) (ND_ENABLE_TORUS_DIM_B & net->NetFlags); + dimTorus[2] = (bool) (ND_ENABLE_TORUS_DIM_C & net->NetFlags); + dimTorus[3] = (bool) (ND_ENABLE_TORUS_DIM_D & net->NetFlags); + dimTorus[4] = (bool) (ND_ENABLE_TORUS_DIM_E & net->NetFlags); + for (i=0;inodeRank += (hw.Coords[i] * baseNum); + baseNum *= dimMaxArray[j]; + proc->nodeRank += (hwCoordsArray[i] * baseNum); #ifdef bridgeringaggtrace if (rank == 0) - fprintf(stderr,"Dimension %d has %d elements wrap-around value is %d\n",i,torusSize[i],dimTorus[i]); + fprintf(stderr,"numNodesInPartition is %d Dimension %d has %d elements wrap-around value is %d\n",proc->numNodesInPartition,i,torusSize[i],dimTorus[i]); #endif } } MPI_Comm_size(comm, &commsize); - proc->ionID = MPIX_IO_node_id (); + proc->ionID = BGQ_IO_node_id (); if(size == 1) { @@ -179,8 +220,6 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, conf->ioMaxSize = size; conf->numBridgeRanks = 1; conf->nProcs = size; - conf->cpuIDsize = hw.ppn; - /*conf->virtualPsetSize = conf->ioMaxSize * conf->cpuIDsize;*/ conf->nAggrs = 1; conf->aggRatio = 1. * conf->nAggrs / conf->ioMinSize /*virtualPsetSize*/; if(conf->aggRatio > 1) conf->aggRatio = 1.; @@ -191,20 +230,20 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, /* Find the nearest bridge node coords. We don't know the rank in our comm so we will collective find/pick a bridge rank later. - */ + */ int32_t bridgeCoords; - bridgeCoords = pers.Network_Config.cnBridge_A << 24 | - pers.Network_Config.cnBridge_B << 18 | - pers.Network_Config.cnBridge_C << 12 | - pers.Network_Config.cnBridge_D << 6 | + bridgeCoords = pers.Network_Config.cnBridge_A << 24 | + pers.Network_Config.cnBridge_B << 18 | + pers.Network_Config.cnBridge_C << 12 | + pers.Network_Config.cnBridge_D << 6 | pers.Network_Config.cnBridge_E << 2; ADIOI_Assert((bridgeCoords >= 0)); /* A dim is < 6 bits or sorting won't work */ - if((hw.Coords[0] == pers.Network_Config.cnBridge_A) && - (hw.Coords[1] == pers.Network_Config.cnBridge_B) && - (hw.Coords[2] == pers.Network_Config.cnBridge_C) && - (hw.Coords[3] == pers.Network_Config.cnBridge_D) && - (hw.Coords[4] == pers.Network_Config.cnBridge_E)) { + if((net->Acoord == pers.Network_Config.cnBridge_A) && + (net->Bcoord == pers.Network_Config.cnBridge_B) && + (net->Ccoord == pers.Network_Config.cnBridge_C) && + (net->Dcoord == pers.Network_Config.cnBridge_D) && + (net->Ecoord == pers.Network_Config.cnBridge_E)) { iambridge = 1; /* I am bridge */ if (gpfsmpio_bridgeringagg > 0) { proc->manhattanDistanceToBridge = 0; @@ -212,16 +251,16 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, } else { // calculate manhattan distance to bridge if gpfsmpio_bridgeringagg is set if (gpfsmpio_bridgeringagg > 0) { - unsigned aggCoords[MPIX_TORUS_MAX_DIMS],manhattanBridgeCoords[MPIX_TORUS_MAX_DIMS]; - aggCoords[0] = hw.Coords[0]; + unsigned aggCoords[BGQ_TORUS_MAX_DIMS],manhattanBridgeCoords[BGQ_TORUS_MAX_DIMS]; + aggCoords[0] = net->Acoord; manhattanBridgeCoords[0] = pers.Network_Config.cnBridge_A; - aggCoords[1] = hw.Coords[1]; + aggCoords[1] = net->Bcoord; manhattanBridgeCoords[1] = pers.Network_Config.cnBridge_B; - aggCoords[2] = hw.Coords[2]; + aggCoords[2] = net->Ccoord; manhattanBridgeCoords[2] = pers.Network_Config.cnBridge_C; - aggCoords[3] = hw.Coords[3]; + aggCoords[3] = net->Dcoord; manhattanBridgeCoords[3] = pers.Network_Config.cnBridge_D; - aggCoords[4] = hw.Coords[4]; + aggCoords[4] = net->Ecoord; manhattanBridgeCoords[4] = pers.Network_Config.cnBridge_E; proc->manhattanDistanceToBridge= procManhattanDistance(aggCoords, manhattanBridgeCoords); @@ -238,16 +277,16 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, bridges = (sortstruct *) ADIOI_Malloc(sizeof(sortstruct) * size); /* We're going to sort this structure by bridgeCoord: - + typedef struct { int rank; int bridgeCoord; - } sortstruct; - - and I want the rank that IS the bridge to sort first, so - OR in '1' on non-bridge ranks that use a bridge coord. - */ + } sortstruct; + + and I want the rank that IS the bridge to sort first, so + OR in '1' on non-bridge ranks that use a bridge coord. + */ /* My input to the collective */ bridges[rank].rank = rank; @@ -268,18 +307,18 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, tempRank = bridges[0].rank; countPset=1; - bridgeIndex = 0; + bridgeIndex = 0; mincompute = size+1; maxcompute = 1; for(i=1; imyIOSize = countPset; proc->ioNodeIndex = bridgeIndex; } - - - if(rank == 0) + + + if(rank == 0) { /* Only rank 0 has a conf structure, fill in stuff as appropriate */ conf->ioMinSize = mincompute; conf->ioMaxSize = maxcompute; /* equivalent to pset size */ conf->numBridgeRanks = bridgeIndex+1; conf->nProcs = size; - conf->cpuIDsize = hw.ppn; - /*conf->virtualPsetSize = maxcompute * conf->cpuIDsize;*/ - + conf->nAggrs = n_aggrs; /* First pass gets nAggrs = -1 */ if(conf->nAggrs <=0) conf->nAggrs = gpfsmpio_bg_nagg_pset; if(conf->ioMinSize <= conf->nAggrs) conf->nAggrs = ADIOI_MAX(1,conf->ioMinSize-1); /* not including bridge itself */ -/* if(conf->nAggrs > conf->numBridgeRanks) - conf->nAggrs = conf->numBridgeRanks; +/* if(conf->nAggrs > conf->numBridgeRanks) + conf->nAggrs = conf->numBridgeRanks; */ conf->aggRatio = 1. * conf->nAggrs / conf->ioMinSize /*virtualPsetSize*/; /* if(conf->aggRatio > 1) conf->aggRatio = 1.; */ @@ -369,7 +406,7 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf, } -void +void ADIOI_BG_persInfo_free( ADIOI_BG_ConfInfo_t *conf, ADIOI_BG_ProcInfo_t *proc ) { ADIOI_BG_ConfInfo_free( conf ); diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/ad_bg_pset.h b/ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/ad_bg_pset.h similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/ad_bg_pset.h rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/ad_bg_pset.h index bcdc61f5e3..3f251e8275 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gpfs/bg/ad_bg_pset.h +++ b/ompi/mca/io/romio321/romio/adio/ad_gpfs/bg/ad_bg_pset.h @@ -17,9 +17,6 @@ #ifndef AD_BG_PSET_H_ #define AD_BG_PSET_H_ -#ifdef HAVE_MPIX_H -#include -#endif /* Keeps specific information to each process, will be exchanged among processes */ typedef struct { @@ -28,7 +25,6 @@ typedef struct { int ionID; /* ion id this cn is using */ /* int myCoords[5]; */ int bridgeRank; /* my bridge node (or proxy) rank */ - unsigned char coreID; unsigned char threadID; /* unlikely to be useful but better than just padding */ unsigned char __cpad[2]; int myIOSize; /* number of ranks sharing my bridge/IO @@ -73,6 +69,7 @@ typedef struct { /* public funcs for a pair of ADIOI_BG_ConfInfo_t and ADIOI_BG_ProcInfo_t objects */ + int BGQ_IO_node_id (); void ADIOI_BG_persInfo_init( ADIOI_BG_ConfInfo_t *conf, ADIOI_BG_ProcInfo_t *proc, int s, int r, int n_aggrs, MPI_Comm comm); diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/pe/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_gpfs/pe/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/pe/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/pe/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c b/ompi/mca/io/romio321/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/pe/ad_pe_aggrs.c diff --git a/ompi/mca/io/romio314/romio/adio/ad_gpfs/pe/ad_pe_aggrs.h b/ompi/mca/io/romio321/romio/adio/ad_gpfs/pe/ad_pe_aggrs.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gpfs/pe/ad_pe_aggrs.h rename to ompi/mca/io/romio321/romio/adio/ad_gpfs/pe/ad_pe_aggrs.h diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_gridftp/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp.c index 8c1ed2d99f..f3767dcda2 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -34,4 +34,6 @@ struct ADIOI_Fns_struct ADIO_GRIDFTP_operations = { ADIOI_GRIDFTP_Resize, /* Resize */ ADIOI_GRIDFTP_Delete, /* Delete */ ADIOI_GRIDFTP_Feature, /* Features */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp.h b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp.h similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp.h rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp.h index 427af0a8eb..0b94c780ea 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp.h +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp.h @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. +/* + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -26,32 +26,32 @@ extern globus_ftp_client_operationattr_t oattr[ADIO_GRIDFTP_HANDLES_MAX]; /* TODO: weed out the now-unused prototypes */ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code); void ADIOI_GRIDFTP_Close(ADIO_File fd, int *error_code); -void ADIOI_GRIDFTP_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_GRIDFTP_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_GRIDFTP_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_GRIDFTP_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_GRIDFTP_IwriteContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_GRIDFTP_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_GRIDFTP_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_GRIDFTP_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); + *error_code); int ADIOI_GRIDFTP_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_GRIDFTP_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); void ADIOI_GRIDFTP_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_GRIDFTP_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code); + int *error_code); +void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, + int *error_code); void ADIOI_GRIDFTP_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, @@ -79,10 +79,10 @@ void ADIOI_GRIDFTP_IwriteStrided(ADIO_File fd, void *buf, int count, void ADIOI_GRIDFTP_Flush(ADIO_File fd, int *error_code); void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); void ADIOI_GRIDFTP_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -void ADIOI_GRIDFTP_Get_shared_fp(ADIO_File fd, int size, - ADIO_Offset *shared_fp, +void ADIOI_GRIDFTP_Get_shared_fp(ADIO_File fd, int size, + ADIO_Offset *shared_fp, int *error_code); -void ADIOI_GRIDFTP_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, +void ADIOI_GRIDFTP_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code); void ADIOI_GRIDFTP_Delete(char *filename, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_close.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_close.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_close.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_close.c index c80dec3175..c1693d65ce 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_close.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_delete.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_delete.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_delete.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_delete.c index 2217e12e8f..54eb714429 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_delete.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -13,7 +13,7 @@ static globus_cond_t cond; static globus_bool_t delete_done, delete_success; static void delete_cb(void *myarg, globus_ftp_client_handle_t *handle, globus_object_t *error) { - + if (error) { FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error)); @@ -39,7 +39,7 @@ void ADIOI_GRIDFTP_Delete(char *filename, int *error_code) globus_module_activate(GLOBUS_FTP_CLIENT_MODULE); result=globus_ftp_client_handle_init(&handle,GLOBUS_NULL); - + if (result != GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_handle_init",myname,result); @@ -47,11 +47,11 @@ void ADIOI_GRIDFTP_Delete(char *filename, int *error_code) MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); - return; + return; } - + delete_done=GLOBUS_FALSE; delete_success=GLOBUS_FALSE; result=globus_ftp_client_delete(&handle,filename,GLOBUS_NULL,delete_cb,GLOBUS_NULL); @@ -78,7 +78,7 @@ void ADIOI_GRIDFTP_Delete(char *filename, int *error_code) MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -89,7 +89,7 @@ void ADIOI_GRIDFTP_Delete(char *filename, int *error_code) MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); } } diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_fcntl.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_fcntl.c index b5150cbdfb..dd9cb5ee09 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -26,7 +26,7 @@ void fcntl_size_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_mutex_unlock(&fcntl_size_lock); } -void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, +void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code) { MPI_Datatype copy_etype, copy_filetype; @@ -46,7 +46,7 @@ void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, { globus_result_t result; globus_off_t fsize=0; - + globus_mutex_init(&fcntl_size_lock,GLOBUS_NULL); globus_cond_init(&fcntl_size_cond,GLOBUS_NULL); fcntl_size_done=GLOBUS_FALSE; @@ -61,7 +61,7 @@ void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_features.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_features.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_features.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_features.c diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_flush.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_flush.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_flush.c index 2f61e7f76d..795341e888 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_hints.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_hints.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_hints.c index f008cdc247..c0b0a40ebb 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_hints.c @@ -1,11 +1,11 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ -/* +/* Valid hints for ftp:// and gsiftp:// URLs (aside from the std. ones): @@ -19,7 +19,7 @@ Valid hints for ftp:// and gsiftp:// URLs (aside from the std. ones): tcp_buffer integer size of tcp stream buffers in bytes - transfer_type ascii or binary (default binary) + transfer_type ascii or binary (default binary) These *must* be specified at open time currently. */ @@ -29,12 +29,12 @@ These *must* be specified at open time currently. void ADIOI_GRIDFTP_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) { - + if (!(fd->info)) { if ( users_info==MPI_INFO_NULL ) { - /* This must be part of the open call. */ + /* This must be part of the open call. */ MPI_Info_create(&(fd->info)); } else @@ -46,7 +46,7 @@ void ADIOI_GRIDFTP_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) { int i,nkeys,valuelen,flag; char key[MPI_MAX_INFO_KEY], value[MPI_MAX_INFO_VAL]; - + if ( users_info!=MPI_INFO_NULL ) { MPI_Info_get_nkeys(users_info,&nkeys); @@ -62,7 +62,7 @@ void ADIOI_GRIDFTP_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) } } } - + /* let the generic ROMIO and MPI-I/O stuff happen... */ - ADIOI_GEN_SetInfo(fd, users_info, error_code); + ADIOI_GEN_SetInfo(fd, users_info, error_code); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_open.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_open.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_open.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_open.c index e30e3811d4..45aab92105 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_open.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -12,7 +12,7 @@ static globus_cond_t cond; static globus_bool_t file_exists,exists_done; static void exists_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error) -{ +{ if (error) { FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error)); @@ -77,7 +77,7 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) result=globus_ftp_client_handleattr_init(&hattr); if ( result != GLOBUS_SUCCESS ) { - + globus_err_handler("globus_ftp_client_handleattr_init", myname,result); @@ -114,41 +114,41 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) /* Since we're (almost by definition) doing things that FTP S (stream) control mode can't handle, default to E (extended block) control mode - for gsiftp:// URLs. ftp:// URLs use standard stream control mode + for gsiftp:// URLs. ftp:// URLs use standard stream control mode by default. This behavior can be overridden by the ftp_control_mode hint. */ /* - if ( !strncmp(fd->filename,"gsiftp:",7) && + if ( !strncmp(fd->filename,"gsiftp:",7) && (result=globus_ftp_client_operationattr_set_mode(&(oattr[fd->fd_sys]),GLOBUS_FTP_CONTROL_MODE_EXTENDED_BLOCK))!=GLOBUS_SUCCESS ) globus_err_handler("globus_ftp_client_operationattr_set_mode",myname,result); - else if ( !strncmp(fd->filename,"ftp:",4) && + else if ( !strncmp(fd->filename,"ftp:",4) && (result=globus_ftp_client_operationattr_set_mode(&(oattr[fd->fd_sys]),GLOBUS_FTP_CONTROL_MODE_STREAM))!=GLOBUS_SUCCESS ) globus_err_handler("globus_ftp_client_operationattr_set_mode",myname,result); */ /* Set append mode if necessary */ - if ( (fd->access_mode&ADIO_APPEND) && + if ( (fd->access_mode&ADIO_APPEND) && ((result=globus_ftp_client_operationattr_set_append(&(oattr[fd->fd_sys]),GLOBUS_TRUE))!=GLOBUS_SUCCESS) ) globus_err_handler("globus_ftp_client_operationattr_set_append",myname,result); - /* Other hint and amode processing that would affect hattr and/or + /* Other hint and amode processing that would affect hattr and/or oattr[] (eg. parallelism, striping, etc.) goes here */ if ( fd->info!=MPI_INFO_NULL ) { ADIOI_Info_get(fd->info,"ftp_control_mode",MPI_MAX_INFO_VAL,hintval,&keyfound); if ( keyfound ) { - if ( ( !strcmp(hintval,"extended") || !strcmp(hintval,"extended_block") ) && + if ( ( !strcmp(hintval,"extended") || !strcmp(hintval,"extended_block") ) && (result=globus_ftp_client_operationattr_set_mode(&(oattr[fd->fd_sys]),GLOBUS_FTP_CONTROL_MODE_EXTENDED_BLOCK))!=GLOBUS_SUCCESS ) globus_err_handler("globus_ftp_client_operationattr_set_mode",myname,result); - else if ( !strcmp(hintval,"block") && + else if ( !strcmp(hintval,"block") && (result=globus_ftp_client_operationattr_set_mode(&(oattr[fd->fd_sys]),GLOBUS_FTP_CONTROL_MODE_BLOCK))!=GLOBUS_SUCCESS ) globus_err_handler("globus_ftp_client_operationattr_set_mode",myname,result); - else if ( !strcmp(hintval,"compressed") && + else if ( !strcmp(hintval,"compressed") && (result=globus_ftp_client_operationattr_set_mode(&(oattr[fd->fd_sys]),GLOBUS_FTP_CONTROL_MODE_COMPRESSED))!=GLOBUS_SUCCESS ) globus_err_handler("globus_ftp_client_operationattr_set_mode",myname,result); - else if ( !strcmp(hintval,"stream") && + else if ( !strcmp(hintval,"stream") && (result=globus_ftp_client_operationattr_set_mode(&(oattr[fd->fd_sys]),GLOBUS_FTP_CONTROL_MODE_STREAM))!=GLOBUS_SUCCESS ) globus_err_handler("globus_ftp_client_operationattr_set_mode",myname,result); } @@ -157,7 +157,7 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) if ( keyfound ) { int nftpthreads; - + if ( sscanf(hintval,"%d",&nftpthreads)==1 ) { globus_ftp_control_parallelism_t parallelism; @@ -261,10 +261,10 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_exists",myname,result); - fd->fd_sys = -1; + fd->fd_sys = -1; *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -295,10 +295,10 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) { globus_err_handler("globus_ftp_client_put",myname,result); fd->fd_sys = -1; - *error_code = MPIO_Err_create_code(MPI_SUCCESS, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -310,10 +310,10 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) if ( result != GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_register_write",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", + "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -328,7 +328,7 @@ void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code) { fd->fd_sys = -1; *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**io", 0); return; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_read.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_read.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_read.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_read.c index fc47860019..91ed544c80 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_read.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -100,7 +100,7 @@ static void readdiscontig_data_cb(void *myargs, globus_ftp_client_handle_t *hand return; } -void ADIOI_GRIDFTP_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_GRIDFTP_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -156,12 +156,12 @@ void ADIOI_GRIDFTP_ReadContig(ADIO_File fd, void *buf, int count, if ( result != GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_register_read",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; - } + } /* The ctl callback won't start till the data callbacks complete, so it's @@ -227,24 +227,21 @@ void ADIOI_GRIDFTP_ReadDiscontig(ADIO_File fd, void *buf, int count, MPI_Type_size_x(datatype,&btype_size); MPI_Type_get_extent(datatype,&btype_lb,&btype_extent); ADIOI_Datatype_iscontig(datatype,&buf_contig); - + if ( ( btype_extent!=btype_size ) || ( ! buf_contig ) ) { FPRINTF(stderr,"[%d/%d] %s called with discontigous memory buffer\n", myrank,nprocs,myname); fflush(stderr); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", 0 ); return; } /* from here we can assume btype_extent==btype_size */ /* Flatten out fd->filetype so we know which blocks to skip */ - ADIOI_Flatten_datatype(fd->filetype); - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype && flat_file->next!=NULL) - flat_file = flat_file->next; + flat_file = ADIOI_Flatten_and_find(fd->filetype); /* Figure out how big the area to read is */ start=(globus_off_t)(offset*etype_size); @@ -279,8 +276,8 @@ void ADIOI_GRIDFTP_ReadDiscontig(ADIO_File fd, void *buf, int count, FPRINTF(stderr,"[%d/%d] %s error in computing extent -- extent %d is smaller than total bytes requested %d!\n", myrank,nprocs,myname,extent,count*btype_size); fflush(stderr); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", 0); return; } @@ -301,9 +298,9 @@ void ADIOI_GRIDFTP_ReadDiscontig(ADIO_File fd, void *buf, int count, GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_partial_get",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -391,15 +388,15 @@ void ADIOI_GRIDFTP_ReadStrided(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); #ifdef PRINT_ERR_MSG - FPRINTF(stdout, "[%d/%d] ADIOI_GRIDFTP_ReadStrided called on %s\n", myrank, + FPRINTF(stdout, "[%d/%d] ADIOI_GRIDFTP_ReadStrided called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStrided\n", myrank, + FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStrided\n", myrank, nprocs); #endif ADIOI_GEN_ReadStrided(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); - + */ char myname[]="ADIOI_GRIDFTP_ReadStrided"; @@ -457,7 +454,7 @@ void ADIOI_GRIDFTP_ReadStrided(ADIO_File fd, void *buf, int count, ADIOI_Free(intermediate); } - else + else { /* Why did you bother calling ReadStrided?!?!?! */ ADIOI_GRIDFTP_ReadContig(fd, buf, count, datatype, diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_resize.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_resize.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_resize.c index f55c56951f..96c0460c42 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -113,9 +113,9 @@ void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_partial_put",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -129,9 +129,9 @@ void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_register_write",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -161,9 +161,9 @@ void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_move",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -189,9 +189,9 @@ void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_partial_third_party_transfer",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } @@ -213,9 +213,9 @@ void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) GLOBUS_NULL))!=GLOBUS_SUCCESS ) { globus_err_handler("globus_ftp_client_delete",myname,result); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_IO, "**io", "**io %s", + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, + MPI_ERR_IO, "**io", "**io %s", globus_object_printable_to_string(globus_error_get(result))); return; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_write.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_write.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_write.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_write.c index 01c6c64144..d349d5c231 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/ad_gridftp_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/ad_gridftp_write.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ @@ -101,12 +101,12 @@ static void writediscontig_data_cb(void *myargs, globus_ftp_client_handle_t *han eof, writediscontig_data_cb, (void *)(bytes_written)); - FPRINTF(stderr,"wrote %Ld bytes...",(long long)length); + FPRINTF(stderr,"wrote %Ld bytes...",(long long)length); return; } -void ADIOI_GRIDFTP_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_GRIDFTP_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -227,7 +227,7 @@ void ADIOI_GRIDFTP_WriteDiscontig(ADIO_File fd, void *buf, int count, MPI_Type_size_x(datatype,&btype_size); MPI_Type_get_extent(datatype,&btype_lb,&btype_extent); ADIOI_Datatype_iscontig(datatype,&buf_contig); - + if ( ( btype_extent!=btype_size ) || ( ! buf_contig ) ) { FPRINTF(stderr,"[%d/%d] %s called with discontigous memory buffer\n", @@ -242,10 +242,7 @@ void ADIOI_GRIDFTP_WriteDiscontig(ADIO_File fd, void *buf, int count, /* from here we can assume btype_extent==btype_size */ /* Flatten out fd->filetype so we know which blocks to skip */ - ADIOI_Flatten_datatype(fd->filetype); - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype && flat_file->next!=NULL) - flat_file = flat_file->next; + flat_file = ADIOI_Flatten_and_find(fd->filetype); /* Figure out how big the area to write is */ /* ASSUMPTION: ftype_size is an integer multiple of btype_size or vice versa. */ @@ -348,7 +345,7 @@ void ADIOI_GRIDFTP_WriteDiscontig(ADIO_File fd, void *buf, int count, nblks++; } - + /* The ctl callback won't start till the data callbacks complete, so it's safe to wait on just the ctl callback */ globus_mutex_lock(&writediscontig_ctl_lock); @@ -392,7 +389,7 @@ void ADIOI_GRIDFTP_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, + ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); return; #else @@ -460,7 +457,7 @@ void ADIOI_GRIDFTP_WriteStrided(ADIO_File fd, void *buf, int count, ADIOI_Free(intermediate); } - else + else { /* Why did you bother calling WriteStrided?!?!?! */ FPRINTF(stderr,"[%d/%d] Why the heck did you call %s with contiguous buffer *and* file types?\n", diff --git a/ompi/mca/io/romio314/romio/adio/ad_gridftp/globus_routines.c b/ompi/mca/io/romio321/romio/adio/ad_gridftp/globus_routines.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_gridftp/globus_routines.c rename to ompi/mca/io/romio321/romio/adio/ad_gridftp/globus_routines.c index bb4a48dad1..1cca367a3f 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_gridftp/globus_routines.c +++ b/ompi/mca/io/romio321/romio/adio/ad_gridftp/globus_routines.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. + * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_hfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_hfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/README b/ompi/mca/io/romio321/romio/adio/ad_hfs/README similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/README rename to ompi/mca/io/romio321/romio/adio/ad_hfs/README diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs.c b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs.c rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs.c index 860c42bdc3..5b34354cab 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -33,4 +33,6 @@ struct ADIOI_Fns_struct ADIO_HFS_operations = { ADIOI_GEN_Flush, /* Flush */ ADIOI_HFS_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs.h b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs.h similarity index 79% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs.h rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs.h index 27bd5dfa9c..2950aa50fc 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -19,16 +19,16 @@ #endif void ADIOI_HFS_Open(ADIO_File fd, int *error_code); -void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_HFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_HFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_HFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_fcntl.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_fcntl.c index 0bc48c763e..460c73666f 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -25,20 +25,20 @@ void ADIOI_HFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *er case ADIO_FCNTL_GET_FSIZE: fcntl_struct->fsize = lseek64(fd->fd_sys, 0, SEEK_END); #ifdef HPUX - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) lseek64(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); /* not required in SPPUX since there we use pread/pwrite */ #endif if (fcntl_struct->fsize == -1) { #ifdef MPICH - *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", + *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); #elif defined(PRINT_ERR_MSG) *error_code = MPI_ERR_UNKNOWN; #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; @@ -52,7 +52,7 @@ void ADIOI_HFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *er /* prealloc64 works only if file is of zero length */ if (err && (errno != ENOTEMPTY)) { #ifdef MPICH - *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", + *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); #elif defined(PRINT_ERR_MSG) *error_code = MPI_ERR_UNKNOWN; @@ -84,16 +84,16 @@ void ADIOI_HFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *er #endif return; } - } + } - if ((fcntl_struct->diskspace > 2147483647) || + if ((fcntl_struct->diskspace > 2147483647) || (err && (errno == ENOTEMPTY))) { #endif ADIOI_GEN_Prealloc(fd,fcntl_struct->diskspace, error_code); } ADIOI_Free(buf); #ifdef HPUX - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) lseek64(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); /* not required in SPPUX since there we use pread/pwrite */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_open.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_open.c index 7df8868d7e..46ee2848e5 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -53,14 +53,14 @@ void ADIOI_HFS_Open(ADIO_File fd, int *error_code) if (fd->fd_sys == -1 ) { #ifdef MPICH - *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", + *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); #elif defined(PRINT_ERR_MSG) *error_code = MPI_ERR_UNKNOWN; #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(ADIO_FILE_NULL, *error_code, myname); + ADIOI_Error(ADIO_FILE_NULL, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_read.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_read.c index 145bae1932..eac03ab6f8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_read.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ #define lseek64 lseek #endif -void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -26,7 +26,7 @@ void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, #ifdef SPPUX fd->fp_sys_posn = -1; /* set it to null, since we are using pread */ - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) err = pread64(fd->fd_sys, buf, len, offset); else { /* read from curr. location of ind. file pointer */ err = pread64(fd->fd_sys, buf, len, fd->fp_ind); @@ -40,15 +40,15 @@ void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, lseek64(fd->fd_sys, offset, SEEK_SET); err = read(fd->fd_sys, buf, len); fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* read from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) lseek64(fd->fd_sys, fd->fp_ind, SEEK_SET); err = read(fd->fd_sys, buf, len); - fd->fp_ind += err; + fd->fp_ind += err; fd->fp_sys_posn = fd->fp_ind; - } + } #endif #ifdef HAVE_STATUS_SET_BYTES @@ -64,7 +64,7 @@ void ADIOI_HFS_ReadContig(ADIO_File fd, void *buf, int count, #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_resize.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_resize.c index 3496849939..de24ad672a 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -13,7 +13,7 @@ void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) #ifndef PRINT_ERR_MSG static char myname[] = "ADIOI_HFS_RESIZE"; #endif - + err = ftruncate64(fd->fd_sys, size); if (err == -1) { #ifdef MPICH @@ -24,7 +24,7 @@ void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_write.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_write.c index 3bde18d2bb..4bffa82a2f 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_hfs/ad_hfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_write.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ #define lseek64 lseek #endif -void ADIOI_HFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_HFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -25,7 +25,7 @@ void ADIOI_HFS_WriteContig(ADIO_File fd, void *buf, int count, #ifdef SPPUX fd->fp_sys_posn = -1; /* set it to null, since we are using pwrite */ - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) err = pwrite64(fd->fd_sys, buf, len, offset); else { /* write from curr. location of ind. file pointer */ err = pwrite64(fd->fd_sys, buf, len, fd->fp_ind); @@ -39,7 +39,7 @@ void ADIOI_HFS_WriteContig(ADIO_File fd, void *buf, int count, lseek64(fd->fd_sys, offset, SEEK_SET); err = write(fd->fd_sys, buf, len); fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* write from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_lustre/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_lustre/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/README b/ompi/mca/io/romio321/romio/adio/ad_lustre/README similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/README rename to ompi/mca/io/romio321/romio/adio/ad_lustre/README index d27110f42f..a217c0f8fe 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/README +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/README @@ -1,11 +1,11 @@ -Upcoming soon: +Upcoming soon: o Hierarchical striping as described in the paper from CCGrid2007 http://ft.ornl.gov/projects/io/pubs/CCGrid-2007-file-joining.pdf Further out: o To post the code for ParColl (Partitioned collective IO) - + ----------------------------------------------------- -V05: +V05: ----------------------------------------------------- Improved data redistribution o Improve I/O pattern identification. Besides checking interleaving, @@ -20,12 +20,12 @@ Improved data redistribution more constant clients. ----------------------------------------------------- -V04: +V04: ----------------------------------------------------- o Direct IO and Lockless IO support ----------------------------------------------------- -V03: +V03: ----------------------------------------------------- o Correct detection of fs_type when lustre: prefix is not given o Further fix on stripe alignment @@ -34,21 +34,21 @@ V03: ----------------------------------------------------- V02: ----------------------------------------------------- -The Lustre ADIO driver has been cleaned up quite a lot. Compared +The Lustre ADIO driver has been cleaned up quite a lot. Compared to the intital posting, here are the changes: o Removal of dead/redundant code o Removal of asynchronous IO piece as it appears outdated o Bug fixes for setting Lustre Hints - o Bug fixes for data sieving - o Improved Setsize operation with one process calling ftruncate - o Improved collective IO with domain partitioning on + o Bug fixes for data sieving + o Improved Setsize operation with one process calling ftruncate + o Improved collective IO with domain partitioning on Lustre stripe boundary Contributing: - o You may contribute via many different ways, such as + o You may contribute via many different ways, such as testing results, bug reports, and new feature patches. o We appreciate any courtesy reference of this work. - o Disclaimer: you are welcome to try the code, but at your own risk. + o Disclaimer: you are welcome to try the code, but at your own risk. Contact info: For more info, visit http://ft.ornl.gov/projects/io/ diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre.c index d524dd829d..f3bc3d091b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre.c @@ -41,4 +41,6 @@ struct ADIOI_Fns_struct ADIO_LUSTRE_operations = { ADIOI_GEN_Delete, /* Delete */ ADIOI_GEN_Feature, /* Features */ "LUSTRE:", + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre.h b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre.h similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre.h rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre.h index 93034cd667..edd2bd35ef 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre.h +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre.h @@ -35,12 +35,16 @@ #include #endif -#ifdef HAVE_AIO_H -#include -#ifdef HAVE_SYS_AIO_H -#include -#endif -#endif /* End of HAVE_SYS_AIO_H */ +#ifdef HAVE_AIO_LITE_H +#include +#else + #ifdef HAVE_AIO_H + #include + #endif + #ifdef HAVE_SYS_AIO_H + #include + #endif +#endif /* End of HAVE_AIO_LITE_H */ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code); void ADIOI_LUSTRE_Close(ADIO_File fd, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_aggregate.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_aggregate.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_aggregate.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_aggregate.c index ce893a30e3..da54d71cf5 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_aggregate.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_aggregate.c @@ -49,23 +49,23 @@ void ADIOI_LUSTRE_Get_striping_info(ADIO_File fd, int **striping_info_ptr, /* Calculate how many IO clients we need */ /* Algorithm courtesy Pascal Deveze (pascal.deveze@bull.net) */ /* To avoid extent lock conflicts, - * avail_cb_nodes should either + * avail_cb_nodes should either * - be a multiple of stripe_count, * - or divide stripe_count exactly * so that each OST is accessed by a maximum of CO constant clients. */ if (nprocs_for_coll >= stripe_count) /* avail_cb_nodes should be a multiple of stripe_count and the number * of procs per OST should be limited to the minimum between - * nprocs_for_coll/stripe_count and CO - * - * e.g. if stripe_count=20, nprocs_for_coll=42 and CO=3 then + * nprocs_for_coll/stripe_count and CO + * + * e.g. if stripe_count=20, nprocs_for_coll=42 and CO=3 then * avail_cb_nodes should be equal to 40 */ - avail_cb_nodes = + avail_cb_nodes = stripe_count * ADIOI_MIN(nprocs_for_coll/stripe_count, CO); else { /* nprocs_for_coll is less than stripe_count */ /* avail_cb_nodes should divide stripe_count */ - /* e.g. if stripe_count=60 and nprocs_for_coll=8 then + /* e.g. if stripe_count=60 and nprocs_for_coll=8 then * avail_cb_nodes should be egal to 6 */ /* This could be done with : while (stripe_count % avail_cb_nodes != 0) avail_cb_nodes--; @@ -83,7 +83,7 @@ void ADIOI_LUSTRE_Get_striping_info(ADIO_File fd, int **striping_info_ptr, } /* if divisor is less than nprocs_for_coll, divisor is a * solution, but it is not sure that it is the best one */ - else if (divisor <= nprocs_for_coll) + else if (divisor <= nprocs_for_coll) avail_cb_nodes = divisor; } divisor++; @@ -202,7 +202,7 @@ void ADIOI_LUSTRE_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list, for (i = 0; i < nprocs; i++) { /* add one to count_my_req_per_proc[i] to avoid zero size malloc */ buf_idx[i] = (int *) ADIOI_Malloc((count_my_req_per_proc[i] + 1) - * sizeof(int)); + * sizeof(int)); } /* now allocate space for my_req, offset, and len */ @@ -310,8 +310,13 @@ int ADIOI_LUSTRE_Docollect(ADIO_File fd, int contig_access_count, fd->comm); MPI_Allreduce(&contig_access_count, &total_access_count, 1, MPI_INT, MPI_SUM, fd->comm); - /* estimate average req_size */ - avg_req_size = (int)(total_req_size / total_access_count); + /* avoid possible divide-by-zero) */ + if (total_access_count != 0) { + /* estimate average req_size */ + avg_req_size = (int)(total_req_size / total_access_count); + } else { + avg_req_size = 0; + } /* get hint of big_req_size */ big_req_size = fd->hints->fs_hints.lustre.coll_threshold; /* Don't perform collective I/O if there are big requests */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_fcntl.c similarity index 82% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_fcntl.c index 61d4b66205..a4bd6fc6d1 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_fcntl.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. * * Copyright (C) 2007 Oak Ridge National Laboratory @@ -22,11 +22,11 @@ void ADIOI_LUSTRE_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int switch(flag) { case ADIO_FCNTL_GET_FSIZE: fcntl_struct->fsize = lseek(fd->fd_sys, 0, SEEK_END); - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) lseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); if (fcntl_struct->fsize == -1) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); } else *error_code = MPI_SUCCESS; @@ -34,11 +34,11 @@ void ADIOI_LUSTRE_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int case ADIO_FCNTL_SET_DISKSPACE: /* will be called by one process only */ - /* On file systems with no preallocation function, I have to - explicitly write - to allocate space. Since there could be holes in the file, - I need to read up to the current file size, write it back, - and then write beyond that depending on how much + /* On file systems with no preallocation function, I have to + explicitly write + to allocate space. Since there could be holes in the file, + I need to read up to the current file size, write it back, + and then write beyond that depending on how much preallocation is needed. read/write in sizes of no more than ADIOI_PREALLOC_BUFSZ */ @@ -46,7 +46,7 @@ void ADIOI_LUSTRE_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int alloc_size = fcntl_struct->diskspace; size = ADIOI_MIN(curr_fsize, alloc_size); - + ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ; buf = (char *) ADIOI_Malloc(ADIOI_PREALLOC_BUFSZ); done = 0; @@ -56,31 +56,31 @@ void ADIOI_LUSTRE_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int ADIO_ReadContig(fd, buf, len, MPI_BYTE, ADIO_EXPLICIT_OFFSET, done, &status, error_code); if (*error_code != MPI_SUCCESS) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); - return; + return; } - ADIO_WriteContig(fd, buf, len, MPI_BYTE, ADIO_EXPLICIT_OFFSET, + ADIO_WriteContig(fd, buf, len, MPI_BYTE, ADIO_EXPLICIT_OFFSET, done, &status, error_code); if (*error_code != MPI_SUCCESS) return; done += len; } if (alloc_size > curr_fsize) { - memset(buf, 0, ADIOI_PREALLOC_BUFSZ); + memset(buf, 0, ADIOI_PREALLOC_BUFSZ); size = alloc_size - curr_fsize; ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ; for (i=0; ifp_sys_posn != -1) + if (fd->fp_sys_posn != -1) lseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); *error_code = MPI_SUCCESS; break; diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_hints.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_hints.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_hints.c index 00aebd1a57..1d40c86f26 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_hints.c @@ -20,7 +20,7 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) char *value; int flag; ADIO_Offset stripe_val[3], str_factor = -1, str_unit=0, start_iodev=-1; - int err, myrank; + int myrank; static char myname[] = "ADIOI_LUSTRE_SETINFO"; value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); @@ -108,7 +108,7 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) if (users_info != MPI_INFO_NULL) { /* CO: IO Clients/OST, * to keep the load balancing between clients and OSTs */ - ADIOI_Info_check_and_install_int(fd, users_info, "romio_lustre_co_ratio", + ADIOI_Info_check_and_install_int(fd, users_info, "romio_lustre_co_ratio", &(fd->hints->fs_hints.lustre.co_ratio), myname, error_code ); /* coll_threshold: @@ -125,6 +125,12 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* set the values for collective I/O and data sieving parameters */ ADIOI_GEN_SetInfo(fd, users_info, error_code); + /* generic hints might step on striping_unit */ + if (users_info != MPI_INFO_NULL) { + ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit", + NULL, myname, error_code); + } + if (ADIOI_Direct_read) fd->direct_read = 1; if (ADIOI_Direct_write) fd->direct_write = 1; diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_open.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_open.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_open.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_open.c index c7add09063..a3b03be9ea 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_open.c @@ -147,9 +147,6 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code) if (fd->access_mode & ADIO_APPEND) fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END); - if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) - fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END); - fd->fd_direct = -1; if (fd->direct_write || fd->direct_read) { fd->fd_direct = open(fd->filename, amode_direct, perm); @@ -160,12 +157,12 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code) fd->direct_write = fd->direct_read = 0; } } + fn_exit: ADIOI_Free(lum); ADIOI_Free(value); - /* --BEGIN ERROR HANDLING-- */ - if (fd->fd_sys == -1 || ((fd->fd_direct == -1) && + if (fd->fd_sys == -1 || ((fd->fd_direct == -1) && (fd->direct_write || fd->direct_read))) { *error_code = ADIOI_Err_create_code(myname, fd->filename, errno); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_rwcontig.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_rwcontig.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_rwcontig.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_rwcontig.c index c737267635..cb187a39e9 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_rwcontig.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_rwcontig.c @@ -94,7 +94,7 @@ static int ADIOI_LUSTRE_Directio(ADIO_File fd, const void *buf, int len, else nbytes += pwrite(fd->fd_sys, buf, size, offset); } err = nbytes; - } else { + } else { if (!(((long) buf) % fd->d_mem)) { ADIOI_LUSTRE_Aligned_Mem_File_Read(fd, buf, size, offset, &err); nbytes += err; @@ -115,11 +115,11 @@ static int ADIOI_LUSTRE_Directio(ADIO_File fd, const void *buf, int len, static void ADIOI_LUSTRE_IOContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int io_mode, int *error_code); static void ADIOI_LUSTRE_IOContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int io_mode, int *error_code) { int err=-1; @@ -138,7 +138,7 @@ static void ADIOI_LUSTRE_IOContig(ADIO_File fd, const void *buf, int count, err = lseek(fd->fd_sys, offset, SEEK_SET); if (err == -1) goto ioerr; } - + if (io_mode) { #ifdef ADIOI_MPE_LOGGING MPE_Log_event(ADIOI_MPE_write_a, 0, NULL); @@ -164,7 +164,7 @@ static void ADIOI_LUSTRE_IOContig(ADIO_File fd, const void *buf, int count, fd->fp_sys_posn = offset + err; if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += err; + fd->fp_ind += err; } #ifdef HAVE_STATUS_SET_BYTES @@ -194,7 +194,7 @@ void ADIOI_LUSTRE_WriteContig(ADIO_File fd, const void *buf, int count, offset, status, 1, error_code); } -void ADIOI_LUSTRE_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_LUSTRE_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_wrcoll.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrcoll.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_wrcoll.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrcoll.c index b6bef142c5..c034d42827 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_wrcoll.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrcoll.c @@ -42,7 +42,7 @@ static void ADIOI_LUSTRE_W_Exchange_data(ADIO_File fd, const void *buf, ADIO_Offset *len_list, int *send_size, int *recv_size, ADIO_Offset off, int size, int *count, - int *start_pos, + int *start_pos, int *sent_to_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, @@ -288,7 +288,7 @@ static void ADIOI_LUSTRE_Exch_and_write(ADIO_File fd, const void *buf, int myrank, ADIOI_Access *others_req, ADIOI_Access *my_req, ADIO_Offset *offset_list, - ADIO_Offset *len_list, + ADIO_Offset *len_list, int contig_access_count, int *striping_info, int **buf_idx, int *error_code) @@ -415,10 +415,7 @@ static void ADIOI_LUSTRE_Exch_and_write(ADIO_File fd, const void *buf, ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); if (!buftype_is_contig) { - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) - flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); } MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); /* I need to check if there are any outstanding nonblocking writes to @@ -500,7 +497,7 @@ static void ADIOI_LUSTRE_Exch_and_write(ADIO_File fd, const void *buf, req_len = others_req[i].lens[j]; if (req_off < iter_st_off + max_size) { recv_count[i]++; - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIR_Upint)(write_buf+req_off-off)); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIU_Upint)(write_buf+req_off-off)); MPI_Get_address(write_buf + req_off - off, &(others_req[i].mem_ptrs[j])); recv_size[i] += req_len; @@ -620,7 +617,7 @@ static void ADIOI_LUSTRE_W_Exchange_data(ADIO_File fd, const void *buf, ADIO_Offset *len_list, int *send_size, int *recv_size, ADIO_Offset off, int size, int *count, - int *start_pos, + int *start_pos, int *sent_to_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, @@ -862,7 +859,7 @@ static void ADIOI_LUSTRE_W_Exchange_data(ADIO_File fd, const void *buf, { \ while (size) { \ size_in_buf = ADIOI_MIN(size, flat_buf_sz); \ - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + user_buf_idx)); \ + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + user_buf_idx)); \ ADIOI_Assert(size_in_buf == (size_t)size_in_buf); \ memcpy(&(send_buf[p][send_buf_idx[p]]), \ ((char *) buf) + user_buf_idx, size_in_buf); \ diff --git a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_wrstr.c b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrstr.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_wrstr.c rename to ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrstr.c index 2eec50db2f..ce538d4a6b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_lustre/ad_lustre_wrstr.c +++ b/ompi/mca/io/romio321/romio/adio/ad_lustre/ad_lustre_wrstr.c @@ -209,10 +209,7 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count, /* Different buftype to different filetype */ if (!buftype_is_contig && filetype_is_contig) { /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) - flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + (ADIO_Offset)etype_size * offset; @@ -436,10 +433,7 @@ void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count, } else { /* noncontiguous in memory as well as in file */ - - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; i_offset = flat_buf->indices[0]; diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_nfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_nfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs.c index e69d839046..763a1b4c7e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -37,5 +37,7 @@ struct ADIOI_Fns_struct ADIO_NFS_operations = { ADIOI_NFS_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ ADIOI_NFS_Feature, /* Features */ - "NFS:" /* fsname: just a string */ + "NFS:", /* fsname: just a string */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs.h b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs.h similarity index 82% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs.h rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs.h index a06f9da26d..dd02bf4a2c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs.h @@ -1,16 +1,17 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #ifndef AD_NFS_INCLUDE #define AD_NFS_INCLUDE +#include "adio.h" + #include #include #include -#include "adio.h" #ifdef HAVE_SIGNAL_H #include @@ -18,14 +19,18 @@ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include +#ifdef HAVE_AIO_LITE_H +#include +#else + #ifdef HAVE_AIO_H + #include + #endif + #ifdef HAVE_SYS_AIO_H + #include + #endif #endif -/* Workaround for incomplete set of definitions if __REDIRECT is not +/* Workaround for incomplete set of definitions if __REDIRECT is not defined and large file support is used in aio.h */ #if !defined(__REDIRECT) && defined(__USE_FILE_OFFSET64) #define aiocb aiocb64 @@ -39,32 +44,32 @@ int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, #endif void ADIOI_NFS_Open(ADIO_File fd, int *error_code); -void ADIOI_NFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_NFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); void ADIOI_NFS_WriteContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_NFS_IwriteContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_NFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_NFS_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_NFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); + *error_code); int ADIOI_NFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_NFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); void ADIOI_NFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_NFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void ADIOI_NFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_done.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_done.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_done.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_done.c index 8ebe583570..ff688546ca 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_done.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_done.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,4 +16,4 @@ int ADIOI_NFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code) { return ADIOI_NFS_ReadDone(request, status, error_code); -} +} diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_fcntl.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_fcntl.c index ea06e114c7..c73006e6cd 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -57,7 +57,7 @@ void ADIOI_NFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *er /* --BEGIN ERROR HANDLING-- */ *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_ARG, + MPI_ERR_ARG, "**flag", "**flag %d", flag); return; /* --END ERROR HANDLING-- */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_features.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_features.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_features.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_features.c index a4153e9517..05b061acf4 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_features.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_features.c @@ -8,7 +8,7 @@ #include "ad_nfs.h" int ADIOI_NFS_Feature(ADIO_File fd, int flag) -{ +{ switch(flag) { case ADIO_SHARED_FP: case ADIO_LOCKS: diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_getsh.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_getsh.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_getsh.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_getsh.c index a1f6290638..974d547cc1 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_getsh.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_getsh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,11 +23,11 @@ void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared if (fd->shared_fp_fd == ADIO_FILE_NULL) { MPI_Comm_dup(MPI_COMM_SELF, &dupcommself); fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself, - fd->shared_fp_fname, + fd->shared_fp_fname, fd->file_system, fd->fns, - ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, - 0, MPI_BYTE, MPI_BYTE, MPI_INFO_NULL, + ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, + 0, MPI_BYTE, MPI_BYTE, MPI_INFO_NULL, ADIO_PERM_NULL, error_code); if (*error_code != MPI_SUCCESS) return; *shared_fp = 0; @@ -40,7 +40,7 @@ void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); #endif /* if the file is empty, the above read may return error - (reading beyond end of file). In that case, shared_fp = 0, + (reading beyond end of file). In that case, shared_fp = 0, set above, is the correct value. */ } else { diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_hints.c similarity index 68% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_hints.c index 46480d51d1..0e5386d22b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -9,5 +9,5 @@ void ADIOI_NFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) { - ADIOI_GEN_SetInfo(fd, users_info, error_code); + ADIOI_GEN_SetInfo(fd, users_info, error_code); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_iread.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_iread.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_iread.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_iread.c index 2b4e19907c..28d2028105 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_iread.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_iread.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -8,10 +8,10 @@ #ifdef ROMIO_HAVE_WORKING_AIO /* nearly identical to ADIOI_GEN_IreadContig, except we lock around I/O */ -void ADIOI_NFS_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_NFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, - int *error_code) + int *error_code) { MPI_Count len, typesize; int aio_errno = 0; diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_iwrite.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_iwrite.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_iwrite.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_iwrite.c index c0fff5c4cb..a5f988cf20 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_iwrite.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_iwrite.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,9 +16,9 @@ static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; /* this routine is nearly identical to ADIOI_GEN_IwriteContig, except we lock * around I/O */ -void ADIOI_NFS_IwriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_NFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code) + ADIO_Offset offset, ADIO_Request *request, int *error_code) { MPI_Count len, typesize; int aio_errno = 0; @@ -69,19 +69,19 @@ int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, aiocbp->aio_buf = buf; aiocbp->aio_nbytes = len; -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE +#ifdef HAVE_STRUCT_AIOCB_AIO_WHENCE aiocbp->aio_whence = SEEK_SET; #endif -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES +#ifdef HAVE_STRUCT_AIOCB_AIO_FILDES aiocbp->aio_fildes = fd_sys; #endif -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT +#ifdef HAVE_STRUCT_AIOCB_AIO_SIGEVENT # ifdef AIO_SIGNOTIFY_NONE aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE; # endif aiocbp->aio_sigevent.sigev_signo = 0; #endif -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO +#ifdef HAVE_STRUCT_AIOCB_AIO_REQPRIO # ifdef AIO_PRIO_DFL aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */ # else @@ -118,9 +118,9 @@ int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, } aio_req->aiocbp = aiocbp; if (ADIOI_GEN_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, - ADIOI_GEN_aio_free_fn, MPIU_Greq_cancel_fn, - ADIOI_GEN_aio_poll_fn, ADIOI_GEN_aio_wait_fn, + MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, + ADIOI_GEN_aio_free_fn, MPIU_Greq_cancel_fn, + ADIOI_GEN_aio_poll_fn, ADIOI_GEN_aio_wait_fn, &ADIOI_GEN_greq_class); } MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, aio_req, request); diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_open.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_open.c index d2ae6b22f1..d8763292b9 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -19,7 +19,7 @@ void ADIOI_NFS_Open(ADIO_File fd, int *error_code) perm = old_mask ^ 0666; } else perm = fd->perm; - + amode = 0; if (fd->access_mode & ADIO_CREATE) amode = amode | O_CREAT; diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_read.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_read.c index 8e76dd4c27..6dce289311 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_read.c @@ -1,74 +1,85 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_nfs.h" #include "adio_extern.h" -#ifdef HAVE_UNISTD_H -#include -#endif -void ADIOI_NFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_NFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { - ssize_t err=-1; + int err=-1; MPI_Count datatype_size, len; - ADIO_Offset bytes_xfered=0; - size_t rd_count; static char myname[] = "ADIOI_NFS_READCONTIG"; - char *p; MPI_Type_size_x(datatype, &datatype_size); len = datatype_size * count; - if (file_ptr_type == ADIO_INDIVIDUAL) { - offset = fd->fp_ind; - } - - p = buf; - while (bytes_xfered < len ) { - rd_count = len - bytes_xfered; - /* FreeBSD and Darwin workaround: bigger than INT_MAX is an error */ - if (rd_count > INT_MAX) - rd_count = INT_MAX; + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { + if (fd->fp_sys_posn != offset) { +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); +#endif + lseek(fd->fd_sys, offset, SEEK_SET); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); +#endif + } if (fd->atomicity) - ADIOI_WRITE_LOCK(fd, offset+bytes_xfered, SEEK_SET, rd_count); - else ADIOI_READ_LOCK(fd, offset+bytes_xfered, SEEK_SET, rd_count); + ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); + else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); #endif - err = pread(fd->fd_sys, p, rd_count, offset+bytes_xfered); - /* --BEGIN ERROR HANDLING-- */ - if (err == -1) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, - "**io", "**io %s", strerror(errno)); - } - /* --END ERROR HANDLING-- */ + err = read(fd->fd_sys, buf, len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); #endif - ADIOI_UNLOCK(fd, offset+bytes_xfered, SEEK_SET, rd_count); - if (err == 0) { - /* end of file */ - break; + ADIOI_UNLOCK(fd, offset, SEEK_SET, len); + fd->fp_sys_posn = offset + err; + /* individual file pointer not updated */ + } + else { /* read from curr. location of ind. file pointer */ + offset = fd->fp_ind; + if (fd->fp_sys_posn != fd->fp_ind) { +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); +#endif + lseek(fd->fd_sys, fd->fp_ind, SEEK_SET); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); +#endif } - bytes_xfered += err; - p += err; + if (fd->atomicity) + ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); + else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); +#endif + err = read(fd->fd_sys, buf, len); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); +#endif + ADIOI_UNLOCK(fd, offset, SEEK_SET, len); + fd->fp_ind += err; + fd->fp_sys_posn = fd->fp_ind; } - fd->fp_sys_posn = offset + bytes_xfered; - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += bytes_xfered; + /* --BEGIN ERROR HANDLING-- */ + if (err == -1) { + *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, + myname, __LINE__, MPI_ERR_IO, + "**io", "**io %s", strerror(errno)); + return; } /* --END ERROR HANDLING-- */ #ifdef HAVE_STATUS_SET_BYTES - if (err != -1) MPIR_Status_set_bytes(status, datatype, bytes_xfered); + MPIR_Status_set_bytes(status, datatype, err); #endif *error_code = MPI_SUCCESS; @@ -164,7 +175,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, ADIO_Offset abs_off_in_filetype=0; int req_len, partial_read; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, lb; + MPI_Aint filetype_extent, buftype_extent, lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off; ADIO_Offset off, req_off, disp, end_offset=0, readbuf_off, start_off; @@ -183,7 +194,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -197,7 +208,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, /* get max_bufsize from the info object. */ value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "ind_rd_buffer_size", MPI_MAX_INFO_VAL, value, + ADIOI_Info_get(fd->info, "ind_rd_buffer_size", MPI_MAX_INFO_VAL, value, &info_flag); max_bufsize = atoi(value); ADIOI_Free(value); @@ -206,11 +217,9 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + etype_size * offset; start_off = off; @@ -241,7 +250,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len); if (err == -1) err_flag = 1; - for (j=0; jcount; i++) { userbuf_off = j*buftype_extent + flat_buf->indices[i]; req_off = off; @@ -279,7 +288,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = (offset - flat_file->indices[0]) / filetype_extent; offset -= (ADIO_Offset)n_filetypes * filetype_extent; /* now offset is local to this extent */ - + /* find the block where offset is located, skip blocklens[i]==0 */ for (i=0; icount; i++) { ADIO_Offset dist; @@ -292,7 +301,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, frd_size = flat_file->blocklens[i]; break; } - if (dist > 0 ) { + if (dist > 0 ) { frd_size = dist; break; } @@ -305,7 +314,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -319,7 +328,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, } /* abs. offset in bytes in the file */ - offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + + offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype; } @@ -333,7 +342,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, offset, status, error_code); if (file_ptr_type == ADIO_INDIVIDUAL) { - /* update MPI-IO file pointer to point to the first byte that + /* update MPI-IO file pointer to point to the first byte that * can be accessed in the fileview. */ fd->fp_ind = offset + bufsize; if (bufsize == frd_size) { @@ -348,10 +357,10 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, + n_filetypes*filetype_extent; } } - fd->fp_sys_posn = -1; /* set it to null. */ + fd->fp_sys_posn = -1; /* set it to null. */ #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -#endif +#endif return; } @@ -417,9 +426,9 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = st_n_filetypes; frd_size = ADIOI_MIN(st_frd_size, bufsize); while (i < bufsize) { - if (frd_size) { - /* TYPE_UB and TYPE_LB can result in - frd_size = 0. save system call in such cases */ + if (frd_size) { + /* TYPE_UB and TYPE_LB can result in + frd_size = 0. save system call in such cases */ /* lseek(fd->fd_sys, off, SEEK_SET); err = read(fd->fd_sys, ((char *) buf) + i, frd_size);*/ @@ -442,7 +451,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i); } @@ -452,9 +461,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, /* noncontiguous in memory as well as in file */ ADIO_Offset i; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; i = flat_buf->indices[0]; @@ -487,7 +494,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; new_frd_size = flat_file->blocklens[j]; @@ -515,7 +522,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, brd_size = new_brd_size; } } - + if (fd->atomicity) ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); @@ -536,8 +543,8 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually read and placed in buf +/* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually read and placed in buf by ADIOI_BUFFERED_READ. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_resize.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_resize.c index 957b5bd809..d86dfcc77e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_setsh.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_setsh.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_setsh.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_setsh.c index f0f79379d0..42e558cb47 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_setsh.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_setsh.c @@ -1,17 +1,17 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_nfs.h" -/* set the shared file pointer to "offset" etypes relative to the current +/* set the shared file pointer to "offset" etypes relative to the current view */ /* -This looks very similar to ADIOI_GEN_Set_shared_fp, except this +This looks very similar to ADIOI_GEN_Set_shared_fp, except this function avoids locking the file twice. The generic version does Write lock @@ -24,7 +24,7 @@ caching. To avoid the lock being called twice, this version for NFS does Write lock Lseek Write -Unlock +Unlock */ @@ -37,10 +37,10 @@ void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code) if (fd->shared_fp_fd == ADIO_FILE_NULL) { MPI_Comm_dup(MPI_COMM_SELF, &dupcommself); fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself, - fd->shared_fp_fname, + fd->shared_fp_fname, fd->file_system, fd->fns, - ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, - 0, MPI_BYTE, MPI_BYTE, MPI_INFO_NULL, + ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, + 0, MPI_BYTE, MPI_BYTE, MPI_INFO_NULL, ADIO_PERM_NULL, error_code); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_wait.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_wait.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_wait.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_wait.c index 218ac5d14b..e1037fc551 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_wait.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_wait.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_write.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_write.c index 794c06c488..06dca92ef8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_nfs/ad_nfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_nfs/ad_nfs_write.c @@ -1,70 +1,82 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_nfs.h" #include "adio_extern.h" -#ifdef HAVE_UNISTD_H -#include -#endif void ADIOI_NFS_WriteContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { - ssize_t err=-1; + int err=-1; MPI_Count datatype_size, len; - ADIO_Offset bytes_xfered=0; - size_t wr_count; static char myname[] = "ADIOI_NFS_WRITECONTIG"; - char *p; MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * (ADIO_Offset)count; + len = datatype_size * count; - if (file_ptr_type == ADIO_INDIVIDUAL) { - offset = fd->fp_ind; - } - - p = (char *)buf; - while (bytes_xfered < len) { + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { + if (fd->fp_sys_posn != offset) { +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); +#endif + lseek(fd->fd_sys, offset, SEEK_SET); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); +#endif + } + ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - wr_count = len - bytes_xfered; - /* work around FreeBSD and OS X defects*/ - if (wr_count > INT_MAX) - wr_count = INT_MAX; - - ADIOI_WRITE_LOCK(fd, offset+bytes_xfered, SEEK_SET, wr_count); - err = pwrite(fd->fd_sys, p, wr_count, offset+bytes_xfered); - /* --BEGIN ERROR HANDLING-- */ - if (err == -1) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, "**io", - "**io %s", strerror(errno)); - fd->fp_sys_posn = -1; - return; - } - /* --END ERROR HANDLING-- */ + err = write(fd->fd_sys, buf, len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); #endif - ADIOI_UNLOCK(fd, offset+bytes_xfered, SEEK_SET, wr_count); - bytes_xfered += err; - p += err; + ADIOI_UNLOCK(fd, offset, SEEK_SET, len); + fd->fp_sys_posn = offset + err; + /* individual file pointer not updated */ + } + else { /* write from curr. location of ind. file pointer */ + offset = fd->fp_ind; + if (fd->fp_sys_posn != fd->fp_ind) { +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); +#endif + lseek(fd->fd_sys, fd->fp_ind, SEEK_SET); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); +#endif + } + ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); +#endif + err = write(fd->fd_sys, buf, len); +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); +#endif + ADIOI_UNLOCK(fd, offset, SEEK_SET, len); + fd->fp_ind += err; + fd->fp_sys_posn = fd->fp_ind; } - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += bytes_xfered; + /* --BEGIN ERROR HANDLING-- */ + if (err == -1) { + *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, + myname, __LINE__, MPI_ERR_IO, + "**io", + "**io %s", strerror(errno)); + return; } + /* --END ERROR HANDLING-- */ #ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, bytes_xfered); + MPIR_Status_set_bytes(status, datatype, err); #endif *error_code = MPI_SUCCESS; @@ -267,7 +279,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, ADIO_Offset abs_off_in_filetype=0; int req_len; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, lb; + MPI_Aint filetype_extent, buftype_extent, lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off; ADIO_Offset off, req_off, disp, end_offset=0, writebuf_off, start_off; @@ -285,7 +297,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -299,7 +311,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, /* get max_bufsize from the info object. */ value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "ind_wr_buffer_size", MPI_MAX_INFO_VAL, value, + ADIOI_Info_get(fd->info, "ind_wr_buffer_size", MPI_MAX_INFO_VAL, value, &info_flag); max_bufsize = atoi(value); ADIOI_Free(value); @@ -308,11 +320,9 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + etype_size * offset; start_off = off; @@ -322,10 +332,10 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1)); /* if atomicity is true, lock the region to be accessed */ - if (fd->atomicity) + if (fd->atomicity) ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - for (j=0; jcount; i++) { userbuf_off = j*buftype_extent + flat_buf->indices[i]; req_off = off; @@ -338,7 +348,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); #endif - lseek(fd->fd_sys, writebuf_off, SEEK_SET); + lseek(fd->fd_sys, writebuf_off, SEEK_SET); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); #endif @@ -346,14 +356,14 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - err = write(fd->fd_sys, writebuf, writebuf_len); + err = write(fd->fd_sys, writebuf, writebuf_len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); #endif if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); - if (err == -1) err_flag = 1; + if (err == -1) err_flag = 1; - if (fd->atomicity) + if (fd->atomicity) ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; @@ -405,7 +415,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -419,7 +429,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, } /* abs. offset in bytes in the file */ - offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + + offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype; } @@ -432,7 +442,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, offset, status, error_code); if (file_ptr_type == ADIO_INDIVIDUAL) { - /* update MPI-IO file pointer to point to the first byte + /* update MPI-IO file pointer to point to the first byte * that can be accessed in the fileview. */ fd->fp_ind = offset + bufsize; if (bufsize == fwr_size) { @@ -447,10 +457,10 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, + (ADIO_Offset)n_filetypes*filetype_extent; } } - fd->fp_sys_posn = -1; /* set it to null. */ + fd->fp_sys_posn = -1; /* set it to null. */ #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -#endif +#endif return; } @@ -473,13 +483,13 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i); } /* if atomicity is true, lock the region to be accessed */ - if (fd->atomicity) + if (fd->atomicity) ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); /* initial read for the read-modify-write */ @@ -490,14 +500,14 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); #endif - lseek(fd->fd_sys, writebuf_off, SEEK_SET); + lseek(fd->fd_sys, writebuf_off, SEEK_SET); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); #endif #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); #endif - err = read(fd->fd_sys, writebuf, writebuf_len); + err = read(fd->fd_sys, writebuf, writebuf_len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); #endif @@ -521,9 +531,9 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes = st_n_filetypes; fwr_size = ADIOI_MIN(st_fwr_size, bufsize); while (i < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ + if (fwr_size) { + /* TYPE_UB and TYPE_LB can result in + fwr_size = 0. save system call in such cases */ /* lseek(fd->fd_sys, off, SEEK_SET); err = write(fd->fd_sys, ((char *) buf) + i, fwr_size);*/ @@ -546,7 +556,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i); } @@ -555,10 +565,8 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, else { /* noncontiguous in memory as well as in file */ - ADIO_Offset i; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + ADIO_Offset i; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; i = flat_buf->indices[0]; @@ -592,7 +600,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; new_fwr_size = flat_file->blocklens[j]; @@ -621,11 +629,11 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, } } - /* write the buffer out finally */ + /* write the buffer out finally */ #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); #endif - lseek(fd->fd_sys, writebuf_off, SEEK_SET); + lseek(fd->fd_sys, writebuf_off, SEEK_SET); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); #endif @@ -633,7 +641,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - err = write(fd->fd_sys, writebuf, writebuf_len); + err = write(fd->fd_sys, writebuf, writebuf_len); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); #endif @@ -642,7 +650,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); else ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - if (err == -1) err_flag = 1; + if (err == -1) err_flag = 1; if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; if (err_flag) { @@ -658,7 +666,7 @@ void ADIOI_NFS_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs.c index 823596e95e..9788274121 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -34,5 +34,7 @@ struct ADIOI_Fns_struct ADIO_NTFS_operations = { ADIOI_NTFS_Flush, /* Flush */ ADIOI_NTFS_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ - ADIOI_NTFS_Feature /* Features */ + ADIOI_NTFS_Feature, /* Features */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs.h b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs.h similarity index 85% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs.h rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs.h index 2f9945971b..aed6168bd8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs.h @@ -1,8 +1,8 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -28,32 +28,32 @@ int ADIOI_NTFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, void ADIOI_NTFS_Open(ADIO_File fd, int *error_code); void ADIOI_NTFS_Close(ADIO_File fd, int *error_code); -void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_NTFS_IwriteContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_NTFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_NTFS_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_NTFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); + *error_code); int ADIOI_NTFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_NTFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); void ADIOI_NTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_NTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void ADIOI_NTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_NTFS_IwriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_close.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_close.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_close.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_close.c index 8a0d4d3a90..95022dca77 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_close.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_done.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_done.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_done.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_done.c index c5edb68395..9f4967b48b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_done.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_done.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_fcntl.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_fcntl.c index 721709a505..4c7d66cd07 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_fcntl.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,7 +17,7 @@ void ADIOI_NTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *e { case ADIO_FCNTL_GET_FSIZE: fcntl_struct->fsize = SetFilePointer(fd->fd_sys, 0, 0, FILE_END); - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) { dwTemp = DWORDHIGH(fd->fp_sys_posn); if (SetFilePointer(fd->fd_sys, DWORDLOW(fd->fp_sys_posn), &dwTemp, FILE_BEGIN) == INVALID_SET_FILE_POINTER) diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_feature.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_feature.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_feature.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_feature.c diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_flush.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_flush.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_flush.c index 8dcfa20866..7656d60fb6 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_iread.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_iread.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_iread.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_iread.c index ff8f7c1b58..845401ad44 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_iread.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_iread.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_ntfs.h" -void ADIOI_NTFS_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_NTFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code) + ADIO_Offset offset, ADIO_Request *request, int *error_code) { MPI_Count len, typesize; int err; diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_iwrite.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_iwrite.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_iwrite.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_iwrite.c index 73216ddf8c..40a567e564 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_iwrite.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_iwrite.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -12,7 +12,7 @@ static MPIX_Grequest_class ADIOI_NTFS_greq_class = 0; -/* Fills the input buffer, errMsg, with the error message +/* Fills the input buffer, errMsg, with the error message corresponding to error code, error */ void ADIOI_NTFS_Strerror(int error, char *errMsg, int errMsgLen) { @@ -44,20 +44,20 @@ int ADIOI_NTFS_aio_poll_fn(void *extra_state, MPI_Status *status) ADIOI_AIO_Request *aio_req; int mpi_errno = MPI_SUCCESS; - /* FIXME: Validate the args -- has it already been done by the + /* FIXME: Validate the args -- has it already been done by the caller ? */ aio_req = (ADIOI_AIO_Request *)extra_state; - + /* XXX: test for AIO completion here */ - if(!GetOverlappedResult( aio_req->fd, aio_req->lpOvl, + if(!GetOverlappedResult( aio_req->fd, aio_req->lpOvl, &(aio_req->nbytes), FALSE)){ if(GetLastError() == ERROR_IO_INCOMPLETE){ /* IO in progress */ /* TODO: need to diddle with status somehow */ }else{ /* Error occured */ - /* TODO: unsure how to handle this */ + /* TODO: unsure how to handle this */ } }else{ mpi_errno = MPI_Grequest_complete(aio_req->req); @@ -82,7 +82,7 @@ int ADIOI_NTFS_aio_wait_fn(int count, void **array_of_states, LPHANDLE lpHandles; DWORD retObject=0; - /* FIXME: Validate the args -- has it already been done by the + /* FIXME: Validate the args -- has it already been done by the caller ? */ aio_reqlist = (ADIOI_AIO_Request **)array_of_states; lpHandles = (LPHANDLE) ADIOI_Calloc(count, sizeof(HANDLE)); @@ -101,12 +101,12 @@ int ADIOI_NTFS_aio_wait_fn(int count, void **array_of_states, /* XXX: wait for one request to complete */ /* FIXME: Is the timeout in seconds ? */ timeout = (timeout <= 0) ? INFINITE : (timeout * 1000); - + if((retObject = WaitForMultipleObjects(count, lpHandles, FALSE, timeout)) != WAIT_FAILED){ retObject = retObject - WAIT_OBJECT_0; - if(GetOverlappedResult( aio_reqlist[retObject]->fd, - aio_reqlist[retObject]->lpOvl, &(aio_reqlist[retObject]->nbytes), + if(GetOverlappedResult( aio_reqlist[retObject]->fd, + aio_reqlist[retObject]->lpOvl, &(aio_reqlist[retObject]->nbytes), FALSE)){ /* XXX: mark completed requests as 'done'*/ mpi_errno = MPI_Grequest_complete(aio_reqlist[retObject]->req); @@ -123,7 +123,7 @@ int ADIOI_NTFS_aio_wait_fn(int count, void **array_of_states, /* TODO: need to diddle with status somehow */ }else{ /* Error occured */ - /* TODO: not sure how to handle this */ + /* TODO: not sure how to handle this */ } } }else{ @@ -133,43 +133,43 @@ int ADIOI_NTFS_aio_wait_fn(int count, void **array_of_states, return mpi_errno; } -int ADIOI_NTFS_aio_query_fn(void *extra_state, MPI_Status *status) +int ADIOI_NTFS_aio_query_fn(void *extra_state, MPI_Status *status) { ADIOI_AIO_Request *aio_req; aio_req = (ADIOI_AIO_Request *)extra_state; - MPI_Status_set_elements(status, MPI_BYTE, aio_req->nbytes); + MPI_Status_set_elements(status, MPI_BYTE, aio_req->nbytes); - /* can never cancel so always true */ - MPI_Status_set_cancelled(status, 0); + /* can never cancel so always true */ + MPI_Status_set_cancelled(status, 0); - /* choose not to return a value for this */ - status->MPI_SOURCE = MPI_UNDEFINED; - /* tag has no meaning for this generalized request */ - status->MPI_TAG = MPI_UNDEFINED; - /* this generalized request never fails */ - return MPI_SUCCESS; + /* choose not to return a value for this */ + status->MPI_SOURCE = MPI_UNDEFINED; + /* tag has no meaning for this generalized request */ + status->MPI_TAG = MPI_UNDEFINED; + /* this generalized request never fails */ + return MPI_SUCCESS; } int ADIOI_NTFS_aio_free_fn(void *extra_state) { ADIOI_AIO_Request *aio_req; - /* FIXME: Validate the args -- has it already been done by the + /* FIXME: Validate the args -- has it already been done by the caller ? */ aio_req = (ADIOI_AIO_Request*)extra_state; CloseHandle(aio_req->lpOvl->hEvent); ADIOI_Free(aio_req->lpOvl); ADIOI_Free(aio_req); - return MPI_SUCCESS; + return MPI_SUCCESS; } -void ADIOI_NTFS_IwriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_NTFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, - int *error_code) + int *error_code) { MPI_Count len, typesize; int err; @@ -255,7 +255,7 @@ int ADIOI_NTFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, aio_req->lpOvl->Offset = DWORDLOW(offset); aio_req->lpOvl->OffsetHigh = DWORDHIGH(offset); aio_req->fd = fd_sys; - + /* XXX: initiate async I/O */ if (wr) { @@ -267,7 +267,7 @@ int ADIOI_NTFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, } /* --BEGIN ERROR HANDLING-- */ - if (ret_val == FALSE) + if (ret_val == FALSE) { mpi_errno = GetLastError(); if (mpi_errno != ERROR_IO_PENDING) diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_open.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_open.c index 2b41ad2ff6..3a49418dba 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_open.c @@ -1,8 +1,8 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -57,12 +57,12 @@ void ADIOI_NTFS_Open(ADIO_File fd, int *error_code) attrib = attrib | FILE_FLAG_RANDOM_ACCESS; } - fd->fd_sys = CreateFile(fd->filename, + fd->fd_sys = CreateFile(fd->filename, amode, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - NULL, - cmode, - attrib, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + cmode, + attrib, NULL); fd->fd_direct = -1; diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_read.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_read.c index 3ffd58cbe4..7c55c1bc37 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_read.c @@ -1,12 +1,12 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_ntfs.h" -void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -140,7 +140,7 @@ void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count, ADIOI_Free(pOvl); fd->fp_sys_posn = offset + (ADIO_Offset)dwNumRead; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { @@ -231,9 +231,9 @@ void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count, } ADIOI_Free(pOvl); - fd->fp_ind = fd->fp_ind + (ADIO_Offset)dwNumRead; + fd->fp_ind = fd->fp_ind + (ADIO_Offset)dwNumRead; fd->fp_sys_posn = fd->fp_ind; - } + } #ifdef HAVE_STATUS_SET_BYTES if (err != FALSE) diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_resize.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_resize.c index 3f2ff58495..0fbeaaf972 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_wait.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_wait.c similarity index 81% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_wait.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_wait.c index dd40a1bf68..80dfa4d334 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_wait.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_wait.c @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_ntfs.h" void ADIOI_NTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code) + int *error_code) { return; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_write.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_write.c index 291de17b46..389e866936 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ntfs/ad_ntfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ntfs/ad_ntfs_write.c @@ -1,12 +1,12 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_ntfs.h" -void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -16,7 +16,7 @@ void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count, DWORD dwNumWritten = 0; MPI_Count err=-1, datatype_size, len; OVERLAPPED *pOvl; - + /* If file pointer type in ADIO_INDIVIDUAL then offset should be ignored and the current location of file pointer should be used */ if(file_ptr_type == ADIO_INDIVIDUAL){ @@ -121,7 +121,7 @@ void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count, ADIOI_Free(pOvl); fd->fp_sys_posn = offset + dwNumWritten; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_panfs/Makefile.mk similarity index 68% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_panfs/Makefile.mk index 68e92d5e91..ad412d9bb0 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/Makefile.mk +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/Makefile.mk @@ -5,13 +5,20 @@ ## See COPYRIGHT in top-level directory. ## +if BUILD_PANFS_OPEN6 +# override open with one that uses newer features +panfs_open = adio/ad_panfs/ad_panfs_open6.c +else +panfs_open = adio/ad_panfs/ad_panfs_open.c +endif + if BUILD_AD_PANFS noinst_HEADERS += adio/ad_panfs/ad_panfs.h romio_other_sources += \ adio/ad_panfs/ad_panfs.c \ - adio/ad_panfs/ad_panfs_open.c \ + $(panfs_open) \ adio/ad_panfs/ad_panfs_hints.c \ adio/ad_panfs/ad_panfs_read.c \ adio/ad_panfs/ad_panfs_resize.c \ diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs.c similarity index 76% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs.c rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs.c index 6b2b13a326..8bc14fccdf 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * ad_panfs.c * * Copyright (C) 2001 University of Chicago. @@ -11,8 +11,18 @@ /* adioi.h has the ADIOI_Fns_struct define */ #include "adioi.h" +#ifndef ROMIOCONF_H_INCLUDED +#include "romioconf.h" +#define ROMIOCONF_H_INCLUDED +#endif + + struct ADIOI_Fns_struct ADIO_PANFS_operations = { - ADIOI_PANFS_Open, /* Open */ +#ifdef HAVE_PAN_FS_CLIENT_RAIDN_ENCODING_T + ADIOI_PANFS_Open6, /* Open, using newer Panasas features */ +#else + ADIOI_PANFS_Open, /* open, but using Panasas5 and earlier features */ +#endif ADIOI_GEN_OpenColl, ADIOI_PANFS_ReadContig, /* ReadContig */ ADIOI_PANFS_WriteContig, /* WriteContig */ @@ -41,5 +51,7 @@ struct ADIOI_Fns_struct ADIO_PANFS_operations = { ADIOI_PANFS_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ ADIOI_GEN_Feature, - "PANFS: Panasas PanFS" + "PANFS: Panasas PanFS", + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs.h b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs.h similarity index 76% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs.h rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs.h index 4ccc73cb77..31a0f3d8a8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs.h @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * ad_panfs.h * * Copyright (C) 2001 University of Chicago. @@ -15,19 +15,27 @@ #include "adio.h" #ifndef NO_AIO -#ifdef AIO_SUN -#include -#else -#include -#ifdef NEEDS_ADIOCB_T -typedef struct adiocb adiocb_t; -#endif -#endif +# ifdef AIO_SUN +# include +# else + #ifdef HAVE_AIO_LITE_H + #include + #else + #ifdef HAVE_AIO_H + #include + #endif + #ifdef HAVE_SYS_AIO_H + #include + #endif + #endif +# endif #endif void ADIOI_PANFS_Open(ADIO_File fd, int *error_code); +/* Panasas 6 introduced some new features */ +void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code); void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_hints.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_hints.c index 93ec230347..94178ab0cf 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_hints.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * ad_panfs_hints.c * * Copyright (C) 2001 University of Chicago. @@ -20,15 +20,15 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) *error_code = MPI_SUCCESS; if (fd->info == MPI_INFO_NULL) { - /* This must be part of the open call. can set striping parameters - * if necessary. - */ + /* This must be part of the open call. can set striping parameters + * if necessary. + */ MPI_Info_create(&(fd->info)); /* anticipate concurrent writes in an MPI-IO application */ ADIOI_Info_set (fd->info, "panfs_concurrent_write", "1"); - /* has user specified striping parameters + /* has user specified striping parameters and do they have the same value on all processes? */ if (users_info != MPI_INFO_NULL) { @@ -61,7 +61,7 @@ void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) } } - ADIOI_GEN_SetInfo(fd, users_info, &gen_error_code); + ADIOI_GEN_SetInfo(fd, users_info, &gen_error_code); /* If this function is successful, use the error code returned from ADIOI_GEN_SetInfo * otherwise use the error_code generated by this function */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_open.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_open.c index d2e3d8dd40..d5374ebf44 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_open.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * ad_panfs_open.c * * Copyright (C) 2001 University of Chicago. @@ -30,7 +30,7 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) pan_fs_client_layout_agg_type_t layout_type = PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT; unsigned long int layout_stripe_unit = 0; unsigned long int layout_parity_stripe_width = 0; - unsigned long int layout_parity_stripe_depth = 0; + unsigned long int layout_parity_stripe_depth = 0; unsigned long int layout_total_num_comps = 0; pan_fs_client_layout_visit_t layout_visit_policy = PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN; int myrank; @@ -39,32 +39,32 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) *error_code = MPI_SUCCESS; value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "panfs_layout_type", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_layout_type", MPI_MAX_INFO_VAL, value, &flag); if (flag) { layout_type = strtoul(value,NULL,10); } - ADIOI_Info_get(fd->info, "panfs_layout_stripe_unit", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_layout_stripe_unit", MPI_MAX_INFO_VAL, value, &flag); if (flag) { layout_stripe_unit = strtoul(value,NULL,10); } - ADIOI_Info_get(fd->info, "panfs_layout_total_num_comps", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_layout_total_num_comps", MPI_MAX_INFO_VAL, value, &flag); if (flag) { layout_total_num_comps = strtoul(value,NULL,10); } - ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_width", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_width", MPI_MAX_INFO_VAL, value, &flag); if (flag) { layout_parity_stripe_width = strtoul(value,NULL,10); } - ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_depth", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_depth", MPI_MAX_INFO_VAL, value, &flag); if (flag) { layout_parity_stripe_depth = strtoul(value,NULL,10); } - ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL, value, &flag); if (flag) { layout_visit_policy = strtoul(value,NULL,10); @@ -145,13 +145,13 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) MPI_Abort(MPI_COMM_WORLD, 1); } } - /* Create the file via ioctl() or open(). ADIOI_PANFS_Open's caller + /* Create the file via ioctl() or open(). ADIOI_PANFS_Open's caller * already optimizes performance by only calling this function with - * ADIO_CREATE on rank 0. Therefore, we don't need to worry about + * ADIO_CREATE on rank 0. Therefore, we don't need to worry about * implementing that optimization here. */ - if((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) + if((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)) { - pan_fs_client_layout_create_args_t file_create_args; + pan_fs_client_layout_create_args_t file_create_args; int fd_dir; char* slash; struct stat stat_buf; @@ -185,7 +185,7 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) if (!slash) ADIOI_Strncpy(path, ".", 2); else { - if (slash == path) + if (slash == path) *(path + 1) = '\0'; else *slash = '\0'; } @@ -210,7 +210,7 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) file_create_args.mode = perm; file_create_args.version = PAN_FS_CLIENT_LAYOUT_VERSION; file_create_args.flags = PAN_FS_CLIENT_LAYOUT_CREATE_F__NONE; - ADIOI_Strncpy(file_create_args.filename, file_name_ptr, strlen(fd->filename)+1); + ADIOI_Strncpy(file_create_args.filename, file_name_ptr, strlen(fd->filename)+1); file_create_args.layout.agg_type = layout_type; file_create_args.layout.layout_is_valid = 1; if(layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) @@ -266,7 +266,7 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) amode = amode | O_EXCL; value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "panfs_concurrent_write", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "panfs_concurrent_write", MPI_MAX_INFO_VAL, value, &flag); if (flag) { unsigned long int concurrent_write = strtoul(value,NULL,10); @@ -293,7 +293,7 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code) /* Error - set layout type to unknown */ ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID"); } - else + else { ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.agg_type); ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer); diff --git a/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_open6.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_open6.c new file mode 100644 index 0000000000..6906ff08d7 --- /dev/null +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_open6.c @@ -0,0 +1,440 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * ad_panfs_open.c + * + * Copyright (C) 2001 University of Chicago. + * See COPYRIGHT notice in top-level directory. + */ + +#include "ad_panfs.h" +#include +#include +#define TEMP_BUFFER_SIZE 64 + +void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code) +{ + char *value; + int perm, old_mask, amode, flag; + static char myname[] = "ADIOI_PANFS_OPEN6"; + + if (fd->perm == ADIO_PERM_NULL) { + old_mask = umask(022); + umask(old_mask); + perm = ~old_mask & 0666; + } + else + perm = fd->perm; + + amode = 0; + if (fd->access_mode & ADIO_CREATE) { + pan_fs_client_layout_agg_type_t layout_type = PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT; + unsigned long int layout_stripe_unit = 0; + unsigned long int layout_parity_stripe_width = 0; + unsigned long int layout_parity_stripe_depth = 0; + unsigned long int layout_total_num_comps = 0; + unsigned long int layout_max_faults = 2; + pan_fs_client_layout_visit_t layout_visit_policy = PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN; + pan_fs_client_raidn_encoding_t layout_encoding = PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS; + int myrank; + + MPI_Comm_rank(fd->comm, &myrank); + + *error_code = MPI_SUCCESS; + value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char)); + ADIOI_Info_get(fd->info, "panfs_layout_type", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + layout_type = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_stripe_unit", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + layout_stripe_unit = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_total_num_comps", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + layout_total_num_comps = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_width", MPI_MAX_INFO_VAL, + value, &flag); + if (flag) { + layout_parity_stripe_width = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_depth", MPI_MAX_INFO_VAL, + value, &flag); + if (flag) { + layout_parity_stripe_depth = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_max_faults", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + layout_max_faults = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + layout_visit_policy = strtoul(value, NULL, 10); + } + ADIOI_Info_get(fd->info, "panfs_layout_encoding", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + layout_encoding = strtoul(value, NULL, 10); + } + ADIOI_Free(value); + + amode = amode | O_CREAT; + /* Check for valid set of hints + * + * Note that RAID0 has been dropped. In the event PAN_FS_CLIENT_LAYOUT_TYPE__RAID0 + * enumeraion no longer exists, the following check will still be correct. + * + * The enumerations looks as follows: + * + * enum pan_fs_client_layout_agg_type_e { + * PAN_FS_CLIENT_LAYOUT_TYPE__INVALID = 0, - *INVALID + * PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT = 1, - VALID + * PAN_FS_CLIENT_LAYOUT_TYPE__RAID0 = 2, - *INVALID + * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE = 3, - VALID + * PAN_FS_CLIENT_LAYOUT_TYPE__RAID10 = 4, - VALID + * PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE = 5 - VALID + * }; + */ + if (((layout_type < PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) && + (layout_type != PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT)) || + (layout_type > PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE)) { + FPRINTF(stderr, "%s: panfs_layout_type is not a valid value: %u.\n", myname, + layout_type); + MPI_Abort(MPI_COMM_WORLD, 1); + } + if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE) { + if ((layout_stripe_unit == 0) || + (layout_parity_stripe_width == 0) || + (layout_parity_stripe_depth == 0) || (layout_total_num_comps == 0)) { + if (layout_stripe_unit == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_total_num_comps == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_parity_stripe_width == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_parity_stripe_depth == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + MPI_Abort(MPI_COMM_WORLD, 1); + } + /* as of 6.0.x release, we only support max_faults == 2 */ + if (layout_max_faults != 2) { + FPRINTF(stderr, + "%s: panfs_layout_max_faults is not a valid value. Setting default of 2\n", + myname); + layout_max_faults = 2; + } + /* as of 6.0.x release, we only support RS enconding */ + if (layout_encoding != PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS) { + FPRINTF(stderr, + "%s: panfs_layout_encoding is not a valid value: %u. Setting to default of %u\n", + myname, layout_encoding, PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS); + layout_encoding = PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS; + } + } + if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) { + if ((layout_stripe_unit == 0) || + (layout_parity_stripe_width == 0) || + (layout_parity_stripe_depth == 0) || (layout_total_num_comps == 0)) { + if (layout_stripe_unit == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_total_num_comps == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_parity_stripe_width == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_parity_stripe_depth == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + MPI_Abort(MPI_COMM_WORLD, 1); + } + if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) || + (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET)) + { + FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname, + layout_visit_policy); + MPI_Abort(MPI_COMM_WORLD, 1); + } + } + if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) { + if ((layout_stripe_unit == 0) || (layout_total_num_comps == 0)) { + if (layout_stripe_unit == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + if (layout_total_num_comps == 0) { + FPRINTF(stderr, + "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", + myname); + } + MPI_Abort(MPI_COMM_WORLD, 1); + } + if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) || + (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET)) + { + FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname, + layout_visit_policy); + MPI_Abort(MPI_COMM_WORLD, 1); + } + } + /* Create the file via ioctl() or open(). ADIOI_PANFS_Open's caller + * already optimizes performance by only calling this function with + * ADIO_CREATE on rank 0. Therefore, we don't need to worry about + * implementing that optimization here. */ + if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) || + (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) || + (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE)) { + pan_fs_client_layout_create_args_t file_create_args; + int fd_dir; + char *slash; + struct stat stat_buf; + int err; + char *path; + + /* Check that the file does not exist before + * trying to create it. The ioctl itself should + * be able to handle this condition. Currently, + * the ioctl will return successfully if the file + * has been previously created. Filed bug 33862 + * to track the problem. + */ + err = stat(fd->filename, &stat_buf); + if ((err == -1) && (errno != ENOENT)) { + FPRINTF(stderr, "%s: Unexpected I/O Error calling stat() on PanFS file: %s.\n", + myname, strerror(errno)); + MPI_Abort(MPI_COMM_WORLD, 1); + } + else if (err == 0) { + /* ensure that we have the same semantics here and in the call to creat(). In the latter, we do not + * use O_EXCL so a create on an existing file should not fail. + */ + FPRINTF(stderr, + "%s: Cannot create PanFS file with ioctl when file already exists, using open() syscall.\n", + myname); + goto use_open_syscall; + } + else { + /* (err == -1) && (errno == ENOENT) */ + /* File does not exist */ + path = ADIOI_Strdup(fd->filename); + slash = strrchr(path, '/'); + if (!slash) + ADIOI_Strncpy(path, ".", 2); + else { + if (slash == path) + *(path + 1) = '\0'; + else + *slash = '\0'; + } + + /* create PanFS object */ + memset(&file_create_args, 0, sizeof(pan_fs_client_layout_create_args_t)); + /* open directory */ + fd_dir = open(path, O_RDONLY); + if (fd_dir < 0) { + FPRINTF(stderr, + "%s: I/O Error opening parent directory to create PanFS file using ioctl: %s.\n", + myname, strerror(errno)); + MPI_Abort(MPI_COMM_WORLD, 1); + } + else { + char *file_name_ptr = fd->filename; + slash = strrchr(fd->filename, '/'); + if (slash) { + file_name_ptr = slash + 1; + } + /* create file in the directory */ + file_create_args.mode = perm; + file_create_args.version = PAN_FS_CLIENT_LAYOUT_VERSION; + file_create_args.flags = PAN_FS_CLIENT_LAYOUT_CREATE_F__NONE; + ADIOI_Strncpy(file_create_args.filename, file_name_ptr, + strlen(fd->filename) + 1); + file_create_args.layout.agg_type = layout_type; + file_create_args.layout.layout_is_valid = 1; + if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE) { + file_create_args.layout.u.raidn_parity_stripe.total_num_comps = + layout_total_num_comps; + file_create_args.layout.u.raidn_parity_stripe.parity_stripe_width = + layout_parity_stripe_width; + file_create_args.layout.u.raidn_parity_stripe.parity_stripe_depth = + layout_parity_stripe_depth; + file_create_args.layout.u.raidn_parity_stripe.stripe_unit = + layout_stripe_unit; + file_create_args.layout.u.raidn_parity_stripe.max_faults = + layout_max_faults; + file_create_args.layout.u.raidn_parity_stripe.encoding = layout_encoding; + } + else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) { + file_create_args.layout.u.raid1_5_parity_stripe.total_num_comps = + layout_total_num_comps; + file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_width = + layout_parity_stripe_width; + file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_depth = + layout_parity_stripe_depth; + file_create_args.layout.u.raid1_5_parity_stripe.stripe_unit = + layout_stripe_unit; + file_create_args.layout.u.raid1_5_parity_stripe.layout_visit_policy = + layout_visit_policy; + } + else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) { + file_create_args.layout.u.raid10.total_num_comps = layout_total_num_comps; + file_create_args.layout.u.raid10.stripe_unit = layout_stripe_unit; + file_create_args.layout.u.raid10.layout_visit_policy = layout_visit_policy; + } + err = ioctl(fd_dir, PAN_FS_CLIENT_LAYOUT_CREATE_FILE, &file_create_args); + if (err < 0) { + FPRINTF(stderr, + "%s: I/O Error doing ioctl on parent directory to create PanFS file using ioctl: %s.\n", + myname, strerror(errno)); + MPI_Abort(MPI_COMM_WORLD, 1); + } + err = close(fd_dir); + } + ADIOI_Free(path); + } + } + else { + use_open_syscall:; + int create_fd = open(fd->filename, amode, perm); + if (create_fd != -1) { + close(create_fd); + } + else { + FPRINTF(stderr, "%s: I/O Error creating PanFS file using open: %s.\n", myname, + strerror(errno)); + MPI_Abort(MPI_COMM_WORLD, 1); + } + } + } + if (fd->access_mode & ADIO_RDONLY) + amode = amode | O_RDONLY; + if (fd->access_mode & ADIO_WRONLY) + amode = amode | O_WRONLY; + if (fd->access_mode & ADIO_RDWR) + amode = amode | O_RDWR; + if (fd->access_mode & ADIO_EXCL) + amode = amode | O_EXCL; + + value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char)); + ADIOI_Info_get(fd->info, "panfs_concurrent_write", MPI_MAX_INFO_VAL, value, &flag); + if (flag) { + unsigned long int concurrent_write = strtoul(value, NULL, 10); + if (concurrent_write == 1) { + amode = amode | O_CONCURRENT_WRITE; + } + } + ADIOI_Free(value); + + fd->fd_sys = open(fd->filename, amode, perm); + fd->fd_direct = -1; + + if (fd->fd_sys != -1) { + int rc; + char temp_buffer[TEMP_BUFFER_SIZE]; + pan_fs_client_layout_query_args_t file_query_args; + memset(&file_query_args, 0, sizeof(pan_fs_client_layout_query_args_t)); + file_query_args.version = PAN_FS_CLIENT_LAYOUT_VERSION; + rc = ioctl(fd->fd_sys, PAN_FS_CLIENT_LAYOUT_QUERY_FILE, &file_query_args); + if (rc < 0) { + /* Error - set layout type to unknown */ + ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID"); + } + else { + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type); + ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer); + if (file_query_args.layout.layout_is_valid == 1) { + switch (file_query_args.layout.agg_type) { + case PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE: + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raidn_parity_stripe.stripe_unit); + ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raidn_parity_stripe. + parity_stripe_width); + ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raidn_parity_stripe. + parity_stripe_depth); + ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raidn_parity_stripe.total_num_comps); + ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raidn_parity_stripe.max_faults); + ADIOI_Info_set(fd->info, "panfs_layout_max_faults", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raidn_parity_stripe.encoding); + ADIOI_Info_set(fd->info, "panfs_layout_encoding", temp_buffer); + break; + case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE: + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit); + ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid1_5_parity_stripe. + parity_stripe_width); + ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid1_5_parity_stripe. + parity_stripe_depth); + ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid1_5_parity_stripe.total_num_comps); + ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid1_5_parity_stripe. + layout_visit_policy); + ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer); + break; + case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10: + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid10.stripe_unit); + ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid10.total_num_comps); + ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer); + ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", + file_query_args.layout.u.raid10.layout_visit_policy); + ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer); + break; + case PAN_FS_CLIENT_LAYOUT_TYPE__INVALID: + case PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT: + MPI_Info_set(fd->info, "panfs_layout_type", + "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID"); + default: + break; + } + } + } + } + + if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) + fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END); + + if (fd->fd_sys == -1) { + *error_code = ADIOI_Err_create_code(myname, fd->filename, errno); + } + else + *error_code = MPI_SUCCESS; +} diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_read.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_read.c index 44e28279df..237e4929de 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_read.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ #include #endif -void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -57,7 +57,7 @@ void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, fd->fp_sys_posn = offset + err; if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += err; + fd->fp_ind += err; } #ifdef HAVE_STATUS_SET_BYTES diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_resize.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_resize.c index 3c59cf8fad..5c41126c4d 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_write.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_write.c index d0ec79ffe6..920d2f473e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_panfs/ad_panfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_panfs/ad_panfs_write.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -40,7 +40,7 @@ void ADIOI_PANFS_WriteContig(ADIO_File fd, const void *buf, int count, } /* --END ERROR HANDLING-- */ } - + AD_PANFS_RETRY(write(fd->fd_sys, buf, len),err) /* --BEGIN ERROR HANDLING-- */ if (err == -1) { @@ -57,7 +57,7 @@ void ADIOI_PANFS_WriteContig(ADIO_File fd, const void *buf, int count, fd->fp_sys_posn = offset + err; if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += err; + fd->fp_ind += err; } #ifdef HAVE_STATUS_SET_BYTES diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_pfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_pfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs.c index 2e68bda625..cc480b0111 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -33,4 +33,6 @@ struct ADIOI_Fns_struct ADIO_PFS_operations = { ADIOI_PFS_Flush, /* Flush */ ADIOI_GEN_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs.h b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs.h similarity index 79% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs.h rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs.h index b0c9739670..fbe055ccf7 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -24,38 +24,38 @@ #endif /* PFS file-pointer modes (removed most of them because they are unused) */ -#ifndef M_ASYNC +#ifndef M_ASYNC #define M_UNIX 0 #define M_ASYNC 5 #endif void ADIOI_PFS_Open(ADIO_File fd, int *error_code); -void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); + *error_code); int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_PFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void ADIOI_PFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_PFS_Flush(ADIO_File fd, int *error_code); void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_done.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_done.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_done.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_done.c index 0550aa9d48..60e2d7da29 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_done.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_done.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_pfs.h" int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status, - int *error_code) + int *error_code) { int done=0; static char myname[] = "ADIOI_PFS_READDONE"; @@ -20,7 +20,7 @@ int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status, if ((*request)->queued) done = _iodone(*((long *) (*request)->handle)); - else done = 1; /* ADIOI_Complete_Async completed this request, + else done = 1; /* ADIOI_Complete_Async completed this request, but request object was not freed. */ #ifdef HAVE_STATUS_SET_BYTES @@ -38,7 +38,7 @@ int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status, ADIOI_Free_request((ADIOI_Req_node *) (*request)); *request = ADIO_REQUEST_NULL; } - + if (done == -1 && errno != 0) { *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, @@ -54,4 +54,4 @@ int ADIOI_PFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code) { return ADIOI_PFS_ReadDone(request, status, error_code); -} +} diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_fcntl.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_fcntl.c index 619abe0932..4a2c0fd382 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,10 +18,10 @@ void ADIOI_PFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, switch(flag) { case ADIO_FCNTL_GET_FSIZE: if (!(fd->atomicity)) { - /* in M_ASYNC mode, all processes are not aware of changes - in file size (although the manual says otherwise). Therefore, - temporarily change to M_UNIX and then change - back to M_ASYNC.*/ + /* in M_ASYNC mode, all processes are not aware of changes + in file size (although the manual says otherwise). Therefore, + temporarily change to M_UNIX and then change + back to M_ASYNC.*/ MPI_Comm_size(MPI_COMM_WORLD, &np_total); MPI_Comm_size(fd->comm, &np_comm); if (np_total == np_comm) { @@ -31,7 +31,7 @@ void ADIOI_PFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, /* else it is M_UNIX anyway, so no problem */ } fcntl_struct->fsize = lseek(fd->fd_sys, 0, SEEK_END); - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) lseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); *error_code = MPI_SUCCESS; break; diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_flush.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_flush.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_flush.c index 9867a46628..98dedc099c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_hints.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_hints.c index 54676e1be3..407a0eb775 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -15,16 +15,16 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) int err, myrank, fd_sys, perm, amode, old_mask; if ( (fd->info) == MPI_INFO_NULL) { - /* This must be part of the open call. can set striping parameters - if necessary. */ + /* This must be part of the open call. can set striping parameters + if necessary. */ MPI_Info_create(&(fd->info)); - - /* has user specified striping or server buffering parameters + + /* has user specified striping or server buffering parameters and do they have the same value on all processes? */ if (users_info != MPI_INFO_NULL) { value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL, value, &flag); if (flag) { str_factor=atoi(value); @@ -40,7 +40,7 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* --END ERROR HANDLING-- */ } - ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL, value, &flag); if (flag) { str_unit=atoi(value); @@ -56,7 +56,7 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* --END ERROR HANDLING-- */ } - ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL, value, &flag); if (flag) { start_iodev=atoi(value); @@ -100,7 +100,7 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) if (!err) { if (str_unit > 0) attr.s_sunitsize = str_unit; - if ((start_iodev >= 0) && + if ((start_iodev >= 0) && (start_iodev < attr.s_sfactor)) attr.s_start_sdir = start_iodev; if ((str_factor > 0) && (str_factor < attr.s_sfactor)) @@ -116,10 +116,10 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) } /* Has user asked for pfs server buffering to be turned on? - If so, mark it as true in fd->info and turn it on in + If so, mark it as true in fd->info and turn it on in ADIOI_PFS_Open after the file is opened */ - ADIOI_Info_get(users_info, "pfs_svr_buf", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "pfs_svr_buf", MPI_MAX_INFO_VAL, value, &flag); if (flag && (!strcmp(value, "true"))) ADIOI_Info_set(fd->info, "pfs_svr_buf", "true"); @@ -128,15 +128,15 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) ADIOI_Free(value); } else ADIOI_Info_set(fd->info, "pfs_svr_buf", "false"); - + /* set the values for collective I/O and data sieving parameters */ ADIOI_GEN_SetInfo(fd, users_info, error_code); } - + else { /* The file has been opened previously and fd->fd_sys is a valid file descriptor. cannot set striping parameters now. */ - + /* set the values for collective I/O and data sieving parameters */ ADIOI_GEN_SetInfo(fd, users_info, error_code); @@ -144,22 +144,22 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) if (users_info != MPI_INFO_NULL) { value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(users_info, "pfs_svr_buf", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "pfs_svr_buf", MPI_MAX_INFO_VAL, value, &flag); if (flag && (!strcmp(value, "true") || !strcmp(value, "false"))) { - value_in_fd = (char *) + value_in_fd = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "pfs_svr_buf", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "pfs_svr_buf", MPI_MAX_INFO_VAL, value_in_fd, &flag); if (strcmp(value, value_in_fd)) { if (!strcmp(value, "true")) { err = fcntl(fd->fd_sys, F_PFS_SVR_BUF, TRUE); - if (!err) + if (!err) ADIOI_Info_set(fd->info, "pfs_svr_buf", "true"); } else { err = fcntl(fd->fd_sys, F_PFS_SVR_BUF, FALSE); - if (!err) + if (!err) ADIOI_Info_set(fd->info, "pfs_svr_buf", "false"); } } @@ -169,6 +169,6 @@ void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) } } - + *error_code = MPI_SUCCESS; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_iread.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_iread.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_iread.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_iread.c index 8e27812047..78b3c592fb 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_iread.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_iread.c @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_pfs.h" -void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code) @@ -62,7 +62,7 @@ void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count, return; } - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; (*request)->queued = 1; (*request)->nbytes = len; diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_iwrite.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_iwrite.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_iwrite.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_iwrite.c index cf54cc4d71..5dda2fbdeb 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_iwrite.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_iwrite.c @@ -1,15 +1,15 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_pfs.h" -void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code) + ADIO_Offset offset, ADIO_Request *request, int *error_code) { long *id_sys; ADIO_Offset off; @@ -61,7 +61,7 @@ void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count, return; } - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; (*request)->queued = 1; (*request)->nbytes = len; diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_open.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_open.c index 86c1459310..f814b7c0a1 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -36,7 +36,7 @@ void ADIOI_PFS_Open(ADIO_File fd, int *error_code) MPI_Comm_size(MPI_COMM_WORLD, &np_total); MPI_Comm_size(fd->comm, &np_comm); - if (np_total == np_comm) + if (np_total == np_comm) fd->fd_sys = _gopen(fd->filename, amode, M_ASYNC, perm); else fd->fd_sys = open(fd->filename, amode, perm); fd->fd_direct = -1; @@ -46,10 +46,10 @@ void ADIOI_PFS_Open(ADIO_File fd, int *error_code) /* if user has asked for pfs server buffering to be turned on, it will be set to true in fd->info in the earlier call - to ADIOI_PFS_SetInfo. Turn it on now, since we now have a + to ADIOI_PFS_SetInfo. Turn it on now, since we now have a valid file descriptor. */ - ADIOI_Info_get(fd->info, "pfs_svr_buf", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "pfs_svr_buf", MPI_MAX_INFO_VAL, value, &flag); if (flag && (!strcmp(value, "true"))) { err = fcntl(fd->fd_sys, F_PFS_SVR_BUF, TRUE); @@ -71,7 +71,7 @@ void ADIOI_PFS_Open(ADIO_File fd, int *error_code) } ADIOI_Free(value); - if (fd->access_mode & ADIO_APPEND) + if (fd->access_mode & ADIO_APPEND) fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_read.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_read.c index d85b09d879..bd3b7e70e4 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_read.c @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_pfs.h" -void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -23,16 +23,16 @@ void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count, } err = _cread(fd->fd_sys, buf, len); fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* read from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) { lseek(fd->fd_sys, fd->fp_ind, SEEK_SET); } err = _cread(fd->fd_sys, buf, len); - fd->fp_ind += err; + fd->fp_ind += err; fd->fp_sys_posn = fd->fp_ind; - } + } #ifdef HAVE_STATUS_SET_BYTES if (err != -1) MPIR_Status_set_bytes(status, datatype, err); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_wait.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_wait.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_wait.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_wait.c index d8200aa540..e14159521a 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_wait.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_wait.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,7 +41,7 @@ void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, freed. This is used in ADIOI_Complete_async, because the user will call MPI_Wait later, which would require status to be filled. Ugly but works. queued = -1 should be used only - in ADIOI_Complete_async. + in ADIOI_Complete_async. This should not affect the user in any way. */ /* if request is still queued in the system, it is also there @@ -56,7 +56,7 @@ void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, } -void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int *error_code) +void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int *error_code) { ADIOI_PFS_ReadComplete(request, status, error_code); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_write.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_write.c index fe836a971a..c64e976a2b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pfs/ad_pfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_write.c @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_pfs.h" -void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -24,7 +24,7 @@ void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count, } err = _cwrite(fd->fd_sys, buf, len); fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* write from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) { diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_piofs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_piofs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/README b/ompi/mca/io/romio321/romio/adio/ad_piofs/README similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/README rename to ompi/mca/io/romio321/romio/adio/ad_piofs/README diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs.c index fbe59d10b4..726bbf15f8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -33,5 +33,7 @@ struct ADIOI_Fns_struct ADIO_PIOFS_operations = { ADIOI_GEN_Flush, /* Flush */ ADIOI_GEN_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ - ADIOI_PIOFS_Feature, + ADIOI_PIOFS_Feature, + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs.h b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs.h similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs.h rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs.h index 01d2567d8a..e9b74c9e87 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -19,16 +19,16 @@ #include "adio.h" void ADIOI_PIOFS_Open(ADIO_File fd, int *error_code); -void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_fcntl.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_fcntl.c index 80009aa44a..7d4a37cbfd 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,7 +23,7 @@ void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int * switch(flag) { case ADIO_FCNTL_GET_FSIZE: fcntl_struct->fsize = llseek(fd->fd_sys, 0, SEEK_END); - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) llseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); if (fcntl_struct->fsize == -1) { #ifdef MPICH @@ -34,7 +34,7 @@ void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int * #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; @@ -45,12 +45,12 @@ void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int * break; case ADIO_FCNTL_SET_ATOMICITY: - piofs_change_view = (piofs_change_view_t *) + piofs_change_view = (piofs_change_view_t *) ADIOI_Malloc(sizeof(piofs_change_view_t)); - piofs_change_view->Vbs = piofs_change_view->Vn = + piofs_change_view->Vbs = piofs_change_view->Vn = piofs_change_view->Hbs = piofs_change_view->Hn = 1; piofs_change_view->subfile = 0; - piofs_change_view->flags = (fcntl_struct->atomicity == 0) + piofs_change_view->flags = (fcntl_struct->atomicity == 0) ? (ACTIVE | NORMAL) : (ACTIVE | CAUTIOUS); err = piofsioctl(fd->fd_sys, PIOFS_CHANGE_VIEW, piofs_change_view); ADIOI_Free(piofs_change_view); @@ -64,7 +64,7 @@ void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int * #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_features.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_features.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_features.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_features.c diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_hints.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_hints.c index 391e9de007..242ebb3f07 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,16 +16,16 @@ void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) int err, myrank, perm, old_mask, nioservers; if ((fd->info) == MPI_INFO_NULL) { - /* This must be part of the open call. can set striping parameters - if necessary. */ + /* This must be part of the open call. can set striping parameters + if necessary. */ MPI_Info_create(&(fd->info)); - - /* has user specified striping parameters + + /* has user specified striping parameters and do they have the same value on all processes? */ if (users_info != MPI_INFO_NULL) { value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL, value, &flag); if (flag) { str_factor=atoi(value); @@ -37,7 +37,7 @@ void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) } } - ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL, value, &flag); if (flag) { str_unit=atoi(value); @@ -49,7 +49,7 @@ void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) } } - ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL, value, &flag); if (flag) { start_iodev=atoi(value); @@ -100,7 +100,7 @@ void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) piofs_create.bsu = (str_unit > 0) ? str_unit : -1; piofs_create.cells = (str_factor > 0) ? str_factor : -1; piofs_create.permissions = perm; - piofs_create.base_node = (start_iodev >= 0) ? + piofs_create.base_node = (start_iodev >= 0) ? start_iodev : -1; piofs_create.flags = 0; @@ -109,8 +109,8 @@ void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) MPI_Barrier(fd->comm); } } - } - + } + /* set the values for collective I/O and data sieving parameters */ ADIOI_GEN_SetInfo(fd, users_info, error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_open.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_open.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_open.c index 67c771ecfa..e02e90cf32 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -72,7 +72,7 @@ void ADIOI_PIOFS_Open(ADIO_File fd, int *error_code) #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(ADIO_FILE_NULL, *error_code, myname); + ADIOI_Error(ADIO_FILE_NULL, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_read.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_read.c similarity index 84% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_read.c index 79a9121810..278548656e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_read.c @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_piofs.h" -void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -25,16 +25,16 @@ void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count, } err = read(fd->fd_sys, buf, len); fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* read from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) { llseek(fd->fd_sys, fd->fp_ind, SEEK_SET); } err = read(fd->fd_sys, buf, len); - fd->fp_ind += err; + fd->fp_ind += err; fd->fp_sys_posn = fd->fp_ind; - } + } #ifdef HAVE_STATUS_SET_BYTES if (err != -1) MPIR_Status_set_bytes(status, datatype, err); @@ -49,7 +49,7 @@ void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count, #else *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_write.c b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_write.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_write.c index 76bf35de9d..31836a8240 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_piofs/ad_piofs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_piofs/ad_piofs_write.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_piofs.h" #include "adio_extern.h" -void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -26,7 +26,7 @@ void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count, } err = write(fd->fd_sys, buf, len); fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* write from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) { @@ -97,7 +97,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -105,16 +105,14 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Type_size_x(datatype, &buftype_size); MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); etype_size = fd->etype_size; - + bufsize = buftype_size * count; if (!buftype_is_contig && filetype_is_contig) { /* noncontiguous in memory, contiguous in file. use writev */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); /* There is a limit of 16 on the number of iovecs for readv/writev! */ @@ -127,10 +125,10 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, else off = llseek(fd->fd_sys, fd->fp_ind, SEEK_SET); k = 0; - for (j=0; jcount; i++) { iov[k].iov_base = ((char *) buf) + j*buftype_extent + - flat_buf->indices[i]; + flat_buf->indices[i]; iov[k].iov_len = flat_buf->blocklens[i]; /*FPRINTF(stderr, "%d %d\n", iov[k].iov_base, iov[k].iov_len);*/ @@ -155,7 +153,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef MPICH *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); -#elif defined(PRINT_ERR_MSG) +#elif defined(PRINT_ERR_MSG) *error_code = MPI_ERR_UNKNOWN; #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, @@ -184,11 +182,11 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + - (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] + if (disp + flat_file->indices[i] + + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - fwr_size = disp + flat_file->indices[i] + + fwr_size = disp + flat_file->indices[i] + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -202,7 +200,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -229,9 +227,9 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, off = offset; fwr_size = ADIOI_MIN(fwr_size, bufsize); while (i < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ + if (fwr_size) { + /* TYPE_UB and TYPE_LB can result in + fwr_size = 0. save system call in such cases */ llseek(fd->fd_sys, off, SEEK_SET); err = write(fd->fd_sys, ((char *) buf) + i, fwr_size); if (err == -1) err_flag = 1; @@ -249,7 +247,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, j = 0; n_filetypes++; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i); } @@ -258,9 +256,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; indx = flat_buf->indices[0]; @@ -287,7 +283,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; new_fwr_size = flat_file->blocklens[j]; @@ -303,7 +299,7 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, k = (k + 1)%flat_buf->count; buf_count++; indx = buftype_extent*(buf_count/flat_buf->count) + - flat_buf->indices[k]; + flat_buf->indices[k]; new_bwr_size = flat_buf->blocklens[k]; if (size != fwr_size) { off += size; @@ -330,13 +326,13 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count, #endif } else *error_code = MPI_SUCCESS; - } + } fd->fp_sys_posn = -1; /* set it to null. */ #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_pvfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs.c index 1d83cca6e6..27a3df8af4 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -34,4 +34,6 @@ struct ADIOI_Fns_struct ADIO_PVFS_operations = { ADIOI_PVFS_Resize, /* Resize */ ADIOI_PVFS_Delete, /* Delete */ ADIOI_PVFS_Feature, /* Features */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs.h b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs.h similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs.h rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs.h index 276f1076dc..88e1a9f225 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -27,16 +27,16 @@ typedef long long int int64_t; void ADIOI_PVFS_Open(ADIO_File fd, int *error_code); void ADIOI_PVFS_Close(ADIO_File fd, int *error_code); -void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_PVFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_close.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_close.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_close.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_close.c index 4766b9b2e7..c2da2e360e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_close.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_delete.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_delete.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_delete.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_delete.c index bb6592aaff..0e322ad32a 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_delete.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_fcntl.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_fcntl.c index d13760b74f..eeff250718 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -66,7 +66,7 @@ void ADIOI_PVFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, myname, __LINE__, MPI_ERR_ARG, "**flag", "**flag %d", flag); - return; + return; /* --END ERROR HANDLING-- */ } } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_flush.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_flush.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_flush.c index 9b2ac4ecd7..340f0cb339 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -19,7 +19,7 @@ void ADIOI_PVFS_Flush(ADIO_File fd, int *error_code) */ MPI_Comm_rank(fd->comm, &rank); - MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, + MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, fd->hints->ranklist[0], fd->comm); if (rank == fd->hints->ranklist[0]) { err = pvfs_fsync(fd->fd_sys); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_hints.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_hints.c index f64edd13d0..fdc06ed846 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -10,24 +10,24 @@ void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) { char *value; - int flag, tmp_val, str_factor=-1, str_unit=-1, start_iodev=-1; + int flag, tmp_val, str_factor=-1, str_unit=-1, start_iodev=-1; static char myname[] = "ADIOI_PVFS_SETINFO"; if ((fd->info) == MPI_INFO_NULL) { - /* This must be part of the open call. can set striping parameters - if necessary. */ + /* This must be part of the open call. can set striping parameters + if necessary. */ MPI_Info_create(&(fd->info)); ADIOI_Info_set(fd->info, "romio_pvfs_listio_read", "disable"); ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", "disable"); fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_DISABLE; fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_DISABLE; - + /* has user specified any pvfs-specific hints (striping params, listio) and do they have the same value on all processes? */ if (users_info != MPI_INFO_NULL) { value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL, value, &flag); if (flag) { str_factor=atoi(value); @@ -44,7 +44,7 @@ void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) else ADIOI_Info_set(fd->info, "striping_factor", value); } - ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL, value, &flag); if (flag) { str_unit=atoi(value); @@ -61,7 +61,7 @@ void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) else ADIOI_Info_set(fd->info, "striping_unit", value); } - ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL, value, &flag); if (flag) { start_iodev=atoi(value); @@ -82,16 +82,16 @@ void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) MPI_MAX_INFO_VAL, value, &flag); if (flag) { - if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE")) + if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE")) { ADIOI_Info_set(fd->info, "romio_pvfs_listio_read", value); fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_ENABLE; - } else if ( !strcmp(value, "disable") || !strcmp(value, "DISABLE")) + } else if ( !strcmp(value, "disable") || !strcmp(value, "DISABLE")) { ADIOI_Info_set(fd->info , "romio_pvfs_listio_read", value); fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_DISABLE; } - else if ( !strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC")) + else if ( !strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC")) { ADIOI_Info_set(fd->info, "romio_pvfs_listio_read", value); fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_AUTO; @@ -110,16 +110,16 @@ void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) ADIOI_Info_get(users_info, "romio_pvfs_listio_write", MPI_MAX_INFO_VAL, value, &flag); if (flag) { - if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE")) + if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE")) { ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", value); fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_ENABLE; - } else if ( !strcmp(value, "disable") || !strcmp(value, "DISABLE")) + } else if ( !strcmp(value, "disable") || !strcmp(value, "DISABLE")) { ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", value); fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_DISABLE; } - else if ( !strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC")) + else if ( !strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC")) { ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", value); fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_AUTO; @@ -134,10 +134,10 @@ void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) return; /* --END ERROR HANDLING-- */ } - } + } ADIOI_Free(value); } - } + } /* set the values for collective I/O and data sieving parameters */ ADIOI_GEN_SetInfo(fd, users_info, error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_open.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_open.c index cef5244553..c4fa28805d 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -37,15 +37,15 @@ void ADIOI_PVFS_Open(ADIO_File fd, int *error_code) value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "striping_factor", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "striping_factor", MPI_MAX_INFO_VAL, value, &flag); if (flag && (atoi(value) > 0)) pstat.pcount = atoi(value); - ADIOI_Info_get(fd->info, "striping_unit", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "striping_unit", MPI_MAX_INFO_VAL, value, &flag); if (flag && (atoi(value) > 0)) pstat.ssize = atoi(value); - ADIOI_Info_get(fd->info, "start_iodevice", MPI_MAX_INFO_VAL, + ADIOI_Info_get(fd->info, "start_iodevice", MPI_MAX_INFO_VAL, value, &flag); if (flag && (atoi(value) >= 0)) pstat.base = atoi(value); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_read.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_read.c index 05437c8c8d..7ea249f28a 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_read.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,7 +16,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, *error_code); #endif -void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -45,7 +45,7 @@ void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count, #endif if (err>0) fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* read from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) { @@ -65,9 +65,9 @@ void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count, MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); #endif if (err > 0) - fd->fp_ind += err; + fd->fp_ind += err; fd->fp_sys_posn = fd->fp_ind; - } + } #ifdef HAVE_STATUS_SET_BYTES if (err != -1) MPIR_Status_set_bytes(status, datatype, err); @@ -115,7 +115,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, int n_filetypes, etype_in_filetype; ADIO_Offset abs_off_in_filetype=0; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb; + MPI_Aint filetype_extent, buftype_extent; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off; ADIO_Offset off, disp, start_off; @@ -154,7 +154,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -171,11 +171,9 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, int64_t file_offsets; int32_t file_lengths; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + etype_size * offset; file_list_count = 1; @@ -195,9 +193,9 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, /* step through each block in memory, filling memory arrays */ while (b_blks_read < total_blks_to_read) { for (i=0; icount; i++) { - mem_offsets[b_blks_read % MAX_ARRAY_SIZE] = + mem_offsets[b_blks_read % MAX_ARRAY_SIZE] = (char*)((char *)buf + j*buftype_extent + flat_buf->indices[i]); - mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = + mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = flat_buf->blocklens[i]; file_lengths += flat_buf->blocklens[i]; b_blks_read++; @@ -215,13 +213,13 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, pvfs_read_list(fd->fd_sys ,mem_list_count, mem_offsets, mem_lengths, file_list_count, &file_offsets, &file_lengths); - + /* in the case of the last read list call, leave here */ if (b_blks_read == total_blks_to_read) break; file_offsets += file_lengths; file_lengths = 0; - } + } } /* for (i=0; icount; i++) */ j++; } /* while (b_blks_read < total_blks_to_read) */ @@ -264,11 +262,11 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - frd_size = (int) (disp + flat_file->indices[i] + + frd_size = (int) (disp + flat_file->indices[i] + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] - offset); flag = 1; @@ -282,7 +280,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -294,16 +292,16 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, break; } } - + /* abs. offset in bytes in the file */ - offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + + offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype; } /* else [file_ptr_type != ADIO_INDIVIDUAL] */ start_off = offset; st_frd_size = frd_size; st_n_filetypes = n_filetypes; - + if (buftype_is_contig && !filetype_is_contig) { /* contiguous in memory, noncontiguous in file. should be the most @@ -311,13 +309,13 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, int mem_lengths; char *mem_offsets; - + i = 0; j = st_index; n_filetypes = st_n_filetypes; - + mem_list_count = 1; - + /* determine how many blocks in file to read */ f_data_read = ADIOI_MIN(st_frd_size, bufsize); total_blks_to_read = 1; @@ -326,17 +324,17 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, f_data_read += flat_file->blocklens[j]; total_blks_to_read++; if (j<(flat_file->count-1)) j++; - else j = 0; + else j = 0; } - + j = st_index; n_filetypes = st_n_filetypes; n_read_lists = total_blks_to_read/MAX_ARRAY_SIZE; extra_blks = total_blks_to_read%MAX_ARRAY_SIZE; - + mem_offsets = buf; mem_lengths = 0; - + /* if at least one full readlist, allocate file arrays at max array size and don't free until very end */ if (n_read_lists) { @@ -353,7 +351,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, file_lengths = (int32_t*)ADIOI_Malloc(extra_blks* sizeof(int32_t)); } - + /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ for (i=0; itype != datatype) flat_buf = flat_buf->next; + + flat_buf = ADIOI_Flatten_and_find(datatype); size_read = 0; n_filetypes = st_n_filetypes; @@ -430,7 +426,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, max_mem_list = 0; max_file_list = 0; - /* run through and file max_file_list and max_mem_list so that you + /* run through and file max_file_list and max_mem_list so that you can allocate the file and memory arrays less than MAX_ARRAY_SIZE if possible */ @@ -438,7 +434,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, k = start_k; new_buffer_read = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -446,9 +442,9 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_read + flat_buf->blocklens[k] + + if((new_buffer_read + flat_buf->blocklens[k] + size_read) > bufsize) { - end_brd_size = new_buffer_read + + end_brd_size = new_buffer_read + flat_buf->blocklens[k] - (bufsize - size_read); new_buffer_read = bufsize - size_read; } @@ -466,15 +462,15 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ j = start_j; new_file_read = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_read < new_buffer_read)) { if(file_list_count) { - if((new_file_read + flat_file->blocklens[j]) > + if((new_file_read + flat_file->blocklens[j]) > new_buffer_read) { end_frd_size = new_buffer_read - new_file_read; new_file_read = new_buffer_read; @@ -495,9 +491,9 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_read < new_buffer_read) && + if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_read = 0; mem_list_count = 0; @@ -526,13 +522,13 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, } /* while (new_buffer_read < new_file_read) */ } /* if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ /* fakes filling the readlist arrays of lengths found above */ k = start_k; j = start_j; - for (i=0; iblocklens[k] == end_brd_size) @@ -553,7 +549,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, if (i == (file_list_count - 1)) { if (flat_file->blocklens[j] == end_frd_size) frd_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { frd_size = flat_file->blocklens[j] - end_frd_size; j--; @@ -579,7 +575,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, mem_lengths = (int *)ADIOI_Malloc(max_mem_list*sizeof(int)); file_offsets = (int64_t *)ADIOI_Malloc(max_file_list*sizeof(int64_t)); file_lengths = (int32_t *)ADIOI_Malloc(max_file_list*sizeof(int32_t)); - + size_read = 0; n_filetypes = st_n_filetypes; frd_size = st_frd_size; @@ -592,12 +588,12 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, /* this section calculates mem_list_count and file_list_count and also finds the possibly odd sized last array elements in new_frd_size and new_brd_size */ - + while (size_read < bufsize) { k = start_k; new_buffer_read = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -605,9 +601,9 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_read + flat_buf->blocklens[k] + + if((new_buffer_read + flat_buf->blocklens[k] + size_read) > bufsize) { - end_brd_size = new_buffer_read + + end_brd_size = new_buffer_read + flat_buf->blocklens[k] - (bufsize - size_read); new_buffer_read = bufsize - size_read; } @@ -625,15 +621,15 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ j = start_j; new_file_read = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_read < new_buffer_read)) { if(file_list_count) { - if((new_file_read + flat_file->blocklens[j]) > + if((new_file_read + flat_file->blocklens[j]) > new_buffer_read) { end_frd_size = new_buffer_read - new_file_read; new_file_read = new_buffer_read; @@ -654,9 +650,9 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_read < new_buffer_read) && + if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_read = 0; mem_list_count = 0; @@ -685,13 +681,13 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, } /* while (new_buffer_read < new_file_read) */ } /* if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ /* fills the allocated readlist arrays */ k = start_k; j = start_j; - for (i=0; icount) + (int)flat_buf->indices[k]); @@ -730,7 +726,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, file_lengths[i] = end_frd_size; if (flat_file->blocklens[j] == end_frd_size) frd_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { frd_size = flat_file->blocklens[j] - end_frd_size; j--; @@ -745,7 +741,7 @@ void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count, } } /* for (i=0; ifp_ind = off; fd->fp_sys_posn = -1; /* set it to null. */ - + #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); - /* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually read and placed in buf + /* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually read and placed in buf by ADIOI_BUFFERED_READ. */ #endif - + if (!buftype_is_contig) ADIOI_Delete_flattened(datatype); } #endif /* HAVE_PVFS_LISTIO */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_resize.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_resize.c index e3d3b2b127..b4b9553633 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_write.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_write.c index c0b247b4a6..5f8d7e0f12 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs/ad_pvfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_write.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -15,7 +15,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, *error_code); #endif -void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -45,7 +45,7 @@ void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count, #endif if (err > 0) fd->fp_sys_posn = offset + err; - /* individual file pointer not updated */ + /* individual file pointer not updated */ } else { /* write from curr. location of ind. file pointer */ if (fd->fp_sys_posn != fd->fp_ind) { @@ -109,7 +109,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_PVFS_LISTIO if ( fd->hints->fs_hints.pvfs.listio_write == ADIOI_HINT_ENABLE ) { - ADIOI_PVFS_WriteStridedListIO(fd, buf, count, datatype, + ADIOI_PVFS_WriteStridedListIO(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); return; } @@ -134,7 +134,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -142,7 +142,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Type_size_x(datatype, &buftype_size); MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); etype_size = fd->etype_size; - + bufsize = buftype_size * count; if (!buftype_is_contig && filetype_is_contig) { @@ -150,9 +150,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, ADIO_Offset combine_buf_remain; /* noncontiguous in memory, contiguous in file. use writev */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); /* allocate our "combine buffer" to pack data into before writing */ combine_buf = (char *) ADIOI_Malloc(fd->hints->ind_wr_buffer_size); @@ -280,11 +278,11 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + - (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] + if (disp + flat_file->indices[i] + + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - fwr_size = disp + flat_file->indices[i] + + fwr_size = disp + flat_file->indices[i] + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -298,7 +296,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -325,9 +323,9 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, off = offset; fwr_size = ADIOI_MIN(fwr_size, bufsize); while (i < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ + if (fwr_size) { + /* TYPE_UB and TYPE_LB can result in + fwr_size = 0. save system call in such cases */ #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); #endif @@ -357,7 +355,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, j = 0; n_filetypes++; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i); } @@ -366,9 +364,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; indx = flat_buf->indices[0]; @@ -407,7 +403,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent; new_fwr_size = flat_file->blocklens[j]; @@ -423,7 +419,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, k = (k + 1)%flat_buf->count; buf_count++; indx = buftype_extent*(buf_count/flat_buf->count) + - flat_buf->indices[k]; + flat_buf->indices[k]; new_bwr_size = flat_buf->blocklens[k]; if (size != fwr_size) { off += size; @@ -450,7 +446,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif @@ -461,7 +457,7 @@ void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count, void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code) + *error_code) { /* Since PVFS does not support file locking, can't do buffered writes as on Unix */ @@ -522,7 +518,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -530,7 +526,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, MPI_Type_size_x(datatype, &buftype_size); MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); etype_size = fd->etype_size; - + bufsize = buftype_size * count; if (!buftype_is_contig && filetype_is_contig) { @@ -539,10 +535,8 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, int64_t file_offsets; int32_t file_lengths; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; - + flat_buf = ADIOI_Flatten_and_find(datatype); + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { off = fd->disp + etype_size * offset; #ifdef ADIOI_MPE_LOGGING @@ -580,9 +574,9 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, /* step through each block in memory, filling memory arrays */ while (b_blks_wrote < total_blks_to_write) { for (i=0; icount; i++) { - mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] = + mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] = ((char*)buf + j*buftype_extent + flat_buf->indices[i]); - mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = + mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = flat_buf->blocklens[i]; file_lengths += flat_buf->blocklens[i]; b_blks_wrote++; @@ -600,13 +594,13 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, pvfs_write_list(fd->fd_sys ,mem_list_count, mem_offsets, mem_lengths, file_list_count, &file_offsets, &file_lengths); - + /* in the case of the last read list call, leave here */ if (b_blks_wrote == total_blks_to_write) break; file_offsets += file_lengths; file_lengths = 0; - } + } } /* for (i=0; icount; i++) */ j++; } /* while (b_blks_wrote < total_blks_to_write) */ @@ -627,7 +621,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif @@ -645,7 +639,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, disp = fd->disp; /* for each case - ADIO_Individual pointer or explicit, find offset - (file offset in bytes), n_filetypes (how many filetypes into file + (file offset in bytes), n_filetypes (how many filetypes into file to start), fwr_size (remaining amount of data in present file block), and st_index (start point in terms of blocks in starting filetype) */ @@ -656,11 +650,11 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - fwr_size = disp + flat_file->indices[i] + + fwr_size = disp + flat_file->indices[i] + (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -674,7 +668,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -695,7 +689,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, start_off = offset; st_fwr_size = fwr_size; st_n_filetypes = n_filetypes; - + if (buftype_is_contig && !filetype_is_contig) { /* contiguous in memory, noncontiguous in file. should be the most @@ -703,14 +697,14 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, int mem_lengths; char *mem_offsets; - + i = 0; j = st_index; off = offset; n_filetypes = st_n_filetypes; - + mem_list_count = 1; - + /* determine how many blocks in file to read */ f_data_wrote = ADIOI_MIN(st_fwr_size, bufsize); total_blks_to_write = 1; @@ -719,17 +713,17 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, f_data_wrote += flat_file->blocklens[j]; total_blks_to_write++; if (j<(flat_file->count-1)) j++; - else j = 0; + else j = 0; } - + j = st_index; n_filetypes = st_n_filetypes; n_write_lists = total_blks_to_write/MAX_ARRAY_SIZE; extra_blks = total_blks_to_write%MAX_ARRAY_SIZE; - + mem_offsets = buf; mem_lengths = 0; - + /* if at least one full readlist, allocate file arrays at max array size and don't free until very end */ if (n_write_lists) { @@ -746,7 +740,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, file_lengths = (int32_t*)ADIOI_Malloc(extra_blks* sizeof(int32_t)); } - + /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ for (i=0; itype != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); size_wrote = 0; n_filetypes = st_n_filetypes; @@ -823,7 +815,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, max_mem_list = 0; max_file_list = 0; - /* run through and file max_file_list and max_mem_list so that you + /* run through and file max_file_list and max_mem_list so that you can allocate the file and memory arrays less than MAX_ARRAY_SIZE if possible */ @@ -831,7 +823,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, k = start_k; new_buffer_write = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -839,9 +831,9 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_write + flat_buf->blocklens[k] + + if((new_buffer_write + flat_buf->blocklens[k] + size_wrote) > bufsize) { - end_bwr_size = new_buffer_write + + end_bwr_size = new_buffer_write + flat_buf->blocklens[k] - (bufsize - size_wrote); new_buffer_write = bufsize - size_wrote; } @@ -859,15 +851,15 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ j = start_j; new_file_write = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_write < new_buffer_write)) { if(file_list_count) { - if((new_file_write + flat_file->blocklens[j]) > + if((new_file_write + flat_file->blocklens[j]) > new_buffer_write) { end_fwr_size = new_buffer_write - new_file_write; new_file_write = new_buffer_write; @@ -888,9 +880,9 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_write < new_buffer_write) && + if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_write = 0; mem_list_count = 0; @@ -898,7 +890,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, if(mem_list_count) { if((new_buffer_write + flat_buf->blocklens[k]) > new_file_write) { - end_bwr_size = new_file_write - + end_bwr_size = new_file_write - new_buffer_write; new_buffer_write = new_file_write; k--; @@ -920,13 +912,13 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, } /* while (new_buffer_write < new_file_write) */ } /* if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ /* fakes filling the writelist arrays of lengths found above */ k = start_k; j = start_j; - for (i=0; iblocklens[k] == end_bwr_size) @@ -947,7 +939,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, if (i == (file_list_count - 1)) { if (flat_file->blocklens[j] == end_fwr_size) fwr_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { fwr_size = flat_file->blocklens[j] - end_fwr_size; j--; @@ -973,7 +965,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, mem_lengths = (int *)ADIOI_Malloc(max_mem_list*sizeof(int)); file_offsets = (int64_t *)ADIOI_Malloc(max_file_list*sizeof(int64_t)); file_lengths = (int32_t *)ADIOI_Malloc(max_file_list*sizeof(int32_t)); - + size_wrote = 0; n_filetypes = st_n_filetypes; fwr_size = st_fwr_size; @@ -986,12 +978,12 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, /* this section calculates mem_list_count and file_list_count and also finds the possibly odd sized last array elements in new_fwr_size and new_bwr_size */ - + while (size_wrote < bufsize) { k = start_k; new_buffer_write = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -999,9 +991,9 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_write + flat_buf->blocklens[k] + + if((new_buffer_write + flat_buf->blocklens[k] + size_wrote) > bufsize) { - end_bwr_size = new_buffer_write + + end_bwr_size = new_buffer_write + flat_buf->blocklens[k] - (bufsize - size_wrote); new_buffer_write = bufsize - size_wrote; } @@ -1019,15 +1011,15 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ j = start_j; new_file_write = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_write < new_buffer_write)) { if(file_list_count) { - if((new_file_write + flat_file->blocklens[j]) > + if((new_file_write + flat_file->blocklens[j]) > new_buffer_write) { end_fwr_size = new_buffer_write - new_file_write; new_file_write = new_buffer_write; @@ -1048,9 +1040,9 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_write < new_buffer_write) && + if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_write = 0; mem_list_count = 0; @@ -1080,17 +1072,17 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, } /* while (new_buffer_write < new_file_write) */ } /* if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ /* fills the allocated readlist arrays */ k = start_k; j = start_j; - for (i=0; icount) + (int)flat_buf->indices[k]); - + if(!i) { mem_lengths[0] = bwr_size; mem_offsets[0] += flat_buf->blocklens[k] - bwr_size; @@ -1126,7 +1118,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, file_lengths[i] = end_fwr_size; if (flat_file->blocklens[j] == end_fwr_size) fwr_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { fwr_size = flat_file->blocklens[j] - end_fwr_size; j--; @@ -1166,7 +1158,7 @@ void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2.c similarity index 84% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2.c index 2ddbd66b14..bdebe19d37 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago. + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -39,9 +39,11 @@ struct ADIOI_Fns_struct ADIO_PVFS2_operations = { ADIOI_PVFS2_Resize, /* Resize */ ADIOI_PVFS2_Delete, /* Delete */ ADIOI_PVFS2_Feature, - "PVFS2: the PVFS v2 or OrangeFS file systems" + "PVFS2: the PVFS v2 or OrangeFS file systems", + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2.h b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2.h similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2.h rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2.h index 76fe56045a..95c5912376 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2.h +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -19,16 +19,16 @@ void ADIOI_PVFS2_Open(ADIO_File fd, int *error_code); void ADIOI_PVFS2_Close(ADIO_File fd, int *error_code); -void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); void ADIOI_PVFS2_WriteContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_PVFS2_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_PVFS2_WriteStrided(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int @@ -43,7 +43,7 @@ void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); int ADIOI_PVFS2_Feature(ADIO_File fd, int flag); -void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, MPI_Request *request, int *error_code); @@ -51,7 +51,7 @@ void ADIOI_PVFS2_IWriteContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, MPI_Request *request, int *error_code); -void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, MPI_Request *request, int flag, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_aio.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_aio.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_aio.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_aio.c index b90fdedabb..88be6f1eaf 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_aio.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_aio.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * vim: ts=8 sts=4 sw=4 noexpandtab + * + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -20,10 +20,10 @@ static int ADIOI_PVFS2_greq_class = 0; int ADIOI_PVFS2_aio_free_fn(void *extra_state); int ADIOI_PVFS2_aio_poll_fn(void *extra_state, MPI_Status *status); -int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, +int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, double timeout, MPI_Status *status); -void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, MPI_Request *request, int *error_code) @@ -41,7 +41,7 @@ void ADIOI_PVFS2_IWriteContig(ADIO_File fd, const void *buf, int count, offset, request, WRITE, error_code); } -void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, MPI_Request *request, int flag, int *error_code) @@ -87,13 +87,13 @@ void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, if (file_ptr_type == ADIO_INDIVIDUAL) { /* copy individual file pointer into offset variable, continue */ offset = fd->fp_ind; - } + } if (flag == READ) { #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_iread_a, 0, NULL ); #endif - ret = PVFS_isys_read(pvfs_fs->object_ref, aio_req->file_req, offset, - buf, aio_req->mem_req, &(pvfs_fs->credentials), + ret = PVFS_isys_read(pvfs_fs->object_ref, aio_req->file_req, offset, + buf, aio_req->mem_req, &(pvfs_fs->credentials), &(aio_req->resp_io), &(aio_req->op_id), NULL); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_iread_b, 0, NULL ); @@ -102,13 +102,13 @@ void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_iwrite_a, 0, NULL ); #endif - ret = PVFS_isys_write(pvfs_fs->object_ref, aio_req->file_req, offset, - buf, aio_req->mem_req, &(pvfs_fs->credentials), + ret = PVFS_isys_write(pvfs_fs->object_ref, aio_req->file_req, offset, + buf, aio_req->mem_req, &(pvfs_fs->credentials), &(aio_req->resp_io), &(aio_req->op_id), NULL); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_iwrite_b, 0, NULL ); -#endif - } +#endif + } /* --BEGIN ERROR HANDLING-- */ if (ret < 0 ) { @@ -121,11 +121,10 @@ void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, } /* --END ERROR HANDLING-- */ -#ifdef HAVE_MPI_GREQUEST_EXTENSIONS /* posted. defered completion */ - if (ret == 0) { + if (ret == 0) { if (ADIOI_PVFS2_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, + MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, ADIOI_PVFS2_aio_free_fn, MPIU_Greq_cancel_fn, ADIOI_PVFS2_aio_poll_fn, ADIOI_PVFS2_aio_wait_fn, &ADIOI_PVFS2_greq_class); @@ -133,15 +132,6 @@ void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, MPIX_Grequest_class_allocate(ADIOI_PVFS2_greq_class, aio_req, request); memcpy(&(aio_req->req), request, sizeof(*request)); } -#else - /* if generalized request extensions not available, we will have to process - * this operation right here */ - int error; - ret = PVFS_sys_wait(aio_req->op_id, "ADIOI_PVFS2_AIO_Contig", &error); - if (ret == 0) { - MPIO_Completed_request_create(&fd, len, error_code, request); - } -#endif /* immediate completion */ if (ret == 1) { @@ -188,7 +178,7 @@ int ADIOI_PVFS2_aio_poll_fn(void *extra_state, MPI_Status *status) } /* wait for multiple requests to complete */ -int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, +int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, double timeout, MPI_Status *status) { @@ -214,7 +204,7 @@ int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, for (i=0; i< count; i++) { for (j=0; jop_id) { - aio_reqlist[j]->nbytes = + aio_reqlist[j]->nbytes = aio_reqlist[j]->resp_io.total_completed; MPI_Grequest_complete(aio_reqlist[j]->req); } @@ -226,5 +216,5 @@ int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, /* - * vim: ts=8 sts=4 sw=4 noexpandtab + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_close.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_close.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_close.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_close.c index 907b0b031d..847dd8341c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_close.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,6 +23,6 @@ void ADIOI_PVFS2_Close(ADIO_File fd, int *error_code) *error_code = MPI_SUCCESS; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_common.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_common.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_common.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_common.c index b85e9b590a..ccd3c1916c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_common.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_common.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2003 University of Chicago. +/* + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -37,7 +37,7 @@ void ADIOI_PVFS2_End(int *error_code) *error_code = MPI_SUCCESS; } -int ADIOI_PVFS2_End_call(MPI_Comm comm, int keyval, +int ADIOI_PVFS2_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state) { int error_code; @@ -77,10 +77,10 @@ void ADIOI_PVFS2_Init(int *error_code ) return; } - + MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_PVFS2_End_call, - &ADIOI_PVFS2_Initialized, (void *)0); - /* just like romio does, we make a dummy attribute so we + &ADIOI_PVFS2_Initialized, (void *)0); + /* just like romio does, we make a dummy attribute so we * get cleaned up */ MPI_Attr_put(MPI_COMM_SELF, ADIOI_PVFS2_Initialized, (void *)0); } @@ -88,7 +88,7 @@ void ADIOI_PVFS2_Init(int *error_code ) void ADIOI_PVFS2_makeattribs(PVFS_sys_attr * attribs) { memset(attribs, 0, sizeof(PVFS_sys_attr)); - + attribs->owner = geteuid(); attribs->group = getegid(); attribs->perms = 0644; @@ -145,6 +145,6 @@ int ADIOI_PVFS2_error_convert(int pvfs_error) } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_common.h b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_common.h similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_common.h rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_common.h index a34f84ee3e..f63f84a27b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_common.h +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_common.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -28,7 +28,7 @@ void ADIOI_PVFS2_Init(int *error_code ); void ADIOI_PVFS2_makeattribs(PVFS_sys_attr * attribs); void ADIOI_PVFS2_makecredentials(PVFS_credentials * credentials); void ADIOI_PVFS2_End(int *error_code); -int ADIOI_PVFS2_End_call(MPI_Comm comm, int keyval, +int ADIOI_PVFS2_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state); int ADIOI_PVFS2_error_convert(int pvfs_error); diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_delete.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_delete.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_delete.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_delete.c index b360288a64..f5770bb393 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_delete.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago. + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -21,7 +21,7 @@ void ADIOI_PVFS2_Delete(const char *filename, int *error_code) ADIOI_PVFS2_Init(error_code); /* --BEGIN ERROR HANDLING-- */ - if (*error_code != MPI_SUCCESS) + if (*error_code != MPI_SUCCESS) { /* ADIOI_PVFS2_INIT handles creating error codes itself */ return; @@ -47,7 +47,7 @@ void ADIOI_PVFS2_Delete(const char *filename, int *error_code) ret = PVFS_sys_getparent(cur_fs, pvfs_path, &credentials, &resp_getparent); - ret = PVFS_sys_remove(resp_getparent.basename, + ret = PVFS_sys_remove(resp_getparent.basename, resp_getparent.parent_ref, &credentials); /* --BEGIN ERROR HANDLING-- */ if (ret != 0) { @@ -64,6 +64,6 @@ void ADIOI_PVFS2_Delete(const char *filename, int *error_code) return; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_fcntl.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_fcntl.c index f28f4f4927..e07291f757 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -21,7 +21,7 @@ void ADIOI_PVFS2_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, switch(flag) { case ADIO_FCNTL_GET_FSIZE: - ret = PVFS_sys_getattr(pvfs_fs->object_ref, PVFS_ATTR_SYS_SIZE, + ret = PVFS_sys_getattr(pvfs_fs->object_ref, PVFS_ATTR_SYS_SIZE, &(pvfs_fs->credentials), &resp_getattr); if (ret != 0 ) { /* --BEGIN ERROR HANDLING-- */ @@ -54,6 +54,6 @@ void ADIOI_PVFS2_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, } } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_features.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_features.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_features.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_features.c diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_flush.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_flush.c similarity index 80% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_flush.c index a82cc54e60..18061084a8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -12,12 +12,12 @@ * flush request, it will stress the PVFS2 servers with redundant * PVFS_sys_flush requests. Instead, one process should wait for * everyone to catch up, do the sync, then broadcast the result. We can - * get away with this thanks to PVFS2's stateless design + * get away with this thanks to PVFS2's stateless design */ -void ADIOI_PVFS2_Flush(ADIO_File fd, int *error_code) -{ - int ret, rank, dummy=0, dummy_in=0; +void ADIOI_PVFS2_Flush(ADIO_File fd, int *error_code) +{ + int ret, rank, dummy=0, dummy_in=0; ADIOI_PVFS2_fs *pvfs_fs; static char myname[] = "ADIOI_PVFS2_FLUSH"; @@ -30,7 +30,7 @@ void ADIOI_PVFS2_Flush(ADIO_File fd, int *error_code) /* unlike ADIOI_PVFS2_Resize, MPI_File_sync() does not perform any * syncronization */ - MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, + MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, fd->hints->ranklist[0], fd->comm); /* io_worker computed in ADIO_Open */ @@ -50,6 +50,6 @@ void ADIOI_PVFS2_Flush(ADIO_File fd, int *error_code) /* --END ERROR HANDLING-- */ } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_hints.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_hints.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_hints.c index 5961726e2b..47522064e3 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -44,15 +44,15 @@ void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_DISABLE; fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_DISABLE; - + /* any user-provided hints? */ if (users_info != MPI_INFO_NULL) { value = (char *) ADIOI_Malloc( (MPI_MAX_INFO_VAL+1)*sizeof(char)); /* pvfs2 debugging */ - ADIOI_Info_get(users_info, "romio_pvfs2_debugmask", + ADIOI_Info_get(users_info, "romio_pvfs2_debugmask", MPI_MAX_INFO_VAL, value, &flag); if (flag) { - tmp_value = fd->hints->fs_hints.pvfs2.debugmask = + tmp_value = fd->hints->fs_hints.pvfs2.debugmask = PVFS_debug_eventlog_to_mask(value); MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm); @@ -64,7 +64,7 @@ void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) return; } /* --END ERROR HANDLING-- */ - + ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", value); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io.h b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io.h similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io.h rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io.h index c9a394f204..aefe0653ec 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io.h +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 2006 University of Chicago. + * Copyright (C) 2006 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -60,7 +60,7 @@ void print_buf_file_ol_pairs(int64_t buf_off_arr[], /* Datatype I/O helper prototypes */ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int *error_code, int rw_type); int convert_named(MPI_Datatype *mpi_dtype, diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c index 14443a1774..02219293ca 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 2006 University of Chicago. + * Copyright (C) 2006 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,9 +45,9 @@ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); /* changed below if error */ - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; - /* datatype is the memory type + /* datatype is the memory type * fd->filetype is the file type */ MPI_Type_size_x(fd->filetype, &filetype_size); if (filetype_size == 0) { @@ -70,34 +70,34 @@ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, * case is handled by using fd->disp and byte-converted off. */ pvfs_disp = fd->disp; - if (file_ptr_type == ADIO_INDIVIDUAL) + if (file_ptr_type == ADIO_INDIVIDUAL) { - if (filetype_is_contig) + if (filetype_is_contig) { off = fd->fp_ind - fd->disp; } - else + else { int flag = 0; /* Should have already been flattened in ADIO_Open*/ - while (flat_file_p->type != fd->filetype) + while (flat_file_p->type != fd->filetype) { flat_file_p = flat_file_p->next; } num_filetypes = -1; - while (!flag) + while (!flag) { num_filetypes++; - for (i = 0; i < flat_file_p->count; i++) + for (i = 0; i < flat_file_p->count; i++) { /* Start on a non zero-length region */ - if (flat_file_p->blocklens[i]) + if (flat_file_p->blocklens[i]) { if (fd->disp + flat_file_p->indices[i] + (num_filetypes * filetype_extent) + flat_file_p->blocklens[i] > fd->fp_ind && - fd->disp + flat_file_p->indices[i] <= - fd->fp_ind) + fd->disp + flat_file_p->indices[i] <= + fd->fp_ind) { cur_flat_file_reg_off = fd->fp_ind - (fd->disp + flat_file_p->indices[i] + @@ -116,7 +116,7 @@ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, } } else /* ADIO_EXPLICIT */ - { + { off = etype_size * offset; } @@ -144,7 +144,7 @@ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, if (ret != 0) /* TODO: convert this to MPIO error handling */ fprintf(stderr, "ADIOI_PVFS2_stridedDtypeIO: error in final" " CONTIG memory type\n"); - PVFS_Request_free(&tmp_mem_req); + PVFS_Request_free(&tmp_mem_req); /* pvfs_disp is used to offset the filetype */ ret = PVFS_Request_hindexed(1, &pvfs_blk, &pvfs_disp, @@ -163,7 +163,7 @@ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, if (ret != 0) { fprintf(stderr, "ADIOI_PVFS2_StridedDtypeIO: Warning - PVFS_sys_" - "read/write returned %d and completed %Ld bytes.\n", + "read/write returned %d and completed %Ld bytes.\n", ret, (long long)resp_io.total_completed); *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, @@ -177,40 +177,40 @@ int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, { fd->fp_ind = off += resp_io.total_completed; } - + error_state: fd->fp_sys_posn = -1; /* set it to null. */ PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); + PVFS_Request_free(&file_req); #ifdef DEBUG_DTYPE fprintf(stderr, "ADIOI_PVFS2_StridedDtypeIO: " - "resp_io.total_completed=%Ld,ret=%d\n", + "resp_io.total_completed=%Ld,ret=%d\n", resp_io.total_completed, ret); #endif #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, resp_io.total_completed); /* This is a temporary way of filling in status. The right way is to - * keep track of how much data was actually acccessed by + * keep track of how much data was actually acccessed by * ADIOI_BUFFERED operations */ #endif return ret; } /* convert_mpi_pvfs2_dtype - Convert a MPI datatype into - * a PVFS2 datatype so that we can natively use the PVFS2 - * datatypes in the PVFS2 I/O calls instead of converting - * all datatypes to the hindexed method + * a PVFS2 datatype so that we can natively use the PVFS2 + * datatypes in the PVFS2 I/O calls instead of converting + * all datatypes to the hindexed method * return 1 - a leaf node - * return 0 - normal return + * return 0 - normal return * return -1 - problems */ -int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, +int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, PVFS_Request *pvfs_dtype) { - int num_int = -1, num_addr = -1, num_dtype = -1, + int num_int = -1, num_addr = -1, num_dtype = -1, combiner = -1, i = -1, ret = -1, leaf = -1; int *arr_int = NULL; MPI_Aint *arr_addr = NULL; @@ -227,16 +227,16 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, &num_dtype, &combiner); - /* Depending on type of datatype do the following + /* Depending on type of datatype do the following * operations */ - + if (combiner == MPI_COMBINER_NAMED) { convert_named(mpi_dtype, pvfs_dtype, combiner); return 1; } - /* Allocate space for the arrays necessary for + /* Allocate space for the arrays necessary for * MPI_Type_get_contents */ if ((arr_int = ADIOI_Malloc(sizeof(int)*num_int)) == NULL) @@ -266,7 +266,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, arr_addr, arr_dtype); - /* If it's not a predefined datatype, it is either a + /* If it's not a predefined datatype, it is either a * derived datatype or a structured datatype */ if (combiner != MPI_COMBINER_STRUCT) @@ -278,28 +278,28 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, { case MPI_COMBINER_CONTIGUOUS: leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - ret = PVFS_Request_contiguous(arr_int[0], + ret = PVFS_Request_contiguous(arr_int[0], *old_pvfs_dtype, pvfs_dtype); break; case MPI_COMBINER_VECTOR: leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); ret = PVFS_Request_vector(arr_int[0], arr_int[1], - arr_int[2], *old_pvfs_dtype, + arr_int[2], *old_pvfs_dtype, pvfs_dtype); break; case MPI_COMBINER_HVECTOR: leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); ret = PVFS_Request_hvector(arr_int[0], arr_int[1], - arr_addr[0], *old_pvfs_dtype, + arr_addr[0], *old_pvfs_dtype, pvfs_dtype); break; - /* Both INDEXED and HINDEXED types require PVFS_size - * address arrays. Therefore, we need to copy and - * convert the data from MPI_get_contents() into + /* Both INDEXED and HINDEXED types require PVFS_size + * address arrays. Therefore, we need to copy and + * convert the data from MPI_get_contents() into * a PVFS_size buffer */ case MPI_COMBINER_INDEXED: leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - if ((pvfs_arr_disp = + if ((pvfs_arr_disp = ADIOI_Malloc(arr_int[0]*sizeof(PVFS_size))) == 0) { fprintf(stderr, "convert_mpi_pvfs2_dtype: " @@ -307,17 +307,17 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, } for (i = 0; i < arr_int[0]; i++) { - pvfs_arr_disp[i] = + pvfs_arr_disp[i] = (PVFS_size) arr_int[arr_int[0]+1+i]; } - ret = PVFS_Request_indexed(arr_int[0], &arr_int[1], + ret = PVFS_Request_indexed(arr_int[0], &arr_int[1], pvfs_arr_disp, *old_pvfs_dtype, pvfs_dtype); ADIOI_Free(pvfs_arr_disp); break; case MPI_COMBINER_HINDEXED: leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - if ((pvfs_arr_disp = + if ((pvfs_arr_disp = ADIOI_Malloc(arr_int[0]*sizeof(PVFS_size))) == 0) { fprintf(stderr, "convert_mpi_pvfs2_dtype: " @@ -325,17 +325,17 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, } for (i = 0; i < arr_int[0]; i++) { - pvfs_arr_disp[i] = + pvfs_arr_disp[i] = (PVFS_size) arr_addr[i]; } - ret = PVFS_Request_hindexed(arr_int[0], &arr_int[1], + ret = PVFS_Request_hindexed(arr_int[0], &arr_int[1], (int64_t *)&arr_addr[0], *old_pvfs_dtype, pvfs_dtype); - ADIOI_Free(pvfs_arr_disp); + ADIOI_Free(pvfs_arr_disp); break; case MPI_COMBINER_DUP: leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - ret = PVFS_Request_contiguous(1, + ret = PVFS_Request_contiguous(1, *old_pvfs_dtype, pvfs_dtype); break; @@ -343,7 +343,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, /* No native PVFS2 support for this operation currently */ ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "INDEXED_BLOCK is unsupported\n"); + "INDEXED_BLOCK is unsupported\n"); break; case MPI_COMBINER_HINDEXED_BLOCK: /* No native PVFS2 support for this operation currently */ @@ -354,42 +354,42 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, case MPI_COMBINER_HINDEXED_INTEGER: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "HINDEXED_INTEGER is unsupported\n"); + "HINDEXED_INTEGER is unsupported\n"); break; case MPI_COMBINER_STRUCT_INTEGER: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "STRUCT_INTEGER is unsupported\n"); + "STRUCT_INTEGER is unsupported\n"); break; case MPI_COMBINER_SUBARRAY: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "SUBARRAY is unsupported\n"); + "SUBARRAY is unsupported\n"); break; case MPI_COMBINER_DARRAY: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "DARRAY is unsupported\n"); + "DARRAY is unsupported\n"); break; case MPI_COMBINER_F90_REAL: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "F90_REAL is unsupported\n"); + "F90_REAL is unsupported\n"); break; case MPI_COMBINER_F90_COMPLEX: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "F90_COMPLEX is unsupported\n"); + "F90_COMPLEX is unsupported\n"); break; case MPI_COMBINER_F90_INTEGER: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "F90_INTEGER is unsupported\n"); + "F90_INTEGER is unsupported\n"); break; case MPI_COMBINER_RESIZED: ADIOI_Free(old_pvfs_dtype); fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "RESIZED is unsupported\n"); + "RESIZED is unsupported\n"); break; default: break; @@ -400,7 +400,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, "for a derived datatype\n"); #ifdef DEBUG_DTYPE - print_dtype_info(combiner, + print_dtype_info(combiner, num_int, num_addr, num_dtype, @@ -418,7 +418,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, PVFS_Request_free(old_pvfs_dtype); ADIOI_Free(old_pvfs_dtype); - + return ret; } else /* MPI_COMBINER_STRUCT */ @@ -430,9 +430,9 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, /* When converting into a PVFS_Request_struct, we no longer * can use MPI_LB and MPI_UB. Therfore, we have to do the - * following. - * We simply ignore all the MPI_LB and MPI_UB types and - * get the lb and extent and pass it on through a + * following. + * We simply ignore all the MPI_LB and MPI_UB types and + * get the lb and extent and pass it on through a * PVFS resized_req */ arr_count = 0; @@ -450,7 +450,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, MPI_Type_get_extent(*mpi_dtype, &mpi_lb, &mpi_extent); pvfs_lb = mpi_lb; pvfs_extent = mpi_extent; - if ((pvfs_arr_len = ADIOI_Malloc(arr_count*sizeof(int))) + if ((pvfs_arr_len = ADIOI_Malloc(arr_count*sizeof(int))) == NULL) { fprintf(stderr, "convert_mpi_pvfs2_dtype: " @@ -464,7 +464,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, fprintf(stderr, "convert_mpi_pvfs2_dtype: " "Failed to allocate PVFS_Requests\n"); - if ((pvfs_arr_disp = ADIOI_Malloc(arr_count*sizeof(PVFS_size))) + if ((pvfs_arr_disp = ADIOI_Malloc(arr_count*sizeof(PVFS_size))) == NULL) { fprintf(stderr, "convert_mpi_pvfs2_dtype: " @@ -480,12 +480,12 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, leaf = convert_mpi_pvfs2_dtype( &arr_dtype[i], &old_pvfs_dtype_arr[arr_count]); if (leaf != 1) - MPI_Type_free(&arr_dtype[i]); - pvfs_arr_disp[arr_count] = + MPI_Type_free(&arr_dtype[i]); + pvfs_arr_disp[arr_count] = (PVFS_size) arr_addr[i]; if (has_lb_ub) { - pvfs_arr_len[arr_count] = + pvfs_arr_len[arr_count] = arr_int[i+1]; } arr_count++; @@ -500,8 +500,8 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, if ((tmp_pvfs_dtype = ADIOI_Malloc(sizeof(PVFS_Request))) == NULL) fprintf(stderr, "convert_mpi_pvfs2_dtype: " "Failed to allocate PVFS_Request\n"); - - ret = PVFS_Request_struct(arr_count, pvfs_arr_len, + + ret = PVFS_Request_struct(arr_count, pvfs_arr_len, pvfs_arr_disp, old_pvfs_dtype_arr, tmp_pvfs_dtype); if (ret != 0) @@ -517,7 +517,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, arr_count++; } } - + #ifdef DEBUG_DTYPE fprintf(stderr, "STRUCT(WITHOUT %d LB or UB)(%d,[", arr_int[0] - arr_count, arr_count); @@ -528,8 +528,8 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, fprintf(stderr, "]\n"); fprintf(stderr, "RESIZED(LB = %Ld, EXTENT = %Ld)\n", pvfs_lb, pvfs_extent); -#endif - ret = PVFS_Request_resized(*tmp_pvfs_dtype, +#endif + ret = PVFS_Request_resized(*tmp_pvfs_dtype, pvfs_lb, pvfs_extent, pvfs_dtype); if (ret != 0) fprintf(stderr, "Error in PVFS_Request_resize\n"); @@ -539,7 +539,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, } else /* No MPI_LB or MPI_UB datatypes */ { - ret = PVFS_Request_struct(arr_int[0], &arr_int[1], + ret = PVFS_Request_struct(arr_int[0], &arr_int[1], pvfs_arr_disp, old_pvfs_dtype_arr, pvfs_dtype); if (ret != 0) @@ -553,14 +553,14 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, } #ifdef DEBUG_DTYPE - print_dtype_info(combiner, + print_dtype_info(combiner, num_int, num_addr, num_dtype, arr_int, arr_addr, arr_dtype); -#endif +#endif } ADIOI_Free(arr_int); @@ -579,9 +579,9 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, return -1; } -int convert_named(MPI_Datatype *mpi_dtype, +int convert_named(MPI_Datatype *mpi_dtype, PVFS_Request *pvfs_dtype, int combiner) -{ +{ int ret = -1; #ifdef DEBUG_DTYPE fprintf(stderr, "NAMED"); @@ -681,7 +681,7 @@ int convert_named(MPI_Datatype *mpi_dtype, return ret; } -void print_dtype_info(int combiner, +void print_dtype_info(int combiner, int num_int, int num_addr, int num_dtype, @@ -696,7 +696,7 @@ void print_dtype_info(int combiner, fprintf(stderr, "CONTIG(%d)\n", arr_int[0]); break; case MPI_COMBINER_VECTOR: - fprintf(stderr, "VECTOR(%d,%d,%d)\n", + fprintf(stderr, "VECTOR(%d,%d,%d)\n", arr_int[0], arr_int[1], arr_int[2]); break; case MPI_COMBINER_HVECTOR: diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io_list.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_list.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io_list.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_list.c index c5e938d06c..a88aaf39fa 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_io_list.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_list.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * * Copyright (C) 2006 Unknown (TODO: fix this) @@ -27,7 +27,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, int etypes_in_filetype = -1, size_in_filetype = -1; int bytes_into_filetype = 0; MPI_Offset total_bytes_accessed = 0; - + /* parameters for offset-length pairs arrays */ int64_t buf_off_arr[MAX_OL_COUNT]; int32_t buf_len_arr[MAX_OL_COUNT]; @@ -35,7 +35,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, int32_t file_len_arr[MAX_OL_COUNT]; int32_t buf_ol_count = 0; int32_t file_ol_count = 0; - + /* parameters for flattened memory and file datatypes*/ int flat_buf_index = 0; int flat_file_index = 0; @@ -46,7 +46,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, MPI_Aint filetype_extent = -1, buftype_extent = -1;; MPI_Aint filetype_lb = -1, buftype_lb = -1;; int buftype_is_contig = -1, filetype_is_contig = -1; - + /* PVFS2 specific parameters */ PVFS_Request mem_req, file_req; ADIOI_PVFS2_fs * pvfs_fs; @@ -74,7 +74,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, io_size = buftype_size*count; pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - + /* Flatten the memory datatype * (file datatype has already been flattened in ADIO open * unless it is contibuous, then we need to flatten it manually) @@ -83,20 +83,17 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); if (buftype_is_contig == 0) { - ADIOI_Flatten_datatype(datatype); - flat_buf_p = ADIOI_Flatlist; - while (flat_buf_p->type != datatype) - flat_buf_p = flat_buf_p->next; + flat_buf_p = ADIOI_Flatten_and_find(datatype); } - else + else { /* flatten and add to the list */ flat_buf_p = (ADIOI_Flatlist_node *) ADIOI_Malloc (sizeof(ADIOI_Flatlist_node)); flat_buf_p->blocklens = (ADIO_Offset*)ADIOI_Malloc(sizeof(ADIO_Offset)); - flat_buf_p->indices = + flat_buf_p->indices = (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset)); - /* For the buffer, we can optimize the buftype, this is not + /* For the buffer, we can optimize the buftype, this is not * possible with the filetype since it is tiled */ buftype_size = buftype_size*count; buftype_extent = buftype_size*count; @@ -109,10 +106,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, /* TODO: why does avery say this should already have been * flattened in Open, but also says contig types don't get * flattened */ - ADIOI_Flatten_datatype(fd->filetype); - flat_file_p = ADIOI_Flatlist; - while (flat_file_p->type != fd->filetype) - flat_file_p = flat_file_p->next; + flat_file_p = ADIOI_Flatten_and_find(fd->filetype); } else { @@ -120,18 +114,18 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, flat_file_p = (ADIOI_Flatlist_node *) ADIOI_Malloc (sizeof(ADIOI_Flatlist_node)); flat_file_p->blocklens =(ADIO_Offset*)ADIOI_Malloc(sizeof(ADIO_Offset)); - flat_file_p->indices = + flat_file_p->indices = (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset)); flat_file_p->blocklens[0] = filetype_size; flat_file_p->indices[0] = 0; flat_file_p->count = 1; } - - /* Find out where we are in the flattened filetype (the block index, + + /* Find out where we are in the flattened filetype (the block index, * how far into the block, and how many bytes_into_filetype) - * If the file_ptr_type == ADIO_INDIVIDUAL we will use disp, fp_ind - * to figure this out (offset should always be zero) - * If file_ptr_type == ADIO_EXPLICIT, we will use disp and offset + * If the file_ptr_type == ADIO_INDIVIDUAL we will use disp, fp_ind + * to figure this out (offset should always be zero) + * If file_ptr_type == ADIO_EXPLICIT, we will use disp and offset * to figure this out. */ etype_size = fd->etype_size; @@ -171,7 +165,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, assert(i != flat_file_p->count); } else - { + { num_filetypes = (int) (offset / num_etypes_in_filetype); etypes_in_filetype = (int) (offset % num_etypes_in_filetype); size_in_filetype = etypes_in_filetype * etype_size; @@ -179,10 +173,10 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, tmp_filetype_size = 0; for (i=0; icount; i++) { tmp_filetype_size += flat_file_p->blocklens[i]; - if (tmp_filetype_size > size_in_filetype) + if (tmp_filetype_size > size_in_filetype) { flat_file_index = i; - cur_flat_file_reg_off = flat_file_p->blocklens[i] - + cur_flat_file_reg_off = flat_file_p->blocklens[i] - (tmp_filetype_size - size_in_filetype); bytes_into_filetype = offset * filetype_size - flat_file_p->blocklens[i]; @@ -194,7 +188,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, fprintf(stderr, "ADIOI_PVFS2_StridedListIO: (fd->fp_ind=%Ld,fd->disp=%Ld," " offset=%Ld)\n(flat_file_index=%d,cur_flat_file_reg_off=%Ld," "bytes_into_filetype=%d)\n", - fd->fp_ind, fd->disp, offset, flat_file_index, + fd->fp_ind, fd->disp, offset, flat_file_index, cur_flat_file_reg_off, bytes_into_filetype); #endif #ifdef DEBUG_LIST2 @@ -208,13 +202,13 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, fprintf(stderr, "(offset, length) = (%Ld, %d)\n", flat_file_p->indices[i], flat_file_p->blocklens[i]); -#endif +#endif /* total data written */ cur_io_size = 0; while (cur_io_size != io_size) { - /* Initialize the temporarily unrolling lists and + /* Initialize the temporarily unrolling lists and * and associated variables */ buf_ol_count = 0; file_ol_count = 0; @@ -276,7 +270,7 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, } } while (0); #endif - + /* Run list I/O operation */ ret = PVFS_Request_hindexed(buf_ol_count, buf_len_arr, buf_off_arr, PVFS_BYTE, &mem_req); @@ -286,16 +280,16 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, if (rw_type == READ) { ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, - buf, mem_req, + buf, mem_req, &(pvfs_fs->credentials), &resp_io); } - else + else { ret = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, - buf, mem_req, + buf, mem_req, &(pvfs_fs->credentials), &resp_io); } - if (ret != 0) + if (ret != 0) { fprintf(stderr, "ADIOI_PVFS2_StridedListIO: Warning - PVFS_sys_" "read/write returned %d and completed %lld bytes.\n", @@ -314,14 +308,14 @@ int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, PVFS_Request_free(&mem_req); PVFS_Request_free(&file_req); } - + #ifdef DEBUG_LIST fprintf(stderr, "ADIOI_PVFS2_StridedListIO: " - "total_bytes_accessed=%Ld,ret=%d\n", + "total_bytes_accessed=%Ld,ret=%d\n", total_bytes_accessed, ret); #endif - if (file_ptr_type == ADIO_INDIVIDUAL) + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_accessed; *error_code = MPI_SUCCESS; @@ -381,11 +375,11 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, int32_t *file_ol_count_p) { int region_size = -1; - + /* parameters for flattened memory and file datatypes*/ int64_t cur_flat_buf_reg_left = 0; int64_t cur_flat_file_reg_left = 0; - + #ifdef DEBUG_LIST2 fprintf(stderr, "gen_list_arr:\n"); #endif @@ -395,31 +389,31 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, fprintf(stderr, "buf_ol_count != 0 || file_ol_count != 0\n"); return -1; } - - /* Start on a non-zero memory and file region - * Note this does not affect the bytes_completed - * since no data is in these regions. Initialize the + + /* Start on a non-zero memory and file region + * Note this does not affect the bytes_completed + * since no data is in these regions. Initialize the * first memory and file offsets. */ while (flat_buf_p->blocklens[(*flat_buf_index_p)] == 0) { - (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % + (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % flat_buf_p->count; } buf_off_arr[*buf_ol_count_p] = - (*bytes_completed / flat_buf_size) * - flat_buf_extent + + (*bytes_completed / flat_buf_size) * + flat_buf_extent + flat_buf_p->indices[*flat_buf_index_p] + *cur_flat_buf_reg_off_p; buf_len_arr[*buf_ol_count_p] = 0; while (flat_file_p->blocklens[(*flat_file_index_p)] == 0) { - (*flat_file_index_p) = ((*flat_file_index_p) + 1) % + (*flat_file_index_p) = ((*flat_file_index_p) + 1) % flat_file_p->count; } - file_off_arr[*file_ol_count_p] = disp + - (((bytes_into_filetype + *bytes_completed) / flat_file_size) * - flat_file_extent) + + file_off_arr[*file_ol_count_p] = disp + + (((bytes_into_filetype + *bytes_completed) / flat_file_size) * + flat_file_extent) + flat_file_p->indices[*flat_file_index_p] + *cur_flat_file_reg_off_p; file_len_arr[*file_ol_count_p] = 0; @@ -443,21 +437,21 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, - *cur_flat_file_reg_off_p; #ifdef DEBUG_LIST2 - fprintf(stderr, + fprintf(stderr, "flat_buf_index=%d flat_buf->blocklens[%d]=%d\n" "cur_flat_buf_reg_left=%Ld " - "*cur_flat_buf_reg_off_p=%Ld\n" + "*cur_flat_buf_reg_off_p=%Ld\n" "flat_file_index=%d flat_file->blocklens[%d]=%d\n" "cur_flat_file_reg_left=%Ld " - "*cur_flat_file_reg_off_p=%Ld\n" + "*cur_flat_file_reg_off_p=%Ld\n" "bytes_completed=%Ld\n" "buf_ol_count=%d file_ol_count=%d\n" "buf_len_arr[%d]=%d file_len_arr[%d]=%d\n\n", - *flat_buf_index_p, *flat_buf_index_p, + *flat_buf_index_p, *flat_buf_index_p, flat_buf_p->blocklens[*flat_buf_index_p], cur_flat_buf_reg_left, *cur_flat_buf_reg_off_p, - *flat_file_index_p, *flat_file_index_p, + *flat_file_index_p, *flat_file_index_p, flat_file_p->blocklens[*flat_file_index_p], cur_flat_file_reg_left, *cur_flat_file_reg_off_p, @@ -476,26 +470,26 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, region_size = cur_flat_file_reg_left; else region_size = cur_flat_buf_reg_left; - + if (region_size > total_io_size - *bytes_completed) region_size = total_io_size - *bytes_completed; - + /* Add this piece to both the mem and file arrays - * coalescing offset-length pairs if possible and advance + * coalescing offset-length pairs if possible and advance * the pointers through the flatten mem and file datatypes - * as well Note: no more than a single piece can be done + * as well Note: no more than a single piece can be done * since we take the smallest one possible */ - + if (cur_flat_buf_reg_left == region_size) { #ifdef DEBUG_LIST2 fprintf(stderr, "reached end of memory block...\n"); #endif - (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % + (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % flat_buf_p->count; while (flat_buf_p->blocklens[(*flat_buf_index_p)] == 0) { - (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % + (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % flat_buf_p->count; } *cur_flat_buf_reg_off_p = 0; @@ -525,13 +519,13 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, } #endif - /* Don't prepare for the next piece if we have reached + /* Don't prepare for the next piece if we have reached * the limit or else it will segment fault. */ if ((*buf_ol_count_p) != max_ol_count) { - buf_off_arr[*buf_ol_count_p] = - ((*bytes_completed + region_size) / flat_buf_size) * - flat_buf_extent + + buf_off_arr[*buf_ol_count_p] = + ((*bytes_completed + region_size) / flat_buf_size) * + flat_buf_extent + flat_buf_p->indices[*flat_buf_index_p] + (*cur_flat_buf_reg_off_p); buf_len_arr[*buf_ol_count_p] = 0; @@ -550,8 +544,8 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, { fprintf(stderr, "gen_listio_arr: Error\n"); } - - /* To calculate the absolute file offset we need to + + /* To calculate the absolute file offset we need to * add the disp, how many filetypes we have gone through, * the relative block offset in the filetype and how far * into the block we have gone. */ @@ -560,11 +554,11 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, #ifdef DEBUG_LIST2 fprintf(stderr, "reached end of file block...\n"); #endif - (*flat_file_index_p) = ((*flat_file_index_p) + 1) % + (*flat_file_index_p) = ((*flat_file_index_p) + 1) % flat_file_p->count; while (flat_file_p->blocklens[(*flat_file_index_p)] == 0) { - (*flat_file_index_p) = ((*flat_file_index_p) + 1) % + (*flat_file_index_p) = ((*flat_file_index_p) + 1) % flat_file_p->count; } (*cur_flat_file_reg_off_p) = 0; @@ -598,10 +592,10 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, * the limit or else it will segment fault. */ if ((*file_ol_count_p) != max_ol_count) { - file_off_arr[*file_ol_count_p] = disp + - (((bytes_into_filetype + *bytes_completed + region_size) - / flat_file_size) * - flat_file_extent) + + file_off_arr[*file_ol_count_p] = disp + + (((bytes_into_filetype + *bytes_completed + region_size) + / flat_file_size) * + flat_file_extent) + flat_file_p->indices[*flat_file_index_p] + (*cur_flat_file_reg_off_p); file_len_arr[*file_ol_count_p] = 0; @@ -621,12 +615,12 @@ int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, fprintf(stderr, "gen_listio_arr: Error\n"); } #ifdef DEBUG_LIST2 - fprintf(stderr, + fprintf(stderr, "------------------------------\n\n"); #endif *bytes_completed += region_size; } - /* Increment the count if we stopped in the middle of a + /* Increment the count if we stopped in the middle of a * memory or file region */ if (*cur_flat_buf_reg_off_p != 0) (*buf_ol_count_p)++; @@ -646,7 +640,7 @@ void print_buf_file_ol_pairs(int64_t buf_off_arr[], int rw_type) { int i = -1; - + fprintf(stderr, "buf_ol_pairs(offset,length) count = %d\n", buf_ol_count); for (i = 0; i < buf_ol_count; i++) diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_open.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_open.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_open.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_open.c index 54dba29a0e..f266c88e5c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -14,13 +14,13 @@ struct open_status_s { PVFS_object_ref object_ref; }; typedef struct open_status_s open_status; - + /* steps for getting a handle: (it gets a little convoluted, but at least - * it's deterministic) - * . lookup the file. + * it's deterministic) + * . lookup the file. * . if lookup succeeds, but we were passed MPI_MODE_EXCL, that's an error - * . if lookup fails, the file might not exist. - * in that case, create the file if we were passed MPI_MODE_CREATE + * . if lookup fails, the file might not exist. + * in that case, create the file if we were passed MPI_MODE_CREATE * . if the create fails, that means someone else created the file between * our call to lookup and our call to create (like if N processors all * open the same file with MPI_COMM_SELF). Then we can just look up the @@ -31,7 +31,7 @@ typedef struct open_status_s open_status; */ static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, int nr_datafiles, PVFS_size strip_size, - ADIOI_PVFS2_fs *pvfs2_fs, + ADIOI_PVFS2_fs *pvfs2_fs, open_status *o_status) { int ret; @@ -48,7 +48,7 @@ static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, } dist = NULL; - + memset(&resp_lookup, 0, sizeof(resp_lookup)); memset(&resp_getparent, 0, sizeof(resp_getparent)); memset(&resp_create, 0, sizeof(resp_create)); @@ -59,13 +59,13 @@ static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, if ( ret == (-PVFS_ENOENT)) { if (access_mode & ADIO_CREATE) { ret = PVFS_sys_getparent(fs_id, pvfs_name, - &(pvfs2_fs->credentials), &resp_getparent); + &(pvfs2_fs->credentials), &resp_getparent); if (ret < 0) { FPRINTF(stderr, "pvfs_sys_getparent returns with %d\n", ret); o_status->error = ret; return; } - + /* Set the distribution strip size if specified */ if (0 < strip_size) { /* Note that the distribution is hardcoded here */ @@ -83,13 +83,13 @@ static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, /* Perform file creation */ #ifdef HAVE_PVFS2_CREATE_WITHOUT_LAYOUT - ret = PVFS_sys_create(resp_getparent.basename, - resp_getparent.parent_ref, attribs, - &(pvfs2_fs->credentials), dist, &resp_create); -#else - ret = PVFS_sys_create(resp_getparent.basename, - resp_getparent.parent_ref, attribs, - &(pvfs2_fs->credentials), dist, NULL, &resp_create); + ret = PVFS_sys_create(resp_getparent.basename, + resp_getparent.parent_ref, attribs, + &(pvfs2_fs->credentials), dist, &resp_create); +#else + ret = PVFS_sys_create(resp_getparent.basename, + resp_getparent.parent_ref, attribs, + &(pvfs2_fs->credentials), dist, NULL, &resp_create); #endif /* if many creates are happening in this directory, the earlier @@ -99,7 +99,7 @@ static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, * handle */ if (ret == (-PVFS_EEXIST)) { ret = PVFS_sys_lookup(fs_id, pvfs_name, - &(pvfs2_fs->credentials), &resp_lookup, + &(pvfs2_fs->credentials), &resp_lookup, PVFS2_LOOKUP_LINK_FOLLOW); if ( ret < 0 ) { o_status->error = ret; @@ -130,7 +130,7 @@ static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, /* ADIOI_PVFS2_Open: * one process opens (or creates) the file, then broadcasts the result to the - * remaining processors. + * remaining processors. * * ADIO_Open used to perform an optimization when MPI_MODE_CREATE (and before * that, MPI_MODE_EXCL) was set. Because PVFS2 handles file lookup and @@ -154,7 +154,7 @@ void ADIOI_PVFS2_Open(ADIO_File fd, int *error_code) MPI_Datatype types[2] = {MPI_INT, MPI_BYTE}; int lens[2] = {1, sizeof(PVFS_object_ref)}; MPI_Aint offsets[2]; - + pvfs2_fs = (ADIOI_PVFS2_fs *) ADIOI_Malloc(sizeof(ADIOI_PVFS2_fs)); /* --BEGIN ERROR HANDLING-- */ @@ -186,7 +186,7 @@ void ADIOI_PVFS2_Open(ADIO_File fd, int *error_code) #endif if (rank == fd->hints->ranklist[0] && fd->fs_ptr == NULL) { /* given the filename, figure out which pvfs filesystem it is on */ - ret = PVFS_util_resolve(fd->filename, &cur_fs, + ret = PVFS_util_resolve(fd->filename, &cur_fs, pvfs_path, PVFS_NAME_MAX); if (ret < 0 ) { PVFS_perror("PVFS_util_resolve", ret); @@ -225,7 +225,7 @@ void ADIOI_PVFS2_Open(ADIO_File fd, int *error_code) /* --BEGIN ERROR HANDLING-- */ if (o_status.error != 0) - { + { ADIOI_Free(pvfs2_fs); fd->fs_ptr = NULL; *error_code = MPIO_Err_create_code(MPI_SUCCESS, diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_read.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_read.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_read.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_read.c index 667ac6cd50..007b4dc393 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_read.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * vim: ts=8 sts=4 sw=4 noexpandtab + * + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ #include "ad_pvfs2_io.h" #include "ad_pvfs2_common.h" -void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -60,7 +60,7 @@ void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); #endif - ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, offset, buf, + ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, offset, buf, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); @@ -106,7 +106,7 @@ static int ADIOI_PVFS2_ReadStridedListIO(ADIO_File fd, void *buf, int count, static int ADIOI_PVFS2_ReadStridedDtypeIO(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int *error_code) { return ADIOI_PVFS2_StridedDtypeIO(fd, buf, count, @@ -126,12 +126,12 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File fd, void *buf, int count, * - new List I/O (from avery) * - classic List I/O (the one that's always been in ROMIO) * I imagine we'll keep Datatype as an optional optimization, and afer a - * release or two promote it to the default + * release or two promote it to the default */ int ret = -1; if (fd->hints->fs_hints.pvfs2.posix_read == ADIOI_HINT_ENABLE) { - ADIOI_GEN_ReadStrided(fd, buf, count, datatype, + ADIOI_GEN_ReadStrided(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); return; } @@ -158,12 +158,12 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File fd, void *buf, int count, } /* Use classic list I/O if no hints given base case */ - ADIOI_PVFS2_OldReadStrided(fd, buf, count, datatype, + ADIOI_PVFS2_OldReadStrided(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); return; } /* - * vim: ts=8 sts=4 sw=4 noexpandtab + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c index 1d5064832a..856c5b8c2f 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * vim: ts=8 sts=4 sw=4 noexpandtab + * + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -24,7 +24,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, int n_filetypes, etype_in_filetype; ADIO_Offset abs_off_in_filetype=0; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb; + MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset off, disp, start_off, initial_off; int flag, st_frd_size, st_n_filetypes; @@ -74,7 +74,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -84,7 +84,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, etype_size = fd->etype_size; bufsize = buftype_size * count; - + pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; if (!buftype_is_contig && filetype_is_contig) { @@ -93,11 +93,9 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, int64_t file_offset; int32_t file_length; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + etype_size * offset; file_list_count = 1; @@ -119,10 +117,10 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, /* step through each block in memory, filling memory arrays */ while (b_blks_read < total_blks_to_read) { for (i=0; icount; i++) { - mem_offsets[b_blks_read % MAX_ARRAY_SIZE] = + mem_offsets[b_blks_read % MAX_ARRAY_SIZE] = /* TODO: fix this compiler warning */ ((PVFS_size)buf + j*buftype_extent + flat_buf->indices[i]); - mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = + mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = flat_buf->blocklens[i]; file_length += flat_buf->blocklens[i]; b_blks_read++; @@ -136,7 +134,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, /* in case last read list call fills max arrays */ if (!mem_list_count) mem_list_count = MAX_ARRAY_SIZE; } - err_flag = PVFS_Request_hindexed(mem_list_count, + err_flag = PVFS_Request_hindexed(mem_list_count, mem_lengths, mem_offsets, PVFS_BYTE, &mem_req); if (err_flag < 0) break; err_flag = PVFS_Request_contiguous(file_length, @@ -145,7 +143,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); #endif - err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, + err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, file_offset, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING @@ -164,21 +162,21 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, PVFS_Request_free(&file_req); total_bytes_read += resp_io.total_completed; /* --END ERROR HANDLING-- */ - - /* in the case of error or the last read list call, + + /* in the case of error or the last read list call, * leave here */ if (err_flag || b_blks_read == total_blks_to_read) break; file_offset += file_length; file_length = 0; - } + } } /* for (i=0; icount; i++) */ j++; } /* while (b_blks_read < total_blks_to_read) */ ADIOI_Free(mem_offsets); ADIOI_Free(mem_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_read; fd->fp_sys_posn = -1; /* set it to null. */ @@ -217,11 +215,11 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - frd_size = (int) (disp + flat_file->indices[i] + + frd_size = (int) (disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] - offset); flag = 1; @@ -235,7 +233,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -247,16 +245,16 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, break; } } - + /* abs. offset in bytes in the file */ - offset = disp + ((ADIO_Offset) n_filetypes)*filetype_extent + + offset = disp + ((ADIO_Offset) n_filetypes)*filetype_extent + abs_off_in_filetype; } /* else [file_ptr_type != ADIO_INDIVIDUAL] */ start_off = offset; st_frd_size = frd_size; st_n_filetypes = n_filetypes; - + if (buftype_is_contig && !filetype_is_contig) { /* contiguous in memory, noncontiguous in file. should be the most @@ -264,13 +262,13 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, int mem_length=0; intptr_t mem_offset; - + i = 0; j = st_index; n_filetypes = st_n_filetypes; - + mem_list_count = 1; - + /* determine how many blocks in file to read */ f_data_read = ADIOI_MIN(st_frd_size, bufsize); total_blks_to_read = 1; @@ -283,17 +281,17 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, f_data_read += flat_file->blocklens[j]; total_blks_to_read++; if (j<(flat_file->count-1)) j++; - else j = 0; + else j = 0; } - + j = st_index; n_filetypes = st_n_filetypes; n_read_lists = total_blks_to_read/MAX_ARRAY_SIZE; extra_blks = total_blks_to_read%MAX_ARRAY_SIZE; - + mem_offset = (intptr_t)buf; mem_lengths = 0; - + /* if at least one full readlist, allocate file arrays at max array size and don't free until very end */ if (n_read_lists) { @@ -310,7 +308,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, file_lengths = (int32_t*)ADIOI_Malloc(extra_blks* sizeof(int32_t)); } - + /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ for (i=0; iindices[j]; file_lengths[k] = flat_file->blocklens[j]; @@ -346,7 +344,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } /* --END ERROR HANDLING-- */ - err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, + err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, file_offsets, PVFS_BYTE, &file_req); /* --BEGIN ERROR HANDLING-- */ @@ -366,7 +364,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); #endif - err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, + err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, (void *)mem_offset, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING @@ -400,7 +398,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } for (k=0; kindices[j]; if (k == (extra_blks - 1)) { @@ -429,7 +427,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } /* --END ERROR HANDLING-- */ - err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, + err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, file_offsets, PVFS_BYTE, &file_req); /* --BEGIN ERROR HANDLING-- */ if (err_flag != 0) { @@ -446,7 +444,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); #endif - err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, + err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, (void *)mem_offset, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); @@ -457,7 +455,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, MPIR_ERR_RECOVERABLE, myname, __LINE__, ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_read", 0); + "Error in PVFS_sys_read", 0); goto error_state; } /* --END ERROR HANDLING-- */ @@ -468,10 +466,8 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } else { /* noncontiguous in memory as well as in file */ - - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + + flat_buf = ADIOI_Flatten_and_find(datatype); size_read = 0; n_filetypes = st_n_filetypes; @@ -484,7 +480,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, max_mem_list = 0; max_file_list = 0; - /* run through and file max_file_list and max_mem_list so that you + /* run through and file max_file_list and max_mem_list so that you can allocate the file and memory arrays less than MAX_ARRAY_SIZE if possible */ @@ -492,7 +488,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, k = start_k; new_buffer_read = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -500,9 +496,9 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_read + flat_buf->blocklens[k] + + if((new_buffer_read + flat_buf->blocklens[k] + size_read) > bufsize) { - end_brd_size = new_buffer_read + + end_brd_size = new_buffer_read + flat_buf->blocklens[k] - (bufsize - size_read); new_buffer_read = bufsize - size_read; } @@ -520,15 +516,15 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ j = start_j; new_file_read = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_read < new_buffer_read)) { if(file_list_count) { - if((new_file_read + flat_file->blocklens[j]) > + if((new_file_read + flat_file->blocklens[j]) > new_buffer_read) { end_frd_size = new_buffer_read - new_file_read; new_file_read = new_buffer_read; @@ -549,9 +545,9 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_read < new_buffer_read) && + if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_read = 0; mem_list_count = 0; @@ -580,13 +576,13 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } /* while (new_buffer_read < new_file_read) */ } /* if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ /* fakes filling the readlist arrays of lengths found above */ k = start_k; j = start_j; - for (i=0; iblocklens[k] == end_brd_size) @@ -607,7 +603,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, if (i == (file_list_count - 1)) { if (flat_file->blocklens[j] == end_frd_size) frd_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { frd_size = flat_file->blocklens[j] - end_frd_size; j--; @@ -640,11 +636,11 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, * region and many (700) very small memory regions. both cases caused * problems for this code */ - if ( ( (file_list_count == 1) && + if ( ( (file_list_count == 1) && (new_file_read < flat_file->blocklens[0] ) ) || - ((mem_list_count == 1) && + ((mem_list_count == 1) && (new_buffer_read < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && + ((file_list_count == MAX_ARRAY_SIZE) && (new_file_read < flat_buf->blocklens[0]) ) || ( (mem_list_count == MAX_ARRAY_SIZE) && (new_buffer_read < flat_file->blocklens[0])) ) @@ -660,7 +656,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, mem_lengths = (int *)ADIOI_Malloc(max_mem_list*sizeof(int)); file_offsets = (int64_t *)ADIOI_Malloc(max_file_list*sizeof(int64_t)); file_lengths = (int32_t *)ADIOI_Malloc(max_file_list*sizeof(int32_t)); - + size_read = 0; n_filetypes = st_n_filetypes; frd_size = st_frd_size; @@ -673,12 +669,12 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, /* this section calculates mem_list_count and file_list_count and also finds the possibly odd sized last array elements in new_frd_size and new_brd_size */ - + while (size_read < bufsize) { k = start_k; new_buffer_read = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -686,9 +682,9 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_read + flat_buf->blocklens[k] + + if((new_buffer_read + flat_buf->blocklens[k] + size_read) > bufsize) { - end_brd_size = new_buffer_read + + end_brd_size = new_buffer_read + flat_buf->blocklens[k] - (bufsize - size_read); new_buffer_read = bufsize - size_read; } @@ -706,15 +702,15 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ j = start_j; new_file_read = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_read < new_buffer_read)) { if(file_list_count) { - if((new_file_read + flat_file->blocklens[j]) > + if((new_file_read + flat_file->blocklens[j]) > new_buffer_read) { end_frd_size = new_buffer_read - new_file_read; new_file_read = new_buffer_read; @@ -735,9 +731,9 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_read < new_buffer_read) && + if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_read = 0; mem_list_count = 0; @@ -766,13 +762,13 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, } /* while (new_buffer_read < new_file_read) */ } /* if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ /* fills the allocated readlist arrays */ k = start_k; j = start_j; - for (i=0; icount) + (int)flat_buf->indices[k]); @@ -800,7 +796,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, k = (k + 1)%flat_buf->count; } /* for (i=0; iindices[j] + + file_offsets[i] = disp + flat_file->indices[j] + ((ADIO_Offset)n_filetypes) * filetype_extent; if (!i) { file_lengths[0] = frd_size; @@ -811,7 +807,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, file_lengths[i] = end_frd_size; if (flat_file->blocklens[j] == end_frd_size) frd_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { frd_size = flat_file->blocklens[j] - end_frd_size; j--; @@ -825,7 +821,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, n_filetypes++; } } /* for (i=0; iobject_ref, file_req, 0, + err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); @@ -882,7 +878,7 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, /* when incrementing fp_ind, need to also take into account the file type: * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1) + * at empty region at offset N+1) * * As we discussed on mpich-discuss in may/june 2009, the code below might * look wierd, but by putting fp_ind at the last byte written, the next @@ -892,10 +888,10 @@ void ADIOI_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, fd->fp_ind = file_offsets[file_list_count-1]+ file_lengths[file_list_count-1]; } - + ADIOI_Free(file_offsets); ADIOI_Free(file_lengths); - + if (err_flag == 0) *error_code = MPI_SUCCESS; error_state: @@ -903,11 +899,11 @@ error_state: #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); - /* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually read and placed in buf + /* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually read and placed in buf by ADIOI_BUFFERED_READ. */ #endif - + if (!buftype_is_contig) ADIOI_Delete_flattened(datatype); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_resize.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_resize.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_resize.c index c68e1ec372..db219db0fd 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,8 +23,8 @@ void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) MPI_Comm_rank(fd->comm, &rank); - /* We desginate one node in the communicator to be an 'io_worker' in - * ADIO_Open. This node can perform operations on files and then + /* We desginate one node in the communicator to be an 'io_worker' in + * ADIO_Open. This node can perform operations on files and then * inform the other nodes of the result */ /* MPI-IO semantics treat conflicting MPI_File_set_size requests the @@ -33,7 +33,7 @@ void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) * syncronization point is reached */ if (rank == fd->hints->ranklist[0]) { - ret = PVFS_sys_truncate(pvfs_fs->object_ref, + ret = PVFS_sys_truncate(pvfs_fs->object_ref, size, &(pvfs_fs->credentials)); MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); } else { @@ -52,5 +52,5 @@ void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) } /* - * vim: ts=8 sts=4 sw=4 noexpandtab + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_write.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_write.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_write.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_write.c index 27f08738e7..93e142bb68 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_write.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -118,7 +118,7 @@ int ADIOI_PVFS2_WriteStridedListIO(ADIO_File fd, const void *buf, int count, int ADIOI_PVFS2_WriteStridedDtypeIO(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int *error_code) { return ADIOI_PVFS2_StridedDtypeIO(fd, (void *)buf, count, @@ -139,7 +139,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File fd, const void *buf, int count, * - new List I/O (from avery) * - classic List I/O (the one that's always been in ROMIO) * I imagine we'll keep Datatype as an optional optimization, and afer a - * release or two promote it to the default + * release or two promote it to the default */ /* a lot of near-duplication from ADIOI_PVFS2_ReadStrided: for @@ -170,7 +170,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File fd, const void *buf, int count, } /* Use list I/O in the base case */ if (fd->hints->fs_hints.pvfs2.listio_write == ADIOI_HINT_ENABLE) { - ret = ADIOI_PVFS2_WriteStridedListIO(fd, buf, count, datatype, + ret = ADIOI_PVFS2_WriteStridedListIO(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); return; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c rename to ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c index 44e536214f..7a9758c30e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c +++ b/ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * vim: ts=8 sts=4 sw=4 noexpandtab + * + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -57,7 +57,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, MPI_Offset total_bytes_written=0; static char myname[] = "ADIOI_PVFS2_WRITESTRIDED"; - /* note: don't increase this: several parts of PVFS2 now + /* note: don't increase this: several parts of PVFS2 now * assume this limit*/ #define MAX_ARRAY_SIZE 64 @@ -90,7 +90,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -98,7 +98,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, MPI_Type_size_x(datatype, &buftype_size); MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); etype_size = fd->etype_size; - + bufsize = buftype_size * count; pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; @@ -109,10 +109,8 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, int64_t file_offset; int32_t file_length; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; - + flat_buf = ADIOI_Flatten_and_find(datatype); + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { off = fd->disp + etype_size * offset; } @@ -135,12 +133,12 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, /* step through each block in memory, filling memory arrays */ while (b_blks_wrote < total_blks_to_write) { for (i=0; icount; i++) { - mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] = + mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] = /* TODO: fix this warning by casting to an integer that's * the same size as a char * and /then/ casting to * PVFS_size */ ((PVFS_size)buf + j*buftype_extent + flat_buf->indices[i]); - mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = + mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = flat_buf->blocklens[i]; file_length += flat_buf->blocklens[i]; b_blks_wrote++; @@ -154,7 +152,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, /* in case last write list call fills max arrays */ if (!mem_list_count) mem_list_count = MAX_ARRAY_SIZE; } - err_flag = PVFS_Request_hindexed(mem_list_count, + err_flag = PVFS_Request_hindexed(mem_list_count, mem_lengths, mem_offsets, PVFS_BYTE, &mem_req); /* --BEGIN ERROR HANDLING-- */ @@ -184,17 +182,17 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, + err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, file_offset, PVFS_BOTTOM, - mem_req, + mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); #endif total_bytes_written += resp_io.total_completed; - - /* in the case of error or the last write list call, + + /* in the case of error or the last write list call, * leave here */ /* --BEGIN ERROR HANDLING-- */ if (err_flag) { @@ -212,14 +210,14 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, file_length = 0; PVFS_Request_free(&mem_req); PVFS_Request_free(&file_req); - } + } } /* for (i=0; icount; i++) */ j++; } /* while (b_blks_wrote < total_blks_to_write) */ ADIOI_Free(mem_offsets); ADIOI_Free(mem_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_written; if (!err_flag) *error_code = MPI_SUCCESS; @@ -228,7 +226,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif @@ -247,7 +245,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, initial_off = offset; /* for each case - ADIO_Individual pointer or explicit, find offset - (file offset in bytes), n_filetypes (how many filetypes into file + (file offset in bytes), n_filetypes (how many filetypes into file to start), fwr_size (remaining amount of data in present file block), and st_index (start point in terms of blocks in starting filetype) */ @@ -258,11 +256,11 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - fwr_size = disp + flat_file->indices[i] + + fwr_size = disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -276,7 +274,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -297,7 +295,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, start_off = offset; st_fwr_size = fwr_size; st_n_filetypes = n_filetypes; - + if (buftype_is_contig && !filetype_is_contig) { /* contiguous in memory, noncontiguous in file. should be the most @@ -305,14 +303,14 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, int mem_length; intptr_t mem_offset; - + i = 0; j = st_index; off = offset; n_filetypes = st_n_filetypes; - + mem_list_count = 1; - + /* determine how many blocks in file to write */ f_data_wrote = ADIOI_MIN(st_fwr_size, bufsize); total_blks_to_write = 1; @@ -325,17 +323,17 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, f_data_wrote += flat_file->blocklens[j]; total_blks_to_write++; if (j<(flat_file->count-1)) j++; - else j = 0; + else j = 0; } - + j = st_index; n_filetypes = st_n_filetypes; n_write_lists = total_blks_to_write/MAX_ARRAY_SIZE; extra_blks = total_blks_to_write%MAX_ARRAY_SIZE; - + mem_offset = (intptr_t) buf; mem_length = 0; - + /* if at least one full writelist, allocate file arrays at max array size and don't free until very end */ if (n_write_lists) { @@ -352,7 +350,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, file_lengths = (int32_t*)ADIOI_Malloc(extra_blks* sizeof(int32_t)); } - + /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ for (i=0; iindices[j]; file_lengths[k] = flat_file->blocklens[j]; @@ -389,7 +387,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } /* --END ERROR HANDLING-- */ - err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, + err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, file_offsets, PVFS_BYTE, &file_req); /* --BEGIN ERROR HANDLING-- */ @@ -409,7 +407,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, + err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, (void *)mem_offset, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING @@ -443,7 +441,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } for (k=0; kindices[j]; if (k == (extra_blks - 1)) { @@ -473,7 +471,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } /* --END ERROR HANDLING-- */ - err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, + err_flag = PVFS_Request_hindexed(file_list_count, file_lengths, file_offsets, PVFS_BYTE, &file_req); /* --BEGIN ERROR HANDLING-- */ @@ -491,7 +489,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, + err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, (void *)mem_offset, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING @@ -511,13 +509,11 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, PVFS_Request_free(&mem_req); PVFS_Request_free(&file_req); } - } + } else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); size_wrote = 0; n_filetypes = st_n_filetypes; @@ -530,7 +526,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, max_mem_list = 0; max_file_list = 0; - /* run through and file max_file_list and max_mem_list so that you + /* run through and file max_file_list and max_mem_list so that you can allocate the file and memory arrays less than MAX_ARRAY_SIZE if possible */ @@ -538,7 +534,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, k = start_k; new_buffer_write = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -546,9 +542,9 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, written in the next immediate write list is less than bufsize */ if(mem_list_count) { - if((new_buffer_write + flat_buf->blocklens[k] + + if((new_buffer_write + flat_buf->blocklens[k] + size_wrote) > bufsize) { - end_bwr_size = new_buffer_write + + end_bwr_size = new_buffer_write + flat_buf->blocklens[k] - (bufsize - size_wrote); new_buffer_write = bufsize - size_wrote; } @@ -566,15 +562,15 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ j = start_j; new_file_write = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && - (new_file_write < new_buffer_write)) { + while ((file_list_count < MAX_ARRAY_SIZE) && + (new_file_write < new_buffer_write)) { if(file_list_count) { - if((new_file_write + flat_file->blocklens[j]) > + if((new_file_write + flat_file->blocklens[j]) > new_buffer_write) { end_fwr_size = new_buffer_write - new_file_write; new_file_write = new_buffer_write; @@ -595,9 +591,9 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_write < new_buffer_write) && + if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_write = 0; mem_list_count = 0; @@ -605,7 +601,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, if(mem_list_count) { if((new_buffer_write + flat_buf->blocklens[k]) > new_file_write) { - end_bwr_size = new_file_write - + end_bwr_size = new_file_write - new_buffer_write; new_buffer_write = new_file_write; k--; @@ -627,13 +623,13 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } /* while (new_buffer_write < new_file_write) */ } /* if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ /* fakes filling the writelist arrays of lengths found above */ k = start_k; j = start_j; - for (i=0; iblocklens[k] == end_bwr_size) @@ -654,7 +650,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, if (i == (file_list_count - 1)) { if (flat_file->blocklens[j] == end_fwr_size) fwr_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { fwr_size = flat_file->blocklens[j] - end_fwr_size; j--; @@ -687,11 +683,11 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, * region and many (700) very small memory regions. both cases caused * problems for this code */ - if ( ( (file_list_count == 1) && + if ( ( (file_list_count == 1) && (new_file_write < flat_file->blocklens[0] ) ) || - ((mem_list_count == 1) && + ((mem_list_count == 1) && (new_buffer_write < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && + ((file_list_count == MAX_ARRAY_SIZE) && (new_file_write < flat_buf->blocklens[0]) ) || ( (mem_list_count == MAX_ARRAY_SIZE) && (new_buffer_write < flat_file->blocklens[0])) ) @@ -707,7 +703,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, mem_lengths = (int *)ADIOI_Malloc(max_mem_list*sizeof(int)); file_offsets = (int64_t *)ADIOI_Malloc(max_file_list*sizeof(int64_t)); file_lengths = (int32_t *)ADIOI_Malloc(max_file_list*sizeof(int32_t)); - + size_wrote = 0; n_filetypes = st_n_filetypes; fwr_size = st_fwr_size; @@ -720,12 +716,12 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, /* this section calculates mem_list_count and file_list_count and also finds the possibly odd sized last array elements in new_fwr_size and new_bwr_size */ - + while (size_wrote < bufsize) { k = start_k; new_buffer_write = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -733,9 +729,9 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, written in the next immediate write list is less than bufsize */ if(mem_list_count) { - if((new_buffer_write + flat_buf->blocklens[k] + + if((new_buffer_write + flat_buf->blocklens[k] + size_wrote) > bufsize) { - end_bwr_size = new_buffer_write + + end_bwr_size = new_buffer_write + flat_buf->blocklens[k] - (bufsize - size_wrote); new_buffer_write = bufsize - size_wrote; } @@ -753,15 +749,15 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ j = start_j; new_file_write = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_write < new_buffer_write)) { if(file_list_count) { - if((new_file_write + flat_file->blocklens[j]) > + if((new_file_write + flat_file->blocklens[j]) > new_buffer_write) { end_fwr_size = new_buffer_write - new_file_write; new_file_write = new_buffer_write; @@ -782,9 +778,9 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_write < new_buffer_write) && + if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_write = 0; mem_list_count = 0; @@ -814,19 +810,19 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } /* while (new_buffer_write < new_file_write) */ } /* if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ /* fills the allocated writelist arrays */ k = start_k; j = start_j; - for (i=0; icount) + (int)flat_buf->indices[k]); - + if(!i) { mem_lengths[0] = bwr_size; mem_offsets[0] += flat_buf->blocklens[k] - bwr_size; @@ -851,7 +847,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, k = (k + 1)%flat_buf->count; } /* for (i=0; iindices[j] + + file_offsets[i] = disp + flat_file->indices[j] + ((ADIO_Offset)n_filetypes) * filetype_extent; if (!i) { file_lengths[0] = fwr_size; @@ -862,7 +858,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, file_lengths[i] = end_fwr_size; if (flat_file->blocklens[j] == end_fwr_size) fwr_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { fwr_size = flat_file->blocklens[j] - end_fwr_size; j--; @@ -877,7 +873,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, } } /* for (i=0; iobject_ref, file_req, 0, + err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); #ifdef ADIOI_MPE_LOGGING @@ -939,7 +935,7 @@ void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, /* when incrementing fp_ind, need to also take into account the file type: * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1). + * at empty region at offset N+1). * * As we discussed on mpich-discuss in may/june 2009, the code below might * look wierd, but by putting fp_ind at the last byte written, the next @@ -959,7 +955,7 @@ error_state: #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_sfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_sfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/README b/ompi/mca/io/romio321/romio/adio/ad_sfs/README similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/README rename to ompi/mca/io/romio321/romio/adio/ad_sfs/README diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs.c b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs.c rename to ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs.c index d022016c57..c4c1609dd2 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -33,4 +33,6 @@ struct ADIOI_Fns_struct ADIO_SFS_operations = { ADIOI_SFS_Flush, /* Flush */ ADIOI_GEN_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs.h b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs.h similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs.h rename to ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs.h index 67d7fe7d23..9f029f0558 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -15,7 +15,7 @@ void ADIOI_SFS_Open(ADIO_File fd, int *error_code); void ADIOI_SFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_SFS_Flush(ADIO_File fd, int *error_code); #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_fcntl.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_fcntl.c index 8bef575586..533e26a77b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -21,17 +21,17 @@ void ADIOI_SFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *er switch(flag) { case ADIO_FCNTL_GET_FSIZE: /* On SFS, I find that a write from one process, which changes - the file size, does not automatically make the new file size - visible to other processes. Therefore, a sync-barrier-sync is - needed. (Other processes are able to read the data written + the file size, does not automatically make the new file size + visible to other processes. Therefore, a sync-barrier-sync is + needed. (Other processes are able to read the data written though; only file size is returned incorrectly.) */ fsync(fd->fd_sys); MPI_Barrier(fd->comm); fsync(fd->fd_sys); - + fcntl_struct->fsize = llseek(fd->fd_sys, 0, SEEK_END); - if (fd->fp_sys_posn != -1) + if (fd->fp_sys_posn != -1) llseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET); if (fcntl_struct->fsize == -1) { #ifdef MPICH @@ -42,7 +42,7 @@ void ADIOI_SFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *er #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_flush.c b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_flush.c similarity index 82% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_flush.c index 5a36dcd4fb..8fc7e358cf 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,10 +18,10 @@ void ADIOI_SFS_Flush(ADIO_File fd, int *error_code) *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", "**io %s", strerror(errno)); #elif defined(PRINT_ERR_MSG) - *error_code = MPI_ERR_UNKNOWN; + *error_code = MPI_ERR_UNKNOWN; #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_UNSUPPORTED_OPERATION, 1, myname, (char *) 0, (char *) 0); - ADIOI_Error(fd, *error_code, myname); + ADIOI_Error(fd, *error_code, myname); #endif } diff --git a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_open.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_open.c index dd614940b9..ebeefdcbcb 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_sfs/ad_sfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_sfs/ad_sfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -50,7 +50,7 @@ void ADIOI_SFS_Open(ADIO_File fd, int *error_code) #else /* MPICH-1 */ *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR, myname, "I/O Error", "%s", strerror(errno)); - ADIOI_Error(ADIO_FILE_NULL, *error_code, myname); + ADIOI_Error(ADIO_FILE_NULL, *error_code, myname); #endif } else *error_code = MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_testfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_testfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs.c index 00542b7164..6696847c3e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -35,5 +35,7 @@ struct ADIOI_Fns_struct ADIO_TESTFS_operations = { ADIOI_TESTFS_Resize, /* Resize */ ADIOI_TESTFS_Delete, /* Delete */ ADIOI_GEN_Feature, /* Features */ - "TESTFS: the logging-only file system" + "TESTFS: the logging-only file system", + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs.h b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs.h similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs.h rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs.h index 829620fc5f..7f51ced0d2 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs.h @@ -1,18 +1,18 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #ifndef AD_TESTFS_INCLUDE #define AD_TESTFS_INCLUDE +#include "adio.h" #include #include #include #include -#include "adio.h" void ADIOI_TESTFS_Open(ADIO_File fd, int *error_code); void ADIOI_TESTFS_Close(ADIO_File fd, int *error_code); @@ -23,25 +23,25 @@ void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, void ADIOI_TESTFS_WriteContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_TESTFS_IwriteContig(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); + *error_code); int ADIOI_TESTFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_TESTFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); void ADIOI_TESTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_TESTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code); + int *error_code); +void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, + int *error_code); void ADIOI_TESTFS_WriteStrided(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, @@ -68,13 +68,13 @@ void ADIOI_TESTFS_IwriteStrided(ADIO_File fd, const void *buf, int count, *error_code); void ADIOI_TESTFS_Flush(ADIO_File fd, int *error_code); void ADIOI_TESTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, +ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, int whence, int *error_code); void ADIOI_TESTFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, - ADIO_Offset *shared_fp, +void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, + ADIO_Offset *shared_fp, int *error_code); -void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, +void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code); void ADIOI_TESTFS_Delete(const char *filename, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_close.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_close.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_close.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_close.c index 7c6a9553df..a1b85e600d 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_close.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,6 +17,6 @@ void ADIOI_TESTFS_Close(ADIO_File fd, int *error_code) MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Close called on %s\n", myrank, + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Close called on %s\n", myrank, nprocs, fd->filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_delete.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_delete.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_delete.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_delete.c index 5563c3ddd3..9a1b6f37e1 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_delete.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,6 +16,6 @@ void ADIOI_TESTFS_Delete(const char *filename, int *error_code) MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Delete called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Delete called on %s\n", myrank, nprocs, filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_done.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_done.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_done.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_done.c index 1cbfa2af14..2ee3111587 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_done.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_done.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,7 +17,7 @@ int ADIOI_TESTFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int MPI_Comm_size( MPI_COMM_WORLD, &nprocs ); MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadDone called on ADIO_REQUEST_NULL\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadDone called on ADIO_REQUEST_NULL\n", myrank, nprocs); return 1; } @@ -32,8 +32,8 @@ int ADIOI_TESTFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int MPI_Comm_size( MPI_COMM_WORLD, &nprocs ); MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); - FPRINTF(stdout, - "[%d/%d] ADIOI_TESTFS_WriteDone called on ADIO_REQUEST_NULL\n", + FPRINTF(stdout, + "[%d/%d] ADIOI_TESTFS_WriteDone called on ADIO_REQUEST_NULL\n", myrank, nprocs); return 1; } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_fcntl.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_fcntl.c index e0ee8fa054..8b1e516d9a 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -9,7 +9,7 @@ #include "adioi.h" #include "adio_extern.h" -void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, +void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code) { int myrank, nprocs; @@ -19,7 +19,7 @@ void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Fcntl called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Fcntl called on %s\n", myrank, nprocs, fd->filename); switch(flag) { @@ -40,7 +40,7 @@ void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, default: /* --BEGIN ERROR HANDLING-- */ *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, + myname, __LINE__, MPI_ERR_ARG, "**flag", "**flag %d", flag); return; diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_flush.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_flush.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_flush.c index 304a666382..23d559787d 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,6 +16,6 @@ void ADIOI_TESTFS_Flush(ADIO_File fd, int *error_code) MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Flush called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Flush called on %s\n", myrank, nprocs, fd->filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_getsh.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_getsh.c similarity index 74% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_getsh.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_getsh.c index abdf38776b..2bdb3dceb8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_getsh.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_getsh.c @@ -1,15 +1,15 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_testfs.h" #include "adioi.h" -void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, - ADIO_Offset *shared_fp, +void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, + ADIO_Offset *shared_fp, int *error_code) { int myrank, nprocs; @@ -18,6 +18,6 @@ void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Get_shared_fp called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Get_shared_fp called on %s\n", myrank, nprocs, fd->filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_hints.c similarity index 83% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_hints.c index ffff0c9493..a6c1be9e9f 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,9 +18,9 @@ void ADIOI_TESTFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_SetInfo called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_SetInfo called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_SetInfo\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_SetInfo\n", myrank, nprocs); ADIOI_GEN_SetInfo(fd, users_info, error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_iread.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_iread.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_iread.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_iread.c index b402791a18..77e862438c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_iread.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_iread.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -12,7 +12,7 @@ * * Implemented by immediately calling ReadContig() */ -void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code) @@ -26,13 +26,13 @@ void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); MPI_Type_size_x(datatype, &typesize); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IreadContig called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IreadContig called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_ReadContig\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_ReadContig\n", myrank, nprocs); len = count * typesize; - ADIOI_TESTFS_ReadContig(fd, buf, len, MPI_BYTE, file_ptr_type, + ADIOI_TESTFS_ReadContig(fd, buf, len, MPI_BYTE, file_ptr_type, offset, &status, error_code); MPIO_Completed_request_create(&fd, len, error_code, request); @@ -50,13 +50,13 @@ void ADIOI_TESTFS_IreadStrided(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); MPI_Type_size_x(datatype, &typesize); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IreadStrided called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IreadStrided called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_ReadStrided\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_ReadStrided\n", myrank, nprocs); - ADIOI_TESTFS_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); + ADIOI_TESTFS_ReadStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); MPIO_Completed_request_create(&fd, count*typesize, error_code, request); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_iwrite.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_iwrite.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_iwrite.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_iwrite.c index bfa2b634ab..e29c9f6ee0 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_iwrite.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_iwrite.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -29,13 +29,13 @@ void ADIOI_TESTFS_IwriteContig(ADIO_File fd, const void *buf, int count, MPI_Type_size_x(datatype, &typesize); MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IwriteContig called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IwriteContig called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_WriteContig\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_WriteContig\n", myrank, nprocs); len = count * typesize; - ADIOI_TESTFS_WriteContig(fd, buf, len, MPI_BYTE, file_ptr_type, + ADIOI_TESTFS_WriteContig(fd, buf, len, MPI_BYTE, file_ptr_type, offset, &status, error_code); MPIO_Completed_request_create(&fd, len, error_code, request); @@ -56,12 +56,12 @@ void ADIOI_TESTFS_IwriteStrided(ADIO_File fd, const void *buf, int count, MPI_Comm_rank(fd->comm, &myrank); MPI_Type_size_x(datatype, &typesize); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IwriteStrided called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IwriteStrided called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_WriteStrided\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_WriteStrided\n", myrank, nprocs); - ADIOI_TESTFS_WriteStrided(fd, buf, count, datatype, file_ptr_type, + ADIOI_TESTFS_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, &status, error_code); MPIO_Completed_request_create(&fd, count*typesize, error_code, request); diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_open.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_open.c index 90751a2d31..6b1595b99c 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,6 +18,6 @@ void ADIOI_TESTFS_Open(ADIO_File fd, int *error_code) MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Open called on %s\n", myrank, + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Open called on %s\n", myrank, nprocs, fd->filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_rdcoll.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_rdcoll.c similarity index 81% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_rdcoll.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_rdcoll.c index 16d9759192..5df94458fd 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_rdcoll.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_rdcoll.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -10,7 +10,7 @@ void ADIOI_TESTFS_ReadStridedColl(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int *error_code) { int myrank, nprocs; @@ -19,9 +19,9 @@ void ADIOI_TESTFS_ReadStridedColl(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStridedColl called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStridedColl\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStridedColl called on %s\n", + myrank, nprocs, fd->filename); + FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStridedColl\n", myrank, nprocs); ADIOI_GEN_ReadStridedColl(fd, buf, count, datatype, file_ptr_type, diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_read.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_read.c index aa2f72f3ab..f60a9920f7 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_read.c @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2001 University of Chicago. +/* + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_testfs.h" #include "adioi.h" -void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -20,7 +20,7 @@ void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); MPI_Type_size_x(datatype, &datatype_size); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadContig called on %s\n", myrank, + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadContig called on %s\n", myrank, nprocs, fd->filename); if (file_ptr_type != ADIO_EXPLICIT_OFFSET) { @@ -33,7 +33,7 @@ void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, } FPRINTF(stdout, "[%d/%d] reading (buf = %p, loc = %lld, sz = %lld)\n", - myrank, nprocs, buf, (long long) offset, + myrank, nprocs, buf, (long long) offset, (long long) datatype_size * count); #ifdef HAVE_STATUS_SET_BYTES @@ -52,9 +52,9 @@ void ADIOI_TESTFS_ReadStrided(ADIO_File fd, void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStrided called on %s\n", myrank, + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStrided called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStrided\n", myrank, + FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStrided\n", myrank, nprocs); ADIOI_GEN_ReadStrided(fd, buf, count, datatype, file_ptr_type, offset, diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_resize.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_resize.c index 30fa9e0853..a4a37eb94b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,6 +16,6 @@ void ADIOI_TESTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Resize called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Resize called on %s\n", myrank, nprocs, fd->filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_seek.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_seek.c index 56d1043343..9366a1215e 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_seek.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_seek.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,9 +16,9 @@ * * Returns an absolute offset in bytes. The offset passed into the call is in * terms of the etype relative to the filetype, so some calculations are - * necessary. + * necessary. */ -ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, +ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, int whence, int *error_code) { int myrank, nprocs; @@ -36,7 +36,7 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_SeekIndividual called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_SeekIndividual called on %s\n", myrank, nprocs, fd->filename); ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); @@ -50,7 +50,7 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); MPI_Type_size_x(fd->filetype, &filetype_size); if ( ! filetype_size ) { - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return 0; } @@ -59,7 +59,7 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_setsh.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_setsh.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_setsh.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_setsh.c index 2b7e7560a4..6fc8a04be9 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_setsh.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_setsh.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "ad_testfs.h" #include "adioi.h" -void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, +void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code) { int myrank, nprocs; @@ -17,6 +17,6 @@ void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Set_shared_fp called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Set_shared_fp called on %s\n", myrank, nprocs, fd->filename); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_wait.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_wait.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_wait.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_wait.c index ffa4c51cdc..6eef9ef706 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_wait.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_wait.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,7 +17,7 @@ void ADIOI_TESTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadComplete called \n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadComplete called \n", myrank, nprocs); /* do something with status set bytes? */ @@ -32,7 +32,7 @@ void ADIOI_TESTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteComplete called\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteComplete called\n", myrank, nprocs); /* do something with status_set_bytes? */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_wrcoll.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_wrcoll.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_wrcoll.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_wrcoll.c index be87957df3..ac11f5847f 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_wrcoll.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_wrcoll.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -10,7 +10,7 @@ void ADIOI_TESTFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, + ADIO_Offset offset, ADIO_Status *status, int *error_code) { int myrank, nprocs; @@ -19,9 +19,9 @@ void ADIOI_TESTFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStridedColl called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStridedColl called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_WriteStridedColl\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_WriteStridedColl\n", myrank, nprocs); ADIOI_GEN_WriteStridedColl(fd, buf, count, datatype, file_ptr_type, diff --git a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_write.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_write.c index 70c9012b7a..e1a59ff010 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_testfs/ad_testfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_write.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2001 University of Chicago. +/* + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -20,17 +20,17 @@ void ADIOI_TESTFS_WriteContig(ADIO_File fd, const void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); MPI_Type_size_x(datatype, &datatype_size); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteContig called on %s\n", myrank, + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteContig called on %s\n", myrank, nprocs, fd->filename); FPRINTF(stdout, "[%d/%d] writing (buf = %p, loc = %lld, sz = %lld)\n", - myrank, nprocs, buf, (long long) offset, + myrank, nprocs, buf, (long long) offset, (long long)datatype_size * (long long)count); if (file_ptr_type != ADIO_EXPLICIT_OFFSET) { fd->fp_ind += datatype_size * count; fd->fp_sys_posn = fd->fp_ind; - FPRINTF(stdout, "[%d/%d] new file position is %lld\n", myrank, + FPRINTF(stdout, "[%d/%d] new file position is %lld\n", myrank, nprocs, (long long) fd->fp_ind); } else { @@ -53,11 +53,11 @@ void ADIOI_TESTFS_WriteStrided(ADIO_File fd, const void *buf, int count, MPI_Comm_size(fd->comm, &nprocs); MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStrided called on %s\n", + FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStrided called on %s\n", myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_WriteStrided\n", + FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_WriteStrided\n", myrank, nprocs); - ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, + ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, status, error_code); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_ufs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_ufs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_ufs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_ufs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs.c b/ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs.c rename to ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs.c index 4fc330258d..a7134dce0b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,4 +41,6 @@ struct ADIOI_Fns_struct ADIO_UFS_operations = { ADIOI_GEN_Delete, /* Delete */ ADIOI_GEN_Feature, /* Features */ "UFS: Generic ROMIO driver for all UNIX-like file systems", + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs.h b/ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs.h similarity index 75% rename from ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs.h rename to ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs.h index e8995eb1e6..72d66f853b 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs.h @@ -1,16 +1,16 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #ifndef AD_UNIX_INCLUDE #define AD_UNIX_INCLUDE +#include "adio.h" #include #include #include -#include "adio.h" #ifdef HAVE_SIGNAL_H #include @@ -18,14 +18,19 @@ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include + +#ifdef HAVE_AIO_LITE_H +#include +#else + #ifdef HAVE_AIO_H + #include + #endif + #ifdef HAVE_SYS_AIO_H + #include + #endif #endif -/* Workaround for incomplete set of definitions if __REDIRECT is not +/* Workaround for incomplete set of definitions if __REDIRECT is not defined and large file support is used in aio.h */ #if !defined(__REDIRECT) && defined(__USE_FILE_OFFSET64) #define aiocb aiocb64 @@ -35,23 +40,23 @@ int ADIOI_UFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, int wr, void *handle); void ADIOI_UFS_Open(ADIO_File fd, int *error_code); -void ADIOI_UFS_IwriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_UFS_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_UFS_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIOI_UFS_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); + *error_code); int ADIOI_UFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_UFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); void ADIOI_UFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_UFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void ADIOI_UFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs_open.c b/ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs_open.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs_open.c index d4c64db4a2..9d5a2a1174 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_ufs/ad_ufs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_ufs/ad_ufs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -31,7 +31,7 @@ void ADIOI_UFS_Open(ADIO_File fd, int *error_code) if (fd->access_mode & ADIO_EXCL) amode = amode | O_EXCL; - + #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_open_a, 0, NULL ); #endif diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_xfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_xfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs.c index 529792488c..f43e0e86b7 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -40,5 +40,7 @@ struct ADIOI_Fns_struct ADIO_XFS_operations = { ADIOI_XFS_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */ ADIOI_GEN_Feature, /* Features */ - "XFS: SGI XFS" + "XFS: SGI XFS", + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs.h b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs.h similarity index 83% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs.h rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs.h index 506f441ad7..d14858d4aa 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,14 +23,14 @@ typedef struct aiocb64 aiocb64_t; void ADIOI_XFS_Open(ADIO_File fd, int *error_code); void ADIOI_XFS_Close(ADIO_File fd, int *error_code); -void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_XFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code); void ADIOI_XFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_fcntl.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_fcntl.c index cf45a6cd90..1f19081afc 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_hints.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_hints.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_hints.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_hints.c index 93b4f5061a..0fe0e832f4 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_hints.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -67,14 +67,14 @@ void ADIOI_XFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) if (users_info != MPI_INFO_NULL) { value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(users_info, "direct_read", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "direct_read", MPI_MAX_INFO_VAL, value, &flag); if (flag && !strcmp(value, "true")) { ADIOI_Info_set(fd->info, "direct_read", "true"); fd->direct_read = 1; } - ADIOI_Info_get(users_info, "direct_write", MPI_MAX_INFO_VAL, + ADIOI_Info_get(users_info, "direct_write", MPI_MAX_INFO_VAL, value, &flag); if (flag && !strcmp(value, "true")) { ADIOI_Info_set(fd->info, "direct_write", "true"); @@ -83,7 +83,7 @@ void ADIOI_XFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) ADIOI_Free(value); } - + /* set the values for collective I/O and data sieving parameters */ ADIOI_GEN_SetInfo(fd, users_info, error_code); diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_open.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_open.c index e0ccafe7f1..5c0a9a2b8a 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -9,7 +9,9 @@ #include "ad_xfs.h" #include +#ifdef HAVE_STDDEF_H #include +#endif #ifndef HAVE_LSEEK64 #define lseek64 lseek @@ -78,7 +80,7 @@ void ADIOI_XFS_Open(ADIO_File fd, int *error_code) fd->hints->fs_hints.xfs.write_chunk_sz = st.d_maxiosz; } else { /* - * MPIO_DIRECT_WRITE_CHUNK_SIZE was set. + * MPIO_DIRECT_WRITE_CHUNK_SIZE was set. * Make write_chunk_sz a multiple of d_miniosz. */ factor = write_chunk_sz / fd->d_miniosz; diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_read.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_read.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_read.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_read.c index b8267313ca..c3c237cc15 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_read.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_read.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -12,10 +12,10 @@ /* style: allow:free:2 sig:0 */ -static void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, +static void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, ADIO_Offset offset, int *err); -void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -35,11 +35,11 @@ void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, err = pread(fd->fd_sys, buf, len, offset); else { /* direct I/O enabled */ - /* (1) if mem_aligned && file_aligned + /* (1) if mem_aligned && file_aligned use direct I/O to read up to correct io_size use buffered I/O for remaining */ - if (!(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz)) + if (!(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz)) ADIOI_XFS_Aligned_Mem_File_Read(fd, buf, len, offset, &err); /* (2) if !file_aligned @@ -99,7 +99,7 @@ void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, } -void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, +void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, ADIO_Offset offset, int *err) { int ntimes, rem, newrem, i, size, nbytes; @@ -110,7 +110,7 @@ void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, use direct I/O to read up to correct io_size, use buffered I/O for remaining. */ - if (!(len % fd->d_miniosz) && + if (!(len % fd->d_miniosz) && (len >= fd->d_miniosz) && (len <= read_chunk_sz)) *err = pread(fd->fd_direct, buf, len, offset); else if (len < fd->d_miniosz) @@ -126,17 +126,17 @@ void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, } if (rem) { if (!(rem % fd->d_miniosz)) - nbytes += pread(fd->fd_direct, + nbytes += pread(fd->fd_direct, ((char *)buf) + ntimes * read_chunk_sz, rem, offset); else { newrem = rem % fd->d_miniosz; size = rem - newrem; if (size) { - nbytes += pread(fd->fd_direct, + nbytes += pread(fd->fd_direct, ((char *)buf) + ntimes * read_chunk_sz, size, offset); offset += size; } - nbytes += pread(fd->fd_sys, + nbytes += pread(fd->fd_sys, ((char *)buf) + ntimes * read_chunk_sz + size, newrem, offset); } } diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_resize.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_resize.c index 79084eb411..8caf8b48bd 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ void ADIOI_XFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) { int err; static char myname[] = "ADIOI_XFS_RESIZE"; - + err = ftruncate64(fd->fd_sys, size); if (err == -1) { *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, diff --git a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_write.c b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_write.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_write.c rename to ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_write.c index a56102e31f..9ab82768f7 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_xfs/ad_xfs_write.c +++ b/ompi/mca/io/romio321/romio/adio/ad_xfs/ad_xfs_write.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -16,7 +16,7 @@ static int ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, ADIO_Offset len, ADIO_Offset offset); -void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { @@ -38,7 +38,7 @@ void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, if (err < 0) {goto leaving;} } else { /* direct I/O enabled */ - /* (1) if mem_aligned && file_aligned + /* (1) if mem_aligned && file_aligned use direct I/O to write up to correct io_size use buffered I/O for remaining */ @@ -109,7 +109,7 @@ leaving: static int -ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, ADIO_Offset len, +ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, ADIO_Offset len, ADIO_Offset offset) { unsigned write_chunk_sz = fd->hints->fs_hints.xfs.write_chunk_sz; @@ -121,7 +121,7 @@ ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, ADIO_Offset len, use direct I/O to write up to correct io_size, use buffered I/O for remaining. */ - if (!(len % fd->d_miniosz) && + if (!(len % fd->d_miniosz) && (len >= fd->d_miniosz) && (len <= write_chunk_sz)) { nbytes = pwrite(fd->fd_direct, buf, len, offset); if (nbytes < 0) {return -1;} @@ -140,19 +140,19 @@ ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, ADIO_Offset len, } if (rem) { if (!(rem % fd->d_miniosz)) { - nbytes = pwrite(fd->fd_direct, + nbytes = pwrite(fd->fd_direct, ((char *)buf) + ntimes * write_chunk_sz, rem, offset); if (nbytes < 0) {return -1;} } else { newrem = rem % fd->d_miniosz; size = rem - newrem; if (size) { - nbytes = pwrite(fd->fd_direct, + nbytes = pwrite(fd->fd_direct, ((char *)buf) + ntimes * write_chunk_sz, size, offset); offset += size; if (nbytes < 0) {return -1;} } - nbytes = pwrite(fd->fd_sys, + nbytes = pwrite(fd->fd_sys, ((char *)buf) + ntimes * write_chunk_sz + size, newrem, offset); if (nbytes < 0) {return -1;} } diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/Makefile.mk b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs.c similarity index 86% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs.c index be8b8a94b1..3c9131aeac 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago. + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -35,8 +35,10 @@ struct ADIOI_Fns_struct ADIO_ZOIDFS_operations = { ADIOI_ZOIDFS_Resize, /* Resize */ ADIOI_ZOIDFS_Delete, /* Delete */ ADIOI_ZOIDFS_Feature, + ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ + ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ }; -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs.h b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs.h similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs.h rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs.h index 412970fac6..d4999b6622 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs.h +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,16 +18,16 @@ typedef zoidfs_handle_t ADIOI_ZOIDFS_object; void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code); void ADIOI_ZOIDFS_Close(ADIO_File fd, int *error_code); -void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIOI_ZOIDFS_WriteContig(ADIO_File fd, void *buf, int count, +void ADIOI_ZOIDFS_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int - *error_code); + *error_code); void ADIOI_ZOIDFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_close.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_close.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_close.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_close.c index db7aa62227..0126783aa3 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_close.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -20,6 +20,6 @@ void ADIOI_ZOIDFS_Close(ADIO_File fd, int *error_code) *error_code = MPI_SUCCESS; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_common.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_common.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_common.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_common.c index d2781c4140..018d439aaa 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_common.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_common.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2003 University of Chicago. +/* + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -34,7 +34,7 @@ void ADIOI_ZOIDFS_End(int *error_code) *error_code = MPI_SUCCESS; } -int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval, +int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state) { int error_code; @@ -64,10 +64,10 @@ void ADIOI_ZOIDFS_Init(int rank, int *error_code ) 0); return; } - + MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_ZOIDFS_End_call, - &ADIOI_ZOIDFS_Initialized, (void *)0); - /* just like romio does, we make a dummy attribute so we + &ADIOI_ZOIDFS_Initialized, (void *)0); + /* just like romio does, we make a dummy attribute so we * get cleaned up */ MPI_Attr_put(MPI_COMM_SELF, ADIOI_ZOIDFS_Initialized, (void *)0); } @@ -121,6 +121,6 @@ int ADIOI_ZOIDFS_error_convert(int error) } } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_common.h b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_common.h similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_common.h rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_common.h index 487b499e0d..ba985b4922 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_common.h +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_common.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -9,10 +9,10 @@ #define _AD_ZOIDFS_COMMON_H #include "ad_zoidfs.h" -/* The ESTALE problem: +/* The ESTALE problem: * The IO forwarding protocol can respond to any call with ESTALE, which means * the handle upon which that call operates has expired from the metadata - * cache. We thus wrap any zoidfs routine (expr) in this macro. + * cache. We thus wrap any zoidfs routine (expr) in this macro. * * ROMIO stores the filename in the ADIOI_File structrue (fd), so we can always * re-lookup in response to ESTALE */ @@ -36,7 +36,7 @@ void ADIOI_ZOIDFS_Init(int rank, int *error_code ); void ADIOI_ZOIDFS_makeattribs(zoidfs_sattr_t * attribs); void ADIOI_ZOIDFS_End(int *error_code); -int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval, +int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state); int ADIOI_ZOIDFS_error_convert(int error); diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_delete.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_delete.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_delete.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_delete.c index cca8021061..87193147a5 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_delete.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago. + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,7 +17,7 @@ void ADIOI_ZOIDFS_Delete(char *filename, int *error_code) ADIOI_ZOIDFS_Init(0, error_code); /* --BEGIN ERROR HANDLING-- */ - if (*error_code != MPI_SUCCESS) + if (*error_code != MPI_SUCCESS) { /* ADIOI_ZOIDFS_INIT handles creating error codes itself */ return; @@ -40,6 +40,6 @@ void ADIOI_ZOIDFS_Delete(char *filename, int *error_code) return; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_fcntl.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_fcntl.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_fcntl.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_fcntl.c index 810100574d..22c26714d8 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -55,6 +55,6 @@ void ADIOI_ZOIDFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, } } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_features.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_features.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_features.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_features.c diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_flush.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_flush.c similarity index 83% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_flush.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_flush.c index 06cd30631a..8ec0b8d551 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_flush.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,12 +11,12 @@ /* we want to be a bit clever here: at scale, if every client sends a * flush request, it will stress the file system with redundant * commit requests. Instead, one process should wait for - * everyone to catch up, do the sync, then broadcast the result. + * everyone to catch up, do the sync, then broadcast the result. */ -void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code) -{ - int ret, rank, dummy=0, dummy_in=0; +void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code) +{ + int ret, rank, dummy=0, dummy_in=0; ADIOI_ZOIDFS_object *zoidfs_obj_ptr; static char myname[] = "ADIOI_ZOIDFS_FLUSH"; @@ -28,7 +28,7 @@ void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code) /* collective call to ensure no outstanding write requests. reduce is * slightly less expensvie than barrier */ - MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, + MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, fd->hints->ranklist[0], fd->comm); if (rank == fd->hints->ranklist[0]) { @@ -47,6 +47,6 @@ void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code) /* --END ERROR HANDLING-- */ } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_io.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_io.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_io.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_io.c index 35dd552ce7..337c92f410 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_io.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_io.c @@ -1,6 +1,6 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * - * Copyright (C) 1997 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -37,12 +37,12 @@ static void ZOIDFS_IOContig(ADIO_File fd, void * buf, int count, if (flag == ZOIDFS_READ) { NO_STALE(ret, fd, zoidfs_obj_ptr, - zoidfs_read(zoidfs_obj_ptr, + zoidfs_read(zoidfs_obj_ptr, 1, &buf, &mem_len, 1, &file_offset, &file_len, ZOIDFS_NO_OP_HINT)); } else { NO_STALE(ret, fd, zoidfs_obj_ptr, - zoidfs_write(zoidfs_obj_ptr, + zoidfs_write(zoidfs_obj_ptr, 1, (const void **)&buf, &mem_len, 1, &file_offset, &file_len, ZOIDFS_NO_OP_HINT)); } @@ -72,12 +72,12 @@ fn_exit: return; } -void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) { - ZOIDFS_IOContig(fd, buf, count, datatype, file_ptr_type, + ZOIDFS_IOContig(fd, buf, count, datatype, file_ptr_type, offset, status, ZOIDFS_READ, error_code); } @@ -90,7 +90,7 @@ void ADIOI_ZOIDFS_WriteContig(ADIO_File fd, void *buf, int count, offset, status, ZOIDFS_WRITE, error_code); } - + /* - * vim: ts=8 sts=4 sw=4 noexpandtab + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_open.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_open.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_open.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_open.c index e130ff3f4a..3c22cb54e1 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_open.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 2007 University of Chicago. + * Copyright (C) 2007 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -14,10 +14,10 @@ struct open_status_s { zoidfs_handle_t handle; }; typedef struct open_status_s open_status; - + static void fake_an_open(char *fname, int access_mode, int nr_datafiles, MPI_Offset strip_size, - ADIOI_ZOIDFS_object *zoidfs_ptr, + ADIOI_ZOIDFS_object *zoidfs_ptr, open_status *o_status) { int ret, created; @@ -31,7 +31,7 @@ static void fake_an_open(char *fname, int access_mode, * be careful with ADIO_EXCL. */ if (access_mode & ADIO_CREATE) { - ret = zoidfs_create(NULL, NULL, + ret = zoidfs_create(NULL, NULL, fname, &attribs, &handle, &created, ZOIDFS_NO_OP_HINT); if ((ret == ZFS_OK) && !created && (access_mode & ADIO_EXCL)) { /* lookup should not succeed if opened with EXCL */ @@ -51,7 +51,7 @@ static void fake_an_open(char *fname, int access_mode, /* ADIOI_ZOIDFS_Open: * one process opens (or creates) the file, then broadcasts the result to the - * remaining processors. + * remaining processors. * * ADIO_Open used to perform an optimization when MPI_MODE_CREATE (and before * that, MPI_MODE_EXCL) was set. Because ZoidFS handles file lookup and @@ -72,9 +72,9 @@ void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code) MPI_Datatype types[2] = {MPI_INT, MPI_BYTE}; int lens[2] = {1, sizeof(ADIOI_ZOIDFS_object)}; MPI_Aint offsets[2]; - + memset(&o_status, 0, sizeof(o_status)); - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *) + zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *) ADIOI_Malloc(sizeof(ADIOI_ZOIDFS_object)); /* --BEGIN ERROR HANDLING-- */ if (zoidfs_obj_ptr == NULL) { @@ -102,10 +102,10 @@ void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code) MPE_Log_event( ADIOI_MPE_open_a, 0, NULL ); #endif if (rank == fd->hints->ranklist[0] && fd->fs_ptr == NULL) { - fake_an_open(fd->filename, fd->access_mode, + fake_an_open(fd->filename, fd->access_mode, fd->hints->striping_factor, fd->hints->striping_unit, - zoidfs_obj_ptr, &o_status); + zoidfs_obj_ptr, &o_status); /* store credentials and object reference in fd */ *zoidfs_obj_ptr = o_status.handle; fd->fs_ptr = zoidfs_obj_ptr; @@ -132,7 +132,7 @@ void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code) /* --BEGIN ERROR HANDLING-- */ if (o_status.error != ZFS_OK) - { + { ADIOI_Free(zoidfs_obj_ptr); fd->fs_ptr = NULL; *error_code = MPIO_Err_create_code(MPI_SUCCESS, diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_read_list.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_read_list.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_read_list.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_read_list.c index ba57e74cf1..3537e63e83 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_read_list.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_read_list.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * vim: ts=8 sts=4 sw=4 noexpandtab + * + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -26,7 +26,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, int n_filetypes, etype_in_filetype; ADIO_Offset abs_off_in_filetype=0; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb; + MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset off, disp, start_off, initial_off; int flag, st_frd_size, st_n_filetypes; @@ -76,7 +76,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -86,7 +86,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, etype_size = fd->etype_size; bufsize = buftype_size * count; - + zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *)fd->fs_ptr; if (!buftype_is_contig && filetype_is_contig) { @@ -95,11 +95,9 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, uint64_t file_offsets; uint64_t file_lengths; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + etype_size * offset; file_list_count = 1; @@ -121,9 +119,9 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, /* step through each block in memory, filling memory arrays */ while (b_blks_read < total_blks_to_read) { for (i=0; icount; i++) { - mem_offsets[b_blks_read % MAX_ARRAY_SIZE] = + mem_offsets[b_blks_read % MAX_ARRAY_SIZE] = buf + j*buftype_extent + flat_buf->indices[i]; - mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = + mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = flat_buf->blocklens[i]; file_lengths += flat_buf->blocklens[i]; b_blks_read++; @@ -159,21 +157,21 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } total_bytes_read += file_lengths; /* --END ERROR HANDLING-- */ - - /* in the case of error or the last read list call, + + /* in the case of error or the last read list call, * leave here */ if (err_flag || b_blks_read == total_blks_to_read) break; file_offsets += file_lengths; file_lengths = 0; - } + } } /* for (i=0; icount; i++) */ j++; } /* while (b_blks_read < total_blks_to_read) */ ADIOI_Free(mem_offsets); ADIOI_Free(mem_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_read; fd->fp_sys_posn = -1; /* set it to null. */ @@ -212,11 +210,11 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - frd_size = disp + flat_file->indices[i] + + frd_size = disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -230,7 +228,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -242,16 +240,16 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, break; } } - + /* abs. offset in bytes in the file */ - offset = disp + ((ADIO_Offset) n_filetypes)*filetype_extent + + offset = disp + ((ADIO_Offset) n_filetypes)*filetype_extent + abs_off_in_filetype; } /* else [file_ptr_type != ADIO_INDIVIDUAL] */ start_off = offset; st_frd_size = frd_size; st_n_filetypes = n_filetypes; - + if (buftype_is_contig && !filetype_is_contig) { /* contiguous in memory, noncontiguous in file. should be the most @@ -260,13 +258,13 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, /* only one memory off-len pair, so no array here */ size_t mem_lengths; size_t mem_offsets; - + i = 0; j = st_index; n_filetypes = st_n_filetypes; - + mem_list_count = 1; - + /* determine how many blocks in file to read */ f_data_read = ADIOI_MIN(st_frd_size, bufsize); total_blks_to_read = 1; @@ -279,17 +277,17 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, f_data_read += flat_file->blocklens[j]; total_blks_to_read++; if (j<(flat_file->count-1)) j++; - else j = 0; + else j = 0; } - + j = st_index; n_filetypes = st_n_filetypes; n_read_lists = total_blks_to_read/MAX_ARRAY_SIZE; extra_blks = total_blks_to_read%MAX_ARRAY_SIZE; - + mem_offsets = (size_t)buf; mem_lengths = 0; - + /* if at least one full readlist, allocate file arrays at max array size and don't free until very end */ if (n_read_lists) { @@ -306,7 +304,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, file_lengths = (uint64_t*)ADIOI_Malloc(extra_blks* sizeof(uint64_t)); } - + /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ for (i=0; iindices[j]; file_lengths[k] = flat_file->blocklens[j]; @@ -366,7 +364,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } for (k=0; kindices[j]; if (k == (extra_blks - 1)) { @@ -400,7 +398,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, MPIR_ERR_RECOVERABLE, myname, __LINE__, ADIOI_ZOIDFS_error_convert(err_flag), - "Error in zoidfs_read", 0); + "Error in zoidfs_read", 0); goto error_state; } /* --END ERROR HANDLING-- */ @@ -409,10 +407,8 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } else { /* noncontiguous in memory as well as in file */ - - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + + flat_buf = ADIOI_Flatten_and_find(datatype); size_read = 0; n_filetypes = st_n_filetypes; @@ -425,7 +421,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, max_mem_list = 0; max_file_list = 0; - /* run through and file max_file_list and max_mem_list so that you + /* run through and file max_file_list and max_mem_list so that you can allocate the file and memory arrays less than MAX_ARRAY_SIZE if possible */ @@ -433,7 +429,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, k = start_k; new_buffer_read = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -441,9 +437,9 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_read + flat_buf->blocklens[k] + + if((new_buffer_read + flat_buf->blocklens[k] + size_read) > bufsize) { - end_brd_size = new_buffer_read + + end_brd_size = new_buffer_read + flat_buf->blocklens[k] - (bufsize - size_read); new_buffer_read = bufsize - size_read; } @@ -461,15 +457,15 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ j = start_j; new_file_read = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_read < new_buffer_read)) { if(file_list_count) { - if((new_file_read + flat_file->blocklens[j]) > + if((new_file_read + flat_file->blocklens[j]) > new_buffer_read) { end_frd_size = new_buffer_read - new_file_read; new_file_read = new_buffer_read; @@ -490,9 +486,9 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_read < new_buffer_read) && + if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_read = 0; mem_list_count = 0; @@ -521,13 +517,13 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } /* while (new_buffer_read < new_file_read) */ } /* if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ /* fakes filling the readlist arrays of lengths found above */ k = start_k; j = start_j; - for (i=0; iblocklens[k] == end_brd_size) @@ -548,7 +544,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, if (i == (file_list_count - 1)) { if (flat_file->blocklens[j] == end_frd_size) frd_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { frd_size = flat_file->blocklens[j] - end_frd_size; j--; @@ -581,11 +577,11 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, * region and many (700) very small memory regions. both cases caused * problems for this code */ - if ( ( (file_list_count == 1) && + if ( ( (file_list_count == 1) && (new_file_read < flat_file->blocklens[0] ) ) || - ((mem_list_count == 1) && + ((mem_list_count == 1) && (new_buffer_read < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && + ((file_list_count == MAX_ARRAY_SIZE) && (new_file_read < flat_buf->blocklens[0]) ) || ( (mem_list_count == MAX_ARRAY_SIZE) && (new_buffer_read < flat_file->blocklens[0])) ) @@ -601,7 +597,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, mem_lengths = (size_t*)ADIOI_Malloc(max_mem_list*sizeof(size_t)); file_offsets = (uint64_t *)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); file_lengths = (uint64_t *)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); - + size_read = 0; n_filetypes = st_n_filetypes; frd_size = st_frd_size; @@ -614,12 +610,12 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, /* this section calculates mem_list_count and file_list_count and also finds the possibly odd sized last array elements in new_frd_size and new_brd_size */ - + while (size_read < bufsize) { k = start_k; new_buffer_read = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -627,9 +623,9 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, read in the next immediate read list is less than bufsize */ if(mem_list_count) { - if((new_buffer_read + flat_buf->blocklens[k] + + if((new_buffer_read + flat_buf->blocklens[k] + size_read) > bufsize) { - end_brd_size = new_buffer_read + + end_brd_size = new_buffer_read + flat_buf->blocklens[k] - (bufsize - size_read); new_buffer_read = bufsize - size_read; } @@ -647,15 +643,15 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ j = start_j; new_file_read = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_read < new_buffer_read)) { if(file_list_count) { - if((new_file_read + flat_file->blocklens[j]) > + if((new_file_read + flat_file->blocklens[j]) > new_buffer_read) { end_frd_size = new_buffer_read - new_file_read; new_file_read = new_buffer_read; @@ -676,9 +672,9 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_read < new_buffer_read) && + if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_read = 0; mem_list_count = 0; @@ -707,14 +703,14 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, } /* while (new_buffer_read < new_file_read) */ } /* if ((new_file_read < new_buffer_read) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_read < bufsize-size_read)) */ /* fills the allocated readlist arrays */ k = start_k; j = start_j; - for (i=0; icount) + flat_buf->indices[k]; if(!i) { @@ -741,7 +737,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, k = (k + 1)%flat_buf->count; } /* for (i=0; iindices[j] + + file_offsets[i] = disp + flat_file->indices[j] + ((ADIO_Offset)n_filetypes) * filetype_extent; if (!i) { file_lengths[0] = frd_size; @@ -752,7 +748,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, file_lengths[i] = end_frd_size; if (flat_file->blocklens[j] == end_frd_size) frd_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { frd_size = flat_file->blocklens[j] - end_frd_size; j--; @@ -799,7 +795,7 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, /* when incrementing fp_ind, need to also take into account the file type: * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1) + * at empty region at offset N+1) * * As we discussed on mpich-discuss in may/june 2009, the code below might * look wierd, but by putting fp_ind at the last byte written, the next @@ -809,10 +805,10 @@ void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count, fd->fp_ind = file_offsets[file_list_count-1]+ file_lengths[file_list_count-1]; } - + ADIOI_Free(file_offsets); ADIOI_Free(file_lengths); - + if (err_flag == 0) *error_code = MPI_SUCCESS; error_state: @@ -820,11 +816,11 @@ error_state: #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); - /* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually read and placed in buf + /* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually read and placed in buf by ADIOI_BUFFERED_READ. */ #endif - + if (!buftype_is_contig) ADIOI_Delete_flattened(datatype); } diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_resize.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_resize.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_resize.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_resize.c index 90734ed59d..60d2fcaba2 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_resize.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -49,5 +49,5 @@ void ADIOI_ZOIDFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) } /* - * vim: ts=8 sts=4 sw=4 noexpandtab + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_write_list.c b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_write_list.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_write_list.c rename to ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_write_list.c index 1b2531c8fc..44376316a6 100644 --- a/ompi/mca/io/romio314/romio/adio/ad_zoidfs/ad_zoidfs_write_list.c +++ b/ompi/mca/io/romio321/romio/adio/ad_zoidfs/ad_zoidfs_write_list.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- + * vim: ts=8 sts=4 sw=4 noexpandtab + * + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,7 +90,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -98,7 +98,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, MPI_Type_size_x(datatype, &buftype_size); MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent); etype_size = fd->etype_size; - + bufsize = buftype_size * count; zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr; @@ -109,10 +109,8 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, uint64_t file_offsets; uint64_t file_lengths; - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; - + flat_buf = ADIOI_Flatten_and_find(datatype); + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { off = fd->disp + etype_size * offset; } @@ -135,11 +133,11 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, /* step through each block in memory, filling memory arrays */ while (b_blks_wrote < total_blks_to_write) { for (i=0; icount; i++) { - mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] = - buf + - j*buftype_extent + + mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] = + buf + + j*buftype_extent + flat_buf->indices[i]; - mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = + mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = flat_buf->blocklens[i]; file_lengths += flat_buf->blocklens[i]; b_blks_wrote++; @@ -157,9 +155,9 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif NO_STALE(err_flag, fd, zoidfs_obj_ptr, - zoidfs_write(zoidfs_obj_ptr, + zoidfs_write(zoidfs_obj_ptr, mem_list_count, - mem_offsets, mem_lengths, + mem_offsets, mem_lengths, 1, &file_offsets, &file_lengths, ZOIDFS_NO_OP_HINT)); /* --BEGIN ERROR HANDLING-- */ @@ -175,8 +173,8 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); #endif total_bytes_written += file_lengths; - - /* in the case of error or the last write list call, + + /* in the case of error or the last write list call, * leave here */ /* --BEGIN ERROR HANDLING-- */ if (err_flag) { @@ -192,14 +190,14 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, file_offsets += file_lengths; file_lengths = 0; - } + } } /* for (i=0; icount; i++) */ j++; } /* while (b_blks_wrote < total_blks_to_write) */ ADIOI_Free(mem_offsets); ADIOI_Free(mem_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_written; if (!err_flag) *error_code = MPI_SUCCESS; @@ -208,7 +206,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif @@ -227,7 +225,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, initial_off = offset; /* for each case - ADIO_Individual pointer or explicit, find offset - (file offset in bytes), n_filetypes (how many filetypes into file + (file offset in bytes), n_filetypes (how many filetypes into file to start), fwr_size (remaining amount of data in present file block), and st_index (start point in terms of blocks in starting filetype) */ @@ -238,11 +236,11 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - fwr_size = disp + flat_file->indices[i] + + fwr_size = disp + flat_file->indices[i] + ((ADIO_Offset) n_filetypes)*filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -256,7 +254,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, n_filetypes = (int) (offset / n_etypes_in_filetype); etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -277,7 +275,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, start_off = offset; st_fwr_size = fwr_size; st_n_filetypes = n_filetypes; - + if (buftype_is_contig && !filetype_is_contig) { /* contiguous in memory, noncontiguous in file. should be the most @@ -286,14 +284,14 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, /* only one memory off-len pair, so no array */ size_t mem_lengths; size_t mem_offsets; - + i = 0; j = st_index; off = offset; n_filetypes = st_n_filetypes; - + mem_list_count = 1; - + /* determine how many blocks in file to write */ f_data_wrote = ADIOI_MIN(st_fwr_size, bufsize); total_blks_to_write = 1; @@ -306,17 +304,17 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, f_data_wrote += flat_file->blocklens[j]; total_blks_to_write++; if (j<(flat_file->count-1)) j++; - else j = 0; + else j = 0; } - + j = st_index; n_filetypes = st_n_filetypes; n_write_lists = total_blks_to_write/MAX_ARRAY_SIZE; extra_blks = total_blks_to_write%MAX_ARRAY_SIZE; - + mem_offsets = (size_t)buf; mem_lengths = 0; - + /* if at least one full writelist, allocate file arrays at max array size and don't free until very end */ if (n_write_lists) { @@ -333,7 +331,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, file_lengths = (uint64_t*)ADIOI_Malloc(extra_blks* sizeof(uint64_t)); } - + /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ for (i=0; iindices[j]; file_lengths[k] = flat_file->blocklens[j]; @@ -362,7 +360,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, NO_STALE(err_flag, fd, zoidfs_obj_ptr, zoidfs_write(zoidfs_obj_ptr, 1, buf, &mem_lengths, - file_list_count, + file_list_count, file_offsets, file_lengths, ZOIDFS_NO_OP_HINT)); #ifdef ADIOI_MPE_LOGGING @@ -394,12 +392,12 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, } for (k=0; kindices[j]; /* XXX: double-check these casts */ if (k == (extra_blks - 1)) { - file_lengths[k] = bufsize + file_lengths[k] = bufsize - mem_lengths - mem_offsets + (size_t)buf; } else file_lengths[k] = flat_file->blocklens[j]; @@ -415,11 +413,11 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif - NO_STALE(err_flag, fd, zoidfs_obj_ptr, - zoidfs_write(zoidfs_obj_ptr, 1, - (const void **)&mem_offsets, + NO_STALE(err_flag, fd, zoidfs_obj_ptr, + zoidfs_write(zoidfs_obj_ptr, 1, + (const void **)&mem_offsets, &mem_lengths, - file_list_count, + file_list_count, file_offsets, file_lengths, ZOIDFS_NO_OP_HINT)); #ifdef ADIOI_MPE_LOGGING @@ -437,13 +435,11 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, /* --END ERROR HANDLING-- */ total_bytes_written += mem_lengths; } - } + } else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); size_wrote = 0; n_filetypes = st_n_filetypes; @@ -456,7 +452,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, max_mem_list = 0; max_file_list = 0; - /* run through and file max_file_list and max_mem_list so that you + /* run through and file max_file_list and max_mem_list so that you can allocate the file and memory arrays less than MAX_ARRAY_SIZE if possible */ @@ -464,7 +460,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, k = start_k; new_buffer_write = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -472,9 +468,9 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, written in the next immediate write list is less than bufsize */ if(mem_list_count) { - if((new_buffer_write + flat_buf->blocklens[k] + + if((new_buffer_write + flat_buf->blocklens[k] + size_wrote) > bufsize) { - end_bwr_size = new_buffer_write + + end_bwr_size = new_buffer_write + flat_buf->blocklens[k] - (bufsize - size_wrote); new_buffer_write = bufsize - size_wrote; } @@ -492,15 +488,15 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ j = start_j; new_file_write = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && - (new_file_write < new_buffer_write)) { + while ((file_list_count < MAX_ARRAY_SIZE) && + (new_file_write < new_buffer_write)) { if(file_list_count) { - if((new_file_write + flat_file->blocklens[j]) > + if((new_file_write + flat_file->blocklens[j]) > new_buffer_write) { end_fwr_size = new_buffer_write - new_file_write; new_file_write = new_buffer_write; @@ -521,9 +517,9 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_write < new_buffer_write) && + if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_write = 0; mem_list_count = 0; @@ -531,7 +527,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, if(mem_list_count) { if((new_buffer_write + flat_buf->blocklens[k]) > new_file_write) { - end_bwr_size = new_file_write - + end_bwr_size = new_file_write - new_buffer_write; new_buffer_write = new_file_write; k--; @@ -553,13 +549,13 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, } /* while (new_buffer_write < new_file_write) */ } /* if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ /* fakes filling the writelist arrays of lengths found above */ k = start_k; j = start_j; - for (i=0; iblocklens[k] == end_bwr_size) @@ -580,7 +576,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, if (i == (file_list_count - 1)) { if (flat_file->blocklens[j] == end_fwr_size) fwr_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { fwr_size = flat_file->blocklens[j] - end_fwr_size; j--; @@ -613,11 +609,11 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, * region and many (700) very small memory regions. both cases caused * problems for this code */ - if ( ( (file_list_count == 1) && + if ( ( (file_list_count == 1) && (new_file_write < flat_file->blocklens[0] ) ) || - ((mem_list_count == 1) && + ((mem_list_count == 1) && (new_buffer_write < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && + ((file_list_count == MAX_ARRAY_SIZE) && (new_file_write < flat_buf->blocklens[0]) ) || ( (mem_list_count == MAX_ARRAY_SIZE) && (new_buffer_write < flat_file->blocklens[0])) ) @@ -633,7 +629,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, mem_lengths = (size_t*)ADIOI_Malloc(max_mem_list*sizeof(size_t)); file_offsets = (uint64_t *)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); file_lengths = (uint64_t*)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); - + size_wrote = 0; n_filetypes = st_n_filetypes; fwr_size = st_fwr_size; @@ -646,12 +642,12 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, /* this section calculates mem_list_count and file_list_count and also finds the possibly odd sized last array elements in new_fwr_size and new_bwr_size */ - + while (size_wrote < bufsize) { k = start_k; new_buffer_write = 0; mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && + while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) { /* find mem_list_count and file_list_count such that both are less than MAX_ARRAY_SIZE, the sum of their lengths are @@ -659,9 +655,9 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, written in the next immediate write list is less than bufsize */ if(mem_list_count) { - if((new_buffer_write + flat_buf->blocklens[k] + + if((new_buffer_write + flat_buf->blocklens[k] + size_wrote) > bufsize) { - end_bwr_size = new_buffer_write + + end_bwr_size = new_buffer_write + flat_buf->blocklens[k] - (bufsize - size_wrote); new_buffer_write = bufsize - size_wrote; } @@ -679,15 +675,15 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, } mem_list_count++; k = (k + 1)%flat_buf->count; - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ j = start_j; new_file_write = 0; file_list_count = 0; - while ((file_list_count < MAX_ARRAY_SIZE) && + while ((file_list_count < MAX_ARRAY_SIZE) && (new_file_write < new_buffer_write)) { if(file_list_count) { - if((new_file_write + flat_file->blocklens[j]) > + if((new_file_write + flat_file->blocklens[j]) > new_buffer_write) { end_fwr_size = new_buffer_write - new_file_write; new_file_write = new_buffer_write; @@ -708,9 +704,9 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, file_list_count++; if (j < (flat_file->count - 1)) j++; else j = 0; - + k = start_k; - if ((new_file_write < new_buffer_write) && + if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) { new_buffer_write = 0; mem_list_count = 0; @@ -740,17 +736,17 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, } /* while (new_buffer_write < new_file_write) */ } /* if ((new_file_write < new_buffer_write) && (file_list_count == MAX_ARRAY_SIZE)) */ - } /* while ((mem_list_count < MAX_ARRAY_SIZE) && + } /* while ((mem_list_count < MAX_ARRAY_SIZE) && (new_buffer_write < bufsize-size_wrote)) */ /* fills the allocated writelist arrays */ k = start_k; j = start_j; - for (i=0; icount) + flat_buf->indices[k]; - + if(!i) { mem_lengths[0] = bwr_size; mem_offsets[0] += flat_buf->blocklens[k] - bwr_size; @@ -775,7 +771,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, k = (k + 1)%flat_buf->count; } /* for (i=0; iindices[j] + + file_offsets[i] = disp + flat_file->indices[j] + ((ADIO_Offset)n_filetypes) * filetype_extent; if (!i) { file_lengths[0] = fwr_size; @@ -786,7 +782,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, file_lengths[i] = end_fwr_size; if (flat_file->blocklens[j] == end_fwr_size) fwr_size = flat_file->blocklens[(j+1)% - flat_file->count]; + flat_file->count]; else { fwr_size = flat_file->blocklens[j] - end_fwr_size; j--; @@ -805,9 +801,9 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif NO_STALE(err_flag, fd, zoidfs_obj_ptr, - zoidfs_write(zoidfs_obj_ptr, - mem_list_count, mem_offsets, mem_lengths, - file_list_count, + zoidfs_write(zoidfs_obj_ptr, + mem_list_count, mem_offsets, mem_lengths, + file_list_count, file_offsets, file_lengths, ZOIDFS_NO_OP_HINT)); /* --BEGIN ERROR HANDLING-- */ if (err_flag != ZFS_OK) { @@ -833,7 +829,7 @@ void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, /* when incrementing fp_ind, need to also take into account the file type: * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1). + * at empty region at offset N+1). * * As we discussed on mpich-discuss in may/june 2009, the code below might * look wierd, but by putting fp_ind at the last byte written, the next @@ -853,7 +849,7 @@ error_state: #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/Makefile.mk b/ompi/mca/io/romio321/romio/adio/common/Makefile.mk similarity index 95% rename from ompi/mca/io/romio314/romio/adio/common/Makefile.mk rename to ompi/mca/io/romio321/romio/adio/common/Makefile.mk index 6cfd118bc2..80194efe48 100644 --- a/ompi/mca/io/romio314/romio/adio/common/Makefile.mk +++ b/ompi/mca/io/romio321/romio/adio/common/Makefile.mk @@ -26,8 +26,10 @@ romio_other_sources += \ adio/common/ad_io_coll.c \ adio/common/ad_iopen.c \ adio/common/ad_iread.c \ + adio/common/ad_iread_coll.c \ adio/common/ad_iread_fake.c \ adio/common/ad_iwrite.c \ + adio/common/ad_iwrite_coll.c \ adio/common/ad_iwrite_fake.c \ adio/common/ad_open.c \ adio/common/ad_opencoll.c \ @@ -69,5 +71,6 @@ romio_other_sources += \ adio/common/hint_fns.c \ adio/common/ad_threaded_io.c \ adio/common/p2p_aggregation.c \ + adio/common/onesided_aggregation.c \ adio/common/utils.c diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_aggregate.c b/ompi/mca/io/romio321/romio/adio/common/ad_aggregate.c similarity index 69% rename from ompi/mca/io/romio314/romio/adio/common/ad_aggregate.c rename to ompi/mca/io/romio321/romio/adio/common/ad_aggregate.c index fe225394c5..77c69bdad6 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_aggregate.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_aggregate.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997-2001 University of Chicago. +/* + * Copyright (C) 1997-2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -22,14 +22,14 @@ * * The last three of these were originally in ad_read_coll.c, but they are * also shared with ad_write_coll.c. I felt that they were better kept with - * the rest of the shared aggregation code. + * the rest of the shared aggregation code. */ /* Discussion of values available from above: * * ADIO_Offset st_offsets[0..nprocs-1] * ADIO_Offset end_offsets[0..nprocs-1] - * These contain a list of start and end offsets for each process in + * These contain a list of start and end offsets for each process in * the communicator. For example, an access at loc 10, size 10 would * have a start offset of 10 and end offset of 19. * int nprocs @@ -39,15 +39,15 @@ * starting location of "file domain"; region that a given process will * perform aggregation for (i.e. actually do I/O) * ADIO_Offset fd_end[0..nprocs_for_coll-1] - * start + size - 1 roughly, but it can be less, or 0, in the case of + * start + size - 1 roughly, but it can be less, or 0, in the case of * uneven distributions */ /* ADIOI_Calc_aggregator() * - * The intention here is to implement a function which provides basically - * the same functionality as in Rajeev's original version of - * ADIOI_Calc_my_req(). He used a ceiling division approach to assign the + * The intention here is to implement a function which provides basically + * the same functionality as in Rajeev's original version of + * ADIOI_Calc_my_req(). He used a ceiling division approach to assign the * file domains, and we use the same approach here when calculating the * location of an offset/len in a specific file domain. Further we assume * this same distribution when calculating the rank_index, which is later @@ -56,7 +56,7 @@ * A better (i.e. more general) approach would be to use the list of file * domains only. This would be slower in the case where the * original ceiling division was used, but it would allow for arbitrary - * distributions of regions to aggregators. We'd need to know the + * distributions of regions to aggregators. We'd need to know the * nprocs_for_coll in that case though, which we don't have now. * * Note a significant difference between this function and Rajeev's old code: @@ -71,9 +71,9 @@ * actually available in this file domain. */ int ADIOI_Calc_aggregator(ADIO_File fd, - ADIO_Offset off, - ADIO_Offset min_off, - ADIO_Offset *len, + ADIO_Offset off, + ADIO_Offset min_off, + ADIO_Offset *len, ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end) @@ -107,7 +107,7 @@ int ADIOI_Calc_aggregator(ADIO_File fd, /* remember here that even in Rajeev's original code it was the case that * different aggregators could end up with different amounts of data to * aggregate. here we use fd_end[] to make sure that we know how much - * data this aggregator is working with. + * data this aggregator is working with. * * the +1 is to take into account the end vs. length issue. */ @@ -127,8 +127,8 @@ int ADIOI_Calc_aggregator(ADIO_File fd, void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset *end_offsets, int nprocs, int nprocs_for_coll, ADIO_Offset *min_st_offset_ptr, - ADIO_Offset **fd_start_ptr, ADIO_Offset - **fd_end_ptr, int min_fd_size, + ADIO_Offset **fd_start_ptr, ADIO_Offset + **fd_end_ptr, int min_fd_size, ADIO_Offset *fd_size_ptr, int striping_unit) { @@ -144,7 +144,7 @@ void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset #endif #ifdef AGG_DEBUG - FPRINTF(stderr, "ADIOI_Calc_file_domains: %d aggregator(s)\n", + FPRINTF(stderr, "ADIOI_Calc_file_domains: %d aggregator(s)\n", nprocs_for_coll); #endif @@ -162,9 +162,9 @@ void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset the file that will be "owned" by each process */ /* partition the total file access range equally among nprocs_for_coll - processes */ + processes */ fd_size = ((max_end_offset - min_st_offset + 1) + nprocs_for_coll - - 1)/nprocs_for_coll; + 1)/nprocs_for_coll; /* ceiling division as in HPF block distribution */ /* Tweak the file domains so that no fd is smaller than a threshold. We @@ -176,9 +176,9 @@ void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset fd_size = min_fd_size; *fd_start_ptr = (ADIO_Offset *) - ADIOI_Malloc(nprocs_for_coll*sizeof(ADIO_Offset)); + ADIOI_Malloc(nprocs_for_coll*sizeof(ADIO_Offset)); *fd_end_ptr = (ADIO_Offset *) - ADIOI_Malloc(nprocs_for_coll*sizeof(ADIO_Offset)); + ADIOI_Malloc(nprocs_for_coll*sizeof(ADIO_Offset)); fd_start = *fd_start_ptr; fd_end = *fd_end_ptr; @@ -195,21 +195,21 @@ void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset end_off = fd_start[0] + fd_size; rem_front = end_off % striping_unit; rem_back = striping_unit - rem_front; - if (rem_front < rem_back) + if (rem_front < rem_back) end_off -= rem_front; - else + else end_off += rem_back; fd_end[0] = end_off - 1; - + /* align fd_end[i] to the nearest file lock boundary */ for (i=1; i 0) { - FPRINTF(stdout, "data needed from %d (count = %d):\n", i, + FPRINTF(stdout, "data needed from %d (count = %d):\n", i, my_req[i].count); for (l=0; l < my_req[i].count; l++) { FPRINTF(stdout, " off[%d] = %lld, len[%d] = %d\n", l, @@ -421,18 +421,18 @@ void ADIOI_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list, ADIO_Offset *len_ -void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, +void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, int *count_my_req_per_proc, - ADIOI_Access *my_req, + ADIOI_Access *my_req, int nprocs, int myrank, int *count_others_req_procs_ptr, - ADIOI_Access **others_req_ptr) + ADIOI_Access **others_req_ptr) { /* determine what requests of other processes lie in this process's file domain */ /* count_others_req_procs = number of processes whose requests lie in - this process's file domain (including this process itself) + this process's file domain (including this process itself) count_others_req_per_proc[i] indicates how many separate contiguous requests of proc. i lie in this process's file domain. */ @@ -452,7 +452,7 @@ void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, count_others_req_per_proc, 1, MPI_INT, fd->comm); *others_req_ptr = (ADIOI_Access *) - ADIOI_Malloc(nprocs*sizeof(ADIOI_Access)); + ADIOI_Malloc(nprocs*sizeof(ADIOI_Access)); others_req = *others_req_ptr; count_others_req_procs = 0; @@ -464,25 +464,25 @@ void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, others_req[i].lens = ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(ADIO_Offset)); others_req[i].mem_ptrs = (MPI_Aint *) - ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(MPI_Aint)); + ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(MPI_Aint)); count_others_req_procs++; } else others_req[i].count = 0; } - + /* now send the calculated offsets and lengths to respective processes */ requests = (MPI_Request *) - ADIOI_Malloc(1+2*(count_my_req_procs+count_others_req_procs)*sizeof(MPI_Request)); + ADIOI_Malloc(1+2*(count_my_req_procs+count_others_req_procs)*sizeof(MPI_Request)); /* +1 to avoid a 0-size malloc */ j = 0; for (i=0; icomm, &requests[j]); j++; - MPI_Irecv(others_req[i].lens, others_req[i].count, + MPI_Irecv(others_req[i].lens, others_req[i].count, ADIO_OFFSET, i, i+myrank+1, fd->comm, &requests[j]); j++; } @@ -490,10 +490,10 @@ void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, for (i=0; i < nprocs; i++) { if (my_req[i].count) { - MPI_Isend(my_req[i].offsets, my_req[i].count, + MPI_Isend(my_req[i].offsets, my_req[i].count, ADIO_OFFSET, i, i+myrank, fd->comm, &requests[j]); j++; - MPI_Isend(my_req[i].lens, my_req[i].count, + MPI_Isend(my_req[i].lens, my_req[i].count, ADIO_OFFSET, i, i+myrank+1, fd->comm, &requests[j]); j++; } @@ -513,3 +513,141 @@ void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, MPE_Log_event (5027, 0, NULL); #endif } + + +/* Nonblocking version of ADIOI_Calc_others_req(). + It consists of three functions - ADIOI_Icalc_others_req(), + ADIOI_Icalc_others_req_main(), and ADIOI_Icalc_others_req_fini(). */ +void ADIOI_Icalc_others_req(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Icalc_others_req_vars *vars = nbc_req->cor_vars; + + /* count_others_req_per_proc[i] indicates how many separate contiguous + requests of proc. i lie in this process's file domain. */ + + /* first find out how much to send/recv and from/to whom */ +#ifdef AGGREGATION_PROFILE + MPE_Log_event(5026, 0, NULL); +#endif + vars->count_others_req_per_proc = + (int *)ADIOI_Malloc(vars->nprocs * sizeof(int)); + + *error_code = MPI_Ialltoall(vars->count_my_req_per_proc, 1, MPI_INT, + vars->count_others_req_per_proc, 1, MPI_INT, vars->fd->comm, + &vars->req1); + + if (nbc_req->rdwr == ADIOI_READ) { + nbc_req->data.rd.state = ADIOI_IRC_STATE_ICALC_OTHERS_REQ; + } else { + ADIOI_Assert(nbc_req->rdwr == ADIOI_WRITE); + nbc_req->data.wr.state = ADIOI_IWC_STATE_ICALC_OTHERS_REQ; + } +} + +void ADIOI_Icalc_others_req_main(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Icalc_others_req_vars *vars = nbc_req->cor_vars; + ADIO_File fd = vars->fd; + int count_my_req_procs = vars->count_my_req_procs; + ADIOI_Access *my_req = vars->my_req; + int nprocs = vars->nprocs; + int myrank = vars->myrank; + ADIOI_Access **others_req_ptr = vars->others_req_ptr; + + /* determine what requests of other processes lie in this process's + file domain */ + + /* count_others_req_procs = number of processes whose requests lie in + this process's file domain (including this process itself) + count_others_req_per_proc[i] indicates how many separate contiguous + requests of proc. i lie in this process's file domain. */ + + int *count_others_req_per_proc = vars->count_others_req_per_proc; + int count_others_req_procs; + int i, j; + ADIOI_Access *others_req; + + *others_req_ptr = (ADIOI_Access *)ADIOI_Malloc(nprocs*sizeof(ADIOI_Access)); + others_req = *others_req_ptr; + + count_others_req_procs = 0; + for (i = 0; i < nprocs; i++) { + if (count_others_req_per_proc[i]) { + others_req[i].count = count_others_req_per_proc[i]; + others_req[i].offsets = (ADIO_Offset *) + ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(ADIO_Offset)); + others_req[i].lens = + ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(ADIO_Offset)); + others_req[i].mem_ptrs = (MPI_Aint *) + ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(MPI_Aint)); + count_others_req_procs++; + } + else others_req[i].count = 0; + } + vars->count_others_req_procs = count_others_req_procs; + + /* now send the calculated offsets and lengths to respective processes */ + + vars->req2 = (MPI_Request *) + ADIOI_Malloc(1+2*(count_my_req_procs+count_others_req_procs) + *sizeof(MPI_Request)); + /* +1 to avoid a 0-size malloc */ + + j = 0; + for (i = 0; i < nprocs; i++) { + if (others_req[i].count) { + MPI_Irecv(others_req[i].offsets, others_req[i].count, + ADIO_OFFSET, i, i+myrank, fd->comm, &vars->req2[j]); + j++; + MPI_Irecv(others_req[i].lens, others_req[i].count, + ADIO_OFFSET, i, i+myrank+1, fd->comm, &vars->req2[j]); + j++; + } + } + + for (i=0; i < nprocs; i++) { + if (my_req[i].count) { + MPI_Isend(my_req[i].offsets, my_req[i].count, + ADIO_OFFSET, i, i+myrank, fd->comm, &vars->req2[j]); + j++; + MPI_Isend(my_req[i].lens, my_req[i].count, + ADIO_OFFSET, i, i+myrank+1, fd->comm, &vars->req2[j]); + j++; + } + } + + /* keep the number of requests */ + vars->num_req2 = j; + + if (nbc_req->rdwr == ADIOI_READ) { + nbc_req->data.rd.state = ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN; + } else { + ADIOI_Assert(nbc_req->rdwr == ADIOI_WRITE); + nbc_req->data.wr.state = ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN; + } +} + +void ADIOI_Icalc_others_req_fini(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Icalc_others_req_vars *vars = nbc_req->cor_vars; + void (*next_fn)(ADIOI_NBC_Request *, int *); + + ADIOI_Free(vars->req2); + ADIOI_Free(vars->count_others_req_per_proc); + + *vars->count_others_req_procs_ptr = vars->count_others_req_procs; +#ifdef AGGREGATION_PROFILE + MPE_Log_event(5027, 0, NULL); +#endif + /* end of the calculation */ + + next_fn = vars->next_fn; + + /* free the struct for parameters and variables */ + ADIOI_Free(vars); + nbc_req->cor_vars = NULL; + + /* move to the next function */ + next_fn(nbc_req, error_code); +} + diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c b/ompi/mca/io/romio321/romio/adio/common/ad_aggregate_new.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c rename to ompi/mca/io/romio321/romio/adio/common/ad_aggregate_new.c index 59fee5b9a9..aca60b2702 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_aggregate_new.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_aggregate_new.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. +/* + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -39,7 +39,7 @@ void ADIOI_Calc_file_realms (ADIO_File fd, ADIO_Offset min_st_offset, { int nprocs_for_coll; int file_realm_calc_type; - + MPI_Datatype *file_realm_types = NULL; ADIO_Offset *file_realm_st_offs = NULL; @@ -49,8 +49,8 @@ void ADIOI_Calc_file_realms (ADIO_File fd, ADIO_Offset min_st_offset, #ifdef DEBUG printf ("ADIOI_Calc_file_realms\n"); #endif - - nprocs_for_coll = fd->hints->cb_nodes; + + nprocs_for_coll = fd->hints->cb_nodes; file_realm_calc_type = fd->hints->cb_fr_type; /* If PFRs are disabled we know these pointers are not allocated */ @@ -85,7 +85,7 @@ void ADIOI_Calc_file_realms (ADIO_File fd, ADIO_Offset min_st_offset, ADIOI_Malloc (nprocs_for_coll * sizeof(ADIO_Offset)); file_realm_types = (MPI_Datatype *) ADIOI_Malloc (nprocs_for_coll * sizeof(MPI_Datatype)); - + if (file_realm_calc_type == ADIOI_FR_AAR) { ADIOI_Calc_file_realms_aar (fd, nprocs_for_coll, fd->hints->cb_pfr, @@ -218,7 +218,7 @@ void ADIOI_Calc_file_realms_fsize (ADIO_File fd, int nprocs_for_coll, MPI_Datatype simpletype; ADIO_Fcntl (fd, ADIO_FCNTL_GET_FSIZE, &fcntl_struct, &error_code); - + /* use impending file size since a write call may lengthen the file */ fsize = ADIOI_MAX (fcntl_struct.fsize, max_end_offset+1); fr_size = (fsize + nprocs_for_coll - 1) / nprocs_for_coll; @@ -274,7 +274,7 @@ int ADIOI_Agg_idx (int rank, ADIO_File fd) { static void align_fr (int fr_size, ADIO_Offset fr_off, int alignment, int *aligned_fr_size, ADIO_Offset *aligned_fr_off) { *aligned_fr_off = fr_off - (fr_off % alignment); - *aligned_fr_size = ((fr_off + fr_size) / alignment) * alignment - + *aligned_fr_size = ((fr_off + fr_size) / alignment) * alignment - *aligned_fr_off; if ((fr_off + fr_size) % alignment) *aligned_fr_size += alignment; diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_close.c b/ompi/mca/io/romio321/romio/adio/common/ad_close.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/common/ad_close.c rename to ompi/mca/io/romio321/romio/adio/common/ad_close.c index 13b9f7c601..0c39d9e947 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_close.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_close.c @@ -1,13 +1,12 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" #include "adio_extern.h" - #ifdef HAVE_UNISTD_H #include #endif @@ -43,7 +42,7 @@ void ADIO_Close(ADIO_File fd, int *error_code) } else { *error_code = MPI_SUCCESS; } - + } if (fd->access_mode & ADIO_DELETE_ON_CLOSE) { @@ -61,7 +60,7 @@ void ADIO_Close(ADIO_File fd, int *error_code) ADIOI_Ftable[fd->fortran_handle] = MPI_FILE_NULL; } - if (fd->hints && fd->hints->ranklist) ADIOI_Free(fd->hints->ranklist); + if (fd->hints) ADIOI_Free(fd->hints->ranklist); if (fd->hints && fd->hints->cb_config_list) ADIOI_Free(fd->hints->cb_config_list); /* This BlueGene platform-specific free must be done in the common code @@ -72,10 +71,8 @@ void ADIO_Close(ADIO_File fd, int *error_code) * ADIOI_GPFS_Close and re-open via ADIOI_GPFS_Open are done which results * in a double-free - ADIOI_GPFS_Open does not redo the SetInfo... */ #ifdef BGQPLATFORM - if (fd->hints && fd->hints->fs_hints.bg.bridgelist) - ADIOI_Free(fd->hints->fs_hints.bg.bridgelist); - if (fd->hints && fd->hints->fs_hints.bg.bridgelistnum) - ADIOI_Free(fd->hints->fs_hints.bg.bridgelistnum); + if (fd->hints && fd->hints->fs_hints.bg.bridgelist) ADIOI_Free(fd->hints->fs_hints.bg.bridgelist); + if (fd->hints && fd->hints->fs_hints.bg.bridgelistnum) ADIOI_Free(fd->hints->fs_hints.bg.bridgelistnum); #endif /* Persistent File Realms */ @@ -96,12 +93,12 @@ void ADIO_Close(ADIO_File fd, int *error_code) ADIOI_Free(fd->file_realm_st_offs); ADIOI_Free(fd->file_realm_types); } - if (fd->hints) ADIOI_Free(fd->hints); + ADIOI_Free(fd->hints); MPI_Comm_free(&(fd->comm)); - ADIOI_Free(fd->filename); + ADIOI_Free(fd->filename); MPI_Type_get_envelope(fd->etype, &i, &j, &k, &combiner); if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->etype)); @@ -114,7 +111,8 @@ void ADIO_Close(ADIO_File fd, int *error_code) MPI_Info_free(&(fd->info)); - if (fd->io_buf != NULL) ADIOI_Free(fd->io_buf); + ADIOI_Free(fd->io_buf); + ADIOI_OneSidedCleanup(fd); /* memory for fd is freed in MPI_File_close */ } diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c b/ompi/mca/io/romio321/romio/adio/common/ad_coll_build_req_new.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c rename to ompi/mca/io/romio321/romio/adio/common/ad_coll_build_req_new.c index 2b6f29e6f2..a15d61cc32 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_coll_build_req_new.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_coll_build_req_new.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -33,7 +33,7 @@ static inline ADIO_Offset view_state_get_cur_sz(view_state *tmp_view_state_p, { flatten_state *tmp_state_p = NULL; switch(op_type) - { + { case TEMP_OFF: tmp_state_p = &(tmp_view_state_p->tmp_state); break; @@ -62,7 +62,7 @@ static inline ADIO_Offset view_state_get_next_len(view_state *tmp_view_state_p, default: fprintf(stderr, "op_type invalid\n"); } - return (ADIO_Offset) + return (ADIO_Offset) tmp_view_state_p->flat_type_p->blocklens[tmp_state_p->idx] - tmp_state_p->cur_reg_off; } @@ -73,7 +73,7 @@ static inline ADIO_Offset view_state_get_next_len(view_state *tmp_view_state_p, * possible later on. */ static inline int view_state_add_region( ADIO_Offset max_sz, - view_state *tmp_view_state_p, + view_state *tmp_view_state_p, ADIO_Offset *st_reg_p, ADIO_Offset *tmp_reg_sz_p, int op_type) @@ -104,23 +104,23 @@ static inline int view_state_add_region( /* Should be looking at some data (or it's a zero len blocklens * (i.e. placeholder). */ - assert(tmp_state_p->cur_reg_off != + assert(tmp_state_p->cur_reg_off != tmp_flat_type_p->blocklens[tmp_state_p->idx]); /* Shouldn't have been called if the view_state is done. */ assert(tmp_state_p->cur_sz != tmp_view_state_p->sz); /* Make sure we are not in a non-zero region in the flat_type */ assert(tmp_flat_type_p->blocklens[tmp_state_p->idx] != 0); - + #ifdef DEBUG3 fprintf(stderr, "view_state:(blocklens[%Ld]=%d,cur_reg_off=%Ld," - "max_sz=%Ld)\n", tmp_state_p->idx, - tmp_flat_type_p->blocklens[tmp_state_p->idx], + "max_sz=%Ld)\n", tmp_state_p->idx, + tmp_flat_type_p->blocklens[tmp_state_p->idx], tmp_state_p->cur_reg_off, max_sz); #endif /* Can it add the whole piece? */ - if (tmp_flat_type_p->blocklens[tmp_state_p->idx] - + if (tmp_flat_type_p->blocklens[tmp_state_p->idx] - tmp_state_p->cur_reg_off <= max_sz) { data_sz = tmp_flat_type_p->blocklens[tmp_state_p->idx] - @@ -133,15 +133,15 @@ static inline int view_state_add_region( { assert(tmp_flat_type_p->blocklens[tmp_state_p->idx] != 0); tmp_state_p->abs_off += data_sz; -#ifdef DEBUG3 +#ifdef DEBUG3 fprintf(stderr, "view_state_add_region: %s contig type " - "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", - off_type_name[op_type], tmp_state_p->abs_off - data_sz, + "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", + off_type_name[op_type], tmp_state_p->abs_off - data_sz, tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); #endif } else - { + { /* Is this the last region in the datatype? */ if (tmp_state_p->idx == (tmp_flat_type_p->count - 1)) { @@ -151,30 +151,30 @@ static inline int view_state_add_region( tmp_view_state_p->ext; #ifdef DEBUG3 fprintf(stderr, "view_state_add_region: %s last region for type " - "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", - off_type_name[op_type], tmp_state_p->abs_off - data_sz, + "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", + off_type_name[op_type], tmp_state_p->abs_off - data_sz, tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); #endif } else { - tmp_state_p->abs_off += + tmp_state_p->abs_off += tmp_flat_type_p->indices[tmp_state_p->idx + 1] - (tmp_flat_type_p->indices[tmp_state_p->idx] + tmp_state_p->cur_reg_off); #ifdef DEBUG3 fprintf(stderr, "view_state_add_region: %s inner region type " - "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", - off_type_name[op_type], tmp_state_p->abs_off - + "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", + off_type_name[op_type], tmp_state_p->abs_off - (tmp_flat_type_p->indices[tmp_state_p->idx + 1] - (tmp_flat_type_p->indices[tmp_state_p->idx] + - tmp_state_p->cur_reg_off)), tmp_state_p->abs_off, + tmp_state_p->cur_reg_off)), tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); #endif } /* Increment idx to next non-zero region in the flat_type */ do { - tmp_state_p->idx = + tmp_state_p->idx = (tmp_state_p->idx + 1) % tmp_flat_type_p->count; } while (tmp_flat_type_p->blocklens[tmp_state_p->idx] == 0); } @@ -186,10 +186,10 @@ static inline int view_state_add_region( tmp_state_p->cur_reg_off += data_sz; tmp_state_p->abs_off += data_sz; tmp_state_p->cur_sz += data_sz; -#ifdef DEBUG3 +#ifdef DEBUG3 fprintf(stderr, "view_state_add_region: %s partial region type " - "(cur_reg_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld\n", - off_type_name[op_type], tmp_state_p->cur_reg_off, + "(cur_reg_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld\n", + off_type_name[op_type], tmp_state_p->cur_reg_off, tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); #endif } @@ -204,7 +204,7 @@ static inline int view_state_add_region( /* Set up the abs_off, idx, and cur_reg_off of a view_state for the * tmp_state or the cur_state. */ int ADIOI_init_view_state(int file_ptr_type, - int nprocs, + int nprocs, view_state *view_state_arr, int op_type) { @@ -227,7 +227,7 @@ int ADIOI_init_view_state(int file_ptr_type, default: fprintf(stderr, "op_type invalid\n"); } - + tmp_view_p = &(view_state_arr[i]); tmp_flat_type_p = tmp_view_p->flat_type_p; @@ -235,7 +235,7 @@ int ADIOI_init_view_state(int file_ptr_type, tmp_state_p->abs_off = tmp_view_p->fp_ind; else tmp_state_p->abs_off = tmp_view_p->disp; - + tmp_off_used = 0; /* initialize tmp_state idx */ @@ -244,7 +244,7 @@ int ADIOI_init_view_state(int file_ptr_type, if (file_ptr_type == ADIO_EXPLICIT_OFFSET) tmp_state_p->abs_off += tmp_flat_type_p->indices[tmp_state_p->idx]; - /* Initialize the abs_off by moving into the datatype + /* Initialize the abs_off by moving into the datatype * byte_off bytes. Since we only do this in the beginning, we * make the assumption that pieces are added whole until the last * piece which MAY be partial. */ @@ -252,19 +252,19 @@ int ADIOI_init_view_state(int file_ptr_type, { view_state_add_region( tmp_view_p->byte_off - tmp_off_used, - &(view_state_arr[i]), &st_reg, &tmp_reg_sz, + &(view_state_arr[i]), &st_reg, &tmp_reg_sz, op_type); } - + /* Re-initialize the cur_size so that the abs_off was set to * the proper position while the actual size = 0.*/ tmp_state_p->cur_sz = 0; #ifdef DEBUG1 fprintf(stderr, "init_view_state: %s (idx=%d,byte_off=%Ld," - "abs_off=%Ld,reg_off=%Ld,sz=%Ld)\n", off_type_name[op_type], + "abs_off=%Ld,reg_off=%Ld,sz=%Ld)\n", off_type_name[op_type], i, tmp_view_p->byte_off, tmp_state_p->abs_off, tmp_state_p->cur_reg_off, tmp_view_p->sz); -#endif +#endif } return 0; @@ -277,7 +277,7 @@ static inline int get_next_fr_off(ADIO_File fd, ADIO_Offset fr_st_off, MPI_Datatype *fr_type_p, ADIO_Offset *fr_next_off_p, - ADIO_Offset *fr_max_len_p) + ADIO_Offset *fr_max_len_p) { MPI_Aint fr_extent = -1, lb; ADIO_Offset tmp_off, off_rem; @@ -297,7 +297,7 @@ static inline int get_next_fr_off(ADIO_File fd, return 0; } - /* Calculate how many times to loop through the fr_type + /* Calculate how many times to loop through the fr_type * and where the next fr_off is. */ MPI_Type_get_extent(*fr_type_p, &lb, &fr_extent); tmp_off = off - fr_st_off; @@ -315,12 +315,12 @@ static inline int get_next_fr_off(ADIO_File fd, else if (off_rem < fr_node_p->indices[i] + fr_node_p->blocklens[i]) { *fr_next_off_p = off; - *fr_max_len_p = fr_node_p->blocklens[i] - + *fr_max_len_p = fr_node_p->blocklens[i] - (off_rem - fr_node_p->indices[i]); return off; } } - + /* Shouldn't get here. */ fprintf(stderr, "get_next_fr_off: Couldn't find the correct " "location of the next offset for this file realm.\n"); @@ -340,7 +340,7 @@ static inline int find_next_off(ADIO_File fd, ADIO_Offset *cur_reg_max_len_p) { ADIOI_Flatlist_node *tmp_flat_type_p = NULL; - ADIO_Offset tmp_off = -1, fr_next_off = -1, fr_max_len = -1, + ADIO_Offset tmp_off = -1, fr_next_off = -1, fr_max_len = -1, tmp_fr_max_len = -1; int ret = 0; flatten_state *tmp_state_p = NULL; @@ -364,7 +364,7 @@ static inline int find_next_off(ADIO_File fd, default: fprintf(stderr, "op_type invalid\n"); } - + tmp_flat_type_p = view_state_p->flat_type_p; /* Can we use this proc? */ @@ -372,26 +372,26 @@ static inline int find_next_off(ADIO_File fd, tmp_st_off = 0; tmp_reg_sz = 0; /* If the current region is not within the file realm, advance - * the state until it is and calculate the end of the next file + * the state until it is and calculate the end of the next file * realm in fr_max_len. */ ret = get_next_fr_off(fd, - tmp_state_p->abs_off, + tmp_state_p->abs_off, fr_st_off, fr_type_p, &fr_next_off, &fr_max_len); - + while ((tmp_state_p->abs_off < fr_next_off) && (tmp_state_p->cur_sz != view_state_p->sz)) { - + /* While this might appear to be erroneous at first, * view_state_add_region can only add a single piece at a * time. Therefore, it will never overshoot the beginning * of the next file realm. When it finally does enter the * next file realm it will not be able to go beyond its * first piece. */ - + #ifdef DTYPE_SKIP if (tmp_flat_type_p->count > 1) { /* let's see if we can skip whole datatypes */ @@ -418,7 +418,7 @@ static inline int find_next_off(ADIO_File fd, op_type); ret = get_next_fr_off(fd, - tmp_state_p->abs_off, + tmp_state_p->abs_off, fr_st_off, fr_type_p, &fr_next_off, @@ -446,7 +446,7 @@ static inline int find_next_off(ADIO_File fd, * should return a list of MPI_Datatypes that correspond to client * communication into a collective buffer, a list of corresponding * sizes, and an aggregate MPI_Datatype which will be used as a - * filetype in MPI_File_write/read on the aggregator. */ + * filetype in MPI_File_write/read on the aggregator. */ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, view_state *client_file_view_state_arr, MPI_Datatype *client_comm_dtype_arr, @@ -480,21 +480,21 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, memset(client_comm_sz_arr, 0, nprocs*sizeof(ADIO_Offset)); - if ((client_comm_next_off_arr = (ADIO_Offset *) + if ((client_comm_next_off_arr = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset))) == NULL) { fprintf(stderr, "ADIOI_Build_agg_reqs: malloc client_next_off_arr " "failed\n"); return -1; } - + if ((client_ol_ct_arr = (int *) ADIOI_Calloc(nprocs, sizeof(int))) == NULL) { fprintf(stderr, "ADIOI_Build_agg_reqs: " "malloc client_ol_ct_arr failed\n"); return -1; } - if ((client_ol_cur_ct_arr = + if ((client_ol_cur_ct_arr = (int *) ADIOI_Calloc(nprocs, sizeof(int))) == NULL) { fprintf(stderr, "ADIOI_Build_agg_reqs: " @@ -517,9 +517,9 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, /* initialize heap */ ADIOI_Heap_create(&offset_heap, nprocs); offset_heap.size = 0; - + for (j=0; jhints->cb_buffer_size); #endif - + /* We process only contiguous file realm regions if we are * using data sieving. Note that we only do this for * writes since reads can be data sieved across each other @@ -595,23 +595,23 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, #ifdef DEBUG1 fprintf(stderr, "ADIOI_Build_agg_reqs: " "Data sieving file realm end changed from " - "%Ld to %Ld\n", ds_fr_end, + "%Ld to %Ld\n", ds_fr_end, cur_off + cur_reg_max_len); #endif break; } } } - + /* Add up to the end of the file realm or the collective * buffer. */ - if (cur_reg_max_len > (fd->hints->cb_buffer_size - + if (cur_reg_max_len > (fd->hints->cb_buffer_size - tmp_coll_buf_sz)) cur_reg_max_len = fd->hints->cb_buffer_size - tmp_coll_buf_sz; view_state_add_region( cur_reg_max_len, - &(client_file_view_state_arr[cur_off_proc]), + &(client_file_view_state_arr[cur_off_proc]), &st_reg, &act_reg_sz, i); switch(i) @@ -621,14 +621,14 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, * the used part of the collective buffer if the * next region is not adjacent to the previous * region. */ - if (client_comm_next_off_arr[cur_off_proc] != + if (client_comm_next_off_arr[cur_off_proc] != tmp_coll_buf_sz) { (client_ol_ct_arr[cur_off_proc])++; } - client_comm_next_off_arr[cur_off_proc] = + client_comm_next_off_arr[cur_off_proc] = tmp_coll_buf_sz + act_reg_sz; - + if (agg_next_off != st_reg) agg_ol_ct++; agg_next_off = st_reg + act_reg_sz; @@ -638,24 +638,24 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, * the next region is not adjacent to the previous * region. */ next_off_idx = client_ol_cur_ct_arr[cur_off_proc]; - if (client_comm_next_off_arr[cur_off_proc] != + if (client_comm_next_off_arr[cur_off_proc] != tmp_coll_buf_sz) { client_disp_arr[cur_off_proc][next_off_idx] = tmp_coll_buf_sz; - client_blk_arr[cur_off_proc][next_off_idx] = + client_blk_arr[cur_off_proc][next_off_idx] = act_reg_sz; (client_ol_cur_ct_arr[cur_off_proc])++; } else { - client_blk_arr[cur_off_proc][next_off_idx - 1] + client_blk_arr[cur_off_proc][next_off_idx - 1] += act_reg_sz; } client_comm_sz_arr[cur_off_proc] += act_reg_sz; client_comm_next_off_arr[cur_off_proc] = tmp_coll_buf_sz + act_reg_sz; - + /* Add to the aggregator filetype if the next * region is not adjacent to the previous * region. */ @@ -667,7 +667,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, *agg_dtype_offset_p = st_reg; agg_disp_arr[agg_ol_cur_ct] = st_reg - (MPI_Aint) *agg_dtype_offset_p; - agg_blk_arr[agg_ol_cur_ct] = act_reg_sz; + agg_blk_arr[agg_ol_cur_ct] = act_reg_sz; agg_ol_cur_ct++; } else @@ -675,7 +675,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, agg_blk_arr[agg_ol_cur_ct - 1] += act_reg_sz; } agg_next_off = st_reg + act_reg_sz; - + break; default: fprintf(stderr, "ADIOI_Build_agg_reqs: Impossible type\n"); @@ -699,12 +699,12 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, #endif } } - + if (i == TEMP_OFF) { /* Allocate offset-length pairs for creating hindexed * MPI_Datatypes for both the client and the aggregator. */ - if ((client_disp_arr = (MPI_Aint **) + if ((client_disp_arr = (MPI_Aint **) ADIOI_Malloc(nprocs*sizeof(MPI_Aint *))) == NULL) { fprintf(stderr, "ADIOI_Build_agg_reqs: malloc " @@ -718,7 +718,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, fprintf(stderr, "ADIOI_Build_agg_reqs: malloc " "client_blk_arr failed\n"); return -1; - } + } for (j = 0; j < nprocs; j++) { if ((client_disp_arr[j] = (MPI_Aint *) ADIOI_Malloc( @@ -728,7 +728,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, "client_disp_arr[%d] failed\n", j); return -1; } - if ((client_blk_arr[j] = (int *) + if ((client_blk_arr[j] = (int *) ADIOI_Malloc(client_ol_ct_arr[j]*sizeof(int))) == NULL) { ADIOI_Free(client_disp_arr[j]); @@ -737,21 +737,21 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, return -1; } } - - if (agg_ol_ct > 0) + + if (agg_ol_ct > 0) { if ((agg_disp_arr = (MPI_Aint *) ADIOI_Malloc( agg_ol_ct*sizeof(MPI_Aint))) == NULL) { - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_agg_reqs: malloc disp_arr failed\n"); return -1; } - if ((agg_blk_arr = (int *) + if ((agg_blk_arr = (int *) ADIOI_Malloc(agg_ol_ct*sizeof(int))) == NULL) { ADIOI_Free(agg_disp_arr); - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_agg_reqs: malloc blk_arr failed\n"); return -1; } @@ -759,7 +759,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, } ADIOI_Heap_free(&offset_heap); } - + /* Let the clients know if this aggregator is totally finished * with all possible client requests. */ all_done = 1; @@ -788,7 +788,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, if (client_ol_cur_ct_arr[i] != client_ol_ct_arr[i]) { fprintf(stderr, "ADIOI_Build_agg_reqs: ERROR Process %d " - "processed only %d out of %d ol pairs\n", i, + "processed only %d out of %d ol pairs\n", i, client_ol_cur_ct_arr[i], client_ol_ct_arr[i]); return -1; @@ -817,13 +817,13 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, fprintf(stderr, "ADIOI_Build_agg_reqs: p %d (off,len) = ", i); for (j = 0; j < client_ol_ct_arr[i]; j++) { - fprintf(stderr, "[%d](%d,%d) ", j, + fprintf(stderr, "[%d](%d,%d) ", j, client_disp_arr[i][j], client_blk_arr[i][j]); } fprintf(stderr, "\n"); } - } + } if (agg_ol_ct) { fprintf(stderr, "ADIOI_Build_agg_reqs:agg_type(off,len)="); for (i = 0; i < agg_ol_ct; i++) @@ -845,8 +845,8 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, if (client_comm_sz_arr[i] > 0) { MPI_Type_create_hindexed(client_ol_ct_arr[i], client_blk_arr[i], - client_disp_arr[i], MPI_BYTE, - &(client_comm_dtype_arr[i])); + client_disp_arr[i], MPI_BYTE, + &(client_comm_dtype_arr[i])); MPI_Type_commit(&(client_comm_dtype_arr[i])); } else @@ -864,7 +864,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, MPI_Type_contiguous (agg_blk_arr[0], MPI_BYTE, agg_dtype_p); else if (agg_ol_ct > 1) MPI_Type_create_hindexed(agg_ol_ct, agg_blk_arr, agg_disp_arr, MPI_BYTE, - agg_dtype_p); + agg_dtype_p); MPI_Type_commit(agg_dtype_p); @@ -884,7 +884,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, * then call this function, which will generate the comm datatypes for * each aggregator (agg_comm_dtype_arr) in the upcoming * MPI_Alltoallw() */ -int ADIOI_Build_client_reqs(ADIO_File fd, +int ADIOI_Build_client_reqs(ADIO_File fd, int nprocs, view_state *my_mem_view_state_arr, view_state *agg_file_view_state_arr, @@ -928,7 +928,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, fprintf(stderr, "\n"); } #endif - + if ((agg_mem_next_off_arr = (ADIO_Offset *) ADIOI_Malloc( nprocs*sizeof(ADIO_Offset))) == NULL) { @@ -937,7 +937,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, return -1; } - if ((agg_comm_cur_sz_arr = (ADIO_Offset *) + if ((agg_comm_cur_sz_arr = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset))) == NULL) { fprintf(stderr, "ADIOI_Build_client_reqs: malloc agg_comm_cur_sz_arr" @@ -964,7 +964,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, if (agg_comm_sz_arr[i] > 0) total_agg_comm_sz += agg_comm_sz_arr[i]; } - + /* On the first pass see how many offset-length pairs are * necessary for each aggregator. Then allocate the correct * amount of offset-length pairs for handling each aggregator's @@ -984,11 +984,11 @@ int ADIOI_Build_client_reqs(ADIO_File fd, { tmp_agg_fr_idx = ADIOI_Agg_idx(j, fd); assert(tmp_agg_fr_idx < fd->hints->cb_nodes); - + /* If this process is not an aggregator or we have * finished all the bytes for this aggregator, move * along. */ - if (tmp_agg_fr_idx < 0 || + if (tmp_agg_fr_idx < 0 || agg_comm_cur_sz_arr[j] == agg_comm_sz_arr[j]) { continue; @@ -1002,9 +1002,9 @@ int ADIOI_Build_client_reqs(ADIO_File fd, &tmp_cur_off, &tmp_cur_reg_max_len); if (tmp_cur_off == -1) - continue; + continue; - if ((cur_off == -1) || + if ((cur_off == -1) || (cur_off > tmp_cur_off)) { cur_off_proc = j; @@ -1014,23 +1014,23 @@ int ADIOI_Build_client_reqs(ADIO_File fd, } assert(cur_off_proc != -1); - + /* Add up to the end of the file realm or as many bytes * are left for this particular aggregator in the client's * filetype */ - if (cur_reg_max_len > agg_comm_sz_arr[cur_off_proc] - + if (cur_reg_max_len > agg_comm_sz_arr[cur_off_proc] - agg_comm_cur_sz_arr[cur_off_proc]) { - cur_reg_max_len = agg_comm_sz_arr[cur_off_proc] - + cur_reg_max_len = agg_comm_sz_arr[cur_off_proc] - agg_comm_cur_sz_arr[cur_off_proc]; } assert(cur_reg_max_len > 0); - + view_state_add_region( cur_reg_max_len, &(agg_file_view_state_arr[cur_off_proc]), &st_reg, &act_reg_sz, i); - + #ifdef DEBUG2 fprintf(stderr, "ADIOI_Build_client_reqs: %s File region" " (proc=%d,off=%Ld,sz=%Ld)\n", @@ -1046,7 +1046,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, tmp_mem_state_p = &(my_mem_view_state_arr[cur_off_proc]); assert(view_state_get_cur_sz(tmp_file_state_p, i) - act_reg_sz >= view_state_get_cur_sz(tmp_mem_state_p, i)); - while (view_state_get_cur_sz(tmp_file_state_p, i) - act_reg_sz != + while (view_state_get_cur_sz(tmp_file_state_p, i) - act_reg_sz != view_state_get_cur_sz(tmp_mem_state_p, i)) { ADIO_Offset fill_st_reg = -1, fill_reg_sz = -1; @@ -1057,7 +1057,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, &fill_st_reg, &fill_reg_sz, i); } - + /* Based on how large the act_reg_sz 1. Figure out how * many memory offset-length pairs are necessary. 2. Set * the offset-length pairs. */ @@ -1067,7 +1067,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, view_state_add_region( act_reg_sz - tmp_reg_sz, tmp_mem_state_p, - &agg_mem_st_reg, &agg_mem_act_reg_sz, + &agg_mem_st_reg, &agg_mem_act_reg_sz, i); tmp_reg_sz += agg_mem_act_reg_sz; @@ -1078,19 +1078,19 @@ int ADIOI_Build_client_reqs(ADIO_File fd, agg_mem_st_reg, agg_mem_act_reg_sz); #endif agg_comm_cur_sz_arr[cur_off_proc] += agg_mem_act_reg_sz; - cur_total_agg_comm_sz += agg_mem_act_reg_sz; + cur_total_agg_comm_sz += agg_mem_act_reg_sz; switch(i) { case TEMP_OFF: /* Increment the ol list count a particular * aggregator if next region is not adjacent * to the previous region. */ - if (agg_mem_next_off_arr[cur_off_proc] != + if (agg_mem_next_off_arr[cur_off_proc] != agg_mem_st_reg) { agg_ol_ct_arr[cur_off_proc]++; } - agg_mem_next_off_arr[cur_off_proc] = + agg_mem_next_off_arr[cur_off_proc] = agg_mem_st_reg + agg_mem_act_reg_sz; break; case REAL_OFF: @@ -1098,12 +1098,12 @@ int ADIOI_Build_client_reqs(ADIO_File fd, * map to each aggregator, coaslescing if * possible. */ agg_next_off_idx = agg_ol_cur_ct_arr[cur_off_proc]; - if (agg_mem_next_off_arr[cur_off_proc] != + if (agg_mem_next_off_arr[cur_off_proc] != agg_mem_st_reg) { - agg_disp_arr[cur_off_proc][agg_next_off_idx] = + agg_disp_arr[cur_off_proc][agg_next_off_idx] = agg_mem_st_reg; - agg_blk_arr[cur_off_proc][agg_next_off_idx] = + agg_blk_arr[cur_off_proc][agg_next_off_idx] = agg_mem_act_reg_sz; (agg_ol_cur_ct_arr[cur_off_proc])++; } @@ -1112,7 +1112,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, agg_blk_arr[cur_off_proc][agg_next_off_idx - 1] += agg_mem_act_reg_sz; } - agg_mem_next_off_arr[cur_off_proc] = + agg_mem_next_off_arr[cur_off_proc] = agg_mem_st_reg + agg_mem_act_reg_sz; break; default: @@ -1121,38 +1121,38 @@ int ADIOI_Build_client_reqs(ADIO_File fd, } } } - + /* On the first pass, allocate the memory structures for * creating the MPI_hindexed type. */ if (i == TEMP_OFF) - { + { /* Allocate offset-length pairs for creating hindexed * MPI_Datatypes for each aggregator */ - if ((agg_disp_arr = (MPI_Aint **) + if ((agg_disp_arr = (MPI_Aint **) ADIOI_Malloc(nprocs*sizeof(MPI_Aint *))) == NULL) { - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_reqs: malloc agg_disp_arr failed\n"); return -1; } - if ((agg_blk_arr = (int **) ADIOI_Malloc(nprocs*sizeof(int *))) + if ((agg_blk_arr = (int **) ADIOI_Malloc(nprocs*sizeof(int *))) == NULL) { ADIOI_Free(agg_disp_arr); - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_reqs: malloc agg_blk_arr failed\n"); return -1; - } + } for (j = 0; j < nprocs; j++) { - if ((agg_disp_arr[j] = (MPI_Aint *) + if ((agg_disp_arr[j] = (MPI_Aint *) ADIOI_Malloc(agg_ol_ct_arr[j]*sizeof(MPI_Aint))) == NULL) { fprintf(stderr, "ADIOI_Build_client_reqs: malloc " "agg_disp_arr[%d] failed\n", j); return -1; } - if ((agg_blk_arr[j] = (int *) + if ((agg_blk_arr[j] = (int *) ADIOI_Malloc(agg_ol_ct_arr[j]*sizeof(int))) == NULL) { ADIOI_Free(agg_disp_arr[j]); @@ -1204,8 +1204,8 @@ int ADIOI_Build_client_reqs(ADIO_File fd, if (agg_comm_sz_arr[i] > 0) { MPI_Type_create_hindexed(agg_ol_ct_arr[i], agg_blk_arr[i], - agg_disp_arr[i], MPI_BYTE, - &(agg_comm_dtype_arr[i])); + agg_disp_arr[i], MPI_BYTE, + &(agg_comm_dtype_arr[i])); MPI_Type_commit(&(agg_comm_dtype_arr[i])); } else @@ -1224,7 +1224,7 @@ int ADIOI_Build_client_reqs(ADIO_File fd, ADIOI_Free(agg_ol_cur_ct_arr); #ifdef AGGREGATION_PROFILE MPE_Log_event (5019, 0, NULL); -#endif +#endif return 0; } /* ADIOI_Build_client_pre_req allows a client to calculate the memtype @@ -1265,12 +1265,12 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, return -1; } - if (agg_file_view_state_p->cur_state.cur_sz == + if (agg_file_view_state_p->cur_state.cur_sz == agg_file_view_state_p->sz || max_pre_req_sz <= 0 || max_ol_ct <= 0) { #ifdef DEBUG1 - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_pre_req: Nothing to preprocess\n"); #endif return 0; @@ -1282,13 +1282,13 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, (my_mem_view_state_p->pre_ol_ct >= max_ol_ct)) { #ifdef DEBUG1 - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_pre_req: Old values surpass new " "pre_req values\n"); #endif return 0; } - + /* General idea is to first advance the filetype to the file realm * and then the memtype to the filetype. The memtype is advanced * further by peeking at the filetype and then the filetype is @@ -1326,18 +1326,18 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, { cur_sz = my_mem_view_state_p->pre_sz; agg_ol_cur_ct = my_mem_view_state_p->pre_ol_ct; - + /* Copy the old data to the new data, freeing the old * arrays */ - memcpy(my_mem_view_state_p->pre_disp_arr, tmp_disp_arr, + memcpy(my_mem_view_state_p->pre_disp_arr, tmp_disp_arr, my_mem_view_state_p->pre_ol_ct * sizeof(MPI_Aint)); - memcpy(my_mem_view_state_p->pre_blk_arr, tmp_blk_arr, + memcpy(my_mem_view_state_p->pre_blk_arr, tmp_blk_arr, my_mem_view_state_p->pre_ol_ct * sizeof(int)); ADIOI_Free(tmp_disp_arr); ADIOI_Free(tmp_blk_arr); - agg_mem_next_off = + agg_mem_next_off = my_mem_view_state_p->pre_disp_arr[agg_ol_cur_ct - 1] + my_mem_view_state_p->pre_blk_arr[agg_ol_cur_ct - 1]; } @@ -1345,10 +1345,10 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, { cur_sz = 0; } - + /* Max_pre_req_sz may be larger than the amount of data left * to preprocess */ - if (max_pre_req_sz - cur_sz > + if (max_pre_req_sz - cur_sz > agg_file_view_state_p->sz - tmp_file_state_p->cur_sz) { max_sz = cur_sz + @@ -1356,12 +1356,12 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, } else max_sz = max_pre_req_sz; - + assert(cur_sz != max_sz); #ifdef DEBUG1 - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_pre_req: (cur_sz=%Ld,agg_ol_ct=%d," - "agg_mem_next_off=%Ld,max_sz=%Ld,max_ol_ct=%d)\n", + "agg_mem_next_off=%Ld,max_sz=%Ld,max_ol_ct=%d)\n", cur_sz, agg_ol_ct, agg_mem_next_off, max_sz, max_ol_ct); #endif while (cur_sz < max_sz) @@ -1372,7 +1372,7 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, i, &cur_off, &cur_reg_max_len); - + /* find_next_off may show that the file_view_state is done * even if cur_sz != max_sz since find_next_off may * advance the file_view_state to the end here and realize @@ -1381,7 +1381,7 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, break; assert(cur_off != -1); - + /* Before translating the file regions to memory regions, * we first must advance to the proper point in the * mem_view_state for this aggregator to match the @@ -1417,10 +1417,10 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, * overstepped the min(end of the current piece in the * file view, end of the file realm, data left in * max_sz) */ - - if (cur_reg_max_len > + + if (cur_reg_max_len > view_state_get_next_len(agg_file_view_state_p, i)) - cur_reg_max_len = + cur_reg_max_len = view_state_get_next_len(agg_file_view_state_p, i); if (cur_reg_max_len > max_sz - cur_sz) @@ -1433,20 +1433,20 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, * allowed */ act_reg_sz = 0; exit_loop = 0; - while ((act_reg_sz < cur_reg_max_len) && + while ((act_reg_sz < cur_reg_max_len) && (exit_loop == 0)) { view_state_add_region( cur_reg_max_len - act_reg_sz, my_mem_view_state_p, - &agg_mem_st_reg, &agg_mem_act_reg_sz, + &agg_mem_st_reg, &agg_mem_act_reg_sz, i); act_reg_sz += agg_mem_act_reg_sz; - + #ifdef DEBUG2 fprintf(stderr, "ADIOI_Build_client_pre_req: %s Mem region" "(proc=%d,off=%Ld,sz=%Ld)\n", - off_type_name[i], agg_rank, agg_mem_st_reg, + off_type_name[i], agg_rank, agg_mem_st_reg, agg_mem_act_reg_sz); #endif switch(i) @@ -1461,7 +1461,7 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, if (agg_ol_ct == max_ol_ct) exit_loop = 1; } - agg_mem_next_off = + agg_mem_next_off = agg_mem_st_reg + agg_mem_act_reg_sz; break; case REAL_OFF: @@ -1472,10 +1472,10 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, if (agg_mem_next_off != agg_mem_st_reg) { my_mem_view_state_p-> - pre_disp_arr[agg_next_off_idx] = + pre_disp_arr[agg_next_off_idx] = agg_mem_st_reg; my_mem_view_state_p-> - pre_blk_arr[agg_next_off_idx] = + pre_blk_arr[agg_next_off_idx] = agg_mem_act_reg_sz; agg_ol_cur_ct++; if (agg_ol_cur_ct == agg_ol_ct) @@ -1487,7 +1487,7 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, pre_blk_arr[agg_next_off_idx - 1] += agg_mem_act_reg_sz; } - agg_mem_next_off = + agg_mem_next_off = agg_mem_st_reg + agg_mem_act_reg_sz; break; default: @@ -1515,10 +1515,10 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, "view_state_add_region failed to match the memtype\n"); return -1; } - + cur_sz += act_reg_sz; } - + /* On the first pass, allocate the memory structures for * storing the preprocessed information */ if (i == TEMP_OFF) @@ -1531,7 +1531,7 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, (long int)agg_ol_ct * sizeof(MPI_Aint)); return -1; } - if ((my_mem_view_state_p->pre_blk_arr = (int *) + if ((my_mem_view_state_p->pre_blk_arr = (int *) ADIOI_Malloc(agg_ol_ct * sizeof(int))) == NULL) { ADIOI_Free(my_mem_view_state_p->pre_disp_arr); @@ -1559,8 +1559,8 @@ int ADIOI_Build_client_pre_req(ADIO_File fd, "(off,len) = \n", agg_rank, my_mem_view_state_p->pre_sz); for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) { - fprintf(stderr, "[%d](%d,%d) ", i, - my_mem_view_state_p->pre_disp_arr[i], + fprintf(stderr, "[%d](%d,%d) ", i, + my_mem_view_state_p->pre_disp_arr[i], my_mem_view_state_p->pre_blk_arr[i]); if (i % 5 == 0 && i != 0) fprintf(stderr, "\n"); @@ -1605,7 +1605,7 @@ static int process_pre_req(ADIO_File fd, { for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) { - if ((my_mem_view_state_p->pre_blk_arr[i] + + if ((my_mem_view_state_p->pre_blk_arr[i] + *agg_comm_pre_sz_p) > *agg_comm_sz_p) { has_partial = 1; @@ -1617,39 +1617,39 @@ static int process_pre_req(ADIO_File fd, else if ((my_mem_view_state_p->pre_blk_arr[i] + *agg_comm_pre_sz_p) == *agg_comm_sz_p) { - *agg_comm_pre_sz_p += + *agg_comm_pre_sz_p += my_mem_view_state_p->pre_blk_arr[i]; i++; break; } else - *agg_comm_pre_sz_p += + *agg_comm_pre_sz_p += my_mem_view_state_p->pre_blk_arr[i]; } - + if (has_partial == 1) { - *agg_mem_next_off_p = - my_mem_view_state_p->pre_disp_arr[i - 1] + + *agg_mem_next_off_p = + my_mem_view_state_p->pre_disp_arr[i - 1] + partial_len; } else { - *agg_mem_next_off_p = - my_mem_view_state_p->pre_disp_arr[i - 1] + + *agg_mem_next_off_p = + my_mem_view_state_p->pre_disp_arr[i - 1] + my_mem_view_state_p->pre_blk_arr[i - 1]; } - + *agg_comm_cur_sz_p = *agg_comm_pre_sz_p; *agg_ol_ct_p = i; - + } else /* Use all the precalculated data */ { *agg_comm_pre_sz_p = my_mem_view_state_p->pre_sz; *agg_comm_cur_sz_p = *agg_comm_pre_sz_p; *agg_ol_ct_p = my_mem_view_state_p->pre_ol_ct; - *agg_mem_next_off_p = + *agg_mem_next_off_p = my_mem_view_state_p->pre_disp_arr[ my_mem_view_state_p->pre_ol_ct - 1] + my_mem_view_state_p->pre_blk_arr[ @@ -1669,8 +1669,8 @@ static int process_pre_req(ADIO_File fd, { agg_disp_arr[i] = my_mem_view_state_p->pre_disp_arr[i]; agg_blk_arr[i] = my_mem_view_state_p->pre_blk_arr[i]; - - if ((my_mem_view_state_p->pre_blk_arr[i] + + + if ((my_mem_view_state_p->pre_blk_arr[i] + tmp_agg_comm_pre_sz) > *agg_comm_pre_sz_p) { has_partial = 1; @@ -1678,7 +1678,7 @@ static int process_pre_req(ADIO_File fd, tmp_agg_comm_pre_sz = *agg_comm_pre_sz_p; partial_disp = my_mem_view_state_p->pre_disp_arr[i] + agg_blk_arr[i]; - partial_len = my_mem_view_state_p->pre_blk_arr[i] - + partial_len = my_mem_view_state_p->pre_blk_arr[i] - agg_blk_arr[i]; i++; break; @@ -1686,7 +1686,7 @@ static int process_pre_req(ADIO_File fd, else if ((my_mem_view_state_p->pre_blk_arr[i] + tmp_agg_comm_pre_sz) == *agg_comm_pre_sz_p) { - tmp_agg_comm_pre_sz += + tmp_agg_comm_pre_sz += my_mem_view_state_p->pre_blk_arr[i]; i++; break; @@ -1698,15 +1698,15 @@ static int process_pre_req(ADIO_File fd, *agg_mem_next_off_p = agg_disp_arr[i - 1] + agg_blk_arr[i - 1]; *agg_ol_cur_ct_p = i; *agg_comm_cur_sz_p = *agg_comm_pre_sz_p; - - /* Clean up the ol pairs we used */ + + /* Clean up the ol pairs we used */ if ((i < my_mem_view_state_p->pre_ol_ct) || (has_partial == 1)) { - int remain_ol_ct = + int remain_ol_ct = my_mem_view_state_p->pre_ol_ct - i + has_partial; MPI_Aint *new_pre_disp_arr = NULL; int *new_pre_blk_arr = NULL; - + if ((new_pre_disp_arr = (MPI_Aint *) ADIOI_Malloc(remain_ol_ct * sizeof(MPI_Aint))) == NULL) { @@ -1721,14 +1721,14 @@ static int process_pre_req(ADIO_File fd, "new_pre_blk_arr failed\n"); return -1; } - - memcpy(new_pre_disp_arr, + + memcpy(new_pre_disp_arr, &(my_mem_view_state_p->pre_disp_arr[i - has_partial]), remain_ol_ct * sizeof(MPI_Aint)); - memcpy(new_pre_blk_arr, + memcpy(new_pre_blk_arr, &(my_mem_view_state_p->pre_blk_arr[i - has_partial]), remain_ol_ct * sizeof(int)); - + /* Set the partial len of the first piece */ if (has_partial == 1) { @@ -1737,10 +1737,10 @@ static int process_pre_req(ADIO_File fd, new_pre_disp_arr[0] = partial_disp; new_pre_blk_arr[0] = partial_len; } - + ADIOI_Free(my_mem_view_state_p->pre_disp_arr); ADIOI_Free(my_mem_view_state_p->pre_blk_arr); - + my_mem_view_state_p->pre_disp_arr = new_pre_disp_arr; my_mem_view_state_p->pre_blk_arr = new_pre_blk_arr; my_mem_view_state_p->pre_ol_ct = remain_ol_ct; @@ -1750,7 +1750,7 @@ static int process_pre_req(ADIO_File fd, { ADIOI_Free(my_mem_view_state_p->pre_disp_arr); ADIOI_Free(my_mem_view_state_p->pre_blk_arr); - + my_mem_view_state_p->pre_disp_arr = NULL; my_mem_view_state_p->pre_blk_arr = NULL; my_mem_view_state_p->pre_ol_ct = 0; @@ -1760,7 +1760,7 @@ static int process_pre_req(ADIO_File fd, fprintf(stderr, "process_pre_req: REAL_OFF " "agg_comm_pre_sz=%Ld,agg_comm_cur_sz=%Ld,agg_ol_ct=%d," "agg_ol_cur_ct=%d\n", - *agg_comm_pre_sz_p, *agg_comm_cur_sz_p, *agg_ol_ct_p, + *agg_comm_pre_sz_p, *agg_comm_cur_sz_p, *agg_ol_ct_p, *agg_ol_cur_ct_p); #endif break; @@ -1814,7 +1814,7 @@ int ADIOI_Build_client_req(ADIO_File fd, fprintf(stderr, "ADIOI_Build_client_req:(agg=%d,size_req=%Ld)\n", agg_idx, agg_comm_sz); #endif - + /* On the first pass see how many offset-length pairs are * necessary for each aggregator. Then allocate the correct * amount of offset-length pairs for handling each aggregator's @@ -1859,18 +1859,18 @@ int ADIOI_Build_client_req(ADIO_File fd, &agg_ol_ct, &agg_mem_next_off); } - + while (agg_comm_cur_sz < agg_comm_sz) - { + { find_next_off(fd, agg_file_view_state_p, fr_st_off_arr[agg_idx], &(fr_type_arr[agg_idx]), i, &cur_off, &cur_reg_max_len); - + assert(cur_off != -1); - + /* Add up to the end of the file realm or as many bytes * are left for this particular aggregator in the client's * filetype */ @@ -1879,27 +1879,27 @@ int ADIOI_Build_client_req(ADIO_File fd, cur_reg_max_len = agg_comm_sz - agg_comm_cur_sz; } assert(cur_reg_max_len > 0); - + view_state_add_region( cur_reg_max_len, agg_file_view_state_p, &st_reg, &act_reg_sz, i); - + #ifdef DEBUG2 fprintf(stderr, "ADIOI_Build_client_req: %s File region" " (proc=%d,off=%Ld,sz=%Ld)\n", off_type_name[i], agg_rank, cur_off, act_reg_sz); #endif - + /* Before translating the file regions to memory regions, * we first must advance to the proper point in the * mem_view_state for this aggregator to match the * file_view_state. */ - - assert(tmp_file_state_p->cur_sz - act_reg_sz >= + + assert(tmp_file_state_p->cur_sz - act_reg_sz >= tmp_mem_state_p->cur_sz); - - while (tmp_file_state_p->cur_sz - act_reg_sz != + + while (tmp_file_state_p->cur_sz - act_reg_sz != tmp_mem_state_p->cur_sz) { ADIO_Offset fill_st_reg = -1, fill_reg_sz = -1; @@ -1922,13 +1922,13 @@ int ADIOI_Build_client_req(ADIO_File fd, } #endif view_state_add_region( - tmp_file_state_p->cur_sz - + tmp_file_state_p->cur_sz - act_reg_sz - tmp_mem_state_p->cur_sz, my_mem_view_state_p, &fill_st_reg, &fill_reg_sz, i); } - + /* Based on how large the act_reg_sz is, first figure * out how many memory offset-length pairs are * necessary and then set the offset-length pairs. */ @@ -1938,14 +1938,14 @@ int ADIOI_Build_client_req(ADIO_File fd, view_state_add_region( act_reg_sz - tmp_reg_sz, my_mem_view_state_p, - &agg_mem_st_reg, &agg_mem_act_reg_sz, + &agg_mem_st_reg, &agg_mem_act_reg_sz, i); tmp_reg_sz += agg_mem_act_reg_sz; - + #ifdef DEBUG2 fprintf(stderr, "ADIOI_Build_client_req: %s Mem region" "(off=%Ld,sz=%Ld)\n", - off_type_name[i], agg_mem_st_reg, + off_type_name[i], agg_mem_st_reg, agg_mem_act_reg_sz); #endif agg_comm_cur_sz += agg_mem_act_reg_sz; @@ -1959,7 +1959,7 @@ int ADIOI_Build_client_req(ADIO_File fd, { agg_ol_ct++; } - agg_mem_next_off = + agg_mem_next_off = agg_mem_st_reg + agg_mem_act_reg_sz; break; case REAL_OFF: @@ -1969,9 +1969,9 @@ int ADIOI_Build_client_req(ADIO_File fd, agg_next_off_idx = agg_ol_cur_ct; if (agg_mem_next_off != agg_mem_st_reg) { - agg_disp_arr[agg_next_off_idx] = + agg_disp_arr[agg_next_off_idx] = agg_mem_st_reg; - agg_blk_arr[agg_next_off_idx] = + agg_blk_arr[agg_next_off_idx] = agg_mem_act_reg_sz; agg_ol_cur_ct++; } @@ -1980,7 +1980,7 @@ int ADIOI_Build_client_req(ADIO_File fd, agg_blk_arr[agg_next_off_idx - 1] += agg_mem_act_reg_sz; } - agg_mem_next_off = + agg_mem_next_off = agg_mem_st_reg + agg_mem_act_reg_sz; break; default: @@ -1989,14 +1989,14 @@ int ADIOI_Build_client_req(ADIO_File fd, } } } - + /* On the first pass, allocate the memory structures for * creating the MPI_hindexed type. */ if (i == TEMP_OFF) - { + { /* Allocate offset-length pairs for creating hindexed * MPI_Datatypes for each aggregator */ - if ((agg_disp_arr = (MPI_Aint *) + if ((agg_disp_arr = (MPI_Aint *) ADIOI_Malloc(agg_ol_ct * sizeof(MPI_Aint))) == NULL) { fprintf(stderr, "ADIOI_Build_client_req: malloc " @@ -2004,7 +2004,7 @@ int ADIOI_Build_client_req(ADIO_File fd, (long int)agg_ol_ct * sizeof(MPI_Aint)); return -1; } - if ((agg_blk_arr = (int *) + if ((agg_blk_arr = (int *) ADIOI_Malloc(agg_ol_ct * sizeof(int))) == NULL) { ADIOI_Free(agg_disp_arr); @@ -2018,7 +2018,7 @@ int ADIOI_Build_client_req(ADIO_File fd, assert(agg_ol_ct == agg_ol_cur_ct); #ifdef DEBUG1 - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_req:(agg=%d,cur_ol_count=%d=ol_count=%d)\n", agg_rank, agg_ol_cur_ct, agg_ol_ct); #endif @@ -2029,7 +2029,7 @@ int ADIOI_Build_client_req(ADIO_File fd, fprintf(stderr, "ADIOI_Build_client_req: p %d (off,len) = ", agg_rank); for (i = 0; i < agg_ol_ct; i++) { - fprintf(stderr, "[%d](%d,%d) ", i, + fprintf(stderr, "[%d](%d,%d) ", i, agg_disp_arr[i], agg_blk_arr[i]); if (i % 5 == 0 && i != 0) fprintf(stderr, "\n"); @@ -2038,7 +2038,7 @@ int ADIOI_Build_client_req(ADIO_File fd, } #endif #ifdef DEBUG1 - fprintf(stderr, + fprintf(stderr, "ADIOI_Build_client_req:(agg=%d,pre_ol_count=%d)\n", agg_idx, my_mem_view_state_p->pre_ol_ct); #endif @@ -2046,12 +2046,12 @@ int ADIOI_Build_client_req(ADIO_File fd, #ifdef DEBUG2 if (my_mem_view_state_p->pre_sz > 0) { - fprintf(stderr, "ADIOI_Build_client_req: p %d pre(off,len) = ", + fprintf(stderr, "ADIOI_Build_client_req: p %d pre(off,len) = ", agg_idx); for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) { - fprintf(stderr, "[%d](%d,%d) ", i, - my_mem_view_state_p->pre_disp_arr[i], + fprintf(stderr, "[%d](%d,%d) ", i, + my_mem_view_state_p->pre_disp_arr[i], my_mem_view_state_p->pre_blk_arr[i]); if (i % 5 == 0 && i != 0) fprintf(stderr, "\n"); @@ -2064,7 +2064,7 @@ int ADIOI_Build_client_req(ADIO_File fd, if (agg_comm_sz > 0) { MPI_Type_create_hindexed(agg_ol_ct, agg_blk_arr, agg_disp_arr, MPI_BYTE, - agg_comm_dtype_p); + agg_comm_dtype_p); MPI_Type_commit(agg_comm_dtype_p); } else @@ -2077,7 +2077,7 @@ int ADIOI_Build_client_req(ADIO_File fd, #ifdef AGGREGATION_PROFILE MPE_Log_event (5019, 0, NULL); -#endif +#endif return 0; } diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c b/ompi/mca/io/romio321/romio/adio/common/ad_coll_exch_new.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c rename to ompi/mca/io/romio321/romio/adio/common/ad_coll_exch_new.c index 1815616675..7013a3a855 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_coll_exch_new.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_coll_exch_new.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -42,7 +42,7 @@ void ADIOI_Print_flatlist_node(ADIOI_Flatlist_node *flatlist_node_p) fprintf(stderr, "print flatlist node of NULL ptr\n"); return; } - fprintf(stderr, "print flatlist node count = %d (idx,blocklen)\n", + fprintf(stderr, "print flatlist node count = %d (idx,blocklen)\n", (int)flatlist_node_p->count); for (i = 0; i < flatlist_node_p->count; i++) { @@ -64,7 +64,7 @@ ADIOI_Flatlist_node * ADIOI_Add_contig_flattened(MPI_Datatype contig_type) { MPI_Count contig_type_sz = -1; ADIOI_Flatlist_node *flat_node_p = ADIOI_Flatlist; - + /* Add contig type to the end of the list if it doesn't already * exist. */ while (flat_node_p->next) @@ -88,7 +88,7 @@ ADIOI_Flatlist_node * ADIOI_Add_contig_flattened(MPI_Datatype contig_type) { fprintf(stderr, "ADIOI_Flatlist_node: malloc blocklens failed\n"); } - if ((flat_node_p->indices = (ADIO_Offset *) + if ((flat_node_p->indices = (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset))) == NULL) { fprintf(stderr, "ADIOI_Flatlist_node: malloc indices failed\n"); @@ -150,10 +150,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, flat_mem_p->blocklens[0] = memtype_sz*count; } else { - ADIOI_Flatten_datatype(datatype); - flat_mem_p = ADIOI_Flatlist; - while (flat_mem_p->type != datatype) - flat_mem_p = flat_mem_p->next; + flat_mem_p = ADIOI_Flatten_and_find(datatype); } MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); @@ -167,7 +164,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, else { flat_file_p = ADIOI_Flatlist; while (flat_file_p->type != fd->filetype) - flat_file_p = flat_file_p->next; + flat_file_p = flat_file_p->next; } disp_off_sz_ext_typesz[0] = fd->fp_ind; @@ -186,14 +183,14 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, /* only aggregators receive data */ if (fd->is_agg) { - recv_count_arr = ADIOI_Calloc(nprocs, + recv_count_arr = ADIOI_Calloc(nprocs, sizeof(amount_and_extra_data_t)); recv_req_arr = ADIOI_Malloc (nprocs * sizeof(MPI_Request)); for (i=0; i < nprocs; i++) MPI_Irecv (&recv_count_arr[i], sizeof(amount_and_extra_data_t), MPI_BYTE, i, COUNT_EXCH, fd->comm, &recv_req_arr[i]); } - + /* only send data to aggregators */ send_req_arr = ADIOI_Calloc (fd->hints->cb_nodes, sizeof(MPI_Request)); for (i=0; i < fd->hints->cb_nodes; i++) { @@ -210,7 +207,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, } } - + /* Every client has to build mem and file view_states for each aggregator. * We initialize their values here. and we also initialize * send_count_arr */ @@ -241,7 +238,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, 1, &(my_mem_view_state_arr[tmp_agg_idx]), REAL_OFF); - + memset(&(agg_file_view_state_arr[tmp_agg_idx]), 0, sizeof(view_state)); agg_file_view_state_arr[tmp_agg_idx].fp_ind = disp_off_sz_ext_typesz[0]; @@ -283,10 +280,10 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, fprintf(stderr, "my own flattened filetype: "); ADIOI_Print_flatlist_node(flat_file_p); #endif - + if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { ret = MPI_Alltoall(send_count_arr, sizeof(amount_and_extra_data_t), - MPI_BYTE, + MPI_BYTE, recv_count_arr, sizeof(amount_and_extra_data_t), MPI_BYTE, fd->comm); if (ret != MPI_SUCCESS) @@ -353,22 +350,22 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, if (fd->is_agg) { if (recv_count_arr[i].count > 0) { - if ((client_file_view_state_arr[i].flat_type_p = + if ((client_file_view_state_arr[i].flat_type_p = (ADIOI_Flatlist_node *) ADIOI_Malloc( sizeof(ADIOI_Flatlist_node))) == NULL) { fprintf(stderr, "ADIOI_Exchange_file_views: malloc " "flat_type_p failed\n"); } - client_file_view_state_arr[i].flat_type_p->count = + client_file_view_state_arr[i].flat_type_p->count = recv_count_arr[i].count; - client_file_view_state_arr[i].flat_type_p->indices = - (ADIO_Offset *) ADIOI_Calloc(recv_count_arr[i].count, + client_file_view_state_arr[i].flat_type_p->indices = + (ADIO_Offset *) ADIOI_Calloc(recv_count_arr[i].count, sizeof(ADIO_Offset)); client_file_view_state_arr[i].flat_type_p->blocklens = - (ADIO_Offset *) ADIOI_Calloc(recv_count_arr[i].count, + (ADIO_Offset *) ADIOI_Calloc(recv_count_arr[i].count, sizeof(ADIO_Offset)); - + /* Copy the extra data out of the stuff we Alltoall'd */ memcpy (&client_file_view_state_arr[i].fp_ind, &recv_count_arr[i].fp_ind, @@ -379,11 +376,11 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, } } - /* Since ADIOI_Calloc may do other things we add the +1 + /* Since ADIOI_Calloc may do other things we add the +1 * to avoid a 0-size malloc */ send_req_arr = (MPI_Request *) ADIOI_Calloc(2*(send_req_arr_sz)+1, sizeof(MPI_Request)); - + j = 0; if (recv_req_arr_sz > 0) { assert (fd->is_agg); @@ -392,7 +389,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, for (i = 0; i < nprocs; i++) { if (recv_count_arr[i].count > 0) { MPI_Irecv(client_file_view_state_arr[i].flat_type_p->indices, - recv_count_arr[i].count, ADIO_OFFSET, i, + recv_count_arr[i].count, ADIO_OFFSET, i, INDICES, fd->comm, &recv_req_arr[j]); j++; MPI_Irecv(client_file_view_state_arr[i].flat_type_p->blocklens, @@ -411,7 +408,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, send_count_arr[i].count, ADIO_OFFSET, i, INDICES, fd->comm, &send_req_arr[j]); j++; - MPI_Isend(flat_file_p->blocklens, + MPI_Isend(flat_file_p->blocklens, send_count_arr[i].count, ADIO_OFFSET, i, BLOCK_LENS, fd->comm, &send_req_arr[j]); j++; @@ -426,7 +423,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, fd->hints->ranklist[i], INDICES, fd->comm, &send_req_arr[j]); j++; - MPI_Isend(flat_file_p->blocklens, + MPI_Isend(flat_file_p->blocklens, send_count_arr[i].count, ADIO_OFFSET, fd->hints->ranklist[i], BLOCK_LENS, fd->comm, &send_req_arr[j]); @@ -435,9 +432,9 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, } } - /* Since ADIOI_Malloc may do other things we add the +1 - * to avoid a 0-size malloc */ - statuses = (MPI_Status *) + /* Since ADIOI_Malloc may do other things we add the +1 + * to avoid a 0-size malloc */ + statuses = (MPI_Status *) ADIOI_Malloc(1 + 2 * ADIOI_MAX(send_req_arr_sz,recv_req_arr_sz) * sizeof(MPI_Status)); @@ -479,19 +476,19 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, client_file_view_state_arr[i].sz, client_file_view_state_arr[i].ext); } - - while (fr_node_p->type != + + while (fr_node_p->type != fd->file_realm_types[fd->my_cb_nodes_index]) fr_node_p = fr_node_p->next; assert(fr_node_p != NULL); - - fprintf(stderr, "my file realm (idx=%d,st_off=%Ld) ", + + fprintf(stderr, "my file realm (idx=%d,st_off=%Ld) ", fd->my_cb_nodes_index, fd->file_realm_st_offs[fd->my_cb_nodes_index]); ADIOI_Print_flatlist_node(fr_node_p); } #endif - + #ifdef DEBUG2 if (fd->is_agg == 1) { diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_darray.c b/ompi/mca/io/romio321/romio/adio/common/ad_darray.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/common/ad_darray.c rename to ompi/mca/io/romio321/romio/adio/common/ad_darray.c index cb1407bda6..3c9ca36a8e 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_darray.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_darray.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -18,11 +18,11 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc MPI_Aint *st_offset); -int ADIO_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) +int ADIO_Type_create_darray(int size, int rank, int ndims, + int *array_of_gsizes, int *array_of_distribs, + int *array_of_dargs, int *array_of_psizes, + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype) { MPI_Datatype type_old, type_new=MPI_DATATYPE_NULL, inttype; int procs, tmp_rank, i, tmp_size, blklen, *coords; @@ -52,12 +52,12 @@ int ADIO_Type_create_darray(int size, int rank, int ndims, MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], coords[i], array_of_dargs[i], - order, orig_extent, + order, orig_extent, type_old, &type_new, - st_offsets+i); + st_offsets+i); break; case MPI_DISTRIBUTE_CYCLIC: - MPIOI_Type_cyclic(array_of_gsizes, i, ndims, + MPIOI_Type_cyclic(array_of_gsizes, i, ndims, array_of_psizes[i], coords[i], array_of_dargs[i], order, orig_extent, type_old, @@ -65,11 +65,11 @@ int ADIO_Type_create_darray(int size, int rank, int ndims, break; case MPI_DISTRIBUTE_NONE: /* treat it as a block distribution on 1 process */ - MPIOI_Type_block(array_of_gsizes, i, ndims, 1, 0, + MPIOI_Type_block(array_of_gsizes, i, ndims, 1, 0, MPI_DISTRIBUTE_DFLT_DARG, order, - orig_extent, + orig_extent, type_old, &type_new, - st_offsets+i); + st_offsets+i); break; } if (i) MPI_Type_free(&type_old); @@ -94,20 +94,20 @@ int ADIO_Type_create_darray(int size, int rank, int ndims, MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], coords[i], array_of_dargs[i], order, orig_extent, type_old, &type_new, - st_offsets+i); + st_offsets+i); break; case MPI_DISTRIBUTE_CYCLIC: - MPIOI_Type_cyclic(array_of_gsizes, i, ndims, + MPIOI_Type_cyclic(array_of_gsizes, i, ndims, array_of_psizes[i], coords[i], - array_of_dargs[i], order, + array_of_dargs[i], order, orig_extent, type_old, &type_new, st_offsets+i); break; case MPI_DISTRIBUTE_NONE: /* treat it as a block distribution on 1 process */ MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], - coords[i], MPI_DISTRIBUTE_DFLT_DARG, order, orig_extent, - type_old, &type_new, st_offsets+i); + coords[i], MPI_DISTRIBUTE_DFLT_DARG, order, orig_extent, + type_old, &type_new, st_offsets+i); break; } if (i != ndims-1) MPI_Type_free(&type_old); @@ -127,9 +127,9 @@ int ADIO_Type_create_darray(int size, int rank, int ndims, ub = orig_extent; for (i=0; idim; i--) stride *= (MPI_Aint)array_of_gsizes[i]; @@ -209,7 +209,7 @@ static int MPIOI_Type_block(int *array_of_gsizes, int dim, int ndims, int nprocs static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nprocs, int rank, int darg, int order, MPI_Aint orig_extent, MPI_Datatype type_old, MPI_Datatype *type_new, - MPI_Aint *st_offset) + MPI_Aint *st_offset) { /* nprocs = no. of processes in dimension dim of grid rank = coordinate of this process in dimension dim */ @@ -225,7 +225,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc return MPI_ERR_ARG; } /* --END ERROR HANDLING-- */ - + st_index = rank*blksize; end_index = array_of_gsizes[dim] - 1; @@ -238,7 +238,7 @@ static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nproc count = local_size/blksize; rem = local_size % blksize; - + stride = (MPI_Aint)nprocs*(MPI_Aint)blksize*orig_extent; if (order == MPI_ORDER_FORTRAN) for (i=0; i #endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include + +#ifdef HAVE_AIO_LITE_H +#include +#else + #ifdef HAVE_AIO_H + #include + #endif + #ifdef HAVE_SYS_AIO_H + #include + #endif #endif -/* Workaround for incomplete set of definitions if __REDIRECT is not +/* Workaround for incomplete set of definitions if __REDIRECT is not defined and large file support is used in aio.h */ #if !defined(__REDIRECT) && defined(__USE_FILE_OFFSET64) #define aiocb aiocb64 @@ -40,7 +45,7 @@ * to complete. */ int ADIOI_GEN_IODone(ADIO_Request *request, ADIO_Status *status, - int *error_code) + int *error_code) { return 0; diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_done_fake.c b/ompi/mca/io/romio321/romio/adio/common/ad_done_fake.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/common/ad_done_fake.c rename to ompi/mca/io/romio321/romio/adio/common/ad_done_fake.c index 3fffa4555b..59da5755e0 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_done_fake.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_done_fake.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_end.c b/ompi/mca/io/romio321/romio/adio/common/ad_end.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/common/ad_end.c rename to ompi/mca/io/romio321/romio/adio/common/ad_end.c index b534e0c25e..a4d186f927 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_end.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_end.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ void ADIO_End(int *error_code) { ADIOI_Flatlist_node *curr, *next; ADIOI_Datarep *datarep, *datarep_next; - + /* FPRINTF(stderr, "reached end\n"); */ /* if a default errhandler was set on MPI_FILE_NULL then we need to ensure diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_fcntl.c b/ompi/mca/io/romio321/romio/adio/common/ad_fcntl.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/common/ad_fcntl.c rename to ompi/mca/io/romio321/romio/adio/common/ad_fcntl.c index 8a4d07352c..62067573dd 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_fcntl.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_fcntl.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2005 University of Chicago. + * Copyright (C) 2005 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_features.c b/ompi/mca/io/romio321/romio/adio/common/ad_features.c similarity index 100% rename from ompi/mca/io/romio314/romio/adio/common/ad_features.c rename to ompi/mca/io/romio321/romio/adio/common/ad_features.c diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_flush.c b/ompi/mca/io/romio321/romio/adio/common/ad_flush.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/common/ad_flush.c rename to ompi/mca/io/romio321/romio/adio/common/ad_flush.c index 76f5da7abc..3ace6778bf 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_flush.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_flush.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_fstype.c b/ompi/mca/io/romio321/romio/adio/common/ad_fstype.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/common/ad_fstype.c rename to ompi/mca/io/romio321/romio/adio/common/ad_fstype.c index a78f77c952..75fb24fee6 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_fstype.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_fstype.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -111,12 +111,12 @@ from the compiler */ #if defined(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE) || \ defined(HAVE_STRUCT_STATFS) || \ - defined(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE) + defined(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE) #ifndef ROMIO_NTFS #define ROMIO_NEEDS_ADIOPARENTDIR static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep); #endif -#endif +#endif static void ADIO_FileSysType_prefix(const char *filename, int *fstype, int *error_code); static void ADIO_FileSysType_fncall(const char *filename, int *fstype, @@ -141,13 +141,13 @@ Output Parameters: here. We assume that S_ISLNK is *always* defined as a macro. If that is not universally true, then add a test to the romio configure that trys to link a program that references S_ISLNK */ -#if !defined(S_ISLNK) +#if !defined(S_ISLNK) # if defined(S_IFLNK) /* Check for the link bit */ # define S_ISLNK(mode) ((mode) & S_IFLNK) # else /* no way to check if it is a link, so say false */ -# define S_ISLNK(mode) 0 +# define S_ISLNK(mode) 0 # endif #endif /* !(S_ISLNK) */ @@ -161,7 +161,7 @@ static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep) int err; char *dir = NULL, *slash; struct stat statbuf; - + err = lstat(filename, &statbuf); if (err || (!S_ISLNK(statbuf.st_mode))) { @@ -192,8 +192,8 @@ static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep) /* successfully read the link */ linkbuf[namelen] = '\0'; /* readlink doesn't null terminate */ dir = ADIOI_Strdup(linkbuf); - ADIOI_Free(linkbuf); } + ADIOI_Free(linkbuf); } slash = strrchr(dir, '/'); @@ -221,8 +221,8 @@ Output Parameters: MPI_SUCCESS is stored in the location pointed to by error_code on success. - This function is used by MPI_File_open() and MPI_File_delete() to determine - file system type. Most other functions use the type which is stored when the + This function is used by MPI_File_open() and MPI_File_delete() to determine + file system type. Most other functions use the type which is stored when the file is opened. */ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *error_code) @@ -346,8 +346,6 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro # endif -# ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE - #ifdef ROMIO_GPFS if (fsbuf.f_type == GPFS_SUPER_MAGIC) { *fstype = ADIO_GPFS; @@ -415,8 +413,6 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro } # endif -# endif /*ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE */ - # ifdef ROMIO_UFS /* if UFS support is enabled, default to that */ *fstype = ADIO_UFS; @@ -448,7 +444,7 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro if(*error_code != MPI_SUCCESS) return; } } - + if (err) { /* --BEGIN ERROR HANDLING-- */ *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, @@ -503,7 +499,7 @@ static void ADIO_FileSysType_fncall_scalable(MPI_Comm comm, const char *filename /* - ADIO_FileSysType_prefix - determines file system type for a file using + ADIO_FileSysType_prefix - determines file system type for a file using a prefix on the file name. upper layer should have already determined that a prefix is present. @@ -556,18 +552,18 @@ static void ADIO_FileSysType_prefix(const char *filename, int *fstype, int *erro else if (!strncmp(filename, "zoidfs:", 7)|| !strncmp(filename, "ZOIDFS:", 7)) { *fstype = ADIO_ZOIDFS; - } - else if (!strncmp(filename, "testfs:", 7) + } + else if (!strncmp(filename, "testfs:", 7) || !strncmp(filename, "TESTFS:", 7)) { *fstype = ADIO_TESTFS; } - else if (!strncmp(filename, "ftp:", 4) + else if (!strncmp(filename, "ftp:", 4) || !strncmp(filename, "gsiftp:", 7)) { *fstype = ADIO_GRIDFTP; } - else if (!strncmp(filename, "lustre:", 7) + else if (!strncmp(filename, "lustre:", 7) || !strncmp(filename, "LUSTRE:", 7)) { *fstype = ADIO_LUSTRE; @@ -603,7 +599,7 @@ Output Parameters: . error_code - (pointer to) int holding error code Notes: -This code used to be in MPI_File_open(), but it has been moved into here in +This code used to be in MPI_File_open(), but it has been moved into here in order to clean things up. The goal is to separate all this "did we compile for this fs type" code from the MPI layer and also to introduce the ADIOI_Fns tables in a reasonable way. -- Rob, 06/06/2001 @@ -629,13 +625,13 @@ void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, /* Optimization: we can reduce the 'storm of stats' that result from * thousands of mpi processes determinig file type this way. Let us * have just one process stat the file and broadcast the result to - * everyone else. + * everyone else. * - Note that we will not catch cases like * http://www.mcs.anl.gov/web-mail-archive/lists/mpich-discuss/2007/08/msg00042.html * (edit: now http://lists.mcs.anl.gov/pipermail/mpich-discuss/2007-August/002648.html) * * where file systems are not mounted or available on other processes, - * but we'll catch those a few functions later in ADIO_Open + * but we'll catch those a few functions later in ADIO_Open * - Note that if we have NFS enabled, we might have a situation where, * for example, /home/user/data.out is UFS on one process but NFS on * others, so we won't perform this optimization if NFS is enabled. @@ -678,7 +674,7 @@ void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, } } else { - /* prefix specified; just match via prefix and assume everyone got + /* prefix specified; just match via prefix and assume everyone got * the same thing. * * perhaps we should have this code go through the allreduce as well? @@ -850,7 +846,7 @@ void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, #endif } if (file_system == ADIO_LUSTRE) { -#ifndef ROMIO_LUSTRE +#ifndef ROMIO_LUSTRE *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**iofstypeunsupported", 0); return; #else @@ -871,6 +867,6 @@ void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, *fstype = file_system; return; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_get_sh_fp.c b/ompi/mca/io/romio321/romio/adio/common/ad_get_sh_fp.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/common/ad_get_sh_fp.c rename to ompi/mca/io/romio321/romio/adio/common/ad_get_sh_fp.c index 3c933f9e87..1213327790 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_get_sh_fp.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_get_sh_fp.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -37,25 +37,25 @@ void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp, if (fd->shared_fp_fd == ADIO_FILE_NULL) { MPI_Comm_dup(MPI_COMM_SELF, &dupcommself); - fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself, - fd->shared_fp_fname, + fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself, + fd->shared_fp_fname, fd->file_system, fd->fns, - ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, + ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, 0, MPI_BYTE, MPI_BYTE, - MPI_INFO_NULL, + MPI_INFO_NULL, ADIO_PERM_NULL, error_code); if (*error_code != MPI_SUCCESS) return; ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); - ADIO_ReadContig(fd->shared_fp_fd, shared_fp, sizeof(ADIO_Offset), + ADIO_ReadContig(fd->shared_fp_fd, shared_fp, sizeof(ADIO_Offset), MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); /* if the file is empty, the above function may return error - (reading beyond end of file). In that case, shared_fp = 0, + (reading beyond end of file). In that case, shared_fp = 0, set above, is the correct value. */ } else { ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); - ADIO_ReadContig(fd->shared_fp_fd, shared_fp, sizeof(ADIO_Offset), + ADIO_ReadContig(fd->shared_fp_fd, shared_fp, sizeof(ADIO_Offset), MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); if (*error_code != MPI_SUCCESS) { ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); @@ -67,7 +67,7 @@ void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp, new_fp = *shared_fp + incr; - ADIO_WriteContig(fd->shared_fp_fd, &new_fp, sizeof(ADIO_Offset), + ADIO_WriteContig(fd->shared_fp_fd, &new_fp, sizeof(ADIO_Offset), MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); done: ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_hints.c b/ompi/mca/io/romio321/romio/adio/common/ad_hints.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/common/ad_hints.c rename to ompi/mca/io/romio321/romio/adio/common/ad_hints.c index 1d226e6c7d..6e89e76a3f 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_hints.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_hints.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,7 +11,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) { -/* if fd->info is null, create a new info object. +/* if fd->info is null, create a new info object. Initialize fd->info to default values. Initialize fd->hints to default values. Examine the info object passed by the user. If it contains values that @@ -58,15 +58,15 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) if (!fd->hints->initialized) { /* buffer size for collective I/O */ - ADIOI_Info_set(info, "cb_buffer_size", ADIOI_CB_BUFFER_SIZE_DFLT); + ADIOI_Info_set(info, "cb_buffer_size", ADIOI_CB_BUFFER_SIZE_DFLT); fd->hints->cb_buffer_size = atoi(ADIOI_CB_BUFFER_SIZE_DFLT); /* default is to let romio automatically decide when to use * collective buffering */ - ADIOI_Info_set(info, "romio_cb_read", "automatic"); + ADIOI_Info_set(info, "romio_cb_read", "automatic"); fd->hints->cb_read = ADIOI_HINT_AUTO; - ADIOI_Info_set(info, "romio_cb_write", "automatic"); + ADIOI_Info_set(info, "romio_cb_write", "automatic"); fd->hints->cb_write = ADIOI_HINT_AUTO; fd->hints->cb_config_list = NULL; @@ -83,7 +83,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* hint instructing the use of persistent file realms */ ADIOI_Info_set(info, "romio_cb_pfr", "disable"); fd->hints->cb_pfr = ADIOI_HINT_DISABLE; - + /* hint guiding the assignment of persistent file realms */ ADIOI_Info_set(info, "romio_cb_fr_types", "aar"); fd->hints->cb_fr_type = ADIOI_FR_AAR; @@ -115,9 +115,9 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* default is to let romio automatically decide when to use data * sieving */ - ADIOI_Info_set(info, "romio_ds_read", "automatic"); + ADIOI_Info_set(info, "romio_ds_read", "automatic"); fd->hints->ds_read = ADIOI_HINT_AUTO; - ADIOI_Info_set(info, "romio_ds_write", "automatic"); + ADIOI_Info_set(info, "romio_ds_write", "automatic"); fd->hints->ds_write = ADIOI_HINT_AUTO; /* still to do: tune this a bit for a variety of file systems. there's @@ -137,18 +137,18 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* add in user's info if supplied */ if (users_info != MPI_INFO_NULL) { - ADIOI_Info_check_and_install_int(fd, users_info, "cb_buffer_size", + ADIOI_Info_check_and_install_int(fd, users_info, "cb_buffer_size", &(fd->hints->cb_buffer_size), myname, error_code); /* aligning file realms to certain sizes (e.g. stripe sizes) * may benefit I/O performance */ - ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_fr_alignment", + ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_fr_alignment", &(fd->hints->cb_fr_alignment), myname, error_code); /* for collective I/O, try to be smarter about when to do data sieving * using a specific threshold for the datatype size/extent * (percentage 0-100%) */ - ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_ds_threshold", + ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_ds_threshold", &(fd->hints->cb_ds_threshold), myname, error_code); ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_cb_alltoall", @@ -178,7 +178,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_cb_pfr", &(fd->hints->cb_pfr), myname, error_code); - + /* file realm assignment types ADIOI_FR_AAR(0), ADIOI_FR_FSZ(-1), ADIOI_FR_USR_REALMS(-2), all others specify a regular fr size in bytes. probably not the best way... */ @@ -196,7 +196,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) ADIOI_Info_set(info, "romio_cb_read", "enable"); fd->hints->cb_read = 1; fd->hints->cb_write = 1; - } + } /* new hints for enabling/disabling data sieving on * reads/writes */ @@ -244,7 +244,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) /* Now we use striping unit in common code so we should process hints for it. */ - ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit", + ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit", &(fd->hints->striping_unit), myname, error_code); } @@ -259,6 +259,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) len = (strlen(ADIOI_CB_CONFIG_LIST_DFLT)+1) * sizeof(char); fd->hints->cb_config_list = ADIOI_Malloc(len); if (fd->hints->cb_config_list == NULL) { + ADIOI_Free(value); *error_code = MPIO_Err_create_code(*error_code, MPIR_ERR_RECOVERABLE, myname, diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_init.c b/ompi/mca/io/romio321/romio/adio/common/ad_init.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/common/ad_init.c rename to ompi/mca/io/romio321/romio/adio/common/ad_init.c index b650ad7875..88e75a5251 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_init.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_init.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -55,7 +55,7 @@ void ADIO_Init(int *argc, char ***argv, int *error_code) ADIOI_UNREFERENCED_ARG(argc); ADIOI_UNREFERENCED_ARG(argv); - + #ifdef ROMIO_INSIDE_MPICH MPIR_Ext_init(); #endif @@ -69,11 +69,11 @@ void ADIO_Init(int *argc, char ***argv, int *error_code) #if defined(ROMIO_XFS) || defined(ROMIO_LUSTRE) c = getenv("MPIO_DIRECT_READ"); - if (c && (!strcmp(c, "true") || !strcmp(c, "TRUE"))) + if (c && (!strcmp(c, "true") || !strcmp(c, "TRUE"))) ADIOI_Direct_read = 1; else ADIOI_Direct_read = 0; c = getenv("MPIO_DIRECT_WRITE"); - if (c && (!strcmp(c, "true") || !strcmp(c, "TRUE"))) + if (c && (!strcmp(c, "true") || !strcmp(c, "TRUE"))) ADIOI_Direct_write = 1; else ADIOI_Direct_write = 0; #endif @@ -93,7 +93,7 @@ void ADIO_Init(int *argc, char ***argv, int *error_code) MPE_Log_get_state_eventIDs( &ADIOI_MPE_unlock_a, &ADIOI_MPE_unlock_b ); MPE_Log_get_state_eventIDs( &ADIOI_MPE_postwrite_a, &ADIOI_MPE_postwrite_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_openinternal_a, + MPE_Log_get_state_eventIDs( &ADIOI_MPE_openinternal_a, &ADIOI_MPE_openinternal_b); MPE_Log_get_state_eventIDs( &ADIOI_MPE_stat_a, &ADIOI_MPE_stat_b); MPE_Log_get_state_eventIDs( &ADIOI_MPE_iread_a, &ADIOI_MPE_iread_b); diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_io_coll.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c rename to ompi/mca/io/romio321/romio/adio/common/ad_io_coll.c index 1f2573eef5..273c8a551b 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_io_coll.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_io_coll.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. +/* + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -31,7 +31,7 @@ static void post_aggregator_comm (MPI_Comm comm, int rw_type, int nproc, MPI_Request **requests, int *aggregators_client_count_p); -static void post_client_comm (ADIO_File fd, int rw_type, +static void post_client_comm (ADIO_File fd, int rw_type, int agg_rank, void *buf, MPI_Datatype agg_comm_dtype, int agg_alltoallw_count, @@ -141,7 +141,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, interleave_count++; /* This is a rudimentary check for interleaving, but should * suffice for the moment. */ - + min_st_offset = ADIOI_MIN(all_st_end_offsets[i*2], min_st_offset); max_end_offset = ADIOI_MAX(all_st_end_offsets[i*2+1], @@ -249,11 +249,11 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, } } #ifdef USE_PRE_REQ - else + else { /* Example use of ADIOI_Build_client_pre_req. to an * appropriate section */ - + for (i = 0; i < fd->hints->cb_nodes; i++) { agg_rank = fd->hints->ranklist[(i+myrank)%fd->hints->cb_nodes]; @@ -264,7 +264,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, fd, agg_rank, (i+myrank)%fd->hints->cb_nodes, &(my_mem_view_state_arr[agg_rank]), &(agg_file_view_state_arr[agg_rank]), - 2*1024*1024, + 2*1024*1024, 64*1024); #ifdef AGGREGATION_PROFILE MPE_Log_event (5041, 0, NULL); @@ -327,7 +327,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, (i+myrank)%fd->hints->cb_nodes, &(my_mem_view_state_arr[agg_rank]), &(agg_file_view_state_arr[agg_rank]), - agg_comm_sz_arr[agg_rank], + agg_comm_sz_arr[agg_rank], &(agg_comm_dtype_arr[agg_rank])); #ifdef AGGREGATION_PROFILE @@ -359,7 +359,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, fprintf (stderr, "expecting from [agg](disp,size,cnt)="); for (i=0; i < nprocs; i++) { MPI_Type_size_x (agg_comm_dtype_arr[i], &size); - fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], + fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], size, agg_alltoallw_counts[i]); if (i != nprocs - 1) fprintf(stderr, ","); @@ -372,8 +372,8 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, MPI_Type_size_x (client_comm_dtype_arr[i], &size); else size = -1; - - fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], + + fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], size, client_alltoallw_counts[i]); if (i != nprocs - 1) fprintf(stderr, ","); @@ -434,7 +434,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, fprintf (stderr, "sending to [agg](disp,size,cnt)="); for (i=0; i < nprocs; i++) { MPI_Type_size_x (agg_comm_dtype_arr[i], &size); - fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], + fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], size, agg_alltoallw_counts[i]); if (i != nprocs - 1) fprintf(stderr, ","); @@ -446,8 +446,8 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, MPI_Type_size_x (client_comm_dtype_arr[i], &size); else size = -1; - - fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], + + fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], size, client_alltoallw_counts[i]); if (i != nprocs - 1) fprintf(stderr, ","); @@ -458,7 +458,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, #ifdef DEBUG fprintf (stderr, "buffered_io_size = %lld\n", buffered_io_size); #endif - + if (clients_agg_count) { client_comm_statuses = ADIOI_Malloc(clients_agg_count * sizeof(MPI_Status)); @@ -484,7 +484,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, /* make sure we actually have the data to write out */ agg_comm_statuses = (MPI_Status *) ADIOI_Malloc (aggs_client_count*sizeof(MPI_Status)); - + MPI_Waitall (aggs_client_count, agg_comm_requests, agg_comm_statuses); #ifdef AGGREGATION_PROFILE @@ -598,7 +598,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, fd, agg_rank, (i+myrank)%fd->hints->cb_nodes, &(my_mem_view_state_arr[agg_rank]), &(agg_file_view_state_arr[agg_rank]), - 2*1024*1024, + 2*1024*1024, 64*1024); #ifdef AGGREGATION_PROFILE MPE_Log_event (5041, 0, NULL); @@ -606,7 +606,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, } } #endif - + /* aggregators pre-post all Irecv's for incoming data from * clients. if nothing is needed, agg_comm_requests is not * allocated */ @@ -627,7 +627,7 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, } /* Clean up */ - + if (fd->hints->cb_pfr != ADIOI_HINT_ENABLE) { /* AAR, FSIZE, and User provided uniform File realms */ if (1) { @@ -663,11 +663,11 @@ void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, } ADIOI_Free (client_file_view_state_arr); ADIOI_Free (cb_buf); - } + } for (i = 0; i 0) MPI_Type_free (&agg_comm_dtype_arr[i]); - + ADIOI_Free (client_comm_sz_arr); ADIOI_Free (client_comm_dtype_arr); ADIOI_Free (my_mem_view_state_arr); @@ -707,9 +707,9 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, int filetype_is_contig; ADIO_Offset i, remainder; ADIOI_Flatlist_node *flat_file; - + ADIO_Offset st_byte_off, end_byte_off; - + #ifdef AGGREGATION_PROFILE MPE_Log_event (5000, 0, NULL); #endif @@ -724,12 +724,12 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, } ADIOI_Datatype_iscontig (fd->filetype, &filetype_is_contig); - + MPI_Type_size_x (fd->filetype, &filetype_size); MPI_Type_get_extent (fd->filetype, &lb, &filetype_extent); MPI_Type_size_x (fd->etype, &etype_size); MPI_Type_size_x (buftype, &buftype_size); - + total_io = buftype_size * count; if (filetype_is_contig) { @@ -748,7 +748,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, points at an accessible byte in file. the first accessible byte in the file is not necessarily the first byte, nor is it necessarily the first off/len pair in the filetype. */ - if (file_ptr_type == ADIO_INDIVIDUAL) { + if (file_ptr_type == ADIO_INDIVIDUAL) { st_byte_off = fd->fp_ind; /* find end byte of I/O (may be in middle of an etype) */ @@ -791,7 +791,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, for (i=0; icount; i++) { sum += flat_file->blocklens[i]; if (sum >= remainder) { - end_byte_off += flat_file->indices[i] + + end_byte_off += flat_file->indices[i] + flat_file->blocklens[i] - sum + remainder - 1; break; } @@ -801,12 +801,12 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, } else { /* find starting byte of I/O (must be aligned with an etype) */ - /* byte starting point of starting filetype */ + /* byte starting point of starting filetype */ st_byte_off = fd->disp + ((offset * etype_size) / filetype_size) * filetype_extent; /* number of file viewable bytes into starting filetype */ remainder = (etype_size * offset) % filetype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -819,14 +819,14 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, break; } } - + /* find end byte of I/O (may be in middle of an etype) */ /* byte starting point of last filetype */ end_byte_off = fd->disp + (offset * etype_size + total_io) / filetype_size * filetype_extent; /* number of bytes into last filetype */ remainder = (offset * etype_size + total_io) % filetype_size; - + if (!remainder) { /* the last non-zero off/len pair */ for (i=flat_file->count-1; i>=0; i--) { @@ -847,7 +847,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, for (i=0; icount; i++) { sum += flat_file->blocklens[i]; if (sum >= remainder) { - end_byte_off += flat_file->indices[i] + + end_byte_off += flat_file->indices[i] + flat_file->blocklens[i] - sum + remainder - 1; break; } @@ -855,7 +855,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, } } } - + *st_offset = st_byte_off; *end_offset = end_byte_off; #ifdef DEBUG @@ -874,7 +874,7 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, * assume that this uses MPI_BYTE for the etype, and disp is 0 */ void ADIOI_IOFiletype(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Datatype custom_ftype, + ADIO_Offset offset, MPI_Datatype custom_ftype, int rdwr, ADIO_Status *status, int *error_code) { MPI_Datatype user_filetype; @@ -1031,7 +1031,7 @@ static void Exch_data_amounts (ADIO_File fd, int nprocs, send_requests = NULL; if (fd->is_agg) { /* only aggregators send data */ - send_requests = ADIOI_Malloc (nprocs * sizeof(MPI_Request)); + send_requests = ADIOI_Malloc (nprocs * sizeof(MPI_Request)); /* post all sends */ for (i = 0; i < nprocs; i++) { @@ -1067,7 +1067,7 @@ static void Exch_data_amounts (ADIO_File fd, int nprocs, } } -static void post_aggregator_comm (MPI_Comm comm, int rw_type, +static void post_aggregator_comm (MPI_Comm comm, int rw_type, int nproc, void *cb_buf, MPI_Datatype *client_comm_dtype_arr, ADIO_Offset *client_comm_sz_arr, @@ -1115,7 +1115,7 @@ static void post_aggregator_comm (MPI_Comm comm, int rw_type, } } -static void post_client_comm (ADIO_File fd, int rw_type, +static void post_client_comm (ADIO_File fd, int rw_type, int agg_rank, void *buf, MPI_Datatype agg_comm_dtype, int agg_alltoallw_count, diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_iopen.c b/ompi/mca/io/romio321/romio/adio/common/ad_iopen.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/common/ad_iopen.c rename to ompi/mca/io/romio321/romio/adio/common/ad_iopen.c index 37e98e3f92..5deeaa2cde 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_iopen.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iopen.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2002 University of Chicago. + * Copyright (C) 2002 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" void ADIO_ImmediateOpen(ADIO_File fd, int *error_code) -{ +{ MPI_Comm tmp_comm; tmp_comm = fd->comm; /* some file systems might try to be clever inside their open routine. @@ -18,4 +18,4 @@ void ADIO_ImmediateOpen(ADIO_File fd, int *error_code) fd->is_open = 1; fd->comm = tmp_comm; -} +} diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_iread.c b/ompi/mca/io/romio321/romio/adio/common/ad_iread.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/common/ad_iread.c rename to ompi/mca/io/romio321/romio/adio/common/ad_iread.c index 2bc3ad6f16..74c342ab93 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_iread.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iread.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -30,15 +30,15 @@ * * This code handles two distinct cases. If ROMIO_HAVE_WORKING_AIO is not * defined, then I/O is performed in a blocking manner. Otherwise we post - * an asynchronous I/O operation using the appropriate aio routines. + * an asynchronous I/O operation using the appropriate aio routines. * * In the aio case we rely on ADIOI_GEN_aio(), which is implemented in * common/ad_iwrite.c. */ -void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, MPI_Request *request, - int *error_code) + int *error_code) { MPI_Count len, typesize; int aio_errno = 0; @@ -60,7 +60,7 @@ void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, return; } /* --END ERROR HANDLING-- */ - + *error_code = MPI_SUCCESS; } #endif @@ -68,7 +68,7 @@ void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, /* Generic implementation of IreadStrided calls the blocking ReadStrided * immediately. */ -void ADIOI_GEN_IreadStrided(ADIO_File fd, void *buf, int count, +void ADIOI_GEN_IreadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code) @@ -80,8 +80,8 @@ void ADIOI_GEN_IreadStrided(ADIO_File fd, void *buf, int count, /* Call the blocking function. It will create an error code * if necessary. */ - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); + ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); if (*error_code == MPI_SUCCESS) { MPI_Type_size_x(datatype, &typesize); diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c new file mode 100644 index 0000000000..8487c25e09 --- /dev/null +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.c @@ -0,0 +1,1345 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "adio.h" +#include "adio_extern.h" +#include "mpiu_greq.h" +#include "mpioimpl.h" + +#ifdef USE_DBG_LOGGING + #define RDCOLL_DEBUG 1 +#endif +#ifdef AGGREGATION_PROFILE +#include "mpe.h" +#endif + +#ifdef HAVE_MPI_GREQUEST_EXTENSIONS + +/* ADIOI_GEN_IreadStridedColl */ +struct ADIOI_GEN_IreadStridedColl_vars { + /* requests */ + MPI_Request req_offset[2]; /* ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL */ + MPI_Request req_ind_io; /* ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO */ + + /* parameters */ + ADIO_File fd; + void *buf; + int count; + MPI_Datatype datatype; + int file_ptr_type; + ADIO_Offset offset; + + /* stack variables */ + ADIOI_Access *my_req; + /* array of nprocs structures, one for each other process in + whose file domain this process's request lies */ + + ADIOI_Access *others_req; + /* array of nprocs structures, one for each other process + whose request lies in this process's file domain. */ + + int nprocs; + int nprocs_for_coll; + int myrank; + int contig_access_count; + int interleave_count; + int buftype_is_contig; + int *count_my_req_per_proc; + int count_my_req_procs; + int count_others_req_procs; + ADIO_Offset start_offset; + ADIO_Offset end_offset; + ADIO_Offset orig_fp; + ADIO_Offset fd_size; + ADIO_Offset min_st_offset; + ADIO_Offset *offset_list; + ADIO_Offset *st_offsets; + ADIO_Offset *fd_start; + ADIO_Offset *fd_end; + ADIO_Offset *end_offsets; + ADIO_Offset *len_list; + int *buf_idx; +}; + +/* ADIOI_Iread_and_exch */ +struct ADIOI_Iread_and_exch_vars { + /* requests */ + MPI_Request req1; /* ADIOI_IRC_STATE_IREAD_AND_EXCH */ + MPI_Request req2; /* ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN */ + + /* parameters */ + ADIO_File fd; + void *buf; + MPI_Datatype datatype; + int nprocs; + int myrank; + ADIOI_Access *others_req; + ADIO_Offset *offset_list; + ADIO_Offset *len_list; + int contig_access_count; + ADIO_Offset min_st_offset; + ADIO_Offset fd_size; + ADIO_Offset *fd_start; + ADIO_Offset *fd_end; + int *buf_idx; + + /* stack variables */ + int m; + int ntimes; + int max_ntimes; + int buftype_is_contig; + ADIO_Offset st_loc; + ADIO_Offset end_loc; + ADIO_Offset off; + ADIO_Offset done; + char *read_buf; + int *curr_offlen_ptr; + int *count; + int *send_size; + int *recv_size; + int *partial_send; + int *recd_from_proc; + int *start_pos; + /* Not convinced end_loc-st_loc couldn't be > int, so make these offsets*/ + ADIO_Offset size; + ADIO_Offset real_size; + ADIO_Offset for_curr_iter; + ADIO_Offset for_next_iter; + ADIOI_Flatlist_node *flat_buf; + MPI_Aint buftype_extent; + int coll_bufsize; + + /* next function to be called */ + void (*next_fn)(ADIOI_NBC_Request *, int *); +}; + +/* ADIOI_R_Iexchange_data */ +struct ADIOI_R_Iexchange_data_vars { + /* requests */ + MPI_Request req1; /* ADIOI_IRC_STATE_R_IEXCHANGE_DATA */ + MPI_Request *req2; /* ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV & FILL */ + + /* parameters */ + ADIO_File fd; + void *buf; + ADIOI_Flatlist_node *flat_buf; + ADIO_Offset *offset_list; + ADIO_Offset *len_list; + int *send_size; + int *recv_size; + int *count; + int *start_pos; + int *partial_send; + int *recd_from_proc; + int nprocs; + int myrank; + int buftype_is_contig; + int contig_access_count; + ADIO_Offset min_st_offset; + ADIO_Offset fd_size; + ADIO_Offset *fd_start; + ADIO_Offset *fd_end; + ADIOI_Access *others_req; + int iter; + MPI_Aint buftype_extent; + int *buf_idx; + + /* stack variables */ + int nprocs_recv; + int nprocs_send; + char **recv_buf; + + /* next function to be called */ + void (*next_fn)(ADIOI_NBC_Request *, int *); +}; + + +void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node + *flat_buf, char **recv_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, + unsigned *recv_size, + MPI_Request *requests, MPI_Status *statuses, + int *recd_from_proc, int nprocs, + int contig_access_count, + ADIO_Offset min_st_offset, + ADIO_Offset fd_size, ADIO_Offset *fd_start, + ADIO_Offset *fd_end, + MPI_Aint buftype_extent); + +/* prototypes of functions used for nonblocking collective reads only. */ +static void ADIOI_GEN_IreadStridedColl_inter(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IreadStridedColl_indio(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IreadStridedColl_read(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IreadStridedColl_free(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IreadStridedColl_fini(ADIOI_NBC_Request *, int *); + +static void ADIOI_Iread_and_exch(ADIOI_NBC_Request *, int *); +static void ADIOI_Iread_and_exch_l1_begin(ADIOI_NBC_Request *, int *); +static void ADIOI_Iread_and_exch_l1_end(ADIOI_NBC_Request *, int *); +static void ADIOI_Iread_and_exch_reset(ADIOI_NBC_Request *, int *); +static void ADIOI_Iread_and_exch_l2_begin(ADIOI_NBC_Request *, int *); +static void ADIOI_Iread_and_exch_l2_end(ADIOI_NBC_Request *, int *); +static void ADIOI_Iread_and_exch_fini(ADIOI_NBC_Request *, int *); + +static void ADIOI_R_Iexchange_data(ADIOI_NBC_Request *, int *); +static void ADIOI_R_Iexchange_data_recv(ADIOI_NBC_Request *, int *); +static void ADIOI_R_Iexchange_data_fill(ADIOI_NBC_Request *, int *); +static void ADIOI_R_Iexchange_data_fini(ADIOI_NBC_Request *, int *); + +static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; +static int ADIOI_GEN_irc_query_fn(void *extra_state, MPI_Status *status); +static int ADIOI_GEN_irc_free_fn(void *extra_state); +static int ADIOI_GEN_irc_poll_fn(void *extra_state, MPI_Status *status); +static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states, + double timeout, MPI_Status *status); + + +/* Nonblocking version of ADIOI_GEN_ReadStridedColl() */ +void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, MPI_Request *request, + int *error_code) +{ + /* Uses a generalized version of the extended two-phase method described + in "An Extended Two-Phase Method for Accessing Sections of + Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, + Scientific Programming, (5)4:301--317, Winter 1996. + http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ + + ADIOI_NBC_Request *nbc_req = NULL; + ADIOI_GEN_IreadStridedColl_vars *vars = NULL; + int nprocs, myrank; +#ifdef RDCOLL_DEBUG + int i; +#endif + + /* FIXME: need an implementation of ADIOI_IOIstridedColl + if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { + ADIOI_IOIstridedColl(fd, buf, count, ADIOI_READ, datatype, + file_ptr_type, offset, request, error_code); + return; + } + */ + + /* top-level struct keeping the status of function progress */ + nbc_req = (ADIOI_NBC_Request *)ADIOI_Calloc(1, sizeof(ADIOI_NBC_Request)); + nbc_req->rdwr = ADIOI_READ; + + /* create a generalized request */ + if (ADIOI_GEN_greq_class == 0) { + MPIX_Grequest_class_create(ADIOI_GEN_irc_query_fn, + ADIOI_GEN_irc_free_fn, MPIU_Greq_cancel_fn, + ADIOI_GEN_irc_poll_fn, ADIOI_GEN_irc_wait_fn, + &ADIOI_GEN_greq_class); + } + MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, nbc_req, request); + memcpy(&nbc_req->req, request, sizeof(MPI_Request)); + + /* create a struct for parameters and variables */ + vars = (ADIOI_GEN_IreadStridedColl_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_GEN_IreadStridedColl_vars)); + nbc_req->data.rd.rsc_vars = vars; + + /* save the parameters */ + vars->fd = fd; + vars->buf = buf; + vars->count = count; + vars->datatype = datatype; + vars->file_ptr_type = file_ptr_type; + vars->offset = offset; + + MPI_Comm_size(fd->comm, &nprocs); + MPI_Comm_rank(fd->comm, &myrank); + vars->nprocs = nprocs; + vars->myrank = myrank; + + /* number of aggregators, cb_nodes, is stored in the hints */ + vars->nprocs_for_coll = fd->hints->cb_nodes; + vars->orig_fp = fd->fp_ind; + + /* only check for interleaving if cb_read isn't disabled */ + if (fd->hints->cb_read != ADIOI_HINT_DISABLE) { + /* For this process's request, calculate the list of offsets and + lengths in the file and determine the start and end offsets. */ + + /* Note: end_offset points to the last byte-offset that will be accessed. + e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/ + + ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, + &vars->offset_list, &vars->len_list, + &vars->start_offset, &vars->end_offset, + &vars->contig_access_count); + +#ifdef RDCOLL_DEBUG + for (i = 0; i < vars->contig_access_count; i++) { + DBG_FPRINTF(stderr, "rank %d off %lld len %lld\n", + myrank, vars->offset_list[i], vars->len_list[i]); + } +#endif + + /* each process communicates its start and end offsets to other + processes. The result is an array each of start and end offsets + stored in order of process rank. */ + + vars->st_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); + vars->end_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); + + *error_code = MPI_Iallgather(&vars->start_offset, 1, ADIO_OFFSET, + vars->st_offsets, 1, ADIO_OFFSET, + fd->comm, &vars->req_offset[0]); + if (*error_code != MPI_SUCCESS) return; + *error_code = MPI_Iallgather(&vars->end_offset, 1, ADIO_OFFSET, + vars->end_offsets, 1, ADIO_OFFSET, + fd->comm, &vars->req_offset[1]); + + nbc_req->data.rd.state = ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL; + return; + } + + ADIOI_GEN_IreadStridedColl_indio(nbc_req, error_code); +} + +static void ADIOI_GEN_IreadStridedColl_inter(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; + int nprocs = vars->nprocs; + ADIO_Offset *st_offsets = vars->st_offsets; + ADIO_Offset *end_offsets = vars->end_offsets; + int i, interleave_count = 0; + + /* are the accesses of different processes interleaved? */ + for (i = 1; i < nprocs; i++) + if ((st_offsets[i] < end_offsets[i-1]) && + (st_offsets[i] <= end_offsets[i])) + interleave_count++; + /* This is a rudimentary check for interleaving, but should suffice + for the moment. */ + + vars->interleave_count = interleave_count; + + ADIOI_GEN_IreadStridedColl_indio(nbc_req, error_code); +} + +static void ADIOI_GEN_IreadStridedColl_indio(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; + ADIOI_Icalc_others_req_vars *cor_vars = NULL; + ADIO_File fd = vars->fd; + void *buf; + int count, file_ptr_type; + MPI_Datatype datatype = vars->datatype; + ADIO_Offset offset; + int filetype_is_contig; + ADIO_Offset off; + int nprocs; + + ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); + + if (fd->hints->cb_read == ADIOI_HINT_DISABLE + || (!vars->interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO))) + { + buf = vars->buf; + count = vars->count; + file_ptr_type = vars->file_ptr_type; + offset = vars->offset; + + /* don't do aggregation */ + if (fd->hints->cb_read != ADIOI_HINT_DISABLE) { + ADIOI_Free(vars->offset_list); + ADIOI_Free(vars->len_list); + ADIOI_Free(vars->st_offsets); + ADIOI_Free(vars->end_offsets); + } + + fd->fp_ind = vars->orig_fp; + ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); + +#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) + /* NOTE: This is currently a workaround to avoid weird errors, e.g., + * stack fault, occurred on Linux. When the host OS is Linux and + * aio-lite is not used, a blocking ADIO function is used here. + * See https://trac.mpich.org/projects/mpich/ticket/2201. */ + MPI_Status status; + if (vars->buftype_is_contig && filetype_is_contig) { + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { + off = fd->disp + (fd->etype_size) * offset; + ADIO_ReadContig(fd, buf, count, datatype, ADIO_EXPLICIT_OFFSET, + off, &status, error_code); + } + else ADIO_ReadContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, + 0, &status, error_code); + } + else { + ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); + } + ADIOI_GEN_IreadStridedColl_fini(nbc_req, error_code); +#else + if (vars->buftype_is_contig && filetype_is_contig) { + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { + off = fd->disp + (fd->etype_size) * offset; + ADIO_IreadContig(fd, buf, count, datatype, ADIO_EXPLICIT_OFFSET, + off, &vars->req_ind_io, error_code); + } + else ADIO_IreadContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, + 0, &vars->req_ind_io, error_code); + } + else { + ADIO_IreadStrided(fd, buf, count, datatype, file_ptr_type, + offset, &vars->req_ind_io, error_code); + } + + nbc_req->data.rd.state = ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO; +#endif + return; + } + + nprocs = vars->nprocs; + + /* We're going to perform aggregation of I/O. Here we call + * ADIOI_Calc_file_domains() to determine what processes will handle I/O + * to what regions. We pass nprocs_for_coll into this function; it is + * used to determine how many processes will perform I/O, which is also + * the number of regions into which the range of bytes must be divided. + * These regions are called "file domains", or FDs. + * + * When this function returns, fd_start, fd_end, fd_size, and + * min_st_offset will be filled in. fd_start holds the starting byte + * location for each file domain. fd_end holds the ending byte location. + * min_st_offset holds the minimum byte location that will be accessed. + * + * Both fd_start[] and fd_end[] are indexed by an aggregator number; this + * needs to be mapped to an actual rank in the communicator later. + * + */ + ADIOI_Calc_file_domains(vars->st_offsets, vars->end_offsets, nprocs, + vars->nprocs_for_coll, &vars->min_st_offset, + &vars->fd_start, &vars->fd_end, + fd->hints->min_fdomain_size, &vars->fd_size, + fd->hints->striping_unit); + + /* calculate where the portions of the access requests of this process + * are located in terms of the file domains. this could be on the same + * process or on other processes. this function fills in: + * count_my_req_procs - number of processes (including this one) for which + * this process has requests in their file domain + * count_my_req_per_proc - count of requests for each process, indexed + * by rank of the process + * my_req[] - array of data structures describing the requests to be + * performed by each process (including self). indexed by rank. + * buf_idx[] - array of locations into which data can be directly moved; + * this is only valid for contiguous buffer case + */ + ADIOI_Calc_my_req(fd, vars->offset_list, vars->len_list, + vars->contig_access_count, vars->min_st_offset, + vars->fd_start, vars->fd_end, vars->fd_size, + nprocs, &vars->count_my_req_procs, + &vars->count_my_req_per_proc, &vars->my_req, + &vars->buf_idx); + + /* perform a collective communication in order to distribute the + * data calculated above. fills in the following: + * count_others_req_procs - number of processes (including this + * one) which have requests in this process's file domain. + * count_others_req_per_proc[] - number of separate contiguous + * requests from proc i lie in this process's file domain. + */ + + cor_vars = (ADIOI_Icalc_others_req_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_Icalc_others_req_vars)); + nbc_req->cor_vars = cor_vars; + cor_vars->fd = vars->fd; + cor_vars->count_my_req_procs = vars->count_my_req_procs; + cor_vars->count_my_req_per_proc = vars->count_my_req_per_proc; + cor_vars->my_req = vars->my_req; + cor_vars->nprocs = vars->nprocs; + cor_vars->myrank = vars->myrank; + cor_vars->count_others_req_procs_ptr = &vars->count_others_req_procs; + cor_vars->others_req_ptr = &vars->others_req; + cor_vars->next_fn = ADIOI_GEN_IreadStridedColl_read; + + ADIOI_Icalc_others_req(nbc_req, error_code); +} + +static void ADIOI_GEN_IreadStridedColl_read(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; + ADIOI_Iread_and_exch_vars *rae_vars = NULL; + ADIOI_Access *my_req = vars->my_req; + int nprocs = vars->nprocs; + int i; + + /* my_req[] and count_my_req_per_proc aren't needed at this point, so + * let's free the memory + */ + ADIOI_Free(vars->count_my_req_per_proc); + for (i = 0; i < nprocs; i++) { + if (my_req[i].count) { + ADIOI_Free(my_req[i].offsets); + ADIOI_Free(my_req[i].lens); + } + } + ADIOI_Free(my_req); + + /* read data in sizes of no more than ADIOI_Coll_bufsize, + * communicate, and fill user buf. + */ + rae_vars = (ADIOI_Iread_and_exch_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_Iread_and_exch_vars)); + nbc_req->data.rd.rae_vars = rae_vars; + rae_vars->fd = vars->fd; + rae_vars->buf = vars->buf; + rae_vars->datatype = vars->datatype; + rae_vars->nprocs = vars->nprocs; + rae_vars->myrank = vars->myrank; + rae_vars->others_req = vars->others_req; + rae_vars->offset_list = vars->offset_list; + rae_vars->len_list = vars->len_list; + rae_vars->contig_access_count = vars->contig_access_count; + rae_vars->min_st_offset = vars->min_st_offset; + rae_vars->fd_size = vars->fd_size; + rae_vars->fd_start = vars->fd_start; + rae_vars->fd_end = vars->fd_end; + rae_vars->buf_idx = vars->buf_idx; + rae_vars->next_fn = ADIOI_GEN_IreadStridedColl_free; + + ADIOI_Iread_and_exch(nbc_req, error_code); +} + +static void ADIOI_GEN_IreadStridedColl_free(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; + ADIO_File fd = vars->fd; + MPI_Datatype datatype = vars->datatype; + ADIOI_Access *others_req = vars->others_req; + int nprocs = vars->nprocs; + int i; + + if (!vars->buftype_is_contig) ADIOI_Delete_flattened(datatype); + + /* free all memory allocated for collective I/O */ + for (i = 0; i < nprocs; i++) { + if (others_req[i].count) { + ADIOI_Free(others_req[i].offsets); + ADIOI_Free(others_req[i].lens); + ADIOI_Free(others_req[i].mem_ptrs); + } + } + ADIOI_Free(others_req); + + ADIOI_Free(vars->buf_idx); + ADIOI_Free(vars->offset_list); + ADIOI_Free(vars->len_list); + ADIOI_Free(vars->st_offsets); + ADIOI_Free(vars->end_offsets); + ADIOI_Free(vars->fd_start); + ADIOI_Free(vars->fd_end); + + fd->fp_sys_posn = -1; /* set it to null. */ + + ADIOI_GEN_IreadStridedColl_fini(nbc_req, error_code); +} + +static void ADIOI_GEN_IreadStridedColl_fini(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; + MPI_Count size; + + /* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually read and placed in buf + during collective I/O. */ + MPI_Type_size_x(vars->datatype, &size); + nbc_req->nbytes = size * vars->count; + + /* free the struct for parameters and variables */ + if (nbc_req->data.rd.rsc_vars) { + ADIOI_Free(nbc_req->data.rd.rsc_vars); + nbc_req->data.rd.rsc_vars = NULL; + } + + /* make the request complete */ + *error_code = MPI_Grequest_complete(nbc_req->req); + nbc_req->data.rd.state = ADIOI_IRC_STATE_COMPLETE; +} + + +static void ADIOI_Iread_and_exch(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + ADIO_File fd = vars->fd; + MPI_Datatype datatype = vars->datatype; + int nprocs = vars->nprocs; + ADIOI_Access *others_req = vars->others_req; + + /* Read in sizes of no more than coll_bufsize, an info parameter. + Send data to appropriate processes. + Place recd. data in user buf. + The idea is to reduce the amount of extra memory required for + collective I/O. If all data were read all at once, which is much + easier, it would require temp space more than the size of user_buf, + which is often unacceptable. For example, to read a distributed + array from a file, where each local array is 8Mbytes, requiring + at least another 8Mbytes of temp space is unacceptable. */ + + int i, j; + ADIO_Offset st_loc = -1, end_loc = -1; + int coll_bufsize; + + *error_code = MPI_SUCCESS; /* changed below if error */ + /* only I/O errors are currently reported */ + + /* calculate the number of reads of size coll_bufsize + to be done by each process and the max among all processes. + That gives the no. of communication phases as well. + coll_bufsize is obtained from the hints object. */ + + coll_bufsize = fd->hints->cb_buffer_size; + vars->coll_bufsize = coll_bufsize; + + /* grab some initial values for st_loc and end_loc */ + for (i = 0; i < nprocs; i++) { + if (others_req[i].count) { + st_loc = others_req[i].offsets[0]; + end_loc = others_req[i].offsets[0]; + break; + } + } + + /* now find the real values */ + for (i = 0; i < nprocs; i++) + for (j = 0; j < others_req[i].count; j++) { + st_loc = ADIOI_MIN(st_loc, others_req[i].offsets[j]); + end_loc = ADIOI_MAX(end_loc, (others_req[i].offsets[j] + + others_req[i].lens[j] - 1)); + } + + vars->st_loc = st_loc; + vars->end_loc = end_loc; + + /* calculate ntimes, the number of times this process must perform I/O + * operations in order to complete all the requests it has received. + * the need for multiple I/O operations comes from the restriction that + * we only use coll_bufsize bytes of memory for internal buffering. + */ + if ((st_loc == -1) && (end_loc == -1)) { + /* this process does no I/O. */ + vars->ntimes = 0; + } + else { + /* ntimes=ceiling_div(end_loc - st_loc + 1, coll_bufsize)*/ + vars->ntimes = (int)((end_loc - st_loc + coll_bufsize) / coll_bufsize); + } + + *error_code = MPI_Iallreduce(&vars->ntimes, &vars->max_ntimes, 1, MPI_INT, + MPI_MAX, fd->comm, &vars->req1); + + vars->read_buf = fd->io_buf; /* Allocated at open time */ + + vars->curr_offlen_ptr = (int *)ADIOI_Calloc(nprocs, sizeof(int)); + /* its use is explained below. calloc initializes to 0. */ + + vars->count = (int *)ADIOI_Malloc(nprocs * sizeof(int)); + /* to store count of how many off-len pairs per proc are satisfied + in an iteration. */ + + vars->partial_send = (int *)ADIOI_Calloc(nprocs, sizeof(int)); + /* if only a portion of the last off-len pair is sent to a process + in a particular iteration, the length sent is stored here. + calloc initializes to 0. */ + + vars->send_size = (int *)ADIOI_Malloc(nprocs * sizeof(int)); + /* total size of data to be sent to each proc. in an iteration */ + + vars->recv_size = (int *)ADIOI_Malloc(nprocs * sizeof(int)); + /* total size of data to be recd. from each proc. in an iteration. + Of size nprocs so that I can use MPI_Alltoall later. */ + + vars->recd_from_proc = (int *)ADIOI_Calloc(nprocs, sizeof(int)); + /* amount of data recd. so far from each proc. Used in + ADIOI_Fill_user_buffer. initialized to 0 here. */ + + vars->start_pos = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + /* used to store the starting value of curr_offlen_ptr[i] in + this iteration */ + + ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); + if (!vars->buftype_is_contig) { + vars->flat_buf = ADIOI_Flatten_and_find(datatype); + } + MPI_Type_extent(datatype, &vars->buftype_extent); + + vars->done = 0; + vars->off = st_loc; + vars->for_curr_iter = vars->for_next_iter = 0; + + /* set the state to wait until MPI_Ialltoall finishes. */ + nbc_req->data.rd.state = ADIOI_IRC_STATE_IREAD_AND_EXCH; +} + +static void ADIOI_Iread_and_exch_l1_begin(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + ADIO_File fd; + int nprocs; + ADIOI_Access *others_req; + + int i, j; + ADIO_Offset real_off, req_off; + char *read_buf; + int *curr_offlen_ptr, *count, *send_size; + int *partial_send, *start_pos; + ADIO_Offset size, real_size, for_next_iter; + int req_len, flag; + + ADIOI_R_Iexchange_data_vars *red_vars = NULL; + + /* loop exit condition */ + if (vars->m >= vars->ntimes) { + ADIOI_Iread_and_exch_reset(nbc_req, error_code); + return; + } + + fd = vars->fd; + nprocs = vars->nprocs; + others_req = vars->others_req; + + read_buf = vars->read_buf; + curr_offlen_ptr = vars->curr_offlen_ptr; + count = vars->count; + send_size = vars->send_size; + partial_send = vars->partial_send; + start_pos = vars->start_pos; + + /* read buf of size coll_bufsize (or less) */ + /* go through all others_req and check if any are satisfied + by the current read */ + + /* since MPI guarantees that displacements in filetypes are in + monotonically nondecreasing order, I can maintain a pointer + (curr_offlen_ptr) to + current off-len pair for each process in others_req and scan + further only from there. There is still a problem of filetypes + such as: (1, 2, 3 are not process nos. They are just numbers for + three chunks of data, specified by a filetype.) + + 1 -------!-- + 2 -----!---- + 3 --!----- + + where ! indicates where the current read_size limitation cuts + through the filetype. I resolve this by reading up to !, but + filling the communication buffer only for 1. I copy the portion + left over for 2 into a tmp_buf for use in the next + iteration. i.e., 2 and 3 will be satisfied in the next + iteration. This simplifies filling in the user's buf at the + other end, as only one off-len pair with incomplete data + will be sent. I also don't need to send the individual + offsets and lens along with the data, as the data is being + sent in a particular order. */ + + /* off = start offset in the file for the data actually read in + this iteration + size = size of data read corresponding to off + real_off = off minus whatever data was retained in memory from + previous iteration for cases like 2, 3 illustrated above + real_size = size plus the extra corresponding to real_off + req_off = off in file for a particular contiguous request + minus what was satisfied in previous iteration + req_size = size corresponding to req_off */ + + size = ADIOI_MIN((unsigned)vars->coll_bufsize, + vars->end_loc - vars->st_loc + 1 - vars->done); + real_off = vars->off - vars->for_curr_iter; + real_size = size + vars->for_curr_iter; + + vars->size = size; + vars->real_size = real_size; + + for (i = 0; i < nprocs; i++) count[i] = send_size[i] = 0; + for_next_iter = 0; + + for (i = 0; i < nprocs; i++) { +#ifdef RDCOLL_DEBUG + DBG_FPRINTF(stderr, "rank %d, i %d, others_count %d\n", + vars->myrank, i, others_req[i].count); +#endif + if (others_req[i].count) { + start_pos[i] = curr_offlen_ptr[i]; + for (j = curr_offlen_ptr[i]; j < others_req[i].count; j++) { + if (partial_send[i]) { + /* this request may have been partially + satisfied in the previous iteration. */ + req_off = others_req[i].offsets[j] + partial_send[i]; + req_len = others_req[i].lens[j] - partial_send[i]; + partial_send[i] = 0; + /* modify the off-len pair to reflect this change */ + others_req[i].offsets[j] = req_off; + others_req[i].lens[j] = req_len; + } + else { + req_off = others_req[i].offsets[j]; + req_len = others_req[i].lens[j]; + } + if (req_off < real_off + real_size) { + count[i]++; + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)read_buf) + req_off - real_off) == (ADIO_Offset)(MPIU_Upint)(read_buf + req_off - real_off)); + MPI_Address(read_buf + req_off - real_off, + &(others_req[i].mem_ptrs[j])); + ADIOI_Assert((real_off + real_size - req_off) == (int)(real_off + real_size - req_off)); + send_size[i] += (int)(ADIOI_MIN(real_off + real_size - req_off, + (ADIO_Offset)(unsigned)req_len)); + + if (real_off + real_size - req_off < (ADIO_Offset)(unsigned)req_len) { + partial_send[i] = (int)(real_off + real_size - req_off); + if ((j+1 < others_req[i].count) && + (others_req[i].offsets[j+1] < real_off + real_size)) { + /* this is the case illustrated in the + figure above. */ + for_next_iter = ADIOI_MAX(for_next_iter, + real_off + real_size - others_req[i].offsets[j+1]); + /* max because it must cover requests + from different processes */ + } + break; + } + } + else break; + } + curr_offlen_ptr[i] = j; + } + } + vars->for_next_iter = for_next_iter; + + flag = 0; + for (i = 0; i < nprocs; i++) + if (count[i]) flag = 1; + + /* create a struct for ADIOI_R_Iexchange_data() */ + red_vars = (ADIOI_R_Iexchange_data_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_R_Iexchange_data_vars)); + nbc_req->data.rd.red_vars = red_vars; + red_vars->fd = vars->fd; + red_vars->buf = vars->buf; + red_vars->flat_buf = vars->flat_buf; + red_vars->offset_list = vars->offset_list; + red_vars->len_list = vars->len_list; + red_vars->send_size = vars->send_size; + red_vars->recv_size = vars->recv_size; + red_vars->count = vars->count; + red_vars->start_pos = vars->start_pos; + red_vars->partial_send = vars->partial_send; + red_vars->recd_from_proc = vars->recd_from_proc; + red_vars->nprocs = vars->nprocs; + red_vars->myrank = vars->myrank; + red_vars->buftype_is_contig = vars->buftype_is_contig; + red_vars->contig_access_count = vars->contig_access_count; + red_vars->min_st_offset = vars->min_st_offset; + red_vars->fd_size = vars->fd_size; + red_vars->fd_start = vars->fd_start; + red_vars->fd_end = vars->fd_end; + red_vars->others_req = vars->others_req; + red_vars->iter = vars->m; + red_vars->buftype_extent = vars->buftype_extent; + red_vars->buf_idx = vars->buf_idx; + red_vars->next_fn = ADIOI_Iread_and_exch_l1_end; + + if (flag) { + ADIOI_Assert(size == (int)size); +#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) + MPI_Status status; + ADIO_ReadContig(fd, read_buf+vars->for_curr_iter, (int)size, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, vars->off, + &status, error_code); +#else + ADIO_IreadContig(fd, read_buf+vars->for_curr_iter, (int)size, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, vars->off, + &vars->req2, error_code); + + nbc_req->data.rd.state = ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN; + return; +#endif + } + + ADIOI_R_Iexchange_data(nbc_req, error_code); +} + +static void ADIOI_Iread_and_exch_l1_end(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + ADIO_File fd = vars->fd; + ADIO_Offset size = vars->size; + ADIO_Offset real_size = vars->real_size; + ADIO_Offset for_next_iter = vars->for_next_iter; + char *read_buf = vars->read_buf; + char *tmp_buf; + + vars->for_curr_iter = for_next_iter; + + if (for_next_iter) { + tmp_buf = (char *)ADIOI_Malloc(for_next_iter); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)read_buf)+real_size-for_next_iter) == (ADIO_Offset)(MPIU_Upint)(read_buf+real_size-for_next_iter)); + ADIOI_Assert((for_next_iter+vars->coll_bufsize) == (size_t)(for_next_iter+vars->coll_bufsize)); + memcpy(tmp_buf, read_buf+real_size-for_next_iter, for_next_iter); + ADIOI_Free(fd->io_buf); + fd->io_buf = (char *)ADIOI_Malloc(for_next_iter+vars->coll_bufsize); + memcpy(fd->io_buf, tmp_buf, for_next_iter); + vars->read_buf = fd->io_buf; + ADIOI_Free(tmp_buf); + } + + vars->off += size; + vars->done += size; + + /* increment m and go back to the beginning of m loop */ + vars->m++; + ADIOI_Iread_and_exch_l1_begin(nbc_req, error_code); +} + +static void ADIOI_Iread_and_exch_reset(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + int nprocs = vars->nprocs; + int *count = vars->count; + int *send_size = vars->send_size; + int i; + + for (i = 0; i < nprocs; i++) count[i] = send_size[i] = 0; + + vars->m = vars->ntimes; + ADIOI_Iread_and_exch_l2_begin(nbc_req, error_code); +} + +static void ADIOI_Iread_and_exch_l2_begin(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + ADIOI_R_Iexchange_data_vars *red_vars = NULL; + + /* loop exit condition */ + if (vars->m >= vars->max_ntimes) { + ADIOI_Iread_and_exch_fini(nbc_req, error_code); + return; + } + + /* create a struct for ADIOI_R_Iexchange_data() */ + red_vars = (ADIOI_R_Iexchange_data_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_R_Iexchange_data_vars)); + nbc_req->data.rd.red_vars = red_vars; + red_vars->fd = vars->fd; + red_vars->buf = vars->buf; + red_vars->flat_buf = vars->flat_buf; + red_vars->offset_list = vars->offset_list; + red_vars->len_list = vars->len_list; + red_vars->send_size = vars->send_size; + red_vars->recv_size = vars->recv_size; + red_vars->count = vars->count; + red_vars->start_pos = vars->start_pos; + red_vars->partial_send = vars->partial_send; + red_vars->recd_from_proc = vars->recd_from_proc; + red_vars->nprocs = vars->nprocs; + red_vars->myrank = vars->myrank; + red_vars->buftype_is_contig = vars->buftype_is_contig; + red_vars->contig_access_count = vars->contig_access_count; + red_vars->min_st_offset = vars->min_st_offset; + red_vars->fd_size = vars->fd_size; + red_vars->fd_start = vars->fd_start; + red_vars->fd_end = vars->fd_end; + red_vars->others_req = vars->others_req; + red_vars->iter = vars->m; + red_vars->buftype_extent = vars->buftype_extent; + red_vars->buf_idx = vars->buf_idx; + red_vars->next_fn = ADIOI_Iread_and_exch_l2_end; + + ADIOI_R_Iexchange_data(nbc_req, error_code); +} + +static void ADIOI_Iread_and_exch_l2_end(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + + vars->m++; + ADIOI_Iread_and_exch_l2_begin(nbc_req, error_code); +} + +static void ADIOI_Iread_and_exch_fini(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; + void (*next_fn)(ADIOI_NBC_Request *, int *); + + ADIOI_Free(vars->curr_offlen_ptr); + ADIOI_Free(vars->count); + ADIOI_Free(vars->partial_send); + ADIOI_Free(vars->send_size); + ADIOI_Free(vars->recv_size); + ADIOI_Free(vars->recd_from_proc); + ADIOI_Free(vars->start_pos); + + next_fn = vars->next_fn; + + /* free the struct for parameters and variables */ + ADIOI_Free(nbc_req->data.rd.rae_vars); + nbc_req->data.rd.rae_vars = NULL; + + /* move to the next function */ + next_fn(nbc_req, error_code); +} + + +static void ADIOI_R_Iexchange_data(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; + + /* exchange send_size info so that each process knows how much to + receive from whom and how much memory to allocate. */ + *error_code = MPI_Ialltoall(vars->send_size, 1, MPI_INT, vars->recv_size, 1, + MPI_INT, vars->fd->comm, &vars->req1); + + nbc_req->data.rd.state = ADIOI_IRC_STATE_R_IEXCHANGE_DATA; +} + +static void ADIOI_R_Iexchange_data_recv(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; + ADIO_File fd = vars->fd; + int *send_size = vars->send_size; + int *recv_size = vars->recv_size; + int *count = vars->count; + int *start_pos = vars->start_pos; + int *partial_send = vars->partial_send; + int nprocs = vars->nprocs; + int myrank = vars->myrank; + ADIOI_Access *others_req = vars->others_req; + int iter = vars->iter; + int *buf_idx = vars->buf_idx; + + int i, j, k = 0, tmp = 0, nprocs_recv, nprocs_send; + char **recv_buf = NULL; + MPI_Datatype send_type; + + nprocs_recv = 0; + for (i = 0; i < nprocs; i++) if (recv_size[i]) nprocs_recv++; + vars->nprocs_recv = nprocs_recv; + + nprocs_send = 0; + for (i = 0; i < nprocs; i++) if (send_size[i]) nprocs_send++; + vars->nprocs_send = nprocs_send; + + vars->req2 = (MPI_Request *) + ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); + /* +1 to avoid a 0-size malloc */ + + /* post recvs. if buftype_is_contig, data can be directly recd. into + user buf at location given by buf_idx. else use recv_buf. */ + +#ifdef AGGREGATION_PROFILE + MPE_Log_event (5032, 0, NULL); +#endif + + if (vars->buftype_is_contig) { + j = 0; + for (i = 0; i < nprocs; i++) + if (recv_size[i]) { + MPI_Irecv(((char *)vars->buf) + buf_idx[i], recv_size[i], + MPI_BYTE, i, myrank+i+100*iter, fd->comm, + vars->req2 + j); + j++; + buf_idx[i] += recv_size[i]; + } + } + else { + /* allocate memory for recv_buf and post receives */ + recv_buf = (char **) ADIOI_Malloc(nprocs * sizeof(char*)); + vars->recv_buf = recv_buf; + for (i = 0; i < nprocs; i++) + if (recv_size[i]) recv_buf[i] = (char *)ADIOI_Malloc(recv_size[i]); + + j = 0; + for (i = 0; i < nprocs; i++) + if (recv_size[i]) { + MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, + myrank+i+100*iter, fd->comm, + vars->req2 + j); + j++; +#ifdef RDCOLL_DEBUG + DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", + myrank, recv_size[i], myrank+i+100*iter); +#endif + } + } + + /* create derived datatypes and send data */ + + j = 0; + for (i = 0; i < nprocs; i++) { + if (send_size[i]) { + /* take care if the last off-len pair is a partial send */ + if (partial_send[i]) { + k = start_pos[i] + count[i] - 1; + tmp = others_req[i].lens[k]; + others_req[i].lens[k] = partial_send[i]; + } + ADIOI_Type_create_hindexed_x(count[i], + &(others_req[i].lens[start_pos[i]]), + &(others_req[i].mem_ptrs[start_pos[i]]), + MPI_BYTE, &send_type); + /* absolute displacement; use MPI_BOTTOM in send */ + MPI_Type_commit(&send_type); + MPI_Isend(MPI_BOTTOM, 1, send_type, i, myrank+i+100*iter, + fd->comm, vars->req2 + nprocs_recv + j); + MPI_Type_free(&send_type); + if (partial_send[i]) others_req[i].lens[k] = tmp; + j++; + } + } + + /* wait on the receives */ + if (nprocs_recv) { + nbc_req->data.rd.state = ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV; + return; + } + + ADIOI_R_Iexchange_data_fill(nbc_req, error_code); +} + +static void ADIOI_R_Iexchange_data_fill(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; + + if (vars->nprocs_recv) { + /* if noncontiguous, to the copies from the recv buffers */ + if (!vars->buftype_is_contig) + ADIOI_Fill_user_buffer(vars->fd, vars->buf, vars->flat_buf, + vars->recv_buf, vars->offset_list, vars->len_list, + (unsigned*)vars->recv_size, + vars->req2, NULL, vars->recd_from_proc, + vars->nprocs, vars->contig_access_count, + vars->min_st_offset, vars->fd_size, vars->fd_start, + vars->fd_end, vars->buftype_extent); + } + + nbc_req->data.rd.state = ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL; +} + +static void ADIOI_R_Iexchange_data_fini(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; + void (*next_fn)(ADIOI_NBC_Request *, int *); + int i; + + ADIOI_Free(vars->req2); + + if (!vars->buftype_is_contig) { + for (i = 0; i < vars->nprocs; i++) + if (vars->recv_size[i]) ADIOI_Free(vars->recv_buf[i]); + ADIOI_Free(vars->recv_buf); + } +#ifdef AGGREGATION_PROFILE + MPE_Log_event (5033, 0, NULL); +#endif + + next_fn = vars->next_fn; + + /* free the structure for parameters and variables */ + ADIOI_Free(vars); + nbc_req->data.rd.red_vars = NULL; + + /* move to the next function */ + next_fn(nbc_req, error_code); +} + + +static int ADIOI_GEN_irc_query_fn(void *extra_state, MPI_Status *status) +{ + ADIOI_NBC_Request *nbc_req; + + nbc_req = (ADIOI_NBC_Request *)extra_state; + + MPI_Status_set_elements_x(status, MPI_BYTE, nbc_req->nbytes); + + /* can never cancel so always true */ + MPI_Status_set_cancelled(status, 0); + + /* choose not to return a value for this */ + status->MPI_SOURCE = MPI_UNDEFINED; + /* tag has no meaning for this generalized request */ + status->MPI_TAG = MPI_UNDEFINED; + + /* this generalized request never fails */ + return MPI_SUCCESS; +} + +static int ADIOI_GEN_irc_free_fn(void *extra_state) +{ + ADIOI_NBC_Request *nbc_req; + + nbc_req = (ADIOI_NBC_Request *)extra_state; + ADIOI_Free(nbc_req); + + return MPI_SUCCESS; +} + +static int ADIOI_GEN_irc_poll_fn(void *extra_state, MPI_Status *status) +{ + ADIOI_NBC_Request *nbc_req; + ADIOI_GEN_IreadStridedColl_vars *rsc_vars = NULL; + ADIOI_Icalc_others_req_vars *cor_vars = NULL; + ADIOI_Iread_and_exch_vars *rae_vars = NULL; + ADIOI_R_Iexchange_data_vars *red_vars = NULL; + int errcode = MPI_SUCCESS; + int flag; + + nbc_req = (ADIOI_NBC_Request *)extra_state; + + switch (nbc_req->data.rd.state) { + case ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL: + rsc_vars = nbc_req->data.rd.rsc_vars; + errcode = MPI_Testall(2, rsc_vars->req_offset, &flag, + MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_GEN_IreadStridedColl_inter(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO: + rsc_vars = nbc_req->data.rd.rsc_vars; + errcode = MPI_Test(&rsc_vars->req_ind_io, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + /* call the last function */ + ADIOI_GEN_IreadStridedColl_fini(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_ICALC_OTHERS_REQ: + cor_vars = nbc_req->cor_vars; + errcode = MPI_Test(&cor_vars->req1, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_Icalc_others_req_main(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN: + cor_vars = nbc_req->cor_vars; + if (cor_vars->num_req2) { + errcode = MPI_Testall(cor_vars->num_req2, cor_vars->req2, + &flag, MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_Icalc_others_req_fini(nbc_req, &errcode); + } + } else { + ADIOI_Icalc_others_req_fini(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_IREAD_AND_EXCH: + rae_vars = nbc_req->data.rd.rae_vars; + errcode = MPI_Test(&rae_vars->req1, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + rae_vars->m = 0; + ADIOI_Iread_and_exch_l1_begin(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN: + rae_vars = nbc_req->data.rd.rae_vars; + errcode = MPI_Test(&rae_vars->req2, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_R_Iexchange_data(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_R_IEXCHANGE_DATA: + red_vars = nbc_req->data.rd.red_vars; + errcode = MPI_Test(&red_vars->req1, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_R_Iexchange_data_recv(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV: + red_vars = nbc_req->data.rd.red_vars; + errcode = MPI_Testall(red_vars->nprocs_recv, red_vars->req2, &flag, + MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_R_Iexchange_data_fill(nbc_req, &errcode); + } + break; + + case ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL: + red_vars = nbc_req->data.rd.red_vars; + errcode = MPI_Testall(red_vars->nprocs_send, + red_vars->req2 + red_vars->nprocs_recv, + &flag, MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_R_Iexchange_data_fini(nbc_req, &errcode); + } + break; + + default: + break; + } + + /* --BEGIN ERROR HANDLING-- */ + if (errcode != MPI_SUCCESS) { + errcode = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, + "ADIOI_GEN_irc_poll_fn", __LINE__, + MPI_ERR_IO, "**mpi_grequest_complete", + 0); + } + /* --END ERROR HANDLING-- */ + + return errcode; +} + +/* wait for multiple requests to complete */ +static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states, + double timeout, MPI_Status *status) +{ + int i, errcode = MPI_SUCCESS; + double starttime; + ADIOI_NBC_Request **nbc_reqlist; + + nbc_reqlist = (ADIOI_NBC_Request **)array_of_states; + + starttime = MPI_Wtime(); + for (i = 0; i < count ; i++) { + while (nbc_reqlist[i]->data.rd.state != ADIOI_IRC_STATE_COMPLETE) { + errcode = ADIOI_GEN_irc_poll_fn(nbc_reqlist[i], MPI_STATUS_IGNORE); + /* --BEGIN ERROR HANDLING-- */ + if (errcode != MPI_SUCCESS) { + errcode = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, + "ADIOI_GEN_irc_wait_fn", + __LINE__, MPI_ERR_IO, + "**mpi_grequest_complete", 0); + } + /* --END ERROR HANDLING-- */ + + if ((timeout > 0) && (timeout < (MPI_Wtime() - starttime))) + goto fn_exit; + + /* If the progress engine is blocked, we have to yield for another + * thread to be able to unblock the progress engine. */ + MPIR_Ext_cs_yield(); + } + } + + fn_exit: + return errcode; +} + +#endif /* HAVE_MPI_GREQUEST_EXTENSIONS */ diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.pdf b/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.pdf new file mode 100644 index 0000000000..2c646fb5a5 Binary files /dev/null and b/ompi/mca/io/romio321/romio/adio/common/ad_iread_coll.pdf differ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_iread_fake.c b/ompi/mca/io/romio321/romio/adio/common/ad_iread_fake.c similarity index 84% rename from ompi/mca/io/romio314/romio/adio/common/ad_iread_fake.c rename to ompi/mca/io/romio321/romio/adio/common/ad_iread_fake.c index 6a7f0bfde7..b5cbd1da27 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_iread_fake.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iread_fake.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,10 +11,10 @@ /* Generic implementation of IreadContig calls the blocking ReadContig * immediately. */ -void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, - int *error_code) + int *error_code) { ADIO_Status status; MPI_Count typesize; @@ -27,8 +27,8 @@ void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, * if necessary. */ ADIOI_Assert(len == (int) len); /* the count is an int parm */ - ADIO_ReadContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset, - &status, error_code); + ADIO_ReadContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset, + &status, error_code); if (*error_code != MPI_SUCCESS) { len=0; } @@ -39,7 +39,7 @@ void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, /* Generic implementation of IreadStrided calls the blocking ReadStrided * immediately. */ -void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, +void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code) @@ -51,8 +51,8 @@ void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, /* Call the blocking function. It will create an error code * if necessary. */ - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); + ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); if (*error_code == MPI_SUCCESS) { MPI_Type_size_x(datatype, &typesize); nbytes = (MPI_Offset)count*(MPI_Offset)typesize; diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_iwrite.c b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite.c similarity index 84% rename from ompi/mca/io/romio314/romio/adio/common/ad_iwrite.c rename to ompi/mca/io/romio321/romio/adio/common/ad_iwrite.c index feecae6a24..e72af5fe22 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_iwrite.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -27,7 +27,7 @@ #include "../../mpi-io/mpioimpl.h" #include "../../mpi-io/mpioprof.h" #include "mpiu_greq.h" -/* Workaround for incomplete set of definitions if __REDIRECT is not +/* Workaround for incomplete set of definitions if __REDIRECT is not defined and large file support is used in aio.h */ #if !defined(__REDIRECT) && defined(__USE_FILE_OFFSET64) #define aiocb aiocb64 @@ -39,7 +39,7 @@ static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; /* ADIOI_GEN_IwriteContig * - * This code handles only the case where ROMIO_HAVE_WORKING_AIO is + * This code handles only the case where ROMIO_HAVE_WORKING_AIO is * defined. We post an asynchronous I/O operations using the appropriate aio * routines. Otherwise, the ADIOI_Fns_struct will point to the FAKE * version. @@ -100,8 +100,8 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, /* Use Direct I/O if desired and properly aligned */ if (fd->fns == &ADIO_XFS_operations && ((wr && fd->direct_write) || (!wr && fd->direct_read)) && - !(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz) && - !(len % fd->d_miniosz) && (len >= fd->d_miniosz) && + !(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz) && + !(len % fd->d_miniosz) && (len >= fd->d_miniosz) && (len <= maxiosz)) { fd_sys = fd->fd_direct; } @@ -113,19 +113,19 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, aiocbp->aio_buf = buf; aiocbp->aio_nbytes = len; -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE +#ifdef HAVE_STRUCT_AIOCB_AIO_WHENCE aiocbp->aio_whence = SEEK_SET; #endif -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES +#ifdef HAVE_STRUCT_AIOCB_AIO_FILDES aiocbp->aio_fildes = fd_sys; #endif -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT +#ifdef HAVE_STRUCT_AIOCB_AIO_SIGEVENT # ifdef AIO_SIGNOTIFY_NONE aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE; # endif aiocbp->aio_sigevent.sigev_signo = 0; #endif -#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO +#ifdef HAVE_STRUCT_AIOCB_AIO_REQPRIO # ifdef AIO_PRIO_DFL aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */ # else @@ -134,7 +134,7 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, #endif #ifndef ROMIO_HAVE_AIO_CALLS_NEED_FILEDES -#ifndef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES +#ifndef HAVE_STRUCT_AIOCB_AIO_FILDES #error 'No fildes set for aio structure' #endif if (wr) err = aio_write(aiocbp); @@ -146,30 +146,32 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, #endif if (err == -1) { - if (errno == EAGAIN || errno == ENOSYS) { + if (errno == EAGAIN || errno == ENOSYS) { /* exceeded the max. no. of outstanding requests. - or, aio routines are not actually implemented + or, aio routines are not actually implemented treat this as a blocking request and return. */ - if (wr) - ADIO_WriteContig(fd, buf, len, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, offset, &status, &error_code); + if (wr) + ADIO_WriteContig(fd, buf, len, MPI_BYTE, + ADIO_EXPLICIT_OFFSET, offset, &status, &error_code); else ADIO_ReadContig(fd, buf, len, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, offset, &status, &error_code); - + ADIO_EXPLICIT_OFFSET, offset, &status, &error_code); + MPIO_Completed_request_create(&fd, len, &error_code, request); if (aiocbp != NULL) ADIOI_Free(aiocbp); if (aio_req != NULL) ADIOI_Free(aio_req); return 0; } else { + ADIOI_Free(aio_req); + ADIOI_Free(aiocbp); return errno; } } aio_req->aiocbp = aiocbp; if (ADIOI_GEN_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, - ADIOI_GEN_aio_free_fn, MPIU_Greq_cancel_fn, - ADIOI_GEN_aio_poll_fn, ADIOI_GEN_aio_wait_fn, + MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, + ADIOI_GEN_aio_free_fn, MPIU_Greq_cancel_fn, + ADIOI_GEN_aio_poll_fn, ADIOI_GEN_aio_wait_fn, &ADIOI_GEN_greq_class); } MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, aio_req, request); @@ -191,11 +193,11 @@ void ADIOI_GEN_IwriteStrided(ADIO_File fd, const void *buf, int count, MPI_Count typesize; MPI_Offset nbytes=0; - /* Call the blocking function. It will create an error code + /* Call the blocking function. It will create an error code * if necessary. */ - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); + ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); if (*error_code == MPI_SUCCESS) { MPI_Type_size_x(datatype, &typesize); @@ -238,7 +240,7 @@ int ADIOI_GEN_aio_poll_fn(void *extra_state, MPI_Status *status) } /* wait for multiple requests to complete */ -int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states, +int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states, double timeout, MPI_Status *status) { const struct aiocb **cblist; @@ -270,13 +272,13 @@ int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states, do { err = aio_suspend(cblist, count, aio_timer_p); } while (err < 0 && errno == EINTR); - if (err == 0) + if (err == 0) { /* run through the list of requests, and mark all the completed ones as done */ for (i=0; i< count; i++) { /* aio_error returns an ERRNO value */ - if (aio_reqlist[i]->aiocbp == NULL) + if (aio_reqlist[i]->aiocbp == NULL) continue; errno = aio_error(aio_reqlist[i]->aiocbp); if (errno == 0) { @@ -286,15 +288,15 @@ int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states, if (errcode != MPI_SUCCESS) { errcode = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_aio_wait_fn", - __LINE__, MPI_ERR_IO, + "ADIOI_GEN_aio_wait_fn", + __LINE__, MPI_ERR_IO, "**mpi_grequest_complete", 0); } ADIOI_Free(aio_reqlist[i]->aiocbp); aio_reqlist[i]->aiocbp = NULL; cblist[i] = NULL; nr_complete++; - } + } /* TODO: need to handle error conditions somehow*/ } } /* TODO: also need to handle errors here */ @@ -319,7 +321,7 @@ int ADIOI_GEN_aio_free_fn(void *extra_state) } #endif /* working AIO */ -int ADIOI_GEN_aio_query_fn(void *extra_state, MPI_Status *status) +int ADIOI_GEN_aio_query_fn(void *extra_state, MPI_Status *status) { ADIOI_AIO_Request *aio_req; @@ -327,16 +329,16 @@ int ADIOI_GEN_aio_query_fn(void *extra_state, MPI_Status *status) MPI_Status_set_elements_x(status, MPI_BYTE, aio_req->nbytes); - /* can never cancel so always true */ - MPI_Status_set_cancelled(status, 0); + /* can never cancel so always true */ + MPI_Status_set_cancelled(status, 0); - /* choose not to return a value for this */ - status->MPI_SOURCE = MPI_UNDEFINED; - /* tag has no meaning for this generalized request */ - status->MPI_TAG = MPI_UNDEFINED; - /* this generalized request never fails */ - return MPI_SUCCESS; + /* choose not to return a value for this */ + status->MPI_SOURCE = MPI_UNDEFINED; + /* tag has no meaning for this generalized request */ + status->MPI_TAG = MPI_UNDEFINED; + /* this generalized request never fails */ + return MPI_SUCCESS; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c new file mode 100644 index 0000000000..9b27b42416 --- /dev/null +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.c @@ -0,0 +1,1570 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "adio.h" +#include "adio_extern.h" +#include "mpiu_greq.h" +#include "mpioimpl.h" + +#ifdef AGGREGATION_PROFILE +#include "mpe.h" +#endif + +#ifdef HAVE_MPI_GREQUEST_EXTENSIONS + +/* ADIOI_GEN_IwriteStridedColl */ +struct ADIOI_GEN_IwriteStridedColl_vars { + /* requests */ + MPI_Request req_offset[2]; /* ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL */ + MPI_Request req_ind_io; /* ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO */ + MPI_Request req_err; /* ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST */ + + /* parameters */ + ADIO_File fd; + const void *buf; + int count; + MPI_Datatype datatype; + int file_ptr_type; + ADIO_Offset offset; + + /* stack variables */ + ADIOI_Access *my_req; + /* array of nprocs access structures, one for each other process in + whose file domain this process's request lies */ + + ADIOI_Access *others_req; + /* array of nprocs access structures, one for each other process + whose request lies in this process's file domain. */ + + int nprocs; + int nprocs_for_coll; + int myrank; + int contig_access_count; + int interleave_count; + int buftype_is_contig; + int *count_my_req_per_proc; + int count_my_req_procs; + int count_others_req_procs; + ADIO_Offset start_offset; + ADIO_Offset end_offset; + ADIO_Offset orig_fp; + ADIO_Offset fd_size; + ADIO_Offset min_st_offset; + ADIO_Offset *offset_list; + ADIO_Offset *st_offsets; + ADIO_Offset *fd_start; + ADIO_Offset *fd_end; + ADIO_Offset *end_offsets; + int *buf_idx; + ADIO_Offset *len_list; + int old_error; + int tmp_error; + int error_code; +}; + +/* ADIOI_Iexch_and_write */ +struct ADIOI_Iexch_and_write_vars { + /* requests */ + MPI_Request req1; /* ADIOI_IWC_STATE_IEXCH_AND_WRITE */ + MPI_Request req3; /* ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY */ + + /* parameters */ + ADIO_File fd; + void *buf; + MPI_Datatype datatype; + int nprocs; + int myrank; + ADIOI_Access *others_req; + ADIO_Offset *offset_list; + ADIO_Offset *len_list; + int contig_access_count; + ADIO_Offset min_st_offset; + ADIO_Offset fd_size; + ADIO_Offset *fd_start; + ADIO_Offset *fd_end; + int *buf_idx; + + /* stack variables */ + /* Not convinced end_loc-st_loc couldn't be > int, so make these offsets*/ + ADIO_Offset size; + int hole; + int m; + int ntimes; + int max_ntimes; + int buftype_is_contig; + ADIO_Offset st_loc; + ADIO_Offset end_loc; + ADIO_Offset off; + ADIO_Offset done; + char *write_buf; + int *curr_offlen_ptr; + int *count; + int *send_size; + int *recv_size; + int *partial_recv; + int *sent_to_proc; + int *start_pos; + int *send_buf_idx; + int *curr_to_proc; + int *done_to_proc; + ADIOI_Flatlist_node *flat_buf; + MPI_Aint buftype_extent; + int coll_bufsize; + + /* next function to be called */ + void (*next_fn)(ADIOI_NBC_Request *, int *); +}; + +/* ADIOI_W_Iexchange_data */ +struct ADIOI_W_Iexchange_data_vars { + /* requests */ + MPI_Request req1; /* ADIOI_IWC_STATE_W_IEXCHANGE_DATA */ + MPI_Request req2; /* ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE */ + MPI_Request *req3; /* ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND */ + + /* parameters */ + ADIO_File fd; + void *buf; + char *write_buf; + ADIOI_Flatlist_node *flat_buf; + ADIO_Offset *offset_list; + ADIO_Offset *len_list; + int *send_size; + int *recv_size; + ADIO_Offset off; + int size; + int *count; + int *start_pos; + int *partial_recv; + int *sent_to_proc; + int nprocs; + int myrank; + int buftype_is_contig; + int contig_access_count; + ADIO_Offset min_st_offset; + ADIO_Offset fd_size; + ADIO_Offset *fd_start; + ADIO_Offset *fd_end; + ADIOI_Access *others_req; + int *send_buf_idx; + int *curr_to_proc; + int *done_to_proc; + int *hole; + int iter; + MPI_Aint buftype_extent; + int *buf_idx; + + /* stack variables */ + int nprocs_recv; + int nprocs_send; + int err; + char **send_buf; + MPI_Request *requests; + MPI_Request *send_req; + MPI_Datatype *recv_types; + int sum; + ADIO_Offset *srt_off; + + /* next function to be called */ + void (*next_fn)(ADIOI_NBC_Request *, int *); +}; + + +void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, + int contig_access_count, ADIO_Offset + min_st_offset, ADIO_Offset fd_size, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, + int *done_to_proc, int iter, + MPI_Aint buftype_extent); +void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, + ADIO_Offset *srt_off, int *srt_len, int *start_pos, + int nprocs, int nprocs_recv, int total_elements); + + +/* prototypes of functions used for nonblocking collective writes only. */ +static void ADIOI_GEN_IwriteStridedColl_inter(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IwriteStridedColl_indio(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IwriteStridedColl_exch(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IwriteStridedColl_bcast(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IwriteStridedColl_free(ADIOI_NBC_Request *, int *); +static void ADIOI_GEN_IwriteStridedColl_fini(ADIOI_NBC_Request *, int *); + +static void ADIOI_Iexch_and_write(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_l1_begin(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_l1_body(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_l1_end(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_reset(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_l2_begin(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_l2_end(ADIOI_NBC_Request *, int *); +static void ADIOI_Iexch_and_write_fini(ADIOI_NBC_Request *, int *); + +static void ADIOI_W_Iexchange_data(ADIOI_NBC_Request *, int *); +static void ADIOI_W_Iexchange_data_hole(ADIOI_NBC_Request *, int *); +static void ADIOI_W_Iexchange_data_send(ADIOI_NBC_Request *, int *); +static void ADIOI_W_Iexchange_data_wait(ADIOI_NBC_Request *, int *); +static void ADIOI_W_Iexchange_data_fini(ADIOI_NBC_Request *, int *); + +static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; +static int ADIOI_GEN_iwc_query_fn(void *extra_state, MPI_Status *status); +static int ADIOI_GEN_iwc_free_fn(void *extra_state); +static int ADIOI_GEN_iwc_poll_fn(void *extra_state, MPI_Status *status); +static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states, + double timeout, MPI_Status *status); + + +/* Non-blocking version of ADIOI_GEN_WriteStridedColl() */ +void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, MPI_Request *request, + int *error_code) +{ + /* Uses a generalized version of the extended two-phase method described + in "An Extended Two-Phase Method for Accessing Sections of + Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, + Scientific Programming, (5)4:301--317, Winter 1996. + http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ + + ADIOI_NBC_Request *nbc_req = NULL; + ADIOI_GEN_IwriteStridedColl_vars *vars = NULL; + int nprocs, myrank; + +#if 0 + /* FIXME: need an implementation of ADIOI_IOIstridedColl */ + if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { + /* Cast away const'ness as the below function is used for read + * and write */ + ADIOI_IOIstridedColl(fd, (char *) buf, count, ADIOI_WRITE, datatype, + file_ptr_type, offset, request, error_code); + return; + } +#endif + + /* top-level struct keeping the status of function progress */ + nbc_req = (ADIOI_NBC_Request *)ADIOI_Calloc(1, sizeof(ADIOI_NBC_Request)); + nbc_req->rdwr = ADIOI_WRITE; + + /* create a generalized request */ + if (ADIOI_GEN_greq_class == 0) { + MPIX_Grequest_class_create(ADIOI_GEN_iwc_query_fn, + ADIOI_GEN_iwc_free_fn, MPIU_Greq_cancel_fn, + ADIOI_GEN_iwc_poll_fn, ADIOI_GEN_iwc_wait_fn, + &ADIOI_GEN_greq_class); + } + MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, nbc_req, request); + memcpy(&nbc_req->req, request, sizeof(MPI_Request)); + + /* create a struct for parameters and variables */ + vars = (ADIOI_GEN_IwriteStridedColl_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_GEN_IwriteStridedColl_vars)); + nbc_req->data.wr.wsc_vars = vars; + + /* save the parameters */ + vars->fd = fd; + vars->buf = buf; + vars->count = count; + vars->datatype = datatype; + vars->file_ptr_type = file_ptr_type; + vars->offset = offset; + + MPI_Comm_size(fd->comm, &nprocs); + MPI_Comm_rank(fd->comm, &myrank); + vars->nprocs = nprocs; + vars->myrank = myrank; + + /* the number of processes that actually perform I/O, nprocs_for_coll, + * is stored in the hints off the ADIO_File structure + */ + vars->nprocs_for_coll = fd->hints->cb_nodes; + vars->orig_fp = fd->fp_ind; + + /* only check for interleaving if cb_write isn't disabled */ + if (fd->hints->cb_write != ADIOI_HINT_DISABLE) { + /* For this process's request, calculate the list of offsets and + lengths in the file and determine the start and end offsets. */ + + /* Note: end_offset points to the last byte-offset that will be accessed. + e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/ + + ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, + &vars->offset_list, &vars->len_list, + &vars->start_offset, &vars->end_offset, + &vars->contig_access_count); + + /* each process communicates its start and end offsets to other + processes. The result is an array each of start and end offsets + stored in order of process rank. */ + + vars->st_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); + vars->end_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); + + *error_code = MPI_Iallgather(&vars->start_offset, 1, ADIO_OFFSET, + vars->st_offsets, 1, ADIO_OFFSET, + fd->comm, &vars->req_offset[0]); + if (*error_code != MPI_SUCCESS) return; + *error_code = MPI_Iallgather(&vars->end_offset, 1, ADIO_OFFSET, + vars->end_offsets, 1, ADIO_OFFSET, + fd->comm, &vars->req_offset[1]); + + nbc_req->data.wr.state = ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL; + return; + } + + ADIOI_GEN_IwriteStridedColl_indio(nbc_req, error_code); +} + +static void ADIOI_GEN_IwriteStridedColl_inter(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; + int nprocs = vars->nprocs; + ADIO_Offset *st_offsets = vars->st_offsets; + ADIO_Offset *end_offsets = vars->end_offsets; + int i, interleave_count = 0; + + /* are the accesses of different processes interleaved? */ + for (i = 1; i < nprocs; i++) + if ((st_offsets[i] < end_offsets[i-1]) && + (st_offsets[i] <= end_offsets[i])) + interleave_count++; + /* This is a rudimentary check for interleaving, but should suffice + for the moment. */ + + vars->interleave_count = interleave_count; + + ADIOI_GEN_IwriteStridedColl_indio(nbc_req, error_code); +} + +static void ADIOI_GEN_IwriteStridedColl_indio(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; + ADIOI_Icalc_others_req_vars *cor_vars = NULL; + ADIO_File fd = vars->fd; + const void *buf; + int count, file_ptr_type; + MPI_Datatype datatype = vars->datatype; + ADIO_Offset offset; + int filetype_is_contig; + ADIO_Offset off; + int nprocs; + + ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); + + if (fd->hints->cb_write == ADIOI_HINT_DISABLE || + (!vars->interleave_count && (fd->hints->cb_write == ADIOI_HINT_AUTO))) + { + buf = vars->buf; + count = vars->count; + file_ptr_type = vars->file_ptr_type; + offset = vars->offset; + + /* use independent accesses */ + if (fd->hints->cb_write != ADIOI_HINT_DISABLE) { + ADIOI_Free(vars->offset_list); + ADIOI_Free(vars->len_list); + ADIOI_Free(vars->st_offsets); + ADIOI_Free(vars->end_offsets); + } + + fd->fp_ind = vars->orig_fp; + ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); + +#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) + /* NOTE: This is currently a workaround to avoid weird errors, e.g., + * stack fault, occurred on Linux. When the host OS is Linux and + * aio-lite is not used, a blocking ADIO function is used here. + * See https://trac.mpich.org/projects/mpich/ticket/2201. */ + MPI_Status status; + if (vars->buftype_is_contig && filetype_is_contig) { + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { + off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset; + ADIO_WriteContig(fd, buf, count, datatype, + ADIO_EXPLICIT_OFFSET, + off, &status, error_code); + } + else ADIO_WriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, + 0, &status, error_code); + } + else { + ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); + } + ADIOI_GEN_IwriteStridedColl_fini(nbc_req, error_code); +#else + if (vars->buftype_is_contig && filetype_is_contig) { + if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { + off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset; + ADIO_IwriteContig(fd, buf, count, datatype, + ADIO_EXPLICIT_OFFSET, + off, &vars->req_ind_io, error_code); + } + else ADIO_IwriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, + 0, &vars->req_ind_io, error_code); + } + else { + ADIO_IwriteStrided(fd, buf, count, datatype, file_ptr_type, + offset, &vars->req_ind_io, error_code); + } + + nbc_req->data.wr.state = ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO; +#endif + return; + } + + nprocs = vars->nprocs; + + /* Divide the I/O workload among "nprocs_for_coll" processes. This is + done by (logically) dividing the file into file domains (FDs); each + process may directly access only its own file domain. */ + + ADIOI_Calc_file_domains(vars->st_offsets, vars->end_offsets, nprocs, + vars->nprocs_for_coll, &vars->min_st_offset, + &vars->fd_start, &vars->fd_end, + fd->hints->min_fdomain_size, &vars->fd_size, + fd->hints->striping_unit); + + /* calculate what portions of the access requests of this process are + located in what file domains */ + + ADIOI_Calc_my_req(fd, vars->offset_list, vars->len_list, + vars->contig_access_count, vars->min_st_offset, + vars->fd_start, vars->fd_end, vars->fd_size, + nprocs, &vars->count_my_req_procs, + &vars->count_my_req_per_proc, &vars->my_req, + &vars->buf_idx); + + /* based on everyone's my_req, calculate what requests of other + processes lie in this process's file domain. + count_others_req_procs = number of processes whose requests lie in + this process's file domain (including this process itself) + count_others_req_per_proc[i] indicates how many separate contiguous + requests of proc. i lie in this process's file domain. */ + + cor_vars = (ADIOI_Icalc_others_req_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_Icalc_others_req_vars)); + nbc_req->cor_vars = cor_vars; + cor_vars->fd = vars->fd; + cor_vars->count_my_req_procs = vars->count_my_req_procs; + cor_vars->count_my_req_per_proc = vars->count_my_req_per_proc; + cor_vars->my_req = vars->my_req; + cor_vars->nprocs = vars->nprocs; + cor_vars->myrank = vars->myrank; + cor_vars->count_others_req_procs_ptr = &vars->count_others_req_procs; + cor_vars->others_req_ptr = &vars->others_req; + cor_vars->next_fn = ADIOI_GEN_IwriteStridedColl_exch; + + ADIOI_Icalc_others_req(nbc_req, error_code); +} + +static void ADIOI_GEN_IwriteStridedColl_exch(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; + ADIOI_Iexch_and_write_vars *eaw_vars = NULL; + ADIOI_Access *my_req = vars->my_req; + int nprocs = vars->nprocs; + int i; + + ADIOI_Free(vars->count_my_req_per_proc); + for (i = 0; i < nprocs; i++) { + if (my_req[i].count) { + ADIOI_Free(my_req[i].offsets); + ADIOI_Free(my_req[i].lens); + } + } + ADIOI_Free(my_req); + + /* exchange data and write in sizes of no more than coll_bufsize. */ + /* Cast away const'ness for the below function */ + eaw_vars = (ADIOI_Iexch_and_write_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_Iexch_and_write_vars)); + nbc_req->data.wr.eaw_vars = eaw_vars; + eaw_vars->fd = vars->fd; + eaw_vars->buf = (char *)vars->buf; + eaw_vars->datatype = vars->datatype; + eaw_vars->nprocs = vars->nprocs; + eaw_vars->myrank = vars->myrank; + eaw_vars->others_req = vars->others_req; + eaw_vars->offset_list = vars->offset_list; + eaw_vars->len_list = vars->len_list; + eaw_vars->contig_access_count = vars->contig_access_count; + eaw_vars->min_st_offset = vars->min_st_offset; + eaw_vars->fd_size = vars->fd_size; + eaw_vars->fd_start = vars->fd_start; + eaw_vars->fd_end = vars->fd_end; + eaw_vars->buf_idx = vars->buf_idx; + eaw_vars->next_fn = ADIOI_GEN_IwriteStridedColl_bcast; + + ADIOI_Iexch_and_write(nbc_req, error_code); +} + +static void ADIOI_GEN_IwriteStridedColl_bcast(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; + ADIO_File fd = vars->fd; + + /* If this collective write is followed by an independent write, + * it's possible to have those subsequent writes on other processes + * race ahead and sneak in before the read-modify-write completes. + * We carry out a collective communication at the end here so no one + * can start independent i/o before collective I/O completes. + * + * need to do some gymnastics with the error codes so that if something + * went wrong, all processes report error, but if a process has a more + * specific error code, we can still have that process report the + * additional information */ + + vars->old_error = *error_code; + if (*error_code != MPI_SUCCESS) *error_code = MPI_ERR_IO; + + /* optimization: if only one process performing i/o, we can perform + * a less-expensive Bcast */ +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_postwrite_a, 0, NULL ); +#endif + vars->error_code = *error_code; + if (fd->hints->cb_nodes == 1) { + *error_code = MPI_Ibcast(&vars->error_code, 1, MPI_INT, + fd->hints->ranklist[0], fd->comm, + &vars->req_err); + } else { + vars->tmp_error = *error_code; + *error_code = MPI_Iallreduce(&vars->tmp_error, &vars->error_code, 1, + MPI_INT, MPI_MAX, fd->comm, + &vars->req_err); + } + + nbc_req->data.wr.state = ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST; +} + +static void ADIOI_GEN_IwriteStridedColl_free(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; + ADIO_File fd = vars->fd; + MPI_Datatype datatype = vars->datatype; + ADIOI_Access *others_req = vars->others_req; + int nprocs = vars->nprocs; + int old_error = vars->old_error; + int i; + +#ifdef ADIOI_MPE_LOGGING + MPE_Log_event( ADIOI_MPE_postwrite_b, 0, NULL ); +#endif +#ifdef AGGREGATION_PROFILE + MPE_Log_event(5012, 0, NULL); +#endif + + if ( (old_error != MPI_SUCCESS) && (old_error != MPI_ERR_IO) ) + *error_code = old_error; + + + if (!vars->buftype_is_contig) ADIOI_Delete_flattened(datatype); + + /* free all memory allocated for collective I/O */ + for (i = 0; i < nprocs; i++) { + if (others_req[i].count) { + ADIOI_Free(others_req[i].offsets); + ADIOI_Free(others_req[i].lens); + ADIOI_Free(others_req[i].mem_ptrs); + } + } + ADIOI_Free(others_req); + + ADIOI_Free(vars->buf_idx); + ADIOI_Free(vars->offset_list); + ADIOI_Free(vars->len_list); + ADIOI_Free(vars->st_offsets); + ADIOI_Free(vars->end_offsets); + ADIOI_Free(vars->fd_start); + ADIOI_Free(vars->fd_end); + + fd->fp_sys_posn = -1; /* set it to null. */ +#ifdef AGGREGATION_PROFILE + MPE_Log_event (5013, 0, NULL); +#endif + + ADIOI_GEN_IwriteStridedColl_fini(nbc_req, error_code); +} + +static void ADIOI_GEN_IwriteStridedColl_fini(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; + MPI_Count size; + + /* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually written during collective I/O. */ + MPI_Type_size_x(vars->datatype, &size); + nbc_req->nbytes = size * vars->count; + + /* free the struct for parameters and variables */ + if (nbc_req->data.wr.wsc_vars) { + ADIOI_Free(nbc_req->data.wr.wsc_vars); + nbc_req->data.wr.wsc_vars = NULL; + } + + /* make the request complete */ + *error_code = MPI_Grequest_complete(nbc_req->req); + nbc_req->data.wr.state = ADIOI_IWC_STATE_COMPLETE; +} + + +static void ADIOI_Iexch_and_write(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + ADIO_File fd = vars->fd; + MPI_Datatype datatype = vars->datatype; + int nprocs = vars->nprocs; + ADIOI_Access *others_req = vars->others_req; + + /* Send data to appropriate processes and write in sizes of no more + than coll_bufsize. + The idea is to reduce the amount of extra memory required for + collective I/O. If all data were written all at once, which is much + easier, it would require temp space more than the size of user_buf, + which is often unacceptable. For example, to write a distributed + array to a file, where each local array is 8Mbytes, requiring + at least another 8Mbytes of temp space is unacceptable. */ + + int i, j; + ADIO_Offset st_loc = -1, end_loc = -1; + int info_flag, coll_bufsize; + char *value; + + *error_code = MPI_SUCCESS; /* changed below if error */ + /* only I/O errors are currently reported */ + + /* calculate the number of writes of size coll_bufsize + to be done by each process and the max among all processes. + That gives the no. of communication phases as well. */ + + value = (char *)ADIOI_Malloc((MPI_MAX_INFO_VAL+1) * sizeof(char)); + ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value, + &info_flag); + coll_bufsize = atoi(value); + vars->coll_bufsize = coll_bufsize; + ADIOI_Free(value); + + for (i = 0; i < nprocs; i++) { + if (others_req[i].count) { + st_loc = others_req[i].offsets[0]; + end_loc = others_req[i].offsets[0]; + break; + } + } + + for (i = 0; i < nprocs; i++) + for (j = 0; j < others_req[i].count; j++) { + st_loc = ADIOI_MIN(st_loc, others_req[i].offsets[j]); + end_loc = ADIOI_MAX(end_loc, (others_req[i].offsets[j] + + others_req[i].lens[j] - 1)); + } + + vars->st_loc = st_loc; + vars->end_loc = end_loc; + + /* ntimes=ceiling_div(end_loc - st_loc + 1, coll_bufsize)*/ + + vars->ntimes = (int)((end_loc - st_loc + coll_bufsize) / coll_bufsize); + + if ((st_loc==-1) && (end_loc==-1)) { + vars->ntimes = 0; /* this process does no writing. */ + } + + *error_code = MPI_Iallreduce(&vars->ntimes, &vars->max_ntimes, 1, MPI_INT, + MPI_MAX, fd->comm, &vars->req1); + + vars->write_buf = fd->io_buf; + + vars->curr_offlen_ptr = (int *)ADIOI_Calloc(nprocs, sizeof(int)); + /* its use is explained below. calloc initializes to 0. */ + + vars->count = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + /* to store count of how many off-len pairs per proc are satisfied + in an iteration. */ + + vars->partial_recv = (int *)ADIOI_Calloc(nprocs, sizeof(int)); + /* if only a portion of the last off-len pair is recd. from a process + in a particular iteration, the length recd. is stored here. + calloc initializes to 0. */ + + vars->send_size = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + /* total size of data to be sent to each proc. in an iteration. + Of size nprocs so that I can use MPI_Alltoall later. */ + + vars->recv_size = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + /* total size of data to be recd. from each proc. in an iteration.*/ + + vars->sent_to_proc = (int *)ADIOI_Calloc(nprocs, sizeof(int)); + /* amount of data sent to each proc so far. Used in + ADIOI_Fill_send_buffer. initialized to 0 here. */ + + vars->send_buf_idx = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + vars->curr_to_proc = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + vars->done_to_proc = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + /* Above three are used in ADIOI_Fill_send_buffer*/ + + vars->start_pos = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + /* used to store the starting value of curr_offlen_ptr[i] in + this iteration */ + + ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); + if (!vars->buftype_is_contig) { + vars->flat_buf = ADIOI_Flatten_and_find(datatype); + } + MPI_Type_extent(datatype, &vars->buftype_extent); + + + /* I need to check if there are any outstanding nonblocking writes to + the file, which could potentially interfere with the writes taking + place in this collective write call. Since this is not likely to be + common, let me do the simplest thing possible here: Each process + completes all pending nonblocking operations before completing. */ + + /*ADIOI_Complete_async(error_code); + if (*error_code != MPI_SUCCESS) return; + MPI_Barrier(fd->comm); + */ + + vars->done = 0; + vars->off = st_loc; + + /* set the state to wait until MPI_Ialltoall finishes. */ + nbc_req->data.wr.state = ADIOI_IWC_STATE_IEXCH_AND_WRITE; +} + +static void ADIOI_Iexch_and_write_l1_begin(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + int nprocs; + ADIOI_Access *others_req; + + int i, j; + ADIO_Offset off, req_off; + char *write_buf; + int *curr_offlen_ptr, *count, req_len, *recv_size; + int *partial_recv, *start_pos; + ADIO_Offset size; + static char myname[] = "ADIOI_IEXCH_AND_WRITE_L1_BEGIN"; + + ADIOI_W_Iexchange_data_vars *wed_vars = NULL; + + /* loop exit condition */ + if (vars->m >= vars->ntimes) { + ADIOI_Iexch_and_write_reset(nbc_req, error_code); + return; + } + + nprocs = vars->nprocs; + others_req = vars->others_req; + + off = vars->off; + write_buf = vars->write_buf; + curr_offlen_ptr = vars->curr_offlen_ptr; + count = vars->count; + recv_size = vars->recv_size; + partial_recv = vars->partial_recv; + start_pos = vars->start_pos; + + /* go through all others_req and check which will be satisfied + by the current write */ + + /* Note that MPI guarantees that displacements in filetypes are in + monotonically nondecreasing order and that, for writes, the + filetypes cannot specify overlapping regions in the file. This + simplifies implementation a bit compared to reads. */ + + /* off = start offset in the file for the data to be written in + this iteration + size = size of data written (bytes) corresponding to off + req_off = off in file for a particular contiguous request + minus what was satisfied in previous iteration + req_size = size corresponding to req_off */ + + /* first calculate what should be communicated */ + + for (i = 0; i < nprocs; i++) count[i] = recv_size[i] = 0; + + size = ADIOI_MIN((unsigned)vars->coll_bufsize, + vars->end_loc - vars->st_loc + 1 - vars->done); + vars->size = size; + + for (i = 0; i < nprocs; i++) { + if (others_req[i].count) { + start_pos[i] = curr_offlen_ptr[i]; + for (j = curr_offlen_ptr[i]; j < others_req[i].count; j++) { + if (partial_recv[i]) { + /* this request may have been partially + satisfied in the previous iteration. */ + req_off = others_req[i].offsets[j] + + partial_recv[i]; + req_len = others_req[i].lens[j] - + partial_recv[i]; + partial_recv[i] = 0; + /* modify the off-len pair to reflect this change */ + others_req[i].offsets[j] = req_off; + others_req[i].lens[j] = req_len; + } + else { + req_off = others_req[i].offsets[j]; + req_len = others_req[i].lens[j]; + } + if (req_off < off + size) { + count[i]++; + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIU_Upint)(write_buf+req_off-off)); + MPI_Address(write_buf + req_off - off, + &(others_req[i].mem_ptrs[j])); + ADIOI_Assert((off + size - req_off) == (int)(off + size - req_off)); + recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, + (unsigned)req_len)); + + if (off+size-req_off < (unsigned)req_len) + { + partial_recv[i] = (int)(off + size - req_off); + + /* --BEGIN ERROR HANDLING-- */ + if ((j+1 < others_req[i].count) && + (others_req[i].offsets[j+1] < off+size)) + { + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, + myname, + __LINE__, + MPI_ERR_ARG, + "Filetype specifies overlapping write regions (which is illegal according to the MPI-2 specification)", 0); + /* allow to continue since additional + * communication might have to occur + */ + } + /* --END ERROR HANDLING-- */ + break; + } + } + else break; + } + curr_offlen_ptr[i] = j; + } + } + + /* create a struct for ADIOI_W_Iexchange_data() */ + wed_vars = (ADIOI_W_Iexchange_data_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_W_Iexchange_data_vars)); + nbc_req->data.wr.wed_vars = wed_vars; + + wed_vars->fd = vars->fd; + wed_vars->buf = vars->buf; + wed_vars->write_buf = vars->write_buf; + wed_vars->flat_buf = vars->flat_buf; + wed_vars->offset_list = vars->offset_list; + wed_vars->len_list = vars->len_list; + wed_vars->send_size = vars->send_size; + wed_vars->recv_size = vars->recv_size; + wed_vars->off = vars->off; + wed_vars->size = vars->size; + wed_vars->count = vars->count; + wed_vars->start_pos = vars->start_pos; + wed_vars->partial_recv = vars->partial_recv; + wed_vars->sent_to_proc = vars->sent_to_proc; + wed_vars->nprocs = vars->nprocs; + wed_vars->myrank = vars->myrank; + wed_vars->buftype_is_contig = vars->buftype_is_contig; + wed_vars->contig_access_count = vars->contig_access_count; + wed_vars->min_st_offset = vars->min_st_offset; + wed_vars->fd_size = vars->fd_size; + wed_vars->fd_start = vars->fd_start; + wed_vars->fd_end = vars->fd_end; + wed_vars->others_req = vars->others_req; + wed_vars->send_buf_idx = vars->send_buf_idx; + wed_vars->curr_to_proc = vars->curr_to_proc; + wed_vars->done_to_proc = vars->done_to_proc; + wed_vars->hole = &vars->hole; + wed_vars->iter = vars->m; + wed_vars->buftype_extent = vars->buftype_extent; + wed_vars->buf_idx = vars->buf_idx; + wed_vars->next_fn = ADIOI_Iexch_and_write_l1_body; + + ADIOI_W_Iexchange_data(nbc_req, error_code); +} + +static void ADIOI_Iexch_and_write_l1_body(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + ADIO_File fd = vars->fd; + int nprocs = vars->nprocs; + ADIO_Offset size = vars->size; + char *write_buf = vars->write_buf; + int *count = vars->count; + int flag, i; + + flag = 0; + for (i = 0; i < nprocs; i++) + if (count[i]) flag = 1; + + if (flag) { + ADIOI_Assert(size == (int)size); +#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) + MPI_Status status; + ADIO_WriteContig(fd, write_buf, (int)size, MPI_BYTE, + ADIO_EXPLICIT_OFFSET, vars->off, &status, + error_code); +#else + ADIO_IwriteContig(fd, write_buf, (int)size, MPI_BYTE, + ADIO_EXPLICIT_OFFSET, vars->off, &vars->req3, + error_code); + + nbc_req->data.wr.state = ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY; + return; +#endif + } + + ADIOI_Iexch_and_write_l1_end(nbc_req, error_code); +} + +static void ADIOI_Iexch_and_write_l1_end(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + ADIO_Offset size = vars->size; + + vars->off += size; + vars->done += size; + + /* increment m and go back to the beginning of m loop */ + vars->m++; + ADIOI_Iexch_and_write_l1_begin(nbc_req, error_code); +} + +static void ADIOI_Iexch_and_write_reset(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + int nprocs = vars->nprocs; + int *count = vars->count; + int *recv_size = vars->recv_size; + int i; + + for (i = 0; i < nprocs; i++) count[i] = recv_size[i] = 0; + + vars->m = vars->ntimes; + ADIOI_Iexch_and_write_l2_begin(nbc_req, error_code); +} + +static void ADIOI_Iexch_and_write_l2_begin(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + ADIO_Offset size = vars->size; + ADIOI_W_Iexchange_data_vars *wed_vars = NULL; + + /* loop exit condition */ + if (vars->m >= vars->max_ntimes) { + ADIOI_Iexch_and_write_fini(nbc_req, error_code); + return; + } + + ADIOI_Assert(size == (int)size); + + /* create a struct for ADIOI_W_Iexchange_data() */ + wed_vars = (ADIOI_W_Iexchange_data_vars *)ADIOI_Calloc( + 1, sizeof(ADIOI_W_Iexchange_data_vars)); + nbc_req->data.wr.wed_vars = wed_vars; + + wed_vars->fd = vars->fd; + wed_vars->buf = vars->buf; + wed_vars->write_buf = vars->write_buf; + wed_vars->flat_buf = vars->flat_buf; + wed_vars->offset_list = vars->offset_list; + wed_vars->len_list = vars->len_list; + wed_vars->send_size = vars->send_size; + wed_vars->recv_size = vars->recv_size; + wed_vars->off = vars->off; + wed_vars->size = (int)vars->size; + wed_vars->count = vars->count; + wed_vars->start_pos = vars->start_pos; + wed_vars->partial_recv = vars->partial_recv; + wed_vars->sent_to_proc = vars->sent_to_proc; + wed_vars->nprocs = vars->nprocs; + wed_vars->myrank = vars->myrank; + wed_vars->buftype_is_contig = vars->buftype_is_contig; + wed_vars->contig_access_count = vars->contig_access_count; + wed_vars->min_st_offset = vars->min_st_offset; + wed_vars->fd_size = vars->fd_size; + wed_vars->fd_start = vars->fd_start; + wed_vars->fd_end = vars->fd_end; + wed_vars->others_req = vars->others_req; + wed_vars->send_buf_idx = vars->send_buf_idx; + wed_vars->curr_to_proc = vars->curr_to_proc; + wed_vars->done_to_proc = vars->done_to_proc; + wed_vars->hole = &vars->hole; + wed_vars->iter = vars->m; + wed_vars->buftype_extent = vars->buftype_extent; + wed_vars->buf_idx = vars->buf_idx; + wed_vars->next_fn = ADIOI_Iexch_and_write_l2_end; + + /* nothing to recv, but check for send. */ + ADIOI_W_Iexchange_data(nbc_req, error_code); +} + +static void ADIOI_Iexch_and_write_l2_end(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + + vars->m++; + ADIOI_Iexch_and_write_l2_begin(nbc_req, error_code); +} + +static void ADIOI_Iexch_and_write_fini(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; + void (*next_fn)(ADIOI_NBC_Request *, int *); + + ADIOI_Free(vars->curr_offlen_ptr); + ADIOI_Free(vars->count); + ADIOI_Free(vars->partial_recv); + ADIOI_Free(vars->send_size); + ADIOI_Free(vars->recv_size); + ADIOI_Free(vars->sent_to_proc); + ADIOI_Free(vars->start_pos); + ADIOI_Free(vars->send_buf_idx); + ADIOI_Free(vars->curr_to_proc); + ADIOI_Free(vars->done_to_proc); + + next_fn = vars->next_fn; + + /* free the struct for parameters and variables */ + ADIOI_Free(nbc_req->data.wr.eaw_vars); + nbc_req->data.wr.eaw_vars = NULL; + + /* move to the next function */ + next_fn(nbc_req, error_code); +} + + +static void ADIOI_W_Iexchange_data(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; + + /* exchange recv_size info so that each process knows how much to + send to whom. */ + + *error_code = MPI_Ialltoall(vars->recv_size, 1, MPI_INT, vars->send_size, 1, + MPI_INT, vars->fd->comm, &vars->req1); + + nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA; +} + +static void ADIOI_W_Iexchange_data_hole(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; + ADIO_File fd = vars->fd; + int *recv_size = vars->recv_size; + ADIO_Offset off = vars->off; + int size = vars->size; + int *count = vars->count; + int *start_pos = vars->start_pos; + int *partial_recv = vars->partial_recv; + int nprocs = vars->nprocs; + ADIOI_Access *others_req = vars->others_req; + int *hole = vars->hole; + + int i, j, k, *tmp_len, nprocs_recv; + MPI_Datatype *recv_types; + int *srt_len = NULL, sum; + ADIO_Offset *srt_off = NULL; + + /* create derived datatypes for recv */ + + nprocs_recv = 0; + for (i = 0; i < nprocs; i++) if (recv_size[i]) nprocs_recv++; + vars->nprocs_recv = nprocs_recv; + + recv_types = (MPI_Datatype *) + ADIOI_Malloc((nprocs_recv+1)*sizeof(MPI_Datatype)); + vars->recv_types = recv_types; + /* +1 to avoid a 0-size malloc */ + + tmp_len = (int *)ADIOI_Malloc(nprocs*sizeof(int)); + j = 0; + for (i = 0; i < nprocs; i++) { + if (recv_size[i]) { + /* take care if the last off-len pair is a partial recv */ + if (partial_recv[i]) { + k = start_pos[i] + count[i] - 1; + tmp_len[i] = others_req[i].lens[k]; + others_req[i].lens[k] = partial_recv[i]; + } + ADIOI_Type_create_hindexed_x(count[i], + &(others_req[i].lens[start_pos[i]]), + &(others_req[i].mem_ptrs[start_pos[i]]), + MPI_BYTE, recv_types+j); + /* absolute displacements; use MPI_BOTTOM in recv */ + MPI_Type_commit(recv_types+j); + j++; + } + } + + /* To avoid a read-modify-write, check if there are holes in the + data to be written. For this, merge the (sorted) offset lists + others_req using a heap-merge. */ + + sum = 0; + for (i = 0; i < nprocs; i++) sum += count[i]; + /* valgrind-detcted optimization: if there is no work on this process we do + * not need to search for holes */ + if (sum) { + srt_off = (ADIO_Offset *)ADIOI_Malloc(sum*sizeof(ADIO_Offset)); + srt_len = (int *)ADIOI_Malloc(sum*sizeof(int)); + + ADIOI_Heap_merge(others_req, count, srt_off, srt_len, start_pos, + nprocs, nprocs_recv, sum); + } + + /* for partial recvs, restore original lengths */ + for (i = 0; i < nprocs; i++) + if (partial_recv[i]) { + k = start_pos[i] + count[i] - 1; + others_req[i].lens[k] = tmp_len[i]; + } + ADIOI_Free(tmp_len); + + /* check if there are any holes. If yes, must do read-modify-write. + * holes can be in three places. 'middle' is what you'd expect: the + * processes are operating on noncontigous data. But holes can also show + * up at the beginning or end of the file domain (see John Bent ROMIO REQ + * #835). Missing these holes would result in us writing more data than + * recieved by everyone else. */ + + *hole = 0; + if (sum) { + if (off != srt_off[0]) /* hole at the front */ + *hole = 1; + else { /* coalesce the sorted offset-length pairs */ + for (i = 1; i < sum; i++) { + if (srt_off[i] <= srt_off[0] + srt_len[0]) { + /* ok to cast: operating on cb_buffer_size chunks */ + int new_len = (int)srt_off[i] + srt_len[i] - (int)srt_off[0]; + if (new_len > srt_len[0]) srt_len[0] = new_len; + } + else + break; + } + if (i < sum || size != srt_len[0]) /* hole in middle or end */ + *hole = 1; + } + + ADIOI_Free(srt_off); + ADIOI_Free(srt_len); + } + + if (nprocs_recv) { + if (*hole) { + ADIO_IreadContig(fd, vars->write_buf, size, MPI_BYTE, + ADIO_EXPLICIT_OFFSET, off, &vars->req2, + &vars->err); + nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE; + return; + } + } + + ADIOI_W_Iexchange_data_send(nbc_req, error_code); +} + +static void ADIOI_W_Iexchange_data_send(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; + ADIO_File fd = vars->fd; + void *buf = vars->buf; + int *send_size = vars->send_size; + int *recv_size = vars->recv_size; + int nprocs = vars->nprocs; + int myrank = vars->myrank; + int iter = vars->iter; + int *buf_idx = vars->buf_idx; + + int nprocs_recv = vars->nprocs_recv; + MPI_Datatype *recv_types = vars->recv_types; + + int i, j; + int nprocs_send; + char **send_buf = NULL; + + nprocs_send = 0; + for (i = 0; i < nprocs; i++) if (send_size[i]) nprocs_send++; + vars->nprocs_send = nprocs_send; + + if (fd->atomicity) { + /* bug fix from Wei-keng Liao and Kenin Coloma */ + vars->requests = (MPI_Request *) + ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request)); + vars->send_req = vars->requests; + } + else { + vars->requests = (MPI_Request *) + ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); + /* +1 to avoid a 0-size malloc */ + + /* post receives */ + j = 0; + for (i = 0; i < nprocs; i++) { + if (recv_size[i]) { + MPI_Irecv(MPI_BOTTOM, 1, recv_types[j], i, myrank+i+100*iter, + fd->comm, vars->requests+j); + j++; + } + } + vars->send_req = vars->requests + nprocs_recv; + } + + /* post sends. if buftype_is_contig, data can be directly sent from + user buf at location given by buf_idx. else use send_buf. */ + +#ifdef AGGREGATION_PROFILE + MPE_Log_event (5032, 0, NULL); +#endif + if (vars->buftype_is_contig) { + j = 0; + for (i = 0; i < nprocs; i++) + if (send_size[i]) { + MPI_Isend(((char *) buf) + buf_idx[i], send_size[i], + MPI_BYTE, i, myrank+i+100*iter, fd->comm, + vars->send_req+j); + j++; + buf_idx[i] += send_size[i]; + } + } + else if (nprocs_send) { + /* buftype is not contig */ + send_buf = (char **)ADIOI_Malloc(nprocs*sizeof(char*)); + vars->send_buf = send_buf; + for (i = 0; i < nprocs; i++) + if (send_size[i]) + send_buf[i] = (char *)ADIOI_Malloc(send_size[i]); + + ADIOI_Fill_send_buffer(fd, buf, vars->flat_buf, send_buf, + vars->offset_list, vars->len_list, send_size, + vars->send_req, + vars->sent_to_proc, nprocs, myrank, + vars->contig_access_count, + vars->min_st_offset, vars->fd_size, + vars->fd_start, vars->fd_end, + vars->send_buf_idx, vars->curr_to_proc, + vars->done_to_proc, iter, + vars->buftype_extent); + /* the send is done in ADIOI_Fill_send_buffer */ + } + + if (fd->atomicity) { + vars->req3 = (MPI_Request *) + ADIOI_Malloc((nprocs_recv+1)*sizeof(MPI_Request)); + /* +1 to avoid a 0-size malloc */ + + /* bug fix from Wei-keng Liao and Kenin Coloma */ + j = 0; + for (i = 0; i < nprocs; i++) { + if (recv_size[i]) { + MPI_Irecv(MPI_BOTTOM, 1, recv_types[j], i, myrank+i+100*iter, + fd->comm, vars->req3+j); + j++; + } + } + + nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND; + return; + } + + ADIOI_W_Iexchange_data_wait(nbc_req, error_code); +} + +static void ADIOI_W_Iexchange_data_wait(ADIOI_NBC_Request *nbc_req, + int *error_code) +{ + ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; + ADIO_File fd = vars->fd; + int nprocs_send = vars->nprocs_send; + int nprocs_recv = vars->nprocs_recv; + MPI_Datatype *recv_types = vars->recv_types; + int i; + + for (i = 0; i < nprocs_recv; i++) MPI_Type_free(recv_types+i); + ADIOI_Free(recv_types); + + i= 0; + if (fd->atomicity) { + /* bug fix from Wei-keng Liao and Kenin Coloma */ + MPI_Testall(nprocs_send, vars->send_req, &i, MPI_STATUSES_IGNORE); + } + else { + MPI_Testall(nprocs_send+nprocs_recv, vars->requests, &i, + MPI_STATUSES_IGNORE); + } + + if (i) { + ADIOI_W_Iexchange_data_fini(nbc_req, error_code); + } else { + nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT; + } +} + +static void ADIOI_W_Iexchange_data_fini(ADIOI_NBC_Request *nbc_req, int *error_code) +{ + ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; + void (*next_fn)(ADIOI_NBC_Request *, int *); + ADIO_File fd = vars->fd; + int *send_size = vars->send_size; + int nprocs = vars->nprocs; + char **send_buf = vars->send_buf; + int i; + + if (fd->atomicity) ADIOI_Free(vars->req3); + +#ifdef AGGREGATION_PROFILE + MPE_Log_event (5033, 0, NULL); +#endif + ADIOI_Free(vars->requests); + if (!vars->buftype_is_contig && vars->nprocs_send) { + for (i = 0; i < nprocs; i++) + if (send_size[i]) ADIOI_Free(send_buf[i]); + ADIOI_Free(send_buf); + } + + next_fn = vars->next_fn; + + /* free the structure for parameters and variables */ + ADIOI_Free(vars); + nbc_req->data.wr.wed_vars = NULL; + + /* move to the next function */ + next_fn(nbc_req, error_code); +} + + +static int ADIOI_GEN_iwc_query_fn(void *extra_state, MPI_Status *status) +{ + ADIOI_NBC_Request *nbc_req; + + nbc_req = (ADIOI_NBC_Request *)extra_state; + + MPI_Status_set_elements_x(status, MPI_BYTE, nbc_req->nbytes); + + /* can never cancel so always true */ + MPI_Status_set_cancelled(status, 0); + + /* choose not to return a value for this */ + status->MPI_SOURCE = MPI_UNDEFINED; + /* tag has no meaning for this generalized request */ + status->MPI_TAG = MPI_UNDEFINED; + + /* this generalized request never fails */ + return MPI_SUCCESS; +} + +static int ADIOI_GEN_iwc_free_fn(void *extra_state) +{ + ADIOI_NBC_Request *nbc_req; + + nbc_req = (ADIOI_NBC_Request *)extra_state; + ADIOI_Free(nbc_req); + + return MPI_SUCCESS; +} + +static int ADIOI_GEN_iwc_poll_fn(void *extra_state, MPI_Status *status) +{ + ADIOI_NBC_Request *nbc_req; + ADIOI_GEN_IwriteStridedColl_vars *wsc_vars = NULL; + ADIOI_Icalc_others_req_vars *cor_vars = NULL; + ADIOI_Iexch_and_write_vars *eaw_vars = NULL; + ADIOI_W_Iexchange_data_vars *wed_vars = NULL; + int errcode = MPI_SUCCESS; + int flag; + + nbc_req = (ADIOI_NBC_Request *)extra_state; + + switch (nbc_req->data.wr.state) { + case ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL: + wsc_vars = nbc_req->data.wr.wsc_vars; + errcode = MPI_Testall(2, wsc_vars->req_offset, &flag, + MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_GEN_IwriteStridedColl_inter(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO: + wsc_vars = nbc_req->data.wr.wsc_vars; + errcode = MPI_Test(&wsc_vars->req_ind_io, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + /* call the last function */ + ADIOI_GEN_IwriteStridedColl_fini(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST: + wsc_vars = nbc_req->data.wr.wsc_vars; + errcode = MPI_Test(&wsc_vars->req_err, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + errcode = wsc_vars->error_code; + ADIOI_GEN_IwriteStridedColl_free(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_ICALC_OTHERS_REQ: + cor_vars = nbc_req->cor_vars; + errcode = MPI_Test(&cor_vars->req1, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_Icalc_others_req_main(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN: + cor_vars = nbc_req->cor_vars; + if (cor_vars->num_req2) { + errcode = MPI_Testall(cor_vars->num_req2, cor_vars->req2, + &flag, MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_Icalc_others_req_fini(nbc_req, &errcode); + } + } else { + ADIOI_Icalc_others_req_fini(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_IEXCH_AND_WRITE: + eaw_vars = nbc_req->data.wr.eaw_vars; + errcode = MPI_Test(&eaw_vars->req1, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + eaw_vars->m = 0; + ADIOI_Iexch_and_write_l1_begin(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY: + eaw_vars = nbc_req->data.wr.eaw_vars; + errcode = MPI_Test(&eaw_vars->req3, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_Iexch_and_write_l1_end(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_W_IEXCHANGE_DATA: + wed_vars = nbc_req->data.wr.wed_vars; + errcode = MPI_Test(&wed_vars->req1, &flag, MPI_STATUS_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_W_Iexchange_data_hole(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE: + wed_vars = nbc_req->data.wr.wed_vars; + errcode = MPI_Test(&wed_vars->req2, &flag, MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + /* --BEGIN ERROR HANDLING-- */ + if (wed_vars->err != MPI_SUCCESS) { + errcode = MPIO_Err_create_code(wed_vars->err, + MPIR_ERR_RECOVERABLE, + "ADIOI_W_EXCHANGE_DATA", + __LINE__, MPI_ERR_IO, + "**ioRMWrdwr", 0); + break;; + } + /* --END ERROR HANDLING-- */ + ADIOI_W_Iexchange_data_send(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND: + wed_vars = nbc_req->data.wr.wed_vars; + errcode = MPI_Testall(wed_vars->nprocs_recv, wed_vars->req3, + &flag, MPI_STATUSES_IGNORE); + if (errcode == MPI_SUCCESS && flag) { + ADIOI_W_Iexchange_data_wait(nbc_req, &errcode); + } + break; + + case ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT: + wed_vars = nbc_req->data.wr.wed_vars; + if (wed_vars->fd->atomicity) { + /* bug fix from Wei-keng Liao and Kenin Coloma */ + errcode = MPI_Testall(wed_vars->nprocs_send, wed_vars->send_req, + &flag, MPI_STATUSES_IGNORE); + } else { + errcode = MPI_Testall(wed_vars->nprocs_send + + wed_vars->nprocs_recv, + wed_vars->requests, + &flag, MPI_STATUSES_IGNORE); + } + if (errcode == MPI_SUCCESS && flag) { + ADIOI_W_Iexchange_data_fini(nbc_req, &errcode); + } + break; + + default: + break; + } + + /* --BEGIN ERROR HANDLING-- */ + if (errcode != MPI_SUCCESS) { + errcode = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, + "ADIOI_GEN_iwc_poll_fn", __LINE__, + MPI_ERR_IO, "**mpi_grequest_complete", + 0); + } + /* --END ERROR HANDLING-- */ + + return errcode; +} + +/* wait for multiple requests to complete */ +static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states, + double timeout, MPI_Status *status) +{ + int i, errcode = MPI_SUCCESS; + double starttime; + ADIOI_NBC_Request **nbc_reqlist; + + nbc_reqlist = (ADIOI_NBC_Request **)array_of_states; + + starttime = MPI_Wtime(); + for (i = 0; i < count ; i++) { + while (nbc_reqlist[i]->data.wr.state != ADIOI_IWC_STATE_COMPLETE) { + errcode = ADIOI_GEN_iwc_poll_fn(nbc_reqlist[i], MPI_STATUS_IGNORE); + /* --BEGIN ERROR HANDLING-- */ + if (errcode != MPI_SUCCESS) { + errcode = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, + "ADIOI_GEN_iwc_wait_fn", + __LINE__, MPI_ERR_IO, + "**mpi_grequest_complete", 0); + } + /* --END ERROR HANDLING-- */ + + if ((timeout > 0) && (timeout < (MPI_Wtime() - starttime))) + goto fn_exit; + + /* If the progress engine is blocked, we have to yield for another + * thread to be able to unblock the progress engine. */ + MPIR_Ext_cs_yield(); + } + } + + fn_exit: + return errcode; +} + +#endif /* HAVE_MPI_GREQUEST_EXTENSIONS */ diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.pdf b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.pdf new file mode 100644 index 0000000000..8efe138a1e Binary files /dev/null and b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_coll.pdf differ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_iwrite_fake.c b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_fake.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/common/ad_iwrite_fake.c rename to ompi/mca/io/romio321/romio/adio/common/ad_iwrite_fake.c index e92e13a5b7..6210942e66 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_iwrite_fake.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_fake.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -30,7 +30,7 @@ void ADIOI_FAKE_IwriteContig(ADIO_File fd, const void *buf, int count, */ ADIOI_Assert(len == (int) len); /* the count is an int parm */ ADIO_WriteContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset, - &status, error_code); + &status, error_code); if (*error_code == MPI_SUCCESS) { MPI_Type_size_x(datatype, &typesize); nbytes = (MPI_Offset)count*(MPI_Offset)typesize; @@ -52,11 +52,11 @@ void ADIOI_FAKE_IwriteStrided(ADIO_File fd, const void *buf, int count, MPI_Count typesize; MPI_Offset nbytes=0; - /* Call the blocking function. It will create an error code + /* Call the blocking function. It will create an error code * if necessary. */ - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); + ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, + offset, &status, error_code); if (*error_code == MPI_SUCCESS) { MPI_Type_size_x(datatype, &typesize); nbytes = (MPI_Offset)count * (MPI_Offset)typesize; diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_open.c b/ompi/mca/io/romio321/romio/adio/common/ad_open.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/common/ad_open.c rename to ompi/mca/io/romio321/romio/adio/common/ad_open.c index 46da0b2d40..ced256d349 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_open.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -10,18 +10,17 @@ #include "adio_cb_config_list.h" #include "mpio.h" - static int is_aggregator(int rank, ADIO_File fd); static int uses_generic_read(ADIO_File fd); static int uses_generic_write(ADIO_File fd); -static int build_cb_config_list(ADIO_File fd, - MPI_Comm orig_comm, MPI_Comm comm, +static int build_cb_config_list(ADIO_File fd, + MPI_Comm orig_comm, MPI_Comm comm, int rank, int procs, int *error_code); MPI_File ADIO_Open(MPI_Comm orig_comm, MPI_Comm comm, const char *filename, int file_system, ADIOI_Fns *ops, - int access_mode, ADIO_Offset disp, MPI_Datatype etype, + int access_mode, ADIO_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, MPI_Info info, int perm, int *error_code) { @@ -39,6 +38,15 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, /* obtain MPI_File handle */ mpi_fh = MPIO_File_create(sizeof(struct ADIOI_FileD)); if (mpi_fh == MPI_FILE_NULL) { + fd = MPI_FILE_NULL; + *error_code = MPIO_Err_create_code(*error_code, + MPIR_ERR_RECOVERABLE, + myname, + __LINE__, + MPI_ERR_OTHER, + "**nomem2",0); + goto fn_exit; + } fd = MPIO_File_resolve(mpi_fh); @@ -71,6 +79,9 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, fd->err_handler = ADIOI_DFLT_ERR_HANDLER; + fd->io_buf_window = MPI_WIN_NULL; + fd->io_buf_put_amounts_window = MPI_WIN_NULL; + MPI_Comm_rank(comm, &rank); MPI_Comm_size(comm, &procs); /* create and initialize info object */ @@ -124,15 +135,15 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, /* Instead of repeatedly allocating this buffer in collective read/write, * allocating up-front might make memory management on small platforms * (e.g. Blue Gene) more efficent */ - fd->io_buf = ADIOI_Malloc(fd->hints->cb_buffer_size); - /* deferred open: + fd->io_buf = ADIOI_Malloc(fd->hints->cb_buffer_size); + /* deferred open: * we can only do this optimization if 'fd->hints->deferred_open' is set * (which means the user hinted 'no_indep_rw' and collective buffering). * Furthermore, we only do this if our collective read/write routines use * our generic function, and not an fs-specific routine (we can defer opens * only if we use our aggreagation code). */ - if (fd->hints->deferred_open && + if (fd->hints->deferred_open && !(uses_generic_read(fd) \ && uses_generic_write(fd))) { fd->hints->deferred_open = 0; @@ -147,15 +158,9 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, * one else does that right now */ if (fd->hints->ranklist == NULL) { build_cb_config_list(fd, orig_comm, comm, rank, procs, error_code); - if (*error_code != MPI_SUCCESS) + if (*error_code != MPI_SUCCESS) goto fn_exit; } - /* for debugging, it can be helpful to see the hints selected */ - p = getenv("ROMIO_PRINT_HINTS"); - if (rank == 0 && p != NULL ) { - ADIOI_Info_print_keyvals(fd->info); - } - fd->is_open = 0; fd->my_cb_nodes_index = -2; fd->is_agg = is_aggregator(rank, fd); @@ -171,13 +176,30 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, ADIOI_OpenColl(fd, rank, access_mode, error_code); + /* deferred open consideration: if an independent process lied about + * "no_indep_rw" and opens the file later (example: HDF5 uses independent + * i/o for metadata), that deferred open will use the access_mode provided + * by the user. CREATE|EXCL only makes sense here -- exclusive access in + * the deferred open case is going to fail and surprise the user. Turn off + * the excl amode bit. Save user's ammode for MPI_FILE_GET_AMODE */ + fd->orig_access_mode = access_mode; + if (fd->access_mode & ADIO_EXCL) fd->access_mode ^= ADIO_EXCL; + + + /* for debugging, it can be helpful to see the hints selected. Some file + * systes set up the hints in the open call (e.g. lustre) */ + p = getenv("ROMIO_PRINT_HINTS"); + if (rank == 0 && p != NULL ) { + ADIOI_Info_print_keyvals(fd->info); + } + fn_exit: MPI_Allreduce(error_code, &max_error_code, 1, MPI_INT, MPI_MAX, comm); if (max_error_code != MPI_SUCCESS) { /* If the file was successfully opened, close it */ if (*error_code == MPI_SUCCESS) { - + /* in the deferred open case, only those who have actually opened the file should close it */ if (fd->hints->deferred_open) { @@ -189,12 +211,12 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); } } - if (fd->filename) ADIOI_Free(fd->filename); - if (fd->hints->ranklist) ADIOI_Free(fd->hints->ranklist); - if (fd->hints->cb_config_list) ADIOI_Free(fd->hints->cb_config_list); - if (fd->hints) ADIOI_Free(fd->hints); + ADIOI_Free(fd->filename); + ADIOI_Free(fd->hints->ranklist); + if ( fd->hints->cb_config_list != NULL ) ADIOI_Free(fd->hints->cb_config_list); + ADIOI_Free(fd->hints); if (fd->info != MPI_INFO_NULL) MPI_Info_free(&(fd->info)); - if (fd->io_buf) ADIOI_Free(fd->io_buf); + ADIOI_Free(fd->io_buf); ADIOI_Free(fd); fd = ADIO_FILE_NULL; if (*error_code == MPI_SUCCESS) @@ -210,16 +232,16 @@ MPI_File ADIO_Open(MPI_Comm orig_comm, } /* a simple linear search. possible enancement: add a my_cb_nodes_index member - * ( index into cb_nodes, else -1 if not aggregator ) for faster lookups + * ( index into cb_nodes, else -1 if not aggregator ) for faster lookups * * fd->hints->cb_nodes is the number of aggregators * fd->hints->ranklist[] is an array of the ranks of aggregators * - * might want to move this to adio/common/cb_config_list.c + * might want to move this to adio/common/cb_config_list.c */ int is_aggregator(int rank, ADIO_File fd ) { int i; - + if (fd->my_cb_nodes_index == -2) { for (i=0; i< fd->hints->cb_nodes; i++ ) { if ( rank == fd->hints->ranklist[i] ) { @@ -253,8 +275,8 @@ static int uses_generic_write(ADIO_File fd) return 0; } -static int build_cb_config_list(ADIO_File fd, - MPI_Comm orig_comm, MPI_Comm comm, +static int build_cb_config_list(ADIO_File fd, + MPI_Comm orig_comm, MPI_Comm comm, int rank, int procs, int *error_code) { ADIO_cb_name_array array; @@ -282,7 +304,7 @@ static int build_cb_config_list(ADIO_File fd, return 0; } - rank_ct = ADIOI_cb_config_list_parse(fd->hints->cb_config_list, + rank_ct = ADIOI_cb_config_list_parse(fd->hints->cb_config_list, array, tmp_ranklist, fd->hints->cb_nodes); @@ -310,6 +332,6 @@ static int build_cb_config_list(ADIO_File fd, return 0; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_opencoll.c b/ompi/mca/io/romio321/romio/adio/common/ad_opencoll.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/common/ad_opencoll.c rename to ompi/mca/io/romio321/romio/adio/common/ad_opencoll.c index b1fd33153c..467a322a34 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_opencoll.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_opencoll.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * * Copyright (C) 2007 UChicago/Argonne LLC * See COPYRIGHT notice in top-level directory. @@ -12,16 +12,16 @@ * * optimization: by having just one process create a file, close it, * then have all N processes open it, we can possibly avoid contention - * for write locks on a directory for some file systems. + * for write locks on a directory for some file systems. * * Happy side-effect: exclusive create (error if file already exists) - * just falls out + * just falls out * * Note: this is not a "scalable open" (c.f. "The impact of file systems - * on MPI-IO scalability"). + * on MPI-IO scalability"). */ - -void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, + +void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code) { int orig_amode_excl, orig_amode_wronly; @@ -34,9 +34,9 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, /* remove delete_on_close flag if set */ if (access_mode & ADIO_DELETE_ON_CLOSE) fd->access_mode = access_mode ^ ADIO_DELETE_ON_CLOSE; - else + else fd->access_mode = access_mode; - + tmp_comm = fd->comm; fd->comm = MPI_COMM_SELF; (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); @@ -44,7 +44,7 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, MPI_Bcast(error_code, 1, MPI_INT, \ fd->hints->ranklist[0], fd->comm); /* if no error, close the file and reopen normally below */ - if (*error_code == MPI_SUCCESS) + if (*error_code == MPI_SUCCESS) (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); fd->access_mode = access_mode; /* back to original */ @@ -53,10 +53,10 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, if (*error_code != MPI_SUCCESS) { return; - } + } else { /* turn off CREAT (and EXCL if set) for real multi-processor open */ - access_mode ^= ADIO_CREATE; + access_mode ^= ADIO_CREATE; if (access_mode & ADIO_EXCL) access_mode ^= ADIO_EXCL; } @@ -85,7 +85,7 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, } } -/* For writing with data sieving, a read-modify-write is needed. If +/* For writing with data sieving, a read-modify-write is needed. If the file is opened for write_only, the read will fail. Therefore, if write_only, open the file as read_write, but record it as write_only in fd, so that get_amode returns the right answer. */ @@ -103,10 +103,10 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - /* if error, may be it was due to the change in amode above. - therefore, reopen with access mode provided by the user.*/ - fd->access_mode = orig_amode_wronly; - if (*error_code != MPI_SUCCESS) + /* if error, may be it was due to the change in amode above. + therefore, reopen with access mode provided by the user.*/ + fd->access_mode = orig_amode_wronly; + if (*error_code != MPI_SUCCESS) (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); /* if we turned off EXCL earlier, then we should turn it back on */ @@ -124,6 +124,6 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_opencoll_failsafe.c b/ompi/mca/io/romio321/romio/adio/common/ad_opencoll_failsafe.c similarity index 81% rename from ompi/mca/io/romio314/romio/adio/common/ad_opencoll_failsafe.c rename to ompi/mca/io/romio321/romio/adio/common/ad_opencoll_failsafe.c index 65c27467ea..962f191c1f 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_opencoll_failsafe.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_opencoll_failsafe.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * * Copyright (C) 2007 UChicago/Argonne LLC * See COPYRIGHT notice in top-level directory. @@ -12,9 +12,10 @@ * as NFS where a create from one client might not be immediately * visible on another */ -void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, +void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code) { + MPI_Comm tmp_comm; int orig_amode_excl, orig_amode_wronly; orig_amode_excl = access_mode; @@ -22,15 +23,23 @@ void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, /* the open should fail if the file exists. Only *1* process * should check this. Otherwise, if all processes try to check * and the file does not exist, one process will create the file - * and others who reach later will return error. */ + * and others who reach later will return error. */ if(rank == fd->hints->ranklist[0]) { fd->access_mode = access_mode; + + /* if the lower-level file system tries to communicate, COMM_SELF + * will ensure it doesn't get stuck waiting for non-existant + * participants */ + tmp_comm = fd->comm; + fd->comm = MPI_COMM_SELF; (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); MPI_Bcast(error_code, 1, MPI_INT, \ - fd->hints->ranklist[0], fd->comm); + fd->hints->ranklist[0], tmp_comm); /* if no error, close the file and reopen normally below */ if (*error_code == MPI_SUCCESS) (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); + /* and put it all back the way we found it for subsequent code */ + fd->comm = tmp_comm; } else MPI_Bcast(error_code, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); @@ -52,7 +61,7 @@ void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, return; } -/* For writing with data sieving, a read-modify-write is needed. If +/* For writing with data sieving, a read-modify-write is needed. If the file is opened for write_only, the read will fail. Therefore, if write_only, open the file as read_write, but record it as write_only in fd, so that get_amode returns the right answer. */ @@ -66,10 +75,10 @@ void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - /* if error, may be it was due to the change in amode above. - therefore, reopen with access mode provided by the user.*/ - fd->access_mode = orig_amode_wronly; - if (*error_code != MPI_SUCCESS) + /* if error, may be it was due to the change in amode above. + therefore, reopen with access mode provided by the user.*/ + fd->access_mode = orig_amode_wronly; + if (*error_code != MPI_SUCCESS) (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); if(*error_code != MPI_SUCCESS) return; @@ -83,6 +92,6 @@ void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_opencoll_scalable.c b/ompi/mca/io/romio321/romio/adio/common/ad_opencoll_scalable.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/common/ad_opencoll_scalable.c rename to ompi/mca/io/romio321/romio/adio/common/ad_opencoll_scalable.c index 97e0fb655a..1c472017f5 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_opencoll_scalable.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_opencoll_scalable.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * * Copyright (C) 2007 UChicago/Argonne LLC * See COPYRIGHT notice in top-level directory. @@ -7,24 +7,24 @@ #include "adio.h" -/* +/* * Scalable open: for file systems capable of having one process - * create/open a file and broadcast the result to everyone else. + * create/open a file and broadcast the result to everyone else. * - Does not need one process to create the file * - Does not need special handling for CREATE|EXCL */ -void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, +void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code) -{ +{ int orig_amode_wronly; /* if we are doing deferred open, non-aggregators should return now */ if (fd->hints->deferred_open && !(fd->is_agg)) { *error_code = MPI_SUCCESS; return; - } - - /* For writing with data sieving, a read-modify-write is needed. If + } + + /* For writing with data sieving, a read-modify-write is needed. If the file is opened for write_only, the read will fail. Therefore, if write_only, open the file as read_write, but record it as write_only in fd, so that get_amode returns the right answer. */ @@ -38,10 +38,10 @@ void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - /* if error, may be it was due to the change in amode above. - therefore, reopen with access mode provided by the user.*/ - fd->access_mode = orig_amode_wronly; - if (*error_code != MPI_SUCCESS) + /* if error, may be it was due to the change in amode above. + therefore, reopen with access mode provided by the user.*/ + fd->access_mode = orig_amode_wronly; + if (*error_code != MPI_SUCCESS) (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); /* for deferred open: this process has opened the file (because if we are @@ -50,6 +50,6 @@ void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_prealloc.c b/ompi/mca/io/romio321/romio/adio/common/ad_prealloc.c similarity index 83% rename from ompi/mca/io/romio314/romio/adio/common/ad_prealloc.c rename to ompi/mca/io/romio321/romio/adio/common/ad_prealloc.c index 557cff4434..9462f775aa 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_prealloc.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_prealloc.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -13,7 +13,7 @@ * This naive approach will get the job done, but not in a terribly efficient * manner. */ -void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code) +void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code) { ADIO_Offset curr_fsize, alloc_size, size, len, done, ntimes; ADIO_Status status; @@ -23,11 +23,11 @@ void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code) static char myname[] = "ADIOI_GEN_PREALLOC"; /* will be called by one process only */ - /* On file systems with no preallocation function, we have to - explicitly write - to allocate space. Since there could be holes in the file, - we need to read up to the current file size, write it back, - and then write beyond that depending on how much + /* On file systems with no preallocation function, we have to + explicitly write + to allocate space. Since there could be holes in the file, + we need to read up to the current file size, write it back, + and then write beyond that depending on how much preallocation is needed. read/write in sizes of no more than ADIOI_PREALLOC_BUFSZ */ @@ -40,14 +40,14 @@ void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code) alloc_size = diskspace; size = ADIOI_MIN(curr_fsize, alloc_size); - + ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ; buf = (char *) ADIOI_Malloc(ADIOI_PREALLOC_BUFSZ); done = 0; for (i=0; i curr_fsize) { - memset(buf, 0, ADIOI_PREALLOC_BUFSZ); + memset(buf, 0, ADIOI_PREALLOC_BUFSZ); size = alloc_size - curr_fsize; ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ; for (i=0; i -#include "adio.h" #ifdef AGGREGATION_PROFILE #include "mpe.h" #endif @@ -20,7 +20,7 @@ #include #endif -void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code) @@ -96,7 +96,7 @@ void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, fd->fp_sys_posn = offset + bytes_xfered; if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += bytes_xfered; + fd->fp_ind += bytes_xfered; } #ifdef HAVE_STATUS_SET_BYTES diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c rename to ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c index ea76f452af..11e657b7e3 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_read_coll.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -20,7 +20,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype datatype, int nprocs, int myrank, ADIOI_Access *others_req, ADIO_Offset *offset_list, - ADIO_Offset *len_list, int contig_access_count, + ADIO_Offset *len_list, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end, @@ -28,26 +28,26 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node *flat_buf, ADIO_Offset *offset_list, ADIO_Offset *len_list, int *send_size, int *recv_size, - int *count, int *start_pos, - int *partial_send, - int *recd_from_proc, int nprocs, + int *count, int *start_pos, + int *partial_send, + int *recd_from_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, - ADIO_Offset min_st_offset, + ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - ADIOI_Access *others_req, - int iter, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + ADIOI_Access *others_req, + int iter, MPI_Aint buftype_extent, int *buf_idx); -static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **recv_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, - unsigned *recv_size, +void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node + *flat_buf, char **recv_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, + unsigned *recv_size, MPI_Request *requests, MPI_Status *statuses, int *recd_from_proc, int nprocs, - int contig_access_count, - ADIO_Offset min_st_offset, - ADIO_Offset fd_size, ADIO_Offset *fd_start, + int contig_access_count, + ADIO_Offset min_st_offset, + ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end, MPI_Aint buftype_extent); @@ -58,15 +58,15 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, *error_code) { /* Uses a generalized version of the extended two-phase method described - in "An Extended Two-Phase Method for Accessing Sections of + in "An Extended Two-Phase Method for Accessing Sections of Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, - Scientific Programming, (5)4:301--317, Winter 1996. + Scientific Programming, (5)4:301--317, Winter 1996. http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ - ADIOI_Access *my_req; + ADIOI_Access *my_req; /* array of nprocs structures, one for each other process in whose file domain this process's request lies */ - + ADIOI_Access *others_req; /* array of nprocs structures, one for each other process whose request lies in this process's file domain. */ @@ -85,7 +85,7 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, #endif if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { - ADIOI_IOStridedColl (fd, buf, count, ADIOI_READ, datatype, + ADIOI_IOStridedColl (fd, buf, count, ADIOI_READ, datatype, file_ptr_type, offset, status, error_code); return; } @@ -108,19 +108,19 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, &offset_list, &len_list, &start_offset, - &end_offset, &contig_access_count); - + &end_offset, &contig_access_count); + #ifdef RDCOLL_DEBUG for (i=0; ihints->cb_read == ADIOI_HINT_DISABLE - || (!interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO))) + || (!interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO))) { /* don't do aggregation */ if (fd->hints->cb_read != ADIOI_HINT_DISABLE) { @@ -187,11 +187,11 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, */ ADIOI_Calc_file_domains(st_offsets, end_offsets, nprocs, nprocs_for_coll, &min_st_offset, - &fd_start, &fd_end, + &fd_start, &fd_end, fd->hints->min_fdomain_size, &fd_size, fd->hints->striping_unit); - /* calculate where the portions of the access requests of this process + /* calculate where the portions of the access requests of this process * are located in terms of the file domains. this could be on the same * process or on other processes. this function fills in: * count_my_req_procs - number of processes (including this one) for which @@ -205,7 +205,7 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, */ ADIOI_Calc_my_req(fd, offset_list, len_list, contig_access_count, min_st_offset, fd_start, fd_end, fd_size, - nprocs, &count_my_req_procs, + nprocs, &count_my_req_procs, &count_my_req_per_proc, &my_req, &buf_idx); @@ -216,13 +216,13 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, * count_others_req_per_proc[] - number of separate contiguous * requests from proc i lie in this process's file domain. */ - ADIOI_Calc_others_req(fd, count_my_req_procs, - count_my_req_per_proc, my_req, - nprocs, myrank, &count_others_req_procs, - &others_req); + ADIOI_Calc_others_req(fd, count_my_req_procs, + count_my_req_per_proc, my_req, + nprocs, myrank, &count_others_req_procs, + &others_req); - /* my_req[] and count_my_req_per_proc aren't needed at this point, so - * let's free the memory + /* my_req[] and count_my_req_per_proc aren't needed at this point, so + * let's free the memory */ ADIOI_Free(count_my_req_per_proc); for (i=0; ifp_ind : + offset_list[0] = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + (ADIO_Offset)etype_size * offset; len_list[0] = 0; *start_offset_ptr = offset_list[0]; *end_offset_ptr = offset_list[0] + len_list[0] - 1; - + return; } if (filetype_is_contig) { - *contig_access_count_ptr = 1; + *contig_access_count_ptr = 1; *offset_list_ptr = (ADIO_Offset *) ADIOI_Malloc(2*sizeof(ADIO_Offset)); *len_list_ptr = (ADIO_Offset *) ADIOI_Malloc(2*sizeof(ADIO_Offset)); /* 2 is for consistency. everywhere I malloc one more than needed */ offset_list = *offset_list_ptr; len_list = *len_list_ptr; - offset_list[0] = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + offset_list[0] = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + (ADIO_Offset)etype_size * offset; len_list[0] = (ADIO_Offset)bufcount * (ADIO_Offset)buftype_size; *start_offset_ptr = offset_list[0]; @@ -349,13 +349,13 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype else { /* First calculate what size of offset_list and len_list to allocate */ - + /* filetype already flattened in ADIO_Open or ADIO_Fcntl */ flat_file = ADIOI_Flatlist; while (flat_file->type != fd->filetype) flat_file = flat_file->next; disp = fd->disp; -#ifdef RDCOLL_DEBUG +#ifdef RDCOLL_DEBUG { int ii; DBG_FPRINTF(stderr, "flattened %3lld : ", flat_file->count ); @@ -371,7 +371,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype n_filetypes = (offset - flat_file->indices[0]) / filetype_extent; offset -= (ADIO_Offset)n_filetypes * filetype_extent; /* now offset is local to this extent */ - + /* find the block where offset is located, skip blocklens[i]==0 */ for (i=0; icount; i++) { ADIO_Offset dist; @@ -397,7 +397,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -411,7 +411,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype } /* abs. offset in bytes in the file */ - offset = disp + n_filetypes* (ADIO_Offset)filetype_extent + + offset = disp + n_filetypes* (ADIO_Offset)filetype_extent + abs_off_in_filetype; } @@ -432,7 +432,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype /* allocate space for offset_list and len_list */ *offset_list_ptr = (ADIO_Offset *) - ADIOI_Malloc((contig_access_count+1)*sizeof(ADIO_Offset)); + ADIOI_Malloc((contig_access_count+1)*sizeof(ADIO_Offset)); *len_list_ptr = (ADIO_Offset *) ADIOI_Malloc((contig_access_count+1)*sizeof(ADIO_Offset)); /* +1 to avoid a 0-size malloc */ @@ -460,12 +460,12 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/ if (off + frd_size < disp + flat_file->indices[j] + - flat_file->blocklens[j] + + flat_file->blocklens[j] + n_filetypes* (ADIO_Offset)filetype_extent) { off += frd_size; /* did not reach end of contiguous block in filetype. - * no more I/O needed. off is incremented by frd_size. + * no more I/O needed. off is incremented by frd_size. */ } else { @@ -474,10 +474,10 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype while (flat_file->blocklens[j]==0) { j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; - /* hit end of flattened filetype; start at beginning + /* hit end of flattened filetype; start at beginning * again */ } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes* (ADIO_Offset)filetype_extent; frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); } @@ -504,7 +504,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype int *buf_idx, int *error_code) { /* Read in sizes of no more than coll_bufsize, an info parameter. - Send data to appropriate processes. + Send data to appropriate processes. Place recd. data in user buf. The idea is to reduce the amount of extra memory required for collective I/O. If all data were read all at once, which is much @@ -528,7 +528,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype *error_code = MPI_SUCCESS; /* changed below if error */ /* only I/O errors are currently reported */ - + /* calculate the number of reads of size coll_bufsize to be done by each process and the max among all processes. That gives the no. of communication phases as well. @@ -567,11 +567,11 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype ntimes = (int) ((end_loc - st_loc + coll_bufsize)/coll_bufsize); } - MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX, fd->comm); + MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX, fd->comm); read_buf = fd->io_buf; /* Allocated at open time */ - curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); + curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); /* its use is explained below. calloc initializes to 0. */ count = (int *) ADIOI_Malloc(nprocs * sizeof(int)); @@ -579,7 +579,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype in an iteration. */ partial_send = (int *) ADIOI_Calloc(nprocs, sizeof(int)); - /* if only a portion of the last off-len pair is sent to a process + /* if only a portion of the last off-len pair is sent to a process in a particular iteration, the length sent is stored here. calloc initializes to 0. */ @@ -595,14 +595,12 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype ADIOI_Fill_user_buffer. initialized to 0 here. */ start_pos = (int *) ADIOI_Malloc(nprocs*sizeof(int)); - /* used to store the starting value of curr_offlen_ptr[i] in + /* used to store the starting value of curr_offlen_ptr[i] in this iteration */ ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); if (!buftype_is_contig) { - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); } MPI_Type_get_extent(datatype, &lb, &buftype_extent); @@ -617,9 +615,9 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype /* go through all others_req and check if any are satisfied by the current read */ - /* since MPI guarantees that displacements in filetypes are in + /* since MPI guarantees that displacements in filetypes are in monotonically nondecreasing order, I can maintain a pointer - (curr_offlen_ptr) to + (curr_offlen_ptr) to current off-len pair for each process in others_req and scan further only from there. There is still a problem of filetypes such as: (1, 2, 3 are not process nos. They are just numbers for @@ -629,7 +627,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype 2 -----!---- 3 --!----- - where ! indicates where the current read_size limitation cuts + where ! indicates where the current read_size limitation cuts through the filetype. I resolve this by reading up to !, but filling the communication buffer only for 1. I copy the portion left over for 2 into a tmp_buf for use in the next @@ -638,19 +636,19 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype other end, as only one off-len pair with incomplete data will be sent. I also don't need to send the individual offsets and lens along with the data, as the data is being - sent in a particular order. */ + sent in a particular order. */ - /* off = start offset in the file for the data actually read in - this iteration + /* off = start offset in the file for the data actually read in + this iteration size = size of data read corresponding to off real_off = off minus whatever data was retained in memory from previous iteration for cases like 2, 3 illustrated above real_size = size plus the extra corresponding to real_off - req_off = off in file for a particular contiguous request + req_off = off in file for a particular contiguous request minus what was satisfied in previous iteration req_size = size corresponding to req_off */ - size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); + size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); real_off = off - for_curr_iter; real_size = size + for_curr_iter; @@ -659,7 +657,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype for (i=0; iio_buf); @@ -751,16 +749,16 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype } for (i=0; icomm, requests+j); j++; buf_idx[i] += recv_size[i]; @@ -824,24 +822,21 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node else { /* allocate memory for recv_buf and post receives */ recv_buf = (char **) ADIOI_Malloc(nprocs * sizeof(char*)); - for (i=0; i < nprocs; i++) { - if (recv_size[i]) { - recv_buf[i] = (char *) ADIOI_Malloc(recv_size[i]); - } - } + for (i=0; i < nprocs; i++) + if (recv_size[i]) recv_buf[i] = + (char *) ADIOI_Malloc(recv_size[i]); - j = 0; - for (i=0; i < nprocs; i++) { - if (recv_size[i]) { - MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, - myrank+i+100*iter, fd->comm, requests+j); - j++; + j = 0; + for (i=0; i < nprocs; i++) + if (recv_size[i]) { + MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, + myrank+i+100*iter, fd->comm, requests+j); + j++; #ifdef RDCOLL_DEBUG - DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", - myrank, recv_size[i], myrank+i+100*iter); + DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", + myrank, recv_size[i], myrank+i+100*iter); #endif - } - } + } } /* create derived datatypes and send data */ @@ -857,7 +852,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node } ADIOI_Type_create_hindexed_x(count[i], &(others_req[i].lens[start_pos[i]]), - &(others_req[i].mem_ptrs[start_pos[i]]), + &(others_req[i].mem_ptrs[start_pos[i]]), MPI_BYTE, &send_type); /* absolute displacement; use MPI_BOTTOM in send */ MPI_Type_commit(&send_type); @@ -870,7 +865,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node } statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+nprocs_recv+1) * \ - sizeof(MPI_Status)); + sizeof(MPI_Status)); /* +1 to avoid a 0-size malloc */ /* wait on the receives */ @@ -883,10 +878,10 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node #endif /* if noncontiguous, to the copies from the recv buffers */ - if (!buftype_is_contig) + if (!buftype_is_contig) ADIOI_Fill_user_buffer(fd, buf, flat_buf, recv_buf, - offset_list, len_list, (unsigned*)recv_size, - requests, statuses, recd_from_proc, + offset_list, len_list, (unsigned*)recv_size, + requests, statuses, recd_from_proc, nprocs, contig_access_count, min_st_offset, fd_size, fd_start, fd_end, buftype_extent); @@ -899,7 +894,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node ADIOI_Free(requests); if (!buftype_is_contig) { - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (recv_size[i]) ADIOI_Free(recv_buf[i]); ADIOI_Free(recv_buf); } @@ -933,7 +928,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node { \ while (size) { \ size_in_buf = ADIOI_MIN(size, flat_buf_sz); \ - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + user_buf_idx)); \ + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + user_buf_idx)); \ ADIOI_Assert(size_in_buf == (size_t)size_in_buf); \ memcpy(((char *) buf) + user_buf_idx, \ &(recv_buf[p][recv_buf_idx[p]]), size_in_buf); \ @@ -956,15 +951,15 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node ADIOI_BUF_INCR \ } -static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **recv_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, - unsigned *recv_size, +void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node + *flat_buf, char **recv_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, + unsigned *recv_size, MPI_Request *requests, MPI_Status *statuses, int *recd_from_proc, int nprocs, - int contig_access_count, - ADIO_Offset min_st_offset, - ADIO_Offset fd_size, ADIO_Offset *fd_start, + int contig_access_count, + ADIO_Offset min_st_offset, + ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end, MPI_Aint buftype_extent) { @@ -983,9 +978,9 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node /* curr_from_proc[p] = amount of data recd from proc. p that has already been accounted for so far - done_from_proc[p] = amount of data already recd from proc. p and + done_from_proc[p] = amount of data already recd from proc. p and filled into user buffer in previous iterations - user_buf_idx = current location in user buffer + user_buf_idx = current location in user buffer recv_buf_idx[p] = current location in recv_buf of proc. p */ curr_from_proc = (unsigned *) ADIOI_Malloc(nprocs * sizeof(unsigned)); done_from_proc = (unsigned *) ADIOI_Malloc(nprocs * sizeof(unsigned)); @@ -1002,10 +997,10 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node flat_buf_sz = flat_buf->blocklens[0]; /* flat_buf_idx = current index into flattened buftype - flat_buf_sz = size of current contiguous component in + flat_buf_sz = size of current contiguous component in flattened buf */ - for (i=0; i done_from_proc[p]) { if (done_from_proc[p] > curr_from_proc[p]) { - size = ADIOI_MIN(curr_from_proc[p] + len - + size = ADIOI_MIN(curr_from_proc[p] + len - done_from_proc[p], recv_size[p]-recv_buf_idx[p]); buf_incr = done_from_proc[p] - curr_from_proc[p]; ADIOI_BUF_INCR @@ -1059,7 +1054,7 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node rem_len -= len; } } - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (recv_size[i]) recd_from_proc[i] = curr_from_proc[i]; ADIOI_Free(curr_from_proc); diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_read_str.c b/ompi/mca/io/romio321/romio/adio/common/ad_read_str.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/common/ad_read_str.c rename to ompi/mca/io/romio321/romio/adio/common/ad_read_str.c index bad948a3cb..b3be3feb62 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_read_str.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_read_str.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -56,7 +56,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, ADIO_Offset n_filetypes, etype_in_filetype, st_n_filetypes, size_in_filetype; ADIO_Offset abs_off_in_filetype=0, new_frd_size, frd_size=0, st_frd_size; MPI_Count filetype_size, etype_size, buftype_size, partial_read; - MPI_Aint filetype_extent, buftype_extent, lb; + MPI_Aint filetype_extent, buftype_extent, lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off, req_len, sum; ADIO_Offset off, req_off, disp, end_offset=0, readbuf_off, start_off; @@ -69,7 +69,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, /* if user has disabled data sieving on reads, use naive * approach instead. */ - ADIOI_GEN_ReadStrided_naive(fd, + ADIOI_GEN_ReadStrided_naive(fd, buf, count, datatype, @@ -90,7 +90,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -105,7 +105,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, /* get max_bufsize from the info object. */ value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "ind_rd_buffer_size", MPI_MAX_INFO_VAL, value, + ADIOI_Info_get(fd->info, "ind_rd_buffer_size", MPI_MAX_INFO_VAL, value, &info_flag); max_bufsize = atoi(value); ADIOI_Free(value); @@ -115,11 +115,9 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + (ADIO_Offset)etype_size * offset; start_off = off; @@ -132,11 +130,11 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - ADIO_ReadContig(fd, readbuf, readbuf_len, MPI_BYTE, + ADIO_ReadContig(fd, readbuf, readbuf_len, MPI_BYTE, ADIO_EXPLICIT_OFFSET, readbuf_off, &status1, error_code); if (*error_code != MPI_SUCCESS) return; - for (j=0; jcount; i++) { userbuf_off = (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]; @@ -152,7 +150,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - ADIOI_Free(readbuf); + ADIOI_Free(readbuf); } else { /* noncontiguous in file */ @@ -194,7 +192,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -208,7 +206,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, } /* abs. offset in bytes in the file */ - offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + + offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype; } @@ -223,7 +221,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, offset, status, error_code); if (file_ptr_type == ADIO_INDIVIDUAL) { - /* update MPI-IO file pointer to point to the first byte that + /* update MPI-IO file pointer to point to the first byte that * can be accessed in the fileview. */ fd->fp_ind = offset + bufsize; if (bufsize == frd_size) { @@ -238,10 +236,10 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, + n_filetypes*filetype_extent; } } - fd->fp_sys_posn = -1; /* set it to null. */ + fd->fp_sys_posn = -1; /* set it to null. */ #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -#endif +#endif return; } @@ -287,9 +285,9 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, n_filetypes = st_n_filetypes; frd_size = ADIOI_MIN(st_frd_size, bufsize); while (i_offset < bufsize) { - if (frd_size) { - /* TYPE_UB and TYPE_LB can result in - frd_size = 0. save system call in such cases */ + if (frd_size) { + /* TYPE_UB and TYPE_LB can result in + frd_size = 0. save system call in such cases */ /* lseek(fd->fd_sys, off, SEEK_SET); err = read(fd->fd_sys, ((char *) buf) + i, frd_size);*/ @@ -312,7 +310,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); } @@ -321,9 +319,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; i_offset = flat_buf->indices[0]; @@ -356,7 +352,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; new_frd_size = flat_file->blocklens[j]; @@ -385,7 +381,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, brd_size = new_brd_size; } } - + if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); @@ -398,8 +394,8 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually read and placed in buf +/* This is a temporary way of filling in status. The right way is to + keep track of how much data was actually read and placed in buf by ADIOI_BUFFERED_READ. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c b/ompi/mca/io/romio321/romio/adio/common/ad_read_str_naive.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c rename to ompi/mca/io/romio321/romio/adio/common/ad_read_str_naive.c index cb574897e7..a65eede955 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_read_str_naive.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_read_str_naive.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,7 +23,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, ADIO_Offset abs_off_in_filetype=0; MPI_Count bufsize, filetype_size, buftype_size, size_in_filetype; ADIO_Offset etype_size; - MPI_Aint filetype_extent, buftype_extent, lb; + MPI_Aint filetype_extent, buftype_extent, lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off; ADIO_Offset off, req_off, disp, end_offset=0, start_off; @@ -39,7 +39,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, buftype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -57,11 +57,9 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, int b_count; /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(buftype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != buftype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(buftype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + etype_size * offset; start_off = off; @@ -78,17 +76,17 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, */ for (b_count=0; b_count < count; b_count++) { for (b_index=0; b_index < flat_buf->count; b_index++) { - userbuf_off = (ADIO_Offset)b_count*(ADIO_Offset)buftype_extent + + userbuf_off = (ADIO_Offset)b_count*(ADIO_Offset)buftype_extent + flat_buf->indices[b_index]; req_off = off; req_len = flat_buf->blocklens[b_index]; - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + userbuf_off)); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); ADIOI_Assert(req_len == (int) req_len); - ADIO_ReadContig(fd, + ADIO_ReadContig(fd, (char *) buf + userbuf_off, - req_len, - MPI_BYTE, + req_len, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, req_off, &status1, @@ -110,7 +108,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, } else { /* noncontiguous in file */ - int f_index, st_index = 0; + int f_index, st_index = 0; ADIO_Offset st_n_filetypes; ADIO_Offset st_frd_size; int flag; @@ -141,15 +139,15 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, while (!flag) { n_filetypes++; for (f_index=0; f_index < flat_file->count; f_index++) { - if (disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + - flat_file->blocklens[f_index] >= start_off) + if (disp + flat_file->indices[f_index] + + n_filetypes*(ADIO_Offset)filetype_extent + + flat_file->blocklens[f_index] >= start_off) { /* this block contains our starting position */ st_index = f_index; - frd_size = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + + frd_size = disp + flat_file->indices[f_index] + + n_filetypes*(ADIO_Offset)filetype_extent + flat_file->blocklens[f_index] - start_off; flag = 1; break; @@ -162,7 +160,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = (int) (offset % n_etypes_in_filetype); size_in_filetype = (unsigned)etype_in_filetype * (unsigned)etype_size; - + sum = 0; for (f_index=0; f_index < flat_file->count; f_index++) { sum += flat_file->blocklens[f_index]; @@ -170,21 +168,21 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, st_index = f_index; frd_size = sum - size_in_filetype; abs_off_in_filetype = flat_file->indices[f_index] + - size_in_filetype - + size_in_filetype - (sum - flat_file->blocklens[f_index]); break; } } /* abs. offset in bytes in the file */ - start_off = disp + n_filetypes*(ADIO_Offset)filetype_extent + + start_off = disp + n_filetypes*(ADIO_Offset)filetype_extent + abs_off_in_filetype; } st_frd_size = frd_size; st_n_filetypes = n_filetypes; - /* start_off, st_n_filetypes, st_index, and st_frd_size are + /* start_off, st_n_filetypes, st_index, and st_frd_size are * all calculated at this point */ @@ -205,9 +203,9 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[f_index] + + off = disp + flat_file->indices[f_index] + n_filetypes*(ADIO_Offset)filetype_extent; - frd_size = ADIOI_MIN(flat_file->blocklens[f_index], + frd_size = ADIOI_MIN(flat_file->blocklens[f_index], bufsize-(unsigned)userbuf_off); } @@ -239,18 +237,18 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, /* while there is still space in the buffer, read more data */ while (userbuf_off < bufsize) { - if (frd_size) { - /* TYPE_UB and TYPE_LB can result in - frd_size = 0. save system call in such cases */ + if (frd_size) { + /* TYPE_UB and TYPE_LB can result in + frd_size = 0. save system call in such cases */ req_off = off; req_len = frd_size; - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + userbuf_off)); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); ADIOI_Assert(req_len == (int) req_len); - ADIO_ReadContig(fd, + ADIO_ReadContig(fd, (char *) buf + userbuf_off, - req_len, - MPI_BYTE, + req_len, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, req_off, &status1, @@ -260,7 +258,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, userbuf_off += frd_size; if (off + frd_size < disp + flat_file->indices[f_index] + - flat_file->blocklens[f_index] + + flat_file->blocklens[f_index] + n_filetypes*(ADIO_Offset)filetype_extent) { /* important that this value be correct, as it is @@ -278,9 +276,9 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, f_index = 0; n_filetypes++; } - off = disp + flat_file->indices[f_index] + + off = disp + flat_file->indices[f_index] + n_filetypes*(ADIO_Offset)filetype_extent; - frd_size = ADIOI_MIN(flat_file->blocklens[f_index], + frd_size = ADIOI_MIN(flat_file->blocklens[f_index], bufsize-(unsigned)userbuf_off); } } @@ -289,9 +287,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, ADIO_Offset i_offset, tmp_bufsize = 0; /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(buftype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != buftype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(buftype); b_index = buf_count = 0; i_offset = flat_buf->indices[0]; @@ -311,12 +307,12 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, req_len = size; userbuf_off = i_offset; - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + userbuf_off)); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); ADIOI_Assert(req_len == (int) req_len); - ADIO_ReadContig(fd, + ADIO_ReadContig(fd, (char *) buf + userbuf_off, - req_len, - MPI_BYTE, + req_len, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, req_off, &status1, @@ -332,7 +328,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[f_index] + + off = disp + flat_file->indices[f_index] + n_filetypes*(ADIO_Offset)filetype_extent; new_frd_size = flat_file->blocklens[f_index]; @@ -362,7 +358,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, } /* unlock the file region if we locked it */ - if ((fd->atomicity) && (fd->file_system != ADIO_PIOFS) && + if ((fd->atomicity) && (fd->file_system != ADIO_PIOFS) && (fd->file_system != ADIO_PVFS) && (fd->file_system != ADIO_PVFS2)) { ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); @@ -375,8 +371,8 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, buftype, bufsize); - /* This is a temporary way of filling in status. The right way is to - * keep track of how much data was actually read and placed in buf + /* This is a temporary way of filling in status. The right way is to + * keep track of how much data was actually read and placed in buf */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_resize.c b/ompi/mca/io/romio321/romio/adio/common/ad_resize.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/common/ad_resize.c rename to ompi/mca/io/romio321/romio/adio/common/ad_resize.c index 0f166cbc2f..a6be2c1760 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_resize.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_resize.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -20,7 +20,7 @@ void ADIOI_GEN_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) /* first aggregator performs ftruncate() */ if (rank == fd->hints->ranklist[0]) { - ADIOI_Assert(size == (off_t) size); + ADIOI_Assert(size == (off_t) size); err = ftruncate(fd->fd_sys, (off_t)size); } diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_seek.c b/ompi/mca/io/romio321/romio/adio/common/ad_seek.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/common/ad_seek.c rename to ompi/mca/io/romio321/romio/adio/common/ad_seek.c index 9a992ddc14..2d6f75fd54 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_seek.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_seek.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -11,11 +11,11 @@ #include #endif -ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, +ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, int whence, int *error_code) { /* implemented for whence=SEEK_SET only. SEEK_CUR and SEEK_END must - be converted to the equivalent with SEEK_SET before calling this + be converted to the equivalent with SEEK_SET before calling this routine. */ /* offset is in units of etype relative to the filetype */ @@ -46,7 +46,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, /* Since offset relative to the filetype size, we can't do compute the offset when that result is zero. Return zero for the offset for now */ - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return 0; } @@ -54,7 +54,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -73,7 +73,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, /* * we used to call lseek here and update both fp_ind and fp_sys_posn, but now * we don't seek and only update fp_ind (ROMIO's idea of where we are in the - * file). We leave the system file descriptor and fp_sys_posn alone. + * file). We leave the system file descriptor and fp_sys_posn alone. * The fs-specifc ReadContig and WriteContig will seek to the correct place in * the file before reading/writing if the 'offset' parameter doesn't match * fp_sys_posn diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_set_sh_fp.c b/ompi/mca/io/romio321/romio/adio/common/ad_set_sh_fp.c similarity index 81% rename from ompi/mca/io/romio314/romio/adio/common/ad_set_sh_fp.c rename to ompi/mca/io/romio321/romio/adio/common/ad_set_sh_fp.c index b936d20551..c55f2efe5a 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_set_sh_fp.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_set_sh_fp.c @@ -1,12 +1,12 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" -/* set the shared file pointer to "offset" etypes relative to the current +/* set the shared file pointer to "offset" etypes relative to the current view */ void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code); @@ -25,20 +25,20 @@ void ADIO_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code) if (fd->shared_fp_fd == ADIO_FILE_NULL) { MPI_Comm_dup(MPI_COMM_SELF, &dupcommself); - fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself, - fd->shared_fp_fname, + fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself, + fd->shared_fp_fname, fd->file_system, fd->fns, - ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, + ADIO_CREATE | ADIO_RDWR | ADIO_DELETE_ON_CLOSE, 0, MPI_BYTE, MPI_BYTE, - MPI_INFO_NULL, + MPI_INFO_NULL, ADIO_PERM_NULL, error_code); } if (*error_code != MPI_SUCCESS) return; ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); - ADIO_WriteContig(fd->shared_fp_fd, &offset, sizeof(ADIO_Offset), + ADIO_WriteContig(fd->shared_fp_fd, &offset, sizeof(ADIO_Offset), MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); } diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_set_view.c b/ompi/mca/io/romio321/romio/adio/common/ad_set_view.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/common/ad_set_view.c rename to ompi/mca/io/romio321/romio/adio/common/ad_set_view.c index 86e007c5c0..18becf269a 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_set_view.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_set_view.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -12,13 +12,13 @@ * deferred open easier if we know ADIO_Fcntl will always need a file to really * be open. set_view doesn't modify anything related to the open files. */ -void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, MPI_Info info, int *error_code) +void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, + MPI_Datatype filetype, MPI_Info info, int *error_code) { int combiner, i, j, k, err, filetype_is_contig; MPI_Datatype copy_etype, copy_filetype; ADIOI_Flatlist_node *flat_file; - /* free copies of old etypes and filetypes and delete flattened + /* free copies of old etypes and filetypes and delete flattened version of filetype if necessary */ MPI_Type_get_envelope(fd->etype, &i, &j, &k, &combiner); @@ -43,7 +43,7 @@ void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, fd->etype = copy_etype; } ADIOI_Type_get_envelope(filetype, &i, &j, &k, &combiner); - if (combiner == MPI_COMBINER_NAMED) + if (combiner == MPI_COMBINER_NAMED) fd->filetype = filetype; else { MPI_Type_contiguous(1, filetype, ©_filetype); @@ -64,7 +64,7 @@ void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, if (filetype_is_contig) fd->fp_ind = disp; else { flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) + while (flat_file->type != fd->filetype) flat_file = flat_file->next; for (i=0; icount; i++) { if (flat_file->blocklens[i]) { diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_subarray.c b/ompi/mca/io/romio321/romio/adio/common/ad_subarray.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/common/ad_subarray.c rename to ompi/mca/io/romio321/romio/adio/common/ad_subarray.c index 6ae7015de5..c6eb9450ce 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_subarray.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_subarray.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -9,11 +9,11 @@ #include "adio_extern.h" int ADIO_Type_create_subarray(int ndims, - int *array_of_sizes, + int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int order, - MPI_Datatype oldtype, + MPI_Datatype oldtype, MPI_Datatype *newtype) { MPI_Aint extent, disp, size, lb, ub; @@ -31,7 +31,7 @@ int ADIO_Type_create_subarray(int ndims, MPI_Type_vector(array_of_subsizes[1], array_of_subsizes[0], array_of_sizes[0], oldtype, &tmp1); - + size = (MPI_Aint)array_of_sizes[0]*extent; for (i=2; i=0; i--) { size *= (MPI_Aint)array_of_sizes[i+1]; @@ -69,7 +69,7 @@ int ADIO_Type_create_subarray(int ndims, tmp1 = tmp2; } } - + /* add displacement and UB */ disp = array_of_starts[ndims-1]; size = 1; @@ -78,14 +78,14 @@ int ADIO_Type_create_subarray(int ndims, disp += size*(MPI_Aint)array_of_starts[i]; } } - + disp *= extent; - + ub = extent; for (i=0; iio_kind == ADIOI_READ) { ADIO_ReadContig(args->fd, args->buf, args->size, MPI_BYTE, ADIO_EXPLICIT_OFFSET, args->offset, - &(args->status), &(args->error_code)); + args->status, &(args->error_code)); } else { ADIO_WriteContig(args->fd, args->buf, args->size, MPI_BYTE, ADIO_EXPLICIT_OFFSET, args->offset, - &(args->status), &(args->error_code)); + args->status, &(args->error_code)); } pthread_exit(&(args->error_code)); return NULL; diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_wait.c b/ompi/mca/io/romio321/romio/adio/common/ad_wait.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/common/ad_wait.c rename to ompi/mca/io/romio321/romio/adio/common/ad_wait.c index 934e82563b..2112ee8fb6 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_wait.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_wait.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,7 +23,7 @@ #include #endif -/* Workaround for incomplete set of definitions if __REDIRECT is not +/* Workaround for incomplete set of definitions if __REDIRECT is not defined and large file support is used in aio.h */ #if !defined(__REDIRECT) && defined(__USE_FILE_OFFSET64) #define aiocb aiocb64 @@ -40,8 +40,8 @@ * to complete. */ void ADIOI_GEN_IOComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code) + int *error_code) { return; - + } diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_wait_fake.c b/ompi/mca/io/romio321/romio/adio/common/ad_wait_fake.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/common/ad_wait_fake.c rename to ompi/mca/io/romio321/romio/adio/common/ad_wait_fake.c index 72905080c9..16947baa1f 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_wait_fake.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_wait_fake.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write.c b/ompi/mca/io/romio321/romio/adio/common/ad_write.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/common/ad_write.c rename to ompi/mca/io/romio321/romio/adio/common/ad_write.c index 2e8692d64b..d1c24ac45e 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_write.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_write.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ +#include "adio.h" #include -#include "adio.h" #ifdef AGGREGATION_PROFILE #include "mpe.h" #endif @@ -95,7 +95,7 @@ void ADIOI_GEN_WriteContig(ADIO_File fd, const void *buf, int count, fd->fp_sys_posn = offset + bytes_xfered; if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += bytes_xfered; + fd->fp_ind += bytes_xfered; } #ifdef ROMIO_GPFS diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_write_coll.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/common/ad_write_coll.c rename to ompi/mca/io/romio321/romio/adio/common/ad_write_coll.c index f14342e039..87a93c5489 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_write_coll.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_write_coll.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -22,31 +22,31 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype ADIO_Offset *fd_start, ADIO_Offset *fd_end, int *buf_idx, int *error_code); static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, - ADIOI_Flatlist_node *flat_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, + ADIOI_Flatlist_node *flat_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, int *recv_size, ADIO_Offset off, int size, - int *count, int *start_pos, int *partial_recv, - int *sent_to_proc, int nprocs, + int *count, int *start_pos, int *partial_recv, + int *sent_to_proc, int nprocs, int myrank, int buftype_is_contig, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - ADIOI_Access *others_req, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + ADIOI_Access *others_req, int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int *hole, int iter, + int *done_to_proc, int *hole, int iter, MPI_Aint buftype_extent, int *buf_idx, int *error_code); -static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, +void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int iter, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, + int *done_to_proc, int iter, MPI_Aint buftype_extent); -void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, +void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, ADIO_Offset *srt_off, int *srt_len, int *start_pos, int nprocs, int nprocs_recv, int total_elements); @@ -57,15 +57,15 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, *error_code) { /* Uses a generalized version of the extended two-phase method described - in "An Extended Two-Phase Method for Accessing Sections of + in "An Extended Two-Phase Method for Accessing Sections of Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, - Scientific Programming, (5)4:301--317, Winter 1996. + Scientific Programming, (5)4:301--317, Winter 1996. http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ - ADIOI_Access *my_req; + ADIOI_Access *my_req; /* array of nprocs access structures, one for each other process in whose file domain this process's request lies */ - + ADIOI_Access *others_req; /* array of nprocs access structures, one for each other process whose request lies in this process's file domain. */ @@ -80,7 +80,7 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, ADIO_Offset *len_list = NULL; int old_error, tmp_error; - if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { + if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { /* Cast away const'ness as the below function is used for read * and write */ ADIOI_IOStridedColl (fd, (char *) buf, count, ADIOI_WRITE, datatype, @@ -107,12 +107,12 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, &offset_list, &len_list, &start_offset, - &end_offset, &contig_access_count); + &end_offset, &contig_access_count); - /* each process communicates its start and end offsets to other + /* each process communicates its start and end offsets to other processes. The result is an array each of start and end offsets stored - in order of process rank. */ - + in order of process rank. */ + st_offsets = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); end_offsets = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); @@ -123,7 +123,7 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, /* are the accesses of different processes interleaved? */ for (i=1; ihints->min_fdomain_size, &fd_size, - fd->hints->striping_unit); + fd->hints->striping_unit); /* calculate what portions of the access requests of this process are @@ -178,22 +178,22 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, ADIOI_Calc_my_req(fd, offset_list, len_list, contig_access_count, min_st_offset, fd_start, fd_end, fd_size, - nprocs, &count_my_req_procs, + nprocs, &count_my_req_procs, &count_my_req_per_proc, &my_req, - &buf_idx); + &buf_idx); /* based on everyone's my_req, calculate what requests of other processes lie in this process's file domain. count_others_req_procs = number of processes whose requests lie in - this process's file domain (including this process itself) + this process's file domain (including this process itself) count_others_req_per_proc[i] indicates how many separate contiguous requests of proc. i lie in this process's file domain. */ - ADIOI_Calc_others_req(fd, count_my_req_procs, - count_my_req_per_proc, my_req, + ADIOI_Calc_others_req(fd, count_my_req_procs, + count_my_req_per_proc, my_req, nprocs, myrank, - &count_others_req_procs, &others_req); - + &count_others_req_procs, &others_req); + ADIOI_Free(count_my_req_per_proc); for (i=0; i < nprocs; i++) { if (my_req[i].count) { @@ -214,7 +214,7 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, * it's possible to have those subsequent writes on other processes * race ahead and sneak in before the read-modify-write completes. * We carry out a collective communication at the end here so no one - * can start independent i/o before collective I/O completes. + * can start independent i/o before collective I/O completes. * * need to do some gymnastics with the error codes so that if something * went wrong, all processes report error, but if a process has a more @@ -229,12 +229,12 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_postwrite_a, 0, NULL ); #endif - if (fd->hints->cb_nodes == 1) - MPI_Bcast(error_code, 1, MPI_INT, + if (fd->hints->cb_nodes == 1) + MPI_Bcast(error_code, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); else { tmp_error = *error_code; - MPI_Allreduce(&tmp_error, error_code, 1, MPI_INT, + MPI_Allreduce(&tmp_error, error_code, 1, MPI_INT, MPI_MAX, fd->comm); } #ifdef ADIOI_MPE_LOGGING @@ -277,7 +277,7 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, bufsize = size * count; MPIR_Status_set_bytes(status, datatype, bufsize); } -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written during collective I/O. */ #endif @@ -293,7 +293,7 @@ void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, * code is created and returned in error_code. */ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype - datatype, int nprocs, + datatype, int nprocs, int myrank, ADIOI_Access *others_req, ADIO_Offset *offset_list, @@ -303,7 +303,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype int *buf_idx, int *error_code) { /* Send data to appropriate processes and write in sizes of no more - than coll_bufsize. + than coll_bufsize. The idea is to reduce the amount of extra memory required for collective I/O. If all data were written all at once, which is much easier, it would require temp space more than the size of user_buf, @@ -334,7 +334,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype That gives the no. of communication phases as well. */ value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value, + ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value, &info_flag); coll_bufsize = atoi(value); ADIOI_Free(value); @@ -364,11 +364,11 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype } MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX, - fd->comm); + fd->comm); write_buf = fd->io_buf; - curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); + curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int)); /* its use is explained below. calloc initializes to 0. */ count = (int *) ADIOI_Malloc(nprocs*sizeof(int)); @@ -397,14 +397,12 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype /* Above three are used in ADIOI_Fill_send_buffer*/ start_pos = (int *) ADIOI_Malloc(nprocs*sizeof(int)); - /* used to store the starting value of curr_offlen_ptr[i] in + /* used to store the starting value of curr_offlen_ptr[i] in this iteration */ ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); if (!buftype_is_contig) { - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); } MPI_Type_get_extent(datatype, &lb, &buftype_extent); @@ -427,15 +425,15 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype /* go through all others_req and check which will be satisfied by the current write */ - /* Note that MPI guarantees that displacements in filetypes are in + /* Note that MPI guarantees that displacements in filetypes are in monotonically nondecreasing order and that, for writes, the filetypes cannot specify overlapping regions in the file. This simplifies implementation a bit compared to reads. */ - /* off = start offset in the file for the data to be written in - this iteration + /* off = start offset in the file for the data to be written in + this iteration size = size of data written (bytes) corresponding to off - req_off = off in file for a particular contiguous request + req_off = off in file for a particular contiguous request minus what was satisfied in previous iteration req_size = size corresponding to req_off */ @@ -443,7 +441,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype for (i=0; i < nprocs; i++) count[i] = recv_size[i] = 0; - size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); + size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done); for (i=0; i < nprocs; i++) { if (others_req[i].count) { @@ -453,7 +451,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype /* this request may have been partially satisfied in the previous iteration. */ req_off = others_req[i].offsets[j] + - partial_recv[i]; + partial_recv[i]; req_len = others_req[i].lens[j] - partial_recv[i]; partial_recv[i] = 0; @@ -467,11 +465,11 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype } if (req_off < off + size) { count[i]++; - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIR_Upint)(write_buf+req_off-off)); - MPI_Get_address(write_buf+req_off-off, - &(others_req[i].mem_ptrs[j])); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIU_Upint)(write_buf+req_off-off)); + MPI_Get_address(write_buf+req_off-off, + &(others_req[i].mem_ptrs[j])); ADIOI_Assert((off + size - req_off) == (int)(off + size - req_off)); - recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, + recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, (unsigned)req_len)); if (off+size-req_off < (unsigned)req_len) @@ -479,9 +477,9 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype partial_recv[i] = (int) (off + size - req_off); /* --BEGIN ERROR HANDLING-- */ - if ((j+1 < others_req[i].count) && + if ((j+1 < others_req[i].count) && (others_req[i].offsets[j+1] < off+size)) - { + { *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, @@ -501,16 +499,16 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype curr_offlen_ptr[i] = j; } } - - ADIOI_W_Exchange_data(fd, buf, write_buf, flat_buf, offset_list, - len_list, send_size, recv_size, off, size, count, - start_pos, partial_recv, - sent_to_proc, nprocs, myrank, + + ADIOI_W_Exchange_data(fd, buf, write_buf, flat_buf, offset_list, + len_list, send_size, recv_size, off, size, count, + start_pos, partial_recv, + sent_to_proc, nprocs, myrank, buftype_is_contig, contig_access_count, min_st_offset, fd_size, fd_start, fd_end, others_req, send_buf_idx, curr_to_proc, done_to_proc, &hole, m, buftype_extent, buf_idx, - error_code); + error_code); if (*error_code != MPI_SUCCESS) return; flag = 0; @@ -519,7 +517,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype if (flag) { ADIOI_Assert(size == (int)size); - ADIO_WriteContig(fd, write_buf, (int)size, MPI_BYTE, ADIO_EXPLICIT_OFFSET, + ADIO_WriteContig(fd, write_buf, (int)size, MPI_BYTE, ADIO_EXPLICIT_OFFSET, off, &status, error_code); if (*error_code != MPI_SUCCESS) return; } @@ -532,15 +530,15 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype for (m=ntimes; matomicity) { /* bug fix from Wei-keng Liao and Kenin Coloma */ requests = (MPI_Request *) - ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request)); + ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request)); send_req = requests; } else { - requests = (MPI_Request *) - ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); + requests = (MPI_Request *) + ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); /* +1 to avoid a 0-size malloc */ /* post receives */ @@ -724,10 +722,10 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, #endif if (buftype_is_contig) { j = 0; - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) { - MPI_Isend(((char *) buf) + buf_idx[i], send_size[i], - MPI_BYTE, i, myrank+i+100*iter, fd->comm, + MPI_Isend(((char *) buf) + buf_idx[i], send_size[i], + MPI_BYTE, i, myrank+i+100*iter, fd->comm, send_req+j); j++; buf_idx[i] += send_size[i]; @@ -736,16 +734,16 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, else if (nprocs_send) { /* buftype is not contig */ send_buf = (char **) ADIOI_Malloc(nprocs*sizeof(char*)); - for (i=0; i < nprocs; i++) - if (send_size[i]) + for (i=0; i < nprocs; i++) + if (send_size[i]) send_buf[i] = (char *) ADIOI_Malloc(send_size[i]); ADIOI_Fill_send_buffer(fd, buf, flat_buf, send_buf, - offset_list, len_list, send_size, + offset_list, len_list, send_size, send_req, - sent_to_proc, nprocs, myrank, + sent_to_proc, nprocs, myrank, contig_access_count, - min_st_offset, fd_size, fd_start, fd_end, + min_st_offset, fd_size, fd_start, fd_end, send_buf_idx, curr_to_proc, done_to_proc, iter, buftype_extent); /* the send is done in ADIOI_Fill_send_buffer */ @@ -766,16 +764,16 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, for (i=0; iatomicity) { /* bug fix from Wei-keng Liao and Kenin Coloma */ statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+1) * \ - sizeof(MPI_Status)); + sizeof(MPI_Status)); /* +1 to avoid a 0-size malloc */ } else { statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+nprocs_recv+1) * \ - sizeof(MPI_Status)); + sizeof(MPI_Status)); /* +1 to avoid a 0-size malloc */ } @@ -802,7 +800,7 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, ADIOI_Free(statuses); ADIOI_Free(requests); if (!buftype_is_contig && nprocs_send) { - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) ADIOI_Free(send_buf[i]); ADIOI_Free(send_buf); } @@ -833,7 +831,7 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, { \ while (size) { \ size_in_buf = ADIOI_MIN(size, flat_buf_sz); \ - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + user_buf_idx)); \ + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + user_buf_idx) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + user_buf_idx)); \ ADIOI_Assert(size_in_buf == (size_t)size_in_buf); \ memcpy(&(send_buf[p][send_buf_idx[p]]), \ ((char *) buf) + user_buf_idx, size_in_buf); \ @@ -860,15 +858,15 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, -static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, - int contig_access_count, +void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node + *flat_buf, char **send_buf, ADIO_Offset + *offset_list, ADIO_Offset *len_list, int *send_size, + MPI_Request *requests, int *sent_to_proc, + int nprocs, int myrank, + int contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, + ADIO_Offset *fd_start, ADIO_Offset *fd_end, + int *send_buf_idx, int *curr_to_proc, int *done_to_proc, int iter, MPI_Aint buftype_extent) { @@ -881,9 +879,9 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node /* curr_to_proc[p] = amount of data sent to proc. p that has already been accounted for so far - done_to_proc[p] = amount of data already sent to proc. p in + done_to_proc[p] = amount of data already sent to proc. p in previous iterations - user_buf_idx = current location in user buffer + user_buf_idx = current location in user buffer send_buf_idx[p] = current location in send_buf of proc. p */ for (i=0; i < nprocs; i++) { @@ -898,10 +896,10 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node flat_buf_sz = flat_buf->blocklens[0]; /* flat_buf_idx = current index into flattened buftype - flat_buf_sz = size of current contiguous component in + flat_buf_sz = size of current contiguous component in flattened buf */ - for (i=0; i done_to_proc[p]) { if (done_to_proc[p] > curr_to_proc[p]) { - size = ADIOI_MIN(curr_to_proc[p] + len - + size = ADIOI_MIN(curr_to_proc[p] + len - done_to_proc[p], send_size[p]-send_buf_idx[p]); buf_incr = done_to_proc[p] - curr_to_proc[p]; ADIOI_BUF_INCR @@ -942,7 +940,7 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node ADIOI_BUF_COPY } if (send_buf_idx[p] == send_size[p]) { - MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p, + MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p, myrank+p+100*iter, fd->comm, requests+jj); jj++; } @@ -962,13 +960,13 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node rem_len -= len; } } - for (i=0; i < nprocs; i++) + for (i=0; i < nprocs; i++) if (send_size[i]) sent_to_proc[i] = curr_to_proc[i]; } -void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, +void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, ADIO_Offset *srt_off, int *srt_len, int *start_pos, int nprocs, int nprocs_recv, int total_elements) { @@ -998,7 +996,7 @@ void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, heapsize = nprocs_recv; for (i=heapsize/2 - 1; i>=0; i--) { /* Heapify(a, i, heapsize); Algorithm from Cormen et al. pg. 143 - modified for a heap with smallest element at root. I have + modified for a heap with smallest element at root. I have removed the recursion so that there are no function calls. Function calls are too expensive. */ k = i; @@ -1006,12 +1004,12 @@ void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, l = 2*(k+1) - 1; r = 2*(k+1); - if ((l < heapsize) && + if ((l < heapsize) && (*(a[l].off_list) < *(a[k].off_list))) smallest = l; else smallest = k; - if ((r < heapsize) && + if ((r < heapsize) && (*(a[r].off_list) < *(a[smallest].off_list))) smallest = r; @@ -1023,11 +1021,11 @@ void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, a[k].off_list = a[smallest].off_list; a[k].len_list = a[smallest].len_list; a[k].nelem = a[smallest].nelem; - + a[smallest].off_list = tmp.off_list; a[smallest].len_list = tmp.len_list; a[smallest].nelem = tmp.nelem; - + k = smallest; } else break; @@ -1057,12 +1055,12 @@ void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, l = 2*(k+1) - 1; r = 2*(k+1); - if ((l < heapsize) && + if ((l < heapsize) && (*(a[l].off_list) < *(a[k].off_list))) smallest = l; else smallest = k; - if ((r < heapsize) && + if ((r < heapsize) && (*(a[r].off_list) < *(a[smallest].off_list))) smallest = r; @@ -1074,11 +1072,11 @@ void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, a[k].off_list = a[smallest].off_list; a[k].len_list = a[smallest].len_list; a[k].nelem = a[smallest].nelem; - + a[smallest].off_list = tmp.off_list; a[smallest].len_list = tmp.len_list; a[smallest].nelem = tmp.nelem; - + k = smallest; } else break; diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c b/ompi/mca/io/romio321/romio/adio/common/ad_write_nolock.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c rename to ompi/mca/io/romio321/romio/adio/common/ad_write_nolock.c index e3371a77de..343806ef3f 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_write_nolock.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_write_nolock.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ -#include #include "adio.h" #include "adio_extern.h" +#include /* #define IO_DEBUG 1 */ @@ -21,7 +21,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, * cannot or do not support client-side buffering * Does not do data sieving optimization * Does contain write-combining optimization for noncontig in memory, contig in - * file + * file */ /* offset is in units of etype relative to the filetype. */ @@ -62,7 +62,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -75,7 +75,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, MPI_Type_size_x(datatype, &buftype_size); MPI_Type_get_extent(datatype, &lb, &buftype_extent); etype_size = fd->etype_size; - + ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count)); bufsize = buftype_size * count; @@ -84,9 +84,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, ADIO_Offset combine_buf_remain; /* noncontiguous in memory, contiguous in file. use writev */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); /* allocate our "combine buffer" to pack data into before writing */ combine_buf = (char *) ADIOI_Malloc(fd->hints->ind_wr_buffer_size); @@ -112,8 +110,8 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, if (flat_buf->blocklens[i] > combine_buf_remain && combine_buf != combine_buf_ptr) { /* there is data in the buffer; write out the buffer so far */ #ifdef IO_DEBUG - printf("[%d/%d] nc mem c file (0) writing loc = %Ld sz = %Ld\n", - rank, nprocs, off, + printf("[%d/%d] nc mem c file (0) writing loc = %Ld sz = %Ld\n", + rank, nprocs, off, fd->hints->ind_wr_buffer_size-combine_buf_remain); #endif #ifdef ADIOI_MPE_LOGGING @@ -138,12 +136,12 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, * write directly */ #ifdef IO_DEBUG - printf("[%d/%d] nc mem c file (1) writing loc = %Ld sz = %d\n", - rank, nprocs, off, + printf("[%d/%d] nc mem c file (1) writing loc = %Ld sz = %d\n", + rank, nprocs, off, flat_buf->blocklens[i]); #endif ADIOI_Assert(flat_buf->blocklens[i] == (unsigned)flat_buf->blocklens[i]); - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]) == (ADIO_Offset)((MPIR_Upint)buf + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i])); + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]) == (ADIO_Offset)((MPIU_Upint)buf + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i])); #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif @@ -171,8 +169,8 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, if (combine_buf_ptr != combine_buf) { /* data left in buffer to write */ #ifdef IO_DEBUG - printf("[%d/%d] nc mem c file (2) writing loc = %Ld sz = %Ld\n", - rank, nprocs, off, + printf("[%d/%d] nc mem c file (2) writing loc = %Ld sz = %Ld\n", + rank, nprocs, off, fd->hints->ind_wr_buffer_size-combine_buf_remain); #endif #ifdef ADIOI_MPE_LOGGING @@ -219,11 +217,11 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, int i; n_filetypes++; for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + - n_filetypes*(ADIO_Offset)filetype_extent + flat_file->blocklens[i] + if (disp + flat_file->indices[i] + + n_filetypes*(ADIO_Offset)filetype_extent + flat_file->blocklens[i] >= offset) { st_index = i; - fwr_size = disp + flat_file->indices[i] + + fwr_size = disp + flat_file->indices[i] + n_filetypes*(ADIO_Offset)filetype_extent + flat_file->blocklens[i] - offset; flag = 1; @@ -238,7 +236,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -265,14 +263,14 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, off = offset; fwr_size = ADIOI_MIN(fwr_size, bufsize); while (i_offset < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ + if (fwr_size) { + /* TYPE_UB and TYPE_LB can result in + fwr_size = 0. save system call in such cases */ #ifdef ADIOI_MPE_LOGGING MPE_Log_event(ADIOI_MPE_lseek_a, 0, NULL); #endif #ifdef IO_DEBUG - printf("[%d/%d] c mem nc file writing loc = %Ld sz = %d\n", + printf("[%d/%d] c mem nc file writing loc = %Ld sz = %d\n", rank, nprocs, off, fwr_size); #endif err_lseek = lseek(fd->fd_sys, off, SEEK_SET); @@ -302,7 +300,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, j = 0; n_filetypes++; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); } @@ -311,9 +309,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; indx = flat_buf->indices[0]; @@ -325,18 +321,18 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, size = ADIOI_MIN(fwr_size, bwr_size); if (size) { #ifdef IO_DEBUG - printf("[%d/%d] nc mem nc file writing loc = %Ld sz = %d\n", + printf("[%d/%d] nc mem nc file writing loc = %Ld sz = %d\n", rank, nprocs, off, size); #endif #ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); #endif lseek(fd->fd_sys, off, SEEK_SET); -#ifdef ADIOI_MPE_LOGGING +#ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); #endif if (err == -1) err_flag = 1; -#ifdef ADIOI_MPE_LOGGING +#ifdef ADIOI_MPE_LOGGING MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); #endif ADIOI_Assert(size == (size_t) size); @@ -359,7 +355,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; new_fwr_size = flat_file->blocklens[j]; @@ -375,7 +371,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, k = (k + 1)%flat_buf->count; buf_count++; indx = buftype_extent*(buf_count/flat_buf->count) + - flat_buf->indices[k]; + flat_buf->indices[k]; new_bwr_size = flat_buf->blocklens[k]; if (size != fwr_size) { off += size; @@ -402,7 +398,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_str.c b/ompi/mca/io/romio321/romio/adio/common/ad_write_str.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/common/ad_write_str.c rename to ompi/mca/io/romio321/romio/adio/common/ad_write_str.c index 9e4d7f7fc9..83f2420ddc 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_write_str.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_write_str.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -122,7 +122,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes; ADIO_Offset n_etypes_in_filetype, abs_off_in_filetype=0; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, lb; + MPI_Aint filetype_extent, buftype_extent, lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off; ADIO_Offset off, req_off, disp, end_offset=0, writebuf_off, start_off; @@ -138,7 +138,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, * approach instead. */ - ADIOI_GEN_WriteStrided_naive(fd, + ADIOI_GEN_WriteStrided_naive(fd, buf, count, datatype, @@ -160,7 +160,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -180,11 +180,9 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + (ADIO_Offset)etype_size * offset; start_off = off; @@ -194,10 +192,10 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize, end_offset-writebuf_off+1)); /* if atomicity is true, lock the region to be accessed */ - if (fd->atomicity) + if (fd->atomicity) ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - for (j=0; jcount; i++) { userbuf_off = (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]; @@ -212,7 +210,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); - if (fd->atomicity) + if (fd->atomicity) ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); if (*error_code != MPI_SUCCESS) goto fn_exit; @@ -259,7 +257,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; @@ -273,7 +271,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, } /* abs. offset in bytes in the file */ - offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + + offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype; } @@ -293,7 +291,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, offset, status, error_code); if (file_ptr_type == ADIO_INDIVIDUAL) { - /* update MPI-IO file pointer to point to the first byte + /* update MPI-IO file pointer to point to the first byte * that can be accessed in the fileview. */ fd->fp_ind = offset + bufsize; if (bufsize == fwr_size) { @@ -308,10 +306,10 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, + (ADIO_Offset)n_filetypes*filetype_extent; } } - fd->fp_sys_posn = -1; /* set it to null. */ + fd->fp_sys_posn = -1; /* set it to null. */ #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, datatype, bufsize); -#endif +#endif goto fn_exit; } @@ -335,13 +333,13 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); } /* if atomicity is true, lock the region to be accessed */ - if (fd->atomicity) + if (fd->atomicity) ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); writebuf_off = 0; @@ -360,9 +358,9 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes = st_n_filetypes; fwr_size = ADIOI_MIN(st_fwr_size, bufsize); while (i_offset < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ + if (fwr_size) { + /* TYPE_UB and TYPE_LB can result in + fwr_size = 0. save system call in such cases */ /* lseek(fd->fd_sys, off, SEEK_SET); err = write(fd->fd_sys, ((char *) buf) + i_offset, fwr_size);*/ @@ -385,9 +383,9 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, j = (j+1) % flat_file->count; n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; - fwr_size = ADIOI_MIN(flat_file->blocklens[j], + fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); } } @@ -395,9 +393,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, else { /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(datatype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != datatype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(datatype); k = num = buf_count = 0; i_offset = flat_buf->indices[0]; @@ -431,7 +427,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, n_filetypes += (j == 0) ? 1 : 0; } - off = disp + flat_file->indices[j] + + off = disp + flat_file->indices[j] + n_filetypes*(ADIO_Offset)filetype_extent; new_fwr_size = flat_file->blocklens[j]; @@ -447,7 +443,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, k = (k + 1)%flat_buf->count; buf_count++; i_offset = (ADIO_Offset)buftype_extent*(ADIO_Offset)(buf_count/flat_buf->count) + - flat_buf->indices[k]; + flat_buf->indices[k]; new_bwr_size = flat_buf->blocklens[k]; if (size != fwr_size) { off += size; @@ -460,15 +456,15 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, } } - /* write the buffer out finally */ + /* write the buffer out finally */ if (writebuf_len) { ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); - if (!(fd->atomicity)) + if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); if (*error_code != MPI_SUCCESS) goto fn_exit; } - if (fd->atomicity) + if (fd->atomicity) ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; @@ -479,7 +475,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES /* datatypes returning negagive values, probably related to tt 1893 */ MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to +/* This is a temporary way of filling in status. The right way is to keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c b/ompi/mca/io/romio321/romio/adio/common/ad_write_str_naive.c similarity index 84% rename from ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c rename to ompi/mca/io/romio321/romio/adio/common/ad_write_str_naive.c index d72f116875..4ab4920bc1 100644 --- a/ompi/mca/io/romio314/romio/adio/common/ad_write_str_naive.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_write_str_naive.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,14 +17,14 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, ADIOI_Flatlist_node *flat_buf, *flat_file; /* bwr == buffer write; fwr == file write */ - ADIO_Offset bwr_size, fwr_size=0, sum, size_in_filetype; + ADIO_Offset bwr_size, fwr_size=0, sum, size_in_filetype; int b_index; MPI_Count bufsize; ADIO_Offset n_etypes_in_filetype; ADIO_Offset size, n_filetypes, etype_in_filetype; ADIO_Offset abs_off_in_filetype=0, req_len; MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, lb; + MPI_Aint filetype_extent, buftype_extent, lb; int buf_count, buftype_is_contig, filetype_is_contig; ADIO_Offset userbuf_off; ADIO_Offset off, req_off, disp, end_offset=0, start_off; @@ -40,7 +40,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, buftype, 0); #endif - *error_code = MPI_SUCCESS; + *error_code = MPI_SUCCESS; return; } @@ -58,11 +58,9 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, int b_count; /* noncontiguous in memory, contiguous in file. */ - ADIOI_Flatten_datatype(buftype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != buftype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(buftype); - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : + off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : fd->disp + (ADIO_Offset)etype_size * offset; start_off = off; @@ -79,17 +77,17 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, */ for (b_count=0; b_count < count; b_count++) { for (b_index=0; b_index < flat_buf->count; b_index++) { - userbuf_off = (ADIO_Offset)b_count*(ADIO_Offset)buftype_extent + + userbuf_off = (ADIO_Offset)b_count*(ADIO_Offset)buftype_extent + flat_buf->indices[b_index]; req_off = off; req_len = flat_buf->blocklens[b_index]; ADIOI_Assert(req_len == (int) req_len); - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + userbuf_off)); - ADIO_WriteContig(fd, + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); + ADIO_WriteContig(fd, (char *) buf + userbuf_off, - (int)req_len, - MPI_BYTE, + (int)req_len, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, req_off, &status1, @@ -141,15 +139,15 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, while (!flag) { n_filetypes++; for (f_index=0; f_index < flat_file->count; f_index++) { - if (disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + - flat_file->blocklens[f_index] >= start_off) + if (disp + flat_file->indices[f_index] + + n_filetypes*(ADIO_Offset)filetype_extent + + flat_file->blocklens[f_index] >= start_off) { /* this block contains our starting position */ st_index = f_index; - fwr_size = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + + fwr_size = disp + flat_file->indices[f_index] + + n_filetypes*(ADIO_Offset)filetype_extent + flat_file->blocklens[f_index] - start_off; flag = 1; break; @@ -162,7 +160,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (f_index=0; f_index < flat_file->count; f_index++) { sum += flat_file->blocklens[f_index]; @@ -170,21 +168,21 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, st_index = f_index; fwr_size = sum - size_in_filetype; abs_off_in_filetype = flat_file->indices[f_index] + - size_in_filetype - + size_in_filetype - (sum - flat_file->blocklens[f_index]); break; } } /* abs. offset in bytes in the file */ - start_off = disp + n_filetypes*(ADIO_Offset)filetype_extent + + start_off = disp + n_filetypes*(ADIO_Offset)filetype_extent + abs_off_in_filetype; } st_fwr_size = fwr_size; st_n_filetypes = n_filetypes; - /* start_off, st_n_filetypes, st_index, and st_fwr_size are + /* start_off, st_n_filetypes, st_index, and st_fwr_size are * all calculated at this point */ @@ -205,9 +203,9 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[f_index] + + off = disp + flat_file->indices[f_index] + n_filetypes*(ADIO_Offset)filetype_extent; - fwr_size = ADIOI_MIN(flat_file->blocklens[f_index], + fwr_size = ADIOI_MIN(flat_file->blocklens[f_index], bufsize-(unsigned)userbuf_off); } @@ -239,18 +237,18 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, /* while there is still space in the buffer, write more data */ while (userbuf_off < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ + if (fwr_size) { + /* TYPE_UB and TYPE_LB can result in + fwr_size = 0. save system call in such cases */ req_off = off; req_len = fwr_size; ADIOI_Assert(req_len == (int) req_len); - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + userbuf_off)); - ADIO_WriteContig(fd, + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); + ADIO_WriteContig(fd, (char *) buf + userbuf_off, - (int)req_len, - MPI_BYTE, + (int)req_len, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, req_off, &status1, @@ -260,7 +258,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, userbuf_off += fwr_size; if (off + fwr_size < disp + flat_file->indices[f_index] + - flat_file->blocklens[f_index] + + flat_file->blocklens[f_index] + n_filetypes*(ADIO_Offset)filetype_extent) { /* important that this value be correct, as it is @@ -278,9 +276,9 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, f_index = 0; n_filetypes++; } - off = disp + flat_file->indices[f_index] + + off = disp + flat_file->indices[f_index] + n_filetypes*(ADIO_Offset)filetype_extent; - fwr_size = ADIOI_MIN(flat_file->blocklens[f_index], + fwr_size = ADIOI_MIN(flat_file->blocklens[f_index], bufsize-(unsigned)userbuf_off); } } @@ -289,9 +287,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, ADIO_Offset i_offset, tmp_bufsize = 0; /* noncontiguous in memory as well as in file */ - ADIOI_Flatten_datatype(buftype); - flat_buf = ADIOI_Flatlist; - while (flat_buf->type != buftype) flat_buf = flat_buf->next; + flat_buf = ADIOI_Flatten_and_find(buftype); b_index = buf_count = 0; i_offset = flat_buf->indices[0]; @@ -312,11 +308,11 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, userbuf_off = i_offset; ADIOI_Assert(req_len == (int) req_len); - ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIR_Upint)((MPIR_Upint)buf + userbuf_off)); - ADIO_WriteContig(fd, + ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); + ADIO_WriteContig(fd, (char *) buf + userbuf_off, - (int)req_len, - MPI_BYTE, + (int)req_len, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, req_off, &status1, @@ -332,7 +328,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, n_filetypes++; } - off = disp + flat_file->indices[f_index] + + off = disp + flat_file->indices[f_index] + n_filetypes*(ADIO_Offset)filetype_extent; new_fwr_size = flat_file->blocklens[f_index]; @@ -374,8 +370,8 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, #ifdef HAVE_STATUS_SET_BYTES MPIR_Status_set_bytes(status, buftype, bufsize); - /* This is a temporary way of filling in status. The right way is to - * keep track of how much data was actually written and placed in buf + /* This is a temporary way of filling in status. The right way is to + * keep track of how much data was actually written and placed in buf */ #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/adi_close.c b/ompi/mca/io/romio321/romio/adio/common/adi_close.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/common/adi_close.c rename to ompi/mca/io/romio321/romio/adio/common/adi_close.c index e11984259a..cdc1873785 100644 --- a/ompi/mca/io/romio314/romio/adio/common/adi_close.c +++ b/ompi/mca/io/romio321/romio/adio/common/adi_close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/common/async_list.c b/ompi/mca/io/romio321/romio/adio/common/async_list.c similarity index 95% rename from ompi/mca/io/romio314/romio/adio/common/async_list.c rename to ompi/mca/io/romio321/romio/adio/common/async_list.c index 6e7c734576..239dbe587b 100644 --- a/ompi/mca/io/romio314/romio/adio/common/async_list.c +++ b/ompi/mca/io/romio321/romio/adio/common/async_list.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -23,7 +23,7 @@ ADIOI_Async_node *ADIOI_Malloc_async_node(void) if (!ADIOI_Async_avail_head) { ADIOI_Async_avail_head = (ADIOI_Async_node *) - ADIOI_Malloc(NUM*sizeof(ADIOI_Async_node)); + ADIOI_Malloc(NUM*sizeof(ADIOI_Async_node)); curr = ADIOI_Async_avail_head; for (i=1; inext = ADIOI_Async_avail_head+i; @@ -35,7 +35,7 @@ ADIOI_Async_node *ADIOI_Malloc_async_node(void) /* keep track of malloced area that needs to be freed later */ if (!ADIOI_Malloc_async_tail) { ADIOI_Malloc_async_tail = (ADIOI_Malloc_async *) - ADIOI_Malloc(sizeof(ADIOI_Malloc_async)); + ADIOI_Malloc(sizeof(ADIOI_Malloc_async)); ADIOI_Malloc_async_head = ADIOI_Malloc_async_tail; ADIOI_Malloc_async_head->ptr = ADIOI_Async_avail_head; ADIOI_Malloc_async_head->next = NULL; @@ -94,7 +94,7 @@ void ADIOI_Add_req_to_list(ADIO_Request *request) (*request)->ptr_in_async_list = ADIOI_Async_list_tail; } } - + /* Sets error_code to MPI_SUCCESS on success, creates an error code on * failure. */ @@ -113,7 +113,7 @@ void ADIOI_Complete_async(int *error_code) while (ADIOI_Async_list_head) { request = ADIOI_Async_list_head->request; (*request)->queued = -1; /* ugly internal hack that prevents - ADIOI_xxxComplete from freeing the request object. + ADIOI_xxxComplete from freeing the request object. This is required, because the user will call MPI_Wait later, which would require status to be filled. */ switch ((*request)->optype) { @@ -152,7 +152,7 @@ void ADIOI_Del_req_from_list(ADIO_Request *request) { /* Delete a request that has already been completed from the async list and move it to the list of available nodes. Typically called - from within an ADIO_Test/ADIO_Wait. */ + from within an ADIO_Test/ADIO_Wait. */ ADIOI_Async_node *curr, *prev, *next; diff --git a/ompi/mca/io/romio314/romio/adio/common/byte_offset.c b/ompi/mca/io/romio321/romio/adio/common/byte_offset.c similarity index 96% rename from ompi/mca/io/romio314/romio/adio/common/byte_offset.c rename to ompi/mca/io/romio321/romio/adio/common/byte_offset.c index 66f83edf5a..7c3d1fe1c7 100644 --- a/ompi/mca/io/romio314/romio/adio/common/byte_offset.c +++ b/ompi/mca/io/romio321/romio/adio/common/byte_offset.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" #include "adio_extern.h" -/* Returns the absolute byte position in the file corresponding to +/* Returns the absolute byte position in the file corresponding to "offset" etypes relative to the current view. */ void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp) @@ -34,7 +34,7 @@ void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp) n_filetypes = offset / n_etypes_in_filetype; etype_in_filetype = offset % n_etypes_in_filetype; size_in_filetype = etype_in_filetype * etype_size; - + sum = 0; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; diff --git a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c b/ompi/mca/io/romio321/romio/adio/common/cb_config_list.c similarity index 93% rename from ompi/mca/io/romio314/romio/adio/common/cb_config_list.c rename to ompi/mca/io/romio321/romio/adio/common/cb_config_list.c index e9f3116224..1fd827d7d2 100644 --- a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c +++ b/ompi/mca/io/romio321/romio/adio/common/cb_config_list.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,15 +41,15 @@ static char *token_ptr; /* internal stuff */ static int get_max_procs(int cb_nodes); -static int match_procs(char *name, int max_per_proc, char *procnames[], +static int match_procs(char *name, int max_per_proc, char *procnames[], char used_procnames[], - int nr_procnames, int ranks[], int nr_ranks, + int nr_procnames, int ranks[], int nr_ranks, int *nr_ranks_allocated); static int match_this_proc(char *name, int cur_proc, int max_matches, char *procnames[], char used_procnames[], - int nr_procnames, int ranks[], + int nr_procnames, int ranks[], int nr_ranks, int nr_ranks_allocated); -static int find_name(char *name, char *procnames[], char used_procnames[], +static int find_name(char *name, char *procnames[], char used_procnames[], int nr_procnames, int start_ind); static int cb_config_list_lex(void); @@ -86,7 +86,7 @@ int ADIOI_cb_bcast_rank_map(ADIO_File fd) return error_code; } } - MPI_Bcast(fd->hints->ranklist, fd->hints->cb_nodes, MPI_INT, 0, + MPI_Bcast(fd->hints->ranklist, fd->hints->cb_nodes, MPI_INT, 0, fd->comm); } /* TEMPORARY -- REMOVE WHEN NO LONGER UPDATING INFO FOR @@ -121,7 +121,7 @@ int ADIOI_cb_bcast_rank_map(ADIO_File fd) * * Returns 0 on success, -1 on failure. * - * NOTE: Needs some work to cleanly handle out of memory cases! + * NOTE: Needs some work to cleanly handle out of memory cases! */ int ADIOI_cb_gather_name_array(MPI_Comm comm, MPI_Comm dupcomm, @@ -135,7 +135,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, if (ADIOI_cb_config_list_keyval == MPI_KEYVAL_INVALID) { /* cleaned up by ADIOI_End_call */ - MPI_Comm_create_keyval((MPI_Comm_copy_attr_function *) ADIOI_cb_copy_name_array, + MPI_Comm_create_keyval((MPI_Comm_copy_attr_function *) ADIOI_cb_copy_name_array, (MPI_Comm_delete_attr_function *) ADIOI_cb_delete_name_array, &ADIOI_cb_config_list_keyval, NULL); } @@ -171,7 +171,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, procname = array->names; /* simpler to read */ procname_len = (int *) ADIOI_Malloc(commsize * sizeof(int)); - if (procname_len == NULL) { + if (procname_len == NULL) { return -1; } } @@ -181,7 +181,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, array->names = NULL; } /* gather lengths first */ - MPI_Gather(&my_procname_len, 1, MPI_INT, + MPI_Gather(&my_procname_len, 1, MPI_INT, procname_len, 1, MPI_INT, 0, dupcomm); if (commrank == 0) { @@ -195,20 +195,21 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, for (i=0; i < commsize; i++) { /* add one to the lengths because we need to count the * terminator, and we are going to use this list of lengths - * again in the gatherv. + * again in the gatherv. */ alloc_size += ++procname_len[i]; } - + procname[0] = ADIOI_Malloc(alloc_size); if (procname[0] == NULL) { + ADIOI_Free(array); return -1; } for (i=1; i < commsize; i++) { procname[i] = procname[i-1] + procname_len[i-1]; } - + /* create our list of displacements for the gatherv. we're going * to do everything relative to the start of the region allocated * for procname[0] @@ -223,7 +224,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, /* now gather strings */ if (commrank == 0) { - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, + MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, procname[0], procname_len, disp, MPI_CHAR, 0, dupcomm); } @@ -231,7 +232,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, /* if we didn't do this, we would need to allocate procname[] * on all processes...which seems a little silly. */ - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, + MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, NULL, NULL, NULL, MPI_CHAR, 0, dupcomm); } @@ -248,7 +249,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, } /* store the attribute; we want to store SOMETHING on all processes - * so that they can all tell if we have gone through this procedure + * so that they can all tell if we have gone through this procedure * or not for the given communicator. * * specifically we put it on both the original comm, so we can find @@ -262,7 +263,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, } -/* ADIOI_cb_config_list_parse() - parse the cb_config_list and build the +/* ADIOI_cb_config_list_parse() - parse the cb_config_list and build the * ranklist * * Parameters: @@ -270,9 +271,9 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm, * * Returns number of ranks allocated in parsing, -1 on error. */ -int ADIOI_cb_config_list_parse(char *config_list, +int ADIOI_cb_config_list_parse(char *config_list, ADIO_cb_name_array array, - int ranklist[], + int ranklist[], int cb_nodes) { int token, max_procs, cur_rank = 0, nr_procnames; @@ -349,7 +350,7 @@ int ADIOI_cb_config_list_parse(char *config_list, ADIOI_Free(used_procnames); return cur_rank; } - + if (token == AGG_WILDCARD) { cur_procname_p = NULL; } @@ -385,17 +386,17 @@ int ADIOI_cb_config_list_parse(char *config_list, /* ADIOI_cb_copy_name_array() - attribute copy routine */ -int ADIOI_cb_copy_name_array(MPI_Comm comm, - int keyval, - void *extra, +int ADIOI_cb_copy_name_array(MPI_Comm comm, + int keyval, + void *extra, void *attr_in, - void **attr_out, + void **attr_out, int *flag) { ADIO_cb_name_array array; ADIOI_UNREFERENCED_ARG(comm); - ADIOI_UNREFERENCED_ARG(keyval); + ADIOI_UNREFERENCED_ARG(keyval); ADIOI_UNREFERENCED_ARG(extra); array = (ADIO_cb_name_array) attr_in; @@ -403,15 +404,15 @@ int ADIOI_cb_copy_name_array(MPI_Comm comm, *attr_out = attr_in; *flag = 1; /* make a copy in the new communicator */ - + return MPI_SUCCESS; } /* ADIOI_cb_delete_name_array() - attribute destructor */ -int ADIOI_cb_delete_name_array(MPI_Comm comm, - int keyval, - void *attr_val, +int ADIOI_cb_delete_name_array(MPI_Comm comm, + int keyval, + void *attr_val, void *extra) { ADIO_cb_name_array array; @@ -427,7 +428,7 @@ int ADIOI_cb_delete_name_array(MPI_Comm comm, /* time to free the structures (names, array of ptrs to names, struct) */ if (array->namect) { - /* Note that array->names[i], where i > 0, + /* Note that array->names[i], where i > 0, * are just pointers into the allocated region array->names[0] */ ADIOI_Free(array->names[0]); @@ -439,7 +440,7 @@ int ADIOI_cb_delete_name_array(MPI_Comm comm, } /* match_procs() - given a name (or NULL for wildcard) and a max. number - * of aggregator processes (per processor name), this + * of aggregator processes (per processor name), this * matches in the procnames[] array and puts appropriate * ranks in the ranks array. * @@ -456,8 +457,8 @@ int ADIOI_cb_delete_name_array(MPI_Comm comm, * * Returns number of matches. */ -static int match_procs(char *name, - int max_per_proc, +static int match_procs(char *name, + int max_per_proc, char *procnames[], char used_procnames[], int nr_procnames, @@ -466,7 +467,7 @@ static int match_procs(char *name, int *nr_ranks_allocated) { int wildcard_proc, cur_proc, old_nr_allocated, ret; - + /* save this so we can report on progress */ old_nr_allocated = *nr_ranks_allocated; @@ -493,8 +494,8 @@ static int match_procs(char *name, while (nr_ranks - *nr_ranks_allocated > 0) { /* find a name */ - while ((wildcard_proc < nr_procnames) && - (used_procnames[wildcard_proc] != 0)) + while ((wildcard_proc < nr_procnames) && + (used_procnames[wildcard_proc] != 0)) { wildcard_proc++; } @@ -505,7 +506,7 @@ static int match_procs(char *name, } #ifdef CB_CONFIG_LIST_DEBUG - FPRINTF(stderr, "performing wildcard match (*:%d) starting with %s (%d)\n", + FPRINTF(stderr, "performing wildcard match (*:%d) starting with %s (%d)\n", max_per_proc, procnames[wildcard_proc], wildcard_proc); #endif @@ -521,7 +522,7 @@ static int match_procs(char *name, * our while loop. */ ranks[*nr_ranks_allocated] = cur_proc; - *nr_ranks_allocated = *nr_ranks_allocated + 1; + *nr_ranks_allocated = *nr_ranks_allocated + 1; cur_proc++; /* so, to accomplish this we use the match_this_proc() to @@ -534,7 +535,7 @@ static int match_procs(char *name, nr_procnames, ranks, nr_ranks, *nr_ranks_allocated); if (ret > 0) *nr_ranks_allocated = *nr_ranks_allocated + ret; - + /* clean up and point wildcard_proc to the next entry, since * we know that this one is NULL now. */ @@ -556,7 +557,7 @@ static int match_procs(char *name, return *nr_ranks_allocated - old_nr_allocated; } -/* match_this_proc() - find each instance of processor name "name" in +/* match_this_proc() - find each instance of processor name "name" in * the "procnames" array, starting with index "cur_proc" * and add the first "max_matches" into the "ranks" * array. remove all instances of "name" from @@ -581,8 +582,8 @@ static int match_this_proc(char *name, int max_matches, char *procnames[], char used_procnames[], - int nr_procnames, - int ranks[], + int nr_procnames, + int ranks[], int nr_ranks, int nr_ranks_allocated) { @@ -592,11 +593,11 @@ static int match_this_proc(char *name, /* calculate how many ranks we want to allocate */ ranks_remaining = nr_ranks - nr_ranks_allocated; - nr_to_alloc = (max_matches < ranks_remaining) ? + nr_to_alloc = (max_matches < ranks_remaining) ? max_matches : ranks_remaining; while (nr_to_alloc > 0) { - cur_proc = find_name(name, procnames, used_procnames, nr_procnames, + cur_proc = find_name(name, procnames, used_procnames, nr_procnames, cur_proc); if (cur_proc < 0) { /* didn't find it */ @@ -612,14 +613,14 @@ static int match_this_proc(char *name, ranks[nr_ranks_allocated] = cur_proc; nr_ranks_allocated++; used_procnames[cur_proc] = 1; - + cur_proc++; nr_to_alloc--; } - + /* take all other instances of this host out of the list */ while (cur_proc >= 0) { - cur_proc = find_name(name, procnames, used_procnames, nr_procnames, + cur_proc = find_name(name, procnames, used_procnames, nr_procnames, cur_proc); if (cur_proc >= 0) { #ifdef CB_CONFIG_LIST_DEBUG @@ -632,17 +633,17 @@ static int match_this_proc(char *name, } return nr_ranks_allocated - old_nr_allocated; } - + /* find_name() - finds the first entry in procnames[] which matches name, * starting at index start_ind * * Returns an index [0..nr_procnames-1] on success, -1 if not found. */ -static int find_name(char *name, - char *procnames[], +static int find_name(char *name, + char *procnames[], char used_procnames[], - int nr_procnames, + int nr_procnames, int start_ind) { int i; @@ -689,7 +690,7 @@ static int get_max_procs(int cb_nodes) /* strip off next comma (if there is one) */ token = cb_config_list_lex(); if (token != AGG_COMMA && token != AGG_EOS) return -1; - + /* return max_procs */ if (max_procs < 0) return -1; else return max_procs; @@ -702,13 +703,13 @@ static int get_max_procs(int cb_nodes) * * Returns a token of types defined at top of this file. */ -#if defined(ROMIO_GPFS) +#if defined(BGQPLATFORM) /* On BlueGene, the ',' character shows up in get_processor_name, so we have to * use a different delimiter */ #define COLON ':' #define COMMA ';' #define DELIMS ":;" -#else +#else /* these tokens work for every other platform */ #define COLON ':' #define COMMA ',' @@ -745,7 +746,7 @@ static int cb_config_list_lex(void) /* it would be a good idea to look at the string and make sure that * it doesn't have any illegal characters in it. in particular we - * should ensure that no one tries to use wildcards with strings + * should ensure that no one tries to use wildcards with strings * (e.g. "ccn*"). */ ADIOI_Strncpy(yylval, token_ptr, slen); diff --git a/ompi/mca/io/romio314/romio/adio/common/eof_offset.c b/ompi/mca/io/romio321/romio/adio/common/eof_offset.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/common/eof_offset.c rename to ompi/mca/io/romio321/romio/adio/common/eof_offset.c index c503eaf94b..ea3c51f6ea 100644 --- a/ompi/mca/io/romio314/romio/adio/common/eof_offset.c +++ b/ompi/mca/io/romio321/romio/adio/common/eof_offset.c @@ -1,14 +1,14 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" #include "adio_extern.h" -/* return the current end of file in etype units relative to the +/* return the current end of file in etype units relative to the current view */ void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset) @@ -26,24 +26,24 @@ void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset) ADIO_Fcntl(fd, ADIO_FCNTL_GET_FSIZE, fcntl_struct, &error_code); fsize = fcntl_struct->fsize; ADIOI_Free(fcntl_struct); - + /* Find the offset in etype units corresponding to eof. - The eof could lie in a hole in the current view, or in the + The eof could lie in a hole in the current view, or in the middle of an etype. In that case the offset will be the offset corresponding to the start of the next etype in the current view.*/ ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); etype_size = fd->etype_size; - if (filetype_is_contig) + if (filetype_is_contig) *eof_offset = (fsize - fd->disp + etype_size - 1)/etype_size; /* ceiling division in case fsize is not a multiple of etype_size;*/ else { /* filetype already flattened in ADIO_Open */ flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) + while (flat_file->type != fd->filetype) flat_file = flat_file->next; - + MPI_Type_size_x(fd->filetype, &filetype_size); MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); @@ -55,14 +55,14 @@ void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset) n_filetypes++; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; - if (disp + flat_file->indices[i] + - n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + + if (disp + flat_file->indices[i] + + n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + flat_file->blocklens[i] >= fsize) { - if (disp + flat_file->indices[i] + + if (disp + flat_file->indices[i] + n_filetypes * ADIOI_AINT_CAST_TO_OFFSET filetype_extent >= fsize) sum -= flat_file->blocklens[i]; else { - rem = (disp + flat_file->indices[i] + + rem = (disp + flat_file->indices[i] + n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + flat_file->blocklens[i] - fsize); sum -= rem; diff --git a/ompi/mca/io/romio314/romio/adio/common/error.c b/ompi/mca/io/romio321/romio/adio/common/error.c similarity index 98% rename from ompi/mca/io/romio314/romio/adio/common/error.c rename to ompi/mca/io/romio321/romio/adio/common/error.c index 6417b943cb..20e211d9fc 100644 --- a/ompi/mca/io/romio314/romio/adio/common/error.c +++ b/ompi/mca/io/romio321/romio/adio/common/error.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -14,7 +14,7 @@ int ADIOI_Error(ADIO_File fd, int error_code, char *string) { char buf[MPI_MAX_ERROR_STRING]; - int myrank, result_len; + int myrank, result_len; MPI_Errhandler err_handler; if (fd == ADIO_FILE_NULL) err_handler = ADIOI_DFLT_ERR_HANDLER; @@ -114,7 +114,7 @@ int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_QUOTA, "**filequota", 0); - + break; default: error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io", diff --git a/ompi/mca/io/romio314/romio/adio/common/flatten.c b/ompi/mca/io/romio321/romio/adio/common/flatten.c similarity index 87% rename from ompi/mca/io/romio314/romio/adio/common/flatten.c rename to ompi/mca/io/romio321/romio/adio/common/flatten.c index 89da527e28..b468ec2f0f 100644 --- a/ompi/mca/io/romio314/romio/adio/common/flatten.c +++ b/ompi/mca/io/romio321/romio/adio/common/flatten.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ /* - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -110,10 +110,10 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype) ADIOI_Flatlist_node *flat, *prev=0; /* check if necessary to flatten. */ - + /* is it entirely contiguous? */ ADIOI_Datatype_iscontig(datatype, &is_contig); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: is_contig %#X\n",is_contig); #endif if (is_contig) return; @@ -122,7 +122,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype) flat = ADIOI_Flatlist; while (flat) { if (flat->type == datatype) { - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: found datatype %#X\n", datatype); #endif return; @@ -142,9 +142,10 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype) flat->next = NULL; flat->blocklens = NULL; flat->indices = NULL; + flat->lb_idx = flat->ub_idx = -1; flat->count = ADIOI_Count_contiguous_blocks(datatype, &curr_index); -#ifdef FLATTEN_DEBUG +#ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %llX, cur_idx = %#llX\n",flat->count,curr_index); #endif /* DBG_FPRINTF(stderr, "%d\n", flat->count);*/ @@ -153,17 +154,17 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype) flat->blocklens = (ADIO_Offset *) ADIOI_Malloc(flat->count * sizeof(ADIO_Offset)); flat->indices = (ADIO_Offset *) ADIOI_Malloc(flat->count * sizeof(ADIO_Offset)); } - + curr_index = 0; #ifdef HAVE_MPIR_TYPE_FLATTEN flatten_idx = (MPI_Aint) flat->count; MPIR_Type_flatten(datatype, flat->indices, flat->blocklens, &flatten_idx); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: MPIR_Type_flatten\n"); #endif #else ADIOI_Flatten(datatype, flat, 0, &curr_index); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: ADIOI_Flatten\n"); #endif @@ -173,7 +174,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype) #ifdef FLATTEN_DEBUG { int i; - for (i=0; icount; i++) + for (i=0; icount; i++) DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: i %#X, blocklens %#llX, indices %#llX\n", i, flat->blocklens[i], @@ -181,23 +182,23 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype) ); } #endif - } /* ADIOI_Flatten() * * Assumption: input datatype is not a basic!!!! */ -void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, +void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, ADIO_Offset st_offset, MPI_Count *curr_index) { - int i, k, m, n, basic_num, nonzeroth, is_hindexed_block=0; + int k, m, n, is_hindexed_block=0; + int lb_updated=0; int combiner, old_combiner, old_is_contig; int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes; - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset top_count; - MPI_Count j, old_size, prev_index, num; + MPI_Count i, j, old_size, prev_index, basic_num, num, nonzeroth; MPI_Aint old_extent, lb;/* Assume extents are non-negative */ int *ints; MPI_Aint *adds; /* Make no assumptions about +/- sign on these */ @@ -212,20 +213,20 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, types = (MPI_Datatype *) ADIOI_Malloc((ntypes+1)*sizeof(MPI_Datatype)); ADIOI_Type_get_contents(datatype, nints, nadds, ntypes, ints, adds, types); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index); DBG_FPRINTF(stderr,"ADIOI_Flatten:: nints %#X, nadds %#X, ntypes %#X\n",nints, nadds, ntypes); for(i=0; i< nints; ++i) { - DBG_FPRINTF(stderr,"ADIOI_Flatten:: ints[%d]=%#X\n",i,ints[i]); + DBG_FPRINTF(stderr,"ADIOI_Flatten:: ints[%lld]=%#X\n",i,ints[i]); } for(i=0; i< nadds; ++i) { - DBG_FPRINTF(stderr,"ADIOI_Flatten:: adds[%d]="MPI_AINT_FMT_HEX_SPEC"\n",i,adds[i]); + DBG_FPRINTF(stderr,"ADIOI_Flatten:: adds[%lld]="MPI_AINT_FMT_HEX_SPEC"\n",i,adds[i]); } for(i=0; i< ntypes; ++i) { - DBG_FPRINTF(stderr,"ADIOI_Flatten:: types[%d]=%#llX\n",i,(unsigned long long)(unsigned long)types[i]); + DBG_FPRINTF(stderr,"ADIOI_Flatten:: types[%lld]=%#llX\n",i,(unsigned long long)(unsigned long)types[i]); } #endif /* Chapter 4, page 83: when processing datatypes, note this item from the @@ -238,11 +239,11 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, switch (combiner) { #ifdef MPIIMPL_HAVE_MPI_COMBINER_DUP case MPI_COMBINER_DUP: - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DUP\n"); #endif ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) ADIOI_Flatten(types[0], flat, st_offset, curr_index); @@ -253,7 +254,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, { int dims = ints[0]; MPI_Datatype stype; - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_SUBARRAY\n"); #endif @@ -274,7 +275,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, { int dims = ints[2]; MPI_Datatype dtype; - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY\n"); #endif @@ -288,12 +289,12 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, ints[4*dims+3], /* order */ types[0], &dtype); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n", 0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index); #endif ADIOI_Flatten(dtype, flat, st_offset, curr_index); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY >ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n", 0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index); #endif @@ -302,12 +303,12 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, break; #endif case MPI_COMBINER_CONTIGUOUS: - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_CONTIGUOUS\n"); #endif top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -320,7 +321,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, flat->indices[j] = st_offset; MPI_Type_size_x(types[0], &old_size); flat->blocklens[j] = top_count * old_size; - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]); #endif (*curr_index)++; @@ -336,7 +337,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, for (i=0; iindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; flat->blocklens[j] = flat->blocklens[j-num]; - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: derived flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]); #endif j++; @@ -346,13 +347,13 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } break; - case MPI_COMBINER_VECTOR: - #ifdef FLATTEN_DEBUG + case MPI_COMBINER_VECTOR: + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_VECTOR\n"); #endif top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -361,7 +362,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, if (prev_index == *curr_index) { /* simplest case, vector of basic or contiguous types */ - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset blocklength = ints[1], stride = ints[2]; j = *curr_index; @@ -376,7 +377,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } else { /* vector of noncontiguous derived types */ - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset blocklength = ints[1], stride = ints[2]; @@ -408,14 +409,14 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } break; - case MPI_COMBINER_HVECTOR: - case MPI_COMBINER_HVECTOR_INTEGER: - #ifdef FLATTEN_DEBUG + case MPI_COMBINER_HVECTOR: + case MPI_COMBINER_HVECTOR_INTEGER: + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_HVECTOR_INTEGER\n"); #endif top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -424,7 +425,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, if (prev_index == *curr_index) { /* simplest case, vector of basic or contiguous types */ - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset blocklength = ints[1]; j = *curr_index; @@ -439,7 +440,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } else { /* vector of noncontiguous derived types */ - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset blocklength = ints[1]; @@ -471,20 +472,20 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } break; - case MPI_COMBINER_INDEXED: - #ifdef FLATTEN_DEBUG + case MPI_COMBINER_INDEXED: + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_INDEXED\n"); #endif top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); MPI_Type_get_extent(types[0], &lb, &old_extent); prev_index = *curr_index; if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) { - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset stride = ints[top_count+1]; ADIOI_Flatten(types[0], flat, @@ -495,7 +496,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, /* simplest case, indexed type made up of basic or contiguous types */ j = *curr_index; for (i=j, nonzeroth=i; i2G integer arithmetic problems */ ADIO_Offset blocklength = ints[1+i-j], stride = ints[top_count+1+i-j]; if (blocklength > 0) { @@ -540,7 +541,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, num = *curr_index - prev_index; prev_index = *curr_index; for (m=0, nonzeroth=j; m2G integer arithmetic problems */ ADIO_Offset stride = ints[top_count+1+i]-ints[top_count+i]; if (flat->blocklens[j-num] > 0 ) { @@ -578,19 +579,19 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, /* deliberate fall-through */ #endif case MPI_COMBINER_INDEXED_BLOCK: - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_INDEXED_BLOCK\n"); #endif top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); MPI_Type_get_extent(types[0], &lb, &old_extent); prev_index = *curr_index; if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) { - /* By using ADIO_Offset we preserve +/- sign and + /* By using ADIO_Offset we preserve +/- sign and avoid >2G integer arithmetic problems */ ADIO_Offset stride = ints[1+1]; if (is_hindexed_block) { @@ -606,7 +607,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, /* simplest case, indexed type made up of basic or contiguous types */ j = *curr_index; for (i=j; i2G integer arithmetic problems */ ADIO_Offset blocklength = ints[1]; if (is_hindexed_block) { @@ -665,20 +666,20 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } break; - case MPI_COMBINER_HINDEXED: + case MPI_COMBINER_HINDEXED: case MPI_COMBINER_HINDEXED_INTEGER: - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_HINDEXED_INTEGER\n"); #endif top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) { - ADIOI_Flatten(types[0], flat, st_offset+adds[0], curr_index); + ADIOI_Flatten(types[0], flat, st_offset+adds[0], curr_index); } if (prev_index == *curr_index) { @@ -756,15 +757,15 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } break; - case MPI_COMBINER_STRUCT: - case MPI_COMBINER_STRUCT_INTEGER: - #ifdef FLATTEN_DEBUG + case MPI_COMBINER_STRUCT: + case MPI_COMBINER_STRUCT_INTEGER: + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_STRUCT_INTEGER\n"); #endif top_count = ints[0]; for (n=0; n2G integer arithmetic problems */ if (ints[1+n] > 0) { ADIO_Offset blocklength = ints[1+n]; @@ -811,8 +812,8 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } break; - case MPI_COMBINER_RESIZED: - #ifdef FLATTEN_DEBUG + case MPI_COMBINER_RESIZED: + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_RESIZED\n"); #endif @@ -820,22 +821,36 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, /* handle the Lb */ j = *curr_index; - flat->indices[j] = st_offset + adds[0]; - /* this zero-length blocklens[] element, unlike eleswhere in the - * flattening code, is correct and is used to indicate a lower bound - * marker */ - flat->blocklens[j] = 0; + /* when we process resized types, we (recursively) process the lower + * bound, the type being resized, then the upper bound. In the + * resized-of-resized case, we might find ourselves updating the upper + * bound based on the inner type, but the lower bound based on the + * upper type. check both lb and ub to prevent mixing updates */ + if (flat->lb_idx == -1 && flat->ub_idx == -1) { + flat->indices[j] = st_offset + adds[0]; + /* this zero-length blocklens[] element, unlike eleswhere in the + * flattening code, is correct and is used to indicate a lower bound + * marker */ + flat->blocklens[j] = 0; + flat->lb_idx = *curr_index; + lb_updated=1; - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]); - #endif + #ifdef FLATTEN_DEBUG + DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]); + #endif - (*curr_index)++; + (*curr_index)++; + } else { + /* skipped over this chunk because something else higher-up in the + * type construction set this for us already */ + flat->count--; + st_offset -= adds[0]; + } /* handle the datatype */ ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) { @@ -848,7 +863,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, MPI_Type_size_x(types[0], &old_size); flat->blocklens[j] = old_size; - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]); #endif @@ -856,13 +871,22 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, } /* take care of the extent as a UB */ - j = *curr_index; - flat->indices[j] = st_offset + adds[0] + adds[1]; - /* again, zero-element ok: an upper-bound marker explicitly set by the - * constructor of this resized type */ - flat->blocklens[j] = 0; + /* see note above about mixing updates for why we check lb and ub */ + if ((flat->lb_idx == -1 && flat->ub_idx == -1) || lb_updated) { + j = *curr_index; + flat->indices[j] = st_offset + adds[0] + adds[1]; + /* again, zero-element ok: an upper-bound marker explicitly set by the + * constructor of this resized type */ + flat->blocklens[j] = 0; + flat->ub_idx = *curr_index; + } else { + /* skipped over this chunk because something else higher-up in the + * type construction set this for us already */ + flat->count--; + (*curr_index)--; + } - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]); #endif @@ -890,7 +914,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, ADIOI_Free(adds); ADIOI_Free(types); - #ifdef FLATTEN_DEBUG + #ifdef FLATTEN_DEBUG DBG_FPRINTF(stderr,"ADIOI_Flatten:: return st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index); #endif @@ -923,13 +947,13 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i ints = (int *) ADIOI_Malloc((nints+1)*sizeof(int)); adds = (MPI_Aint *) ADIOI_Malloc((nadds+1)*sizeof(MPI_Aint)); types = (MPI_Datatype *) ADIOI_Malloc((ntypes+1)*sizeof(MPI_Datatype)); - ADIOI_Type_get_contents(datatype, nints, nadds, ntypes, ints, adds, types); + MPI_Type_get_contents(datatype, nints, nadds, ntypes, ints, adds, types); switch (combiner) { #ifdef MPIIMPL_HAVE_MPI_COMBINER_DUP case MPI_COMBINER_DUP: ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) count = ADIOI_Count_contiguous_blocks(types[0], curr_index); @@ -988,7 +1012,7 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i case MPI_COMBINER_CONTIGUOUS: top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -996,7 +1020,7 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i count = ADIOI_Count_contiguous_blocks(types[0], curr_index); else count = 1; - if (prev_index == *curr_index) + if (prev_index == *curr_index) /* simplest case, made up of basic or contiguous types */ (*curr_index)++; else { @@ -1009,10 +1033,10 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i case MPI_COMBINER_VECTOR: case MPI_COMBINER_HVECTOR: - case MPI_COMBINER_HVECTOR_INTEGER: + case MPI_COMBINER_HVECTOR_INTEGER: top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -1042,12 +1066,12 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i } break; - case MPI_COMBINER_INDEXED: + case MPI_COMBINER_INDEXED: case MPI_COMBINER_HINDEXED: case MPI_COMBINER_HINDEXED_INTEGER: top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -1083,7 +1107,7 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i case MPI_COMBINER_INDEXED_BLOCK: top_count = ints[0]; ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); + &old_ntypes, &old_combiner); ADIOI_Datatype_iscontig(types[0], &old_is_contig); prev_index = *curr_index; @@ -1111,13 +1135,13 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i } break; - case MPI_COMBINER_STRUCT: - case MPI_COMBINER_STRUCT_INTEGER: + case MPI_COMBINER_STRUCT: + case MPI_COMBINER_STRUCT_INTEGER: top_count = ints[0]; count = 0; for (n=0; ncount - 1); i++) { if ((flat_type->indices[i] + flat_type->blocklens[i] != @@ -1232,7 +1256,7 @@ void ADIOI_Optimize_flattened(ADIOI_Flatlist_node *flat_type) j++; opt_indices[j] = flat_type->indices[i + 1]; opt_blocklens[j] = flat_type->blocklens[i + 1]; - } + } } flat_type->count = opt_blocks; ADIOI_Free(flat_type->blocklens); @@ -1258,3 +1282,12 @@ void ADIOI_Delete_flattened(MPI_Datatype datatype) ADIOI_Free(flat); } } + +ADIOI_Flatlist_node * ADIOI_Flatten_and_find(MPI_Datatype datatype) +{ + ADIOI_Flatlist_node *node; + ADIOI_Flatten_datatype(datatype); + node = ADIOI_Flatlist; + while (node->type != datatype) node = node->next; + return node; +} diff --git a/ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c b/ompi/mca/io/romio321/romio/adio/common/get_fp_posn.c similarity index 90% rename from ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c rename to ompi/mca/io/romio321/romio/adio/common/get_fp_posn.c index 785b662922..f2e025d00f 100644 --- a/ompi/mca/io/romio314/romio/adio/common/get_fp_posn.c +++ b/ompi/mca/io/romio321/romio/adio/common/get_fp_posn.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -20,7 +20,7 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset) int filetype_is_contig; MPI_Aint filetype_extent, lb; ADIO_Offset disp, byte_offset, sum=0, size_in_file, n_filetypes, frd_size; - + ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); etype_size = fd->etype_size; @@ -42,10 +42,10 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset) n_filetypes++; for (i=0; icount; i++) { sum += flat_file->blocklens[i]; - if (disp + flat_file->indices[i] + - n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + flat_file->blocklens[i] + if (disp + flat_file->indices[i] + + n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + flat_file->blocklens[i] >= byte_offset) { - frd_size = disp + flat_file->indices[i] + + frd_size = disp + flat_file->indices[i] + n_filetypes * ADIOI_AINT_CAST_TO_OFFSET filetype_extent + flat_file->blocklens[i] - byte_offset; sum -= frd_size; diff --git a/ompi/mca/io/romio314/romio/adio/common/greq_fns.c b/ompi/mca/io/romio321/romio/adio/common/greq_fns.c similarity index 88% rename from ompi/mca/io/romio314/romio/adio/common/greq_fns.c rename to ompi/mca/io/romio321/romio/adio/common/greq_fns.c index 5be6f4d167..aff8ff77e5 100644 --- a/ompi/mca/io/romio314/romio/adio/common/greq_fns.c +++ b/ompi/mca/io/romio321/romio/adio/common/greq_fns.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -25,7 +25,7 @@ void MPIO_Completed_request_create(MPI_File *fh, MPI_Offset bytes, if (*error_code != MPI_SUCCESS) *error_code = MPIO_Err_return_file(*fh, *error_code); /* --END ERROR HANDLING-- */ - MPI_Grequest_start(MPIU_Greq_query_fn, MPIU_Greq_free_fn, + MPI_Grequest_start(MPIU_Greq_query_fn, MPIU_Greq_free_fn, MPIU_Greq_cancel_fn, status, request); MPI_Grequest_complete(*request); } diff --git a/ompi/mca/io/romio314/romio/adio/common/heap-sort.c b/ompi/mca/io/romio321/romio/adio/common/heap-sort.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/common/heap-sort.c rename to ompi/mca/io/romio321/romio/adio/common/heap-sort.c index e9b19f5efa..c398e41aee 100644 --- a/ompi/mca/io/romio314/romio/adio/common/heap-sort.c +++ b/ompi/mca/io/romio321/romio/adio/common/heap-sort.c @@ -1,15 +1,15 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2008 University of Chicago. + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ +#include "heap-sort.h" #include #include #include #include -#include "heap-sort.h" #define NOEXP2 @@ -97,7 +97,7 @@ void ADIOI_Heap_extract_min(heap_t *heap, ADIO_Offset* offset, int *proc, ADIO_Offset *reg_max_len) { heap_node_t *nodes; nodes = heap->nodes; - + assert (heap->size > 0); *offset = nodes[0].offset; *proc = nodes[0].proc; @@ -121,7 +121,7 @@ static void print_heap(heap_t *heap) printf ("offsets:\n"); for (i=0; i < heap->size; i++) { printf ("%lld ", heap->nodes[i].offset); - + if ((i+1) == next_level_idx) { printf ("\n"); next_level_idx += (int) exp2(level+1); diff --git a/ompi/mca/io/romio314/romio/adio/common/hint_fns.c b/ompi/mca/io/romio321/romio/adio/common/hint_fns.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/common/hint_fns.c rename to ompi/mca/io/romio321/romio/adio/common/hint_fns.c index ef447db6e0..284e4a9627 100644 --- a/ompi/mca/io/romio314/romio/adio/common/hint_fns.c +++ b/ompi/mca/io/romio321/romio/adio/common/hint_fns.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * * Copyright (C) 2013 UChicago/Argonne, LLC * See COPYRIGHT notice in top-level directory. @@ -9,10 +9,10 @@ #include "hint_fns.h" -int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *key, +int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *key, int *local_cache, char *funcname, int *error_code) { - int intval, tmp_val, flag; + int intval, tmp_val, flag, ret=0; char *value; value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); @@ -35,9 +35,10 @@ int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *ke /* --BEGIN ERROR HANDLING-- */ if (tmp_val != intval) { MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname, - key, + key, error_code); - return -1; + ret = -1; + goto fn_exit; } /* --END ERROR HANDLING-- */ @@ -45,14 +46,15 @@ int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *ke /* some file systems do not cache hints in the fd struct */ if (local_cache != NULL) *local_cache = intval; } +fn_exit: ADIOI_Free(value); - return 0; + return ret; } -int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char *key, +int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char *key, int *local_cache, char *funcname, int *error_code) { - int tmp_val, flag; + int tmp_val, flag, ret=0; char *value; value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); @@ -90,17 +92,19 @@ int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname, key, error_code); - return -1; + ret = -1; + goto fn_exit; } /* --END ERROR HANDLING-- */ } +fn_exit: ADIOI_Free(value); - return 0; + return ret; } -int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *key, +int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *key, int *local_cache, char *funcname, int *error_code) { - int flag, tmp_val; + int flag, tmp_val, ret=0; char *value; value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); @@ -132,18 +136,19 @@ int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *k MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname, key, error_code); - return -1; + ret = -1; + goto fn_exit; } /* --END ERROR HANDLING-- */ } - +fn_exit: ADIOI_Free(value); - return 0; + return ret; } -int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key, +int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key, char **local_cache, char *funcname, int *error_code) { - int flag; + int flag, ret=0; size_t len; char *value; @@ -171,14 +176,16 @@ int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *ke __LINE__, MPI_ERR_OTHER, "**nomem2",0); - return -1; + ret = -1; + goto fn_exit; } ADIOI_Strncpy(*local_cache, value, len); } - /* if it has been set already, we ignore it the second time. + /* if it has been set already, we ignore it the second time. * otherwise we would get an error if someone used the same * info value with a cb_config_list value in it in a couple * of calls, which would be irritating. */ +fn_exit: ADIOI_Free(value); - return 0; + return ret; } diff --git a/ompi/mca/io/romio314/romio/adio/common/iscontig.c b/ompi/mca/io/romio321/romio/adio/common/iscontig.c similarity index 97% rename from ompi/mca/io/romio314/romio/adio/common/iscontig.c rename to ompi/mca/io/romio321/romio/adio/common/iscontig.c index 58eead89da..3c8aa712f4 100644 --- a/ompi/mca/io/romio314/romio/adio/common/iscontig.c +++ b/ompi/mca/io/romio321/romio/adio/common/iscontig.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -80,7 +80,7 @@ void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) adds = (MPI_Aint *) ADIOI_Malloc((nadds+1)*sizeof(MPI_Aint)); types = (MPI_Datatype *) ADIOI_Malloc((ntypes+1)*sizeof(MPI_Datatype)); MPI_Type_get_contents(datatype, nints, nadds, ntypes, ints, - adds, types); + adds, types); ADIOI_Datatype_iscontig(types[0], flag); #ifndef MPISGI @@ -99,7 +99,7 @@ void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) break; } - /* This function needs more work. It should check for contiguity + /* This function needs more work. It should check for contiguity in other cases as well.*/ } #endif diff --git a/ompi/mca/io/romio314/romio/adio/common/lock.c b/ompi/mca/io/romio321/romio/adio/common/lock.c similarity index 91% rename from ompi/mca/io/romio314/romio/adio/common/lock.c rename to ompi/mca/io/romio321/romio/adio/common/lock.c index 6fcff9e690..2590d77433 100644 --- a/ompi/mca/io/romio314/romio/adio/common/lock.c +++ b/ompi/mca/io/romio321/romio/adio/common/lock.c @@ -1,18 +1,18 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" #ifdef ROMIO_NTFS -/* This assumes that lock will always remain in the common directory and +/* This assumes that lock will always remain in the common directory and * that the ntfs directory will always be called ad_ntfs. */ #include "..\ad_ntfs\ad_ntfs.h" int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, - ADIO_Offset len) + ADIO_Offset len) { static char myname[] = "ADIOI_Set_lock"; int ret_val, error_code = MPI_SUCCESS; @@ -33,17 +33,17 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, if (cmd == ADIOI_LOCK_CMD) { /*printf("locking %d\n", (int)fd);fflush(stdout);*/ - ret_val = LockFileEx(fd, dwFlags, 0, - ( (DWORD) ( len & (__int64) 0xFFFFFFFF ) ), - ( (DWORD) ( (len >> 32) & (__int64) 0xFFFFFFFF ) ), + ret_val = LockFileEx(fd, dwFlags, 0, + ( (DWORD) ( len & (__int64) 0xFFFFFFFF ) ), + ( (DWORD) ( (len >> 32) & (__int64) 0xFFFFFFFF ) ), &Overlapped); } else { /*printf("unlocking %d\n", (int)fd);fflush(stdout);*/ - ret_val = UnlockFileEx(fd, 0, - ( (DWORD) ( len & (__int64) 0xFFFFFFFF ) ), - ( (DWORD) ( (len >> 32) & (__int64) 0xFFFFFFFF ) ), + ret_val = UnlockFileEx(fd, 0, + ( (DWORD) ( len & (__int64) 0xFFFFFFFF ) ), + ( (DWORD) ( (len >> 32) & (__int64) 0xFFFFFFFF ) ), &Overlapped); } #else @@ -91,7 +91,7 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, } #else int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, - ADIO_Offset len) + ADIO_Offset len) { int err, error_code, err_count = 0, sav_errno; struct flock lock; @@ -99,13 +99,13 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, if (len == 0) return MPI_SUCCESS; - /* Depending on the compiler flags and options, struct flock + /* Depending on the compiler flags and options, struct flock may not be defined with types that are the same size as ADIO_Offsets. */ /* FIXME: This is a temporary hack until we use flock64 where available. It also doesn't fix the broken Solaris header sys/types.h header file, which declars off_t as a UNION ! Configure tests to - see if the off64_t is a union if large file support is requested; + see if the off64_t is a union if large file support is requested; if so, it does not select large file support. */ #ifdef NEEDS_INT_CAST_WITH_FLOCK @@ -131,16 +131,16 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, { if((err_count < 5) || (err_count > 9995)) { - fprintf(stderr, "File locking failed in ADIOI_Set_lock(fd %#X,cmd %s/%#X,type %s/%#X,whence %#X) with return value %#X and errno %#X. Retry (%d).\n", + fprintf(stderr, "File locking failed in ADIOI_Set_lock(fd %#X,cmd %s/%#X,type %s/%#X,whence %#X) with return value %#X and errno %#X. Retry (%d).\n", fd, ((cmd == F_GETLK )? "F_GETLK" : ((cmd == F_SETLK )? "F_SETLK" : ((cmd == F_SETLKW )? "F_SETLKW" : "UNEXPECTED"))), - cmd, + cmd, ((type == F_RDLCK )? "F_RDLCK" : ((type == F_WRLCK )? "F_WRLCK" : ((type == F_UNLCK )? "F_UNLOCK" : "UNEXPECTED"))), - type, + type, whence, err, errno, err_count); perror("ADIOI_Set_lock:"); fprintf(stderr,"ADIOI_Set_lock:offset %#llx, length %#llx\n",(unsigned long long)offset, (unsigned long long)len); @@ -151,7 +151,7 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, } while (err && ((errno == EINTR) || ((errno == EINPROGRESS) && (++err_count < 10000)))); if (err && (errno != EBADF)) { - /* FIXME: This should use the error message system, + /* FIXME: This should use the error message system, especially for MPICH */ FPRINTF(stderr, "This requires fcntl(2) to be implemented. As of 8/25/2011 it is not. Generic MPICH Message: File locking failed in ADIOI_Set_lock(fd %X,cmd %s/%X,type %s/%X,whence %X) with return value %X and errno %X.\n" "- If the file system is NFS, you need to use NFS version 3, ensure that the lockd daemon is running on all the machines, and mount the directory with the 'noac' option (no attribute caching).\n" @@ -160,11 +160,11 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, ((cmd == F_GETLK )? "F_GETLK" : ((cmd == F_SETLK )? "F_SETLK" : ((cmd == F_SETLKW )? "F_SETLKW" : "UNEXPECTED"))), - cmd, + cmd, ((type == F_RDLCK )? "F_RDLCK" : ((type == F_WRLCK )? "F_WRLCK" : ((type == F_UNLCK )? "F_UNLOCK" : "UNEXPECTED"))), - type, + type, whence, err, errno); perror("ADIOI_Set_lock:"); FPRINTF(stderr,"ADIOI_Set_lock:offset %llu, length %llu\n",(unsigned long long)offset, (unsigned long long)len); @@ -182,7 +182,7 @@ int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, #if (defined(ROMIO_HFS) || defined(ROMIO_XFS)) int ADIOI_Set_lock64(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, - ADIO_Offset len) + ADIO_Offset len) { int err, error_code; struct flock64 lock; @@ -208,11 +208,11 @@ int ADIOI_Set_lock64(FDTYPE fd, int cmd, int type, ADIO_Offset offset, ((cmd == F_GETLK64 )? "F_GETLK64" : ((cmd == F_SETLK64 )? "F_SETLK64" : ((cmd == F_SETLKW64)? "F_SETLKW64" : "UNEXPECTED")))))), - cmd, + cmd, ((type == F_RDLCK )? "F_RDLCK" : ((type == F_WRLCK )? "F_WRLCK" : ((type == F_UNLCK )? "F_UNLOCK" : "UNEXPECTED"))), - type, + type, whence, err, errno); perror("ADIOI_Set_lock64:"); FPRINTF(stderr,"ADIOI_Set_lock:offset %llu, length %llu\n",(unsigned long long)offset, (unsigned long long)len); diff --git a/ompi/mca/io/romio314/romio/adio/common/malloc.c b/ompi/mca/io/romio321/romio/adio/common/malloc.c similarity index 92% rename from ompi/mca/io/romio314/romio/adio/common/malloc.c rename to ompi/mca/io/romio321/romio/adio/common/malloc.c index 03e90e38df..73c5a70705 100644 --- a/ompi/mca/io/romio314/romio/adio/common/malloc.c +++ b/ompi/mca/io/romio321/romio/adio/common/malloc.c @@ -1,17 +1,17 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ /* These are routines for allocating and deallocating memory. They should be called as ADIOI_Malloc(size) and - ADIOI_Free(ptr). In adio.h, they are macro-replaced to - ADIOI_Malloc(size,__LINE__,__FILE__) and + ADIOI_Free(ptr). In adio.h, they are macro-replaced to + ADIOI_Malloc(size,__LINE__,__FILE__) and ADIOI_Free(ptr,__LINE__,__FILE__). - Later on, add some tracing and error checking, similar to + Later on, add some tracing and error checking, similar to MPID_trmalloc. */ #include "adio.h" diff --git a/ompi/mca/io/romio321/romio/adio/common/onesided_aggregation.c b/ompi/mca/io/romio321/romio/adio/common/onesided_aggregation.c new file mode 100644 index 0000000000..3e0ad1f8fc --- /dev/null +++ b/ompi/mca/io/romio321/romio/adio/common/onesided_aggregation.c @@ -0,0 +1,2174 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2015 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "adio.h" +#include "adio_extern.h" +#ifdef ROMIO_GPFS +/* right now this is GPFS only but TODO: extend this to all file systems */ +#include "../ad_gpfs/ad_gpfs_tuning.h" +#else +int gpfsmpio_onesided_no_rmw = 0; +int gpfsmpio_write_aggmethod = 0; +int gpfsmpio_read_aggmethod = 0; +int gpfsmpio_onesided_always_rmw = 0; +#endif + +#include + +// #define onesidedtrace 1 + + +/* This data structure holds the number of extents, the index into the flattened buffer and the remnant length + * beyond the flattened buffer index corresponding to the base buffer offset for non-contiguous source data + * for the range to be written coresponding to the round and target agg. + */ +typedef struct NonContigSourceBufOffset { + int dataTypeExtent; + int flatBufIndice; + ADIO_Offset indiceOffset; +} NonContigSourceBufOffset; + +/* This data structure holds the access state of the source buffer for target + * file domains within aggregators corresponding to the target data blocks. It + * is designed to be initialized with a starting point for a given file domain + * with an aggregator, after which the data access for data written to a given + * file domain from this compute is linear and uninterupted, and this serves as + * a key optimization for feeding the target aggs. For contigous source data + * the starting point is a single-value offset, for non-contiguous data it is + * the number of extents, the index into the flattened buffer and the remnant + * length beyond the flattened buffer index. The validity of the usage of this + * structure relies on the requirement that only 1 aggregator can write to a + * given file domain. */ +typedef struct FDSourceBufferState { + + ADIO_Offset indiceOffset; + MPI_Aint bufTypeExtent; + int dataTypeExtent; + int flatBufIndice; + + ADIO_Offset sourceBufferOffset; + +} FDSourceBufferState; + + +static int ADIOI_OneSidedSetup(ADIO_File fd, int procs) { + int ret = MPI_SUCCESS; + + ret = MPI_Win_create(fd->io_buf,fd->hints->cb_buffer_size,1, + MPI_INFO_NULL,fd->comm, &fd->io_buf_window); + if (ret != MPI_SUCCESS) goto fn_exit; + fd->io_buf_put_amounts = (int *) ADIOI_Malloc(procs*sizeof(int)); + ret =MPI_Win_create(fd->io_buf_put_amounts,procs*sizeof(int),sizeof(int), + MPI_INFO_NULL,fd->comm, &fd->io_buf_put_amounts_window); +fn_exit: + return ret; +} + +int ADIOI_OneSidedCleanup(ADIO_File fd) +{ + int ret = MPI_SUCCESS; + if (fd->io_buf_window != MPI_WIN_NULL) + ret = MPI_Win_free(&fd->io_buf_window); + if (fd->io_buf_put_amounts_window != MPI_WIN_NULL) + ret = MPI_Win_free(&fd->io_buf_put_amounts_window); + if (fd->io_buf_put_amounts != NULL) + ADIOI_Free(fd->io_buf_put_amounts); + + return ret; +} + +/* This funtion packs a contigous buffer of data from the non-contgious source + * buffer for a specified chunk of data and advances the FDSourceBufferState + * machinery, so subsequent calls with the FDSourceBufferState will return the + * next linear chunk. + * Parameters: + * in: sourceDataBuffer - pointer to source data buffer. + * in: flatBuf - pointer to flattened source data buffer + * in: targetNumBytes - number of bytes to return and advance. + * in: packing - whether data is being packed from the source buffer to the + * packed buffer (1) or unpacked from the packed buffer to the source + * buffer (0) + * in/out: currentFDSourceBufferState - pointer to FDSourceBufferState structure, current + * data used as starting point, will be updated with + * the new state after targetNumBytes advance. + * out: packedDataBufer - pointer to the output packed data buffer. If the + * value is NULL then no data will be written. + * + */ +inline static void nonContigSourceDataBufferAdvance(char *sourceDataBuffer, + ADIOI_Flatlist_node *flatBuf, int targetNumBytes, int packing, + FDSourceBufferState *currentFDSourceBufferState, char *packedDataBufer) +{ + // make currentDataTypeExtent and bufTypeExtent ADIO_Offset since they are + // used in offset calculations + ADIO_Offset currentIndiceOffset = currentFDSourceBufferState->indiceOffset; + ADIO_Offset bufTypeExtent = (ADIO_Offset)currentFDSourceBufferState->bufTypeExtent; + ADIO_Offset currentDataTypeExtent = + (ADIO_Offset)currentFDSourceBufferState->dataTypeExtent; + int currentFlatBufIndice = currentFDSourceBufferState->flatBufIndice; + + int targetSendDataIndex = 0; + +#ifdef onesidedtrace + printf("nonContigSourceDataBufferAdvance: currentFlatBufIndice is %d currentDataTypeExtent is %ld currentIndiceOffset is %ld\n",currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset); +#endif + + int remainingBytesToLoad = targetNumBytes; + while (remainingBytesToLoad > 0) { + if ((flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset) >= remainingBytesToLoad) { // we can get the rest of our data from this indice + ADIO_Offset physicalSourceBufferOffset = (currentDataTypeExtent * bufTypeExtent) + flatBuf->indices[currentFlatBufIndice] + currentIndiceOffset; + +#ifdef onesidedtrace + printf("loading remainingBytesToLoad %d from src buffer offset %ld to targetSendDataIndex %d\n",remainingBytesToLoad,physicalSourceBufferOffset,targetSendDataIndex); +#endif + + if (packedDataBufer != NULL) { + if (packing) + memcpy(&(packedDataBufer[targetSendDataIndex]),&(sourceDataBuffer[physicalSourceBufferOffset]),remainingBytesToLoad); + else + memcpy(&(sourceDataBuffer[physicalSourceBufferOffset]),&(packedDataBufer[targetSendDataIndex]),remainingBytesToLoad); + } + + targetSendDataIndex += remainingBytesToLoad; + currentIndiceOffset += (ADIO_Offset)remainingBytesToLoad; + if (currentIndiceOffset >= flatBuf->blocklens[currentFlatBufIndice]) { + currentIndiceOffset = (ADIO_Offset)0; + currentFlatBufIndice++; + if (currentFlatBufIndice == flatBuf->count) { + currentFlatBufIndice = 0; + currentDataTypeExtent++; + } + } + remainingBytesToLoad = 0; + + } + else { // we can only get part of our data from this indice + int amountDataToLoad = (flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset); + ADIO_Offset physicalSourceBufferOffset = (currentDataTypeExtent * bufTypeExtent) + flatBuf->indices[currentFlatBufIndice] + currentIndiceOffset; + +#ifdef onesidedtrace + printf("loading amountDataToLoad %d from src buffer offset %ld to targetSendDataIndex %d\n",amountDataToLoad,physicalSourceBufferOffset,targetSendDataIndex); +#endif + if (packedDataBufer != NULL) { + if (packing) + memcpy(&(packedDataBufer[targetSendDataIndex]),&(sourceDataBuffer[physicalSourceBufferOffset]),amountDataToLoad); + else + memcpy(&(sourceDataBuffer[physicalSourceBufferOffset]),&(packedDataBufer[targetSendDataIndex]),amountDataToLoad); + } + + targetSendDataIndex += amountDataToLoad; + currentIndiceOffset = (ADIO_Offset)0; + currentFlatBufIndice++; + if (currentFlatBufIndice == flatBuf->count) { + currentFlatBufIndice = 0; + currentDataTypeExtent++; + } + remainingBytesToLoad -= amountDataToLoad; + } + } // while + + /* update machinery with new flatbuf position + */ + currentFDSourceBufferState->indiceOffset = currentIndiceOffset; + currentFDSourceBufferState->dataTypeExtent = (int) currentDataTypeExtent; + currentFDSourceBufferState->flatBufIndice = currentFlatBufIndice; +#ifdef onesidedtrace + printf("source buf advanced to currentFlatBufIndice %d currentDataTypeExtent %ld currentIndiceOffset %ld\n",currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset); +#endif +} + + +void ADIOI_OneSidedWriteAggregation(ADIO_File fd, + ADIO_Offset *offset_list, + ADIO_Offset *len_list, + int contig_access_count, + const void *buf, + MPI_Datatype datatype, + int *error_code, + ADIO_Offset *st_offsets, + ADIO_Offset *end_offsets, + int numNonZeroDataOffsets, + ADIO_Offset *fd_start, + ADIO_Offset* fd_end, + int *hole_found) + +{ + int i,j; /* generic iterators */ + +#ifdef onesidedtrace + if (buf == NULL) { + printf("ADIOI_OneSidedWriteAggregation - buf is NULL contig_access_count is %d\n",contig_access_count); + for (i=0;i 0) + lenListOverZero = 1; + + + *error_code = MPI_SUCCESS; /* initialize to success */ + +#ifdef ROMIO_GPFS + double startTimeBase,endTimeBase; + startTimeBase = MPI_Wtime(); +#endif + + MPI_Status status; + pthread_t io_thread; + void *thread_ret; + ADIOI_IO_ThreadFuncData io_thread_args; + + int nprocs,myrank; + MPI_Comm_size(fd->comm, &nprocs); + MPI_Comm_rank(fd->comm, &myrank); +#ifdef onesidedtrace +printf("ADIOI_OneSidedWriteAggregation started on rank %d\n",myrank); +#endif + + + if (fd->io_buf_window == MPI_WIN_NULL || + fd->io_buf_put_amounts_window == MPI_WIN_NULL) + { + ADIOI_OneSidedSetup(fd, nprocs); + } + + /* This flag denotes whether the source datatype is contiguous, which is referenced throughout the algorithm + * and defines how the source buffer offsets and data chunks are determined. If the value is 1 (true - contiguous data) + * things are profoundly simpler in that the source buffer offset for a given target offset simply linearly increases + * by the chunk sizes being written. If the value is 0 (non-contiguous) then these values are based on calculations + * from the flattened source datatype. + */ + int bufTypeIsContig; + + MPI_Aint bufTypeExtent, lb; + ADIOI_Flatlist_node *flatBuf=NULL; + ADIOI_Datatype_iscontig(datatype, &bufTypeIsContig); + + if (!bufTypeIsContig) { + /* Flatten the non-contiguous source datatype and set the extent. */ + flatBuf = ADIOI_Flatten_and_find(datatype); + MPI_Type_get_extent(datatype, &lb, &bufTypeExtent); +#ifdef onesidedtrace + printf("flatBuf->count is %d bufTypeExtent is %d\n", flatBuf->count,bufTypeExtent); + for (i=0;icount;i++) + printf("flatBuf->blocklens[%d] is %d flatBuf->indices[%d] is %ld\n",i,flatBuf->blocklens[i],i,flatBuf->indices[i]); +#endif + } + + int naggs = fd->hints->cb_nodes; + + /* Track the state of the source buffer for feeding the target data blocks. + * For GPFS the number of file domains per agg is always 1 so we just need 1 agg + * dimension to track the data, in the case of lustre we will need 2 dimensions + * agg and file domain since aggs write to multiple file domains in the case of lustre. + * This structure will be modified as the data is written to reflect the current state + * of the offset. + */ + +#ifdef onesidedtrace + printf("sizeof(FDSourceBufferState) is %d - make sure is 32 for 32-byte memalign optimal\n",sizeof(FDSourceBufferState)); +#endif + FDSourceBufferState *currentFDSourceBufferState; + + currentFDSourceBufferState = (FDSourceBufferState *) ADIOI_Malloc(naggs * sizeof(FDSourceBufferState)); + for (i=0;ihints->ranklist */ + int iAmUsedAgg = 0; /* whether or not this rank is used as an aggregator. */ + + /* Make coll_bufsize an ADIO_Offset since it is used in calculations with offsets. + */ + ADIO_Offset coll_bufsize = (ADIO_Offset)(fd->hints->cb_buffer_size); +#ifdef ROMIO_GPFS + if (gpfsmpio_pthreadio == 1) { + /* split buffer in half for a kind of double buffering with the threads*/ + coll_bufsize = (ADIO_Offset)(fd->hints->cb_buffer_size/2); + } +#endif + + /* This logic defines values that are used later to determine what offsets define the portion + * of the file domain the agg is writing this round. + */ + int greatestFileDomainAggRank = -1,smallestFileDomainAggRank = -1; + ADIO_Offset greatestFileDomainOffset = 0; + ADIO_Offset smallestFileDomainOffset = lastFileOffset; + for (j=0;j greatestFileDomainOffset) { + greatestFileDomainOffset = fd_end[j]; + greatestFileDomainAggRank = j; + } + if (fd_start[j] < smallestFileDomainOffset) { + smallestFileDomainOffset = fd_start[j]; + smallestFileDomainAggRank = j; + } + if (fd->hints->ranklist[j] == myrank) { + myAggRank = j; + if (fd_end[j] > fd_start[j]) { + iAmUsedAgg = 1; + } + } + } + +#ifdef onesidedtrace + printf("contig_access_count is %d lastFileOffset is %ld firstFileOffset is %ld\n",contig_access_count,lastFileOffset,firstFileOffset); + for (j=0;j numberOfRounds) + numberOfRounds = currentNumberOfRounds; + } + + /* Data structures to track what data this compute needs to send to whom. + * For lustre they will all need another dimension for the file domain. + */ + int *targetAggsForMyData = (int *)ADIOI_Malloc(naggs * sizeof(int)); + ADIO_Offset *targetAggsForMyDataFDStart = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); + ADIO_Offset *targetAggsForMyDataFDEnd = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); + int numTargetAggs = 0; + + /* This data structure holds the beginning offset and len list index for the range to be written + * coresponding to the round and target agg. Initialize to -1 to denote being unset. + */ + int **targetAggsForMyDataFirstOffLenIndex = (int **)ADIOI_Malloc(numberOfRounds * sizeof(int *)); + for (i=0;ihints->ranklist[%d]is %d fd_start is %ld fd_end is %ld\n",i,fd->hints->ranklist[i],fd_start[i],fd_end[i]); + for (j=0;j 0) && (buf != NULL) && lenListOverZero) { + int blockIter; + for (blockIter=0;blockIter0) { + if (bufTypeIsContig) { + currentSourceBufferOffset += len_list[blockIter-1]; + } + else { + + /* Non-contiguous source datatype, count up the extents and indices to this point + * in the blocks for use in computing the source starting buffer offset for target aggs + * and file domains. + */ + ADIO_Offset sourceBlockTotal = 0; + int lastIndiceUsed = currentFlatBufIndice; + int numNonContigSourceChunks = 0; + + while (sourceBlockTotal < len_list[blockIter-1]) { + numNonContigSourceChunks++; + sourceBlockTotal += (flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset); + lastIndiceUsed = currentFlatBufIndice; + currentFlatBufIndice++; + if (currentFlatBufIndice == flatBuf->count) { + currentFlatBufIndice = 0; + currentDataTypeExtent++; + } + currentIndiceOffset = (ADIO_Offset)0; + } + if (sourceBlockTotal > len_list[blockIter-1]) { + currentFlatBufIndice--; + if (currentFlatBufIndice < 0 ) { + currentDataTypeExtent--; + currentFlatBufIndice = flatBuf->count-1; + } + currentIndiceOffset = len_list[blockIter-1] - (sourceBlockTotal - flatBuf->blocklens[lastIndiceUsed]); + // ADIOI_Assert((currentIndiceOffset >= 0) && (currentIndiceOffset < flatBuf->blocklens[currentFlatBufIndice])); + } + else + currentIndiceOffset = (ADIO_Offset)0; + maxNumContigOperations += (numNonContigSourceChunks+2); + if (numNonContigSourceChunks > maxNumNonContigSourceChunks) + maxNumNonContigSourceChunks = numNonContigSourceChunks; + +#ifdef onesidedtrace + printf("blockiter %d currentFlatBufIndice is now %d currentDataTypeExtent is now %d currentIndiceOffset is now %ld maxNumContigOperations is now %d\n",blockIter,currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset,maxNumContigOperations); +#endif + } // !bufTypeIsContig + } // blockIter > 0 + + /* For the last iteration we need to include these maxNumContigOperations and maxNumNonContigSourceChunks + * for non-contig case even though we did not need to compute the next starting offset. + */ + if ((blockIter == (contig_access_count-1)) && (!bufTypeIsContig)) { + ADIO_Offset sourceBlockTotal = 0; + int tmpCurrentFlatBufIndice = currentFlatBufIndice; + int lastNumNonContigSourceChunks = 0; + while (sourceBlockTotal < len_list[blockIter]) { + lastNumNonContigSourceChunks++; + sourceBlockTotal += flatBuf->blocklens[tmpCurrentFlatBufIndice]; + tmpCurrentFlatBufIndice++; + if (tmpCurrentFlatBufIndice == flatBuf->count) { + tmpCurrentFlatBufIndice = 0; + } + } + maxNumContigOperations += (lastNumNonContigSourceChunks+2); + if (lastNumNonContigSourceChunks > maxNumNonContigSourceChunks) + maxNumNonContigSourceChunks = lastNumNonContigSourceChunks; + + } + + ADIO_Offset blockStart = offset_list[blockIter], blockEnd = offset_list[blockIter]+len_list[blockIter]-(ADIO_Offset)1; + + /* Find the starting target agg for this block - normally it will be the current agg so guard the expensive + * while loop with a cheap if-check which for large numbers of small blocks will usually be false. + */ + if (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) { + while (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) + currentAggRankListIndex++; + }; + +#ifdef onesidedtrace + printf("currentAggRankListIndex is %d blockStart %ld blockEnd %ld fd_start[currentAggRankListIndex] %ld fd_end[currentAggRankListIndex] %ld\n",currentAggRankListIndex,blockStart,blockEnd,fd_start[currentAggRankListIndex],fd_end[currentAggRankListIndex]); +#endif + + /* Determine if this is a new target agg. + */ + if (blockIter>0) { + if ((offset_list[blockIter-1]+len_list[blockIter-1]-(ADIO_Offset)1) < fd_start[currentAggRankListIndex]) { + numTargetAggs++; + } + } + + /* Determine which round to start writing - data is written coll_bufsize per round from the aggregator + * so if our starting offset in the file domain is multiple coll_bufsize that will correspond to the round. + */ + if ((blockStart - fd_start[currentAggRankListIndex]) >= coll_bufsize) { + ADIO_Offset currentRoundBlockStart = fd_start[currentAggRankListIndex]; + int startingRound = 0; + while (blockStart > (currentRoundBlockStart + coll_bufsize - (ADIO_Offset)1)) { + currentRoundBlockStart+=coll_bufsize; + startingRound++; + } + targetAggsForMyDataCurrentRoundIter[numTargetAggs] = startingRound; + } + + /* Initialize the data structures if this is the first offset in the round/target agg. + */ + if (targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] == -1) { + targetAggsForMyData[numTargetAggs] = fd->hints->ranklist[currentAggRankListIndex]; + targetAggsForMyDataFDStart[numTargetAggs] = fd_start[currentAggRankListIndex]; + /* Round up file domain to the first actual offset used if this is the first file domain. + */ + if (currentAggRankListIndex == smallestFileDomainAggRank) { + if (targetAggsForMyDataFDStart[numTargetAggs] < firstFileOffset) + targetAggsForMyDataFDStart[numTargetAggs] = firstFileOffset; + } + targetAggsForMyDataFDEnd[numTargetAggs] = fd_end[currentAggRankListIndex]; + /* Round down file domain to the last actual offset used if this is the last file domain. + */ + if (currentAggRankListIndex == greatestFileDomainAggRank) { + if (targetAggsForMyDataFDEnd[numTargetAggs] > lastFileOffset) + targetAggsForMyDataFDEnd[numTargetAggs] = lastFileOffset; + } + targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; + /* Set the source buffer state starting point for data access for this + agg and file domain. */ + + if (bufTypeIsContig) { + if (currentFDSourceBufferState[numTargetAggs].sourceBufferOffset == -1) { + + currentFDSourceBufferState[numTargetAggs].sourceBufferOffset = currentSourceBufferOffset; +#ifdef onesidedtrace + printf("For agg %d sourceBufferOffset initialized to %ld\n",currentAggRankListIndex,currentSourceBufferOffset); +#endif + } + } + else { + if (currentFDSourceBufferState[numTargetAggs].indiceOffset == -1) { + currentFDSourceBufferState[numTargetAggs].indiceOffset = currentIndiceOffset; + currentFDSourceBufferState[numTargetAggs].bufTypeExtent = bufTypeExtent; + currentFDSourceBufferState[numTargetAggs].dataTypeExtent = currentDataTypeExtent; + currentFDSourceBufferState[numTargetAggs].flatBufIndice = currentFlatBufIndice; +#ifdef onesidedtrace + printf("For agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld\n",numTargetAggs,currentDataTypeExtent,currentFlatBufIndice,currentIndiceOffset); +#endif + } + } + + intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + ((ADIO_Offset)(targetAggsForMyDataCurrentRoundIter[numTargetAggs]+1) * coll_bufsize); + +#ifdef onesidedtrace + printf("Initial settings numTargetAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld currentSourceBufferOffset set to %ld intraRoundCollBufsizeOffset set to %ld\n",numTargetAggs,blockIter,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter],currentSourceBufferOffset,intraRoundCollBufsizeOffset); +#endif + } + + /* Replace the last offset block iter with this one. + */ + targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; + + /* If this blocks extends into the next file domain advance to the next target aggs and source buffer states. + */ + if (blockEnd > fd_end[currentAggRankListIndex]) { +#ifdef onesidedtrace + printf("block extends past current fd, blockEnd %ld >= fd_end[currentAggRankListIndex] %ld total block size is %ld blockStart was %ld\n",blockEnd,fd_end[currentAggRankListIndex], len_list[blockIter],blockStart); +#endif + ADIO_Offset amountToAdvanceSBOffsetForFD = 0; + int additionalFDCounter = 0; + + while (blockEnd >= fd_end[currentAggRankListIndex]) { + ADIO_Offset thisAggBlockEnd = fd_end[currentAggRankListIndex]; + if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { + while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { + targetAggsForMyDataCurrentRoundIter[numTargetAggs]++; + intraRoundCollBufsizeOffset += coll_bufsize; + targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; + targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; +#ifdef onesidedtrace + printf("targetAggsForMyDataCurrentRoundI%d] is now %d intraRoundCollBufsizeOffset is now %ld\n",numTargetAggs,targetAggsForMyDataCurrentRoundIter[numTargetAggs],intraRoundCollBufsizeOffset); +#endif + } // while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) + } // if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) + + int prevAggRankListIndex = currentAggRankListIndex; + currentAggRankListIndex++; + + /* Skip over unused aggs. + */ + if (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) { + while (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) + currentAggRankListIndex++; + + } // (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) + + /* Start new target agg. + */ + if (blockEnd >= fd_start[currentAggRankListIndex]) { + numTargetAggs++; + targetAggsForMyData[numTargetAggs] = fd->hints->ranklist[currentAggRankListIndex]; + targetAggsForMyDataFDStart[numTargetAggs] = fd_start[currentAggRankListIndex]; + /* Round up file domain to the first actual offset used if this is the first file domain. + */ + if (currentAggRankListIndex == smallestFileDomainAggRank) { + if (targetAggsForMyDataFDStart[numTargetAggs] < firstFileOffset) + targetAggsForMyDataFDStart[numTargetAggs] = firstFileOffset; + } + targetAggsForMyDataFDEnd[numTargetAggs] = fd_end[currentAggRankListIndex]; + /* Round down file domain to the last actual offset used if this is the last file domain. + */ + if (currentAggRankListIndex == greatestFileDomainAggRank) { + if (targetAggsForMyDataFDEnd[numTargetAggs] > lastFileOffset) + targetAggsForMyDataFDEnd[numTargetAggs] = lastFileOffset; + } + targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; + /* For the first additonal file domain the source buffer offset + * will be incremented relative to the state of this first main + * loop but for subsequent full file domains the offset will be + * incremented by the size + * of the file domain. + */ + if (additionalFDCounter == 0) + amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex] + - blockStart) + (ADIO_Offset)1; + else + amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex] + -fd_start[prevAggRankListIndex]) +(ADIO_Offset)1; + + if (bufTypeIsContig) { + ADIOI_Assert(numTargetAggs > 0); + if (currentFDSourceBufferState[numTargetAggs].sourceBufferOffset == -1) { + if (additionalFDCounter == 0) { // first file domain, still use the current data counter + currentFDSourceBufferState[numTargetAggs].sourceBufferOffset = + currentSourceBufferOffset+amountToAdvanceSBOffsetForFD; + } + else { // 2nd file domain, advance full file domain from last source buffer state + currentFDSourceBufferState[numTargetAggs].sourceBufferOffset = + currentFDSourceBufferState[numTargetAggs-1].sourceBufferOffset+amountToAdvanceSBOffsetForFD; + } + +#ifdef onesidedtrace + printf("Crossed into new FD - for agg %d sourceBufferOffset initialized to %ld amountToAdvanceSBOffsetForFD is %ld\n",numTargetAggs,currentFDSourceBufferState[numTargetAggs].sourceBufferOffset,amountToAdvanceSBOffsetForFD); +#endif + } + } + else if (currentFDSourceBufferState[numTargetAggs].indiceOffset == -1) { + // non-contiguos source buffer + ADIOI_Assert(numTargetAggs > 0); + + /* Initialize the source buffer state appropriately and then + * advance it with the + * nonContigSourceDataBufferAdvance function. + */ + if (additionalFDCounter == 0) { + // first file domain, still use the current data counter + currentFDSourceBufferState[numTargetAggs].indiceOffset = + currentIndiceOffset; + currentFDSourceBufferState[numTargetAggs].bufTypeExtent = bufTypeExtent; + currentFDSourceBufferState[numTargetAggs].dataTypeExtent = + currentDataTypeExtent; + currentFDSourceBufferState[numTargetAggs].flatBufIndice = + currentFlatBufIndice; + } + else { + // 2nd file domain, advance full file domain from last source buffer state + currentFDSourceBufferState[numTargetAggs].indiceOffset = + currentFDSourceBufferState[numTargetAggs-1].indiceOffset; + currentFDSourceBufferState[numTargetAggs].bufTypeExtent = + currentFDSourceBufferState[numTargetAggs-1].bufTypeExtent; + currentFDSourceBufferState[numTargetAggs].dataTypeExtent = + currentFDSourceBufferState[numTargetAggs-1].dataTypeExtent; + currentFDSourceBufferState[numTargetAggs].flatBufIndice = + currentFDSourceBufferState[numTargetAggs-1].flatBufIndice; + } + nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, + (int)amountToAdvanceSBOffsetForFD, 1, + ¤tFDSourceBufferState[numTargetAggs], NULL); +#ifdef onesidedtrace + printf("Crossed into new FD - for agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld amountToAdvanceSBOffsetForFD is %d\n",numTargetAggs,currentFDSourceBufferState[numTargetAggs].dataTypeExtent,currentFDSourceBufferState[numTargetAggs].flatBufIndice,currentFDSourceBufferState[numTargetAggs].indiceOffset,amountToAdvanceSBOffsetForFD); +#endif + } + additionalFDCounter++; + +#ifdef onesidedtrace + printf("block extended beyond fd init settings numTargetAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld\n",numTargetAggs,i,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter]); +#endif + intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + coll_bufsize; + targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; + } // if (blockEnd >= fd_start[currentAggRankListIndex]) + } // while (blockEnd >= fd_end[currentAggRankListIndex]) + } // if (blockEnd > fd_end[currentAggRankListIndex]) + + /* If we are still in the same file domain / target agg but have gone + * past the coll_bufsize and need to advance to the next round - + * initialize tracking data appropriately. + */ + if (blockEnd >= intraRoundCollBufsizeOffset) { + ADIO_Offset currentBlockEnd = blockEnd; + while (currentBlockEnd >= intraRoundCollBufsizeOffset) { + targetAggsForMyDataCurrentRoundIter[numTargetAggs]++; + intraRoundCollBufsizeOffset += coll_bufsize; + targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; + targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; +#ifdef onesidedtrace + printf("smaller than fd currentBlockEnd is now %ld intraRoundCollBufsizeOffset is now %ld targetAggsForMyDataCurrentRoundIter[%d] is now %d\n",currentBlockEnd, intraRoundCollBufsizeOffset, numTargetAggs,targetAggsForMyDataCurrentRoundIter[numTargetAggs]); +#endif + } // while (currentBlockEnd >= intraRoundCollBufsizeOffset) + } // if (blockEnd >= intraRoundCollBufsizeOffset) + + /* Need to advance numTargetAggs if this is the last target offset to + * include this one. + */ + if (blockIter == (contig_access_count-1)) + numTargetAggs++; + } + +#ifdef onesidedtrace + printf("numTargetAggs is %d\n",numTargetAggs); + for (i=0;i 0) && (buf != NULL) && lenListOverZero) + + ADIOI_Free(targetAggsForMyDataCurrentRoundIter); + + int currentWriteBuf = 0; + int useIOBuffer = 0; +#ifdef ROMIO_GPFS + if (gpfsmpio_pthreadio && (numberOfRounds>1)) { + useIOBuffer = 1; + io_thread = pthread_self(); + } +#endif + + /* use the write buffer allocated in the file_open */ + char *write_buf0 = fd->io_buf; + char *write_buf1 = fd->io_buf + coll_bufsize; + + /* start off pointing to the first buffer. If we use the 2nd buffer (threaded + * case) we'll swap later */ + char *write_buf = write_buf0; + MPI_Win write_buf_window = fd->io_buf_window; + + int *write_buf_put_amounts = fd->io_buf_put_amounts; + if(!gpfsmpio_onesided_no_rmw) { + *hole_found = 0; + for (i=0;i lastFileOffset) + currentRoundFDEnd = lastFileOffset; + } +#ifdef onesidedtrace +printf("iAmUsedAgg - currentRoundFDStart initialized to %ld currentRoundFDEnd to %ld\n",currentRoundFDStart,currentRoundFDEnd); +#endif + if (gpfsmpio_onesided_always_rmw) { // read in the first buffer + ADIO_Offset tmpCurrentRoundFDEnd = 0; + if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { + if (myAggRank == greatestFileDomainAggRank) { + if (fd_end[myAggRank] > lastFileOffset) + tmpCurrentRoundFDEnd = lastFileOffset; + else + tmpCurrentRoundFDEnd = fd_end[myAggRank]; + } + else + tmpCurrentRoundFDEnd = fd_end[myAggRank]; + } + else + tmpCurrentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; +#ifdef onesidedtrace +printf("gpfsmpio_onesided_always_rmw - first buffer pre-read for file offsets %ld to %ld total is %d\n",currentRoundFDStart,tmpCurrentRoundFDEnd,(int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1); +#endif + ADIO_ReadContig(fd, write_buf, (int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1, + MPI_BYTE, ADIO_EXPLICIT_OFFSET,currentRoundFDStart, &status, error_code); + + } + } + if (gpfsmpio_onesided_always_rmw) // wait until the first buffer is read + MPI_Barrier(fd->comm); + +#ifdef ROMIO_GPFS + endTimeBase = MPI_Wtime(); + gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_SETUP] += (endTimeBase-startTimeBase); + startTimeBase = MPI_Wtime(); +#endif + + /* This is the second main loop of the algorithm, actually nested loop of target aggs within rounds. There are 2 flavors of this. + * For gpfsmpio_write_aggmethod of 1 each nested iteration for the target + * agg does an mpi_put on a contiguous chunk using a primative datatype + * determined using the data structures from the first main loop. For + * gpfsmpio_write_aggmethod of 2 each nested iteration for the target agg + * builds up data to use in created a derived data type for 1 mpi_put that is done for the target agg for each round. + * To support lustre there will need to be an additional layer of nesting + * for the multiple file domains within target aggs. + */ + int roundIter; + + for (roundIter=0;roundIter 0) && (buf != NULL) && lenListOverZero) { + + + int aggIter; + for (aggIter=0;aggIter targetAggsForMyDataFDEnd[aggIter]) + currentRoundFDEndForMyTargetAgg = targetAggsForMyDataFDEnd[aggIter]; + + ADIO_Offset offsetStart = offset_list[offsetIter], offsetEnd = (offset_list[offsetIter]+len_list[offsetIter]-(ADIO_Offset)1); + +#ifdef onesidedtrace + printf("roundIter %d target iter %d targetAggsForMyData is %d offset_list[%d] is %ld len_list[%d] is %ld targetAggsForMyDataFDStart is %ld targetAggsForMyDataFDEnd is %ld currentRoundFDStartForMyTargetAgg is %ld currentRoundFDEndForMyTargetAgg is %ld targetAggsForMyDataFirstOffLenIndex is %ld\n", + roundIter,aggIter,targetAggsForMyData[aggIter],offsetIter,offset_list[offsetIter],offsetIter,len_list[offsetIter], + targetAggsForMyDataFDStart[aggIter],targetAggsForMyDataFDEnd[aggIter], + currentRoundFDStartForMyTargetAgg,currentRoundFDEndForMyTargetAgg, targetAggsForMyDataFirstOffLenIndex[roundIter][aggIter]); +#endif + + /* Determine the amount of data and exact source buffer offsets to use. + */ + int bufferAmountToSend = 0; + + if ((offsetStart >= currentRoundFDStartForMyTargetAgg) && (offsetStart <= currentRoundFDEndForMyTargetAgg)) { + if (offsetEnd > currentRoundFDEndForMyTargetAgg) + bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - offsetStart) +1; + else + bufferAmountToSend = (offsetEnd - offsetStart) +1; + } + else if ((offsetEnd >= currentRoundFDStartForMyTargetAgg) && (offsetEnd <= currentRoundFDEndForMyTargetAgg)) { + if (offsetEnd > currentRoundFDEndForMyTargetAgg) + bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - currentRoundFDStartForMyTargetAgg) +1; + else + bufferAmountToSend = (offsetEnd - currentRoundFDStartForMyTargetAgg) +1; + if (offsetStart < currentRoundFDStartForMyTargetAgg) { + offsetStart = currentRoundFDStartForMyTargetAgg; + } + } + else if ((offsetStart <= currentRoundFDStartForMyTargetAgg) && (offsetEnd >= currentRoundFDEndForMyTargetAgg)) { + bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - currentRoundFDStartForMyTargetAgg) +1; + offsetStart = currentRoundFDStartForMyTargetAgg; + } + + numBytesPutThisAggRound += bufferAmountToSend; +#ifdef onesidedtrace + printf("bufferAmountToSend is %d\n",bufferAmountToSend); +#endif + if (bufferAmountToSend > 0) { /* we have data to send this round */ + if (gpfsmpio_write_aggmethod == 2) { + /* Only allocate these arrays if we are using method 2 and only do it once for this round/target agg. + */ + if (!allocatedDerivedTypeArrays) { + targetAggBlockLengths = (int *)ADIOI_Malloc(maxNumContigOperations * sizeof(int)); + targetAggDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); + sourceBufferDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); + targetAggDataTypes = (MPI_Datatype *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Datatype)); + if (!bufTypeIsContig) { + int k; + for (k=targetAggsForMyDataFirstOffLenIndex[roundIter][aggIter];k<=targetAggsForMyDataLastOffLenIndex[roundIter][aggIter];k++) + amountOfDataWrittenThisRoundAgg += len_list[k]; + +#ifdef onesidedtrace + printf("derivedTypePackedSourceBuffer mallocing %ld\n",amountOfDataWrittenThisRoundAgg); +#endif + if (amountOfDataWrittenThisRoundAgg > 0) + derivedTypePackedSourceBuffer = (char *)ADIOI_Malloc(amountOfDataWrittenThisRoundAgg * sizeof(char)); + else + derivedTypePackedSourceBuffer = NULL; + } + allocatedDerivedTypeArrays = 1; + } + } + + /* Determine the offset into the target window. + */ + MPI_Aint targetDisplacementToUseThisRound = (MPI_Aint) (offsetStart - currentRoundFDStartForMyTargetAgg); + + /* If using the thread writer select the appropriate side of the split window. + */ + if (useIOBuffer && (write_buf == write_buf1)) { + targetDisplacementToUseThisRound += (MPI_Aint) coll_bufsize; + } + + /* For gpfsmpio_write_aggmethod of 1 do the mpi_put using the primitive MPI_BYTE type for each contiguous + * chunk in the target, of source data is non-contiguous then pack the data first. + */ + + if (gpfsmpio_write_aggmethod == 1) { + MPI_Win_lock(MPI_LOCK_SHARED, targetAggsForMyData[aggIter], 0, write_buf_window); + if (bufTypeIsContig) { + MPI_Put(((char*)buf) + currentFDSourceBufferState[aggIter].sourceBufferOffset,bufferAmountToSend, MPI_BYTE,targetAggsForMyData[aggIter],targetDisplacementToUseThisRound, bufferAmountToSend,MPI_BYTE,write_buf_window); + currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToSend; + } + else { + char *putSourceData = (char *) ADIOI_Malloc(bufferAmountToSend*sizeof(char)); + nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, bufferAmountToSend, 1, ¤tFDSourceBufferState[aggIter], putSourceData); + MPI_Put(putSourceData,bufferAmountToSend, MPI_BYTE,targetAggsForMyData[aggIter],targetDisplacementToUseThisRound, bufferAmountToSend,MPI_BYTE,write_buf_window); + ADIOI_Free(putSourceData); + } + MPI_Win_unlock(targetAggsForMyData[aggIter], write_buf_window); + } + + /* For gpfsmpio_write_aggmethod of 2 populate the data structures for this round/agg for this offset iter + * to be used subsequently when building the derived type for 1 mpi_put for all the data for this + * round/agg. + */ + else if (gpfsmpio_write_aggmethod == 2) { + + if (bufTypeIsContig) { + targetAggBlockLengths[targetAggContigAccessCount]= bufferAmountToSend; + targetAggDataTypes[targetAggContigAccessCount] = MPI_BYTE; + targetAggDisplacements[targetAggContigAccessCount] = targetDisplacementToUseThisRound; + sourceBufferDisplacements[targetAggContigAccessCount] = (MPI_Aint)currentFDSourceBufferState[aggIter].sourceBufferOffset; + currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToSend; + targetAggContigAccessCount++; + } + else { + nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, bufferAmountToSend, 1, ¤tFDSourceBufferState[aggIter], &derivedTypePackedSourceBuffer[derivedTypePackedSourceBufferOffset]); + targetAggBlockLengths[targetAggContigAccessCount]= bufferAmountToSend; + targetAggDataTypes[targetAggContigAccessCount] = MPI_BYTE; + targetAggDisplacements[targetAggContigAccessCount] = targetDisplacementToUseThisRound; + sourceBufferDisplacements[targetAggContigAccessCount] = (MPI_Aint)derivedTypePackedSourceBufferOffset; + targetAggContigAccessCount++; + derivedTypePackedSourceBufferOffset += (ADIO_Offset)bufferAmountToSend; + } + } +#ifdef onesidedtrace + printf("roundIter %d bufferAmountToSend is %d offsetStart is %ld currentRoundFDStartForMyTargetAgg is %ld targetDisplacementToUseThisRound is %ld targetAggsForMyDataFDStart[aggIter] is %ld\n",roundIter, bufferAmountToSend, offsetStart,currentRoundFDStartForMyTargetAgg,targetDisplacementToUseThisRound,targetAggsForMyDataFDStart[aggIter]); +#endif + + } // bufferAmountToSend > 0 + } // contig list + + /* For gpfsmpio_write_aggmethod of 2 now build the derived type using the data from this round/agg and do 1 single mpi_put. + */ + if (gpfsmpio_write_aggmethod == 2) { + + MPI_Datatype sourceBufferDerivedDataType, targetBufferDerivedDataType; + MPI_Type_create_struct(targetAggContigAccessCount, targetAggBlockLengths, sourceBufferDisplacements, targetAggDataTypes, &sourceBufferDerivedDataType); + MPI_Type_commit(&sourceBufferDerivedDataType); + MPI_Type_create_struct(targetAggContigAccessCount, targetAggBlockLengths, targetAggDisplacements, targetAggDataTypes, &targetBufferDerivedDataType); + MPI_Type_commit(&targetBufferDerivedDataType); + +#ifdef onesidedtrace + printf("mpi_put of derived type to agg %d targetAggContigAccessCount is %d\n",targetAggsForMyData[aggIter],targetAggContigAccessCount); +#endif + if (targetAggContigAccessCount > 0) { + MPI_Win_lock(MPI_LOCK_SHARED, targetAggsForMyData[aggIter], 0, write_buf_window); + if (bufTypeIsContig) { + MPI_Put(((char*)buf),1, sourceBufferDerivedDataType,targetAggsForMyData[aggIter],0, 1,targetBufferDerivedDataType,write_buf_window); + } + else { + MPI_Put(derivedTypePackedSourceBuffer,1, sourceBufferDerivedDataType,targetAggsForMyData[aggIter],0, 1,targetBufferDerivedDataType,write_buf_window); + } + + + MPI_Win_unlock(targetAggsForMyData[aggIter], write_buf_window); + } + + if (allocatedDerivedTypeArrays) { + ADIOI_Free(targetAggBlockLengths); + ADIOI_Free(targetAggDisplacements); + ADIOI_Free(targetAggDataTypes); + ADIOI_Free(sourceBufferDisplacements); + if (!bufTypeIsContig) + if (derivedTypePackedSourceBuffer != NULL) + ADIOI_Free(derivedTypePackedSourceBuffer); + } + if (targetAggContigAccessCount > 0) { + MPI_Type_free(&sourceBufferDerivedDataType); + MPI_Type_free(&targetBufferDerivedDataType); + } + } + if (!gpfsmpio_onesided_no_rmw) { + MPI_Win_lock(MPI_LOCK_SHARED, targetAggsForMyData[aggIter], 0, fd->io_buf_put_amounts_window); + MPI_Put(&numBytesPutThisAggRound,1, MPI_INT,targetAggsForMyData[aggIter],myrank, 1,MPI_INT,fd->io_buf_put_amounts_window); + MPI_Win_unlock(targetAggsForMyData[aggIter], fd->io_buf_put_amounts_window); + } + } // baseoffset != -1 + } // target aggs + } /// contig_access_count > 0 + +#ifdef onesidedtrace +printf("first barrier roundIter %d\n",roundIter); +#endif + MPI_Barrier(fd->comm); + + if (iAmUsedAgg) { + /* Determine what offsets define the portion of the file domain the agg is writing this round. + */ + if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { + if (myAggRank == greatestFileDomainAggRank) { + if (fd_end[myAggRank] > lastFileOffset) + currentRoundFDEnd = lastFileOffset; + else + currentRoundFDEnd = fd_end[myAggRank]; + } + else + currentRoundFDEnd = fd_end[myAggRank]; + } + else + currentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; + +#ifdef onesidedtrace + printf("used agg about to writecontig - currentRoundFDStart is %ld currentRoundFDEnd is %ld within file domeain %ld to %ld\n",currentRoundFDStart,currentRoundFDEnd,fd_start[myAggRank],fd_end[myAggRank]); +#endif + + int doWriteContig = 1; + if (!gpfsmpio_onesided_no_rmw) { + int numBytesPutIntoBuf = 0; + for (i=0;i lastFileOffset) + tmpCurrentRoundFDEnd = lastFileOffset; + else + tmpCurrentRoundFDEnd = fd_end[myAggRank]; + } + else + tmpCurrentRoundFDEnd = fd_end[myAggRank]; + } + else + tmpCurrentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; +#ifdef onesidedtrace +printf("gpfsmpio_onesided_always_rmw - round %d buffer pre-read for file offsets %ld to %ld total is %d\n",roundIter, currentRoundFDStart,tmpCurrentRoundFDEnd,(int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1); +#endif + ADIO_ReadContig(fd, write_buf, (int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1, + MPI_BYTE, ADIO_EXPLICIT_OFFSET,currentRoundFDStart, &status, error_code); + + } + } + + if (roundIter<(numberOfRounds-1)) { +#ifdef onesidedtrace +printf("second barrier roundIter %d\n",roundIter); +#endif + MPI_Barrier(fd->comm); + } + + } /* for-loop roundIter */ + + +#ifdef ROMIO_GPFS + endTimeBase = MPI_Wtime(); + gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH] += (endTimeBase-startTimeBase); +#endif + + if (useIOBuffer) { /* thread writer cleanup */ + + if ( !pthread_equal(io_thread, pthread_self()) ) { + pthread_join(io_thread, &thread_ret); + *error_code = *(int *)thread_ret; + } + + } + +#ifdef onesidedtrace +printf("freeing datastructures\n"); +#endif + ADIOI_Free(targetAggsForMyData); + ADIOI_Free(targetAggsForMyDataFDStart); + ADIOI_Free(targetAggsForMyDataFDEnd); + + for (i=0;i 0) + lenListOverZero = 1; + + *error_code = MPI_SUCCESS; /* initialize to success */ + +#ifdef ROMIO_GPFS + double startTimeBase,endTimeBase; + startTimeBase = MPI_Wtime(); +#endif + + MPI_Status status; + pthread_t io_thread; + void *thread_ret; + ADIOI_IO_ThreadFuncData io_thread_args; + + int nprocs,myrank; + MPI_Comm_size(fd->comm, &nprocs); + MPI_Comm_rank(fd->comm, &myrank); + +#ifdef onesidedtrace +printf("ADIOI_OneSidedReadAggregation started on rank %d\n",myrank); +#endif + + if (fd->io_buf_window == MPI_WIN_NULL || + fd->io_buf_put_amounts_window == MPI_WIN_NULL) + { + ADIOI_OneSidedSetup(fd, nprocs); + } + /* This flag denotes whether the source datatype is contiguus, which is referenced throughout the algorithm + * and defines how the source buffer offsets and data chunks are determined. If the value is 1 (true - contiguous data) + * things are profoundly simpler in that the source buffer offset for a given source offset simply linearly increases + * by the chunk sizes being read. If the value is 0 (non-contiguous) then these values are based on calculations + * from the flattened source datatype. + */ + int bufTypeIsContig; + + MPI_Aint bufTypeExtent, lb; + ADIOI_Flatlist_node *flatBuf=NULL; + ADIOI_Datatype_iscontig(datatype, &bufTypeIsContig); + + if (!bufTypeIsContig) { + /* Flatten the non-contiguous source datatype. + */ + flatBuf = ADIOI_Flatten_and_find(datatype); + MPI_Type_get_extent(datatype, &lb, &bufTypeExtent); +#ifdef onesidedtrace + printf("flatBuf->count is %d bufTypeExtent is %d\n", flatBuf->count,bufTypeExtent); + for (i=0;icount;i++) + printf("flatBuf->blocklens[%d] is %d flatBuf->indices[%d] is %ld\n",i,flatBuf->blocklens[i],i,flatBuf->indices[i]); +#endif + } +#ifdef onesidedtrace + printf("ADIOI_OneSidedReadAggregation bufTypeIsContig is %d contig_access_count is %d\n",bufTypeIsContig,contig_access_count); +#endif + + int naggs = fd->hints->cb_nodes; + + /* Track the state of the source buffer for feeding the target data blocks. + * For GPFS the number of file domains per agg is always 1 so we just need 1 agg + * dimension to track the data, in the case of lustre we will need 2 dimensions + * agg and file domain since aggs write to multiple file domains in the + * case of lustre. + * This structure will be modified as the data is written to reflect the + * current state of the offset. + */ + +#ifdef onesidedtrace + printf("sizeof(FDSourceBufferState) is %d - make sure is 32 for 32-byte memalign optimal\n",sizeof(FDSourceBufferState)); +#endif + FDSourceBufferState *currentFDSourceBufferState; + + currentFDSourceBufferState = (FDSourceBufferState *) ADIOI_Malloc(naggs * sizeof(FDSourceBufferState)); + for (i=0;ihints->ranklist */ + int iAmUsedAgg = 0; /* whether or not this rank is used as an aggregator. */ + + int coll_bufsize = fd->hints->cb_buffer_size; +#ifdef ROMIO_GPFS + if (gpfsmpio_pthreadio == 1) { + /* split buffer in half for a kind of double buffering with the threads*/ + coll_bufsize = fd->hints->cb_buffer_size/2; + } +#endif + + /* This logic defines values that are used later to determine what offsets define the portion + * of the file domain the agg is reading this round. + */ + int greatestFileDomainAggRank = -1,smallestFileDomainAggRank = -1; + ADIO_Offset greatestFileDomainOffset = 0; + ADIO_Offset smallestFileDomainOffset = lastFileOffset; + for (j=0;j greatestFileDomainOffset) { + greatestFileDomainOffset = fd_end[j]; + greatestFileDomainAggRank = j; + } + if (fd_start[j] < smallestFileDomainOffset) { + smallestFileDomainOffset = fd_start[j]; + smallestFileDomainAggRank = j; + } + if (fd->hints->ranklist[j] == myrank) { + myAggRank = j; + if (fd_end[j] > fd_start[j]) { + iAmUsedAgg = 1; + } + } + } + +#ifdef onesidedtrace + printf("contig_access_count is %d lastFileOffset is %ld firstFileOffset is %ld\n",contig_access_count,lastFileOffset,firstFileOffset); + for (j=0;j numberOfRounds) + numberOfRounds = currentNumberOfRounds; + } + + /* Data structures to track what data this compute needs to receive from whom. + * For lustre they will all need another dimension for the file domain. + */ int *sourceAggsForMyData = (int *)ADIOI_Malloc(naggs * sizeof(int)); + ADIO_Offset *sourceAggsForMyDataFDStart = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); + ADIO_Offset *sourceAggsForMyDataFDEnd = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); + int numSourceAggs = 0; + + /* This data structure holds the beginning offset and len list index for the range to be read + * coresponding to the round and source agg. Initialize to -1 to denote being unset. + */ + int **sourceAggsForMyDataFirstOffLenIndex = (int **)ADIOI_Malloc(numberOfRounds * sizeof(int *)); + for (i=0;ihints->ranklist[%d]is %d fd_start is %ld fd_end is %ld\n",i,fd->hints->ranklist[i],fd_start[i],fd_end[i]); + for (j=0;j 0) && (buf != NULL) && lenListOverZero) { + int blockIter; + for (blockIter=0;blockIter0) { + if (bufTypeIsContig) { + currentRecvBufferOffset += len_list[blockIter-1]; + } + else { + /* Non-contiguous source datatype, count up the extents and indices to this point + * in the blocks. + */ + ADIO_Offset sourceBlockTotal = 0; + int lastIndiceUsed = currentFlatBufIndice; + int numNonContigSourceChunks = 0; + while (sourceBlockTotal < len_list[blockIter-1]) { + numNonContigSourceChunks++; + sourceBlockTotal += (flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset); + lastIndiceUsed = currentFlatBufIndice; + currentFlatBufIndice++; + if (currentFlatBufIndice == flatBuf->count) { + currentFlatBufIndice = 0; + currentDataTypeExtent++; + } + currentIndiceOffset = (ADIO_Offset)0; + } + if (sourceBlockTotal > len_list[blockIter-1]) { + currentFlatBufIndice--; + if (currentFlatBufIndice < 0 ) { + currentDataTypeExtent--; + currentFlatBufIndice = flatBuf->count-1; + } + currentIndiceOffset = len_list[blockIter-1] - (sourceBlockTotal - flatBuf->blocklens[lastIndiceUsed]); + // ADIOI_Assert((currentIndiceOffset >= 0) && (currentIndiceOffset < flatBuf->blocklens[currentFlatBufIndice])); + } + else + currentIndiceOffset = 0; + maxNumContigOperations += (numNonContigSourceChunks+2); + if (numNonContigSourceChunks > maxNumNonContigSourceChunks) + maxNumNonContigSourceChunks = numNonContigSourceChunks; + +#ifdef onesidedtrace + printf("block iter %d currentFlatBufIndice is now %d currentDataTypeExtent is now %d currentIndiceOffset is now %ld maxNumContigOperations is now %d\n",blockIter,currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset,maxNumContigOperations); +#endif + } // !bufTypeIsContig + } // blockIter > 0 + + /* For the last iteration we need to include these maxNumContigOperations and maxNumNonContigSourceChunks + * for non-contig case even though we did not need to compute the next starting offset. + */ + if ((blockIter == (contig_access_count-1)) && (!bufTypeIsContig)) { + ADIO_Offset sourceBlockTotal = 0; + int tmpCurrentFlatBufIndice = currentFlatBufIndice; + int lastNumNonContigSourceChunks = 0; + while (sourceBlockTotal < len_list[blockIter]) { + lastNumNonContigSourceChunks++; + sourceBlockTotal += flatBuf->blocklens[tmpCurrentFlatBufIndice]; + tmpCurrentFlatBufIndice++; + if (tmpCurrentFlatBufIndice == flatBuf->count) { + tmpCurrentFlatBufIndice = 0; + } + } + maxNumContigOperations += (lastNumNonContigSourceChunks+2); + if (lastNumNonContigSourceChunks > maxNumNonContigSourceChunks) + maxNumNonContigSourceChunks = lastNumNonContigSourceChunks; + + } + + ADIO_Offset blockStart = offset_list[blockIter], blockEnd = offset_list[blockIter]+len_list[blockIter]-(ADIO_Offset)1; + + /* Find the starting source agg for this block - normally it will be the current agg so guard the expensive + * while loop with a cheap if-check which for large numbers of small blocks will usually be false. + */ + if (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) { + while (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) + currentAggRankListIndex++; + }; + + /* Determine if this is a new source agg. + */ + if (blockIter>0) { + if ((offset_list[blockIter-1]+len_list[blockIter-1]-(ADIO_Offset)1) < fd_start[currentAggRankListIndex]) + numSourceAggs++; + } + + /* Determine which round to start reading. + */ + if ((blockStart - fd_start[currentAggRankListIndex]) >= coll_bufsize) { + ADIO_Offset currentRoundBlockStart = fd_start[currentAggRankListIndex]; + int startingRound = 0; + while (blockStart > (currentRoundBlockStart + coll_bufsize - (ADIO_Offset)1)) { + currentRoundBlockStart+=coll_bufsize; + startingRound++; + } + sourceAggsForMyDataCurrentRoundIter[numSourceAggs] = startingRound; + } + + /* Initialize the data structures if this is the first offset in the round/source agg. + */ + if (sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] == -1) { + sourceAggsForMyData[numSourceAggs] = fd->hints->ranklist[currentAggRankListIndex]; + sourceAggsForMyDataFDStart[numSourceAggs] = fd_start[currentAggRankListIndex]; + /* Round up file domain to the first actual offset used if this is the first file domain. + */ + if (currentAggRankListIndex == smallestFileDomainAggRank) { + if (sourceAggsForMyDataFDStart[numSourceAggs] < firstFileOffset) + sourceAggsForMyDataFDStart[numSourceAggs] = firstFileOffset; + } + sourceAggsForMyDataFDEnd[numSourceAggs] = fd_end[currentAggRankListIndex]; + /* Round down file domain to the last actual offset used if this is the last file domain. + */ + if (currentAggRankListIndex == greatestFileDomainAggRank) { + if (sourceAggsForMyDataFDEnd[numSourceAggs] > lastFileOffset) + sourceAggsForMyDataFDEnd[numSourceAggs] = lastFileOffset; + } + sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; + + /* Set the source buffer state starting point for data access for this agg and file domain. + */ + if (bufTypeIsContig) { + if (currentFDSourceBufferState[numSourceAggs].sourceBufferOffset == -1) { + + currentFDSourceBufferState[numSourceAggs].sourceBufferOffset = currentRecvBufferOffset; +#ifdef onesidedtrace + printf("For agg %d sourceBufferOffset initialized to %ld\n",currentAggRankListIndex,currentRecvBufferOffset); +#endif + } + } + else { + if (currentFDSourceBufferState[numSourceAggs].indiceOffset == -1) { + currentFDSourceBufferState[numSourceAggs].indiceOffset = currentIndiceOffset; + currentFDSourceBufferState[numSourceAggs].bufTypeExtent = bufTypeExtent; + currentFDSourceBufferState[numSourceAggs].dataTypeExtent = currentDataTypeExtent; + currentFDSourceBufferState[numSourceAggs].flatBufIndice = currentFlatBufIndice; +#ifdef onesidedtrace + printf("For agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld\n",numSourceAggs,currentDataTypeExtent,currentFlatBufIndice,currentIndiceOffset); +#endif + } + } + intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + ((ADIO_Offset)(sourceAggsForMyDataCurrentRoundIter[numSourceAggs]+1) * coll_bufsize); +#ifdef onesidedtrace + printf("init settings numSourceAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld currentRecvBufferOffset set to %ld intraRoundCollBufsizeOffset set to %ld\n",numSourceAggs,blockIter,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter],currentRecvBufferOffset,intraRoundCollBufsizeOffset); +#endif + + } + + /* Replace the last offset block iter with this one. + */ + sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; + + /* If this blocks extends into the next file domain advance to the next source aggs and source buffer states. + */ + if (blockEnd > fd_end[currentAggRankListIndex]) { +#ifdef onesidedtrace + printf("block extends past current fd, blockEnd %ld >= fd_end[currentAggRankListIndex] %ld total block size is %ld blockStart was %ld\n",blockEnd,fd_end[currentAggRankListIndex], len_list[blockIter],blockStart); +#endif + ADIO_Offset amountToAdvanceSBOffsetForFD = 0; + int additionalFDCounter = 0; + while (blockEnd >= fd_end[currentAggRankListIndex]) { + ADIO_Offset thisAggBlockEnd = fd_end[currentAggRankListIndex]; + if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { + while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { + sourceAggsForMyDataCurrentRoundIter[numSourceAggs]++; + intraRoundCollBufsizeOffset += coll_bufsize; + sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; + sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; +#ifdef onesidedtrace + printf("sourceAggsForMyDataCurrentRoundI%d] is now %d intraRoundCollBufsizeOffset is now %ld\n",numSourceAggs,sourceAggsForMyDataCurrentRoundIter[numSourceAggs],intraRoundCollBufsizeOffset); +#endif + } // while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) + } // if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) + + int prevAggRankListIndex = currentAggRankListIndex; + currentAggRankListIndex++; + + /* Skip over unused aggs. + */ + if (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) { + while (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) + currentAggRankListIndex++; + + } // (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) + + /* Start new source agg. + */ + if (blockEnd >= fd_start[currentAggRankListIndex]) { + numSourceAggs++; + sourceAggsForMyData[numSourceAggs] = fd->hints->ranklist[currentAggRankListIndex]; + sourceAggsForMyDataFDStart[numSourceAggs] = fd_start[currentAggRankListIndex]; + /* Round up file domain to the first actual offset used if this is the first file domain. + */ + if (currentAggRankListIndex == smallestFileDomainAggRank) { + if (sourceAggsForMyDataFDStart[numSourceAggs] < firstFileOffset) + sourceAggsForMyDataFDStart[numSourceAggs] = firstFileOffset; + } + sourceAggsForMyDataFDEnd[numSourceAggs] = fd_end[currentAggRankListIndex]; + /* Round down file domain to the last actual offset used if this is the last file domain. + */ + if (currentAggRankListIndex == greatestFileDomainAggRank) { + if (sourceAggsForMyDataFDEnd[numSourceAggs] > lastFileOffset) + sourceAggsForMyDataFDEnd[numSourceAggs] = lastFileOffset; + } + sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; + + + /* For the first additonal file domain the source buffer offset + * will be incremented relative to the state of this first main + * loop but for subsequent full file domains the offset will be + * incremented by the size of the file domain. + */ + if (additionalFDCounter == 0) + amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex] - blockStart) + (ADIO_Offset)1; + else + amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex]-fd_start[prevAggRankListIndex]) +(ADIO_Offset)1; + + if (bufTypeIsContig) { + ADIOI_Assert(numSourceAggs > 0); + if (currentFDSourceBufferState[numSourceAggs].sourceBufferOffset == -1) { + if (additionalFDCounter == 0) { // first file domain, still use the current data counter + currentFDSourceBufferState[numSourceAggs].sourceBufferOffset = currentRecvBufferOffset+amountToAdvanceSBOffsetForFD; + } + else { // 2nd file domain, advance full file domain from last source buffer state + currentFDSourceBufferState[numSourceAggs].sourceBufferOffset = currentFDSourceBufferState[numSourceAggs-1].sourceBufferOffset+amountToAdvanceSBOffsetForFD; + } + +#ifdef onesidedtrace + printf("Crossed into new FD - for agg %d sourceBufferOffset initialized to %ld amountToAdvanceSBOffsetForFD is %ld\n",numSourceAggs,currentFDSourceBufferState[numSourceAggs].sourceBufferOffset,amountToAdvanceSBOffsetForFD); +#endif + } + } + else if (currentFDSourceBufferState[numSourceAggs].indiceOffset == -1) { + // non-contiguos source buffer + ADIOI_Assert(numSourceAggs > 0); + + /* Initialize the source buffer state appropriately and then + * advance it with the nonContigSourceDataBufferAdvance function. + */ + if (additionalFDCounter == 0) { + // first file domain, still use the current data counter + currentFDSourceBufferState[numSourceAggs].indiceOffset = currentIndiceOffset; + currentFDSourceBufferState[numSourceAggs].bufTypeExtent = bufTypeExtent; + currentFDSourceBufferState[numSourceAggs].dataTypeExtent = currentDataTypeExtent; + currentFDSourceBufferState[numSourceAggs].flatBufIndice = currentFlatBufIndice; + } + else { + // 2nd file domain, advance full file domain from last source + // buffer state + currentFDSourceBufferState[numSourceAggs].indiceOffset = currentFDSourceBufferState[numSourceAggs-1].indiceOffset; + currentFDSourceBufferState[numSourceAggs].bufTypeExtent = currentFDSourceBufferState[numSourceAggs-1].bufTypeExtent; + currentFDSourceBufferState[numSourceAggs].dataTypeExtent = currentFDSourceBufferState[numSourceAggs-1].dataTypeExtent; + currentFDSourceBufferState[numSourceAggs].flatBufIndice = currentFDSourceBufferState[numSourceAggs-1].flatBufIndice; + } + nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, (int)amountToAdvanceSBOffsetForFD, 0, ¤tFDSourceBufferState[numSourceAggs], NULL); +#ifdef onesidedtrace + printf("Crossed into new FD - for agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld amountToAdvanceSBOffsetForFD is %d\n",numSourceAggs,currentFDSourceBufferState[numSourceAggs].dataTypeExtent,currentFDSourceBufferState[numSourceAggs].flatBufIndice,currentFDSourceBufferState[numSourceAggs].indiceOffset,amountToAdvanceSBOffsetForFD); +#endif + } + + additionalFDCounter++; + + +#ifdef onesidedtrace + printf("block extended beyond fd init settings numSourceAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld\n",numSourceAggs,i,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter]); +#endif + intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + coll_bufsize; + sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; + } // if (blockEnd >= fd_start[currentAggRankListIndex]) + } // while (blockEnd >= fd_end[currentAggRankListIndex]) + } // if (blockEnd > fd_end[currentAggRankListIndex]) + + /* If we are still in the same file domain / source agg but have gone past the coll_bufsize and need + * to advance to the next round handle this situation. + */ + if (blockEnd >= intraRoundCollBufsizeOffset) { + ADIO_Offset currentBlockEnd = blockEnd; + while (currentBlockEnd >= intraRoundCollBufsizeOffset) { + sourceAggsForMyDataCurrentRoundIter[numSourceAggs]++; + intraRoundCollBufsizeOffset += coll_bufsize; + sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; + sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; +#ifdef onesidedtrace + printf("block less than fd currentBlockEnd is now %ld intraRoundCollBufsizeOffset is now %ld sourceAggsForMyDataCurrentRoundIter[%d] is now %d\n",currentBlockEnd, intraRoundCollBufsizeOffset, numSourceAggs,sourceAggsForMyDataCurrentRoundIter[numSourceAggs]); +#endif + } // while (currentBlockEnd >= intraRoundCollBufsizeOffset) + } // if (blockEnd >= intraRoundCollBufsizeOffset) + + /* Need to advance numSourceAggs if this is the last source offset to + * include this one. + */ + if (blockIter == (contig_access_count-1)) + numSourceAggs++; + } + +#ifdef onesidedtrace + printf("numSourceAggs is %d\n",numSourceAggs); + for (i=0;i 0) && (buf != NULL) && lenListOverZero) + + ADIOI_Free(sourceAggsForMyDataCurrentRoundIter); + + /* use the two-phase buffer allocated in the file_open - no app should ever + * be both reading and reading at the same time */ + char *read_buf0 = fd->io_buf; + char *read_buf1 = fd->io_buf + coll_bufsize; + /* if threaded i/o selected, we'll do a kind of double buffering */ + char *read_buf = read_buf0; + + int currentReadBuf = 0; + int useIOBuffer = 0; +#ifdef ROMIO_GPFS + if (gpfsmpio_pthreadio && (numberOfRounds>1)) { + useIOBuffer = 1; + io_thread = pthread_self(); + } +#endif + + MPI_Win read_buf_window = fd->io_buf_window; + + ADIO_Offset currentRoundFDStart = 0, nextRoundFDStart = 0; + ADIO_Offset currentRoundFDEnd = 0, nextRoundFDEnd = 0; + + if (iAmUsedAgg) { + currentRoundFDStart = fd_start[myAggRank]; + nextRoundFDStart = fd_start[myAggRank]; + if (myAggRank == smallestFileDomainAggRank) { + if (currentRoundFDStart < firstFileOffset) + currentRoundFDStart = firstFileOffset; + if (nextRoundFDStart < firstFileOffset) + nextRoundFDStart = firstFileOffset; + } + else if (myAggRank == greatestFileDomainAggRank) { + if (currentRoundFDEnd > lastFileOffset) + currentRoundFDEnd = lastFileOffset; + if (nextRoundFDEnd > lastFileOffset) + nextRoundFDEnd = lastFileOffset; + } +#ifdef onesidedtrace +printf("iAmUsedAgg - currentRoundFDStart initialized " + "to %ld currentRoundFDEnd to %ld\n", + currentRoundFDStart,currentRoundFDEnd); +#endif + + + } + +#ifdef ROMIO_GPFS + endTimeBase = MPI_Wtime(); + gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_SETUP] += (endTimeBase-startTimeBase); + startTimeBase = MPI_Wtime(); +#endif + + + /* This is the second main loop of the algorithm, actually nested loop of target aggs within rounds. There are 2 flavors of this. + * For gpfsmpio_read_aggmethod of 1 each nested iteration for the source agg does an mpi_put on a contiguous chunk using a primative datatype + * determined using the data structures from the first main loop. For gpfsmpio_read_aggmethod of 2 each nested iteration for the source agg + * builds up data to use in created a derived data type for 1 mpi_put that is done for the target agg for each round. + * To support lustre there will need to be an additional layer of nesting for the multiple file domains + * within target aggs. + */ + int roundIter; + for (roundIter=0;roundIter 0) && (buf != NULL) && lenListOverZero) + { + /* determine what offsets define the portion of the file domain the agg is reading this round */ + if (iAmUsedAgg) { + + currentRoundFDStart = nextRoundFDStart; + + if (!useIOBuffer || (roundIter == 0)) { + int amountDataToReadThisRound; + if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { + currentRoundFDEnd = fd_end[myAggRank]; + amountDataToReadThisRound = ((currentRoundFDEnd-currentRoundFDStart)+1); + } + else { + currentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; + amountDataToReadThisRound = coll_bufsize; + } + + /* read currentRoundFDEnd bytes */ + ADIO_ReadContig(fd, read_buf,amountDataToReadThisRound, + MPI_BYTE, ADIO_EXPLICIT_OFFSET, currentRoundFDStart, + &status, error_code); + currentReadBuf = 1; + + } + if (useIOBuffer) { /* use the thread reader for the next round */ + /* switch back and forth between the read buffers so that the data aggregation code is diseminating 1 buffer while the thread is reading into the other */ + + if (roundIter > 0) + currentRoundFDEnd = nextRoundFDEnd; + + if (roundIter < (numberOfRounds-1)) { + nextRoundFDStart += coll_bufsize; + int amountDataToReadNextRound; + if ((fd_end[myAggRank] - nextRoundFDStart) < coll_bufsize) { + nextRoundFDEnd = fd_end[myAggRank]; + amountDataToReadNextRound = ((nextRoundFDEnd-nextRoundFDStart)+1); + } + else { + nextRoundFDEnd = nextRoundFDStart + coll_bufsize - (ADIO_Offset)1; + amountDataToReadNextRound = coll_bufsize; + } + + if(!pthread_equal(io_thread, pthread_self())) { + pthread_join(io_thread, &thread_ret); + *error_code = *(int *)thread_ret; + if (*error_code != MPI_SUCCESS) return; + io_thread = pthread_self(); + + } + io_thread_args.fd = fd; + /* do a little pointer shuffling: background I/O works from one + * buffer while two-phase machinery fills up another */ + + if (currentReadBuf == 0) { + io_thread_args.buf = read_buf0; + currentReadBuf = 1; + read_buf = read_buf1; + } + else { + io_thread_args.buf = read_buf1; + currentReadBuf = 0; + read_buf = read_buf0; + } + io_thread_args.io_kind = ADIOI_READ; + io_thread_args.size = amountDataToReadNextRound; + io_thread_args.offset = nextRoundFDStart; + io_thread_args.status = &status; + io_thread_args.error_code = *error_code; + if ( (pthread_create(&io_thread, NULL, + ADIOI_IO_Thread_Func, &(io_thread_args))) != 0) + io_thread = pthread_self(); + + } + else { /* last round */ + + if(!pthread_equal(io_thread, pthread_self())) { + pthread_join(io_thread, &thread_ret); + *error_code = *(int *)thread_ret; + if (*error_code != MPI_SUCCESS) return; + io_thread = pthread_self(); + + } + if (currentReadBuf == 0) { + read_buf = read_buf0; + } + else { + read_buf = read_buf1; + } + + } + } /* useIOBuffer */ + } /* IAmUsedAgg */ + else if (useIOBuffer) { + if (roundIter < (numberOfRounds-1)) { + if (currentReadBuf == 0) { + currentReadBuf = 1; + read_buf = read_buf1; + } + else { + currentReadBuf = 0; + read_buf = read_buf0; + } + } + else { + if (currentReadBuf == 0) { + read_buf = read_buf0; + } + else { + read_buf = read_buf1; + } + } + + } + // wait until the read buffers are full before we start pulling from the source procs + MPI_Barrier(fd->comm); + + int aggIter; + for (aggIter=0;aggIter sourceAggsForMyDataFDEnd[aggIter]) + currentRoundFDEndForMySourceAgg = sourceAggsForMyDataFDEnd[aggIter]; + + ADIO_Offset offsetStart = offset_list[offsetIter], offsetEnd = (offset_list[offsetIter]+len_list[offsetIter]-(ADIO_Offset)1); + + /* Determine the amount of data and exact source buffer offsets to use. + */ + int bufferAmountToRecv = 0; + + if ((offsetStart >= currentRoundFDStartForMySourceAgg) && (offsetStart <= currentRoundFDEndForMySourceAgg)) { + if (offsetEnd > currentRoundFDEndForMySourceAgg) + bufferAmountToRecv = (currentRoundFDEndForMySourceAgg - offsetStart) +1; + else + bufferAmountToRecv = (offsetEnd - offsetStart) +1; + } + else if ((offsetEnd >= currentRoundFDStartForMySourceAgg) && (offsetEnd <= currentRoundFDEndForMySourceAgg)) { + if (offsetEnd > currentRoundFDEndForMySourceAgg) + bufferAmountToRecv = (currentRoundFDEndForMySourceAgg - currentRoundFDStartForMySourceAgg) +1; + else + bufferAmountToRecv = (offsetEnd - currentRoundFDStartForMySourceAgg) +1; + if (offsetStart < currentRoundFDStartForMySourceAgg) { + offsetStart = currentRoundFDStartForMySourceAgg; + } + } + else if ((offsetStart <= currentRoundFDStartForMySourceAgg) && (offsetEnd >= currentRoundFDEndForMySourceAgg)) { + bufferAmountToRecv = (currentRoundFDEndForMySourceAgg - currentRoundFDStartForMySourceAgg) +1; + offsetStart = currentRoundFDStartForMySourceAgg; + } + + if (bufferAmountToRecv > 0) { /* we have data to recv this round */ + if (gpfsmpio_read_aggmethod == 2) { + /* Only allocate these arrays if we are using method 2 and only do it once for this round/source agg. + */ + if (!allocatedDerivedTypeArrays) { + sourceAggBlockLengths = (int *)ADIOI_Malloc(maxNumContigOperations * sizeof(int)); + sourceAggDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); + recvBufferDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); + sourceAggDataTypes = (MPI_Datatype *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Datatype)); + if (!bufTypeIsContig) { + int k; + for (k=sourceAggsForMyDataFirstOffLenIndex[roundIter][aggIter];k<=sourceAggsForMyDataLastOffLenIndex[roundIter][aggIter];k++) + amountOfDataReadThisRoundAgg += len_list[k]; + +#ifdef onesidedtrace + printf("derivedTypePackedSourceBuffer mallocing %ld\n",amountOfDataReadThisRoundAgg); +#endif + if (amountOfDataReadThisRoundAgg > 0) + derivedTypePackedSourceBuffer = (char *)ADIOI_Malloc(amountOfDataReadThisRoundAgg * sizeof(char)); + else + derivedTypePackedSourceBuffer = NULL; + } + allocatedDerivedTypeArrays = 1; + } + } + + /* Determine the offset into the source window. + */ + MPI_Aint sourceDisplacementToUseThisRound = (MPI_Aint) (offsetStart - currentRoundFDStartForMySourceAgg); + + /* If using the thread reader select the appropriate side of the split window. + */ + if (useIOBuffer && (read_buf == read_buf1)) { + sourceDisplacementToUseThisRound += (MPI_Aint)coll_bufsize; + } + + /* For gpfsmpio_read_aggmethod of 1 do the mpi_get using the primitive MPI_BYTE type from each + * contiguous chunk from the target, if the source is non-contiguous then unpack the data after + * the MPI_Win_unlock is done to make sure the data has arrived first. + */ + if (gpfsmpio_read_aggmethod == 1) { + MPI_Win_lock(MPI_LOCK_SHARED, sourceAggsForMyData[aggIter], 0, read_buf_window); + char *getSourceData = NULL; + if (bufTypeIsContig) { + MPI_Get(((char*)buf) + currentFDSourceBufferState[aggIter].sourceBufferOffset,bufferAmountToRecv, MPI_BYTE,sourceAggsForMyData[aggIter],sourceDisplacementToUseThisRound, bufferAmountToRecv,MPI_BYTE,read_buf_window); + currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToRecv; + + } + else { + getSourceData = (char *) ADIOI_Malloc(bufferAmountToRecv*sizeof(char)); + MPI_Get(getSourceData,bufferAmountToRecv, MPI_BYTE,sourceAggsForMyData[aggIter],sourceDisplacementToUseThisRound, bufferAmountToRecv,MPI_BYTE,read_buf_window); + + } + MPI_Win_unlock(sourceAggsForMyData[aggIter], read_buf_window); + if (!bufTypeIsContig) { + nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, bufferAmountToRecv, 0, ¤tFDSourceBufferState[aggIter], getSourceData); + ADIOI_Free(getSourceData); + } + } + + /* For gpfsmpio_read_aggmethod of 2 populate the data structures for this round/agg for this offset iter + * to be used subsequently when building the derived type for 1 mpi_put for all the data for this + * round/agg. + */ + else if (gpfsmpio_read_aggmethod == 2) { + if (bufTypeIsContig) { + sourceAggBlockLengths[sourceAggContigAccessCount]= bufferAmountToRecv; + sourceAggDataTypes[sourceAggContigAccessCount] = MPI_BYTE; + sourceAggDisplacements[sourceAggContigAccessCount] = sourceDisplacementToUseThisRound; + recvBufferDisplacements[sourceAggContigAccessCount] = (MPI_Aint)currentFDSourceBufferState[aggIter].sourceBufferOffset; + currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToRecv; + sourceAggContigAccessCount++; + } + else { + sourceAggBlockLengths[sourceAggContigAccessCount]= bufferAmountToRecv; + sourceAggDataTypes[sourceAggContigAccessCount] = MPI_BYTE; + sourceAggDisplacements[sourceAggContigAccessCount] = sourceDisplacementToUseThisRound; + recvBufferDisplacements[sourceAggContigAccessCount] = (MPI_Aint)derivedTypePackedSourceBufferOffset; + derivedTypePackedSourceBufferOffset += (ADIO_Offset)bufferAmountToRecv; + sourceAggContigAccessCount++; + } + } + } // bufferAmountToRecv > 0 + } // contig list + + /* For gpfsmpio_read_aggmethod of 2 now build the derived type using the data from this round/agg and do 1 single mpi_put. + */ + if (gpfsmpio_read_aggmethod == 2) { + MPI_Datatype recvBufferDerivedDataType, sourceBufferDerivedDataType; + + MPI_Type_create_struct(sourceAggContigAccessCount, sourceAggBlockLengths, recvBufferDisplacements, sourceAggDataTypes, &recvBufferDerivedDataType); + MPI_Type_commit(&recvBufferDerivedDataType); + MPI_Type_create_struct(sourceAggContigAccessCount, sourceAggBlockLengths, sourceAggDisplacements, sourceAggDataTypes, &sourceBufferDerivedDataType); + MPI_Type_commit(&sourceBufferDerivedDataType); + + if (sourceAggContigAccessCount > 0) { + + MPI_Win_lock(MPI_LOCK_SHARED, sourceAggsForMyData[aggIter], 0, read_buf_window); + if (bufTypeIsContig) { + MPI_Get(((char*)buf),1, recvBufferDerivedDataType,sourceAggsForMyData[aggIter],0, 1,sourceBufferDerivedDataType,read_buf_window); + } + else { + MPI_Get(derivedTypePackedSourceBuffer,1, recvBufferDerivedDataType,sourceAggsForMyData[aggIter],0, 1,sourceBufferDerivedDataType,read_buf_window); + } + + MPI_Win_unlock(sourceAggsForMyData[aggIter], read_buf_window); + if (!bufTypeIsContig) { + nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, derivedTypePackedSourceBufferOffset, 0, ¤tFDSourceBufferState[aggIter], derivedTypePackedSourceBuffer); + } + } + + if (allocatedDerivedTypeArrays) { + ADIOI_Free(sourceAggBlockLengths); + ADIOI_Free(sourceAggDisplacements); + ADIOI_Free(sourceAggDataTypes); + ADIOI_Free(recvBufferDisplacements); + if (!bufTypeIsContig) + if (derivedTypePackedSourceBuffer != NULL) + ADIOI_Free(derivedTypePackedSourceBuffer); + } + if (sourceAggContigAccessCount > 0) { + MPI_Type_free(&recvBufferDerivedDataType); + MPI_Type_free(&sourceBufferDerivedDataType); + } + } + } // baseoffset != -1 + } // source aggs + } // contig_access_count > 0 + /* the source procs recv the requested data to the aggs */ + + MPI_Barrier(fd->comm); + + nextRoundFDStart = currentRoundFDStart + coll_bufsize; + + } /* for-loop roundIter */ + +#ifdef ROMIO_GPFS + endTimeBase = MPI_Wtime(); + gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH] += (endTimeBase-startTimeBase); +#endif + + if (useIOBuffer) { /* thread readr cleanup */ + + if ( !pthread_equal(io_thread, pthread_self()) ) { + pthread_join(io_thread, &thread_ret); + *error_code = *(int *)thread_ret; + } + + } + + ADIOI_Free(sourceAggsForMyData); + ADIOI_Free(sourceAggsForMyDataFDStart); + ADIOI_Free(sourceAggsForMyDataFDEnd); + + for (i=0;iptr = ADIOI_Req_avail_head; ADIOI_Malloc_req_head->next = NULL; @@ -57,7 +57,7 @@ struct ADIOI_RequestD *ADIOI_Malloc_request(void) ptr = ADIOI_Req_avail_head; ADIOI_Req_avail_head = ADIOI_Req_avail_head->next; if (!ADIOI_Req_avail_head) ADIOI_Req_avail_tail = NULL; - + (ptr->reqd).cookie = ADIOI_REQ_COOKIE; return &(ptr->reqd); } @@ -65,7 +65,7 @@ struct ADIOI_RequestD *ADIOI_Malloc_request(void) void ADIOI_Free_request(ADIOI_Req_node *node) { -/* This function could be called as ADIOI_Free_request(ADIO_Request request), +/* This function could be called as ADIOI_Free_request(ADIO_Request request), because request would be a pointer to the first element of ADIOI_Req_node.*/ /* moves this node to available pool. does not actually free it. */ diff --git a/ompi/mca/io/romio314/romio/adio/common/shfp_fname.c b/ompi/mca/io/romio321/romio/adio/common/shfp_fname.c similarity index 85% rename from ompi/mca/io/romio314/romio/adio/common/shfp_fname.c rename to ompi/mca/io/romio321/romio/adio/common/shfp_fname.c index 3ad772fddb..dfa5bafc2c 100644 --- a/ompi/mca/io/romio314/romio/adio/common/shfp_fname.c +++ b/ompi/mca/io/romio321/romio/adio/common/shfp_fname.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -17,15 +17,8 @@ #ifdef HAVE_TIME_H #include #endif - -/* - * Open MPI: we have to use internal opal_random() instead of rand(3) - * to prevent pertubing user's randon seed - */ -#include - -/* The following function selects the name of the file to be used to - store the shared file pointer. The shared-file-pointer file is a +/* The following function selects the name of the file to be used to + store the shared file pointer. The shared-file-pointer file is a hidden file in the same directory as the real file being accessed. If the real file is /tmp/thakur/testfile, the shared-file-pointer file will be /tmp/thakur/.testfile.shfp.yyy.xxxx, where yyy @@ -42,26 +35,20 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code) int len; char *slash, *ptr, tmp[128]; int pid = 0; - opal_rng_buff_t adio_rand_buff; fd->shared_fp_fname = (char *) ADIOI_Malloc(PATH_MAX); if (!rank) { - /* - * Open MPI: we have to use internal opal_random() instead of rand(3) - * to prevent pertubing user's randon seed - */ - opal_srand(&adio_rand_buff,time(NULL)); - i = opal_random(); - + srand(time(NULL)); + i = rand(); pid = (int)getpid(); - + if (ADIOI_Strncpy(fd->shared_fp_fname, fd->filename, PATH_MAX)) { *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname", fd->filename, ENAMETOOLONG); return; } - + #ifdef ROMIO_NTFS slash = strrchr(fd->filename, '\\'); #else @@ -99,11 +86,11 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code) return; } } - + ADIOI_Snprintf(tmp, 128, ".shfp.%d.%d", pid, i); /* ADIOI_Strnapp will return non-zero if truncated. That's ok */ ADIOI_Strnapp(fd->shared_fp_fname, tmp, PATH_MAX); - + len = (int)strlen(fd->shared_fp_fname); MPI_Bcast(&len, 1, MPI_INT, 0, fd->comm); MPI_Bcast(fd->shared_fp_fname, len+1, MPI_CHAR, 0, fd->comm); diff --git a/ompi/mca/io/romio314/romio/adio/common/status_setb.c b/ompi/mca/io/romio321/romio/adio/common/status_setb.c similarity index 89% rename from ompi/mca/io/romio314/romio/adio/common/status_setb.c rename to ompi/mca/io/romio321/romio/adio/common/status_setb.c index 756e94e38a..ec1e4ff7f6 100644 --- a/ompi/mca/io/romio314/romio/adio/common/status_setb.c +++ b/ompi/mca/io/romio321/romio/adio/common/status_setb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -13,11 +13,11 @@ /* TODO: still needs to handle partial datatypes and situations where the mpi * implementation fills status with something other than bytes (globus2 might * do this) */ -int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, +int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, MPI_Count nbytes) { ADIOI_UNREFERENCED_ARG(datatype); - /* it's ok that ROMIO stores number-of-bytes in status, not + /* it's ok that ROMIO stores number-of-bytes in status, not * count-of-copies, as long as MPI_GET_COUNT knows what to do */ if (status != MPI_STATUS_IGNORE) MPI_Status_set_elements_x(status, MPI_BYTE, nbytes); diff --git a/ompi/mca/io/romio314/romio/adio/common/strfns.c b/ompi/mca/io/romio321/romio/adio/common/strfns.c similarity index 94% rename from ompi/mca/io/romio314/romio/adio/common/strfns.c rename to ompi/mca/io/romio321/romio/adio/common/strfns.c index 4b8c1ec256..65e5ac24e7 100644 --- a/ompi/mca/io/romio314/romio/adio/common/strfns.c +++ b/ompi/mca/io/romio321/romio/adio/common/strfns.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -9,7 +9,7 @@ /* style: allow:sprintf:3 sig:0 */ -/* +/* * Below are the "safe" versions of the various string and printf * operations. They are directly taken from MPICH, with MPIU replaced by ADIOI. */ @@ -18,7 +18,7 @@ * ADIOI_Strncpy - Copy at most n character. Stop once a null is reached. * * This is different from strncpy, which null pads so that exactly - * n characters are copied. The strncpy behavior is correct for many + * n characters are copied. The strncpy behavior is correct for many * applications because it guarantees that the string has no uninitialized * data. * @@ -27,7 +27,7 @@ * */ /*@ ADIOI_Strncpy - Copy a string with a maximum length - + Input Parameters: + instr - String to copy - maxlen - Maximum total length of 'outstr' @@ -36,11 +36,11 @@ Output Parameters: . outstr - String to copy into Notes: - This routine is the routine that you wish 'strncpy' was. In copying - 'instr' to 'outstr', it stops when either the end of 'outstr' (the + This routine is the routine that you wish 'strncpy' was. In copying + 'instr' to 'outstr', it stops when either the end of 'outstr' (the null character) is seen or the maximum length 'maxlen' is reached. - Unlike 'strncpy', it does not add enough nulls to 'outstr' after - copying 'instr' in order to move precisely 'maxlen' characters. + Unlike 'strncpy', it does not add enough nulls to 'outstr' after + copying 'instr' in order to move precisely 'maxlen' characters. Thus, this routine may be used anywhere 'strcpy' is used, without any performance cost related to large values of 'maxlen'. @@ -57,8 +57,8 @@ int ADIOI_Strncpy( char *dest, const char *src, size_t n ) while (*s_ptr && i-- > 0) { *d_ptr++ = *s_ptr++; } - - if (i > 0) { + + if (i > 0) { *d_ptr = 0; return 0; } @@ -81,7 +81,7 @@ Output Parameters: Notes: This routine is similar to 'strncat' except that the 'maxlen' argument - is the maximum total length of 'outstr', rather than the maximum + is the maximum total length of 'outstr', rather than the maximum number of characters to move from 'instr'. Thus, this routine is easier to use when the declared size of 'instr' is known. @@ -106,21 +106,21 @@ int ADIOI_Strnapp( char *dest, const char *src, size_t n ) /* We allow i >= (not just >) here because the first while decrements i by one more than there are characters, leaving room for the null */ - if (i >= 0) { + if (i >= 0) { *d_ptr = 0; return 0; } else { /* Force the null at the end */ *--d_ptr = 0; - + /* We may want to force an error message here, at least in the debugging version */ return 1; } } -/*@ +/*@ ADIOI_Strdup - Duplicate a string Synopsis: @@ -136,7 +136,7 @@ Input Parameters: null pointer is returned on error, such as out-of-memory. Notes: - Like 'ADIOI_Malloc' and 'ADIOI_Free', this will often be implemented as a + Like 'ADIOI_Malloc' and 'ADIOI_Free', this will often be implemented as a macro but may use 'ADIOI_trstrdup' to provide a tracing version. Module: @@ -159,14 +159,14 @@ char *ADIOI_Strdup( const char *str ) } -/* +/* * We need an snprintf replacement for systems without one */ #ifndef HAVE_SNPRINTF #include /* FIXME: Really need a check for varargs.h vs stdarg.h */ #include -/* +/* * This is an approximate form which is suitable for most uses within * the MPICH code */ @@ -209,7 +209,7 @@ int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) while (*p && isdigit(*p)) { width = 10 * width + (*p++ - '0'); } - /* When there is no longer a digit, get the format + /* When there is no longer a digit, get the format character */ nc = *p++; } @@ -236,7 +236,7 @@ int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) int tmplen = strlen(tmp); /* If a width was specified, pad with spaces on the left (on the right if %-3d given; not implemented yet */ - while (size-- > 0 && width-- > tmplen) + while (size-- > 0 && width-- > tmplen) *out_str++ = ' '; } while (size-- > 0 && *t) { @@ -257,7 +257,7 @@ int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) int tmplen = strlen(tmp); /* If a width was specified, pad with spaces on the left (on the right if %-3d given; not implemented yet */ - while (size-- > 0 && width-- > tmplen) + while (size-- > 0 && width-- > tmplen) *out_str++ = ' '; } while (size-- > 0 && *t) { @@ -277,7 +277,7 @@ int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) int tmplen = strlen(tmp); /* If a width was specified, pad with spaces on the left (on the right if %-3d given; not implemented yet */ - while (size-- > 0 && width-- > tmplen) + while (size-- > 0 && width-- > tmplen) *out_str++ = ' '; } while (size-- > 0 && *t) { diff --git a/ompi/mca/io/romio314/romio/adio/common/system_hints.c b/ompi/mca/io/romio321/romio/adio/common/system_hints.c similarity index 76% rename from ompi/mca/io/romio314/romio/adio/common/system_hints.c rename to ompi/mca/io/romio321/romio/adio/common/system_hints.c index 56e9db2144..1b049b1ff5 100644 --- a/ompi/mca/io/romio314/romio/adio/common/system_hints.c +++ b/ompi/mca/io/romio321/romio/adio/common/system_hints.c @@ -1,7 +1,7 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab * - * Copyright (C) 2007 UChicago/Argonne LLC. + * Copyright (C) 2007 UChicago/Argonne LLC. * See COPYRIGHT notice in top-level directory. */ @@ -15,8 +15,12 @@ #ifdef HAVE_SYS_TYPES_H #include #endif +#ifdef HAVE_STDLIB_H #include +#endif +#ifdef HAVE_STRING_H #include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -34,8 +38,8 @@ void ADIOI_Info_print_keyvals(MPI_Info info) { int i, nkeys, flag; - char key[MPI_MAX_INFO_KEY]; - char value[MPI_MAX_INFO_VAL]; + char key[MPI_MAX_INFO_KEY+1]; + char value[MPI_MAX_INFO_VAL+1]; if (info == MPI_INFO_NULL) return; @@ -44,7 +48,7 @@ void ADIOI_Info_print_keyvals(MPI_Info info) for (i=0; i \n". * A # in collumn zero is a comment and the line will be ignored. Do our best - * to ignore badly formed lines too. + * to ignore badly formed lines too. * * The caller provides an 'info' object. Each key-value pair found by the * parser will get added to the info object. any keys already set will be left - * alone on the assumption that the caller knows best. + * alone on the assumption that the caller knows best. * * because MPI-IO hints are optional, we can get away with limited error * reporting. @@ -87,7 +91,7 @@ static int file_to_info_all(int fd, MPI_Info info, int rank, MPI_Comm comm) char *pos1=NULL, *pos2=NULL; int flag; ssize_t ret; - char dummy; + int valuelen; /* assumption: config files will be small */ #define HINTFILE_MAX_SIZE 1024*4 @@ -106,25 +110,25 @@ static int file_to_info_all(int fd, MPI_Info info, int rank, MPI_Comm comm) if (token == NULL) goto fn_exit; do { - if ( (key = strtok_r(token, " \t", &pos2)) == NULL) + if ( (key = strtok_r(token, " \t", &pos2)) == NULL) /* malformed line: found no items */ continue; - if (token[0] == '#') + if (token[0] == '#') /* ignore '#'-delimited comments */ continue; - if ( (val = strtok_r(NULL, " \t", &pos2)) == NULL) + if ( (val = strtok_r(NULL, " \t", &pos2)) == NULL) /* malformed line: found key without value */ continue; - if ( (garbage = strtok_r(NULL, " \t", &pos2)) != NULL) + if ( (garbage = strtok_r(NULL, " \t", &pos2)) != NULL) /* malformed line: more than two items */ continue; - + #ifdef SYSHINT_DEBUG printf("found: key=%s val=%s\n", key, val); #endif /* don't actually care what the value is. only want to know if key * exists: we leave it alone if so*/ - ADIOI_Info_get(info, key, 1, &dummy, &flag); + ADIOI_Info_get_valuelen(info, key, &valuelen, &flag); if (flag == 1) continue; ADIOI_Info_set(info, key, val); } while ((token = strtok_r(NULL, "\n", &pos1)) != NULL); @@ -151,13 +155,14 @@ void ADIOI_process_system_hints(ADIO_File fd, MPI_Info info) /* given 'info', incorporate any hints in 'sysinfo' that are not already set * into 'new_info'. Caller must free 'new_info' later. */ -void ADIOI_incorporate_system_hints(MPI_Info info, - MPI_Info sysinfo, - MPI_Info *new_info) +void ADIOI_incorporate_system_hints(MPI_Info info, + MPI_Info sysinfo, + MPI_Info *new_info) { - int i, nkeys_sysinfo, flag=0; /* must initialize flag to 0 */ + int i, nkeys_sysinfo, nkeys_info=0, flag=0; /* must initialize flag to 0 */ + int valuelen; - char val[MPI_MAX_INFO_VAL], key[MPI_MAX_INFO_KEY]; + char val[MPI_MAX_INFO_VAL+1], key[MPI_MAX_INFO_KEY+1]; if (sysinfo == MPI_INFO_NULL) nkeys_sysinfo = 0; @@ -170,17 +175,23 @@ void ADIOI_incorporate_system_hints(MPI_Info info, return; } - if (info == MPI_INFO_NULL) + if (info == MPI_INFO_NULL) MPI_Info_create(new_info); - else + else { + /* tiny optimization: if 'info' has no keys, we can skip the check if a + * hint is set: no keys means nothing has been set, and there's nothing + * we might step on */ + MPI_Info_get_nkeys(info, &nkeys_info); MPI_Info_dup(info, new_info); + } for (i=0; i #include + /* utility function for creating large contiguous types: algorithim from BigMPI * https://github.com/jeffhammond/BigMPI */ @@ -116,20 +117,40 @@ ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); ssize_t pread(int fd, void *buf, size_t count, off_t offset) { off_t lseek_ret; + off_t old_offset; + ssize_t read_ret; + old_offset = lseek(fd, 0, SEEK_CUR); lseek_ret = lseek(fd, offset, SEEK_SET); if (lseek_ret == -1) return lseek_ret; - return (read(fd, buf, count)); + read_ret = read(fd, buf, count); + if (read_ret < 0) + return read_ret; + /* man page says "file offset is not changed" */ + if ( (lseek_ret = lseek(fd, old_offset, SEEK_SET)) < 0) + return lseek_ret; + + return read_ret; } ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) { off_t lseek_ret; + off_t old_offset; + ssize_t write_ret; + old_offset = lseek(fd, 0, SEEK_CUR); lseek_ret = lseek(fd, offset, SEEK_SET); if (lseek_ret == -1) return lseek_ret; - return (write(fd, buf, count)); + write_ret = write(fd, buf, count); + if (write_ret < 0) + return write_ret; + /* man page says "file offset is not changed" */ + if ( (lseek_ret = lseek(fd, old_offset, SEEK_SET)) < 0) + return lseek_ret; + + return write_ret; } #endif diff --git a/ompi/mca/io/romio314/romio/adio/include/BaseIOErrMsgs.msg b/ompi/mca/io/romio321/romio/adio/include/BaseIOErrMsgs.msg similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/BaseIOErrMsgs.msg rename to ompi/mca/io/romio321/romio/adio/include/BaseIOErrMsgs.msg diff --git a/ompi/mca/io/romio314/romio/adio/include/adio.h b/ompi/mca/io/romio321/romio/adio/include/adio.h similarity index 88% rename from ompi/mca/io/romio314/romio/adio/include/adio.h rename to ompi/mca/io/romio321/romio/adio/include/adio.h index fac10c1674..b320fe2788 100644 --- a/ompi/mca/io/romio314/romio/adio/include/adio.h +++ b/ompi/mca/io/romio321/romio/adio/include/adio.h @@ -1,20 +1,20 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ /* main include file for ADIO. - contains general definitions, declarations, and macros independent + contains general definitions, declarations, and macros independent of the underlying file system */ -/* Functions and datataypes that are "internal" to the ADIO implementation +/* Functions and datataypes that are "internal" to the ADIO implementation prefixed ADIOI_. Functions and datatypes that are part of the "externally visible" (documented) ADIO interface are prefixed ADIO_. An implementation of MPI-IO, or any other high-level interface, should - not need to use any of the ADIOI_ functions/datatypes. - Only someone implementing ADIO on a new file system, or modifying + not need to use any of the ADIOI_ functions/datatypes. + Only someone implementing ADIO on a new file system, or modifying an existing ADIO implementation, would need to use the ADIOI_ functions/datatypes. */ @@ -112,11 +112,11 @@ # define ADIO_OFFSET MPI_LONG #endif -#define ADIO_Status MPI_Status +#define ADIO_Status MPI_Status #ifndef MPIO_INCLUDE # ifdef NEEDS_MPI_FINT - typedef int MPI_Fint; + typedef int MPI_Fint; # endif #endif @@ -128,7 +128,7 @@ int MPI_Info_create(MPI_Info *info); int MPI_Info_set(MPI_Info info, char *key, char *value); int MPI_Info_delete(MPI_Info info, char *key); -int MPI_Info_get(MPI_Info info, char *key, int valuelen, +int MPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag); int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag); int MPI_Info_get_nkeys(MPI_Info info, int *nkeys); @@ -149,7 +149,7 @@ MPI_Info MPI_Info_f2c(MPI_Fint info); int PMPI_Info_create(MPI_Info *info); int PMPI_Info_set(MPI_Info info, char *key, char *value); int PMPI_Info_delete(MPI_Info info, char *key); -int PMPI_Info_get(MPI_Info info, char *key, int valuelen, +int PMPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag); int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag); int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys); @@ -188,7 +188,7 @@ typedef struct ADIOI_FileD { int cookie; /* for error checking */ FDTYPE fd_sys; /* system file descriptor */ FDTYPE null_fd; /* the null-device file descriptor: debug only (obviously)*/ - int fd_direct; /* On XFS, this is used for direct I/O; + int fd_direct; /* On XFS, this is used for direct I/O; fd_sys is used for buffered I/O */ int direct_read; /* flag; 1 means use direct read */ int direct_write; /* flag; 1 means use direct write */ @@ -205,9 +205,12 @@ typedef struct ADIOI_FileD { MPI_Comm comm; /* communicator indicating who called open */ int is_open; /* deferred open: 0: not open yet 1: is open */ int is_agg; /* bool: if I am an aggregator */ - char *filename; + char *filename; int file_system; /* type of file system */ - int access_mode; /* Access mode (sequential, append, etc.) */ + int access_mode; /* Access mode (sequential, append, etc.), + possibly modified to deal with + data sieving or deferred open*/ + int orig_access_mode; /* Access mode provided by user: unmodified */ ADIO_Offset disp; /* reqd. for MPI-IO */ MPI_Datatype etype; /* reqd. for MPI-IO */ MPI_Datatype filetype; /* reqd. for MPI-IO */ @@ -222,7 +225,7 @@ typedef struct ADIOI_FileD { /* The following support the shared file operations */ char *shared_fp_fname; /* name of file containing shared file pointer */ - struct ADIOI_FileD *shared_fp_fd; /* file handle of file + struct ADIOI_FileD *shared_fp_fd; /* file handle of file containing shared fp */ int async_count; /* count of outstanding nonblocking operations */ int perm; @@ -236,6 +239,10 @@ typedef struct ADIOI_FileD { MPI_Datatype *file_realm_types; /* file realm datatypes */ int my_cb_nodes_index; /* my index into cb_config_list. -1 if N/A */ char *io_buf; /* two-phase buffer allocated out of i/o path */ + MPI_Win io_buf_window; /* Window over the io_buf to support one-sided aggregation */ + int *io_buf_put_amounts; /* array tracking the amount of data mpi_put into the io_buf + during the same round of one-sided write aggregation */ + MPI_Win io_buf_put_amounts_window; /* Window over the io_buf_put_amounts */ /* External32 */ int is_external32; /* bool: 0 means native view */ @@ -331,7 +338,7 @@ typedef struct { #define ADIOI_REQ_COOKIE 3493740 /* ADIO function prototypes */ -/* all these may not be necessary, as many of them are macro replaced to +/* all these may not be necessary, as many of them are macro replaced to function pointers that point to the appropriate functions for each different file system (in adioi.h), but anyway... */ @@ -346,34 +353,34 @@ void ADIOI_OpenColl(ADIO_File fd, int rank, int acces_mode, int *error_code); void ADIO_ImmediateOpen(ADIO_File fd, int *error_code); void ADIO_Close(ADIO_File fd, int *error_code); void ADIO_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, - int file_ptr_type, ADIO_Offset offset, + int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); -void ADIO_WriteContig(ADIO_File fd, void *buf, int count, +void ADIO_WriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, int *bytes_written, int *error_code); -void ADIO_IwriteContig(ADIO_File fd, void *buf, int count, +void ADIO_IwriteContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIO_IreadContig(ADIO_File fd, void *buf, int count, + *error_code); +void ADIO_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int - *error_code); -int ADIO_ReadDone(ADIO_Request *request, ADIO_Status *status, + *error_code); +int ADIO_ReadDone(ADIO_Request *request, ADIO_Status *status, int *error_code); -int ADIO_WriteDone(ADIO_Request *request, ADIO_Status *status, +int ADIO_WriteDone(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIO_ReadIcomplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); int ADIO_WriteIcomplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void ADIO_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); + *error_code); void ADIO_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void ADIO_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); + *error_code); void ADIO_ReadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int @@ -398,7 +405,15 @@ void ADIO_IwriteStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); -ADIO_Offset ADIO_SeekIndividual(ADIO_File fd, ADIO_Offset offset, +void ADIO_IreadStridedColl(ADIO_File fd, void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, ADIO_Request *request, + int *error_code); +void ADIO_IwriteStridedColl(ADIO_File fd, void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, ADIO_Request *request, + int *error_code); +ADIO_Offset ADIO_SeekIndividual(ADIO_File fd, ADIO_Offset offset, int whence, int *error_code); void ADIO_Delete(char *filename, int *error_code); void ADIO_Flush(ADIO_File fd, int *error_code); @@ -409,7 +424,7 @@ void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp, int *error_code); void ADIO_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code); -void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, +void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, MPI_Info info, int *error_code); int ADIO_Feature(ADIO_File fd, int flag); @@ -421,10 +436,10 @@ int ADIO_Type_create_subarray(int ndims, int order, MPI_Datatype oldtype, MPI_Datatype *newtype); -int ADIO_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, +int ADIO_Type_create_darray(int size, int rank, int ndims, + int *array_of_gsizes, int *array_of_distribs, + int *array_of_dargs, int *array_of_psizes, + int order, MPI_Datatype oldtype, MPI_Datatype *newtype); /* MPI_File management functions (in mpio_file.c) */ diff --git a/ompi/mca/io/romio314/romio/adio/include/adio_cb_config_list.h b/ompi/mca/io/romio321/romio/adio/include/adio_cb_config_list.h similarity index 82% rename from ompi/mca/io/romio314/romio/adio/include/adio_cb_config_list.h rename to ompi/mca/io/romio321/romio/adio/include/adio_cb_config_list.h index 0bc04bdba3..ab2c5b501f 100644 --- a/ompi/mca/io/romio314/romio/adio/include/adio_cb_config_list.h +++ b/ompi/mca/io/romio321/romio/adio/include/adio_cb_config_list.h @@ -1,11 +1,11 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2001 University of Chicago. + * Copyright (C) 2001 University of Chicago. * See COPYRIGHT notice in top-level directory. */ -/* I have no idea what the "D" stands for; it's how things are done in adio.h +/* I have no idea what the "D" stands for; it's how things are done in adio.h */ struct ADIO_cb_name_arrayD { int refct; @@ -15,13 +15,13 @@ struct ADIO_cb_name_arrayD { typedef struct ADIO_cb_name_arrayD *ADIO_cb_name_array; -int ADIOI_cb_gather_name_array(MPI_Comm comm, MPI_Comm dupcomm, +int ADIOI_cb_gather_name_array(MPI_Comm comm, MPI_Comm dupcomm, ADIO_cb_name_array *arrayp); -int ADIOI_cb_copy_name_array(MPI_Comm comm, int keyval, void *extra, +int ADIOI_cb_copy_name_array(MPI_Comm comm, int keyval, void *extra, void *attr_in, void **attr_out, int *flag); -int ADIOI_cb_delete_name_array(MPI_Comm comm, int keyval, void *attr_val, +int ADIOI_cb_delete_name_array(MPI_Comm comm, int keyval, void *attr_val, void *extra); -int ADIOI_cb_config_list_parse(char *config_list, ADIO_cb_name_array array, +int ADIOI_cb_config_list_parse(char *config_list, ADIO_cb_name_array array, int ranklist[], int cb_nodes); int ADIOI_cb_bcast_rank_map(ADIO_File fd); diff --git a/ompi/mca/io/romio314/romio/adio/include/adio_extern.h b/ompi/mca/io/romio321/romio/adio/include/adio_extern.h similarity index 93% rename from ompi/mca/io/romio314/romio/adio/include/adio_extern.h rename to ompi/mca/io/romio321/romio/adio/include/adio_extern.h index a3b67e6495..9a7f2e59b0 100644 --- a/ompi/mca/io/romio314/romio/adio/include/adio_extern.h +++ b/ompi/mca/io/romio321/romio/adio/include/adio_extern.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/include/adioi.h b/ompi/mca/io/romio321/romio/adio/include/adioi.h similarity index 80% rename from ompi/mca/io/romio314/romio/adio/include/adioi.h rename to ompi/mca/io/romio321/romio/adio/include/adioi.h index e70d015aba..5656f10bae 100644 --- a/ompi/mca/io/romio314/romio/adio/include/adioi.h +++ b/ompi/mca/io/romio321/romio/adio/include/adioi.h @@ -1,22 +1,22 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ /* contains general definitions, declarations, and macros internal to the ADIO implementation, though independent of the underlying file - system. This file is included in adio.h */ + system. This file is included in adio.h */ -/* Functions and datataypes that are "internal" to the ADIO implementation +/* Functions and datataypes that are "internal" to the ADIO implementation prefixed ADIOI_. Functions and datatypes that are part of the "externally visible" (documented) ADIO interface are prefixed ADIO_. An implementation of MPI-IO, or any other high-level interface, should - not need to use any of the ADIOI_ functions/datatypes. - Only someone implementing ADIO on a new file system, or modifying + not need to use any of the ADIOI_ functions/datatypes. + Only someone implementing ADIO on a new file system, or modifying an existing ADIO implementation, would need to use the ADIOI_ functions/datatypes. */ @@ -25,7 +25,7 @@ #define ADIOI_INCLUDE /* used to keep track of hint/info values. * Note that there are a lot of int-sized values in here...they are - * used as int-sized entities other places as well. This would be a + * used as int-sized entities other places as well. This would be a * problem on 32-bit systems using > 2GB files in some cases... */ struct ADIOI_Hints_struct { @@ -94,7 +94,7 @@ typedef struct ADIOI_Datarep { struct ADIOI_Datarep *next; /* pointer to next datarep */ } ADIOI_Datarep; -/* Values for use with cb_read, cb_write, ds_read, and ds_write +/* Values for use with cb_read, cb_write, ds_read, and ds_write * and some fs-specific hints (IBM xlc, Compaq Tru64 compilers object to a comma after the last item) (that's just wrong) @@ -107,13 +107,23 @@ enum { /* flattened datatypes. Each datatype is stored as a node of a globally accessible linked list. Once attribute caching on a - datatype is available (in MPI-2), that should be used instead. */ + datatype is available (in MPI-2), that should be used instead. */ -typedef struct ADIOI_Fl_node { +typedef struct ADIOI_Fl_node { MPI_Datatype type; MPI_Count count; /* no. of contiguous blocks */ ADIO_Offset *blocklens; /* array of contiguous block lengths (bytes)*/ ADIO_Offset *indices; /* array of byte offsets of each block */ + /* the type processing code in ROMIO loops through the flattened + * representation to tile file views. so, we cannot simply indicate a + * lower bound and upper bound with entries here -- those are instead + * indicated by offset-length pairs with zero length. In order to deal + * with repeatedly resetting the LB and UB though (as in resized of + * resized, or struct of resized, perhaps?), indicate where in the + * tuple-stream the lb and ub parts are kept + * (-1 indicates "not explicitly set") */ + ADIO_Offset lb_idx; + ADIO_Offset ub_idx; struct ADIOI_Fl_node *next; /* pointer to next node */ } ADIOI_Flatlist_node; @@ -145,25 +155,25 @@ typedef struct ADIOI_AIO_req_str { struct ADIOI_Fns_struct { void (*ADIOI_xxx_Open) (ADIO_File fd, int *error_code); - void (*ADIOI_xxx_OpenColl) (ADIO_File fd, int rank, + void (*ADIOI_xxx_OpenColl) (ADIO_File fd, int rank, int access_mode, int *error_code); void (*ADIOI_xxx_ReadContig) (ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); void (*ADIOI_xxx_WriteContig) (ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code); + ADIO_Offset offset, ADIO_Status *status, int *error_code); void (*ADIOI_xxx_ReadStridedColl) (ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); void (*ADIOI_xxx_WriteStridedColl) (ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); - ADIO_Offset (*ADIOI_xxx_SeekIndividual) (ADIO_File fd, ADIO_Offset offset, + ADIO_Offset (*ADIOI_xxx_SeekIndividual) (ADIO_File fd, ADIO_Offset offset, int whence, int *error_code); - void (*ADIOI_xxx_Fcntl) (ADIO_File fd, int flag, - ADIO_Fcntl_t *fcntl_struct, int *error_code); - void (*ADIOI_xxx_SetInfo) (ADIO_File fd, MPI_Info users_info, + void (*ADIOI_xxx_Fcntl) (ADIO_File fd, int flag, + ADIO_Fcntl_t *fcntl_struct, int *error_code); + void (*ADIOI_xxx_SetInfo) (ADIO_File fd, MPI_Info users_info, int *error_code); void (*ADIOI_xxx_ReadStrided) (ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, @@ -172,31 +182,37 @@ struct ADIOI_Fns_struct { MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); void (*ADIOI_xxx_Close) (ADIO_File fd, int *error_code); - void (*ADIOI_xxx_IreadContig) (ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, + void (*ADIOI_xxx_IreadContig) (ADIO_File fd, void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); void (*ADIOI_xxx_IwriteContig) (ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); - int (*ADIOI_xxx_ReadDone) (ADIO_Request *request, ADIO_Status *status, - int *error_code); - int (*ADIOI_xxx_WriteDone) (ADIO_Request *request, ADIO_Status *status, - int *error_code); - void (*ADIOI_xxx_ReadComplete) (ADIO_Request *request, ADIO_Status *status, + int (*ADIOI_xxx_ReadDone) (ADIO_Request *request, ADIO_Status *status, + int *error_code); + int (*ADIOI_xxx_WriteDone) (ADIO_Request *request, ADIO_Status *status, int *error_code); + void (*ADIOI_xxx_ReadComplete) (ADIO_Request *request, ADIO_Status *status, + int *error_code); void (*ADIOI_xxx_WriteComplete) (ADIO_Request *request, ADIO_Status *status, - int *error_code); + int *error_code); void (*ADIOI_xxx_IreadStrided) (ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); void (*ADIOI_xxx_IwriteStrided) (ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); - void (*ADIOI_xxx_Flush) (ADIO_File fd, int *error_code); + void (*ADIOI_xxx_Flush) (ADIO_File fd, int *error_code); void (*ADIOI_xxx_Resize) (ADIO_File fd, ADIO_Offset size, int *error_code); void (*ADIOI_xxx_Delete) (const char *filename, int *error_code); int (*ADIOI_xxx_Feature) (ADIO_File fd, int flag); const char *fsname; + void (*ADIOI_xxx_IreadStridedColl) (ADIO_File fd, void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, ADIO_Request *request, int *error_code); + void (*ADIOI_xxx_IwriteStridedColl) (ADIO_File fd, const void *buf, + int count, MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, ADIO_Request *request, int *error_code); }; /* optypes for ADIO_RequestD */ @@ -209,7 +225,7 @@ struct ADIOI_Fns_struct { * http://stackoverflow.com/questions/3982348/implement-generic-swap-macro-in-c */ #define ADIOI_SWAP(x, y, T) do { T temp##x##y = x; x = y; y = temp##x##y; } while (0); -#define ADIOI_PREALLOC_BUFSZ 16777216 /* buffer size used to +#define ADIOI_PREALLOC_BUFSZ 16777216 /* buffer size used to preallocate disk space */ @@ -220,7 +236,7 @@ struct ADIOI_Fns_struct { #define ADIOI_IND_RD_BUFFER_SIZE_DFLT "4194304" /* buffer size for data sieving in independent writes = 512KB. default is smaller than for reads, because write requires read-modify-write - with file locking. If buffer size is large there is more contention + with file locking. If buffer size is large there is more contention for locks. */ #define ADIOI_IND_WR_BUFFER_SIZE_DFLT "524288" /* use one process per processor name by default */ @@ -287,6 +303,12 @@ struct ADIOI_Fns_struct { #define ADIO_IwriteStrided(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ (*(fd->fns->ADIOI_xxx_IwriteStrided))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) +#define ADIO_IreadStridedColl(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ + (*(fd->fns->ADIOI_xxx_IreadStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) + +#define ADIO_IwriteStridedColl(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ + (*(fd->fns->ADIOI_xxx_IwriteStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) + #define ADIO_Flush(fd,error_code) (*(fd->fns->ADIOI_xxx_Flush))(fd,error_code) #define ADIO_Resize(fd,size,error_code) \ @@ -302,8 +324,8 @@ struct ADIOI_Fns_struct { (*(fd->fns->ADIOI_xxx_Feature))(fd, flag) -/* structure for storing access info of this process's request - from the file domain of other processes, and vice-versa. used +/* structure for storing access info of this process's request + from the file domain of other processes, and vice-versa. used as array of structures indexed by process number. */ typedef struct { ADIO_Offset *offsets; /* array of offsets */ @@ -335,6 +357,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype type); void ADIOI_Flatten(MPI_Datatype type, ADIOI_Flatlist_node *flat, ADIO_Offset st_offset, MPI_Count *curr_index); void ADIOI_Delete_flattened(MPI_Datatype datatype); +ADIOI_Flatlist_node * ADIOI_Flatten_and_find(MPI_Datatype); MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype type, MPI_Count *curr_index); void ADIOI_Complete_async(int *error_code); void *ADIOI_Malloc_fn(size_t size, int lineno, const char *fname); @@ -347,7 +370,7 @@ void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset); void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp); void ADIOI_process_system_hints(ADIO_File fd, MPI_Info info); -void ADIOI_incorporate_system_hints(MPI_Info info, MPI_Info sysinfo, +void ADIOI_incorporate_system_hints(MPI_Info info, MPI_Info sysinfo, MPI_Info *new_info); void ADIOI_Info_print_keyvals(MPI_Info info); @@ -355,20 +378,20 @@ void ADIOI_Info_print_keyvals(MPI_Info info); void ADIOI_GEN_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code); void ADIOI_GEN_Flush(ADIO_File fd, int *error_code); -void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, +void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code); -void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, +void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code); -void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, +void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code); void ADIOI_GEN_Delete(const char *filename, int *error_code); -void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, +void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, int wr, MPI_Request *request); -void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); @@ -397,7 +420,7 @@ int ADIOI_GEN_IODone(ADIO_Request *request, ADIO_Status *status, void ADIOI_GEN_IOComplete(ADIO_Request *request, ADIO_Status *status, int *error_code); int ADIOI_GEN_aio_poll_fn(void *extra_state, ADIO_Status *status); -int ADIOI_GEN_aio_wait_fn(int count, void **array_of_states, double timeout, +int ADIOI_GEN_aio_wait_fn(int count, void **array_of_states, double timeout, ADIO_Status *status); int ADIOI_GEN_aio_query_fn(void *extra_state, ADIO_Status *status); int ADIOI_GEN_aio_free_fn(void *extra_state); @@ -423,12 +446,28 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); +#ifdef HAVE_MPI_GREQUEST_EXTENSIONS +void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, MPI_Request *request, + int *error_code); +#else +#define ADIOI_GEN_IreadStridedColl NULL +#endif void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code); +#ifdef HAVE_MPI_GREQUEST_EXTENSIONS +void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count, + MPI_Datatype datatype, int file_ptr_type, + ADIO_Offset offset, MPI_Request *request, + int *error_code); +#else +#define ADIOI_GEN_IwriteStridedColl NULL +#endif void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype - datatype, int file_ptr_type, ADIO_Offset + datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Offset **offset_list_ptr, ADIO_Offset **len_list_ptr, ADIO_Offset *start_offset_ptr, ADIO_Offset *end_offset_ptr, int @@ -436,8 +475,8 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset *end_offsets, int nprocs, int nprocs_for_coll, ADIO_Offset *min_st_offset_ptr, - ADIO_Offset **fd_start_ptr, ADIO_Offset - **fd_end_ptr, int min_fd_size, + ADIO_Offset **fd_start_ptr, ADIO_Offset + **fd_end_ptr, int min_fd_size, ADIO_Offset *fd_size_ptr, int striping_unit); int ADIOI_Calc_aggregator(ADIO_File fd, @@ -447,9 +486,9 @@ int ADIOI_Calc_aggregator(ADIO_File fd, ADIO_Offset fd_size, ADIO_Offset *fd_start, ADIO_Offset *fd_end); -void ADIOI_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list, +void ADIOI_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list, ADIO_Offset *len_list, int - contig_access_count, ADIO_Offset + contig_access_count, ADIO_Offset min_st_offset, ADIO_Offset *fd_start, ADIO_Offset *fd_end, ADIO_Offset fd_size, int nprocs, @@ -457,12 +496,104 @@ void ADIOI_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list, int **count_my_req_per_proc_ptr, ADIOI_Access **my_req_ptr, int **buf_idx_ptr); -void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, +void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs, int *count_my_req_per_proc, - ADIOI_Access *my_req, + ADIOI_Access *my_req, int nprocs, int myrank, int *count_others_req_procs_ptr, - ADIOI_Access **others_req_ptr); + ADIOI_Access **others_req_ptr); + + +/* Nonblocking Collective I/O internals */ +typedef enum { + ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL, + ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO, + ADIOI_IRC_STATE_ICALC_OTHERS_REQ, + ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN, + ADIOI_IRC_STATE_IREAD_AND_EXCH, + ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN, + ADIOI_IRC_STATE_R_IEXCHANGE_DATA, + ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV, + ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL, + ADIOI_IRC_STATE_COMPLETE +} ADIOI_IRC_State; + +typedef enum { + ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL, + ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO, + ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST, + ADIOI_IWC_STATE_ICALC_OTHERS_REQ, + ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN, + ADIOI_IWC_STATE_IEXCH_AND_WRITE, + ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY, + ADIOI_IWC_STATE_W_IEXCHANGE_DATA, + ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE, + ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND, + ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT, + ADIOI_IWC_STATE_COMPLETE +} ADIOI_IWC_State; + +typedef struct ADIOI_NBC_Request ADIOI_NBC_Request; + +typedef struct ADIOI_GEN_IreadStridedColl_vars ADIOI_GEN_IreadStridedColl_vars; +typedef struct ADIOI_Iread_and_exch_vars ADIOI_Iread_and_exch_vars; +typedef struct ADIOI_R_Iexchange_data_vars ADIOI_R_Iexchange_data_vars; + +typedef struct ADIOI_GEN_IwriteStridedColl_vars ADIOI_GEN_IwriteStridedColl_vars; +typedef struct ADIOI_Iexch_and_write_vars ADIOI_Iexch_and_write_vars; +typedef struct ADIOI_W_Iexchange_data_vars ADIOI_W_Iexchange_data_vars; + +typedef struct ADIOI_Icalc_others_req_vars { + /* requests */ + MPI_Request req1; + MPI_Request *req2; + int num_req2; + + /* parameters */ + ADIO_File fd; + int count_my_req_procs; + int *count_my_req_per_proc; + ADIOI_Access *my_req; + int nprocs; + int myrank; + int *count_others_req_procs_ptr; + ADIOI_Access **others_req_ptr; + + /* stack variables */ + int *count_others_req_per_proc; + int count_others_req_procs; + ADIOI_Access *others_req; + + /* next function to be called */ + void (*next_fn)(ADIOI_NBC_Request *, int *); +} ADIOI_Icalc_others_req_vars; + +struct ADIOI_NBC_Request { + int rdwr; /* ADIOI_READ or ADIOI_WRITE */ + MPI_Request req; /* MPIX_Grequest */ + MPI_Count nbytes; /* data read or written */ + + union { + struct { + ADIOI_IRC_State state; /* progress state */ + ADIOI_GEN_IreadStridedColl_vars *rsc_vars; + ADIOI_Iread_and_exch_vars *rae_vars; + ADIOI_R_Iexchange_data_vars *red_vars; + } rd; + struct { + ADIOI_IWC_State state; /* progress state */ + ADIOI_GEN_IwriteStridedColl_vars *wsc_vars; + ADIOI_Iexch_and_write_vars *eaw_vars; + ADIOI_W_Iexchange_data_vars *wed_vars; + } wr; + } data; + ADIOI_Icalc_others_req_vars *cor_vars; +}; + +void ADIOI_Icalc_others_req(ADIOI_NBC_Request *nbc_req, int *error_code); +void ADIOI_Icalc_others_req_main(ADIOI_NBC_Request *nbc_req, int *error_code); +void ADIOI_Icalc_others_req_fini(ADIOI_NBC_Request *nbc_req, int *error_code); + /* KC && AC - New Collective I/O internals*/ @@ -506,7 +637,7 @@ typedef struct view_state int pre_ol_ct; MPI_Aint *pre_disp_arr; int *pre_blk_arr; - + ADIOI_Flatlist_node *flat_type_p; } view_state; @@ -534,7 +665,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, view_state *agg_file_view_state_arr, view_state *client_file_view_state_arr); int ADIOI_init_view_state(int file_ptr_type, - int nprocs, + int nprocs, view_state *view_state_arr, int op_type); int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, @@ -543,7 +674,7 @@ int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, ADIO_Offset *client_comm_sz_arr, ADIO_Offset *agg_dtype_offset_p, MPI_Datatype *agg_dtype_p); -int ADIOI_Build_client_reqs(ADIO_File fd, +int ADIOI_Build_client_reqs(ADIO_File fd, int nprocs, view_state *my_mem_view_state_arr, view_state *agg_file_view_state_arr, @@ -580,7 +711,33 @@ void ADIOI_P2PContigReadAggregation(ADIO_File fd, ADIO_Offset *fd_start, ADIO_Offset *fd_end); -ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, +int ADIOI_OneSidedCleanup(ADIO_File fd); +void ADIOI_OneSidedWriteAggregation(ADIO_File fd, + ADIO_Offset *offset_list, + ADIO_Offset *len_list, + int contig_access_count, + const void *buf, + MPI_Datatype datatype, + int *error_code, + ADIO_Offset *st_offsets, + ADIO_Offset *end_offsets, + int numNonZeroDataOffsets, + ADIO_Offset *fd_start, + ADIO_Offset* fd_end, + int *hole_found); +void ADIOI_OneSidedReadAggregation(ADIO_File fd, + ADIO_Offset *offset_list, + ADIO_Offset *len_list, + int contig_access_count, + const void *buf, + MPI_Datatype datatype, + int *error_code, + ADIO_Offset *st_offsets, + ADIO_Offset *end_offsets, + int numNonZeroDataOffsets, + ADIO_Offset *fd_start, + ADIO_Offset* fd_end); +ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, int whence, int *error_code); void ADIOI_GEN_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); @@ -603,11 +760,11 @@ int ADIOI_Type_create_hindexed_x(int count, int ADIOI_FAKE_IODone(ADIO_Request *request, ADIO_Status *status, int *error_code); -void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, +void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); -void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, +void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, int file_ptr_type, ADIO_Offset offset, ADIO_Request *request, int *error_code); @@ -694,6 +851,22 @@ int MPIOI_File_iread(MPI_File fh, MPI_Datatype datatype, char *myname, MPI_Request *request); +int MPIOI_File_iwrite_all(MPI_File fh, + MPI_Offset offset, + int file_ptr_type, + const void *buf, + int count, + MPI_Datatype datatype, + char *myname, + MPI_Request *request); +int MPIOI_File_iread_all(MPI_File fh, + MPI_Offset offset, + int file_ptr_type, + void *buf, + int count, + MPI_Datatype datatype, + char *myname, + MPI_Request *request); @@ -704,7 +877,7 @@ int MPIOI_File_iread(MPI_File fh, # define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_WRLCK, offset, whence, len);\ - else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len); } while (0) + else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len); } while (0) # define ADIOI_READ_LOCK(fd, offset, whence, len) \ do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ @@ -802,7 +975,7 @@ char *ADIOI_Strdup( const char * ); extern int snprintf( char *, size_t, const char *, ... ) ATTRIBUTE((format(printf,3,4))); #endif #else -int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) +int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) ATTRIBUTE((format(printf,3,4))); #endif /* HAVE_SNPRINTF */ @@ -812,7 +985,7 @@ int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) # ifdef HAVE_SYSERRLIST extern char *sys_errlist[]; # define strerror(n) sys_errlist[n] -# else +# else # define PRINT_ERR_MSG # endif #endif @@ -854,15 +1027,15 @@ int ADIOI_MPE_iwrite_b; #ifdef ROMIO_INSIDE_MPICH /* Assert that this MPI_Aint value can be cast to a ptr value without problem.*/ -/* Basic idea is the value should be unchanged after casting - (no loss of (meaningful) high order bytes in 8 byte MPI_Aint +/* Basic idea is the value should be unchanged after casting + (no loss of (meaningful) high order bytes in 8 byte MPI_Aint to (possible) 4 byte ptr cast) */ /* Should work even on 64bit or old 32bit configs */ - /* Use MPID_Ensure_Aint_fits_in_pointer from mpiutil.h and - MPI_AINT_CAST_TO_VOID_PTR from configure (mpi.h) */ + /* Use MPIU_Ensure_Aint_fits_in_pointer from mpiutil.h and + MPIU_AINT_CAST_TO_VOID_PTR from configure (mpi.h) */ #include "glue_romio.h" - #define ADIOI_AINT_CAST_TO_VOID_PTR (void*)(MPIR_Pint) + #define ADIOI_AINT_CAST_TO_VOID_PTR (void*)(MPIU_Pint) /* The next two casts are only used when you don't want sign extension when casting a (possible 4 byte) aint to a (8 byte) long long or offset */ #define ADIOI_AINT_CAST_TO_LONG_LONG (long long) @@ -875,10 +1048,10 @@ int ADIOI_MPE_iwrite_b; #define ADIOI_AINT_CAST_TO_VOID_PTR (void*) #define ADIOI_AINT_CAST_TO_LONG_LONG (long long) #define ADIOI_AINT_CAST_TO_OFFSET ADIOI_AINT_CAST_TO_LONG_LONG - #define ADIOI_ENSURE_AINT_FITS_IN_PTR(aint_value) + #define ADIOI_ENSURE_AINT_FITS_IN_PTR(aint_value) #define ADIOI_Assert assert - #define MPIR_Upint unsigned long - #define MPIU_THREADPRIV_DECL + #define MPIU_Upint unsigned long + #define MPID_THREADPRIV_DECL #endif #ifdef USE_DBG_LOGGING /*todo fix dependency on mpich?*/ @@ -905,7 +1078,7 @@ typedef struct wcThreadFuncData { char *buf; int size; ADIO_Offset offset; - ADIO_Status status; + ADIO_Status *status; int error_code; } ADIOI_IO_ThreadFuncData; @@ -920,12 +1093,12 @@ void *ADIOI_IO_Thread_Func(void *vptr_args); #define PATH_MAX 65535 #endif -#endif - - #if (HAVE_DECL_PWRITE == 0) #include #include ssize_t pread(int fd, void *buf, size_t count, off_t offset); ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); + #endif + +#endif /* ADIOI_INCLUDE */ diff --git a/ompi/mca/io/romio314/romio/adio/include/adioi_errmsg.h b/ompi/mca/io/romio321/romio/adio/include/adioi_errmsg.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/adioi_errmsg.h rename to ompi/mca/io/romio321/romio/adio/include/adioi_errmsg.h diff --git a/ompi/mca/io/romio314/romio/adio/include/adioi_error.h b/ompi/mca/io/romio321/romio/adio/include/adioi_error.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/adioi_error.h rename to ompi/mca/io/romio321/romio/adio/include/adioi_error.h diff --git a/ompi/mca/io/romio314/romio/adio/include/adioi_fs_proto.h b/ompi/mca/io/romio321/romio/adio/include/adioi_fs_proto.h similarity index 97% rename from ompi/mca/io/romio314/romio/adio/include/adioi_fs_proto.h rename to ompi/mca/io/romio321/romio/adio/include/adioi_fs_proto.h index 5c3f748096..e3af917082 100644 --- a/ompi/mca/io/romio314/romio/adio/include/adioi_fs_proto.h +++ b/ompi/mca/io/romio321/romio/adio/include/adioi_fs_proto.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/adio/include/heap-sort.h b/ompi/mca/io/romio321/romio/adio/include/heap-sort.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/heap-sort.h rename to ompi/mca/io/romio321/romio/adio/include/heap-sort.h diff --git a/ompi/mca/io/romio314/romio/adio/include/hint_fns.h b/ompi/mca/io/romio321/romio/adio/include/hint_fns.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/hint_fns.h rename to ompi/mca/io/romio321/romio/adio/include/hint_fns.h diff --git a/ompi/mca/io/romio314/romio/adio/include/mpio_error.h b/ompi/mca/io/romio321/romio/adio/include/mpio_error.h similarity index 96% rename from ompi/mca/io/romio314/romio/adio/include/mpio_error.h rename to ompi/mca/io/romio321/romio/adio/include/mpio_error.h index 88fdb09273..f9d22b1721 100644 --- a/ompi/mca/io/romio314/romio/adio/include/mpio_error.h +++ b/ompi/mca/io/romio321/romio/adio/include/mpio_error.h @@ -59,7 +59,7 @@ #define MPIR_ERR_ASYNC_OUTSTANDING 27 #define MPIR_READ_PERM 29 #define MPIR_PREALLOC_PERM 31 -#define MPIR_ERR_FILETYPE 33 +#define MPIR_ERR_FILETYPE 33 #define MPIR_ERR_NO_NTFS 35 #define MPIR_ERR_NO_TESTFS 36 #define MPIR_ERR_NO_LUSTRE 37 @@ -68,7 +68,7 @@ /* MPI_ERR_COMM */ #ifndef MPIR_ERR_COMM_NULL #define MPIR_ERR_COMM_NULL 3 -#define MPIR_ERR_COMM_INTER 5 +#define MPIR_ERR_COMM_INTER 5 #endif /* MPI_ERR_UNSUPPORTED_DATAREP */ diff --git a/ompi/mca/io/romio314/romio/adio/include/mpipr.h b/ompi/mca/io/romio321/romio/adio/include/mpipr.h similarity index 99% rename from ompi/mca/io/romio314/romio/adio/include/mpipr.h rename to ompi/mca/io/romio321/romio/adio/include/mpipr.h index bfe8b5ebf6..8b86c4cfe1 100644 --- a/ompi/mca/io/romio314/romio/adio/include/mpipr.h +++ b/ompi/mca/io/romio321/romio/adio/include/mpipr.h @@ -4,8 +4,8 @@ * See COPYRIGHT in top-level directory. */ /* This file replaces all MPI function names with their PMPI equivalents. - PMPI versions are used by default so that the user can profile - application code without interference from MPI functions used by + PMPI versions are used by default so that the user can profile + application code without interference from MPI functions used by MPI-IO. */ #ifndef USE_MPI_VERSIONS @@ -293,7 +293,7 @@ #undef MPI_Wtime #define MPI_Wtime PMPI_Wtime -/* commented out because these could be macros themselves, as in MPICH +/* commented out because these could be macros themselves, as in MPICH #undef MPI_Type_c2f #define MPI_Type_c2f PMPI_Type_c2f #undef MPI_Type_f2c diff --git a/ompi/mca/io/romio314/romio/adio/include/mpiu_external32.h b/ompi/mca/io/romio321/romio/adio/include/mpiu_external32.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/mpiu_external32.h rename to ompi/mca/io/romio321/romio/adio/include/mpiu_external32.h diff --git a/ompi/mca/io/romio314/romio/adio/include/mpiu_greq.h b/ompi/mca/io/romio321/romio/adio/include/mpiu_greq.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/mpiu_greq.h rename to ompi/mca/io/romio321/romio/adio/include/mpiu_greq.h diff --git a/ompi/mca/io/romio314/romio/adio/include/nopackage.h b/ompi/mca/io/romio321/romio/adio/include/nopackage.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/nopackage.h rename to ompi/mca/io/romio321/romio/adio/include/nopackage.h diff --git a/ompi/mca/io/romio314/romio/adio/include/romioconf-undefs.h b/ompi/mca/io/romio321/romio/adio/include/romioconf-undefs.h similarity index 100% rename from ompi/mca/io/romio314/romio/adio/include/romioconf-undefs.h rename to ompi/mca/io/romio321/romio/adio/include/romioconf-undefs.h diff --git a/ompi/mca/io/romio314/romio/autogen.sh b/ompi/mca/io/romio321/romio/autogen.sh similarity index 100% rename from ompi/mca/io/romio314/romio/autogen.sh rename to ompi/mca/io/romio321/romio/autogen.sh diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_am.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_am.m4 similarity index 98% rename from ompi/mca/io/romio314/romio/confdb/aclocal_am.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_am.m4 index 8e425df190..4d3b0de225 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_am.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_am.m4 @@ -1,6 +1,6 @@ dnl AM_IGNORE is an extension that tells (a patched) automake not to dnl include the specified AC_SUBST variable in the Makefile.in that -dnl automake generates. We don't use AC_DEFUN, since aclocal will +dnl automake generates. We don't use AC_DEFUN, since aclocal will dnl then complain that AM_IGNORE is a duplicate (if you are using the dnl patched automake/aclocal). m4_ifdef([AM_IGNORE],[],[m4_define([AM_IGNORE],[])]) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_atomic.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_atomic.m4 similarity index 99% rename from ompi/mca/io/romio314/romio/confdb/aclocal_atomic.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_atomic.m4 index 0bda659a98..4e96cfbf36 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_atomic.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_atomic.m4 @@ -16,11 +16,11 @@ dnl . HAVE__INTERLOCKEDEXCHANGE - _InterlockedExchange intrinsic is available dnl (IA64) dnl . HAVE_GCC_ASM_SPARC_MEMBAR - gcc __asm__ will issue SPARC architecture dnl memory barrier instruction -dnl . HAVE_SOLARIS_ASM_SPARC_MEMBAR - Solaris asm() will issue SPARC +dnl . HAVE_SOLARIS_ASM_SPARC_MEMBAR - Solaris asm() will issue SPARC dnl architecture memory barrier instruction dnl . HAVE_GCC_ASM_SPARC_STBAR - gcc __asm__ will issue stbar dnl - HAVE_SOLARIS_ASM_SPARC_STBAR - Solaris __asm() will issue stbar -dnl +dnl dnl D*/ AC_DEFUN([PAC_C_MEMATOMIC],[ AC_CACHE_CHECK([for x86 mfence instruction using __asm__], @@ -114,9 +114,9 @@ if test "$lac_cv_have___asm_and_x86_lfence" = "yes" ; then AC_DEFINE(HAVE___ASM_AND_X86_LFENCE, 1, [Define if using __asm on a x86 system with the lfence instruction]) fi -dnl +dnl dnl Some compilers, such as pgcc, may require additional arguments. -dnl pgcc may need -Masmkeyword flag. We may want to try this with and +dnl pgcc may need -Masmkeyword flag. We may want to try this with and dnl without adding -Masmkeyword to CFLAGS AC_CACHE_CHECK([for x86 mfence instruction using asm()], @@ -224,4 +224,4 @@ int main(int argc, char **argv){ if test "$pac_cv_solaris_sparc_stbar" = yes ; then AC_DEFINE(HAVE_SOLARIS_ASM_SPARC_STBAR,1,[Define if solaris asm stbar supported]) fi -]) +]) \ No newline at end of file diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_attr_alias.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_attr_alias.m4 similarity index 99% rename from ompi/mca/io/romio314/romio/confdb/aclocal_attr_alias.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_attr_alias.m4 index 128a08844a..32f016546d 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_attr_alias.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_attr_alias.m4 @@ -17,7 +17,7 @@ AC_PATH_PROGS_FEATURE_CHECK(NM_G, nm, [ # Tru64's nm complains that /dev/null is an invalid object file # # AIX's sed does not accept \+, 1) instead of doing 's|a\+||', do 's|aa*||' - # or 2) instead of 's|A \+B|AB|g', do 's|A *B|AB|g' + # or 2) instead of 's|A \+B|AB|g', do 's|A *B|AB|g' # Check if nm accepts -g case `${ac_path_NM_G} -g /dev/null 2>&1 | sed '1q'` in @@ -108,7 +108,7 @@ mpif_cmblk_t MPIFCMB; /* Do the test in this file instead in the file - where __attribute__((alias)) is used. + where __attribute__((alias)) is used. This is needed for pgcc since pgcc seems to define aliased symbols if they are in the same file. */ @@ -171,7 +171,7 @@ if test "$pac_c_attr_alias_other" = "yes" ; then #if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) #include #endif - + struct mpif_cmblk_t_ { int imember; }; typedef struct mpif_cmblk_t_ mpif_cmblk_t; @@ -239,7 +239,7 @@ if test "$pac_c_attr_alias_main" = "yes" ; then cmp_addr=${addr} fi done - + if test "$diff_addrs" != "yes" ; then dnl echo "Same addresses. Multiple aliases support" AC_MSG_RESULT([${NM_G} says yes]) @@ -348,7 +348,7 @@ dnl the following weird behavour dnl pgf77 -o ftest ftest.f => when $?=0 with zero stderr output dnl pgf77 -o ftest ftest.f dummy.o => when $?=0 with non-zero stderr output. dnl stderr has "ftest.f:". -dnl +dnl # First create a fortran CONFTEST which will be used repeatedly. AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77]) AC_LANG_CONFTEST([ @@ -385,7 +385,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[ pac_f2c_alignedn_diffbase=no ]) # Be sure NOT to remove the conftest.f which is still needed for later use. - # rm -f conftest.$ac_ext + # rm -f conftest.$ac_ext # Restore everything in autoconf that has been overwritten PAC_POP_FLAG([ac_link]) # restore previously pushed LIBS diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_bugfix.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_bugfix.m4 similarity index 95% rename from ompi/mca/io/romio314/romio/confdb/aclocal_bugfix.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_bugfix.m4 index 1f8704ed15..f580d3919a 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_bugfix.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_bugfix.m4 @@ -17,26 +17,26 @@ dnl Synopsis: dnl PAC_PROG_CHECK_INSTALL_WORKS dnl dnl Output Effect: -dnl Sets the variable 'INSTALL' to the value of 'ac_sh_install' if +dnl Sets the variable 'INSTALL' to the value of 'ac_sh_install' if dnl a file cannot be installed into a local directory with the 'INSTALL' dnl program dnl dnl Notes: -dnl The 'AC_PROG_INSTALL' scripts tries to avoid broken versions of -dnl install by avoiding directories such as '/usr/sbin' where some -dnl systems are known to have bad versions of 'install'. Unfortunately, +dnl The 'AC_PROG_INSTALL' scripts tries to avoid broken versions of +dnl install by avoiding directories such as '/usr/sbin' where some +dnl systems are known to have bad versions of 'install'. Unfortunately, dnl this is exactly the sort of test-on-name instead of test-on-capability dnl that 'autoconf' is meant to eliminate. The test in this script -dnl is very simple but has been adequate for working around problems -dnl on Solaris, where the '/usr/sbin/install' program (known by -dnl autoconf to be bad because it is in /usr/sbin) is also reached by a +dnl is very simple but has been adequate for working around problems +dnl on Solaris, where the '/usr/sbin/install' program (known by +dnl autoconf to be bad because it is in /usr/sbin) is also reached by a dnl soft link through /bin, which autoconf believes is good. dnl -dnl No variables are cached to ensure that we do not make a mistake in +dnl No variables are cached to ensure that we do not make a mistake in dnl our choice of install program. dnl dnl The Solaris configure requires the directory name to immediately -dnl follow the '-c' argument, rather than the more common +dnl follow the '-c' argument, rather than the more common dnl.vb dnl args sourcefiles destination-dir dnl.ve diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_cache.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_cache.m4 similarity index 95% rename from ompi/mca/io/romio314/romio/confdb/aclocal_cache.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_cache.m4 index d0a7982247..9d02c41638 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_cache.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_cache.m4 @@ -1,20 +1,20 @@ dnl dnl/*D -dnl AC_CACHE_LOAD - Replacement for autoconf cache load +dnl AC_CACHE_LOAD - Replacement for autoconf cache load dnl dnl Notes: -dnl Caching in autoconf is broken (at least through version 2.13). +dnl Caching in autoconf is broken (at least through version 2.13). dnl The problem is that the cache is read dnl without any check for whether it makes any sense to read it. -dnl A common problem is a build on a shared file system; connecting to +dnl A common problem is a build on a shared file system; connecting to dnl a different computer and then building within the same directory will dnl lead to at best error messages from configure and at worse a build that dnl is wrong but fails only at run time (e.g., wrong datatype sizes used). dnl Later versions of autoconf do include some checks for changes in the dnl environment that impact the choices, but still misses problems with dnl multiple different systems. -dnl -dnl This fixes that by requiring the user to explicitly enable caching +dnl +dnl This fixes that by requiring the user to explicitly enable caching dnl before the cache file will be loaded. dnl dnl To use this version of 'AC_CACHE_LOAD', you need to include @@ -26,7 +26,7 @@ dnl command causes configure to keep track of the system being configured dnl in a config.system file; if the current system matches the value stored dnl in that file (or there is neither a config.cache nor config.system file), dnl configure will enable caching. In order to ensure that the configure -dnl tests make sense, the values of CC, F77, F90, and CXX are also included +dnl tests make sense, the values of CC, F77, F90, and CXX are also included dnl in the config.system file. In addition, the value of PATH is included dnl to ensure that changes in the PATH that might select a different version dnl of a program with the same name (such as a native make versus gnumake) @@ -34,7 +34,7 @@ dnl are detected. dnl dnl Bugs: dnl This does not work with the Cygnus configure because the enable arguments -dnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid +dnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid dnl changing the value of enable_cache, and use real_enable_cache, duplicating dnl the "notgiven" value. dnl @@ -46,14 +46,14 @@ dnl See Also: dnl PAC_ARG_CACHING dnl D*/ define([AC_CACHE_LOAD], -[if test "$CONFIGURE_DEBUG_CACHE" = yes ; then +[if test "$CONFIGURE_DEBUG_CACHE" = yes ; then oldopts="$-" clearMinusX=no - set -x - if test "$oldopts" != "$-" ; then + set -x + if test "$oldopts" != "$-" ; then clearMinusX=yes fi -fi +fi if test "X$cache_system" = "X" ; then # A default file name, just in case cache_system="config.system" @@ -66,13 +66,13 @@ if test "X$cache_system" = "X" ; then test "x$cache_system" = "x$cache_file" && cache_system="config.system" # else # We must *not* set enable_cache to no because we need to know if -# enable_cache was not set. +# enable_cache was not set. # enable_cache=no fi fi dnl dnl The "action-if-not-given" part of AC_ARG_ENABLE is not executed until -dnl after the AC_CACHE_LOAD is executed (!). Thus, the value of +dnl after the AC_CACHE_LOAD is executed (!). Thus, the value of dnl enable_cache if neither --enable-cache or --disable-cache is selected dnl is null. Just in case autoconf ever fixes this, we test both cases. dnl @@ -81,12 +81,12 @@ dnl change which versions of programs are found (such as vendor make dnl or GNU make). dnl # -# Get a test value and flag whether we should remove/replace the +# Get a test value and flag whether we should remove/replace the # cache_system file (do so unless cache_system_ok is yes) # FC and F77 should be synonyms. Save both in case # We include the xxxFLAGS in case the user is using the flags to change -# the language (either input or output) of the compiler. E.g., -# using -xarch=v9 on Solaris to select 64 bit output or using -D_BSD_SOURCE +# the language (either input or output) of the compiler. E.g., +# using -xarch=v9 on Solaris to select 64 bit output or using -D_BSD_SOURCE # with gcc to get different header files on input. cleanargs=`echo "$CC $F77 $FC $CXX $F90 $CFLAGS $FFLAGS $CXXFLAGS $F90FLAGS $PATH" | tr '"' ' '` if uname -srm >/dev/null 2>&1 ; then @@ -112,7 +112,7 @@ if test "X$real_enable_cache" = "Xnotgiven" ; then elif test ! -f "$cache_system" -a -n "$cache_system_text" ; then # remove the cache file because it may not correspond to our # system - if test "$cache_file" != "/dev/null" ; then + if test "$cache_file" != "/dev/null" ; then rm -f $cache_file fi real_enable_cache="yes" @@ -157,7 +157,7 @@ if test "$clearMinusX" = yes ; then fi ]) dnl -dnl/*D +dnl/*D dnl PAC_ARG_CACHING - Enable caching of results from a configure execution dnl dnl Synopsis: @@ -165,7 +165,7 @@ dnl PAC_ARG_CACHING dnl dnl Output Effects: dnl Adds '--enable-cache' and '--disable-cache' to the command line arguments -dnl accepted by 'configure'. +dnl accepted by 'configure'. dnl dnl See Also: dnl AC_CACHE_LOAD @@ -194,7 +194,7 @@ AC_DEFUN([PAC_CACHE_CLEAN],[ else echo "not updating unwritable cache $cache_file" fi - fi + fi rm -f confcache if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then echo "Results of cleaned cache file:" @@ -207,20 +207,20 @@ AC_DEFUN([PAC_CACHE_CLEAN],[ dnl/*D dnl PAC_SUBDIR_CACHE - Create a cache file before ac_output for subdirectory dnl configures. -dnl +dnl dnl Synopsis: dnl PAC_SUBDIR_CACHE(when) dnl dnl Input Parameter: dnl . when - Indicates when the cache should be created (optional) dnl If 'always', create a new cache file. This option -dnl should be used if any of the cache parameters (such as +dnl should be used if any of the cache parameters (such as dnl CFLAGS or LDFLAGS) may have changed. dnl dnl Output Effects: -dnl +dnl dnl Create a cache file before ac_output so that subdir configures don't -dnl make mistakes. +dnl make mistakes. dnl We can't use OUTPUT_COMMANDS to remove the cache file, because those dnl commands are executed *before* the subdir configures. dnl @@ -232,9 +232,9 @@ if test "x$1" = "xalways" -o \( "$cache_file" = "/dev/null" -a "X$real_enable_ca # lost cache_file=`pwd`/$$conf.cache touch $cache_file - dnl + dnl dnl For Autoconf 2.52+, we should ensure that the environment is set - dnl for the cache. Make sure that we get the values and set the + dnl for the cache. Make sure that we get the values and set the dnl xxx_set variables properly ac_cv_env_CC_set=set ac_cv_env_CC_value=$CC @@ -320,7 +320,7 @@ fi ]) dnl dnl The following three macros support the sharing of configure results -dnl by configure scripts, including ones that are not run with +dnl by configure scripts, including ones that are not run with dnl AC_CONFIG_SUBDIRS (the cachefiles managed by --enable-cache can dnl only be used with AC_CONFIG_SUBDIRS; creating a autoconf-style dnl cachefile before the the end of the autoconf process will often @@ -335,7 +335,7 @@ AC_ARG_ENABLE(base-cache, if test "$enable_base_cache" = "default" ; then if test "$CONF_USE_CACHEFILE" = yes ; then enable_base_cache=yes - else + else enable_base_cache=no fi fi diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_cc.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_cc.m4 similarity index 98% rename from ompi/mca/io/romio314/romio/confdb/aclocal_cc.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_cc.m4 index fc801f1709..666d0a4c26 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_cc.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_cc.m4 @@ -27,13 +27,13 @@ dnl dnl If no actions are specified, a working value is added to 'COPTIONS' dnl dnl Notes: -dnl This is now careful to check that the output is different, since +dnl This is now careful to check that the output is different, since dnl some compilers are noisy. -dnl +dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl -dnl Because this is a long script, we have ensured that you can pass a +dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl dnl D*/ @@ -68,11 +68,11 @@ AC_MSG_RESULT([$pac_result]) dnl Delete the conftest created by AC_LANG_CONFTEST. rm -f conftest.$ac_ext -# gcc 4.2.4 on 32-bit does not complain about the -Wno-type-limits option -# even though it doesn't support it. However, when another warning is -# triggered, it gives an error that the option is not recognized. So we +# gcc 4.2.4 on 32-bit does not complain about the -Wno-type-limits option +# even though it doesn't support it. However, when another warning is +# triggered, it gives an error that the option is not recognized. So we # need to test with a conftest file that will generate warnings. -# +# # add an extra switch, pac_c_check_compiler_option_prototest, to # disable this test just in case some new compiler does not like it. # @@ -155,13 +155,13 @@ dnl PAC_C_OPTIMIZATION([action if found]) dnl dnl Output Effect: dnl Adds options to 'COPTIONS' if no other action is specified -dnl +dnl dnl Notes: dnl This is a temporary standin for compiler optimization. dnl It should try to match known systems to known compilers (checking, of dnl course), and then falling back to some common defaults. dnl Note that many compilers will complain about -g and aggressive -dnl optimization. +dnl optimization. dnl D*/ AC_DEFUN([PAC_C_OPTIMIZATION],[ for copt in "-O4 -Ofast" "-Ofast" "-fast" "-O3" "-xO3" "-O" ; do @@ -221,18 +221,18 @@ return 0; } ],pac_cv_prog_c_unaligned_doubles="yes",pac_cv_prog_c_unaligned_doubles="no", pac_cv_prog_c_unaligned_doubles="unknown")]) -ifelse($1,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "yes" ; then +ifelse($1,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "yes" ; then $1 fi) -ifelse($2,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "no" ; then +ifelse($2,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "no" ; then $2 fi) -ifelse($3,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "unknown" ; then +ifelse($3,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "unknown" ; then $3 fi) ]) -dnl/*D +dnl/*D dnl PAC_PROG_C_WEAK_SYMBOLS - Test whether C supports weak alias symbols. dnl dnl Synopsis @@ -254,7 +254,7 @@ dnl sets the shell variable pac_cv_attr_weak to yes. dnl Also checks for __attribute__((weak_import)) which is supported by dnl Apple in Mac OSX (at least in Darwin). Note that this provides only dnl weak symbols, not weak aliases -dnl +dnl dnl D*/ AC_DEFUN([PAC_PROG_C_WEAK_SYMBOLS],[ pragma_extra_message="" @@ -273,7 +273,7 @@ int Foo(int a) { return a; } # only within a single object file! This tests that case. # Note that there is an extern int PFoo declaration before the # pragma. Some compilers require this in order to make the weak symbol -# externally visible. +# externally visible. if test "$has_pragma_weak" = yes ; then PAC_COMPLINK_IFELSE([ AC_LANG_SOURCE([ @@ -315,7 +315,7 @@ return Foo(0);} ]) fi dnl -if test -z "$pac_cv_prog_c_weak_symbols" ; then +if test -z "$pac_cv_prog_c_weak_symbols" ; then AC_TRY_LINK([ extern int PFoo(int); #pragma _HP_SECONDARY_DEF Foo PFoo @@ -404,14 +404,14 @@ correctly set error code when a fatal error occurs]) fi ]) -dnl/*D +dnl/*D dnl PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS - Test whether C and the dnl linker allow multiple weak symbols. dnl dnl Synopsis dnl PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS(action-if-true,action-if-false) dnl -dnl +dnl dnl D*/ AC_DEFUN([PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS],[ AC_CACHE_CHECK([for multiple weak symbol support], @@ -451,10 +451,10 @@ dnl pac_cc_strict_flags contains the strict flags. dnl dnl -std=c89 is used to select the C89 version of the ANSI/ISO C standard. dnl As of this writing, many C compilers still accepted only this version, -dnl not the later C99 version. When all compilers accept C99, this +dnl not the later C99 version. When all compilers accept C99, this dnl should be changed to the appropriate standard level. Note that we've -dnl had trouble with gcc 2.95.3 accepting -std=c89 but then trying to -dnl compile program with a invalid set of options +dnl had trouble with gcc 2.95.3 accepting -std=c89 but then trying to +dnl compile program with a invalid set of options dnl (-D __STRICT_ANSI__-trigraphs) AC_DEFUN([PAC_CC_STRICT],[ export enable_strict_done @@ -469,14 +469,14 @@ if test "$enable_strict_done" != "yes" ; then # warning at 256k. # # These were added to reduce warnings: - # -Wno-missing-field-initializers -- We want to allow a struct to be - # initialized to zero using "struct x y = {0};" and not require + # -Wno-missing-field-initializers -- We want to allow a struct to be + # initialized to zero using "struct x y = {0};" and not require # each field to be initialized individually. # -Wno-unused-parameter -- For portability, some parameters go unused - # when we have different implementations of functions for + # when we have different implementations of functions for # different platforms - # -Wno-unused-label -- We add fn_exit: and fn_fail: on all functions, - # but fn_fail may not be used if the function doesn't return an + # -Wno-unused-label -- We add fn_exit: and fn_fail: on all functions, + # but fn_fail may not be used if the function doesn't return an # error. # -Wno-sign-compare -- read() and write() return bytes read/written # as a signed value, but we often compare this to size_t (or @@ -484,10 +484,10 @@ if test "$enable_strict_done" != "yes" ; then # -Wno-format-zero-length -- this warning is irritating and useless, since # a zero-length format string is very well defined # These were removed to reduce warnings: - # -Wcast-qual -- Sometimes we need to cast "volatile char*" to + # -Wcast-qual -- Sometimes we need to cast "volatile char*" to # "char*", e.g., for memcpy. # -Wpadded -- We catch struct padding with asserts when we need to - # -Wredundant-decls -- Having redundant declarations is benign and the + # -Wredundant-decls -- Having redundant declarations is benign and the # code already has some. # -Waggregate-return -- This seems to be a performance-related warning # aggregate return values are legal in ANSI C, but they may be returned @@ -498,7 +498,7 @@ if test "$enable_strict_done" != "yes" ; then # -Wdeclaration-after-statement -- This is a C89 # requirement. When compiling with C99, this should be # disabled. - # -Wfloat-equal -- There are places in hwloc that set a float var to 0, then + # -Wfloat-equal -- There are places in hwloc that set a float var to 0, then # compare it to 0 later to see if it was updated. Also when using strtod() # one needs to compare the return value with 0 to see whether a conversion # was performed. @@ -519,11 +519,11 @@ if test "$enable_strict_done" != "yes" ; then # However, since Intel compiler currently does not include -Wtype-limits # in -Wextra, -Wtype-limits was added to handle warnings with the Intel # compiler. - # -Wno-type-limits -- There are places where we compare an unsigned to - # a constant that happens to be zero e.g., if x is unsigned and + # -Wno-type-limits -- There are places where we compare an unsigned to + # a constant that happens to be zero e.g., if x is unsigned and # MIN_VAL is zero, we'd like to do "MPIU_Assert(x >= MIN_VAL);". - # Note this option is not supported by gcc 4.2. This needs to be added - # after most other warning flags, so that we catch a gcc bug on 32-bit + # Note this option is not supported by gcc 4.2. This needs to be added + # after most other warning flags, so that we catch a gcc bug on 32-bit # that doesn't give a warning that this is unsupported, unless another # warning is triggered, and then if gives an error. # the embedded newlines in this string are safe because we evaluate each @@ -626,13 +626,6 @@ if test "$enable_strict_done" != "yes" ; then pac_cc_strict_flags="-O2" fi pac_cc_strict_flags="$pac_cc_strict_flags $pac_common_strict_flags" - case "$enable_posix" in - no) : ;; - 1995) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=199506L],[pac_cc_strict_flags]) ;; - 2001) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=200112L],[pac_cc_strict_flags]) ;; - 2008) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=200809L],[pac_cc_strict_flags]) ;; - *) AC_MSG_ERROR([internal error, unexpected POSIX version: '$enable_posix']) ;; - esac # We only allow one of strict-C99 or strict-C89 to be # enabled. If C99 is enabled, we automatically disable C89. if test "${enable_c99}" = "yes" ; then @@ -645,6 +638,16 @@ if test "$enable_strict_done" != "yes" ; then PAC_APPEND_FLAG([-std=c89],[pac_cc_strict_flags]) PAC_APPEND_FLAG([-Wdeclaration-after-statement],[pac_cc_strict_flags]) fi + # POSIX 2001 should be used with C99. But the default standard for some + # compilers are not C99. We must test the support of POSIX 2001 after + # testing C99. + case "$enable_posix" in + no) : ;; + 1995) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=199506L],[pac_cc_strict_flags]) ;; + 2001) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=200112L],[pac_cc_strict_flags]) ;; + 2008) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=200809L],[pac_cc_strict_flags]) ;; + *) AC_MSG_ERROR([internal error, unexpected POSIX version: '$enable_posix']) ;; + esac fi # See if the above options work with the compiler @@ -660,11 +663,11 @@ fi ]) dnl/*D -dnl PAC_ARG_STRICT - Add --enable-strict to configure. +dnl PAC_ARG_STRICT - Add --enable-strict to configure. dnl dnl Synopsis: dnl PAC_ARG_STRICT -dnl +dnl dnl Output effects: dnl Adds '--enable-strict' to the command line. dnl @@ -685,7 +688,7 @@ dnl four dnl eight dnl dnl In addition, a "Could not determine alignment" and a "error!" -dnl return is possible. +dnl return is possible. AC_DEFUN([PAC_C_MAX_INTEGER_ALIGN],[ AC_CACHE_CHECK([for max C struct integer alignment], pac_cv_c_max_integer_align,[ @@ -816,7 +819,7 @@ dnl eight dnl sixteen dnl dnl In addition, a "Could not determine alignment" and a "error!" -dnl return is possible. +dnl return is possible. AC_DEFUN([PAC_C_MAX_FP_ALIGN],[ AC_CACHE_CHECK([for max C struct floating point alignment], pac_cv_c_max_fp_align,[ @@ -930,7 +933,7 @@ dnl four dnl eight dnl dnl In addition, a "Could not determine alignment" and a "error!" -dnl return is possible. +dnl return is possible. AC_DEFUN([PAC_C_MAX_DOUBLE_FP_ALIGN],[ AC_CACHE_CHECK([for max C struct alignment of structs with doubles], pac_cv_c_max_double_fp_align,[ @@ -1232,7 +1235,7 @@ dnl Synopsis: dnl PAC_FUNC_NEEDS_DECL(headerfiles,funcname) dnl dnl Output Effect: -dnl Sets 'NEEDS__DECL' if 'funcname' is not declared by the +dnl Sets 'NEEDS__DECL' if 'funcname' is not declared by the dnl headerfiles. dnl dnl Approach: @@ -1269,8 +1272,8 @@ dnl #endif dnl If *not*, define __attribute__(a) as null dnl dnl We start by requiring Gcc. Some other compilers accept __attribute__ -dnl but generate warning messages, or have different interpretations -dnl (which seems to make __attribute__ just as bad as #pragma) +dnl but generate warning messages, or have different interpretations +dnl (which seems to make __attribute__ just as bad as #pragma) dnl For example, the Intel icc compiler accepts __attribute__ and dnl __attribute__((pure)) but generates warnings for __attribute__((format...)) dnl @@ -1308,7 +1311,7 @@ AC_COMPILE_IFELSE([ ],[ if ${AR-ar} ${AR_FLAGS-cr} libconftest.a conftest.$OBJEXT >/dev/null 2>&1 ; then if ${RANLIB-:} libconftest.a >/dev/null 2>&1 ; then - # Anything less than sleep 10, and Mac OS/X (Darwin) + # Anything less than sleep 10, and Mac OS/X (Darwin) # will claim that install works because ranlib won't complain sleep 10 libinstall="$INSTALL_DATA" @@ -1325,7 +1328,7 @@ int main(int argc, char **argv){ return foo(0); } # Success! Install works ac_cv_prog_install_breaks_libs=no ],[ - # Failure! Does install -p work? + # Failure! Does install -p work? rm -f libconftest1.a if ${libinstall} -p libconftest.a libconftest1.a >/dev/null 2>&1 ; then AC_LINK_IFELSE([],[ @@ -1366,7 +1369,7 @@ AC_SUBST(RANLIB_AFTER_INSTALL) # These tests check not only that the compiler defines some symbol, such # as __FUNCTION__, but that the symbol correctly names the function. # -# Defines +# Defines # HAVE__FUNC__ (if __func__ defined) # HAVE_CAP__FUNC__ (if __FUNC__ defined) # HAVE__FUNCTION__ (if __FUNCTION__ defined) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_coverage.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_coverage.m4 similarity index 97% rename from ompi/mca/io/romio314/romio/confdb/aclocal_coverage.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_coverage.m4 index 4b7cf0881a..ce949d40a6 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_coverage.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_coverage.m4 @@ -44,7 +44,7 @@ if test "$enable_coverage" = "yes" ; then fi fi # Add similar options for g77 so that the Fortran tests will also - # + # if test "$enable_f77" = yes ; then if test "$ac_cv_f77_compiler_gnu" = "yes" ; then FFLAGS="$FFLAGS -fprofile-arcs -ftest-coverage" @@ -67,14 +67,14 @@ if test "$enable_coverage" = "yes" ; then AC_MSG_WARN([--enable-coverage only supported for GFORTRAN]) fi fi - # On some platforms (e.g., Mac Darwin), we must also *link* + # On some platforms (e.g., Mac Darwin), we must also *link* # with the -fprofile-args -ftest-coverage option. AC_MSG_CHECKING([whether compilation with coverage analysis enabled works]) AC_LINK_IFELSE([AC_LANG_SOURCE([int main(int argc, char **argv){return 1;}])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([Unable to link programs when coverage analysis enabled])]) - + # Test for the routines that we need to use to ensure that the # data files are (usually) written out # FIXME: Some versions of Linux provide usleep, but it rounds times diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_cxx.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_cxx.m4 similarity index 98% rename from ompi/mca/io/romio314/romio/confdb/aclocal_cxx.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_cxx.m4 index 2edf623538..72febd8ab9 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_cxx.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_cxx.m4 @@ -78,7 +78,7 @@ AC_DEFUN([AX_CXX_NAMESPACE_STD], AC_CACHE_CHECK(whether the compiler implements the namespace std, ac_cv_cxx_namespace_std, [ac_cv_cxx_namespace_std=no -if test "$ac_cv_cxx_namespaces" = yes ; then +if test "$ac_cv_cxx_namespaces" = yes ; then AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ @@ -106,13 +106,13 @@ dnl dnl If no actions are specified, a working value is added to 'CXXOPTIONS' dnl dnl Notes: -dnl This is now careful to check that the output is different, since +dnl This is now careful to check that the output is different, since dnl some compilers are noisy. -dnl +dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl -dnl Because this is a long script, we have ensured that you can pass a +dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl D*/ AC_DEFUN([PAC_CXX_CHECK_COMPILER_OPTION],[ diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_f77.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_f77.m4 similarity index 98% rename from ompi/mca/io/romio314/romio/confdb/aclocal_f77.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_f77.m4 index e7a8feff72..92d310b0f2 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_f77.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_f77.m4 @@ -13,7 +13,7 @@ PAC_POP_FLAG([FFLAGS]) dnl dnl/*D dnl PAC_PROG_F77_NAME_MANGLE - Determine how the Fortran compiler mangles -dnl names +dnl names dnl dnl Synopsis: dnl PAC_PROG_F77_NAME_MANGLE([action]) @@ -31,20 +31,20 @@ dnl mixed -> mixed_ F77_NAME_MIXED_USCORE dnl mixed -> UPPER@STACK_SIZE F77_NAME_UPPER_STDCALL dnl.ve dnl If an action is specified, it is executed instead. -dnl +dnl dnl Notes: dnl We assume that if lower -> lower (any underscore), upper -> upper with the -dnl same underscore behavior. Previous versions did this by -dnl compiling a Fortran program and running strings -a over it. Depending on -dnl strings is a bad idea, so instead we try compiling and linking with a +dnl same underscore behavior. Previous versions did this by +dnl compiling a Fortran program and running strings -a over it. Depending on +dnl strings is a bad idea, so instead we try compiling and linking with a dnl C program, since that is why we are doing this anyway. A similar approach -dnl is used by FFTW, though without some of the cases we check (specifically, +dnl is used by FFTW, though without some of the cases we check (specifically, dnl mixed name mangling). STD_CALL not only specifies a particular name dnl mangling convention (adding the size of the calling stack into the function dnl name, but also the stack management convention (callee cleans the stack, dnl and arguments are pushed onto the stack from right to left) dnl -dnl One additional problem is that some Fortran implementations include +dnl One additional problem is that some Fortran implementations include dnl references to the runtime (like pgf90_compiled for the pgf90 compiler dnl used as the "Fortran 77" compiler). This is not yet solved. dnl @@ -104,7 +104,7 @@ if test "$pac_found" != "yes" ; then AC_LANG_PROGRAM([],[ call my_name(0)]) ],[ pac_found=yes - ]) + ]) AC_LANG_POP([Fortran 77]) LIBS="$saved_LIBS" rm -f cconftest.$OBJEXT @@ -163,7 +163,7 @@ name_scheme="`echo $pac_cv_prog_f77_name_mangle | sed 's% %_%g'`" # Turn lowercase into uppercase. name_scheme="`echo $name_scheme | sed -e 'y%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ%'`" F77_NAME_MANGLE="F77_NAME_${name_scheme}" -AC_DEFINE_UNQUOTED([$F77_NAME_MANGLE]) +AC_DEFINE_UNQUOTED([$F77_NAME_MANGLE]) AC_SUBST(F77_NAME_MANGLE) if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then AC_MSG_WARN([Unknown Fortran naming scheme]) @@ -208,11 +208,11 @@ dnl Sets SIZEOF_F77_uctype to the size if bytes of type. dnl If type is unknown, the size is set to 0. dnl If cross-compiling, the value cross-size is used (it may be a variable) dnl For example 'PAC_PROG_F77_CHECK_SIZEOF(real)' defines -dnl 'SIZEOF_F77_REAL' to 4 on most systems. The variable +dnl 'SIZEOF_F77_REAL' to 4 on most systems. The variable dnl 'pac_cv_sizeof_f77_' (e.g., 'pac_cv_sizeof_f77_real') is also set to -dnl the size of the type. +dnl the size of the type. dnl If the corresponding variable is already set, that value is used. -dnl If the name has an '*' in it (e.g., 'integer*4'), the defined name +dnl If the name has an '*' in it (e.g., 'integer*4'), the defined name dnl replaces that with an underscore (e.g., 'SIZEOF_F77_INTEGER_4'). dnl dnl Notes: @@ -263,7 +263,7 @@ static int isize_val=0; void cisize_(char *,char*); void isize_(void); void cisize_(char *i1p, char *i2p) -{ +{ isize_val = (int)(i2p - i1p); } ],[ @@ -398,7 +398,7 @@ dnl Notes: dnl Check whether '!' may be used to begin comments in Fortran. dnl dnl This macro requires a version of autoconf `after` 2.13; the 'acgeneral.m4' -dnl file contains an error in the handling of Fortran programs in +dnl file contains an error in the handling of Fortran programs in dnl 'AC_TRY_COMPILE' (fixed in our local version). dnl dnl D*/ @@ -434,13 +434,13 @@ dnl dnl If no actions are specified, a working value is added to 'FOPTIONS' dnl dnl Notes: -dnl This is now careful to check that the output is different, since +dnl This is now careful to check that the output is different, since dnl some compilers are noisy. -dnl +dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl -dnl Because this is a long script, we have ensured that you can pass a +dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl D*/ AC_DEFUN([PAC_F77_CHECK_COMPILER_OPTION],[ @@ -519,10 +519,10 @@ dnl PAC_PROG_F77_LIBRARY_DIR_FLAG - Determine the flag used to indicate dnl the directories to find libraries in dnl dnl Notes: -dnl Many compilers accept '-Ldir' just like most C compilers. -dnl Unfortunately, some (such as some HPUX Fortran compilers) do not, +dnl Many compilers accept '-Ldir' just like most C compilers. +dnl Unfortunately, some (such as some HPUX Fortran compilers) do not, dnl and require instead either '-Wl,-L,dir' or something else. This -dnl command attempts to determine what is accepted. The flag is +dnl command attempts to determine what is accepted. The flag is dnl placed into 'F77_LIBDIR_LEADER'. dnl dnl D*/ @@ -574,19 +574,19 @@ if test "X$pac_cv_prog_f77_library_dir_flag" != "Xnone" ; then fi ]) dnl -dnl/*D +dnl/*D dnl PAC_PROG_F77_HAS_INCDIR - Check whether Fortran accepts -Idir flag dnl dnl Syntax: dnl PAC_PROG_F77_HAS_INCDIR(directory,action-if-true,action-if-false) dnl dnl Output Effect: -dnl Sets 'F77_INCDIR' to the flag used to choose the directory. +dnl Sets 'F77_INCDIR' to the flag used to choose the directory. dnl dnl Notes: dnl This refers to the handling of the common Fortran include extension, dnl not to the use of '#include' with the C preprocessor. -dnl If directory does not exist, it will be created. In that case, the +dnl If directory does not exist, it will be created. In that case, the dnl directory should be a direct descendant of the current directory. dnl dnl D*/ @@ -628,7 +628,7 @@ fi dnl dnl/*D dnl PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS - Check whether the Fortran compiler -dnl allows unused and undefined functions to be listed in an external +dnl allows unused and undefined functions to be listed in an external dnl statement dnl dnl Syntax: @@ -659,12 +659,12 @@ else ifelse([$2],[],[:],[$2]) fi ]) -dnl PAC_PROG_F77_RUN_PROC_FROM_C( c main program, fortran routine, -dnl [action-if-works], [action-if-fails], +dnl PAC_PROG_F77_RUN_PROC_FROM_C( c main program, fortran routine, +dnl [action-if-works], [action-if-fails], dnl [cross-action] ) dnl Fortran routine MUST be named ftest unless you include code dnl to select the appropriate Fortran name. -dnl +dnl AC_DEFUN([PAC_PROG_F77_RUN_PROC_FROM_C],[ AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) @@ -706,18 +706,18 @@ AC_LANG_POP([Fortran 77]) ]) dnl PAC_PROG_F77_IN_C_LIBS dnl -dnl Find the essential libraries that are needed to use the C linker to -dnl create a program that includes a trival Fortran code. +dnl Find the essential libraries that are needed to use the C linker to +dnl create a program that includes a trival Fortran code. dnl dnl For example, all pgf90 compiled objects include a reference to the dnl symbol pgf90_compiled, found in libpgf90 . dnl -dnl There is an additional problem. To *run* programs, we may need +dnl There is an additional problem. To *run* programs, we may need dnl additional arguments; e.g., if shared libraries are used. Even dnl with autoconf 2.52, the autoconf macro to find the library arguments dnl doesn't handle this, either by detecting the use of -rpath or dnl by trying to *run* a trivial program. It only checks for *linking*. -dnl +dnl dnl AC_DEFUN([PAC_PROG_F77_IN_C_LIBS],[ AC_REQUIRE([AC_HEADER_STDC]) @@ -788,7 +788,7 @@ fi ]) dnl dnl Test to see if we should use C or Fortran to link programs whose -dnl main program is in Fortran. We may find that neither work because +dnl main program is in Fortran. We may find that neither work because dnl we need special libraries in each case. dnl AC_DEFUN([PAC_PROG_F77_LINKER_WITH_C],[ @@ -905,7 +905,7 @@ AC_LINK_IFELSE([],[ pac_libs="" pac_other="" for name in $FLIBS ; do - case $name in + case $name in -l*) pac_libs="$pac_libs $name" ;; -L*) pac_ldirs="$pac_ldirs $name" ;; *) pac_other="$pac_other $name" ;; @@ -927,7 +927,7 @@ AC_LANG_PUSH([C]) ]) dnl dnl Test for extra libraries needed when linking C routines that use -dnl stdio with Fortran. This test was created for OSX, which +dnl stdio with Fortran. This test was created for OSX, which dnl sometimes requires -lSystemStubs. If another library is needed, dnl add it to F77_OTHER_LIBS dnl @@ -991,7 +991,7 @@ dnl Endof ac_cache_check if test "$pac_cv_prog_f77_and_c_stdio_libs" != "none" \ -a "$pac_cv_prog_f77_and_c_stdio_libs" != "unknown" ; then F77_OTHER_LIBS="$F77_OTHER_LIBS $pac_cv_prog_f77_and_c_stdio_libs" -fi +fi ]) dnl dnl Check that the FLIBS determined by AC_F77_LIBRARY_LDFLAGS is valid. @@ -1205,7 +1205,7 @@ AC_LANG_POP([Fortran 77]) AC_MSG_RESULT([$pac_cv_f77_accepts_F]) ]) dnl -dnl /*D +dnl /*D dnl PAC_PROG_F77_CRAY_POINTER - Check if Fortran 77 supports Cray-style pointer. dnl If so, set pac_cv_prog_f77_has_pointer to yes dnl and find out if any extra compiler flag is @@ -1325,16 +1325,16 @@ dnl PAC_F77_LOGICALS_IN_C(MPI_FINT) dnl dnl where MPI_FINT is the C type for Fortran integer. dnl -dnl Use a Fortran main program. This simplifies some steps, -dnl since getting all of the Fortran libraries (including shared -dnl libraries that are not in the default library search path) can -dnl be tricky. Specifically, The PROG_F77_RUN_PROC_FROM_C failed with +dnl Use a Fortran main program. This simplifies some steps, +dnl since getting all of the Fortran libraries (including shared +dnl libraries that are not in the default library search path) can +dnl be tricky. Specifically, The PROG_F77_RUN_PROC_FROM_C failed with dnl some installations of the Portland group compiler. dnl dnl We'd also like to check other values for .TRUE. and .FALSE. to see dnl if the compiler allows (or uses) more than one value (some DEC compilers, -dnl for example, used the high (sign) bit to indicate true and false; the -dnl rest of the bits were ignored. For now, we'll assume that there are +dnl for example, used the high (sign) bit to indicate true and false; the +dnl rest of the bits were ignored. For now, we'll assume that there are dnl unique true and false values. dnl AC_DEFUN([PAC_F77_LOGICALS_IN_C],[ @@ -1416,14 +1416,14 @@ if test -n "$true_val" -a -n "$false_val" ; then fi ]) dnl/*D -dnl PAC_PROG_F77_MISMATCHED_ARGS([option],[AllOnly]) - Determine whether the -dnl Fortran compiler allows routines to be called with different -dnl argument types. If not, attempts to determine a command-line argument -dnl that permits such use +dnl PAC_PROG_F77_MISMATCHED_ARGS([option],[AllOnly]) - Determine whether the +dnl Fortran compiler allows routines to be called with different +dnl argument types. If not, attempts to determine a command-line argument +dnl that permits such use dnl (The Fortran standard prohibits this usage) dnl dnl option is set to the compiler option to use. -dnl if AllOnly is yes (literal, not variable with value), then only consider +dnl if AllOnly is yes (literal, not variable with value), then only consider dnl options that turn off checking dnl for all routines dnl @@ -1470,7 +1470,7 @@ if test "X$pac_cv_prog_f77_mismatched_args" = X ; then FFLAGS="$save_FFLAGS" if test "$testok" = yes ; then break ; fi done - if test "$testok" = yes ; then + if test "$testok" = yes ; then pac_cv_prog_f77_mismatched_args_parm="$flags" pac_cv_prog_f77_mismatched_args="yes, with $pac_cv_prog_f77_mismatched_args_parm" fi @@ -1479,7 +1479,7 @@ if test "X$pac_cv_prog_f77_mismatched_args" = X ; then fi AC_MSG_RESULT($pac_cv_prog_f77_mismatched_args) if test "$pac_cv_prog_f77_mismatched_args" = no ; then - AC_MSG_ERROR([The Fortran compiler $F77 will not compile files that call + AC_MSG_ERROR([The Fortran compiler $F77 will not compile files that call the same routine with arguments of different types.]) fi diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_f77old.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_f77old.m4 similarity index 94% rename from ompi/mca/io/romio314/romio/confdb/aclocal_f77old.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_f77old.m4 index 71d1ae4023..5d6e2d9e70 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_f77old.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_f77old.m4 @@ -15,7 +15,7 @@ dnl.ve dnl If 'F77_GETARG' has a value, then that value and the values for these dnl other symbols will be used instead. If no approach is found, all of these dnl variables will have empty values. -dnl If no other approach works and a file 'f77argdef' is in the directory, +dnl If no other approach works and a file 'f77argdef' is in the directory, dnl that file will be sourced for the values of the above four variables. dnl dnl In most cases, you should add F77_GETARG_FFLAGS to the FFLAGS variable @@ -24,13 +24,13 @@ dnl performed on the compiler version that will be used. dnl dnl 'AC_SUBST' is called for all six variables. dnl -dnl One complication is that on systems with multiple Fortran compilers, +dnl One complication is that on systems with multiple Fortran compilers, dnl some libraries used by one Fortran compiler may have been (mis)placed dnl in a common location. We have had trouble with libg2c in particular. dnl To work around this, we test whether iargc etc. work first. This dnl will catch most systems and will speed up the tests. dnl -dnl Next, the libraries are only added if they are needed to complete a +dnl Next, the libraries are only added if they are needed to complete a dnl link; they aren''t added just because they exist. dnl dnl f77argdef @@ -55,11 +55,11 @@ AC_CACHE_VAL(pac_cv_prog_f77_cmdarg, f77_getargdecl="${F77_GETARGDECL:-external getarg}" f77_getarg="${F77_GETARG:-call GETARG(i,s)}" f77_iargc="${F77_IARGC:-IARGC()}" - # + # # Grumble. The Absoft Fortran compiler computes i - i as 0 and then # 1.0 / 0 at compile time, even though the code may never be executed. # What we need is a way to generate an error, so the second usage of i - # was replaced with f77_iargc. + # was replaced with f77_iargc. cat > conftest.f <, but this caused other + # (we experimented with using a , but this caused other # problems because we need in the IFS) trial_LIBS="0 -lU77 -lPEPCF90" if test "$NOG2C" != "1" ; then @@ -149,7 +149,7 @@ $libs" # The -N109 was used for getarg before we realized that GETARG # was necessary with the (non standard conforming) Absoft compiler # (Fortran is monocase; Absoft uses mixedcase by default) - # The -f is used by Absoft and is the compiler switch that folds + # The -f is used by Absoft and is the compiler switch that folds # symbolic names to lower case. Without this option, the compiler # considers upper- and lower-case letters to be unique. # The -YEXT_NAMES=LCS will cause external names to be output as lower @@ -157,14 +157,14 @@ $libs" # The first line is ", the space is important # To make the Absoft f77 and f90 work together, we need to prefer the # upper case versions of the arguments. They also require libU77. - # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based) + # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based) # Fortran compilers # # Problem: The Intel efc compiler hangs when presented with -N109 . # The only real fix for this is to detect this compiler and exclude # the test. We may want to reorganize these tests so that if we # can compile code without special options, we never look for them. - # + # using_intel_efc="no" pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'` if test "$pac_test_msg" != "" ; then @@ -194,10 +194,10 @@ $libs" PAC_F77_CHECK_COMPILER_OPTION($flag,opt_ok=yes,opt_ok=no) fi if test "$opt_ok" = "yes" ; then - if test "$flag" = " " -o "$flag" = "000" ; then - fflag="" - else - fflag="$flag" + if test "$flag" = " " -o "$flag" = "000" ; then + fflag="" + else + fflag="$flag" fi # discard options that don't allow mixed-case name matching cat > conftest.f </dev/null 2>&1 ; then found_answer="yes" fi - else + else found_answer="yes" fi fi @@ -358,9 +358,9 @@ EOF fi done done - IFS="$save_IFS" + IFS="$save_IFS" rm -f conftest.* - trial=`expr $trial + 1` + trial=`expr $trial + 1` done fi pac_cv_F77_GETARGDECL="$F77_GETARGDECL" @@ -368,7 +368,7 @@ pac_cv_F77_IARGC="$F77_IARGC" pac_cv_F77_GETARG="$F77_GETARG" pac_cv_FXX_MODULE="$FXX_MODULE" ]) -if test "$found_cached" = "yes" ; then +if test "$found_cached" = "yes" ; then AC_MSG_RESULT([$pac_cv_prog_f77_cmdarg]) elif test -z "$pac_cv_F77_IARGC" ; then AC_MSG_WARN([Could not find a way to access the command line from Fortran 77]) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_fc.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_fc.m4 similarity index 97% rename from ompi/mca/io/romio314/romio/confdb/aclocal_fc.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_fc.m4 index 609ccb3326..c5e2d1fb0f 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_fc.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_fc.m4 @@ -33,7 +33,7 @@ dnl ifc - An older Intel compiler dnl fc - A compiler on some unknown system. This has been removed because dnl it may also be the name of a command for something other than dnl the Fortran compiler (e.g., fc=file system check!) -dnl gfortran - The GNU Fortran compiler (not the same as g95) +dnl gfortran - The GNU Fortran compiler (not the same as g95) dnl gfc - An alias for gfortran recommended in cygwin installations dnl NOTE: this macro suffers from a basically intractable "expanded before it dnl was required" problem when libtool is also used @@ -58,7 +58,7 @@ AC_COMPILE_IFELSE([ ],[ AC_MSG_RESULT([f90]) ],[ - ac_fc_srcext="f" + ac_fc_srcext="f" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM() ],[ @@ -101,12 +101,12 @@ AC_LINK_IFELSE([ rm -f work.pc work.pcl AC_LANG_POP(Fortran) dnl cross_compiling no longer maintained by autoconf as part of the -dnl AC_LANG changes. If we set it here, a later AC_LANG may not +dnl AC_LANG changes. If we set it here, a later AC_LANG may not dnl restore it (in the case where one compiler claims to be a cross compiler dnl and another does not) dnl cross_compiling=$pac_cv_prog_f90_cross ]) -dnl/*D +dnl/*D dnl PAC_PROG_FC_INT_KIND - Determine kind parameter for an integer with dnl the specified number of bytes. dnl @@ -124,7 +124,7 @@ else AC_LANG_PUSH(Fortran) AC_MSG_CHECKING([for Fortran 90 integer kind for $2-byte integers]) # Convert bytes to digits - case $2 in + case $2 in 1) sellen=2 ;; 2) sellen=4 ;; 4) sellen=8 ;; @@ -134,7 +134,7 @@ else esac # Check for cached value eval testval=\$"pac_cv_prog_fc_int_kind_$sellen" - if test -n "$testval" ; then + if test -n "$testval" ; then AC_MSG_RESULT([$testval (cached)]) $1=$testval else @@ -170,7 +170,7 @@ dnl ------------------------------------------------------------------------ dnl Special characteristics that have no autoconf counterpart but that dnl we need as part of the Fortran 90 support. To distinquish these, they dnl have a [PAC] prefix. -dnl +dnl dnl At least one version of the Cray compiler needs the option -em to dnl generate a separate module file, rather than including the module dnl information in the object (.o) file. @@ -226,7 +226,7 @@ AC_COMPILE_IFELSE([ pac_MOD="" fi fi - if test -z "$pac_MOD" ; then + if test -z "$pac_MOD" ; then pac_cv_fc_module_ext="unknown" else pac_cv_fc_module_ext=$pac_MOD @@ -304,7 +304,7 @@ AC_COMPILE_IFELSE([],[ mv $pac_module conftestdir # Remove any temporary files, and hide the work.pc file # (if the compiler generates them) - if test -f work.pc ; then + if test -f work.pc ; then mv -f work.pc conftest.pc fi rm -f work.pcl @@ -343,7 +343,7 @@ if test "X$pac_cv_fc_module_incflag" = "X" ; then AC_MSG_RESULT([-cl,filename where filename contains a list of files and directories]) FC_WORK_FILES_ARG="-cl,mpimod.pcl" FCMODINCSPEC="-cl,/mod.pcl" - else + else # The version of the Intel compiler that I have refuses to let # you put the "work catalog" list anywhere but the current directory. pac_cv_fc_module_incflag="Unavailable!" @@ -351,12 +351,12 @@ if test "X$pac_cv_fc_module_incflag" = "X" ; then else # Early versions of the Intel ifc compiler required a *file* # containing the names of files that contained the names of the - # + # # -cl,filename.pcl # filename.pcl contains # fullpathname.pc - # The "fullpathname.pc" is generated, I believe, when a module is - # compiled. + # The "fullpathname.pc" is generated, I believe, when a module is + # compiled. # Intel compilers use a wierd system: -cl,filename.pcl . If no file is # specified, work.pcl and work.pc are created. However, if you specify # a file, it must contain the name of a file ending in .pc . Ugh! @@ -415,7 +415,7 @@ AC_COMPILE_IFELSE([],[ rm -f "$pac_module" # Remove any temporary files, and hide the work.pc file # (if the compiler generates them) - if test -f work.pc ; then + if test -f work.pc ; then mv -f work.pc conftest.pc fi rm -f work.pcl @@ -439,7 +439,7 @@ AC_COMPILE_IFELSE([],[ # module tests do not always use the module output flag. See # FC_MODULE_EXT , where this is determined. # f95 -YMOD_OUT_DIR=${dir} ## the Absoft fortran compiler -# lf95 -Am -mod ${dir} ## the Lahey/Fujitsu fortran compiler +# lf95 -M ${dir} ## the Lahey/Fujitsu fortran compiler # f90 -moddir=${dir} ## the Sun f90 compiler # g95 -fmod=${dir} # @@ -448,7 +448,7 @@ AC_COMPILE_IFELSE([],[ # users to use. Alternatively they can use an older version of MPICH. pac_cv_fc_module_outflag= -for mod_flag in '-J' '-J ' '-qmoddir=' '-module ' '-YMOD_OUT_DIR=' '-mdir ' '-moddir=' '-fmod=' ; do +for mod_flag in '-J' '-J ' '-qmoddir=' '-module ' '-YMOD_OUT_DIR=' '-mdir ' '-moddir=' '-fmod=' '-M '; do rm -f conftestdir/NONEXISTENT conftestdir/* PAC_PUSH_FLAG([FCFLAGS]) FCFLAGS="$FCFLAGS ${mod_flag}conftestdir" @@ -478,7 +478,7 @@ AC_SUBST([FCMODOUTFLAG],[$pac_cv_fc_module_outflag]) dnl dnl PAC_FC_AND_F77_COMPATIBLE([action-if-true],[action-if-false]) dnl -dnl Determine whether object files compiled with Fortran 77 can be +dnl Determine whether object files compiled with Fortran 77 can be dnl linked to Fortran 90 main programs. dnl dnl The test uses a name that includes an underscore unless the 3rd @@ -543,7 +543,7 @@ dnl ]) dnl dnl -dnl /*D +dnl /*D dnl PAC_PROG_FC_CRAY_POINTER - Check if Fortran supports Cray-style pointer. dnl If so, set pac_cv_prog_fc_has_pointer to yes dnl and find out if any extra compiler flag is @@ -650,7 +650,7 @@ AC_LANG_POP(C) dnl if test "$pac_cv_prog_fc_and_c_stdio_libs" != none -a \ "$pac_cv_prog_fc_and_c_stdio_libs" != unknown ; then - FC_OTHER_LIBS="$FC_OTHER_LIBS $pac_cv_prog_fc_and_c_stdio_libs" + FC_OTHER_LIBS="$FC_OTHER_LIBS $pac_cv_prog_fc_and_c_stdio_libs" fi ]) dnl @@ -668,13 +668,13 @@ dnl dnl If no actions are specified, a working value is added to 'FCOPTIONS' dnl dnl Notes: -dnl This is now careful to check that the output is different, since +dnl This is now careful to check that the output is different, since dnl some compilers are noisy. -dnl +dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl -dnl Because this is a long script, we have ensured that you can pass a +dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl D*/ AC_DEFUN([PAC_FC_CHECK_COMPILER_OPTION],[ @@ -817,14 +817,14 @@ for arg in --version -V -v ; do rm -f conftest.txt PAC_RUNLOG([$FC $arg conftest.txt 2>&1]) # Ignore the return code, because some compilers set the - # return code to zero on invalid arguments and some to + # return code to zero on invalid arguments and some to # non-zero on success (with no files to compile) if test -f conftest.txt ; then if grep 'Portland Group' conftest.txt >/dev/null 2>&1 ; then pac_cv_fc_vendor=pgi elif grep 'Sun Workshop' conftest.txt >/dev/null 2>&1 ; then pac_cv_fc_vendor=sun - elif grep 'Sun Fortran 9' conftest.txt >/dev/null 2>&1 ; then + elif grep 'Sun Fortran 9' conftest.txt >/dev/null 2>&1 ; then pac_cv_fc_vendor=sun elif grep 'Absoft' conftest.txt >/dev/null 2>&1 ; then pac_cv_fc_vendor=absoft @@ -1171,6 +1171,14 @@ INTERFACE END FUNCTION FOO END INTERFACE +! Test assumed-rank + asynchronous +INTERFACE TEST_ASSUMED_RANK_ASYNC + SUBROUTINE TEST_ASSUMED_RANK_ASYNC_IMPL(BUF) + IMPLICIT NONE + TYPE(*), DIMENSION(..), ASYNCHRONOUS :: BUF + END SUBROUTINE TEST_ASSUMED_RANK_ASYNC_IMPL +END INTERFACE TEST_ASSUMED_RANK_ASYNC + CONTAINS ! Test TS 29113 asychronous attribute and optional @@ -1199,16 +1207,18 @@ END MODULE !============================================== PROGRAM MAIN -USE :: F08TS_MODULE, ONLY : FOO +USE :: F08TS_MODULE, ONLY : FOO, TEST_ASSUMED_RANK_ASYNC IMPLICIT NONE INTEGER, DIMENSION(4,4) :: A, B INTEGER, DIMENSION(2,2) :: C INTEGER :: ERRCODE +INTEGER, DIMENSION(10), ASYNCHRONOUS :: IAR ! Test contiguous and non-contiguous array section passing ! and linkage with C code ERRCODE = FOO(A(1:4:2, :), B(:, 2:4:2), C) +CALL TEST_ASSUMED_RANK_ASYNC(IAR(2:7)) END PROGRAM ])],[],[f08_works=no]) @@ -1220,6 +1230,6 @@ if test "$f08_works" = "yes" ; then else $2 fi -rm -f conftest1.$OBJEXT +rm -f conftest1.$OBJEXT F08TS_MODULE.* f08ts_module.* AC_MSG_RESULT([$f08_works]) ]) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_libs.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_libs.m4 similarity index 95% rename from ompi/mca/io/romio314/romio/confdb/aclocal_libs.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_libs.m4 index 9dff74248b..8868e994cb 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_libs.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_libs.m4 @@ -47,8 +47,11 @@ AC_DEFUN([PAC_SET_HEADER_LIB_PATH],[ [AS_IF([test -n "${with_$1}"], dnl is adding lib64 by default really the right thing to do? What if dnl we are on a 32-bit host that happens to have both lib dirs available? - [PAC_APPEND_FLAG([-L${with_$1}/lib64],[LDFLAGS]) - PAC_APPEND_FLAG([-L${with_$1}/lib],[LDFLAGS])])]) + [PAC_APPEND_FLAG([-L${with_$1}/lib],[LDFLAGS]) + AS_IF([test -d "${with_$1}/lib64"], + [PAC_APPEND_FLAG([-L${with_$1}/lib64],[LDFLAGS])]) + ]) + ]) ]) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_make.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_make.m4 similarity index 98% rename from ompi/mca/io/romio314/romio/confdb/aclocal_make.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_make.m4 index 2c900e810b..147e92e9c2 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_make.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_make.m4 @@ -72,7 +72,7 @@ fi ])dnl dnl/*D -dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in +dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in dnl shell commands in a makefile dnl dnl Synopsis: @@ -105,7 +105,7 @@ ALL: pac_str=`$MAKE -f conftest 2>&1` # This is needed for Mac OSX 10.5 rm -rf conftest.dSYM -rm -f conftest +rm -f conftest if test "$pac_str" != "success" ; then pac_cv_prog_make_allows_comments="no" else @@ -135,7 +135,7 @@ dnl or dnl.vb dnl .PATH: . ${srcdir} dnl.ve -dnl +dnl dnl Notes: dnl The test checks that the path works with implicit targets (some makes dnl support only explicit targets with 'VPATH' or 'PATH'). @@ -166,7 +166,7 @@ VPATH=.:conftestdir @echo \$< EOF ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'` -if test -n "$ac_out" ; then +if test -n "$ac_out" ; then pac_cv_prog_make_vpath="VPATH" else rm -f conftest @@ -177,7 +177,7 @@ all: a.o @echo \$< EOF ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'` - if test -n "$ac_out" ; then + if test -n "$ac_out" ; then pac_cv_prog_make_vpath=".PATH" else pac_cv_prog_make_vpath="neither VPATH nor .PATH works" @@ -226,7 +226,7 @@ EOF pac_str=`$MAKE -f conftest 2>&1` # This is needed for Mac OSX 10.5 rm -rf conftest.dSYM -rm -f conftest +rm -f conftest if test "$pac_str" = "XX" ; then pac_cv_prog_make_set_cflags="no" else @@ -241,7 +241,7 @@ fi ])dnl dnl/*D -dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with +dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with dnl clock skew in suing make. dnl dnl Effect: @@ -277,7 +277,7 @@ fi ]) dnl/*D -dnl PAC_PROG_MAKE - Checks for the varieties of MAKE, including support for +dnl PAC_PROG_MAKE - Checks for the varieties of MAKE, including support for dnl VPATH dnl dnl Synopsis: @@ -292,10 +292,10 @@ dnl This macro uses 'PAC_PROG_MAKE_INCLUDE', dnl 'PAC_PROG_MAKE_ALLOWS_COMMENTS', 'PAC_PROG_MAKE_VPATH', and dnl 'PAC_PROG_MAKE_SET_CFLAGS'. See those commands for details about their dnl actions. -dnl +dnl dnl It may call 'AC_PROG_MAKE_SET', which sets 'SET_MAKE' to 'MAKE = @MAKE@' dnl if the make program does not set the value of make, otherwise 'SET_MAKE' -dnl is set to empty; if the make program echos the directory name, then +dnl is set to empty; if the make program echos the directory name, then dnl 'SET_MAKE' is set to 'MAKE = $MAKE'. dnl D*/ AC_DEFUN([PAC_PROG_MAKE],[ diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_mpi.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_mpi.m4 similarity index 96% rename from ompi/mca/io/romio314/romio/confdb/aclocal_mpi.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_mpi.m4 index c90fb49065..f0013a9bd1 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_mpi.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_mpi.m4 @@ -1,5 +1,5 @@ dnl -dnl/*D +dnl/*D dnl PAC_LIB_MPI - Check for MPI library dnl dnl Synopsis: @@ -9,7 +9,7 @@ dnl Output Effect: dnl dnl Notes: dnl Currently, only checks for lib mpi and mpi.h. Later, we will add -dnl MPI_Pcontrol prototype (const int or not?). +dnl MPI_Pcontrol prototype (const int or not?). dnl dnl Prerequisites: dnl autoconf version 2.13 (for AC_SEARCH_LIBS) @@ -21,7 +21,7 @@ dnl MPI-2 Spawn? dnl MPI-2 RMA? dnl PAC_LIB_MPI([found text],[not found text]) AC_DEFUN([PAC_LIB_MPI],[ -dnl Set the prereq to 2.50 to avoid having +dnl Set the prereq to 2.50 to avoid having AC_PREREQ(2.50) if test "X$pac_lib_mpi_is_building" != "Xyes" ; then # Use CC if TESTCC is defined @@ -55,7 +55,7 @@ ifelse($1,,,[$1]) dnl This should also set MPIRUN. dnl dnl/*D -dnl PAC_ARG_MPI_TYPES - Add command-line switches for different MPI +dnl PAC_ARG_MPI_TYPES - Add command-line switches for different MPI dnl environments dnl dnl Synopsis: @@ -73,11 +73,11 @@ dnl is given, that type is used as if '--with-' was given. dnl dnl Sets 'CC', 'F77', 'TESTCC', 'TESTF77', and 'MPILIBNAME'. Does `not` dnl perform an AC_SUBST for these values. -dnl Also sets 'MPIBOOT' and 'MPIUNBOOT'. These are used to specify +dnl Also sets 'MPIBOOT' and 'MPIUNBOOT'. These are used to specify dnl programs that may need to be run before and after running MPI programs. dnl For example, 'MPIBOOT' may start demons necessary to run MPI programs and dnl 'MPIUNBOOT' will stop those demons. -dnl +dnl dnl The two forms of the compilers are to allow for tests of the compiler dnl when the MPI version of the compiler creates executables that cannot dnl be run on the local system (for example, the IBM SP, where executables @@ -87,21 +87,21 @@ dnl the size of data types). dnl dnl Historical note: dnl Some common autoconf tests, such as AC_CHECK_SIZEOF, used to require -dnl running a program. But some MPI compilers (often really compilation +dnl running a program. But some MPI compilers (often really compilation dnl scripts) produced programs that could only be run with special commands, dnl such as a batch submission system. To allow these test programs to be -dnl run, a separate set of compiler variables, TESTCC, TESTF77, etc., +dnl run, a separate set of compiler variables, TESTCC, TESTF77, etc., dnl were defined. However, in later versions of autoconf, it both became -dnl unnecessary to run programs for tests such as AC_CHECK_SIZEOF and +dnl unnecessary to run programs for tests such as AC_CHECK_SIZEOF and dnl it became necessary to define CC etc. before invoking AC_PROG_CC (and dnl the othe language compilers), because those commands now do much, much dnl more than just determining the compiler. dnl dnl To address the change, we still define the TESTCC etc. compilers where dnl possible to allow the use of AC_TRY_RUN when required, but we define -dnl the CC etc variables and do not define ac_cv_prog_CC etc., as these -dnl cause autoconf to skip all of the other initialization code that -dnl AC_PROG_CC etc. runs. Note also that this command must occur before +dnl the CC etc variables and do not define ac_cv_prog_CC etc., as these +dnl cause autoconf to skip all of the other initialization code that +dnl AC_PROG_CC etc. runs. Note also that this command must occur before dnl AC_PROG_CC (or anything that might cause AC_PROG_CC to be invoked). dnl dnl See also: @@ -160,7 +160,7 @@ dnl dnl Because autoconf insists on moving code to the beginning of dnl certain definitions, it is *not possible* to define a single command dnl that selects compilation scripts and also check for other options. -dnl Thus, this needs to be divided into +dnl Thus, this needs to be divided into dnl MPI_FIND_COMPILER_SCRIPTS dnl which can fail (i.e., not find a script), and dnl MPI_FIND_COMPILERS @@ -183,7 +183,7 @@ AC_ARG_VAR([MPIF77],[Name and absolute path of program used to compile MPI progr AC_ARG_VAR([MPICXX],[Name and absolute path of program used to compile MPI programs in C++]) AC_ARG_VAR([MPIF90],[Name and absolute path of program used to compile MPI programs in F90]) # -# Check for things that will cause trouble. For example, +# Check for things that will cause trouble. For example, # if MPICC is defined but does not contain a / or \, then PATH_PROG will # ignore the value if test -n "$MPICC" ; then @@ -192,7 +192,7 @@ changequote(<<,>>) [\\/]* | ?:[\\/]*) changequote([,]) # Ok, PATH_PROG will figure it out - ;; + ;; *) AC_MSG_ERROR([MPICC must be set to an absolute path if it is set]) esac @@ -203,7 +203,7 @@ changequote(<<,>>) [\\/]* | ?:[\\/]*) changequote([,]) # Ok, PATH_PROG will figure it out - ;; + ;; *) AC_MSG_ERROR([MPICXX must be set to an absolute path if it is set]) esac @@ -214,7 +214,7 @@ changequote(<<,>>) [\\/]* | ?:[\\/]*) changequote([,]) # Ok, PATH_PROG will figure it out - ;; + ;; *) AC_MSG_ERROR([MPIF77 must be set to an absolute path if it is set]) esac @@ -225,7 +225,7 @@ changequote(<<,>>) [\\/]* | ?:[\\/]*) changequote([,]) # Ok, PATH_PROG will figure it out - ;; + ;; *) AC_MSG_ERROR([MPIF90 must be set to an absolute path if it is set]) esac @@ -233,12 +233,12 @@ fi case $ac_mpi_type in mpich) - dnl + dnl dnl This isn't correct. It should try to get the underlying compiler dnl from the mpicc and mpif77 scripts or mpireconfig if test "X$pac_lib_mpi_is_building" != "Xyes" ; then PAC_PUSH_FLAG([PATH]) - if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then + if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the # path if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then @@ -249,21 +249,21 @@ case $ac_mpi_type in AC_PATH_PROG(MPICC,mpicc) if test -z "$TESTCC" ; then TESTCC=${CC-cc} ; fi CC="$MPICC" - # Note that autoconf may unconditionally change the value of + # Note that autoconf may unconditionally change the value of # CC (!) in some other command. Thus, we define CCMASTER CCMASTER=$CC # Force autoconf to respect this choice ac_ct_CC=$CC # to permit configure codes to recover the correct CC. This - # is an ugly not-quite-correct workaround for the fact that + # is an ugly not-quite-correct workaround for the fact that # does not want you to change the C compiler once you have set it - # (But since it does so unconditionally, it silently creates + # (But since it does so unconditionally, it silently creates # bogus output files.) AC_PATH_PROG(MPIF77,mpif77) if test -z "$TESTF77" ; then TESTF77=${F77-f77} ; fi F77="$MPIF77" AC_PATH_PROG(MPIFC,mpif90) - if test -z "$TESTFC" ; then TESTFC=${FC-f90} ; fi + if test -z "$TESTFC" ; then TESTFC=${FC-f90} ; fi FC="$MPIFC" AC_PATH_PROG(MPICXX,mpiCC) if test -z "$TESTCXX" ; then TESTCXX=${CXX-CC} ; fi @@ -275,7 +275,7 @@ case $ac_mpi_type in AC_PATH_PROG(MPIUNBOOT,mpichstop) PAC_POP_FLAG([PATH]) MPILIBNAME="mpich" - else + else # All of the above should have been passed in the environment! : fi @@ -289,7 +289,7 @@ case $ac_mpi_type in dnl This isn't correct. It should try to get the underlying compiler dnl from the mpicc and mpif77 scripts or mpireconfig PAC_PUSH_FLAG([PATH]) - if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then + if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the path if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then with_lammpi="$with_lammpi/bin" @@ -330,7 +330,7 @@ case $ac_mpi_type in if test "$enable_f90" != no ; then AC_CHECK_PROGS(MPIXLF90,mpxlf90 mpfort) if test -z "$TESTFC" ; then TESTFC=${FC-xlf90}; fi - if test "X$MPIXLF90" != "X" ; then + if test "X$MPIXLF90" != "X" ; then FC="$MPIXLF90" else FC="$MPXLF -qlanglvl=90ext -qfree=f90" @@ -405,7 +405,7 @@ esac ]) AC_DEFUN([PAC_MPI_FIND_COMPILERS],[ -# Tell autoconf to determine properties of the compilers (these are the +# Tell autoconf to determine properties of the compilers (these are the # compilers for MPI programs) PAC_PROG_CC if test "$enable_f77" != no -a "$enable_fortran" != no ; then @@ -468,14 +468,14 @@ case $ac_mpi_type in AC_CHECK_LIB(mpi,MPI_Init) if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then MPILIBNAME="mpi" - fi + fi ;; generic) AC_SEARCH_LIBS(MPI_Init,mpi mpich mpich) if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then MPILIBNAME="mpi" - fi + fi ;; *) @@ -502,8 +502,8 @@ AC_TRY_LINK([#include "mpi.h"], [MPI_Request request;MPI_Fint a;a = MPI_Request_c2f(request);], pac_cv_mpi_f2c="yes",pac_cv_mpi_f2c="no") ]) -if test "$pac_cv_mpi_f2c" = "yes" ; then - AC_DEFINE(HAVE_MPI_F2C,1,[Define if MPI has F2C]) +if test "$pac_cv_mpi_f2c" = "yes" ; then + AC_DEFINE(HAVE_MPI_F2C,1,[Define if MPI has F2C]) fi ]) dnl diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_romio.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_romio.m4 similarity index 95% rename from ompi/mca/io/romio314/romio/confdb/aclocal_romio.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_romio.m4 index db731d54de..af80d3c102 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_romio.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_romio.m4 @@ -1,5 +1,5 @@ dnl -dnl This files contains additional macros for using autoconf to +dnl This files contains additional macros for using autoconf to dnl build configure scripts. dnl dnl Almost all of this file is taken from the aclocal.m4 of MPICH @@ -19,21 +19,21 @@ AC_DEFUN([PAC_GET_FORTNAMES],[ EOF $F77 $FFLAGS -c confftest.f > /dev/null 2>&1 if test ! -s confftest.$OBJEXT ; then - AC_MSG_WARN([Unable to test Fortran compiler. Compiling a test + AC_MSG_WARN([Unable to test Fortran compiler. Compiling a test program failed to produce an object file]) NOF77=1 elif test -z "$FORTRANNAMES" ; then # MAC OS X (and probably FreeBSD need strings - (not strings -a) # Cray doesn't accept -a ... allstrings="-a" - if test $arch_CRAY ; then - allstrings="" + if test $arch_CRAY ; then + allstrings="" elif strings - confftest.$OBJEXT < /dev/null >/dev/null 2>&1 ; then allstrings="-" elif strings -a confftest.$OBJEXT < /dev/null >/dev/null 2>&1 ; then allstrings="-a" fi - + nameform1=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop_ | head -1` nameform2=`strings $allstrings confftest.$OBJEXT | grep MPIR_INIT_FOP | head -1` nameform3=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop | head -1` @@ -47,8 +47,8 @@ program failed to produce an object file]) echo "Fortran externals have a trailing underscore and are lowercase" FORTRANNAMES="FORTRANUNDERSCORE" elif test -n "$nameform2" ; then - echo "Fortran externals are uppercase" - FORTRANNAMES="FORTRANCAPS" + echo "Fortran externals are uppercase" + FORTRANNAMES="FORTRANCAPS" elif test -n "$nameform3" ; then echo "Fortran externals are lower case" FORTRANNAMES="FORTRANNOUNDERSCORE" @@ -76,7 +76,7 @@ if test -n "$arch_IRIX"; then dnl For example dnl IRIX_5_4400 (IRIX 5.x, using MIPS 4400) osversion=`uname -r | sed 's/\..*//'` - dnl Note that we need to allow brackets here, so we briefly turn off + dnl Note that we need to allow brackets here, so we briefly turn off dnl the macro quotes changequote(,)dnl dnl Get the second field (looking for 6.1) @@ -111,7 +111,7 @@ if test -n "$arch_IRIX"; then fi AC_MSG_RESULT($cputype) dnl echo "checking for osversion and cputype" - dnl cputype may contain R4400, R2000A/R3000, or something else. + dnl cputype may contain R4400, R2000A/R3000, or something else. dnl We may eventually need to look at it. if test -z "$osversion" ; then AC_MSG_RESULT([Could not determine OS version. Please send]) @@ -123,9 +123,9 @@ if test -n "$arch_IRIX"; then true elif test $osversion = 6 ; then true - else + else AC_MSG_RESULT([Could not recognize the version of IRIX (got $osversion). -ROMIO knows about versions 4, 5 and 6; the version being returned from +ROMIO knows about versions 4, 5 and 6; the version being returned from uname -r is $osversion. Please send]) uname -a 2>&1 hinv 2>&1 @@ -138,7 +138,7 @@ uname -r is $osversion. Please send]) changequote(,)dnl cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"` changequote([,])dnl - case $cputype in + case $cputype in 3000) ;; 4000) ;; 4400) ;; @@ -150,7 +150,7 @@ uname -r is $osversion. Please send]) *) AC_MSG_WARN([Unexpected IRIX/MIPS chipset $cputype. Please send the output]) uname -a 2>&1 - hinv 2>&1 + hinv 2>&1 AC_MSG_WARN([to romio-maint@mcs.anl.gov ROMIO will continue and assume that the cputype is compatible with a MIPS 4400 processor.]) @@ -172,7 +172,7 @@ define(PAC_TEST_MPI,[ main(int argc, char **argv) { MPI_Init(&argc,&argv); - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -225,10 +225,10 @@ define(PAC_MPI_LONG_LONG_INT,[ #include "mpi.h" main(int argc, char **argv) { - long long i; + long long i; MPI_Init(&argc,&argv); MPI_Send(&i, 1, MPI_LONG_LONG_INT, 0, 0, MPI_COMM_WORLD); - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -247,7 +247,7 @@ dnl define(PAC_LONG_LONG_64,[ if test -n "$longlongsize" ; then if test "$longlongsize" = 8 ; then - echo "defining MPI_Offset as long long in C and integer*8 in Fortran" + echo "defining MPI_Offset as long long in C and integer*8 in Fortran" AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits]) DEFINE_MPI_OFFSET="typedef long long MPI_Offset;" FORTRAN_MPI_OFFSET="integer*8" @@ -260,8 +260,8 @@ if test -n "$longlongsize" ; then LL="\%d" MPI_OFFSET_KIND1="!" MPI_OFFSET_KIND2="!" - else - echo "defining MPI_Offset as long in C and integer in Fortran" + else + echo "defining MPI_Offset as long in C and integer in Fortran" DEFINE_MPI_OFFSET="typedef long MPI_Offset;" FORTRAN_MPI_OFFSET="integer" LL="\%ld" @@ -274,14 +274,14 @@ else if test "$longlongsize" = 8 ; then PAC_TEST_LONG_LONG() else - echo "defining MPI_Offset as long in C and integer in Fortran" + echo "defining MPI_Offset as long in C and integer in Fortran" DEFINE_MPI_OFFSET="typedef long MPI_Offset;" FORTRAN_MPI_OFFSET="integer" LL="\%ld" MPI_OFFSET_KIND1="!" MPI_OFFSET_KIND2="!" fi - else + else dnl check if longlong is not supported or only its size cannot be determined dnl because the program cannot be run. rm -f ltest.c @@ -297,14 +297,14 @@ EOF if test -x conftest$EXEEXT ; then echo "assuming size of long long is 8bytes; use '-longlongsize' to indicate otherwise" rm -f conftest$EXEEXT ltest.c - echo "defining MPI_Offset as long long in C and integer*8 in Fortran" + echo "defining MPI_Offset as long long in C and integer*8 in Fortran" AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits]) DEFINE_MPI_OFFSET="typedef long long MPI_Offset;" FORTRAN_MPI_OFFSET="integer*8" LL="\%lld" - else + else echo "assuming long long is not available; use '-longlongsize' to indicate otherwise" - echo "defining MPI_Offset as long in C and integer in Fortran" + echo "defining MPI_Offset as long in C and integer in Fortran" DEFINE_MPI_OFFSET="typedef long MPI_Offset;" FORTRAN_MPI_OFFSET="integer" LL="\%ld" @@ -326,7 +326,7 @@ define(PAC_MPI_INFO,[ MPI_Info info; MPI_Init(&argc,&argv); MPI_Info_create(&info); - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -363,7 +363,7 @@ define(PAC_MPI_DARRAY_SUBARRAY,[ MPI_Init(&argc,&argv); MPI_Type_create_darray(i, i, i, &i, &i, &i, &i, i, MPI_INT, &t); MPI_Type_create_subarray(i, &i, &i, &i, i, MPI_INT, &t); - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -480,7 +480,7 @@ define(PAC_TEST_MPI_SGI_type_is_contig,[ MPI_Init(&argc,&argv); i = MPI_SGI_type_is_contig(type); - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -507,7 +507,7 @@ define(PAC_TEST_MPI_COMBINERS,[ MPI_Init(&argc,&argv); i = MPI_COMBINER_STRUCT; - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -581,7 +581,7 @@ fi KINDVAL="" if $FC -o conftest$EXEEXT conftest.$ac_f90ext >/dev/null 2>&1 ; then ./conftest$EXEEXT >/dev/null 2>&1 - if test -s conftest.out ; then + if test -s conftest.out ; then KINDVAL=`cat conftest.out` fi fi @@ -624,7 +624,7 @@ EOF dnl dnl dnl PAC_GET_XFS_MEMALIGN -dnl +dnl dnl define(PAC_GET_XFS_MEMALIGN, [AC_MSG_CHECKING([for memory alignment needed for direct I/O]) @@ -634,7 +634,7 @@ AC_TEST_PROGRAM([#include #include #include #include -main() { +main() { struct dioattr st; int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644); FILE *f=fopen("memalignval","w"); @@ -704,7 +704,7 @@ fi KINDVAL="" if $FC -o kind$EXEEXT kind.f >/dev/null 2>&1 ; then ./kind >/dev/null 2>&1 - if test -s k.out ; then + if test -s k.out ; then KINDVAL=`cat k.out` fi fi @@ -773,7 +773,7 @@ define(PAC_TEST_MPIR_STATUS_SET_BYTES,[ MPI_Init(&argc,&argv); MPIR_Status_set_bytes(status,type,err); - MPI_Finalize(); + MPI_Finalize(); } EOF rm -f conftest$EXEEXT @@ -856,3 +856,17 @@ EOF fi rm -f conftest$EXEEXT mpitest.c ])dnl + +define(PAC_TEST_NEEDS_CONST,[ + AC_MSG_CHECKING([const declarations needed in MPI routines]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [ #include + int MPI_File_delete(char *filename, MPI_Info info) { return (0); } + ] )], + [ + AC_MSG_RESULT(no) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_MPIIO_CONST, const, [Define if MPI-IO routines need a const qualifier]) + ]) + ]) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_runlog.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_runlog.m4 similarity index 100% rename from ompi/mca/io/romio314/romio/confdb/aclocal_runlog.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_runlog.m4 diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_shl.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_shl.m4 similarity index 96% rename from ompi/mca/io/romio314/romio/confdb/aclocal_shl.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_shl.m4 index f13222944e..f974bfa226 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_shl.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_shl.m4 @@ -1,7 +1,7 @@ dnl dnl Definitions for creating shared libraries dnl -dnl The purpose of these definitions is to provide common support for +dnl The purpose of these definitions is to provide common support for dnl shared libraries, with *or without* the use of the GNU Libtool package. dnl For many of our important platforms, the Libtool approach is overkill, dnl and can be particularly painful for developers. @@ -9,30 +9,30 @@ dnl dnl To use libtool, you need macros that are defined by libtool for libtool dnl Don't even think about the consequences of this for updating and for dnl using user-versions of libtool :( -dnl +dnl dnl !!!!!!!!!!!!!!!!!!!!! dnl libtool requires ac 2.50 !!!!!!!!!!!!!!!!! -dnl +dnl dnl builtin(include,libtool.m4) dnl dnl/*D dnl PAC_ARG_SHAREDLIBS - Add --enable-sharedlibs=kind to configure. -dnl +dnl dnl Synopsis: dnl PAC_ARG_SHAREDLIBS dnl dnl Output effects: dnl Adds '--enable-sharedlibs=kind' to the command line. If this is enabled, -dnl then based on the value of 'kind', programs are selected for the +dnl then based on the value of 'kind', programs are selected for the dnl names 'CC_SHL' and 'CC_LINK_SHL' that configure will substitute for in dnl 'Makefile.in's. These symbols are generated by 'simplemake' when dnl shared library support is selected. -dnl The variable 'C_LINKPATH_SHL' is set to the option to specify the +dnl The variable 'C_LINKPATH_SHL' is set to the option to specify the dnl path to search at runtime for libraries (-rpath in gcc/GNU ld). dnl This can be turned off with --disable-rpath , which is appropriate dnl for libraries and for executables that may be installed in different dnl locations. -dnl The variable 'SHLIB_EXT' is set to the extension used by shared +dnl The variable 'SHLIB_EXT' is set to the extension used by shared dnl libraries; under most forms of Unix, this is 'so'; under Mac OS/X, this dnl is 'dylib', and under Windows (including cygwin), this is 'dll'. dnl @@ -40,7 +40,7 @@ dnl Supported values of 'kind' include \: dnl+ gcc - Use gcc to create both shared objects and libraries dnl. osx-gcc - Use gcc on Mac OS/X to create both shared objects and dnl libraries -dnl. solaris-cc - Use native Solaris cc to create shared objects and +dnl. solaris-cc - Use native Solaris cc to create shared objects and dnl libraries dnl. cygwin-gcc - Use gcc on Cygwin to create shared objects and libraries dnl- none - The same as '--disable-sharedlibs' @@ -105,7 +105,7 @@ C_LINKPATH_SHL="" SHLIB_EXT=unknown SHLIB_FROM_LO=no SHLIB_INSTALL='$(INSTALL_PROGRAM)' -case "$enable_sharedlibs" in +case "$enable_sharedlibs" in no|none) ;; gcc-osx|osx-gcc) @@ -114,7 +114,7 @@ case "$enable_sharedlibs" in CC_SHL='${CC} -fPIC' # No way in osx to specify the location of the shared libraries at link # time (see the code in createshlib in mpich/src/util) - # As of 10.5, -Wl,-rpath,dirname should work . The dirname + # As of 10.5, -Wl,-rpath,dirname should work . The dirname # must be a single directory, not a colon-separated list (use multiple # -Wl,-rpath,path for each of the paths in the list). However, os x # apparently records the library full path, so rpath isn't as useful @@ -148,13 +148,13 @@ case "$enable_sharedlibs" in C_LINKPATH_SHL="-Wl,-rpath," fi SHLIB_EXT=so - # We need to test that this isn't osx. The following is a + # We need to test that this isn't osx. The following is a # simple hack osname=`uname -s` - case $osname in + case $osname in *Darwin*|*darwin*) AC_MSG_ERROR([You must specify --enable-sharedlibs=osx-gcc for Mac OS/X]) - ;; + ;; *CYGWIN*|*cygwin*) AC_MSG_ERROR([You must specify --enable-sharedlibs=cygwin-gcc for Cygwin]) ;; @@ -172,7 +172,7 @@ case "$enable_sharedlibs" in C_LINKPATH_SHL="" SHLIB_EXT="dll" enable_sharedlibs="cygwin-gcc" - ;; + ;; libtool) # set TRY_LIBTOOL to yes to experiment with libtool. You are on your @@ -180,7 +180,7 @@ case "$enable_sharedlibs" in if test "$TRY_LIBTOOL" != yes ; then AC_MSG_ERROR([Creating shared libraries using libtool not yet supported]) else - # Using libtool requires a heavy-weight process to test for + # Using libtool requires a heavy-weight process to test for # various stuff that libtool needs. Without this, you'll get a # bizarre error message about libtool being unable to find # configure.in or configure.ac (!) @@ -205,7 +205,7 @@ case "$enable_sharedlibs" in # we are building under cygwin sysname=`uname -s | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` isCygwin=no - case "$sysname" in + case "$sysname" in *CYGWIN*) isCygwin=yes ;; esac if test "$isCygwin" = yes ; then @@ -269,7 +269,7 @@ dnl Other, such as solaris-cc *) AC_MSG_ERROR([Unknown value $enable_sharedlibs for enable-sharedlibs. Values should be gcc or osx-gcc]) enable_sharedlibs=no - ;; + ;; esac # Check for the shared-library extension PAC_CC_SHLIB_EXT @@ -286,7 +286,7 @@ dnl /*D dnl PAC_xx_SHAREDLIBS - Get compiler and linker for shared libraries dnl These routines may be used to determine the compiler and the dnl linker to be used in creating shared libraries -dnl Rather than set predefined variable names, they set an argument +dnl Rather than set predefined variable names, they set an argument dnl (if provided) dnl dnl Synopsis @@ -300,11 +300,11 @@ ifelse($1,,[ AC_CHECK_PROG(pac_prog,gcc,yes,no) # If we are gcc but OS X, set the special type # We need a similar setting for cygwin - if test "$pac_prog" = yes ; then + if test "$pac_prog" = yes ; then osname=`uname -s` - case $osname in + case $osname in *Darwin*|*darwin*) pac_kinds=gcc-osx - ;; + ;; *) pac_kinds=gcc ;; esac @@ -314,7 +314,7 @@ ifelse($1,,[ if test "$pac_prog" = yes ; then pac_kinds="$pac_kinds libtool" ; fi ]) for pac_arg in $pac_kinds ; do - case $pac_arg in + case $pac_arg in gcc) # For example, include the libname as ${LIBNAME_SHL} #C_LINK_SHL='${CC} -shared -Wl,-h,' @@ -363,10 +363,10 @@ ifelse($3,,C_LINK_SHL=$pac_clink_sharedlibs,$3=$pac_clink_sharedlibs) ifelse($4,,SHAREDLIB_TYPE=$pac_type_sharedlibs,$4=$pac_type_sharedlibs) ]) -dnl This macro ensures that all of the necessary substitutions are +dnl This macro ensures that all of the necessary substitutions are dnl made by any subdirectory configure (which may simply SUBST the dnl necessary values rather than trying to determine them from scratch) -dnl This is a more robust (and, in the case of libtool, only +dnl This is a more robust (and, in the case of libtool, only dnl managable) method. AC_DEFUN([PAC_CC_SUBDIR_SHLIBS],[ AC_SUBST(CC_SHL) @@ -395,9 +395,9 @@ AC_DEFUN([PAC_CC_SHLIB_EXT],[ # clean steps that look for libfoo.$SHLIB_EXT . if test "$SHLIB_EXT" = "unknown" ; then osname=`uname -s` - case $osname in + case $osname in *Darwin*|*darwin*) SHLIB_EXT=dylib - ;; + ;; *CYGWIN*|*cygwin*) SHLIB_EXT=dll ;; *Linux*|*LINUX*|*SunOS*) SHLIB_EXT=so diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_shm.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_shm.m4 similarity index 100% rename from ompi/mca/io/romio314/romio/confdb/aclocal_shm.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_shm.m4 diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_subcfg.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_subcfg.m4 similarity index 99% rename from ompi/mca/io/romio314/romio/confdb/aclocal_subcfg.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_subcfg.m4 index 970ae22305..53fb78e3d9 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_subcfg.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_subcfg.m4 @@ -30,7 +30,7 @@ dnl to subconfigure as "precious" appropriately. The precious variable dnl can be created in the following ways: dnl 1) implicit declaration through use of autoconf macros, like dnl AC_PROG_CC (declares CC/CFLAGS/CPPFLAGS/LIBS/LDFLAGS), or -dnl AC_PROG_F77 (declares F77/FFLAGS/FLIBS) ... +dnl AC_PROG_F77 (declares F77/FFLAGS/FLIBS) ... dnl which are in turns invoked by other subconfigure. dnl When in doubt, check "ac_precious_var" in the calling configure. dnl 2) explicit "precious" declaration through AC_ARG_VAR. @@ -54,7 +54,7 @@ AC_DEFUN([PAC_CONFIG_SUBDIR_ARGS],[ # Adapted for MPICH from the autoconf-2.67 implementation of # AC_CONFIG_SUBDIRS. Search for "MPICH note:" for relevant commentary and # local modifications. - + # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. Otherwise relative paths (like --srcdir=.. from # make distcheck) will be incorrect. @@ -115,7 +115,7 @@ AC_DEFUN([PAC_CONFIG_SUBDIR_ARGS],[ AS_VAR_APPEND([pac_sub_configure_args], [" '$pac_arg'"]) ;; esac done - + # Always prepend --prefix to ensure using the same prefix # in subdir configurations. # MPICH note: see tt#983 for an example of why this is necessary @@ -124,22 +124,22 @@ AC_DEFUN([PAC_CONFIG_SUBDIR_ARGS],[ *\'*) pac_arg=`AS_ECHO(["$pac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;; esac pac_sub_configure_args="'$pac_arg' $pac_sub_configure_args" - + # Pass --silent if test "$silent" = yes; then pac_sub_configure_args="--silent $pac_sub_configure_args" fi - + # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. pac_sub_configure_args="--disable-option-checking $pac_sub_configure_args" - + pac_popdir=`pwd` - + # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$pac_dir" || continue - + # MPICH note: modified to remove the internal "_AS_*" macro usage, also # msg is already printed at top dnl _AS_ECHO_LOG([$pac_msg]) diff --git a/ompi/mca/io/romio314/romio/confdb/aclocal_util.m4 b/ompi/mca/io/romio321/romio/confdb/aclocal_util.m4 similarity index 96% rename from ompi/mca/io/romio314/romio/confdb/aclocal_util.m4 rename to ompi/mca/io/romio321/romio/confdb/aclocal_util.m4 index 6faec25ab1..2648be5430 100644 --- a/ompi/mca/io/romio314/romio/confdb/aclocal_util.m4 +++ b/ompi/mca/io/romio321/romio/confdb/aclocal_util.m4 @@ -64,7 +64,7 @@ dnl argument is already present in the variable AC_DEFUN([PAC_APPEND_FLAG],[ AC_REQUIRE([AC_PROG_FGREP]) AS_IF( - [echo "$$2" | $FGREP -e '$1' >/dev/null 2>&1], + [echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1], [echo "$2(='$$2') contains '$1', not appending" >&AS_MESSAGE_LOG_FD], [echo "$2(='$$2') does not contain '$1', appending" >&AS_MESSAGE_LOG_FD $2="$$2 $1"] @@ -80,7 +80,7 @@ dnl should be added in reverse order. AC_DEFUN([PAC_PREPEND_FLAG],[ AC_REQUIRE([AC_PROG_FGREP]) AS_IF( - [echo "$$2" | $FGREP -e '$1' >/dev/null 2>&1], + [echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1], [echo "$2(='$$2') contains '$1', not prepending" >&AS_MESSAGE_LOG_FD], [echo "$2(='$$2') does not contain '$1', prepending" >&AS_MESSAGE_LOG_FD $2="$1 $$2"] @@ -131,7 +131,7 @@ AC_SUBST(MKDIR_P) ]) dnl Test for a clean VPATH directory. Provide this command with the names -dnl of all of the generated files that might cause problems +dnl of all of the generated files that might cause problems dnl (Makefiles won't cause problems because there's no VPATH usage for them) dnl dnl Synopsis @@ -151,12 +151,12 @@ if test ! -s $srcdir/conftest$$ ; then pac_header="" ifdef([AC_LIST_HEADER],[pac_header=AC_LIST_HEADER]) for file in config.status $pac_header $1 ; do - if test -f $srcdir/$file ; then + if test -f $srcdir/$file ; then pac_dirtyfiles="$pac_dirtyfiles $file" fi done ifelse($2,,,[ - for dir in $2 ; do + for dir in $2 ; do if test -d $srcdir/$dir ; then pac_dirtydirs="$pac_dirtydirs $dir" fi diff --git a/ompi/mca/io/romio314/romio/confdb/ax_prefix_config_h.m4 b/ompi/mca/io/romio321/romio/confdb/ax_prefix_config_h.m4 similarity index 100% rename from ompi/mca/io/romio314/romio/confdb/ax_prefix_config_h.m4 rename to ompi/mca/io/romio321/romio/confdb/ax_prefix_config_h.m4 diff --git a/ompi/mca/io/romio314/romio/confdb/ax_tls.m4 b/ompi/mca/io/romio321/romio/confdb/ax_tls.m4 similarity index 76% rename from ompi/mca/io/romio314/romio/confdb/ax_tls.m4 rename to ompi/mca/io/romio321/romio/confdb/ax_tls.m4 index 2704438226..3f6a0ac04f 100644 --- a/ompi/mca/io/romio314/romio/confdb/ax_tls.m4 +++ b/ompi/mca/io/romio321/romio/confdb/ax_tls.m4 @@ -58,17 +58,33 @@ AC_DEFUN([AX_TLS], [ # link line. AC_LINK_IFELSE( [AC_LANG_PROGRAM([$ax_tls_keyword int bar = 5;],[++bar;])], - [ac_cv_tls=$ax_tls_keyword ; break], + [ac_cv_tls=$ax_tls_keyword], [ac_cv_tls=none]) + + # MPICH modification: Also test with the extern keyword. + # The intel compiler on Darwin (at least as of 15.0.1) + # seems to break with the above error when the extern + # keyword is specified in shared library builds. + PAC_PUSH_FLAG([LIBS]) + PAC_APPEND_FLAG([-shared],[LIBS]) + if test "$ac_cv_tls" != "none" ; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([extern $ax_tls_keyword int bar;],[++bar;])], + [ac_cv_tls=$ax_tls_keyword], + [ac_cv_tls=none]) + fi + PAC_POP_FLAG([LIBS]) + + if test "$ac_cv_tls" != "none" ; then break ; fi esac done ]) if test "$ac_cv_tls" != "none"; then # MPICH modification: this was "TLS" before instead of - # "MPIU_TLS_SPECIFIER", but TLS had a reasonably high chance of conflicting + # "MPICH_TLS_SPECIFIER", but TLS had a reasonably high chance of conflicting # with a system library. - AC_DEFINE_UNQUOTED([MPIU_TLS_SPECIFIER], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here]) + AC_DEFINE_UNQUOTED([MPICH_TLS_SPECIFIER], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here]) fi AC_MSG_RESULT($ac_cv_tls) ]) diff --git a/ompi/mca/io/romio314/romio/configure.ac b/ompi/mca/io/romio321/romio/configure.ac similarity index 88% rename from ompi/mca/io/romio314/romio/configure.ac rename to ompi/mca/io/romio321/romio/configure.ac index 436b7832cb..0b85d5309d 100644 --- a/ompi/mca/io/romio314/romio/configure.ac +++ b/ompi/mca/io/romio321/romio/configure.ac @@ -189,7 +189,6 @@ MPIO_EXTRA_REAL_POBJECTS="_get_errh.o _set_errh.o" MPIO_REQOBJECTS="iotest.o iotestall.o iotestany.o iotestsome.o iowait.o iowaitall.o iowaitany.o iowaitsome.o ioreq_c2f.o ioreq_f2c.o" MPIO_REQ_TMP_POBJECTS="iotest.p iowait.p iowaitall.p iowaitany.p iotestall.p iotestany.p iowaitsome.p iotestsome.p" MPIO_REQ_REAL_POBJECTS="_iotest.o _iowait.o _iowaitall.o _iowaitany.o _iotestall.o _iotestany.o _iowaitsome.o _iotestsome.o" -have_aio=no # known_mpi_impls="mpich_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi open_mpi_mpi" @@ -213,14 +212,14 @@ known_filesystems="m4_join([ ],known_filesystems_m4)" # Defaults AC_ARG_ENABLE(aio,[ --enable-aio - Request use of asynchronous I/O routines (default)], -[ +[ if test "x$enableval" = "xno" ; then disable_aio=yes else disable_aio=no fi ], disable_aio=no) -AC_ARG_ENABLE(echo, +AC_ARG_ENABLE(echo, [--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x) AC_ARG_ENABLE(f77, [--enable-f77 - Turn on support for Fortran 77 (default)],,enable_f77=yes) @@ -274,9 +273,9 @@ if test -z "$ARCH" -a -x $srcdir/util/tarch ; then ARCH=`$srcdir/util/tarch | sed s/-/_/g` if test -z "$ARCH" ; then AC_MSG_RESULT([Unknown!]) - AC_MSG_ERROR([Error: Could not guess target architecture, you must -set an architecture type with the environment variable ARCH]) - fi + AC_MSG_ERROR([Error: Could not guess target architecture, you must +set an architecture type with the environment variable ARCH]) + fi eval "arch_$ARCH=1" AC_MSG_RESULT($ARCH) fi @@ -291,7 +290,7 @@ fi # # # Find the home directory if not specified -if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then +if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then ROMIO_HOME_TRIAL=$srcdir else # Take advantage of autoconf2 features @@ -327,7 +326,7 @@ AC_SUBST(mandir) if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi AC_SUBST(docdir) if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi -AC_SUBST(htmldir) +AC_SUBST(htmldir) # If we are building within a known MPI implementation, we must avoid the @@ -375,7 +374,7 @@ if test $WITHIN_KNOWN_MPI_IMPL = no ; then # compile command. Some compilers complain if it's only -I MPI_INCLUDE_DIR=. fi -else +else MPI_INCLUDE_DIR=. fi # @@ -397,22 +396,22 @@ else USER_FFLAGS="$FFLAGS -O" fi # -# Here begin the architecture-specific tests. +# Here begin the architecture-specific tests. # -------------------------------------------------------------------------- -# We must first select the C and Fortran compilers. Because of the +# We must first select the C and Fortran compilers. Because of the # way that the PROG_CC autoconf macro works (and all of the macros that # require it, including CHECK_HEADERS), that macro must occur exactly -# once in the configure.ac file, at least as of autoconf 2.57 . +# once in the configure.ac file, at least as of autoconf 2.57 . # Unfortunately, this requirement is not enforced. To handle this, # we first case on the architecture; then use PROG_CC, then case on the # architecture again for any arch-specific features. We also set the # C_DEBUG_FLAG and F77_DEBUG_FLAG in case debugging is selected. -# +# # For the MPICH and MPICH configures, the compilers will already be # selected, so most of the compiler-selection code will be bypassed. # -------------------------------------------------------------------------- # For historical reasons -if test -z "$FC" ; then +if test -z "$FC" ; then FC=$F77 fi # @@ -467,7 +466,7 @@ PAC_GET_SPECIAL_SYSTEM_INFO AC_HAVE_FUNCS(memalign) # -# Question: Should ROMIO under MPICH ignore the Fortran tests, since +# Question: Should ROMIO under MPICH ignore the Fortran tests, since # MPICH provides all of the Fortran interface routines? # if test $NOF77 = 0 ; then @@ -483,7 +482,7 @@ if test $NOF77 = 0 ; then if test ! -d test ; then mkdir test ; fi ln -s $MPI_INCLUDE_DIR/mpif.h test fi -else +else F77=":" fi # @@ -557,7 +556,7 @@ if test "$ac_cv_sizeof_long_long" != 0 ; then MPI_OFFSET_KIND1="!" MPI_OFFSET_KIND2="!" else - echo "defining MPI_Offset as long in C and integer in Fortran" + echo "defining MPI_Offset as long in C and integer in Fortran" MPI_OFFSET_TYPE="long" DEFINE_MPI_OFFSET="typedef long MPI_Offset;" FORTRAN_MPI_OFFSET="integer" @@ -566,7 +565,7 @@ if test "$ac_cv_sizeof_long_long" != 0 ; then MPI_OFFSET_KIND2="!" fi else - echo "defining MPI_Offset as long in C and integer in Fortran" + echo "defining MPI_Offset as long in C and integer in Fortran" MPI_OFFSET_TYPE="long" DEFINE_MPI_OFFSET="typedef long MPI_Offset;" FORTRAN_MPI_OFFSET="integer" @@ -585,7 +584,7 @@ if test -n "$ac_cv_sizeof_long_long"; then fi fi # -if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then +if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND" MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$OFFSET_KIND)" MPI_OFFSET_KIND_VAL=$OFFSET_KIND @@ -650,7 +649,7 @@ else MPI_FINFO2="!" MPI_FINFO3="!" MPI_FINFO4="!" -fi +fi # if test -n "$mpi_sgi"; then dnl if test -z "$HAVE_MPI_INFO" ; then @@ -661,8 +660,8 @@ dnl fi PAC_TEST_MPI_HAVE_OFFSET_KIND fi # -# check if darray and subarray constructors are defined in the MPI -# implementation +# check if darray and subarray constructors are defined in the MPI +# implementation if test $WITHIN_KNOWN_MPI_IMPL = no ; then PAC_MPI_DARRAY_SUBARRAY fi @@ -680,7 +679,7 @@ if test $FROM_MPICH = yes ; then MPI_FARRAY5="!" MPI_FARRAY6="!" MPI_FARRAY7="!" -fi +fi # Check to see if weak symbols work correctly if test "$enable_weak_symbols" = "yes" ; then @@ -729,7 +728,7 @@ AC_MSG_CHECKING([whether struct flock compatible with MPI_Offset]) AC_TRY_COMPILE([#include ], [struct flock l; $MPI_OFFSET_TYPE a=1; - l.l_start = a; + l.l_start = a; l.l_len = a; ],pac_cv_struct_flock_and_mpi_offset=yes,pac_cv_struct_flock_and_mpi_offset=no) AC_MSG_RESULT($pac_cv_struct_flock_and_mpi_offset) @@ -740,7 +739,7 @@ if test "$pac_cv_struct_flock_and_mpi_offset" = no ; then AC_TRY_COMPILE([#include ], [struct flock l; int a=1; - l.l_start = a; + l.l_start = a; l.l_len = a; ],pac_cv_struct_flock_and_int=yes,pac_cv_struct_flock_and_int=no) AC_MSG_RESULT($pac_cv_struct_flock_and_int) @@ -766,15 +765,15 @@ if test -n "$FILE_SYSTEM" ; then # if multiple filesystems are passed in, they are '+'-delimited # we could set the IFS to tokenize FILE_SYSTEM, but the FILE_SYSTEM env var # is used in multiple places in the build system: get rid of the '+'s so we - # can use the 'for x in $FILE_SYSTEM ...' idiom + # can use the 'for x in $FILE_SYSTEM ...' idiom FILE_SYSTEM=`echo $FILE_SYSTEM|sed -e 's/\+/ /g'` for x in $FILE_SYSTEM do found=no # We could also do test -d "ad_$y" to test for known file systems - # based on having access to the adio code. Then adding a file + # based on having access to the adio code. Then adding a file # system would not require changing configure to change known_filesystems - for y in $known_filesystems ; do + for y in $known_filesystems ; do if test $x = $y ; then found=yes eval "file_system_`echo $x`=1" @@ -856,7 +855,10 @@ if test -n "$file_system_panfs"; then AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS]), AC_MSG_ERROR([PANFS support requested but cannot find pan_fs_client_cw_mode.h header file]) ) + AC_CHECK_TYPES([pan_fs_client_raidn_encoding_t], , , + [[#include ]]) fi +AM_CONDITIONAL([BUILD_PANFS_OPEN6], [test "X$ac_cv_type_pan_fs_client_raidn_encoding_t" = "Xyes"]) if test -n "$file_system_ufs"; then AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS]) @@ -905,7 +907,7 @@ fi if test -n "$file_system_lustre"; then AC_CHECK_HEADERS(lustre/lustre_user.h, AC_DEFINE(ROMIO_LUSTRE,1,[Define for ROMIO with LUSTRE]), - AC_MSG_ERROR([LUSTRE support requested but cannot find lustre/lustre_user.h header file]) + AC_MSG_ERROR([LUSTRE support requested but cannot find lustre/lustre_user.h header file]) ) fi @@ -922,7 +924,7 @@ if test -n "$file_system_xfs"; then #include #include #include -int main(int argc, char **argv) { +int main(int argc, char **argv) { struct dioattr st; int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644); FILE *f=fopen("confmemalignval","w"); @@ -1006,7 +1008,7 @@ if test -n "$file_system_pvfs2"; then AC_CHECK_HEADERS(pvfs2.h, AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS2]) AC_DEFINE(HAVE_PVFS2_SUPER_MAGIC, 1, [Define if PVFS2_SUPER_MAGIC defined.]), - AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file]) + AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file]) ) fi @@ -1016,13 +1018,13 @@ if test -n "$file_system_pvfs2"; then AC_LANG_SOURCE([ #include #include "pvfs2.h" - int main(int argc, char **argv) { + int main(int argc, char **argv) { PVFS_object_ref ref; PVFS_sys_attr attr; - PVFS_sys_create(NULL, ref, attr, NULL, NULL, NULL, NULL); + PVFS_sys_create(NULL, ref, attr, NULL, NULL, NULL, NULL); return 0; } ])], - , AC_DEFINE(HAVE_PVFS2_CREATE_WITHOUT_LAYOUT, 1, + , AC_DEFINE(HAVE_PVFS2_CREATE_WITHOUT_LAYOUT, 1, [Define if PVFS_sys_create does not have layout parameter]) ) fi @@ -1035,11 +1037,13 @@ fi AS_IF([test -n "$file_system_gpfs"], [SYSDEP_INC=-I${prefix}/include], [SYSDEP_INC=]) -AC_CHECK_HEADERS([gpfs.h gpfs_fcntl.h]) -AS_IF([test "$ac_cv_header_gpfs_h" = "yes" -o "$ac_cv_header_gpfs_fcntl_h" = "yes"], [ - AC_SEARCH_LIBS([gpfs_fcntl], [gpfs], [], - [AC_MSG_ERROR([Library containing gpfs_fcntl symbols not found])]) -]) +AS_IF([test -n "$file_system_gpfs"], + AC_CHECK_HEADERS([gpfs.h gpfs_fcntl.h]) + AS_IF([test "$ac_cv_header_gpfs_h" = "yes" -o "$ac_cv_header_gpfs_fcntl_h" = "yes"], [ + AC_SEARCH_LIBS([gpfs_fcntl], [gpfs], [], + [AC_MSG_ERROR([Library containing gpfs_fcntl symbols not found])]) + ]) + ) # Check for presence and characteristics of async. I/O calls if # not disabled. @@ -1063,45 +1067,24 @@ if test "x$disable_aio" = "xno" ; then fi if test "x$disable_aio" = "xno" -a -n "$aio_write_found" ; then - AC_CHECK_HEADERS(signal.h) - # Just because aio.h is found by CPP doesn't mean that we can use it - # We try to compile it, not just read it. - AC_MSG_CHECKING([if aio.h exists and can be compiled]) - AC_TRY_COMPILE([ -#include -#include ], -[],have_aio_h=yes,have_aio_h=no) - AC_MSG_RESULT($have_aio_h) - if test "$have_aio_h" = yes ; then - AC_DEFINE(HAVE_AIO_H,1,[Define if aio.h exists and can be compiled]) - fi - - AC_MSG_CHECKING([if sys/aio.h exists and can be compiled]) - AC_TRY_COMPILE([ -#include -#include ], -[],have_sys_aio_h=yes,have_sys_aio_h=no) - AC_MSG_RESULT($have_sys_aio_h) - if test "$have_sys_aio_h" = yes ; then - AC_DEFINE(HAVE_SYS_AIO_H,1,[Define if sys/aio.h exists and can be compiled]) - fi - if test "$have_aio_h" = "no" -a "$have_sys_aio_h" = "no" ; then + AC_CHECK_HEADERS([signal.h aio.h sys/aio.h] ) + if test "$ac_cv_header_aio_h" = "no" -a "$ac_cv_header_sys_aio_h" = "no" ; then disable_aio=yes fi fi -if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = "xno"; then +if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" -o "x$disable_aio" = "xno"; then # Check that aio is available (many systems appear to have aio # either installed improperly or turned off). - # The test is the following: if not cross compiling, try to run a + # The test is the following: if not cross compiling, try to run a # program that includes a *reference* to aio_write but does not call it # If the libraries are not set up correctly, then this will fail. AC_MSG_CHECKING([whether aio routines can be used]) - # Include aio.h and the aiocb struct (since we'll need these to - # actually use the aio_write interface). Note that this will - # fail for some pre-POSIX implementations of the aio interface + # Include aio.h and the aiocb struct (since we'll need these to + # actually use the aio_write interface). Note that this will + # fail for some pre-POSIX implementations of the aio interface # (an old IBM interface needs an fd argument as well) AC_TRY_RUN([ #include @@ -1131,7 +1114,7 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = if test "$aio_runs" != "no" ; then AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work) fi - + # now about that old IBM interface... # modern AIO interfaces have the file descriptor in the aiocb structure, # and will set ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES. Old IBM @@ -1164,7 +1147,7 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = ], aio_two_arg_write=yes AC_MSG_RESULT(yes), - aio_two_arg_write=no + aio_two_arg_write=no AC_MSG_RESULT(no), aio_two_arg_write=no AC_MSG_RESULT(no: cannot test when cross-compiling) @@ -1196,7 +1179,7 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = ], aio_two_arg_suspend=yes AC_MSG_RESULT(yes), - aio_two_arg_suspend=no + aio_two_arg_suspend=no AC_MSG_RESULT(no), aio_two_arg_suspend=no AC_MSG_RESULT(no: cannot test when cross compiling) @@ -1206,127 +1189,51 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments) fi - AC_MSG_CHECKING([for aio_fildes member of aiocb structure]) - AC_TRY_COMPILE([ -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - ],[ - struct aiocb a; - a.aio_fildes = 0; - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES, 1, [Define if aiocb has aio_fildes member]), - AC_MSG_RESULT(no) - ) - AC_MSG_CHECKING(for aio_whence member of aiocb structure) - AC_TRY_COMPILE([ -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif -#include -#include - ],[ - struct aiocb a; - a.aio_whence = SEEK_SET; - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE, 1, [Define if aiocb has aio_whence member]), - AC_MSG_RESULT(no) - ) - AC_MSG_CHECKING(for aio_handle member of aiocb structure) - AC_TRY_COMPILE([ -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - ],[ - struct aiocb a; - aio_handle_t h; - - a.aio_handle = h; - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE, 1, [Define if aiocb has aio_handle member]), - AC_MSG_RESULT(no) - ) - AC_MSG_CHECKING(for aio_reqprio member of aiocb structure) - AC_TRY_COMPILE([ -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - ],[ - struct aiocb a; - - a.aio_reqprio = 0; - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO, 1, [Define if aiocb has aio_reqprio member]), - AC_MSG_RESULT(no) - ) - AC_MSG_CHECKING(for aio_sigevent member of aiocb structure) - AC_TRY_COMPILE([ -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - ],[ - struct aiocb a; - - a.aio_sigevent.sigev_signo = 0; - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT, 1, [Define if aiocb has aio_sigevent member]), - AC_MSG_RESULT(no) - ) - + AC_CHECK_MEMBERS( + [struct aiocb.aio_fildes, + struct aiocb.aio_whence, + struct aiocb.aio_handle, + struct aiocb.aio_reqprio, + struct aiocb.aio_sigevent], + [], + [], + [[#ifdef HAVE_AIO_H + #include + #endif + #ifdef HAVE_SYS_AIO_H + #include + #endif] ] ) fi +# the aio-lite package provides an aio facility in case system aio library is +# buggy or does not perform well. for example, one fortran test does not pass +# its non-blocking collective I/O test +# See http://trac.mpich.org/projects/mpich/ticket/2201 for one such failure. + +AC_ARG_WITH([aio-lite], + [AS_HELP_STRING([--with-aio-lite], + [use alternate external aio implementation])], + [with_aiolite=yes], + []) +AS_IF([test "x$with_aiolite" == xyes], + AC_CHECK_LIB([aio-lite], [lio_listio], + [], [], [-lpthread] + ) + AC_CHECK_HEADERS([aio-lite.h]) + ) # End of aio-related tests +# Linux aio library seems to have problems when they are used in our NBC I/O +# implementation. We let the code know when the host OS is Linux so that the +# NBC I/O implementation uses blocking I/O operations. +# See http://trac.mpich.org/projects/mpich/ticket/2201. + +# compute canonical system types +AC_CANONICAL_HOST +AS_CASE([$host_os], + [linux*], AC_DEFINE(ROMIO_RUN_ON_LINUX,1,[Define if run on Linux])) +# End of OS check + # # Check for statfs (many) and specifically f_fstypename field (BSD) # @@ -1352,61 +1259,19 @@ AC_TRY_COMPILE([ pac_cv_have_statfs=yes,pac_cv_have_statfs=no ) AC_MSG_RESULT($pac_cv_have_statfs) -# At this point, we could check for whether defining +# At this point, we could check for whether defining # __SWORD_TYPE as sizet_t or int/long (size of pointer) # would help. FIXME if test "$pac_cv_have_statfs" = yes ; then AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled]) fi - -AC_MSG_CHECKING([for f_type member of statfs structure]) -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_VFS_H -#include -#endif -#ifdef HAVE_SYS_STATVFS_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - ],[ - struct statfs f; - memset(&f, 0, sizeof(f)); - f.f_type = 0; - ], - pac_cv_have_statfs_f_type=yes, - pac_cv_have_statfs_f_type=no -) -AC_MSG_RESULT($pac_cv_have_statfs_f_type) -if test $pac_cv_have_statfs_f_type = yes ; then - AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE, 1,[Define if statfs has f_type]) -fi - + AC_MSG_CHECKING([for f_fstypename member of statfs structure]) AC_TRY_COMPILE([ -#ifdef HAVE_SYS_VFS_H -#include -#endif -#ifdef HAVE_SYS_STATVFS_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H #include -#endif -#ifdef HAVE_SYS_MOUNT_H #include -#endif -#ifdef HAVE_STRING_H #include -#endif ],[ struct statfs f; memset(&f, 0, sizeof(f)); @@ -1488,35 +1353,11 @@ AC_CHECK_TYPE([blksize_t],[],[AC_DEFINE_UNQUOTED([blksize_t],[__blksize_t],[Prov #endif]] ) # -# Check for large file support. Make sure that we can use the off64_t -# type (in some cases, it is an array, and the ROMIO code isn't prepared for -# that). +# in 2004, solairs defined off_t as a union. Today (2016) that is not the case +# and we can simplify this check # -AC_CHECK_HEADERS(unistd.h) -if test "$ac_cv_header_unistd_h" = "yes" ; then - AC_CACHE_CHECK([for large file defines],ac_cv_has_large_file_defines,[ - AC_TRY_COMPILE([ -#include - ], [ -#ifndef _LFS64_LARGEFILE -#error no largefile defines -#endif - ],ac_cv_has_large_file_defines=yes,ac_cv_has_large_file_defines=no)]) - if test "$ac_cv_has_large_file_defines" = "yes" ; then - # See if we can use them - AC_CACHE_CHECK([whether off64_t is an scalar type],ac_cv_off64_t_scalar,[ - AC_TRY_COMPILE([ -#define _LARGEFILE64_SOURCE -#define _FILE_OFFSET_BITS 64 -#include -#include -],[off64_t a = 3;],ac_cv_off64_t_scalar=yes,ac_cv_off64_t_scalar=no)]) - if test "$ac_cv_off64_t_scalar" = "yes" ; then - CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" - fi - fi -fi +AC_SYS_LARGEFILE() # pread and pwrite are useful to ROMIO: if implemented well, they help us avoid # an extra system call. But --enable-strict or CFLAGS="--std=c99" does not @@ -1566,7 +1407,7 @@ AC_ARG_VAR([master_top_srcdir],[set by the MPICH configure to indicate the MPICH AC_ARG_VAR([master_top_builddir],[set by the MPICH configure to indicate the MPICH build root]) # The master_top_srcdir is the location of the source for the building -# package. This is used only as part of the MPICH build, including +# package. This is used only as part of the MPICH build, including # the documentation targets mandoc, htmldoc, and latexdoc if test -z "$master_top_srcdir" ; then if test "$FROM_MPICH" = yes ; then @@ -1599,7 +1440,7 @@ if test "$FROM_MPICH" = no ; then LIBNAME="$top_build_dir/lib/libmpio.a" fi # - if test ! -d $top_build_dir/lib ; then + if test ! -d $top_build_dir/lib ; then mkdir $top_build_dir/lib fi else @@ -1631,7 +1472,7 @@ AC_SUBST(DOCTEXT) if test $NOF77 = 1 ; then F77=":" else - FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test" + FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test" fi # if test $WITHIN_KNOWN_MPI_IMPL = no ; then @@ -1643,7 +1484,7 @@ fi # if test "$MPI_INCLUDE_DIR" = "." ; then ROMIO_INCLUDE="-I../include" -else +else ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR" fi # @@ -1676,11 +1517,11 @@ if test $FROM_OMPI = yes ; then elif test $FROM_LAM = yes ; then # LAM does have the status set bytes functionality AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes]) - + # Used in the tests/ subdirectory for after ROMIO is built TEST_CC=mpicc TEST_F77=mpifort - MPIRUN=mpirun + MPIRUN=mpirun MPI_LIB= ROMIO_INCLUDE= USER_CFLAGS= @@ -1698,7 +1539,7 @@ elif test $FROM_MPICH = yes ; then # CC="$CC -I${use_top_srcdir}/src/include -I${top_build_dir}/src/include" # TEST_CC="$CC" # MPI_LIB="$LIBNAME" - # To allow ROMIO to work with the LIBTOOL scripts, we want to + # To allow ROMIO to work with the LIBTOOL scripts, we want to # work directly with the CC, not the mpicc, compiler. # Note that in the "FROM_MPICH" case, the CPPFLAGS and INCLUDES are already # properly set @@ -1736,7 +1577,7 @@ if test $WITHIN_KNOWN_MPI_IMPL = no ; then PAC_TEST_MPI_GREQUEST PAC_TEST_MPIU_FUNCS AC_DEFINE(PRINT_ERR_MSG,1,[Define for printing error messages]) - AC_CHECK_TYPE(MPI_Count,[],[AC_DEFINE_UNQUOTED([MPI_Count],[MPI_Aint],[Define to "MPI_Aint" if MPI does not provide MPI_Count]) ]) + AC_CHECK_TYPE([MPI_Count],[],[AC_DEFINE_UNQUOTED([MPI_Count],[MPI_Aint],[Define to "MPI_Aint" if MPI does not provide MPI_Count]) ], [[#include ]]) PAC_TEST_NEEDS_CONST AC_CHECK_DECLS([MPI_COMBINER_HINDEXED_BLOCK], [], [], [[#include ]]) AC_CHECK_FUNCS(MPI_Type_size_x MPI_Status_set_elements_x) @@ -1837,24 +1678,10 @@ CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H" if test -n "$MPIOF_H_INCLUDED"; then F77MPIOINC="" -else +else F77MPIOINC="include 'mpiof.h'" fi -AC_CHECK_HEADERS(unistd.h, - AC_MSG_CHECKING([for large file defines]) - AC_TRY_COMPILE([ - #include - ], [ - #ifndef _LFS64_LARGEFILE - #error no largefile defines - #endif - ], - CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(none) ) - ) - echo "setting SYSDEP_INC to $SYSDEP_INC" AC_SUBST(SYSDEP_INC) @@ -1928,6 +1755,7 @@ AC_SUBST(HAVE_MPI_DARRAY_SUBARRAY) AC_SUBST(BUILD_MPI_ARRAY) AC_SUBST(DEFINE_MPI_OFFSET) AC_SUBST(DEFINE_HAVE_MPI_GREQUEST) +AC_SUBST(DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS) AC_SUBST(MPI_OFFSET_TYPE) AC_SUBST(MPI_FINFO1) AC_SUBST(MPI_FINFO2) @@ -1971,7 +1799,7 @@ AC_SUBST(FORTRAN_TEST) #if test ! -d mpi-io ; then mkdir mpi-io ; fi #if test ! -d mpi-io/glue ; then mkdir mpi-io/glue ; fi -# Create makefiles for all of the adio devices. Only the ones that +# Create makefiles for all of the adio devices. Only the ones that # are active will be called by the top level ROMIO make AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests]) AC_CONFIG_FILES([ diff --git a/ompi/mca/io/romio314/romio/doc/README b/ompi/mca/io/romio321/romio/doc/README similarity index 84% rename from ompi/mca/io/romio314/romio/doc/README rename to ompi/mca/io/romio321/romio/doc/README index 9f72cc10a1..b61e73ee20 100644 --- a/ompi/mca/io/romio314/romio/doc/README +++ b/ompi/mca/io/romio321/romio/doc/README @@ -1,7 +1,7 @@ The ROMIO Users Guide is in the file users-guide.ps.gz. The book ``Using MPI-2: Advanced Features of the Message-Passing -Interface,'' by William Gropp, Ewing Lusk, and Rajeev Thakur, +Interface,'' by William Gropp, Ewing Lusk, and Rajeev Thakur, MIT Press, 1999, provides a tutorial introduction to all aspects of MPI-2, including I/O. It has lots of example programs. @@ -9,18 +9,18 @@ The following papers related to ROMIO are available online: * Rajeev Thakur, William Gropp, and Ewing Lusk, ``Optimizing Noncontiguous Accesses in MPI-IO,'' Parallel Computing, (28)1:83--105, -January 2002. +January 2002. http://www.mcs.anl.gov/~thakur/papers/mpi-io-noncontig.ps * R. Thakur, W. Gropp, and E. Lusk, ``On Implementing MPI-IO Portably and with High Performance,'' in Proc. of the Sixth Workshop on I/O in -Parallel and Distributed Systems, May 1999. +Parallel and Distributed Systems, May 1999. http://www.mcs.anl.gov/~thakur/papers/mpio-impl.ps * R. Thakur, W. Gropp, and E. Lusk, ``Data Sieving and Collective I/O in ROMIO,'' in Proc. of the 7th Symposium on the Frontiers of Massively Parallel Computation, February 1999, pp. 182--189. -http://www.mcs.anl.gov/~thakur/papers/romio-coll.ps +http://www.mcs.anl.gov/~thakur/papers/romio-coll.ps * R. Thakur, W. Gropp, and E. Lusk, ``A Case for Using MPI's Derived Datatypes to Improve I/O Performance,'' in Proc. of SC98: High @@ -29,7 +29,7 @@ http://www.mcs.anl.gov/~thakur/dtype * R. Thakur, W. Gropp, and E. Lusk, ``An Abstract-Device Interface for Implementing Portable Parallel-I/O Interfaces,'' in Proc. of the 6th -Symposium on the Frontiers of Massively Parallel Computation, +Symposium on the Frontiers of Massively Parallel Computation, October 1996, pp. 180-187. http://www.mcs.anl.gov/~thakur/papers/adio.ps diff --git a/ompi/mca/io/romio314/romio/doc/makepubpage.sh b/ompi/mca/io/romio321/romio/doc/makepubpage.sh similarity index 100% rename from ompi/mca/io/romio314/romio/doc/makepubpage.sh rename to ompi/mca/io/romio321/romio/doc/makepubpage.sh diff --git a/ompi/mca/io/romio314/romio/doc/pubs.bib b/ompi/mca/io/romio321/romio/doc/pubs.bib similarity index 99% rename from ompi/mca/io/romio314/romio/doc/pubs.bib rename to ompi/mca/io/romio321/romio/doc/pubs.bib index 946f6f2b54..5799bc305c 100644 --- a/ompi/mca/io/romio314/romio/doc/pubs.bib +++ b/ompi/mca/io/romio321/romio/doc/pubs.bib @@ -145,10 +145,10 @@ } @InProceedings{yu:bgl-io, - author = {Hao Yu and R. K. Sahoo and C. Howson and George. Almasi and - J. G. Castanos and M. Gupta and Jose. E. Moreira and J. J. Parker and - T. E. Engelsiepen and Robert Ross and Rajeev Thakur and Robert Latham - and W. D. Gropp}, + author = {Hao Yu and R. K. Sahoo and C. Howson and George. Almasi and + J. G. Castanos and M. Gupta and Jose. E. Moreira and J. J. Parker and + T. E. Engelsiepen and Robert Ross and Rajeev Thakur and Robert Latham + and W. D. Gropp}, title = {High Performance File {I/O} for the {BlueGene/L} Supercomputer}, booktitle = {Proceedings of the 12th International Symposium on High-Performance Computer Architecture (HPCA-12)}, month = {February}, @@ -260,7 +260,7 @@ title = {Exploiting {Lustre} File Joining for Effective Collective {IO}}, booktitle = {Seventh IEEE International Symposium on Cluster Computing and the Grid (CCGrid 2007)}, month = {May}, - year = {2007}, + year = {2007}, } @InProceedings{yu:opal, @@ -333,7 +333,7 @@ title = {Cooperative Client-side File Caching for {MPI} Applications}, journal = {International Journal of High Performance Computing Applications}, volume = {21}, - number = {2}, + number = {2}, pages = {144-154}, month = {May}, year = {2007} @@ -341,10 +341,10 @@ @InProceedings{liao:client_cache_eval, author = {Wei-keng Liao and Avery Ching and Kenin Coloma and Alok Choudhary and Lee Ward}, - title = {An Implementation and Evaluation of Client-side File Caching for {MPI-IO}}, - booktitle = {Proceedings of the 21st International Parallel and Distributed + title = {An Implementation and Evaluation of Client-side File Caching for {MPI-IO}}, + booktitle = {Proceedings of the 21st International Parallel and Distributed Processing Symposium (IPDPS), Long Beach, California}, - month = {March}, + month = {March}, year = {2007} } @@ -384,7 +384,7 @@ Processing Symposium (IPDPS), Long Beach, California}, title = {{MPI} Atomicity and Concurrent Overlapping {I/O}}, booktitle = {High Performance Computing: Paradigm and Infrastructure}, pages = {203-218}, - chapter = {10}, + chapter = {10}, month = {November}, year = {2005}, publisher = {John Wiley & Sons Inc}, @@ -396,7 +396,7 @@ Processing Symposium (IPDPS), Long Beach, California}, title = {{Cooperative Write-Behind Data Buffering for MPI I/O}}, booktitle = {Proceedings of the 12th European Parallel Virtual Machine and Message Passing Interface Conference (EURO PVM/MPI), Sorrento (Naples), Italy}, month = {September}, - year = {2005} + year = {2005} } @InProceedings{liao:app_aware_caching, diff --git a/ompi/mca/io/romio314/romio/doc/romio.bib b/ompi/mca/io/romio321/romio/doc/romio.bib similarity index 97% rename from ompi/mca/io/romio314/romio/doc/romio.bib rename to ompi/mca/io/romio321/romio/doc/romio.bib index 8cbb37f128..bb94a2d2ea 100644 --- a/ompi/mca/io/romio314/romio/doc/romio.bib +++ b/ompi/mca/io/romio321/romio/doc/romio.bib @@ -8,17 +8,17 @@ @Misc{mpi97a, author = "{Message Passing Interface Forum}", - title = "{{MPI-2}: Extensions to the Message-Passing Interface}", + title = "{{MPI-2}: Extensions to the Message-Passing Interface}", note = "{\tt http://www.mpi-forum.org/docs/docs.html}", year = {July 1997} } @InProceedings{thak96e, author = {Rajeev Thakur and William Gropp and Ewing Lusk}, - title = {An Abstract-Device Interface for Implementing Portable + title = {An Abstract-Device Interface for Implementing Portable Parallel-{I/O} Interfaces}, booktitle = {Proceedings of the 6th Symposium on the Frontiers of - Massively Parallel Computation}, + Massively Parallel Computation}, publisher = {IEEE Computer Society Press}, pages = {180--187}, month = {October}, @@ -28,8 +28,8 @@ @InProceedings{thak99b, author = {Rajeev Thakur and William Gropp and Ewing Lusk}, title = {On Implementing {MPI-IO} Portably and with High Performance}, - booktitle = {Proceedings of the 6th Workshop on I/O in Parallel and - Distributed Systems}, + booktitle = {Proceedings of the 6th Workshop on I/O in Parallel and + Distributed Systems}, pages = {23--32}, year = {1999}, month = {May}, diff --git a/ompi/mca/io/romio314/romio/doc/source-guide.tex b/ompi/mca/io/romio321/romio/doc/source-guide.tex similarity index 99% rename from ompi/mca/io/romio314/romio/doc/source-guide.tex rename to ompi/mca/io/romio321/romio/doc/source-guide.tex index ec151bfeea..96fa7ca58d 100644 --- a/ompi/mca/io/romio314/romio/doc/source-guide.tex +++ b/ompi/mca/io/romio321/romio/doc/source-guide.tex @@ -61,7 +61,7 @@ Science Foundation.} %% \newcommand{\ls}[1] - {\dimen0=\fontdimen6\the\font + {\dimen0=\fontdimen6\the\font \lineskip=#1\dimen0 \advance\lineskip.5\fontdimen5\the\font \advance\lineskip-\dimen0 diff --git a/ompi/mca/io/romio321/romio/doc/users-guide.pdf b/ompi/mca/io/romio321/romio/doc/users-guide.pdf new file mode 100644 index 0000000000..4d060499a9 Binary files /dev/null and b/ompi/mca/io/romio321/romio/doc/users-guide.pdf differ diff --git a/ompi/mca/io/romio314/romio/doc/users-guide.tex b/ompi/mca/io/romio321/romio/doc/users-guide.tex similarity index 97% rename from ompi/mca/io/romio314/romio/doc/users-guide.tex rename to ompi/mca/io/romio321/romio/doc/users-guide.tex index 3eebdbd21e..3715431b71 100644 --- a/ompi/mca/io/romio314/romio/doc/users-guide.tex +++ b/ompi/mca/io/romio321/romio/doc/users-guide.tex @@ -21,7 +21,7 @@ ANL/MCS-TM-234 \\ \rule{1.75in}{.01in} \\ -\vskip 1.3in +\vskip 1.3in {\Large\bf Users Guide for ROMIO: A High-Performance, \\ [1ex] Portable MPI-IO Implementation} \\ [4ex] by \\ [2ex] @@ -60,7 +60,7 @@ Science Foundation.} %% \newcommand{\ls}[1] - {\dimen0=\fontdimen6\the\font + {\dimen0=\fontdimen6\the\font \lineskip=#1\dimen0 \advance\lineskip.5\fontdimen5\the\font \advance\lineskip-\dimen0 @@ -98,10 +98,10 @@ I/O chapter in the \mbox{MPI Standard}). This document describes how to install ROMIO version~1.2.4 on various machines. \end{abstract} -\section{Introduction} +\section{Introduction} ROMIO\footnote{\tt http://www.mcs.anl.gov/romio} is a -high-performance, portable implementation of MPI-IO (the I/O chapter in +high-performance, portable implementation of MPI-IO (the I/O chapter in MPI~\cite{mpi97a}). This document describes how to install and use ROMIO version~1.2.4 on various machines. @@ -143,7 +143,7 @@ HFS, SGI XFS, NEC SFS, PVFS, NFS, NTFS, and any Unix file system (UFS). This version of ROMIO is included in MPICH 1.2.4; an earlier version is included in at least the following MPI implementations: LAM, HP -MPI, SGI MPI, and NEC MPI. +MPI, SGI MPI, and NEC MPI. Note that proper I/O error codes and classes are returned and the status variable is filled only when used with MPICH revision 1.2.1 or later. @@ -163,7 +163,7 @@ the commands provided by the file system to access the file, for example, Please read the limitations of this version of ROMIO that are listed in Section~\ref{sec:limit} of this document (e.g., restriction to homogeneous -environments). +environments). \subsection{ROMIO Optimizations} \label{sec:opt} @@ -179,8 +179,8 @@ number of I/O operations, each of which is often for a very small amount of data. The added network cost of performing an I/O operation across the network, as in parallel I/O systems, is often high because of latency. Thus, this naive approach typically performs very poorly because of -the overhead of multiple operations. -% +the overhead of multiple operations. +% In the data sieving technique, a number of noncontiguous regions are accessed by reading a block of data containing all of the regions, including the unwanted data between them (called ``holes''). The regions @@ -229,7 +229,7 @@ read operations. Default is \texttt{4194304} (4~Mbytes). \item \texttt{ind\_wr\_buffer\_size} -- Controls the size (in bytes) of the intermediate buffer used by ROMIO when performing data sieving during write operations. Default is \texttt{524288} (512~Kbytes). -\item \texttt{romio\_ds\_read} -- +\item \texttt{romio\_ds\_read} -- Determines when ROMIO will choose to perform data sieving. Valid values are \texttt{enable}, \texttt{disable}, or \texttt{automatic}. Default value is \texttt{automatic}. In \texttt{automatic} mode ROMIO @@ -256,8 +256,8 @@ serviced with individual operations by each process. When set to \texttt{automatic}, ROMIO will use heuristics to determine when to enable the optimization. \item \texttt{romio\_cb\_write} -- Controls when collective buffering is -applied to collective write operations. Valid values are -\texttt{enable}, \texttt{disable}, and \texttt{automatic}. Default is +applied to collective write operations. Valid values are +\texttt{enable}, \texttt{disable}, and \texttt{automatic}. Default is \texttt{automatic}. See the description of \texttt{romio\_cb\_read} for an explanation of the values. \item \texttt{romio\_no\_indep\_rw} -- This hint controls when ``deferred @@ -265,7 +265,7 @@ open'' is used. When set to \texttt{true}, ROMIO will make an effort to avoid performing any file operation on non-aggregator nodes. The application is expected to use only collective operations. This is discussed in further detail below. -\item \texttt{cb\_config\_list} -- Provides explicit control over +\item \texttt{cb\_config\_list} -- Provides explicit control over aggregators. This is discussed in further detail below. \end{itemize} @@ -286,7 +286,7 @@ following BNF: cb_config_list => hostspec [ ',' cb_config_list ] hostspec => hostname [ ':' maxprocesses ] hostname => - | '*' + | '*' maxprocesses => | '*' \end{verbatim} @@ -353,13 +353,13 @@ The implementation is also encouraged to assign processes in the order that they are listed in \texttt{cb\_config\_list}. The following hint controls the deferred open feature of romio and are also -applicable to all file system types: +applicable to all file system types: \begin{itemize} -\item \texttt{romio\_no\_indep\_rw} -- If the application plans on performing only +\item \texttt{romio\_no\_indep\_rw} -- If the application plans on performing only collecitve operations and this hint is set to ``true'', then ROMIO can have just the aggregators open a file. The \texttt{cb\_config\_list} and \texttt{cb\_nodes} hints can be given to further control which nodes are - aggregators. + aggregators. \end{itemize} For PVFS, PIOFS, and PFS: @@ -414,7 +414,7 @@ Default is \texttt{disable}. \subsubsection{Hints for PVFS (v2)} \label{sec:hints_pvfs} -The PVFS v2 file system has many tuning parameters. +The PVFS v2 file system has many tuning parameters. \begin{itemize} \item dtype i/o \end{itemize} @@ -450,7 +450,7 @@ locking). The Lustre developers have run tests where data sieving showed bad collective write performance for some kinds of workloads. So, to avoid this, we define the \texttt{romio\_lustre\_ds\_in\_coll} hint to disable the read-modify-write step in collective I/O. This optimization is distinct from the one in -independent I/O (controlled by \texttt{romio\_ds\_read} and +independent I/O (controlled by \texttt{romio\_ds\_read} and \texttt{romio\_ds\_write}). \end{itemize} @@ -466,7 +466,7 @@ time. \begin{itemize} \item \texttt{panfs\_layout\_type} Specifies the layout of a file: 2 = RAID0 -3 = RAID5 Parity Stripes +3 = RAID5 Parity Stripes \item \texttt{panfs\_layout\_stripe\_unit} The size of the stripe unit in bytes @@ -484,7 +484,7 @@ written across the same set of SBs. \item \texttt{panfs\_layout\_visit\_policy} If the layout type is RAID5 Parity Stripes, the policy used to determine the parity stripe a given file offset is -written to: 1 = Round Robin +written to: 1 = Round Robin \end{itemize} PanFS supports the ``concurrent write'' (CW) mode, where groups of @@ -508,7 +508,7 @@ Concurrent write mode is not a persistent attribute of the file. Below is an example PanFS layout using the following parameters: \begin{verbatim} - + - panfs_layout_type = 3 - panfs_layout_total_num_comps = 100 - panfs_layout_parity_stripe_width = 10 @@ -557,7 +557,7 @@ cb_config_list n01,n11,n21,n31,n41 ROMIO will look for these hints in the file \texttt{/etc/romio-hints}. A user can set the environment variable \texttt{ROMIO\_HINTS} to the name of a file -which ROMIO will use instead. +which ROMIO will use instead. \subsection{Using ROMIO on NFS} @@ -578,17 +578,17 @@ performance, but it is necessary for correct behavior. The following are some instructions we received from Ian Wells of HP for setting the {\tt noac} option on NFS. We have not tried them -ourselves. We are including them here because you may find +ourselves. We are including them here because you may find them useful. Note that some of the steps may be specific to HP systems, and you may need root permission to execute some of the -commands. +commands. -\begin{verbatim} +\begin{verbatim} >1. first confirm you are running nfs version 3 > >rpcnfo -p `hostname` | grep nfs > - >ie + >ie > goedel >rpcinfo -p goedel | grep nfs > 100003 2 udp 2049 nfs > 100003 3 udp 2049 nfs @@ -600,11 +600,11 @@ commands. > Here is an example of a correct fstab entry for /epm1: > > ie grep epm1 /etc/fstab - > + > > ROOOOT 11>grep epm1 /etc/fstab > gershwin:/epm1 /rmt/gershwin/epm1 nfs bg,intr,noac 0 0 > - > if the noac option is not present, add it + > if the noac option is not present, add it > and then remount this directory > on each of the machines that will be used to share MPIO files > @@ -615,7 +615,7 @@ commands. > >3. Confirm that the directory is mounted noac: > - >ROOOOT >grep gershwin /etc/mnttab + >ROOOOT >grep gershwin /etc/mnttab >gershwin:/epm1 /rmt/gershwin/epm1 nfs >noac,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0 0 0 899911504 \end{verbatim} @@ -626,7 +626,7 @@ NFS has a ``sync'' option that specifies that the server should put data on the disk before replying that an operation is complete. This means that the actual I/O cost on the server side cannot be hidden with caching, etc. when this option is selected. - + In the ``async'' mode the server can get the data into a buffer (and perhaps put it in the write queue; this depends on the implementation) and reply right away. Obviously if the server were to go down after the @@ -706,7 +706,7 @@ barrier or similar operation to ensure the set size has completed. Since ROMIO is included in MPICH, LAM, HP MPI, SGI MPI, and NEC MPI, you don't need to install it separately if you are using any of these MPI implementations. If you are using some other MPI, you -can configure and build ROMIO as follows: +can configure and build ROMIO as follows: Untar the tar file as \begin{verbatim} @@ -731,12 +731,12 @@ program takes the filename as a command-line argument ``{\tt -fname filename}''. The {\tt configure} script by default configures ROMIO for the file -systems most likely +systems most likely to be used on the given machine. If you wish, you can explicitly specify the file systems by using the ``{\tt -file\_system}'' option to configure. Multiple file systems can be specified by using `+' as a separator, e.g., \\ \hspace*{.4in} {\tt ./configure -file\_system=xfs+nfs} \\ -For the entire list of options to configure, do\\ +For the entire list of options to configure, do\\ \hspace*{.4in} {\tt ./configure -h | more} \\ After building a specific version, you can install it in a particular directory with \\ @@ -773,7 +773,7 @@ need to change source. might affect interoperability with libraries compiled with a different size of {\tt off\_t}). The latter exposes the gnu libc functions open64(), write64(), read64(), etc. ROMIO does not make use of the 64 bit system calls directly at this time, but we -add this flag for good measure. +add this flag for good measure. If your linux system is relatively new, there is an excellent chance it is running kernel 2.4.0 or newer and glibc-2.2.0 or newer. Add the @@ -804,7 +804,7 @@ a directory corresponding to that file system as follows:\\ \section{Compiling and Running MPI-IO Programs} If ROMIO is not already included in the MPI implementation, you need to include the file {\tt mpio.h} for C or {\tt mpiof.h} for Fortran in -your MPI-IO program. +your MPI-IO program. Note that on HP machines running HPUX and on NEC SX-4, you need to compile Fortran programs with {\tt mpifort}, because {\tt mpif77} does @@ -891,10 +891,10 @@ add the following line to your {\tt .cshrc} file:\\ \hspace*{.4in} {\tt setenv MPI\_TYPE\_MAX 65536}\\ Use a larger number if you still get the error message. \item If a Fortran program uses a file handle created using ROMIO's C -interface, or vice versa, you must use the functions {\tt MPI\_File\_c2f} +interface, or vice versa, you must use the functions {\tt MPI\_File\_c2f} or {\tt MPI\_File\_f2c} (see \S~4.12.4 in~\cite{mpi97a}). Such a situation occurs, for example, if a Fortran program uses an I/O -library written in C +library written in C with MPI-IO calls. Similar functions {\tt MPIO\_Request\_f2c} and {\tt MPIO\_Request\_c2f} are also provided. \item For Fortran programs on the Intel Paragon, you may need @@ -902,7 +902,7 @@ to provide the complete path to {\tt mpif.h} in the {\tt include} statement, e.g., \\ \hspace*{.4in} {\tt include '/usr/local/mpich/include/mpif.h'}\\ instead of \\ -\hspace*{.4in} {\tt include 'mpif.h'}\\ +\hspace*{.4in} {\tt include 'mpif.h'}\\ This is because the {\tt -I} option to the Paragon Fortran compiler {\tt if77} doesn't work correctly. It always looks in the default directories first and, @@ -1007,15 +1007,15 @@ therefore used as the default. components of the MPI I/O chapter not yet implemented are file interoperability and error handling. -\item Added support for using ``direct I/O'' on SGI's XFS file system. +\item Added support for using ``direct I/O'' on SGI's XFS file system. Direct I/O is an optional feature of XFS in which data is moved - directly between the user's buffer and the storage devices, bypassing - the file-system cache. This can improve performance significantly on + directly between the user's buffer and the storage devices, bypassing + the file-system cache. This can improve performance significantly on systems with high disk bandwidth. Without high disk bandwidth, regular I/O (that uses the file-system cache) perfoms better. ROMIO, therefore, does not use direct I/O by default. The user can turn on direct I/O (separately for reading and writing) either by - using environment variables or by using MPI's hints mechanism (info). + using environment variables or by using MPI's hints mechanism (info). To use the environment-variables method, do \begin{verbatim} setenv MPIO_DIRECT_READ TRUE @@ -1032,7 +1032,7 @@ therefore used as the default. process in the MPI job. This is not guaranteed by the MPI Standard, but it works with SGI's MPI and the {\tt ch\_shmem} device of MPICH. -\item Added support (new ADIO device, {\tt ad\_pvfs}) for the PVFS parallel +\item Added support (new ADIO device, {\tt ad\_pvfs}) for the PVFS parallel file system for Linux clusters, developed at Clemson University (see {\tt http://www.parl.clemson.edu/pvfs}). To use it, you must first install PVFS and then when configuring ROMIO, specify @@ -1048,13 +1048,13 @@ therefore used as the default. \item Uses weak symbols (where available) for building the profiling version, i.e., the PMPI routines. As a result, the size of the library is reduced - considerably. + considerably. \item The Makefiles use {\em virtual paths} if supported by the make utility. GNU {\tt make} supports it, for example. This feature allows you to untar the distribution in some directory, say a slow NFS directory, - and compile the library (create the .o files) in another + and compile the library (create the .o files) in another directory, say on a faster local disk. For example, if the tar file has been untarred in an NFS directory called {\tt /home/thakur/romio}, one can compile it in a different directory, say {\tt /tmp/thakur}, as @@ -1067,7 +1067,7 @@ therefore used as the default. The .o files will be created in {\tt /tmp/thakur}; the library will be created in\newline {\tt /home/thakur/romio/lib/\$ARCH/libmpio.a}. This method works only if the {\tt make} utility supports {\em - virtual paths}. + virtual paths}. If the default {\tt make} utility does not, you can install GNU {\tt make} which does, and specify it to {\tt configure} as \begin{verbatim} @@ -1078,8 +1078,8 @@ therefore used as the default. \item This version is included in MPICH 1.2.0. If you are using MPICH, you need not download ROMIO separately; it gets built as part of MPICH. - The previous version of ROMIO is included in LAM, HP MPI, SGI MPI, and - NEC MPI. NEC has also implemented the MPI-IO functions missing + The previous version of ROMIO is included in LAM, HP MPI, SGI MPI, and + NEC MPI. NEC has also implemented the MPI-IO functions missing in ROMIO, and therefore NEC MPI has a complete implementation of MPI-IO. \end{itemize} @@ -1095,7 +1095,7 @@ NEC SFS file system. \item New devices {\tt ad\_hfs} for HP HFS file system and {\tt ad\_xfs} for SGI XFS file system. -\item Users no longer need to prefix the filename with the type of +\item Users no longer need to prefix the filename with the type of file system; ROMIO determines the file-system type on its own. \item Added support for 64-bit file sizes on IBM PIOFS, SGI XFS, @@ -1104,11 +1104,11 @@ HP HFS, and NEC SFS file systems. \item {\tt MPI\_Offset} is an 8-byte integer on machines that support 8-byte integers. It is of type {\tt long long} in C and {\tt integer*8} in Fortran. With a Fortran 90 compiler, you can use either -{\tt integer*8} or {\tt integer(kind=MPI\_OFFSET\_KIND)}. -If you {\tt printf} an {\tt MPI\_Offset} in C, remember to use {\tt \%lld} -or {\tt \%ld} as required by your compiler. (See what is used in the test +{\tt integer*8} or {\tt integer(kind=MPI\_OFFSET\_KIND)}. +If you {\tt printf} an {\tt MPI\_Offset} in C, remember to use {\tt \%lld} +or {\tt \%ld} as required by your compiler. (See what is used in the test program {\tt romio/test/misc.c}). -On some machines, ROMIO detects at configure time that {\tt long long} is +On some machines, ROMIO detects at configure time that {\tt long long} is either not supported by the C compiler or it doesn't work properly. In such cases, configure sets {\tt MPI\_Offset} to {\tt long} in C and {\tt integer} in Fortran. This happens on Intel Paragon, Sun4, and FreeBSD. @@ -1124,7 +1124,7 @@ in {\tt MPI\_Info} object): \texttt{striping\_unit} (on PFS and PIOFS), \texttt{start\_iodevice} (on PFS and PIOFS), and \texttt{pfs\_svr\_buf} (on PFS only). - + \end{itemize} \newpage @@ -1134,7 +1134,7 @@ and \texttt{pfs\_svr\_buf} (on PFS only). %\bibliography{/homes/thakur/tex/bib/papers,/homes/robl/projects/papers/pario} % this is the pared-down one containing only those references used in % users-guide.tex -% to regenerate, uncomment the full databases above, then run +% to regenerate, uncomment the full databases above, then run % ~gropp/bin/citetags users-guide.tex | sort | uniq | \ % ~gropp/bin/citefind - /homes/thakur/tex/bib/papers.bib \ % /homes/robl/projects/papers/pario diff --git a/ompi/mca/io/romio314/romio/include/io_romio_conv.h b/ompi/mca/io/romio321/romio/include/io_romio_conv.h similarity index 94% rename from ompi/mca/io/romio314/romio/include/io_romio_conv.h rename to ompi/mca/io/romio321/romio/include/io_romio_conv.h index 82d85cb51c..ae3ea7deb4 100644 --- a/ompi/mca/io/romio314/romio/include/io_romio_conv.h +++ b/ompi/mca/io/romio321/romio/include/io_romio_conv.h @@ -23,7 +23,7 @@ #ifdef ROMIO_PREFIX #undef ROMIO_PREFIX #endif -#define ROMIO_PREFIX(foo) mca_io_romio314_dist_##foo +#define ROMIO_PREFIX(foo) mca_io_romio_dist_##foo /* Section 9.2 */ /* Begin Prototypes */ @@ -57,7 +57,12 @@ #define MPI_File_write_all ROMIO_PREFIX(MPI_File_write_all) #define MPI_File_iread ROMIO_PREFIX(MPI_File_iread) +#define MPI_File_iread_all ROMIO_PREFIX(MPI_File_iread_all) #define MPI_File_iwrite ROMIO_PREFIX(MPI_File_iwrite) +#define MPI_File_iwrite_all ROMIO_PREFIX(MPI_File_iwrite_all) +#define MPI_File_iread_at_all ROMIO_PREFIX(MPI_File_iread_at_all) +#define MPI_File_iwrite_at_all ROMIO_PREFIX(MPI_File_iwrite_at_all) + #define MPI_File_seek ROMIO_PREFIX(MPI_File_seek) #define MPI_File_get_position ROMIO_PREFIX(MPI_File_get_position) diff --git a/ompi/mca/io/romio314/romio/include/mpio.h.in b/ompi/mca/io/romio321/romio/include/mpio.h.in similarity index 91% rename from ompi/mca/io/romio314/romio/include/mpio.h.in rename to ompi/mca/io/romio321/romio/include/mpio.h.in index 0e3de89b9f..9ef709dc65 100644 --- a/ompi/mca/io/romio314/romio/include/mpio.h.in +++ b/ompi/mca/io/romio321/romio/include/mpio.h.in @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -36,7 +36,7 @@ typedef struct ADIOI_FileD *MPI_File; @DEFINE_HAVE_MPI_GREQUEST@ #ifndef HAVE_MPI_GREQUEST -typedef struct ADIOI_RequestD *MPIO_Request; +typedef struct ADIOI_RequestD *MPIO_Request; #else #define MPIO_Request MPI_Request #define MPIO_USES_MPI_REQUEST @@ -48,13 +48,15 @@ typedef struct ADIOI_RequestD *MPIO_Request; #endif #define MPIO_REQUEST_DEFINED +@DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS@ + #ifndef HAVE_MPI_OFFSET @DEFINE_MPI_OFFSET@ /* If we needed to define MPI_Offset, then we also need to make this definition. */ #ifndef HAVE_MPI_DATAREP_FUNCTIONS #define HAVE_MPI_DATAREP_FUNCTIONS -typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, +typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, void *, MPI_Offset, void *); typedef int (MPI_Datarep_extent_function)(MPI_Datatype datatype, MPI_Aint *, void *); @@ -65,7 +67,7 @@ typedef int (MPI_Datarep_extent_function)(MPI_Datatype datatype, MPI_Aint *, @NEEDS_MPI_FINT@ #endif #ifdef NEEDS_MPI_FINT -typedef int MPI_Fint; +typedef int MPI_Fint; #endif #ifndef HAVE_MPI_INFO @@ -81,7 +83,7 @@ typedef int MPI_Fint; #define MPI_MODE_RDONLY 2 /* ADIO_RDONLY */ #define MPI_MODE_RDWR 8 /* ADIO_RDWR */ #define MPI_MODE_WRONLY 4 /* ADIO_WRONLY */ -#define MPI_MODE_CREATE 1 /* ADIO_CREATE */ +#define MPI_MODE_CREATE 1 /* ADIO_CREATE */ #define MPI_MODE_EXCL 64 /* ADIO_EXCL */ #define MPI_MODE_DELETE_ON_CLOSE 16 /* ADIO_DELETE_ON_CLOSE */ #define MPI_MODE_UNIQUE_OPEN 32 /* ADIO_UNIQUE_OPEN */ @@ -123,7 +125,7 @@ typedef int MPI_Fint; /* MPI-IO function prototypes */ -/* The compiler must support ANSI C style prototypes, otherwise +/* The compiler must support ANSI C style prototypes, otherwise long long constants (e.g. 0) may get passed as ints. */ #ifndef HAVE_PRAGMA_HP_SEC_DEF @@ -161,8 +163,8 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int c MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); /* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, @@ -180,8 +182,8 @@ int MPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype dat MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); /* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); @@ -247,6 +249,20 @@ int MPI_File_sync(MPI_File fh); int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler); int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler); #endif + +/* For MPI 3.1 */ +int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); +int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); +int MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, + MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); +int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, + MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); /* End Prototypes */ #ifndef HAVE_MPI_DARRAY_SUBARRAY @@ -357,9 +373,9 @@ int PMPI_File_set_info(MPI_File, MPI_Info); int PMPI_File_get_info(MPI_File, MPI_Info *); /* Section 9.3 */ -int PMPI_File_set_view(MPI_File, MPI_Offset, +int PMPI_File_set_view(MPI_File, MPI_Offset, MPI_Datatype, MPI_Datatype, const char *, MPI_Info); -int PMPI_File_get_view(MPI_File, MPI_Offset *, +int PMPI_File_get_view(MPI_File, MPI_Offset *, MPI_Datatype *, MPI_Datatype *, char *); /* Section 9.4.2 */ @@ -377,8 +393,8 @@ int PMPI_File_write_at_all(MPI_File, MPI_Offset, const void *, MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); /* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ int PMPI_File_iread_at(MPI_File, MPI_Offset, void *, int, MPI_Datatype, MPIO_Request *) @@ -398,8 +414,8 @@ int PMPI_File_write_all(MPI_File, const void *, int, MPI_Datatype, MPI_Status *) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); /* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ + requests not yet implemented. For the same reason, MPIO_Test and + MPIO_Wait are used to test and wait on nonblocking I/O requests */ int PMPI_File_iread(MPI_File, void *, int, MPI_Datatype, MPIO_Request *) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); @@ -415,7 +431,7 @@ int PMPI_File_read_shared(MPI_File, void *, int, MPI_Datatype, MPI_Status *) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); int PMPI_File_write_shared(MPI_File, const void *, int, MPI_Datatype, MPI_Status *) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_iread_shared(MPI_File, void *, int, +int PMPI_File_iread_shared(MPI_File, void *, int, MPI_Datatype, MPIO_Request *) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); int PMPI_File_iwrite_shared(MPI_File, const void *, int, @@ -472,13 +488,27 @@ int PMPI_File_set_errhandler( MPI_File, MPI_Errhandler ); int PMPI_File_get_errhandler( MPI_File, MPI_Errhandler * ); #endif +/* For MPI 3.1 */ +int PMPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); +int PMPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); +int PMPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, + MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); +int PMPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, + MPI_Request *request) + MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); + #ifndef HAVE_MPI_DARRAY_SUBARRAY /* Section 4.14.4 */ -int PMPI_Type_create_subarray(int, int *, int *, int *, int, +int PMPI_Type_create_subarray(int, int *, int *, int *, int, MPI_Datatype, MPI_Datatype *); /* Section 4.14.5 */ -int PMPI_Type_create_darray(int, int, int, int *, int *, +int PMPI_Type_create_darray(int, int, int, int *, int *, int *, int *, int, MPI_Datatype, MPI_Datatype *); #endif diff --git a/ompi/mca/io/romio314/romio/include/mpiof.h.in b/ompi/mca/io/romio321/romio/include/mpiof.h.in similarity index 91% rename from ompi/mca/io/romio314/romio/include/mpiof.h.in rename to ompi/mca/io/romio321/romio/include/mpiof.h.in index cfb26c5d35..fa945807bd 100644 --- a/ompi/mca/io/romio314/romio/include/mpiof.h.in +++ b/ompi/mca/io/romio321/romio/include/mpiof.h.in @@ -1,9 +1,9 @@ -! -! Copyright (C) 1997 University of Chicago. +! +! Copyright (C) 1997 University of Chicago. ! See COPYRIGHT notice in top-level directory. ! -! -! user include file for Fortran MPI-IO programs +! +! user include file for Fortran MPI-IO programs ! INTEGER MPI_MODE_RDONLY, MPI_MODE_RDWR, MPI_MODE_WRONLY INTEGER MPI_MODE_DELETE_ON_CLOSE, MPI_MODE_UNIQUE_OPEN diff --git a/ompi/mca/io/romio321/romio/localdefs.in b/ompi/mca/io/romio321/romio/localdefs.in new file mode 100644 index 0000000000..94fd9508da --- /dev/null +++ b/ompi/mca/io/romio321/romio/localdefs.in @@ -0,0 +1,7 @@ +#! /bin/sh + +# Append ROMIO library dependencies to the global list +WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@" + +MPI_OFFSET_TYPE="@MPI_OFFSET_TYPE@" +FORTRAN_MPI_OFFSET="@FORTRAN_MPI_OFFSET@" diff --git a/ompi/mca/io/romio314/romio/mpi-io/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/Makefile.mk similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/Makefile.mk rename to ompi/mca/io/romio321/romio/mpi-io/Makefile.mk index d23ac9c383..264976e06c 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/Makefile.mk +++ b/ompi/mca/io/romio321/romio/mpi-io/Makefile.mk @@ -26,10 +26,14 @@ romio_mpi_sources += \ mpi-io/get_size.c \ mpi-io/get_view.c \ mpi-io/iread.c \ + mpi-io/iread_all.c \ mpi-io/iread_at.c \ + mpi-io/iread_atall.c \ mpi-io/iread_sh.c \ mpi-io/iwrite.c \ + mpi-io/iwrite_all.c \ mpi-io/iwrite_at.c \ + mpi-io/iwrite_atall.c \ mpi-io/iwrite_sh.c \ mpi-io/open.c \ mpi-io/prealloc.c \ diff --git a/ompi/mca/io/romio314/romio/mpi-io/close.c b/ompi/mca/io/romio321/romio/mpi-io/close.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/close.c rename to ompi/mca/io/romio321/romio/mpi-io/close.c index cfad507369..12d5c4791f 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/close.c +++ b/ompi/mca/io/romio321/romio/mpi-io/close.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -44,7 +44,7 @@ int MPI_File_close(MPI_File *fh) HPMP_IO_WSTART(fl_xmpi, BLKMPIFILECLOSE, TRDTBLOCK, *adio_fh); #endif /* MPI_hpux */ - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(*fh); @@ -95,7 +95,7 @@ int MPI_File_close(MPI_File *fh) #endif /* MPI_hpux */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; fn_fail: /* --BEGIN ERROR HANDLING-- */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/delete.c b/ompi/mca/io/romio321/romio/mpi-io/delete.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/delete.c rename to ompi/mca/io/romio321/romio/mpi-io/delete.c index caec75bd83..47b52a054c 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/delete.c +++ b/ompi/mca/io/romio321/romio/mpi-io/delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,27 +41,27 @@ int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info) ADIOI_Fns *fsops; #ifdef MPI_hpux int fl_xmpi; - + HPMP_IO_START(fl_xmpi, BLKMPIFILEDELETE, TRDTBLOCK, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ MPIU_UNREFERENCED_ARG(info); - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); MPIR_MPIOInit(&error_code); if (error_code != MPI_SUCCESS) goto fn_exit; /* resolve file system type from file name; this is a collective call */ - ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops, + ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops, &error_code); /* --BEGIN ERROR HANDLING-- */ if (error_code != MPI_SUCCESS) { /* ADIO_ResolveFileType() will print as informative a message as it - * possibly can or call MPIR_Err_setmsg. We just need to propagate + * possibly can or call MPIR_Err_setmsg. We just need to propagate * the error up. In the PRINT_ERR_MSG case MPI_Abort has already * been called as well, so we probably didn't even make it this far. */ @@ -84,12 +84,12 @@ int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info) if (error_code != MPI_SUCCESS) error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); /* --END ERROR HANDLING-- */ - + #ifdef MPI_hpux HPMP_IO_END(fl_xmpi, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/file_c2f.c b/ompi/mca/io/romio321/romio/mpi-io/file_c2f.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/file_c2f.c rename to ompi/mca/io/romio321/romio/mpi-io/file_c2f.c index 4d2032bc8f..4eaae9fafa 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/file_c2f.c +++ b/ompi/mca/io/romio321/romio/mpi-io/file_c2f.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/file_f2c.c b/ompi/mca/io/romio321/romio/mpi-io/file_f2c.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/file_f2c.c rename to ompi/mca/io/romio321/romio/mpi-io/file_f2c.c index fded33df35..b6b4896b38 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/file_f2c.c +++ b/ompi/mca/io/romio321/romio/mpi-io/file_f2c.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/fortran/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/Makefile.mk rename to ompi/mca/io/romio321/romio/mpi-io/fortran/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/closef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/closef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/closef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/closef.c index 514d64c128..aebdf56a61 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/closef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/closef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/deletef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/deletef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/deletef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/deletef.c index d44092d4db..660129f760 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/deletef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/deletef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/fsyncf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/fsyncf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/fsyncf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/fsyncf.c index 52e905aec9..b52245256b 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/fsyncf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/fsyncf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_sync_(MPI_Fint *fh, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_sync_(MPI_Fint *fh, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_sync(fh_c); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_amodef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_amodef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_amodef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_amodef.c index 81e77d534a..2427f06831 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_amodef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_amodef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_amode_(MPI_Fint *fh, MPI_Fint *amode, MP FORTRAN_API void FORT_CALL mpi_file_get_amode_(MPI_Fint *fh, MPI_Fint *amode, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_amode(fh_c, amode); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_atomf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_atomf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_atomf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_atomf.c index 3aa79475fc..98bf557e34 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_atomf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_atomf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_atomicity_(MPI_Fint *fh, MPI_Fint *flag, FORTRAN_API void FORT_CALL mpi_file_get_atomicity_(MPI_Fint *fh, MPI_Fint *flag, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_atomicity(fh_c, flag); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_bytofff.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_bytofff.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_bytofff.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_bytofff.c index 3e28c26fc4..fb38b7be4c 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_bytofff.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_bytofff.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_byte_offset_(MPI_Fint *fh, MPI_Offset *o FORTRAN_API void FORT_CALL mpi_file_get_byte_offset_(MPI_Fint *fh,MPI_Offset *offset, MPI_Offset *disp, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_byte_offset(fh_c,*offset,disp); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_errhf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_errhf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_errhf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_errhf.c index 4ec1936c2e..96901ad776 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_errhf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_errhf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -96,7 +96,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_errhandler_(MPI_Fint *fh, MPI_Fint *err_ { MPI_File fh_c; MPI_Errhandler err_handler_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_errhandler(fh_c, &err_handler_c); *err_handler = MPI_Errhandler_c2f(err_handler_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_extentf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_extentf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_extentf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_extentf.c index 363118b773..9a11d3c946 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_extentf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_extentf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -100,7 +100,7 @@ void mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Fint *datatype, MPI_File fh_c; MPI_Datatype datatype_c; MPI_Aint extent_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -118,7 +118,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Datatype * { MPI_File fh_c; MPI_Aint extent_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_type_extent(fh_c,*datatype, &extent_c); *(MPI_Aint*)extent = extent_c; /* Have to assume it's really an MPI_Aint?*/ diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_groupf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_groupf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_groupf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_groupf.c index abb2707384..bb8c9a9cba 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_groupf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_groupf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -109,7 +109,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_group_(MPI_Fint *fh,MPI_Group *group, MP FORTRAN_API void FORT_CALL mpi_file_get_group_(MPI_Fint *fh,MPI_Group *group, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_group(fh_c, group); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_infof.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_infof.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_infof.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_infof.c index 3771727e69..eb2ba551a4 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_infof.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_infof.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -96,7 +96,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_info_(MPI_Fint *fh, MPI_Fint *info_used, { MPI_File fh_c; MPI_Info info_used_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_info(fh_c, &info_used_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_posn_shf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_posn_shf.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_posn_shf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_posn_shf.c index a6a1bbc3e0..8f5bff5c06 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_posn_shf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_posn_shf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,13 +90,13 @@ extern FORTRAN_API void FORT_CALL mpi_file_get_position_shared_( MPI_Fint *, MPI #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_position_shared_(MPI_Fint *fh, MPI_Offset *offset, +FORTRAN_API void FORT_CALL mpi_file_get_position_shared_(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_get_position_shared_(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_position_shared(fh_c, offset); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_posnf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_posnf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_posnf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_posnf.c index b97190cfcb..e21f37674a 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_posnf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_posnf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_position_(MPI_Fint *fh, MPI_Offset *offs FORTRAN_API void FORT_CALL mpi_file_get_position_(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_position(fh_c, offset); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_sizef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_sizef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_sizef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_sizef.c index 343704bb57..71ff17bb56 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_sizef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_sizef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_size_(MPI_Fint *fh, MPI_Offset *size, MP FORTRAN_API void FORT_CALL mpi_file_get_size_(MPI_Fint *fh, MPI_Offset *size, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_get_size(fh_c, size); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_viewf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_viewf.c similarity index 99% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/get_viewf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/get_viewf.c index 6022379bb1..8a4bc3d7fb 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/get_viewf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/get_viewf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -127,7 +127,7 @@ void mpi_file_get_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, /* this should be flagged as an error. */ *ierr = MPI_ERR_UNKNOWN; } - + *etype = MPI_Type_c2f(etype_c); *filetype = MPI_Type_c2f(filetype_c); ADIOI_Free(tmprep); @@ -159,7 +159,7 @@ FORTRAN_API void FORT_CALL mpi_file_get_view_( MPI_Fint *fh, MPI_Offset *disp, M FPRINTF(stderr, "MPI_File_get_view: datarep is an invalid address\n"); MPI_Abort(MPI_COMM_WORLD, 1); } - + tmprep = (char *) ADIOI_Malloc((MPI_MAX_DATAREP_STRING+1) * sizeof(char)); fh_c = MPI_File_f2c(*fh); etype_c = MPI_Type_f2c(*etype); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iotestf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iotestf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iotestf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iotestf.c index 346fdead50..2a2c96c886 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iotestf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iotestf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -94,7 +94,7 @@ FORTRAN_API void FORT_CALL mpio_test_(MPI_Fint *request,MPI_Fint *flag,MPI_Statu FORTRAN_API void FORT_CALL mpio_test_(MPI_Fint *request,MPI_Fint *flag,MPI_Status *status, MPI_Fint *ierr ) { MPIO_Request req_c; - + req_c = MPIO_Request_f2c(*request); *ierr = MPIO_Test(&req_c,flag,status); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iowaitf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iowaitf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iowaitf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iowaitf.c index c4c551914f..a87ca6a6d9 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iowaitf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iowaitf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -94,7 +94,7 @@ FORTRAN_API void FORT_CALL mpio_wait_(MPI_Fint *request,MPI_Status *status, MPI_ FORTRAN_API void FORT_CALL mpio_wait_(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ) { MPIO_Request req_c; - + req_c = MPIO_Request_f2c(*request); *ierr = MPIO_Wait(&req_c, status); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iread_atf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iread_atf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iread_atf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iread_atf.c index 5d983c98a0..c6a687dcee 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iread_atf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iread_atf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -102,7 +102,7 @@ void mpi_file_iread_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, MPI_File fh_c; MPIO_Request req_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -122,7 +122,7 @@ FORTRAN_API void FORT_CALL mpi_file_iread_at_(MPI_Fint *fh,MPI_Offset *offset,vo { MPI_File fh_c; MPIO_Request req_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iread_at(fh_c,*offset,buf,*count,*datatype,&req_c); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iread_shf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iread_shf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iread_shf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iread_shf.c index 9262240eff..84dc3753c4 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iread_shf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iread_shf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -100,7 +100,7 @@ void mpi_file_iread_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_File fh_c; MPIO_Request req_c; MPI_Datatype datatype_c; - + datatype_c = MPI_Type_f2c(*datatype); fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iread_shared(fh_c,buf,*count,datatype_c,&req_c); @@ -116,7 +116,7 @@ FORTRAN_API void FORT_CALL mpi_file_iread_shared_(MPI_Fint *fh,void *buf,MPI_Fin { MPI_File fh_c; MPIO_Request req_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iread_shared(fh_c,buf,*count,*datatype,&req_c); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/ireadf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/ireadf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/ireadf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/ireadf.c index 15e0554658..ae9fbaf3bf 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/ireadf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/ireadf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -100,7 +100,7 @@ void mpi_file_iread_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_File fh_c; MPIO_Request req_c; MPI_Datatype datatype_c; - + datatype_c = MPI_Type_f2c(*datatype); fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iread(fh_c,buf,*count,datatype_c,&req_c); @@ -116,7 +116,7 @@ FORTRAN_API void FORT_CALL mpi_file_iread_(MPI_Fint *fh,void *buf,MPI_Fint *coun { MPI_File fh_c; MPIO_Request req_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iread(fh_c,buf,*count,*datatype,&req_c); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iwrite_atf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iwrite_atf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iwrite_atf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iwrite_atf.c index 752e95938c..b326fc3d1a 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iwrite_atf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iwrite_atf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -102,7 +102,7 @@ void mpi_file_iwrite_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, MPI_File fh_c; MPIO_Request req_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -121,7 +121,7 @@ FORTRAN_API void FORT_CALL mpi_file_iwrite_at_(MPI_Fint *fh,MPI_Offset *offset,v { MPI_File fh_c; MPIO_Request req_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iwrite_at(fh_c,*offset,buf,*count,*datatype,&req_c); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iwrite_shf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iwrite_shf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iwrite_shf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iwrite_shf.c index d5233b41ca..90ea68777b 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iwrite_shf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iwrite_shf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_File fh_c; MPIO_Request req_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -109,14 +109,14 @@ void mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, #else /* Prototype to keep compiler happy */ FORTRAN_API void FORT_CALL mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ); + MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ) { MPI_File fh_c; MPIO_Request req_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iwrite_shared(fh_c,buf,*count,*datatype,&req_c); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/iwritef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/iwritef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/iwritef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/iwritef.c index 4ea2d686b6..4410c011a1 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/iwritef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/iwritef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -100,7 +100,7 @@ void mpi_file_iwrite_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_File fh_c; MPIO_Request req_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -117,7 +117,7 @@ FORTRAN_API void FORT_CALL mpi_file_iwrite_(MPI_Fint *fh,void *buf,MPI_Fint *cou { MPI_File fh_c; MPIO_Request req_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_iwrite(fh_c,buf,*count,*datatype,&req_c); *request = MPIO_Request_c2f(req_c); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/openf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/openf.c similarity index 99% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/openf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/openf.c index 1f5bb50f73..ea1a5d1c47 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/openf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/openf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/preallocf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/preallocf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/preallocf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/preallocf.c index 6130bf086e..515aa4a912 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/preallocf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/preallocf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_preallocate_(MPI_Fint *fh,MPI_Offset *size, FORTRAN_API void FORT_CALL mpi_file_preallocate_(MPI_Fint *fh,MPI_Offset *size, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_preallocate(fh_c,*size); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/rd_atallbf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/rd_atallbf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/rd_atallbf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/rd_atallbf.c index 379e9b8273..5fff4e9e7e 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/rd_atallbf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/rd_atallbf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -114,7 +114,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_at_all_begin_(MPI_Fint *fh,MPI_Offset * MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_at_all_begin(fh_c,*offset,buf,*count,(MPI_Datatype) *datatype); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/rd_atallef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/rd_atallef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/rd_atallef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/rd_atallef.c index 702e8f81a2..8a3441126d 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/rd_atallef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/rd_atallef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_at_all_end_(MPI_Fint *fh,void *buf,MPI_ FORTRAN_API void FORT_CALL mpi_file_read_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_at_all_end(fh_c,buf,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_allbf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_allbf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_allbf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_allbf.c index 4370cbb6f9..5708a03c8d 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_allbf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_allbf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -113,7 +113,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_F FORTRAN_API void FORT_CALL mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_all_begin(fh_c,buf,*count,(MPI_Datatype) *datatype); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_allef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_allef.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_allef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_allef.c index 3fbc321f8b..776b182d64 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_allef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_allef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,13 +90,13 @@ extern FORTRAN_API void FORT_CALL mpi_file_read_all_end_( MPI_Fint *, void*, MPI #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, +FORTRAN_API void FORT_CALL mpi_file_read_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_read_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_all_end(fh_c,buf,status); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_allf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_allf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_allf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_allf.c index ae0d8563dd..99e1229b7f 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_allf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_allf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -113,7 +113,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *c FORTRAN_API void FORT_CALL mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_all(fh_c,buf,*count,(MPI_Datatype)*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_atallf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_atallf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_atallf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_atallf.c index cf059a33eb..b9f30a0056 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_atallf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_atallf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -118,7 +118,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_at_all_(MPI_Fint *fh,MPI_Offset *offset MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_at_all(fh_c,*offset,buf,*count,(MPI_Datatype)*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_atf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_atf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_atf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_atf.c index c6e00bb274..2602e399bf 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_atf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_atf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_read_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -114,7 +114,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_at_(MPI_Fint *fh,MPI_Offset *offset,voi MPI_Fint *count,MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_at(fh_c,*offset,buf,*count,(MPI_Datatype)*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordbf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordbf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordbf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordbf.c index ca1d03e298..74389174f4 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordbf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordbf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -113,7 +113,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,M FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_ordered_begin(fh_c,buf,*count,(MPI_Datatype)*datatype); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordef.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordef.c index 83b7c9476c..63425c8ad3 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,13 +90,13 @@ extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_( MPI_Fint *, void*, #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, +FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_ordered_end(fh_c,buf,status); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordf.c index 9b8633224c..a45ae1282f 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_ordf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_ordf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -113,7 +113,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fin FORTRAN_API void FORT_CALL mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_ordered(fh_c,buf,*count,(MPI_Datatype)*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_shf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_shf.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/read_shf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/read_shf.c index 098bf242fd..937e54fb95 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/read_shf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/read_shf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -98,7 +98,7 @@ void mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -107,12 +107,12 @@ void mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, #else /* Prototype to keep compiler happy */ FORTRAN_API void FORT_CALL mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); + MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read_shared(fh_c,buf,*count,(MPI_Datatype)*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/readf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/readf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/readf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/readf.c index 4600e591bc..c802739139 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/readf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/readf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_read_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -114,7 +114,7 @@ FORTRAN_API void FORT_CALL mpi_file_read_(MPI_Fint *fh,void *buf,MPI_Fint *count MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_read(fh_c,buf,*count,(MPI_Datatype)*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/seek_shf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/seek_shf.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/seek_shf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/seek_shf.c index 74a65df92c..158e626c0e 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/seek_shf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/seek_shf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,13 +90,13 @@ extern FORTRAN_API void FORT_CALL mpi_file_seek_shared_( MPI_Fint *, MPI_Offset #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_seek_shared_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, +FORTRAN_API void FORT_CALL mpi_file_seek_shared_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_seek_shared_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_seek_shared(fh_c,*offset,*whence); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/seekf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/seekf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/seekf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/seekf.c index d05bd7789e..8e125d1849 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/seekf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/seekf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_seek_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fi FORTRAN_API void FORT_CALL mpi_file_seek_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_seek(fh_c,*offset,*whence); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_atomf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_atomf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/set_atomf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/set_atomf.c index 2c8aa6ce6d..c4388950da 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_atomf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_atomf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_set_atomicity_(MPI_Fint *fh,MPI_Fint *flag, FORTRAN_API void FORT_CALL mpi_file_set_atomicity_(MPI_Fint *fh,MPI_Fint *flag, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_set_atomicity(fh_c,*flag); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_errhf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_errhf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/set_errhf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/set_errhf.c index 7f44019208..c622660898 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_errhf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_errhf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -96,7 +96,7 @@ FORTRAN_API void FORT_CALL mpi_file_set_errhandler_(MPI_Fint *fh, MPI_Fint *err_ { MPI_File fh_c; MPI_Errhandler err_handler_c; - + fh_c = MPI_File_f2c(*fh); err_handler_c = MPI_Errhandler_f2c(*err_handler); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_infof.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_infof.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/set_infof.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/set_infof.c index 12731b273d..85c05e8f1d 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_infof.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_infof.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -96,7 +96,7 @@ FORTRAN_API void FORT_CALL mpi_file_set_info_(MPI_Fint *fh, MPI_Fint *info, MPI_ { MPI_File fh_c; MPI_Info info_c; - + fh_c = MPI_File_f2c(*fh); info_c = MPI_Info_f2c(*info); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_sizef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_sizef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/set_sizef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/set_sizef.c index cda3530057..c595f2b855 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_sizef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_sizef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -95,7 +95,7 @@ FORTRAN_API void FORT_CALL mpi_file_set_size_(MPI_Fint *fh,MPI_Offset *size, MPI FORTRAN_API void FORT_CALL mpi_file_set_size_(MPI_Fint *fh,MPI_Offset *size, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_set_size(fh_c,*size); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_viewf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_viewf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/set_viewf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/set_viewf.c index 6bc7d93164..97151d978f 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/set_viewf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/set_viewf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -104,10 +104,10 @@ void mpi_file_set_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, { char *newstr; MPI_File fh_c; - int i, real_len; + int i, real_len; MPI_Datatype etype_c, filetype_c; MPI_Info info_c; - + etype_c = MPI_Type_f2c(*etype); filetype_c = MPI_Type_f2c(*filetype); info_c = MPI_Info_f2c(*info); @@ -127,9 +127,9 @@ void mpi_file_set_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, newstr = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); ADIOI_Strncpy(newstr, datarep, real_len); newstr[real_len] = '\0'; - + fh_c = MPI_File_f2c(*fh); - + *ierr = MPI_File_set_view(fh_c,*disp,etype_c,filetype_c,newstr,info_c); ADIOI_Free(newstr); @@ -152,9 +152,9 @@ FORTRAN_API void FORT_CALL mpi_file_set_view_( MPI_Fint *fh, MPI_Offset *disp, M #endif char *newstr; MPI_File fh_c; - int i, real_len; + int i, real_len; MPI_Info info_c; - + info_c = MPI_Info_f2c(*info); /* strip trailing blanks in datarep */ @@ -172,9 +172,9 @@ FORTRAN_API void FORT_CALL mpi_file_set_view_( MPI_Fint *fh, MPI_Offset *disp, M newstr = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); ADIOI_Strncpy(newstr, datarep, real_len); newstr[real_len] = '\0'; - + fh_c = MPI_File_f2c(*fh); - + *ierr = MPI_File_set_view(fh_c,*disp,*etype,*filetype,newstr,info_c); ADIOI_Free(newstr); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/wr_atallbf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/wr_atallbf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/wr_atallbf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/wr_atallbf.c index 36e32f0d44..836dd378ae 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/wr_atallbf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/wr_atallbf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -100,7 +100,7 @@ void mpi_file_write_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -115,7 +115,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_at_all_begin_(MPI_Fint *fh,MPI_Offset MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_at_all_begin(fh_c,*offset,buf,*count,(MPI_Datatype)*datatype); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/wr_atallef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/wr_atallef.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/wr_atallef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/wr_atallef.c index f190a3538b..7426c48bf2 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/wr_atallef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/wr_atallef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,13 +90,13 @@ extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_( MPI_Fint *, void*, #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, +FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_at_all_end(fh_c,buf,status); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_allbf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_allbf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_allbf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_allbf.c index 680d0925f1..e47d3cd200 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_allbf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_allbf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -97,7 +97,7 @@ void mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr ){ MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -110,7 +110,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_ FORTRAN_API void FORT_CALL mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_all_begin(fh_c,buf,*count,(MPI_Datatype)*datatype); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_allef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_allef.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_allef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_allef.c index 3ae1018f39..9ccc1eb8db 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_allef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_allef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,11 +90,11 @@ extern FORTRAN_API void FORT_CALL mpi_file_write_all_end_( MPI_Fint *, void*, MP #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); +FORTRAN_API void FORT_CALL mpi_file_write_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_write_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_all_end(fh_c,buf,status); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_allf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_allf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_allf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_allf.c index f4e57f3b22..bddcac1509 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_allf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_allf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -98,7 +98,7 @@ void mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -112,7 +112,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint * FORTRAN_API void FORT_CALL mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_all(fh_c,buf,*count,*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_atallf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_atallf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_atallf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_atallf.c index 1e377a7905..030e7ae359 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_atallf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_atallf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -101,7 +101,7 @@ void mpi_file_write_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -118,7 +118,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_at_all_(MPI_Fint *fh,MPI_Offset *offse MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_at_all(fh_c,*offset,buf,*count,*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_atf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_atf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_atf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_atf.c index e7b6640425..8ba429dcc6 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_atf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_atf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -101,7 +101,7 @@ void mpi_file_write_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -118,7 +118,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_at_(MPI_Fint *fh,MPI_Offset *offset,vo MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_at(fh_c,*offset,buf,*count,*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordbf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordbf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordbf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordbf.c index d3f1226f55..41b9accfbe 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordbf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordbf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -98,7 +98,7 @@ void mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr ){ MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -112,7 +112,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf, FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_ordered_begin(fh_c,buf,*count,*datatype); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordef.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordef.c index 8eaea85344..a979f70eee 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,12 +90,12 @@ extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_( MPI_Fint *, void* #endif /* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, +FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_ordered_end(fh_c,buf,status); diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordf.c index 4c779bfffe..fe96406d9b 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_ordf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_ordf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -98,7 +98,7 @@ void mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -112,7 +112,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fi FORTRAN_API void FORT_CALL mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_ordered(fh_c,buf,*count,*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_shf.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_shf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/write_shf.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/write_shf.c index 4aa0138c90..30d80e0ee6 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/write_shf.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/write_shf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_write_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -114,7 +114,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_shared_(MPI_Fint *fh,void *buf,MPI_Fin MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write_shared(fh_c, buf,*count,*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fortran/writef.c b/ompi/mca/io/romio321/romio/mpi-io/fortran/writef.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi-io/fortran/writef.c rename to ompi/mca/io/romio321/romio/mpi-io/fortran/writef.c index 7bab168781..9b07ba095f 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fortran/writef.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fortran/writef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -99,7 +99,7 @@ void mpi_file_write_(MPI_Fint *fh,void *buf,MPI_Fint *count, { MPI_File fh_c; MPI_Datatype datatype_c; - + fh_c = MPI_File_f2c(*fh); datatype_c = MPI_Type_f2c(*datatype); @@ -114,7 +114,7 @@ FORTRAN_API void FORT_CALL mpi_file_write_(MPI_Fint *fh,void *buf,MPI_Fint *coun MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) { MPI_File fh_c; - + fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_write(fh_c, buf,*count,*datatype,status); } diff --git a/ompi/mca/io/romio314/romio/mpi-io/fsync.c b/ompi/mca/io/romio321/romio/mpi-io/fsync.c similarity index 90% rename from ompi/mca/io/romio314/romio/mpi-io/fsync.c rename to ompi/mca/io/romio321/romio/mpi-io/fsync.c index 3f457f7a57..00c9499629 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/fsync.c +++ b/ompi/mca/io/romio321/romio/mpi-io/fsync.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,11 +45,11 @@ int MPI_File_sync(MPI_File fh) HPMP_IO_START(fl_xmpi, BLKMPIFILESYNC, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); /* --BEGIN ERROR HANDLING-- */ - if ((adio_fh <= (MPI_File) 0) || ((adio_fh)->cookie != ADIOI_FILE_COOKIE)) + if ((adio_fh == NULL) || ((adio_fh)->cookie != ADIOI_FILE_COOKIE)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_ARG, @@ -69,8 +69,8 @@ int MPI_File_sync(MPI_File fh) #ifdef MPI_hpux HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ - + fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_amode.c b/ompi/mca/io/romio321/romio/mpi-io/get_amode.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/get_amode.c rename to ompi/mca/io/romio321/romio/mpi-io/get_amode.c index 3ff5077ae2..3e9e2c3120 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_amode.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_amode.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,14 +41,14 @@ int MPI_File_get_amode(MPI_File fh, int *amode) int error_code=MPI_SUCCESS; static char myname[] = "MPI_FILE_GET_AMODE"; ADIO_File adio_fh; - + adio_fh = MPIO_File_resolve(fh); /* --BEGIN ERROR HANDLING-- */ MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); /* --END ERROR HANDLING-- */ - *amode = adio_fh->access_mode; + *amode = adio_fh->orig_access_mode; fn_exit: return error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_atom.c b/ompi/mca/io/romio321/romio/mpi-io/get_atom.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/get_atom.c rename to ompi/mca/io/romio321/romio/mpi-io/get_atom.c index 306c31ce89..1a9eae1389 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_atom.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_atom.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,7 +41,7 @@ int MPI_File_get_atomicity(MPI_File fh, int *flag) int error_code; ADIO_File adio_fh; static char myname[] = "MPI_FILE_GET_ATOMICITY"; - + adio_fh = MPIO_File_resolve(fh); /* --BEGIN ERROR HANDLING-- */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_bytoff.c b/ompi/mca/io/romio321/romio/mpi-io/get_bytoff.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/get_bytoff.c rename to ompi/mca/io/romio321/romio/mpi-io/get_bytoff.c index 7376e7af5f..f5cb452e5a 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_bytoff.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_bytoff.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -27,7 +27,7 @@ int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) _ #endif /*@ - MPI_File_get_byte_offset - Returns the absolute byte position in + MPI_File_get_byte_offset - Returns the absolute byte position in the file corresponding to "offset" etypes relative to the current view diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_errh.c b/ompi/mca/io/romio321/romio/mpi-io/get_errh.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/get_errh.c rename to ompi/mca/io/romio321/romio/mpi-io/get_errh.c index 6915218fde..7962e33f92 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_errh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_errh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -42,9 +42,9 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler) int error_code = MPI_SUCCESS; ADIO_File fh; static char myname[] = "MPI_FILE_GET_ERRHANDLER"; - MPIU_THREADPRIV_DECL; + MPID_THREADPRIV_DECL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); if (mpi_fh == MPI_FILE_NULL) { *errhandler = ADIOI_DFLT_ERR_HANDLER; @@ -66,6 +66,6 @@ int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler) } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return MPI_SUCCESS; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_extent.c b/ompi/mca/io/romio321/romio/mpi-io/get_extent.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/get_extent.c rename to ompi/mca/io/romio321/romio/mpi-io/get_extent.c index 8b7ff15004..960afab5e5 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_extent.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_extent.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_group.c b/ompi/mca/io/romio321/romio/mpi-io/get_group.c similarity index 89% rename from ompi/mca/io/romio314/romio/mpi-io/get_group.c rename to ompi/mca/io/romio321/romio/mpi-io/get_group.c index 34293c98b1..2b3077c7dc 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_group.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_group.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -26,7 +26,7 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group) __attribute__((weak,alias( #endif /*@ - MPI_File_get_group - Returns the group of processes that + MPI_File_get_group - Returns the group of processes that opened the file Input Parameters: @@ -43,7 +43,7 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group) ADIO_File adio_fh; static char myname[] = "MPI_FILE_GET_GROUP"; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -59,6 +59,6 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group) error_code = MPI_Comm_group(adio_fh->comm, group); fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_info.c b/ompi/mca/io/romio321/romio/mpi-io/get_info.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/get_info.c rename to ompi/mca/io/romio321/romio/mpi-io/get_info.c index 7685c9f04a..e923e2b95e 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_info.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_info.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -42,7 +42,7 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) ADIO_File adio_fh; static char myname[] = "MPI_FILE_GET_INFO"; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -57,6 +57,6 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) /* --END ERROR HANDLING-- */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_posn.c b/ompi/mca/io/romio321/romio/mpi-io/get_posn.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/get_posn.c rename to ompi/mca/io/romio321/romio/mpi-io/get_posn.c index 1d5c59f600..49d8e4919b 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_posn.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_posn.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -27,7 +27,7 @@ int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) __attribute__((weak,a #endif /*@ - MPI_File_get_position - Returns the current position of the + MPI_File_get_position - Returns the current position of the individual file pointer in etype units relative to the current view diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_posn_sh.c b/ompi/mca/io/romio321/romio/mpi-io/get_posn_sh.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/get_posn_sh.c rename to ompi/mca/io/romio321/romio/mpi-io/get_posn_sh.c index d0bfa44a4d..c6172c9d73 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_posn_sh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_posn_sh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -26,7 +26,7 @@ int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) __attribute__( #endif /*@ - MPI_File_get_position_shared - Returns the current position of the + MPI_File_get_position_shared - Returns the current position of the shared file pointer in etype units relative to the current view Input Parameters: diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_size.c b/ompi/mca/io/romio321/romio/mpi-io/get_size.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/get_size.c rename to ompi/mca/io/romio321/romio/mpi-io/get_size.c index ad4b8223a7..d7836c2791 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_size.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_size.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/get_view.c b/ompi/mca/io/romio321/romio/mpi-io/get_view.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/get_view.c rename to ompi/mca/io/romio321/romio/mpi-io/get_view.c index e4a7e947bc..e07cd9fa95 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/get_view.c +++ b/ompi/mca/io/romio321/romio/mpi-io/get_view.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -52,17 +52,17 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, int i, j, k, combiner; MPI_Datatype copy_etype, copy_filetype; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); /* --BEGIN ERROR HANDLING-- */ MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - if (datarep <= (char *) 0) + if (datarep == NULL) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, + myname, __LINE__, MPI_ERR_ARG, "**iodatarepnomem", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -70,14 +70,14 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, /* --END ERROR HANDLING-- */ *disp = adio_fh->disp; - ADIOI_Strncpy(datarep, + ADIOI_Strncpy(datarep, (adio_fh->is_external32 ? "external32": "native"), MPI_MAX_DATAREP_STRING); MPI_Type_get_envelope(adio_fh->etype, &i, &j, &k, &combiner); if (combiner == MPI_COMBINER_NAMED) *etype = adio_fh->etype; else { /* FIXME: It is wrong to use MPI_Type_contiguous; the user could choose to - re-implement MPI_Type_contiguous in an unexpected way. Either use + re-implement MPI_Type_contiguous in an unexpected way. Either use MPIR_Barrier_impl as in MPICH or PMPI_Type_contiguous */ MPI_Type_contiguous(1, adio_fh->etype, ©_etype); @@ -96,7 +96,7 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return MPI_SUCCESS; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/glue/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/glue/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/mpi-io/glue/Makefile.mk rename to ompi/mca/io/romio321/romio/mpi-io/glue/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/mpi-io/glue/default/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/glue/default/Makefile.mk similarity index 100% rename from ompi/mca/io/romio314/romio/mpi-io/glue/default/Makefile.mk rename to ompi/mca/io/romio321/romio/mpi-io/glue/default/Makefile.mk diff --git a/ompi/mca/io/romio314/romio/mpi-io/glue/default/mpio_err.c b/ompi/mca/io/romio321/romio/mpi-io/glue/default/mpio_err.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/glue/default/mpio_err.c rename to ompi/mca/io/romio321/romio/mpi-io/glue/default/mpio_err.c index 11c50bf5aa..880de9077a 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/glue/default/mpio_err.c +++ b/ompi/mca/io/romio321/romio/mpi-io/glue/default/mpio_err.c @@ -1,15 +1,15 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2004 University of Chicago. +/* + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ -#include -#include - #include "mpioimpl.h" #include "adio_extern.h" +#include +#include + /* Default error handling implementation. * * Note that only MPI_ERRORS_ARE_FATAL and MPI_ERRORS_RETURN are diff --git a/ompi/mca/io/romio314/romio/mpi-io/glue/default/mpio_file.c b/ompi/mca/io/romio321/romio/mpi-io/glue/default/mpio_file.c similarity index 86% rename from ompi/mca/io/romio314/romio/mpi-io/glue/default/mpio_file.c rename to ompi/mca/io/romio321/romio/mpi-io/glue/default/mpio_file.c index 51df8784b1..38222f77f2 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/glue/default/mpio_file.c +++ b/ompi/mca/io/romio321/romio/mpi-io/glue/default/mpio_file.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2004 University of Chicago. + * Copyright (C) 2004 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -43,7 +43,7 @@ extern int ADIOI_Ftable_max; MPI_File MPIO_File_f2c(MPI_Fint fh) { #ifndef INT_LT_POINTER - return (MPI_File) ((void *) fh); + return (MPI_File) ((void *) fh); /* the extra cast is to get rid of a compiler warning on Exemplar. The warning is because MPI_File points to a structure containing longlongs, which may be 8-byte aligned. But MPI_Fint itself @@ -66,20 +66,20 @@ MPI_Fint MPIO_File_c2f(MPI_File fh) #else int i; - if ((fh <= (MPI_File) 0) || (fh->cookie != ADIOI_FILE_COOKIE)) + if ((fh == NULL) || (fh->cookie != ADIOI_FILE_COOKIE)) return (MPI_Fint) 0; if (!ADIOI_Ftable) { ADIOI_Ftable_max = 1024; ADIOI_Ftable = (MPI_File *) - ADIOI_Malloc(ADIOI_Ftable_max*sizeof(MPI_File)); - ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because + ADIOI_Malloc(ADIOI_Ftable_max*sizeof(MPI_File)); + ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because MPI_FILE_NULL=0 */ for (i=0; icookie != ADIOI_FILE_COOKIE)) + if ((fh == NULL) || (fh->cookie != ADIOI_FILE_COOKIE)) return (MPI_Fint) 0; if (fh->fortran_handle != -1) @@ -72,15 +72,15 @@ MPI_Fint MPIO_File_c2f(MPI_File fh) if (!ADIOI_Ftable) { ADIOI_Ftable_max = 1024; ADIOI_Ftable = (MPI_File *) - ADIOI_Malloc(ADIOI_Ftable_max*sizeof(MPI_File)); - ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because + ADIOI_Malloc(ADIOI_Ftable_max*sizeof(MPI_File)); + ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because MPI_FILE_NULL=0 */ for (i=0; icookie != ADIOI_FILE_COOKIE)) + if ((fh == NULL) || (fh->cookie != ADIOI_FILE_COOKIE)) return (MPI_Fint) 0; if (!ADIOI_Ftable) { ADIOI_Ftable_max = 1024; diff --git a/ompi/mca/io/romio314/romio/mpi-io/ioreq_c2f.c b/ompi/mca/io/romio321/romio/mpi-io/ioreq_c2f.c similarity index 82% rename from ompi/mca/io/romio314/romio/mpi-io/ioreq_c2f.c rename to ompi/mca/io/romio321/romio/mpi-io/ioreq_c2f.c index 9de9459bda..d49ebcd2b9 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/ioreq_c2f.c +++ b/ompi/mca/io/romio321/romio/mpi-io/ioreq_c2f.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -25,7 +25,7 @@ #include "adio_extern.h" /*@ - MPIO_Request_c2f - Translates a C I/O-request handle to a + MPIO_Request_c2f - Translates a C I/O-request handle to a Fortran I/O-request handle Input Parameters: @@ -47,35 +47,35 @@ MPI_Fint MPIO_Request_c2f(MPIO_Request request) return (MPI_Fint) request; #else int i; - MPIU_THREADPRIV_DECL; + MPID_THREADPRIV_DECL; - /* We can make this test outside of the ALLFUNC mutex because it does + /* We can make this test outside of the GLOBAL mutex because it does not access any shared data */ if ((request <= (MPIO_Request) 0) || (request->cookie != ADIOI_REQ_COOKIE)) { return (MPI_Fint) 0; } - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); if (!ADIOI_Reqtable) { ADIOI_Reqtable_max = 1024; ADIOI_Reqtable = (MPIO_Request *) - ADIOI_Malloc(ADIOI_Reqtable_max*sizeof(MPIO_Request)); - ADIOI_Reqtable_ptr = 0; /* 0 can't be used though, because + ADIOI_Malloc(ADIOI_Reqtable_max*sizeof(MPIO_Request)); + ADIOI_Reqtable_ptr = 0; /* 0 can't be used though, because MPIO_REQUEST_NULL=0 */ for (i=0; icookie != ADIOI_REQ_COOKIE)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, @@ -89,7 +89,7 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status) #endif /* MPI_hpux */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } #endif diff --git a/ompi/mca/io/romio314/romio/mpi-io/iotestall.c b/ompi/mca/io/romio321/romio/mpi-io/iotestall.c similarity index 89% rename from ompi/mca/io/romio314/romio/mpi-io/iotestall.c rename to ompi/mca/io/romio321/romio/mpi-io/iotestall.c index c6db21802f..24dd8b2bc5 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/iotestall.c +++ b/ompi/mca/io/romio321/romio/mpi-io/iotestall.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 2003 University of Chicago. + * Copyright (C) 2003 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -31,19 +31,19 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag, MPI_Status statuses[]) { - int done, i, err; - MPIU_THREADPRIV_DECL; + int done, i, err; + MPID_THREADPRIV_DECL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); if (count == 1) { err = MPIO_Test( requests, flag, statuses ); goto fn_exit; } - /* This is actually very difficult to do. We can't use MPIO_Test, + /* This is actually very difficult to do. We can't use MPIO_Test, since we must change the requests only if *ALL* requests are complete */ - /* FIXME: THIS IS NOT CORRECT (see above). But most applications won't + /* FIXME: THIS IS NOT CORRECT (see above). But most applications won't care */ done = 1; for (i=0; iatomicity)) ADIO_IreadContig(adio_fh, buf, count, datatype, file_ptr_type, - off, request, &error_code); + off, request, &error_code); else { /* to maintain strict atomicity semantics with other concurrent operations, lock (exclusive) and call blocking routine */ @@ -151,10 +151,10 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu } } else ADIO_IreadStrided(adio_fh, buf, count, datatype, file_ptr_type, - offset, request, &error_code); + offset, request, &error_code); fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio321/romio/mpi-io/iread_all.c b/ompi/mca/io/romio321/romio/mpi-io/iread_all.c new file mode 100644 index 0000000000..00a0640f5a --- /dev/null +++ b/ompi/mca/io/romio321/romio/mpi-io/iread_all.c @@ -0,0 +1,149 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "mpioimpl.h" + +#ifdef HAVE_WEAK_SYMBOLS + +#if defined(HAVE_PRAGMA_WEAK) +#pragma weak MPI_File_iread_all = PMPI_File_iread_all +#elif defined(HAVE_PRAGMA_HP_SEC_DEF) +#pragma _HP_SECONDARY_DEF PMPI_File_iread_all MPI_File_iread_all +#elif defined(HAVE_PRAGMA_CRI_DUP) +#pragma _CRI duplicate MPI_File_iread_all as PMPI_File_iread_all +/* end of weak pragmas */ +#elif defined(HAVE_WEAK_ATTRIBUTE) +int MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, + MPI_Request *request) + __attribute__((weak,alias("PMPI_File_iread_all"))); +#endif + +/* Include mapping from MPI->PMPI */ +#define MPIO_BUILD_PROFILING +#include "mpioprof.h" +#endif + +#if HAVE_MPI_GREQUEST +#include "mpiu_greq.h" +#endif + +/*@ + MPI_File_iread_all - Nonblocking collective read using individual file pointer + +Input Parameters: +. fh - file handle (handle) +. count - number of elements in buffer (nonnegative integer) +. datatype - datatype of each buffer element (handle) + +Output Parameters: +. buf - initial address of buffer (choice) +. request - request object (handle) + +.N fortran +@*/ +int MPI_File_iread_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) +{ + int error_code; + static char myname[] = "MPI_FILE_IREAD_ALL"; +#ifdef MPI_hpux + int fl_xmpi; + + HPMP_IO_START(fl_xmpi, BLKMPIFILEREADALL, TRDTBLOCK, fh, datatype, count); +#endif /* MPI_hpux */ + + error_code = MPIOI_File_iread_all(fh, (MPI_Offset)0, + ADIO_INDIVIDUAL, buf, + count, datatype, myname, request); + + /* --BEGIN ERROR HANDLING-- */ + if (error_code != MPI_SUCCESS) { + error_code = MPIO_Err_return_file(fh, error_code); + } + /* --END ERROR HANDLING-- */ + +#ifdef MPI_hpux + HPMP_IO_END(fl_xmpi, fh, datatype, count); +#endif /* MPI_hpux */ + + return error_code; +} + +/* Note: MPIOI_File_iread_all also used by MPI_File_iread_at_all */ +/* prevent multiple definitions of this routine */ +#ifdef MPIO_BUILD_PROFILING +int MPIOI_File_iread_all(MPI_File fh, + MPI_Offset offset, + int file_ptr_type, + void *buf, + int count, + MPI_Datatype datatype, + char *myname, + MPI_Request *request) +{ + int error_code; + MPI_Count datatype_size; + ADIO_File adio_fh; + void *xbuf=NULL, *e32_buf=NULL; + + ROMIO_THREAD_CS_ENTER(); + + adio_fh = MPIO_File_resolve(fh); + + /* --BEGIN ERROR HANDLING-- */ + MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); + MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); + MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); + + if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) { + error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, + myname, __LINE__, MPI_ERR_ARG, + "**iobadoffset", 0); + error_code = MPIO_Err_return_file(adio_fh, error_code); + goto fn_exit; + } + /* --END ERROR HANDLING-- */ + + MPI_Type_size_x(datatype, &datatype_size); + + /* --BEGIN ERROR HANDLING-- */ + MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); + MPIO_CHECK_READABLE(adio_fh, myname, error_code); + MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); + MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); + /* --END ERROR HANDLING-- */ + + xbuf = buf; + if (adio_fh->is_external32) { + MPI_Aint e32_size = 0; + error_code = MPIU_datatype_full_size(datatype, &e32_size); + if (error_code != MPI_SUCCESS) + goto fn_exit; + + e32_buf = ADIOI_Malloc(e32_size*count); + xbuf = e32_buf; + } + + ADIO_IreadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, + offset, request, &error_code); + + /* --BEGIN ERROR HANDLING-- */ + if (error_code != MPI_SUCCESS) + error_code = MPIO_Err_return_file(adio_fh, error_code); + /* --END ERROR HANDLING-- */ + + if (e32_buf != NULL) { + error_code = MPIU_read_external32_conversion_fn(buf, datatype, + count, e32_buf); + ADIOI_Free(e32_buf); + } + +fn_exit: + ROMIO_THREAD_CS_EXIT(); + + return error_code; +} +#endif diff --git a/ompi/mca/io/romio314/romio/mpi-io/iread_at.c b/ompi/mca/io/romio321/romio/mpi-io/iread_at.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/iread_at.c rename to ompi/mca/io/romio321/romio/mpi-io/iread_at.c index 29fd7cf31c..29bda8462f 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/iread_at.c +++ b/ompi/mca/io/romio321/romio/mpi-io/iread_at.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,7 +45,7 @@ Output Parameters: .N fortran @*/ -int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, +int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { int error_code; diff --git a/ompi/mca/io/romio321/romio/mpi-io/iread_atall.c b/ompi/mca/io/romio321/romio/mpi-io/iread_atall.c new file mode 100644 index 0000000000..da9326a5b0 --- /dev/null +++ b/ompi/mca/io/romio321/romio/mpi-io/iread_atall.c @@ -0,0 +1,74 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "mpioimpl.h" + +#ifdef HAVE_WEAK_SYMBOLS + +#if defined(HAVE_PRAGMA_WEAK) +#pragma weak MPI_File_iread_at_all = PMPI_File_iread_at_all +#elif defined(HAVE_PRAGMA_HP_SEC_DEF) +#pragma _HP_SECONDARY_DEF PMPI_File_iread_at_all MPI_File_iread_at_all +#elif defined(HAVE_PRAGMA_CRI_DUP) +#pragma _CRI duplicate MPI_File_iread_at_all as PMPI_File_iread_at_all +/* end of weak pragmas */ +#elif defined(HAVE_WEAK_ATTRIBUTE) +int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void * buf, int count, + MPI_Datatype datatype, MPI_Request *request) + __attribute__((weak,alias("PMPI_File_iread_at_all"))); +#endif + +/* Include mapping from MPI->PMPI */ +#define MPIO_BUILD_PROFILING +#include "mpioprof.h" +#endif + +#ifdef HAVE_MPI_GREQUEST +#include "mpiu_greq.h" +#endif + +/*@ + MPI_File_iread_at_all - Nonblocking collective read using explicit offset + +Input Parameters: +. fh - file handle (handle) +. offset - file offset (nonnegative integer) +. count - number of elements in buffer (nonnegative integer) +. datatype - datatype of each buffer element (handle) + +Output Parameters: +. buf - initial address of buffer (choice) +. request - request object (handle) + +.N fortran +@*/ +int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, + MPI_Request *request) +{ + int error_code; + static char myname[] = "MPI_FILE_IREAD_AT_ALL"; +#ifdef MPI_hpux + int fl_xmpi; + + HPMP_IO_START(fl_xmpi, BLKMPIFILEIREADATALL, TRDTBLOCK, fh, datatype, + count); +#endif /* MPI_hpux */ + + error_code = MPIOI_File_iread_all(fh, offset, ADIO_EXPLICIT_OFFSET, buf, + count, datatype, myname, request); + + /* --BEGIN ERROR HANDLING-- */ + if (error_code != MPI_SUCCESS) + error_code = MPIO_Err_return_file(fh, error_code); + /* --END ERROR HANDLING-- */ + +#ifdef MPI_hpux + HPMP_IO_END(fl_xmpi, fh, datatype, count); +#endif /* MPI_hpux */ + + return error_code; +} diff --git a/ompi/mca/io/romio314/romio/mpi-io/iread_sh.c b/ompi/mca/io/romio321/romio/mpi-io/iread_sh.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/iread_sh.c rename to ompi/mca/io/romio321/romio/mpi-io/iread_sh.c index ca1bc17a7c..bd64313059 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/iread_sh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/iread_sh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -55,7 +55,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count, ADIO_Offset off, shared_fp; MPI_Offset nbytes=0; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -110,7 +110,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count, } ADIO_ReadContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, &status, &error_code); + off, &status, &error_code); if (adio_fh->file_system != ADIO_NFS) { @@ -134,7 +134,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count, /* --END ERROR HANDLING-- */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } #endif diff --git a/ompi/mca/io/romio314/romio/mpi-io/iwrite.c b/ompi/mca/io/romio321/romio/mpi-io/iwrite.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/iwrite.c rename to ompi/mca/io/romio321/romio/mpi-io/iwrite.c index fc8dd44544..ae6c6aec59 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/iwrite.c +++ b/ompi/mca/io/romio321/romio/mpi-io/iwrite.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -90,7 +90,7 @@ int MPIOI_File_iwrite(MPI_File fh, ADIO_File adio_fh; MPI_Offset nbytes=0; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); /* --BEGIN ERROR HANDLING-- */ @@ -118,7 +118,7 @@ int MPIOI_File_iwrite(MPI_File fh, ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - + ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); if (buftype_is_contig && filetype_is_contig) { @@ -144,7 +144,7 @@ int MPIOI_File_iwrite(MPI_File fh, } ADIO_WriteContig(adio_fh, buf, count, datatype, file_ptr_type, off, - &status, &error_code); + &status, &error_code); if (ADIO_Feature(adio_fh, ADIO_LOCKS) ) { @@ -153,7 +153,7 @@ int MPIOI_File_iwrite(MPI_File fh, if (error_code == MPI_SUCCESS) { nbytes = count * datatype_size; } - + MPIO_Completed_request_create(&adio_fh, nbytes, &error_code, request); } } @@ -162,7 +162,7 @@ int MPIOI_File_iwrite(MPI_File fh, offset, request, &error_code); } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } #endif diff --git a/ompi/mca/io/romio321/romio/mpi-io/iwrite_all.c b/ompi/mca/io/romio321/romio/mpi-io/iwrite_all.c new file mode 100644 index 0000000000..9f486e700f --- /dev/null +++ b/ompi/mca/io/romio321/romio/mpi-io/iwrite_all.c @@ -0,0 +1,138 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "mpioimpl.h" + +#ifdef HAVE_WEAK_SYMBOLS + +#if defined(HAVE_PRAGMA_WEAK) +#pragma weak MPI_File_iwrite_all = PMPI_File_iwrite_all +#elif defined(HAVE_PRAGMA_HP_SEC_DEF) +#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_all MPI_File_iwrite_all +#elif defined(HAVE_PRAGMA_CRI_DUP) +#pragma _CRI duplicate MPI_File_iwrite_all as PMPI_File_iwrite_all +/* end of weak pragmas */ +#elif defined(HAVE_WEAK_ATTRIBUTE) +int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, + MPI_Request *request) + __attribute__((weak,alias("PMPI_File_iwrite_all"))); +#endif + +/* Include mapping from MPI->PMPI */ +#define MPIO_BUILD_PROFILING +#include "mpioprof.h" +#endif + +#ifdef HAVE_MPI_GREQUEST +#include "mpiu_greq.h" +#endif + +/*@ + MPI_File_iwrite_all - Nonblocking collective write using individual file pointer + +Input Parameters: +. fh - file handle (handle) +. buf - initial address of buffer (choice) +. count - number of elements in buffer (nonnegative integer) +. datatype - datatype of each buffer element (handle) + +Output Parameters: +. request - request object (handle) + +.N fortran +@*/ +int MPI_File_iwrite_all(MPI_File fh, ROMIO_CONST void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) +{ + int error_code; + static char myname[] = "MPI_FILE_IWRITE_ALL"; +#ifdef MPI_hpux + int fl_xmpi; + + HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEALL, TRDTBLOCK, fh, datatype, count); +#endif /* MPI_hpux */ + + error_code = MPIOI_File_iwrite_all(fh, (MPI_Offset) 0, + ADIO_INDIVIDUAL, buf, + count, datatype, myname, request); + +#ifdef MPI_hpux + HPMP_IO_END(fl_xmpi, fh, datatype, count); +#endif /* MPI_hpux */ + + return error_code; +} + +/* Note: MPIOI_File_iwrite_all also used by MPI_File_iwrite_at_all */ +/* prevent multiple definitions of this routine */ +#ifdef MPIO_BUILD_PROFILING +int MPIOI_File_iwrite_all(MPI_File fh, + MPI_Offset offset, + int file_ptr_type, + const void *buf, + int count, + MPI_Datatype datatype, + char *myname, + MPI_Request *request) +{ + int error_code; + MPI_Count datatype_size; + ADIO_File adio_fh; + void *e32buf=NULL; + const void *xbuf=NULL; + + ROMIO_THREAD_CS_ENTER(); + + adio_fh = MPIO_File_resolve(fh); + + /* --BEGIN ERROR HANDLING-- */ + MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); + MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); + MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); + + if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) + { + error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, + myname, __LINE__, MPI_ERR_ARG, + "**iobadoffset", 0); + error_code = MPIO_Err_return_file(adio_fh, error_code); + goto fn_exit; + } + /* --END ERROR HANDLING-- */ + + MPI_Type_size_x(datatype, &datatype_size); + + /* --BEGIN ERROR HANDLING-- */ + MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); + MPIO_CHECK_WRITABLE(adio_fh, myname, error_code); + MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); + MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); + /* --END ERROR HANDLING-- */ + + xbuf = buf; + if (adio_fh->is_external32) { + error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); + if (error_code != MPI_SUCCESS) + goto fn_exit; + + xbuf = e32buf; + } + + ADIO_IwriteStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, + offset, request, &error_code); + + /* --BEGIN ERROR HANDLING-- */ + if (error_code != MPI_SUCCESS) + error_code = MPIO_Err_return_file(adio_fh, error_code); + /* --END ERROR HANDLING-- */ + +fn_exit: + if (e32buf != NULL) ADIOI_Free(e32buf); + ROMIO_THREAD_CS_EXIT(); + + return error_code; +} +#endif diff --git a/ompi/mca/io/romio314/romio/mpi-io/iwrite_at.c b/ompi/mca/io/romio321/romio/mpi-io/iwrite_at.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/iwrite_at.c rename to ompi/mca/io/romio321/romio/mpi-io/iwrite_at.c index ee53675423..10862bd033 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/iwrite_at.c +++ b/ompi/mca/io/romio321/romio/mpi-io/iwrite_at.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -47,7 +47,7 @@ Output Parameters: #endif int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPIO_Request *request) { int error_code; diff --git a/ompi/mca/io/romio321/romio/mpi-io/iwrite_atall.c b/ompi/mca/io/romio321/romio/mpi-io/iwrite_atall.c new file mode 100644 index 0000000000..9c0564efd8 --- /dev/null +++ b/ompi/mca/io/romio321/romio/mpi-io/iwrite_atall.c @@ -0,0 +1,68 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include "mpioimpl.h" + +#ifdef HAVE_WEAK_SYMBOLS + +#if defined(HAVE_PRAGMA_WEAK) +#pragma weak MPI_File_iwrite_at_all = PMPI_File_iwrite_at_all +#elif defined(HAVE_PRAGMA_HP_SEC_DEF) +#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_at_all MPI_File_iwrite_at_all +#elif defined(HAVE_PRAGMA_CRI_DUP) +#pragma _CRI duplicate MPI_File_iwrite_at_all as PMPI_File_iwrite_at_all +/* end of weak pragmas */ +#elif defined(HAVE_WEAK_ATTRIBUTE) +int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) + __attribute__((weak,alias("PMPI_File_iwrite_at_all"))); +#endif + +/* Include mapping from MPI->PMPI */ +#define MPIO_BUILD_PROFILING +#include "mpioprof.h" +#endif + +#ifdef HAVE_MPI_GREQUEST +#include "mpiu_greq.h" +#endif + +/*@ + MPI_File_iwrite_at_all - Nonblocking collective write using explicit offset + +Input Parameters: +. fh - file handle (handle) +. offset - file offset (nonnegative integer) +. buf - initial address of buffer (choice) +. count - number of elements in buffer (nonnegative integer) +. datatype - datatype of each buffer element (handle) + +Output Parameters: +. request - request object (handle) + +.N fortran +@*/ +int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, + int count, MPI_Datatype datatype, + MPI_Request *request) +{ + int error_code; + static char myname[] = "MPI_FILE_IWRITE_AT_ALL"; +#ifdef MPI_hpux + int fl_xmpi; + + HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEATALL, TRDTBLOCK, fh, datatype, count); +#endif /* MPI_hpux */ + + error_code = MPIOI_File_iwrite_all(fh, offset, ADIO_EXPLICIT_OFFSET, + buf, count, datatype, myname, request); + +#ifdef MPI_hpux + HPMP_IO_END(fl_xmpi, fh, datatype, count); +#endif /* MPI_hpux */ + return error_code; +} + diff --git a/ompi/mca/io/romio314/romio/mpi-io/iwrite_sh.c b/ompi/mca/io/romio321/romio/mpi-io/iwrite_sh.c similarity index 93% rename from ompi/mca/io/romio314/romio/mpi-io/iwrite_sh.c rename to ompi/mca/io/romio321/romio/mpi-io/iwrite_sh.c index 458202d5ac..3f9612a789 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/iwrite_sh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/iwrite_sh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -55,7 +55,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count, ADIO_Offset off, shared_fp; static char myname[] = "MPI_FILE_IWRITE_SHARED"; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -92,7 +92,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count, off = adio_fh->disp + adio_fh->etype_size * shared_fp; if (!(adio_fh->atomicity)) ADIO_IwriteContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, request, &error_code); + off, request, &error_code); else { /* to maintain strict atomicity semantics with other concurrent operations, lock (exclusive) and call blocking routine */ @@ -101,7 +101,7 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count, ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); ADIO_WriteContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, &status, &error_code); + off, &status, &error_code); if (adio_fh->file_system != ADIO_NFS) ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); @@ -111,10 +111,10 @@ int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count, } else ADIO_IwriteStrided(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, request, &error_code); + shared_fp, request, &error_code); fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpich_fileutil.c b/ompi/mca/io/romio321/romio/mpi-io/mpich_fileutil.c similarity index 91% rename from ompi/mca/io/romio314/romio/mpi-io/mpich_fileutil.c rename to ompi/mca/io/romio321/romio/mpi-io/mpich_fileutil.c index 7f35430c70..b853b588fa 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/mpich_fileutil.c +++ b/ompi/mca/io/romio321/romio/mpi-io/mpich_fileutil.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -14,13 +14,13 @@ */ int MPIR_ROMIO_Get_file_errhand( MPI_File, MPI_Errhandler * ); int MPIR_ROMIO_Set_file_errhand( MPI_File, MPI_Errhandler ); -void MPIR_Get_file_error_routine( MPI_Errhandler, - void (**)(MPI_File *, int *, ...), +void MPIR_Get_file_error_routine( MPI_Errhandler, + void (**)(MPI_File *, int *, ...), int * ); /* These next two routines are used to allow MPICH to access/set the error handers in the MPI_File structure until MPICH knows about the - file structure, and to handle the errhandler structure, which + file structure, and to handle the errhandler structure, which includes a reference count. Not currently used. */ int MPIR_ROMIO_Set_file_errhand( MPI_File file_ptr, MPI_Errhandler e ) { @@ -30,7 +30,7 @@ int MPIR_ROMIO_Set_file_errhand( MPI_File file_ptr, MPI_Errhandler e ) return MPI_ERR_FILE; } /* --END ERROR HANDLING-- */ - else + else file_ptr->err_handler = e; return 0; } @@ -49,7 +49,7 @@ int MPIR_ROMIO_Get_file_errhand( MPI_File file_ptr, MPI_Errhandler *e ) } /* --END ERROR HANDLING-- */ else { - if (file_ptr->err_handler == MPI_ERRORS_RETURN) + if (file_ptr->err_handler == MPI_ERRORS_RETURN) *e = 0; else *e = file_ptr->err_handler; diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h b/ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h similarity index 64% rename from ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h rename to ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h index ff1372394b..7c5f0eb394 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h +++ b/ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h @@ -1,13 +1,13 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ /* header file for MPI-IO implementation. not intended to be - user-visible */ + user-visible */ #ifndef MPIOIMPL_INCLUDE #define MPIOIMPL_INCLUDE @@ -18,10 +18,9 @@ #ifdef ROMIO_INSIDE_MPICH #include "glue_romio.h" -#define MPIU_THREAD_CS_ENTER(name_,ctx_) MPIU_THREAD_CS_ENTER_##name_(ctx_) -#define MPIU_THREAD_CS_EXIT(name_,ctx_) MPIU_THREAD_CS_EXIT_##name_(ctx_) -#define MPIU_THREAD_CS_ENTER_ALLFUNC(ctx_) MPIR_Ext_cs_enter_allfunc() -#define MPIU_THREAD_CS_EXIT_ALLFUNC(ctx_) MPIR_Ext_cs_exit_allfunc() +#define ROMIO_THREAD_CS_ENTER() MPIR_Ext_cs_enter() +#define ROMIO_THREAD_CS_EXIT() MPIR_Ext_cs_exit() +#define ROMIO_THREAD_CS_YIELD() MPIR_Ext_cs_yield() /* committed datatype checking support in ROMIO */ #define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) \ @@ -31,17 +30,13 @@ #else /* not ROMIO_INSIDE_MPICH */ /* Any MPI implementation that wishes to follow the thread-safety and - error reporting features provided by MPICH must implement these - four functions. Defining these as empty should not change the behavior + error reporting features provided by MPICH must implement these + four functions. Defining these as empty should not change the behavior of correct programs */ -#define MPIU_THREAD_CS_ENTER(x,y) -#define MPIU_THREAD_CS_EXIT(x,y) -/* The MPI_DATATYPE_ISCOMMITTED macro now always sets err_=0. - This is an optimistic approach for Open MPI, but it is likely other - upper layers already checked the datatype was committed. - Not setting err_ is incorrect since it can lead to use of - uninitialized variable.*/ -#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do { err_ = 0; } while (0) +#define ROMIO_THREAD_CS_ENTER() +#define ROMIO_THREAD_CS_EXIT() +#define ROMIO_THREAD_CS_YIELD() +#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do {} while (0) #ifdef HAVE_WINDOWS_H #define MPIU_UNREFERENCED_ARG(a) a #else diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpioprof.h b/ompi/mca/io/romio321/romio/mpi-io/mpioprof.h similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/mpioprof.h rename to ompi/mca/io/romio321/romio/mpi-io/mpioprof.h index 672642028b..c74413d1e8 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/mpioprof.h +++ b/ompi/mca/io/romio321/romio/mpi-io/mpioprof.h @@ -1,12 +1,12 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ -/* - This header file converts all MPI_ names into PMPI_ names, for +/* + This header file converts all MPI_ names into PMPI_ names, for building the profiling interface */ @@ -63,7 +63,7 @@ #undef MPI_File_read #define MPI_File_read PMPI_File_read #undef MPI_File_read_all -#define MPI_File_read_all PMPI_File_read_all +#define MPI_File_read_all PMPI_File_read_all #undef MPI_File_write #define MPI_File_write PMPI_File_write #undef MPI_File_write_all @@ -79,6 +79,15 @@ #undef MPI_File_get_byte_offset #define MPI_File_get_byte_offset PMPI_File_get_byte_offset +#undef MPI_File_iread_at_all +#define MPI_File_iread_at_all PMPI_File_iread_at_all +#undef MPI_File_iwrite_at_all +#define MPI_File_iwrite_at_all PMPI_File_iwrite_at_all +#undef MPI_File_iread_all +#define MPI_File_iread_all PMPI_File_iread_all +#undef MPI_File_iwrite_all +#define MPI_File_iwrite_all PMPI_File_iwrite_all + #undef MPI_File_read_shared #define MPI_File_read_shared PMPI_File_read_shared #undef MPI_File_write_shared diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c b/ompi/mca/io/romio321/romio/mpi-io/mpir-mpioinit.c similarity index 88% rename from ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c rename to ompi/mca/io/romio321/romio/mpi-io/mpir-mpioinit.c index 50d9d4e08e..90a2739a21 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/mpir-mpioinit.c +++ b/ompi/mca/io/romio321/romio/mpi-io/mpir-mpioinit.c @@ -3,8 +3,8 @@ * (C) 2009 UChicago/Argonne LLC * See COPYRIGHT in top-level directory. */ -#include #include "mpioimpl.h" +#include #ifdef HAVE_WEAK_SYMBOLS /* Include mapping from MPI->PMPI */ @@ -28,8 +28,8 @@ void MPIR_MPIOInit(int * error_code) { /* --BEGIN ERROR HANDLING-- */ if (!flag) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, + *error_code = MPIO_Err_create_code(MPI_SUCCESS, + MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_OTHER, "**initialized", 0); *error_code = MPIO_Err_return_file(MPI_FILE_NULL, *error_code); return; @@ -37,7 +37,7 @@ void MPIR_MPIOInit(int * error_code) { /* --END ERROR HANDLING-- */ MPI_Comm_create_keyval (MPI_COMM_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval, - (void *) 0); + (void *) 0); /* put a dummy attribute on MPI_COMM_SELF, because we want the delete function to be called when MPI_COMM_SELF is freed. Clarified @@ -51,6 +51,6 @@ void MPIR_MPIOInit(int * error_code) { } *error_code = MPI_SUCCESS; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpiu_external32.c b/ompi/mca/io/romio321/romio/mpi-io/mpiu_external32.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/mpiu_external32.c rename to ompi/mca/io/romio321/romio/mpi-io/mpiu_external32.c index 39b4949f58..8a8254cbb8 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/mpiu_external32.c +++ b/ompi/mca/io/romio321/romio/mpi-io/mpiu_external32.c @@ -41,7 +41,7 @@ int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datat else { void *tmp_buf = NULL; - tmp_buf = ADIOI_Malloc(bytes); + tmp_buf = ADIOI_Malloc(bytes); if (!tmp_buf) { mpi_errno = MPI_ERR_NO_MEM; @@ -99,7 +99,7 @@ int MPIU_read_external32_conversion_fn(void *userbuf, MPI_Datatype datatype, else { void *tmp_buf = NULL; - tmp_buf = ADIOI_Malloc(bytes); + tmp_buf = ADIOI_Malloc(bytes); if (!tmp_buf) { mpi_errno = MPI_ERR_NO_MEM; @@ -160,13 +160,13 @@ int MPIU_external32_buffer_setup(const void * buf, int count, MPI_Datatype type, error_code = MPIU_write_external32_conversion_fn(buf, type, count, *newbuf); if (error_code != MPI_SUCCESS) { - ADIOI_Free(newbuf); + ADIOI_Free(*newbuf); return error_code; } return MPI_SUCCESS; } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpiu_greq.c b/ompi/mca/io/romio321/romio/mpi-io/mpiu_greq.c similarity index 99% rename from ompi/mca/io/romio314/romio/mpi-io/mpiu_greq.c rename to ompi/mca/io/romio321/romio/mpi-io/mpiu_greq.c index 77589e0ea4..ad1e4d2582 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/mpiu_greq.c +++ b/ompi/mca/io/romio321/romio/mpi-io/mpiu_greq.c @@ -3,10 +3,10 @@ * (C) 2003 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ -#include #include "mpioimpl.h" #include "mpiu_greq.h" +#include #ifdef HAVE_WEAK_SYMBOLS /* Include mapping from MPI->PMPI */ #define MPIO_BUILD_PROFILING @@ -36,7 +36,7 @@ int MPIU_Greq_free_fn(void *extra_state) { /* frees the memory allocated in MPIO_Completed_request_create */ ADIOI_Free(extra_state); - + return MPI_SUCCESS; } int MPIU_Greq_cancel_fn(void *extra_state, int complete) diff --git a/ompi/mca/io/romio314/romio/mpi-io/open.c b/ompi/mca/io/romio321/romio/mpi-io/open.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/open.c rename to ompi/mca/io/romio321/romio/mpi-io/open.c index 4174dad10e..7cebb5abc7 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/open.c +++ b/ompi/mca/io/romio321/romio/mpi-io/open.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -59,7 +59,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, HPMP_IO_OPEN_START(fl_xmpi, comm); #endif /* MPI_hpux */ - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); /* --BEGIN ERROR HANDLING-- */ MPIO_CHECK_COMM(comm, myname, error_code); @@ -71,7 +71,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, if (error_code || flag) { error_code = MPIO_Err_create_code(error_code, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_COMM, + myname, __LINE__, MPI_ERR_COMM, "**commnotintra", 0); goto fn_fail; } @@ -80,16 +80,16 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, ((amode&MPI_MODE_WRONLY)?1:0) != 1 ) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_AMODE, + myname, __LINE__, MPI_ERR_AMODE, "**fileamodeone", 0); goto fn_fail; } - if ((amode & MPI_MODE_RDONLY) && + if ((amode & MPI_MODE_RDONLY) && ((amode & MPI_MODE_CREATE) || (amode & MPI_MODE_EXCL))) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_AMODE, + myname, __LINE__, MPI_ERR_AMODE, "**fileamoderead", 0); goto fn_fail; } @@ -97,7 +97,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, if ((amode & MPI_MODE_RDWR) && (amode & MPI_MODE_SEQUENTIAL)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_AMODE, + myname, __LINE__, MPI_ERR_AMODE, "**fileamodeseq", 0); goto fn_fail; } @@ -132,7 +132,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, if (error_code != MPI_SUCCESS) { /* ADIO_ResolveFileType() will print as informative a message as it - * possibly can or call MPIO_Err_setmsg. We just need to propagate + * possibly can or call MPIO_Err_setmsg. We just need to propagate * the error up. */ goto fn_fail; @@ -149,7 +149,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, filename = tmp + 1; } -/* use default values for disp, etype, filetype */ +/* use default values for disp, etype, filetype */ *fh = ADIO_Open(comm, dupcomm, filename, file_system, fsops, amode, 0, MPI_BYTE, MPI_BYTE, info, ADIO_PERM_NULL, &error_code); @@ -163,10 +163,10 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, /* if MPI_MODE_SEQUENTIAL requested, file systems cannot do explicit offset * or independent file pointer accesses, leaving not much else aside from * shared file pointer accesses. */ - if ( !ADIO_Feature((*fh), ADIO_SHARED_FP) && (amode & MPI_MODE_SEQUENTIAL)) + if ( !ADIO_Feature((*fh), ADIO_SHARED_FP) && (amode & MPI_MODE_SEQUENTIAL)) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, + error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, + myname, __LINE__, MPI_ERR_UNSUPPORTED_OPERATION, "**iosequnsupported", 0); ADIO_Close(*fh, &error_code); @@ -176,7 +176,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, /* determine name of file that will hold the shared file pointer */ /* can't support shared file pointers on a file system that doesn't support file locking. */ - if ((error_code == MPI_SUCCESS) && + if ((error_code == MPI_SUCCESS) && ADIO_Feature((*fh), ADIO_SHARED_FP)) { MPI_Comm_rank(dupcomm, &rank); ADIOI_Shfp_fname(*fh, rank, &error_code); @@ -184,7 +184,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, goto fn_fail; /* if MPI_MODE_APPEND, set the shared file pointer to end of file. - indiv. file pointer already set to end of file in ADIO_Open. + indiv. file pointer already set to end of file in ADIO_Open. Here file view is just bytes. */ if ((*fh)->access_mode & MPI_MODE_APPEND) { if (rank == (*fh)->hints->ranklist[0]) /* only one person need set the sharedfp */ @@ -198,7 +198,7 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, #endif /* MPI_hpux */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; fn_fail: /* --BEGIN ERROR HANDLING-- */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/prealloc.c b/ompi/mca/io/romio321/romio/mpi-io/prealloc.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/prealloc.c rename to ompi/mca/io/romio321/romio/mpi-io/prealloc.c index e1cf7f91fd..1542e47a5d 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/prealloc.c +++ b/ompi/mca/io/romio321/romio/mpi-io/prealloc.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -48,7 +48,7 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size) adio_fh, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -92,14 +92,14 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size) /* --END ERROR HANDLING-- */ } MPI_Barrier(adio_fh->comm); - + #ifdef MPI_hpux HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); /* TODO: bcast result? */ if (!mynod) return error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/rd_atallb.c b/ompi/mca/io/romio321/romio/mpi-io/rd_atallb.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/rd_atallb.c rename to ompi/mca/io/romio321/romio/mpi-io/rd_atallb.c index c6cc5e5cd5..a7120b3da2 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/rd_atallb.c +++ b/ompi/mca/io/romio321/romio/mpi-io/rd_atallb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/rd_atalle.c b/ompi/mca/io/romio321/romio/mpi-io/rd_atalle.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/rd_atalle.c rename to ompi/mca/io/romio321/romio/mpi-io/rd_atalle.c index 69eafa21b7..207d5ba369 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/rd_atalle.c +++ b/ompi/mca/io/romio321/romio/mpi-io/rd_atalle.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/read.c b/ompi/mca/io/romio321/romio/mpi-io/read.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/read.c rename to ompi/mca/io/romio321/romio/mpi-io/read.c index cff5a32317..6f12914893 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -79,7 +79,7 @@ int MPIOI_File_read(MPI_File fh, ADIO_Offset off, bufsize; void *xbuf=NULL, *e32_buf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -155,7 +155,7 @@ int MPIOI_File_read(MPI_File fh, } ADIO_ReadContig(adio_fh, xbuf, count, datatype, file_ptr_type, - off, status, &error_code); + off, status, &error_code); if ((adio_fh->atomicity) && ADIO_Feature(adio_fh, ADIO_LOCKS)) { ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); @@ -180,7 +180,7 @@ int MPIOI_File_read(MPI_File fh, } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_all.c b/ompi/mca/io/romio321/romio/mpi-io/read_all.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/read_all.c rename to ompi/mca/io/romio321/romio/mpi-io/read_all.c index 0761e454f8..efce7832b7 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_all.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_all.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -80,7 +80,7 @@ int MPIOI_File_read_all(MPI_File fh, ADIO_File adio_fh; void *xbuf=NULL, *e32_buf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -129,13 +129,13 @@ int MPIOI_File_read_all(MPI_File fh, /* --END ERROR HANDLING-- */ if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(xbuf, datatype, + error_code = MPIU_read_external32_conversion_fn(buf, datatype, count, e32_buf); ADIOI_Free(e32_buf); } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_allb.c b/ompi/mca/io/romio321/romio/mpi-io/read_allb.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/read_allb.c rename to ompi/mca/io/romio321/romio/mpi-io/read_allb.c index 3bc0304f06..ae1053b151 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_allb.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_allb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -67,7 +67,7 @@ int MPIOI_File_read_all_begin(MPI_File fh, ADIO_File adio_fh; void *xbuf=NULL, *e32_buf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -85,7 +85,7 @@ int MPIOI_File_read_all_begin(MPI_File fh, goto fn_exit; } /* --END ERROR HANDLING-- */ - + MPI_Type_size_x(datatype, &datatype_size); /* --BEGIN ERROR HANDLING-- */ @@ -95,7 +95,7 @@ int MPIOI_File_read_all_begin(MPI_File fh, if (adio_fh->split_coll_count) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcoll", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -126,13 +126,13 @@ int MPIOI_File_read_all_begin(MPI_File fh, /* --END ERROR HANDLING-- */ if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(xbuf, datatype, + error_code = MPIU_read_external32_conversion_fn(buf, datatype, count, e32_buf); ADIOI_Free(e32_buf); } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_alle.c b/ompi/mca/io/romio321/romio/mpi-io/read_alle.c similarity index 93% rename from ompi/mca/io/romio314/romio/mpi-io/read_alle.c rename to ompi/mca/io/romio321/romio/mpi-io/read_alle.c index 823f815da5..e2853c13dd 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_alle.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_alle.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -60,7 +60,7 @@ int MPIOI_File_read_all_end(MPI_File fh, MPIU_UNREFERENCED_ARG(buf); - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -69,7 +69,7 @@ int MPIOI_File_read_all_end(MPI_File fh, if (!(adio_fh->split_coll_count)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcollnone", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -83,7 +83,7 @@ int MPIOI_File_read_all_end(MPI_File fh, adio_fh->split_coll_count = 0; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_at.c b/ompi/mca/io/romio321/romio/mpi-io/read_at.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/read_at.c rename to ompi/mca/io/romio321/romio/mpi-io/read_at.c index 732741ba53..53dc8c42e3 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_at.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_at.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_atall.c b/ompi/mca/io/romio321/romio/mpi-io/read_atall.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/read_atall.c rename to ompi/mca/io/romio321/romio/mpi-io/read_atall.c index 17efe4f2ae..2bed66be4d 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_atall.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_atall.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,7 +45,7 @@ Output Parameters: .N fortran @*/ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { int error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_ord.c b/ompi/mca/io/romio321/romio/mpi-io/read_ord.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/read_ord.c rename to ompi/mca/io/romio321/romio/mpi-io/read_ord.c index 9bcc598110..be877633c8 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_ord.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_ord.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -53,7 +53,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count, ADIO_Offset shared_fp=0; ADIO_File adio_fh; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -77,7 +77,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Comm_rank(adio_fh->comm, &myrank); incr = (count*datatype_size)/adio_fh->etype_size; - + /* Use a message as a 'token' to order the operations */ source = myrank - 1; dest = myrank + 1; @@ -104,7 +104,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count, /* --END ERROR HANDLING-- */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); /* FIXME: Check for error code from ReadStridedColl? */ return error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_ordb.c b/ompi/mca/io/romio321/romio/mpi-io/read_ordb.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/read_ordb.c rename to ompi/mca/io/romio321/romio/mpi-io/read_ordb.c index f3019ed766..050934b731 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_ordb.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_ordb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -50,7 +50,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, static char myname[] = "MPI_FILE_READ_ORDERED_BEGIN"; void *xbuf=NULL, *e32_buf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -62,7 +62,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, if (adio_fh->split_coll_count) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcoll", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -125,13 +125,13 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, /* --END ERROR HANDLING-- */ if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(xbuf, datatype, + error_code = MPIU_read_external32_conversion_fn(buf, datatype, count, e32_buf); ADIOI_Free(e32_buf); } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_orde.c b/ompi/mca/io/romio321/romio/mpi-io/read_orde.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/read_orde.c rename to ompi/mca/io/romio321/romio/mpi-io/read_orde.c index 88a5a88e64..542f687bc2 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_orde.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_orde.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,7 +45,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) MPIU_UNREFERENCED_ARG(buf); - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -55,7 +55,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) if (!(adio_fh->split_coll_count)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcollnone", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -69,7 +69,7 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) adio_fh->split_coll_count = 0; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/read_sh.c b/ompi/mca/io/romio321/romio/mpi-io/read_sh.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/read_sh.c rename to ompi/mca/io/romio321/romio/mpi-io/read_sh.c index 288593261d..83c29daa7e 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/read_sh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/read_sh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -52,7 +52,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count, ADIO_File adio_fh; void *xbuf=NULL, *e32_buf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -119,14 +119,14 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count, off = adio_fh->disp + adio_fh->etype_size * shared_fp; /* if atomic mode requested, lock (exclusive) the region, because there - could be a concurrent noncontiguous request. On NFS, locking + could be a concurrent noncontiguous request. On NFS, locking is done in the ADIO_ReadContig.*/ if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); ADIO_ReadContig(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, status, &error_code); + off, status, &error_code); if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); @@ -144,12 +144,12 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count, /* --END ERROR HANDLING-- */ if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(xbuf, datatype, + error_code = MPIU_read_external32_conversion_fn(buf, datatype, count, e32_buf); ADIOI_Free(e32_buf); } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/register_datarep.c b/ompi/mca/io/romio321/romio/mpi-io/register_datarep.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/register_datarep.c rename to ompi/mca/io/romio321/romio/mpi-io/register_datarep.c index a0a4df14f6..3895872332 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/register_datarep.c +++ b/ompi/mca/io/romio321/romio/mpi-io/register_datarep.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -28,7 +28,7 @@ int MPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *r #endif /*@ - MPI_Register_datarep - Register functions for user-defined data + MPI_Register_datarep - Register functions for user-defined data representations Input Parameters: @@ -45,12 +45,12 @@ Input Parameters: Notes: This function allows the user to provide routines to convert data from an external representation, used within a file, and the native representation, - used within the CPU. There is one predefined data representation, + used within the CPU. There is one predefined data representation, 'external32'. Please consult the MPI-2 standard for details on this function. .N fortran - + @*/ int MPI_Register_datarep(ROMIO_CONST char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, @@ -62,7 +62,7 @@ int MPI_Register_datarep(ROMIO_CONST char *datarep, ADIOI_Datarep *adio_datarep; static char myname[] = "MPI_REGISTER_DATAREP"; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); /* --BEGIN ERROR HANDLING-- */ /* check datarep name (use strlen instead of strnlen because @@ -139,7 +139,7 @@ int MPI_Register_datarep(ROMIO_CONST char *datarep, error_code = MPI_SUCCESS; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/seek.c b/ompi/mca/io/romio321/romio/mpi-io/seek.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/seek.c rename to ompi/mca/io/romio321/romio/mpi-io/seek.c index a9e92569ce..c68394a18a 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/seek.c +++ b/ompi/mca/io/romio321/romio/mpi-io/seek.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -49,7 +49,7 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) HPMP_IO_START(fl_xmpi, BLKMPIFILESEEK, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -134,6 +134,6 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) error_code = MPI_SUCCESS; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/seek_sh.c b/ompi/mca/io/romio321/romio/mpi-io/seek_sh.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/seek_sh.c rename to ompi/mca/io/romio321/romio/mpi-io/seek_sh.c index 17320da866..d3ce1ab8aa 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/seek_sh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/seek_sh.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,7 +41,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) MPI_Offset curr_offset, eof_offset, tmp_offset; ADIO_File adio_fh; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -108,7 +108,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, myname, __LINE__, - MPI_ERR_INTERN, + MPI_ERR_INTERN, "**iosharedfailed", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -163,7 +163,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, myname, __LINE__, - MPI_ERR_INTERN, + MPI_ERR_INTERN, "**iosharedfailed", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -178,7 +178,7 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) error_code = MPI_SUCCESS; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/set_atom.c b/ompi/mca/io/romio321/romio/mpi-io/set_atom.c similarity index 93% rename from ompi/mca/io/romio314/romio/mpi-io/set_atom.c rename to ompi/mca/io/romio321/romio/mpi-io/set_atom.c index 246b5d7fed..00be9fc35b 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/set_atom.c +++ b/ompi/mca/io/romio321/romio/mpi-io/set_atom.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -41,7 +41,7 @@ int MPI_File_set_atomicity(MPI_File fh, int flag) ADIO_Fcntl_t *fcntl_struct; ADIO_File adio_fh; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -60,7 +60,7 @@ int MPI_File_set_atomicity(MPI_File fh, int flag) /* --BEGIN ERROR HANDLING-- */ if (tmp_flag != flag) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, + myname, __LINE__, MPI_ERR_ARG, "**notsame", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -86,6 +86,6 @@ int MPI_File_set_atomicity(MPI_File fh, int flag) ADIOI_Free(fcntl_struct); fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/set_errh.c b/ompi/mca/io/romio321/romio/mpi-io/set_errh.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/set_errh.c rename to ompi/mca/io/romio321/romio/mpi-io/set_errh.c index a591dde64b..d943787e35 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/set_errh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/set_errh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -40,9 +40,9 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler) int error_code = MPI_SUCCESS; static char myname[] = "MPI_FILE_SET_ERRHANDLER"; ADIO_File fh; - MPIU_THREADPRIV_DECL; + MPID_THREADPRIV_DECL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); if (mpi_fh == MPI_FILE_NULL) { ADIOI_DFLT_ERR_HANDLER = errhandler; @@ -71,6 +71,6 @@ int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler) } fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/set_info.c b/ompi/mca/io/romio321/romio/mpi-io/set_info.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/set_info.c rename to ompi/mca/io/romio321/romio/mpi-io/set_info.c index a57a88f3e2..2c898fe85a 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/set_info.c +++ b/ompi/mca/io/romio321/romio/mpi-io/set_info.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -40,7 +40,7 @@ int MPI_File_set_info(MPI_File fh, MPI_Info info) static char myname[] = "MPI_FILE_SET_INFO"; ADIO_File adio_fh; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -58,7 +58,7 @@ fn_exit: error_code = MPIO_Err_return_file(adio_fh, error_code); /* --END ERROR HANDLING-- */ - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; fn_fail: diff --git a/ompi/mca/io/romio314/romio/mpi-io/set_size.c b/ompi/mca/io/romio321/romio/mpi-io/set_size.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/set_size.c rename to ompi/mca/io/romio321/romio/mpi-io/set_size.c index b76b903062..b658929576 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/set_size.c +++ b/ompi/mca/io/romio321/romio/mpi-io/set_size.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -48,7 +48,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size) MPI_DATATYPE_NULL, -1); #endif /* MPI_hpux */ - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -88,7 +88,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size) ADIO_Resize(adio_fh, size, &error_code); /* TODO: what to do with error code? */ - + /* --BEGIN ERROR HANDLING-- */ if (error_code != MPI_SUCCESS) error_code = MPIO_Err_return_file(adio_fh, error_code); @@ -99,7 +99,7 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size) #endif /* MPI_hpux */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/set_view.c b/ompi/mca/io/romio321/romio/mpi-io/set_view.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/set_view.c rename to ompi/mca/io/romio321/romio/mpi-io/set_view.c index ce1dc9b0c3..4d98fdd184 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/set_view.c +++ b/ompi/mca/io/romio321/romio/mpi-io/set_view.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -48,7 +48,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, ADIO_Offset shared_fp, byte_off; ADIO_File adio_fh; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -58,7 +58,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, if ((disp < 0) && (disp != MPI_DISPLACEMENT_CURRENT)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, + myname, __LINE__, MPI_ERR_ARG, "**iobaddisp", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -95,7 +95,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, (disp != MPI_DISPLACEMENT_CURRENT)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, + myname, __LINE__, MPI_ERR_ARG, "**iodispifseq", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -105,7 +105,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, !(adio_fh->access_mode & MPI_MODE_SEQUENTIAL)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, + myname, __LINE__, MPI_ERR_ARG, "**iodispifseq", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -135,7 +135,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_UNSUPPORTED_DATAREP, + MPI_ERR_UNSUPPORTED_DATAREP, "**unsupporteddatarep",0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -167,11 +167,11 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, if (ADIO_Feature(adio_fh, ADIO_SHARED_FP) && (adio_fh->shared_fp_fd != ADIO_FILE_NULL)) { - /* only one process needs to set it to zero, but I don't want to - create the shared-file-pointer file if shared file pointers have - not been used so far. Therefore, every process that has already - opened the shared-file-pointer file sets the shared file pointer - to zero. If the file was not opened, the value is automatically + /* only one process needs to set it to zero, but I don't want to + create the shared-file-pointer file if shared file pointers have + not been used so far. Therefore, every process that has already + opened the shared-file-pointer file sets the shared file pointer + to zero. If the file was not opened, the value is automatically zero. Note that shared file pointer is stored as no. of etypes relative to the current view, whereas indiv. file pointer is stored in bytes. */ @@ -193,7 +193,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, adio_fh->is_external32 = 1; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; fn_fail: diff --git a/ompi/mca/io/romio314/romio/mpi-io/wr_atallb.c b/ompi/mca/io/romio321/romio/mpi-io/wr_atallb.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/wr_atallb.c rename to ompi/mca/io/romio321/romio/mpi-io/wr_atallb.c index 18023d73b3..83eb28bc88 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/wr_atallb.c +++ b/ompi/mca/io/romio321/romio/mpi-io/wr_atallb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/wr_atalle.c b/ompi/mca/io/romio321/romio/mpi-io/wr_atalle.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/wr_atalle.c rename to ompi/mca/io/romio321/romio/mpi-io/wr_atalle.c index cac4931488..fa2ab51423 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/wr_atalle.c +++ b/ompi/mca/io/romio321/romio/mpi-io/wr_atalle.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/write.c b/ompi/mca/io/romio321/romio/mpi-io/write.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/write.c rename to ompi/mca/io/romio321/romio/mpi-io/write.c index c9f3197aca..eb9a77fb82 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -72,7 +72,7 @@ int MPIOI_File_write(MPI_File fh, MPI_Datatype datatype, char *myname, MPI_Status *status) -{ +{ int error_code, buftype_is_contig, filetype_is_contig; MPI_Count datatype_size; ADIO_Offset off, bufsize; @@ -80,7 +80,7 @@ int MPIOI_File_write(MPI_File fh, void *e32buf=NULL; const void *xbuf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -128,7 +128,7 @@ int MPIOI_File_write(MPI_File fh, xbuf = buf; if (adio_fh->is_external32) { error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) + if (error_code != MPI_SUCCESS) goto fn_exit; xbuf = e32buf; @@ -157,7 +157,7 @@ int MPIOI_File_write(MPI_File fh, } ADIO_WriteContig(adio_fh, xbuf, count, datatype, file_ptr_type, - off, status, &error_code); + off, status, &error_code); if ((adio_fh->atomicity) && ADIO_Feature(adio_fh, ADIO_LOCKS)) { @@ -179,7 +179,7 @@ int MPIOI_File_write(MPI_File fh, fn_exit: if (e32buf!= NULL) ADIOI_Free(e32buf); - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_all.c b/ompi/mca/io/romio321/romio/mpi-io/write_all.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi-io/write_all.c rename to ompi/mca/io/romio321/romio/mpi-io/write_all.c index d0cd8ed7ec..6f17cc30ad 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_all.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_all.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -81,7 +81,7 @@ int MPIOI_File_write_all(MPI_File fh, void *e32buf=NULL; const void *xbuf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -112,7 +112,7 @@ int MPIOI_File_write_all(MPI_File fh, xbuf = buf; if (adio_fh->is_external32) { error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) + if (error_code != MPI_SUCCESS) goto fn_exit; xbuf = e32buf; @@ -127,7 +127,7 @@ int MPIOI_File_write_all(MPI_File fh, fn_exit: if (e32buf != NULL) ADIOI_Free(e32buf); - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_allb.c b/ompi/mca/io/romio321/romio/mpi-io/write_allb.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/write_allb.c rename to ompi/mca/io/romio321/romio/mpi-io/write_allb.c index be5977cb45..e184723a87 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_allb.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_allb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -67,7 +67,7 @@ int MPIOI_File_write_all_begin(MPI_File fh, void *e32buf=NULL; const void *xbuf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -89,7 +89,7 @@ int MPIOI_File_write_all_begin(MPI_File fh, if (adio_fh->split_coll_count) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcoll", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -108,7 +108,7 @@ int MPIOI_File_write_all_begin(MPI_File fh, xbuf = buf; if (adio_fh->is_external32) { error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) + if (error_code != MPI_SUCCESS) goto fn_exit; xbuf = e32buf; @@ -125,7 +125,7 @@ int MPIOI_File_write_all_begin(MPI_File fh, fn_exit: if ( e32buf != NULL) ADIOI_Free(e32buf); - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_alle.c b/ompi/mca/io/romio321/romio/mpi-io/write_alle.c similarity index 93% rename from ompi/mca/io/romio314/romio/mpi-io/write_alle.c rename to ompi/mca/io/romio321/romio/mpi-io/write_alle.c index 79be797560..6dc7f6d156 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_alle.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_alle.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -59,7 +59,7 @@ int MPIOI_File_write_all_end(MPI_File fh, MPIU_UNREFERENCED_ARG(buf); - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -69,7 +69,7 @@ int MPIOI_File_write_all_end(MPI_File fh, if (!(adio_fh->split_coll_count)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcollnone", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -88,7 +88,7 @@ int MPIOI_File_write_all_end(MPI_File fh, error_code = MPI_SUCCESS; fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_at.c b/ompi/mca/io/romio321/romio/mpi-io/write_at.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi-io/write_at.c rename to ompi/mca/io/romio321/romio/mpi-io/write_at.c index cc4a2af16e..4362322b67 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_at.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_at.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_atall.c b/ompi/mca/io/romio321/romio/mpi-io/write_atall.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/write_atall.c rename to ompi/mca/io/romio321/romio/mpi-io/write_atall.c index 300fadffee..6f815cdd4c 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_atall.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_atall.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,7 +45,7 @@ Output Parameters: .N fortran @*/ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { int error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_ord.c b/ompi/mca/io/romio321/romio/mpi-io/write_ord.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi-io/write_ord.c rename to ompi/mca/io/romio321/romio/mpi-io/write_ord.c index 72d8b085bb..eb72734e9c 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_ord.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_ord.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. * */ @@ -56,7 +56,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count, void *e32buf=NULL; const void *xbuf; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -92,7 +92,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count, /* --BEGIN ERROR HANDLING-- */ if (error_code != MPI_SUCCESS) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - myname, __LINE__, MPI_ERR_INTERN, + myname, __LINE__, MPI_ERR_INTERN, "**iosharedfailed", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -104,7 +104,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count, xbuf = buf; if (adio_fh->is_external32) { error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) + if (error_code != MPI_SUCCESS) goto fn_exit; xbuf = e32buf; @@ -120,7 +120,7 @@ int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count, fn_exit: if (e32buf != NULL) ADIOI_Free(e32buf); - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); /* FIXME: Check for error code from WriteStridedColl? */ return error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_ordb.c b/ompi/mca/io/romio321/romio/mpi-io/write_ordb.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/write_ordb.c rename to ompi/mca/io/romio321/romio/mpi-io/write_ordb.c index aaacc9ec1a..8b5a302366 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_ordb.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_ordb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -52,7 +52,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count, void *e32buf = NULL; const void *xbuf=NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -64,7 +64,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count, if (adio_fh->split_coll_count) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcoll", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -98,7 +98,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count, if (error_code != MPI_SUCCESS) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - myname, __LINE__, MPI_ERR_INTERN, + myname, __LINE__, MPI_ERR_INTERN, "**iosharedfailed", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -110,7 +110,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count, xbuf = buf; if (adio_fh->is_external32) { error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) + if (error_code != MPI_SUCCESS) goto fn_exit; xbuf = e32buf; @@ -125,7 +125,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count, /* --END ERROR HANDLING-- */ fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); /* FIXME: Check for error code from WriteStridedColl? */ return error_code; diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_orde.c b/ompi/mca/io/romio321/romio/mpi-io/write_orde.c similarity index 92% rename from ompi/mca/io/romio314/romio/mpi-io/write_orde.c rename to ompi/mca/io/romio321/romio/mpi-io/write_orde.c index 34617a96df..8cfdba2ecf 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_orde.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_orde.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -45,7 +45,7 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s MPIU_UNREFERENCED_ARG(buf); - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -55,7 +55,7 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s if (!(adio_fh->split_coll_count)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, + myname, __LINE__, MPI_ERR_IO, "**iosplitcollnone", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -70,6 +70,6 @@ int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *s fn_exit: - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return MPI_SUCCESS; } diff --git a/ompi/mca/io/romio314/romio/mpi-io/write_sh.c b/ompi/mca/io/romio321/romio/mpi-io/write_sh.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi-io/write_sh.c rename to ompi/mca/io/romio321/romio/mpi-io/write_sh.c index 00c90449f5..ed8e1c198b 100644 --- a/ompi/mca/io/romio314/romio/mpi-io/write_sh.c +++ b/ompi/mca/io/romio321/romio/mpi-io/write_sh.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -54,7 +54,7 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count, void *e32buf = NULL; const void *xbuf = NULL; - MPIU_THREAD_CS_ENTER(ALLFUNC,); + ROMIO_THREAD_CS_ENTER(); adio_fh = MPIO_File_resolve(fh); @@ -95,7 +95,7 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count, if (error_code != MPI_SUCCESS) { error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - myname, __LINE__, MPI_ERR_INTERN, + myname, __LINE__, MPI_ERR_INTERN, "**iosharedfailed", 0); error_code = MPIO_Err_return_file(adio_fh, error_code); goto fn_exit; @@ -105,7 +105,7 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count, xbuf = buf; if (adio_fh->is_external32) { error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) + if (error_code != MPI_SUCCESS) goto fn_exit; xbuf = e32buf; @@ -118,14 +118,14 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count, off = adio_fh->disp + adio_fh->etype_size * shared_fp; /* if atomic mode requested, lock (exclusive) the region, because there - could be a concurrent noncontiguous request. On NFS, locking is + could be a concurrent noncontiguous request. On NFS, locking is done in the ADIO_WriteContig.*/ if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); ADIO_WriteContig(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, status, &error_code); + off, status, &error_code); if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); @@ -144,6 +144,6 @@ int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count, fn_exit: if (e32buf != NULL) ADIOI_Free(e32buf); - MPIU_THREAD_CS_EXIT(ALLFUNC,); + ROMIO_THREAD_CS_EXIT(); return error_code; } diff --git a/ompi/mca/io/romio314/romio/mpi2-other/array/Makefile.in b/ompi/mca/io/romio321/romio/mpi2-other/array/Makefile.in similarity index 93% rename from ompi/mca/io/romio314/romio/mpi2-other/array/Makefile.in rename to ompi/mca/io/romio321/romio/mpi2-other/array/Makefile.in index 89cc636189..41a366e398 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/array/Makefile.in +++ b/ompi/mca/io/romio321/romio/mpi2-other/array/Makefile.in @@ -44,7 +44,7 @@ all: $(LIBNAME) profile: $(MPIO_REAL_POBJECTS) $(AR) $(LIBNAME) $(MPIO_REAL_POBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) @if [ "@ENABLE_SHLIB@" != "none" ] ; then \ $(MAKE) P$(SHLIBNAME).la ;\ fi @@ -52,10 +52,10 @@ profile: $(MPIO_REAL_POBJECTS) $(LIBNAME): $(MPIO_OBJECTS) $(AR) $(LIBNAME) $(MPIO_OBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) MPIO_LOOBJECTS = $(MPIO_OBJECTS:.o=.lo) -$(SHLIBNAME).la: $(MPIO_LOOBJECTS) +$(SHLIBNAME).la: $(MPIO_LOOBJECTS) $(AR) $(SHLIBNAME).la $(MPIO_LOOBJECTS) # -------------------------------------------------------------------------- @@ -69,7 +69,7 @@ P$(SHLIBNAME).la: $(MPIO_TMP_LOPOBJECTS) clean: @rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg - @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda + @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda @rm -f ${srcdir}/*.bb ${srcdir}/*.bbg # Rules for the profiling objects diff --git a/ompi/mca/io/romio314/romio/mpi2-other/array/darray.c b/ompi/mca/io/romio321/romio/mpi2-other/array/darray.c similarity index 94% rename from ompi/mca/io/romio314/romio/mpi2-other/array/darray.c rename to ompi/mca/io/romio321/romio/mpi2-other/array/darray.c index 87c8390c28..17ee2a1fce 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/array/darray.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/array/darray.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -42,11 +42,11 @@ Output Parameters: .N fortran @*/ -int MPI_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) +int MPI_Type_create_darray(int size, int rank, int ndims, + int *array_of_gsizes, int *array_of_distribs, + int *array_of_dargs, int *array_of_psizes, + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype) { int err, error_code; int i; @@ -108,7 +108,7 @@ int MPI_Type_create_darray(int size, int rank, int ndims, /* array_of_distribs checked below */ - if ((array_of_dargs[i] != MPI_DISTRIBUTE_DFLT_DARG) && + if ((array_of_dargs[i] != MPI_DISTRIBUTE_DFLT_DARG) && (array_of_dargs[i] <= 0)) { error_code = MPIO_Err_create_code(MPI_SUCCESS, @@ -161,7 +161,7 @@ int MPI_Type_create_darray(int size, int rank, int ndims, MPI_Type_get_extent(oldtype, &orig_lb, &orig_extent); -/* check if MPI_Aint is large enough for size of global array. +/* check if MPI_Aint is large enough for size of global array. if not, complain. */ size_with_aint = orig_extent; diff --git a/ompi/mca/io/romio314/romio/mpi2-other/array/fortran/Makefile.in b/ompi/mca/io/romio321/romio/mpi2-other/array/fortran/Makefile.in similarity index 91% rename from ompi/mca/io/romio314/romio/mpi2-other/array/fortran/Makefile.in rename to ompi/mca/io/romio321/romio/mpi2-other/array/fortran/Makefile.in index 00a8de8184..63c8fe5e02 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/array/fortran/Makefile.in +++ b/ompi/mca/io/romio321/romio/mpi2-other/array/fortran/Makefile.in @@ -29,16 +29,16 @@ all: $(LIBNAME) profile: $(MPIO_REAL_PFOBJECTS) $(AR) $(LIBNAME) $(MPIO_REAL_PFOBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) @rm -f _*.o $(LIBNAME): $(MPIO_FOBJECTS) $(AR) $(LIBNAME) $(MPIO_FOBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) -clean: +clean: @rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg - @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda + @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda @rm -f ${srcdir}/*.bb ${srcdir}/*.bbg # Rules for the profiling objects diff --git a/ompi/mca/io/romio314/romio/mpi2-other/array/fortran/darrayf.c b/ompi/mca/io/romio321/romio/mpi2-other/array/fortran/darrayf.c similarity index 99% rename from ompi/mca/io/romio314/romio/mpi2-other/array/fortran/darrayf.c rename to ompi/mca/io/romio321/romio/mpi2-other/array/fortran/darrayf.c index 5048250068..7a16bbb3cc 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/array/fortran/darrayf.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/array/fortran/darrayf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/array/fortran/subarrayf.c b/ompi/mca/io/romio321/romio/mpi2-other/array/fortran/subarrayf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi2-other/array/fortran/subarrayf.c rename to ompi/mca/io/romio321/romio/mpi2-other/array/fortran/subarrayf.c index 176c06f9e5..7a2e54a530 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/array/fortran/subarrayf.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/array/fortran/subarrayf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/array/subarray.c b/ompi/mca/io/romio321/romio/mpi2-other/array/subarray.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi2-other/array/subarray.c rename to ompi/mca/io/romio321/romio/mpi2-other/array/subarray.c index 640b7c137f..006abce19c 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/array/subarray.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/array/subarray.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997 University of Chicago. +/* + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -38,9 +38,9 @@ Output Parameters: .N fortran @*/ -int MPI_Type_create_subarray(int ndims, int *array_of_sizes, +int MPI_Type_create_subarray(int ndims, int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, - int order, MPI_Datatype oldtype, + int order, MPI_Datatype oldtype, MPI_Datatype *newtype) { MPI_Aint extent, lb, size_with_aint; @@ -130,7 +130,7 @@ int MPI_Type_create_subarray(int ndims, int *array_of_sizes, MPI_Type_get_extent(oldtype, &lb, &extent); -/* check if MPI_Aint is large enough for size of global array. +/* check if MPI_Aint is large enough for size of global array. if not, complain. */ size_with_aint = extent; diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/Makefile.in b/ompi/mca/io/romio321/romio/mpi2-other/info/Makefile.in similarity index 96% rename from ompi/mca/io/romio314/romio/mpi2-other/info/Makefile.in rename to ompi/mca/io/romio321/romio/mpi2-other/info/Makefile.in index 52087ca819..b77f08e2b3 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/Makefile.in +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/Makefile.in @@ -51,7 +51,7 @@ all: $(LIBNAME) profile: $(MPIO_REAL_POBJECTS) $(AR) $(LIBNAME) $(MPIO_REAL_POBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) @if [ "@ENABLE_SHLIB@" != "none" ] ; then \ $(MAKE) P$(SHLIBNAME).la ;\ fi @@ -59,10 +59,10 @@ profile: $(MPIO_REAL_POBJECTS) $(LIBNAME): $(MPIO_OBJECTS) $(AR) $(LIBNAME) $(MPIO_OBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) MPIO_LOOBJECTS = $(MPIO_OBJECTS:.o=.lo) -$(SHLIBNAME).la: $(MPIO_LOOBJECTS) +$(SHLIBNAME).la: $(MPIO_LOOBJECTS) $(AR) $(SHLIBNAME).la $(MPIO_LOOBJECTS) # -------------------------------------------------------------------------- @@ -76,7 +76,7 @@ P$(SHLIBNAME).la: $(MPIO_TMP_LOPOBJECTS) clean: @rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg - @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda + @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda @rm -f ${srcdir}/*.bb ${srcdir}/*.bbg diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/fortran/Makefile.in b/ompi/mca/io/romio321/romio/mpi2-other/info/fortran/Makefile.in similarity index 95% rename from ompi/mca/io/romio314/romio/mpi2-other/info/fortran/Makefile.in rename to ompi/mca/io/romio321/romio/mpi2-other/info/fortran/Makefile.in index 3b9a2df643..c84769c546 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/fortran/Makefile.in +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/fortran/Makefile.in @@ -32,16 +32,16 @@ all: $(LIBNAME) profile: $(MPIO_REAL_POBJECTS) $(AR) $(LIBNAME) $(MPIO_REAL_POBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) @rm -f _*.o $(LIBNAME): $(MPIO_OBJECTS) $(AR) $(LIBNAME) $(MPIO_OBJECTS) - $(RANLIB) $(LIBNAME) + $(RANLIB) $(LIBNAME) clean: @rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg - @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda + @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda @rm -f ${srcdir}/*.bb ${srcdir}/*.bbg # Rules for the profiling objects diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/fortran/info_createf.c b/ompi/mca/io/romio321/romio/mpi2-other/info/fortran/info_createf.c similarity index 98% rename from ompi/mca/io/romio314/romio/mpi2-other/info/fortran/info_createf.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/fortran/info_createf.c index 1568ba51e5..5d01ce93d0 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/fortran/info_createf.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/fortran/info_createf.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/fortran/info_deletef.c b/ompi/mca/io/romio321/romio/mpi2-other/info/fortran/info_deletef.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi2-other/info/fortran/info_deletef.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/fortran/info_deletef.c index 92a2496caf..f7a7bb4d58 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/fortran/info_deletef.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/fortran/info_deletef.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -97,7 +97,7 @@ void mpi_info_delete_(MPI_Fint *info, char *key, int *ierr, int keylen) /* strip leading and trailing blanks in key */ lead_blanks = 0; - for (i=0; icookie != MPIR_INFO_COOKIE)) + if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) return (MPI_Fint) 0; if (!MPIR_Infotable) { MPIR_Infotable_max = 1024; MPIR_Infotable = (MPI_Info *) - ADIOI_Malloc(MPIR_Infotable_max*sizeof(MPI_Info)); - MPIR_Infotable_ptr = 0; /* 0 can't be used though, because + ADIOI_Malloc(MPIR_Infotable_max*sizeof(MPI_Info)); + MPIR_Infotable_ptr = 0; /* 0 can't be used though, because MPI_INFO_NULL=0 */ for (i=0; ikey = 0; (*info)->value = 0; (*info)->next = 0; - /* this is the first structure in this linked list. it is + /* this is the first structure in this linked list. it is always kept empty. new (key,value) pairs are added after it. */ fn_exit: diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_delete.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_delete.c similarity index 93% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_delete.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_delete.c index 7ee0941591..06ec27ee8d 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_delete.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_delete.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -63,7 +63,7 @@ int MPI_Info_delete(MPI_Info info, char *key) while (curr) { if (!strcmp(curr->key, key)) { - ADIOI_Free(curr->key); + ADIOI_Free(curr->key); ADIOI_Free(curr->value); prev->next = curr->next; ADIOI_Free(curr); @@ -76,7 +76,7 @@ int MPI_Info_delete(MPI_Info info, char *key) if (!done) { FPRINTF(stderr, "MPI_Info_delete: key not defined in info\n"); - MPI_Abort(MPI_COMM_WORLD, 1); + MPI_Abort(MPI_COMM_WORLD, 1); } return MPI_SUCCESS; diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_dup.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_dup.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_dup.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_dup.c index 08b593d833..a1c1a9969f 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_dup.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_dup.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -58,7 +58,7 @@ int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) curr_new->key = ADIOI_Strdup(curr_old->key); curr_new->value = ADIOI_Strdup(curr_old->value); curr_new->next = 0; - + curr_old = curr_old->next; } diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_f2c.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_f2c.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_f2c.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_f2c.c index ec9e2b6792..49d8ae5eec 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_f2c.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_f2c.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_free.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_free.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_free.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_free.c index b9238c7e08..e682ce0cd5 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_free.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_free.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_get.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_get.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_get.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_get.c index 05125c585f..ca4274672b 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_get.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_get.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_getnks.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_getnks.c similarity index 95% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_getnks.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_getnks.c index da728d7cb6..fd20826950 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_getnks.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_getnks.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_getnth.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_getnth.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_getnth.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_getnth.c index bcb608248f..fa325c41cc 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_getnth.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_getnth.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_getvln.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_getvln.c similarity index 97% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_getvln.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_getvln.c index 363e4dfbc9..b484929b72 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_getvln.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_getvln.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/mpi2-other/info/info_set.c b/ompi/mca/io/romio321/romio/mpi2-other/info/info_set.c similarity index 96% rename from ompi/mca/io/romio314/romio/mpi2-other/info/info_set.c rename to ompi/mca/io/romio321/romio/mpi2-other/info/info_set.c index b52ebc8bfe..e60d89d79e 100644 --- a/ompi/mca/io/romio314/romio/mpi2-other/info/info_set.c +++ b/ompi/mca/io/romio321/romio/mpi2-other/info/info_set.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * - * Copyright (C) 1997 University of Chicago. + * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -77,7 +77,7 @@ int MPI_Info_set(MPI_Info info, char *key, char *value) while (curr) { if (!strcmp(curr->key, key)) { - ADIOI_Free(curr->value); + ADIOI_Free(curr->value); curr->value = ADIOI_Strdup(value); break; } diff --git a/ompi/mca/io/romio314/romio/test-internal/Makefile.am b/ompi/mca/io/romio321/romio/test-internal/Makefile.am similarity index 100% rename from ompi/mca/io/romio314/romio/test-internal/Makefile.am rename to ompi/mca/io/romio321/romio/test-internal/Makefile.am diff --git a/ompi/mca/io/romio314/romio/test-internal/file_realms_test.c b/ompi/mca/io/romio321/romio/test-internal/file_realms_test.c similarity index 97% rename from ompi/mca/io/romio314/romio/test-internal/file_realms_test.c rename to ompi/mca/io/romio321/romio/test-internal/file_realms_test.c index 72cef99d25..b848259e0e 100644 --- a/ompi/mca/io/romio314/romio/test-internal/file_realms_test.c +++ b/ompi/mca/io/romio321/romio/test-internal/file_realms_test.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. +/* + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ diff --git a/ompi/mca/io/romio314/romio/test-internal/heap_test.c b/ompi/mca/io/romio321/romio/test-internal/heap_test.c similarity index 99% rename from ompi/mca/io/romio314/romio/test-internal/heap_test.c rename to ompi/mca/io/romio321/romio/test-internal/heap_test.c index 083e1429dd..2f0041df36 100644 --- a/ompi/mca/io/romio314/romio/test-internal/heap_test.c +++ b/ompi/mca/io/romio321/romio/test-internal/heap_test.c @@ -49,7 +49,7 @@ int main(int argc, char **argv) { int test_type = RANDOM; test_params_t predefined_tests[PREDEF_TESTS]; test_params_t test; - + /* parse args */ adding_elements = 0; curr_add_idx = 0; @@ -260,10 +260,10 @@ int run_test(test_params_t *test) { int i, j, k, err_flag = 0; int curr_insert_idx = 0; int curr_extract_idx = 0; - + create_heap(&myheap, test->heap_size); myheap.size = 0; - + extracted = (ADIO_Offset *) malloc(test->heap_size * sizeof(ADIO_Offset)); for (i=0; i < test->action_arr_sz; i++) { for (j=0; jaction_count_arr[i]; j++) { @@ -275,7 +275,7 @@ int run_test(test_params_t *test) { myheap.nodes[k].offset = test->offsets[k]; myheap.nodes[k].proc = k; } - build_heap(&myheap); + build_heap(&myheap); break; case INSERT: ADIOI_Heap_insert(&myheap, test->offsets[curr_insert_idx], @@ -341,7 +341,7 @@ void init_predefined_test(test_params_t *params, int index) { strcpy(params->name, "TEST 1"); params->heap_size = 15; params->action_arr_sz = 3; - + /* allocate space */ params->action_arr = (int *) malloc (params->action_arr_sz*sizeof(int)); @@ -399,7 +399,7 @@ void init_predefined_test(test_params_t *params, int index) { strcpy(params->name, "TEST 1"); params->heap_size = 15; params->action_arr_sz = 3; - + /* allocate space */ params->action_arr = (int *) malloc (params->action_arr_sz*sizeof(int)); @@ -409,7 +409,7 @@ void init_predefined_test(test_params_t *params, int index) { if (params->verify) params->correct_order = (ADIO_Offset *) malloc(params->heap_size*sizeof(ADIO_Offset)); - + /* Set values */ params->offsets[0] = 65; params->offsets[1] = 53; diff --git a/ompi/mca/io/romio314/romio/test-internal/io_bounds_test.c b/ompi/mca/io/romio321/romio/test-internal/io_bounds_test.c similarity index 98% rename from ompi/mca/io/romio314/romio/test-internal/io_bounds_test.c rename to ompi/mca/io/romio321/romio/test-internal/io_bounds_test.c index a4d70a4cfb..f7514764e4 100644 --- a/ompi/mca/io/romio314/romio/test-internal/io_bounds_test.c +++ b/ompi/mca/io/romio321/romio/test-internal/io_bounds_test.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. +/* + * Copyright (C) 2008 University of Chicago. * See COPYRIGHT notice in top-level directory. */ @@ -40,7 +40,7 @@ int main (int argc, char **argv) { MPI_Init (&argc, &argv); MPI_Comm_rank (MPI_COMM_WORLD, &rank); - + if (argc != 1) { if (!rank) { printf ("Use only one process\n"); @@ -116,7 +116,7 @@ int run_test (test_param_t *test) { MPI_File_seek (fh, test->offset, MPI_SEEK_SET); ADIOI_Calc_bounds ((ADIO_File) fh, test->count, MPI_BYTE, ADIO_INDIVIDUAL, - test->offset, &st_offset, &end_offset); + test->offset, &st_offset, &end_offset); ind_err = 0; if (st_offset != test->correct_st_offset) { @@ -173,7 +173,7 @@ int print_usage () " io_bounds_test -A -T \n"); } -int print_test_params (test_param_t *test) +int print_test_params (test_param_t *test) { int i; printf ( @@ -181,7 +181,7 @@ int print_test_params (test_param_t *test) "bytes: %d\n" "Filetype [n](disp, lens, type):\n", test->offset, test->count); - + for (i=0; itype_count; i++) { printf ( " [%d](%lld, %d, ", diff --git a/ompi/mca/io/romio314/romio/test/.codingcheck b/ompi/mca/io/romio321/romio/test/.codingcheck similarity index 59% rename from ompi/mca/io/romio314/romio/test/.codingcheck rename to ompi/mca/io/romio321/romio/test/.codingcheck index 823ebd28ea..0d0a655fa8 100644 --- a/ompi/mca/io/romio314/romio/test/.codingcheck +++ b/ompi/mca/io/romio321/romio/test/.codingcheck @@ -1,10 +1,10 @@ # -# We allow these routines for the romio test programs -%romioTestRoutines = ( +# We allow these routines for the romio test programs +%romioTestRoutines = ( 'printf' => sys, 'fprintf' => sys , 'sprintf' => sys, 'vprintf' => sys, - 'strcpy' => sys, 'strncpy' => sys, 'strcat' => sys, + 'strcpy' => sys, 'strncpy' => sys, 'strcat' => sys, 'malloc' => sys, 'free' => sys, 'calloc' => sys, 'strdup' => sys, - 'assert' => sys, 'snprintf' => sys, + 'assert' => sys, 'snprintf' => sys, ); if (defined(&PushAllowFuncNames)) { &PushAllowFuncNames( "romioTestRoutines", "tree", "add" ); diff --git a/ompi/mca/io/romio314/romio/test/Makefile.am b/ompi/mca/io/romio321/romio/test/Makefile.am similarity index 94% rename from ompi/mca/io/romio314/romio/test/Makefile.am rename to ompi/mca/io/romio321/romio/test/Makefile.am index 74940cd8a9..cdddf64f51 100644 --- a/ompi/mca/io/romio314/romio/test/Makefile.am +++ b/ompi/mca/io/romio321/romio/test/Makefile.am @@ -25,8 +25,8 @@ AM_FFLAGS = $(USER_FFLAGS) CTESTS = simple perf async coll_test coll_perf misc file_info excl large_array \ atomicity noncontig i_noncontig noncontig_coll split_coll shared_fp \ large_file psimple error status noncontig_coll2 aggregation1 aggregation2 \ - async-multiple ordered_fp hindexed external32 types_with_zeros darray_read -FTESTS = fcoll_test fperf fmisc pfcoll_test + async-multiple ordered_fp hindexed external32 types_with_zeros darray_read syshints +FTESTS = fcoll_test fperf fmisc pfcoll_test noinst_PROGRAMS = $(CTESTS) diff --git a/ompi/mca/io/romio314/romio/test/Mfile.in b/ompi/mca/io/romio321/romio/test/Mfile.in similarity index 93% rename from ompi/mca/io/romio314/romio/test/Mfile.in rename to ompi/mca/io/romio321/romio/test/Mfile.in index 6b432ac10d..c2e1c29825 100644 --- a/ompi/mca/io/romio314/romio/test/Mfile.in +++ b/ompi/mca/io/romio321/romio/test/Mfile.in @@ -24,7 +24,7 @@ srcdir = @srcdir@ @VPATH@ PROFLIB = -CFLAGS = @CFLAGS@ @DEFS@ $(OPTFLAGS) +CFLAGS = @CFLAGS@ @DEFS@ $(OPTFLAGS) CCFLAGS = $(CFLAGS) FFLAGS = $(OPTFLAGS) @FFLAGS@ # Use LIBS to add any special libraries for C programs @@ -32,18 +32,18 @@ LIBS = @LIB_PATH@ @LIB_LIST@ # Use FLIBS to add any special libraries for Fortran programs FLIBS = @FLIB_PATH@ @LIB_LIST@ @F77EXTRALIBS@ EXECS = $(CTESTS) $(FTESTS) -OTHEREXECS = +OTHEREXECS = CTESTS = simple perf async coll_test coll_perf misc file_info excl \ large_array \ atomicity noncontig i_noncontig noncontig_coll split_coll shared_fp \ large_file psimple error status noncontig_coll2 -FTESTS = fcoll_test fperf fmisc pfcoll_test +FTESTS = fcoll_test fperf fmisc pfcoll_test default: $(EXECS) # # Note that runtests builds the executables as required -testing: +testing: -./runtests $(TESTARGS) all: testing @@ -62,7 +62,7 @@ fcoll_test: fcoll_test.f fmisc: fmisc.f $(F77) $(USER_FFLAGS) -o fmisc fmisc.f $(FLIBS) -pfcoll_test: pfcoll_test.f +pfcoll_test: pfcoll_test.f $(F77) $(USER_FFLAGS) -o pfcoll_test pfcoll_test.f $(FLIBS) # diff --git a/ompi/mca/io/romio314/romio/test/README b/ompi/mca/io/romio321/romio/test/README similarity index 89% rename from ompi/mca/io/romio314/romio/test/README rename to ompi/mca/io/romio321/romio/test/README index 15a24804b4..dbab8e393d 100644 --- a/ompi/mca/io/romio314/romio/test/README +++ b/ompi/mca/io/romio321/romio/test/README @@ -1,9 +1,9 @@ -This directory contains a few example programs. +This directory contains a few example programs. Each program takes the filename as a command-line argument -"-fname filename". +"-fname filename". -If you are using "mpirun" to run an MPI program, you can run the +If you are using "mpirun" to run an MPI program, you can run the program "simple" with two processes as follows: mpirun -np 2 simple -fname test @@ -22,9 +22,9 @@ perf.c: A simple read and write performance test. Each process writes reads it back. For a different access size, change the value of SIZE in the code. The bandwidth is reported for two cases: (1) without including MPI_File_sync and (2) including - MPI_File_sync. - -async.c: This program is the same as simple.c, except that it uses + MPI_File_sync. + +async.c: This program is the same as simple.c, except that it uses asynchronous I/O. coll_test.c: This program tests the use of collective I/O. It writes @@ -42,8 +42,8 @@ coll_perf.c: Measures the I/O bandwidth for writing/reading a 3D misc.c: Tests various miscellaneous MPI-IO functions -atomicity.c: Tests whether atomicity semantics are satisfied for - overlapping accesses in atomic mode. The probability of detecting +atomicity.c: Tests whether atomicity semantics are satisfied for + overlapping accesses in atomic mode. The probability of detecting errors is higher if you run it on 8 or more processes. large_file.c: Tests access to large files. Writes a 4-Gbyte file and @@ -53,20 +53,20 @@ large_file.c: Tests access to large files. Writes a 4-Gbyte file and large_array.c: Tests writing and reading a 4-Gbyte distributed array using the distributed array datatype constructor. Works only on file systems that support 64-bit file sizes and MPI implementations - that support 64-bit MPI_Aint. + that support 64-bit MPI_Aint. -file_info.c: Tests the setting and retrieval of hints via +file_info.c: Tests the setting and retrieval of hints via MPI_File_set_info and MPI_File_get_info excl.c: Tests MPI_File_open with MPI_MODE_EXCL -noncontig.c: Tests noncontiguous accesses in memory and file using +noncontig.c: Tests noncontiguous accesses in memory and file using independent I/O. Run it on two processes only. noncontig_coll.c: Same as noncontig.c, but uses collective I/O -noncontig_coll2.c: Same as noncontig_coll.c, but exercises the - cb_config_list hint and aggregation handling more. +noncontig_coll2.c: Same as noncontig_coll.c, but exercises the + cb_config_list hint and aggregation handling more. i_noncontig.c: Same as noncontig.c, but uses nonblocking I/O @@ -78,7 +78,7 @@ fperf.f: Fortran version of perf.c fcoll_test.f: Fortran version of coll_test.c -pfcoll_test.f: Same as fcoll_test.f but uses the PMPI versions of +pfcoll_test.f: Same as fcoll_test.f but uses the PMPI versions of all MPI routines fmisc.f: Fortran version of misc.c diff --git a/ompi/mca/io/romio314/romio/test/aggregation1.c b/ompi/mca/io/romio321/romio/test/aggregation1.c similarity index 92% rename from ompi/mca/io/romio314/romio/test/aggregation1.c rename to ompi/mca/io/romio321/romio/test/aggregation1.c index 9b4a76acd1..dee42d60a5 100644 --- a/ompi/mca/io/romio314/romio/test/aggregation1.c +++ b/ompi/mca/io/romio321/romio/test/aggregation1.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2007 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -15,7 +15,7 @@ #include #define NUM_OBJS 4 -#define OBJ_SIZE 1048576 +#define OBJ_SIZE 1048576 extern char *optarg; extern int optind, opterr, optopt; @@ -29,7 +29,7 @@ Usage( int line ) { int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); if ( rank == 0 ) { - fprintf( stderr, + fprintf( stderr, "Usage (line %d): %s [-d] [-h] -f filename\n" "\t-d for debugging\n" "\t-h to turn on the hints to force collective aggregation\n", @@ -61,7 +61,7 @@ print_hints( int rank, MPI_File *mfh ) { for( i = 0; i < nkeys; i++ ) { MPI_Info_get_nthkey( info, i, key ); printf( "%35s -> ", key ); - MPI_Info_get( info, key, 1024, value, &dummy_int ); + MPI_Info_get( info, key, 1024, value, &dummy_int ); printf( "%s\n", value ); } MPI_Info_free(&info); @@ -93,10 +93,10 @@ write_file( char *target, int rank, MPI_Info *info ) { buffer = malloc(OBJ_SIZE); if ( debug ) printf( "%d writing file %s\n", rank, target ); - - if( (mpi_ret = MPI_File_open(MPI_COMM_WORLD, target, + + if( (mpi_ret = MPI_File_open(MPI_COMM_WORLD, target, MPI_MODE_WRONLY | MPI_MODE_CREATE, *info, &wfh ) ) - != MPI_SUCCESS ) + != MPI_SUCCESS ) { fatal_error( mpi_ret, NULL, "open for write" ); } @@ -106,7 +106,7 @@ write_file( char *target, int rank, MPI_Info *info ) { fill_buffer( buffer, OBJ_SIZE, rank, offset ); if ( debug ) printf( "%s", buffer ); if ( (mpi_ret = MPI_File_write_at_all( wfh, offset, buffer, OBJ_SIZE, - MPI_CHAR, &mpi_stat ) ) != MPI_SUCCESS ) + MPI_CHAR, &mpi_stat ) ) != MPI_SUCCESS ) { fatal_error( mpi_ret, &mpi_stat, "write" ); } @@ -125,7 +125,7 @@ static int reduce_corruptions( int corrupt_blocks ) { int mpi_ret; int sum; - if ( ( mpi_ret = MPI_Reduce( &corrupt_blocks, &sum, 1, + if ( ( mpi_ret = MPI_Reduce( &corrupt_blocks, &sum, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD ) ) != MPI_SUCCESS ) { fatal_error( mpi_ret, NULL, "MPI_Reduce" ); @@ -145,9 +145,9 @@ read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) { verify_buf = (char *)malloc(OBJ_SIZE); if ( debug ) printf( "%d reading file %s\n", rank, target ); - - if( (mpi_ret = MPI_File_open(MPI_COMM_WORLD, target, - MPI_MODE_RDONLY, *info, &rfh ) ) != MPI_SUCCESS ) + + if( (mpi_ret = MPI_File_open(MPI_COMM_WORLD, target, + MPI_MODE_RDONLY, *info, &rfh ) ) != MPI_SUCCESS ) { fatal_error( mpi_ret, NULL, "open for read" ); } @@ -157,7 +157,7 @@ read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) { fill_buffer( verify_buf, OBJ_SIZE, rank, offset ); if ( debug ) printf( "Expecting %s", buffer ); if ( (mpi_ret = MPI_File_read_at_all( rfh, offset, buffer, OBJ_SIZE, - MPI_CHAR, &mpi_stat ) ) != MPI_SUCCESS ) + MPI_CHAR, &mpi_stat ) ) != MPI_SUCCESS ) { fatal_error( mpi_ret, &mpi_stat, "read" ); } @@ -182,9 +182,9 @@ read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) { static void set_hints( MPI_Info *info ) { - MPI_Info_set( *info, "romio_cb_write", "enable" ); - MPI_Info_set( *info, "romio_no_indep_rw", "1" ); - MPI_Info_set( *info, "cb_nodes", "1" ); + MPI_Info_set( *info, "romio_cb_write", "enable" ); + MPI_Info_set( *info, "romio_no_indep_rw", "1" ); + MPI_Info_set( *info, "cb_nodes", "1" ); MPI_Info_set( *info, "cb_buffer_size", "4194304" ); } @@ -199,7 +199,7 @@ set_hints( MPI_Info *info, char *hints ) { val = strtok( NULL, delimiter ); if ( debug ) printf( "HINT: %s = %s\n", key, val ); if ( ! val ) { - Usage( __LINE__ ); + Usage( __LINE__ ); } MPI_Info_set( *info, key, val ); key = strtok( NULL, delimiter ); @@ -208,7 +208,7 @@ set_hints( MPI_Info *info, char *hints ) { } */ -int +int main( int argc, char *argv[] ) { int nproc = 1, rank = 0; char *target = NULL; diff --git a/ompi/mca/io/romio314/romio/test/aggregation2.c b/ompi/mca/io/romio321/romio/test/aggregation2.c similarity index 88% rename from ompi/mca/io/romio314/romio/test/aggregation2.c rename to ompi/mca/io/romio321/romio/test/aggregation2.c index 8108b466e4..a35ebe0caf 100644 --- a/ompi/mca/io/romio314/romio/test/aggregation2.c +++ b/ompi/mca/io/romio321/romio/test/aggregation2.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2007 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -29,7 +29,7 @@ static void handle_error(int errcode, const char *str) MPI_Abort(MPI_COMM_WORLD, 1); } -int main(int argc, char ** argv) +int main(int argc, char ** argv) { MPI_Info info = MPI_INFO_NULL; MPI_File fh; @@ -51,19 +51,19 @@ int main(int argc, char ** argv) } off = rank*sizeof(buffer); - errcode = MPI_File_open(MPI_COMM_WORLD, argv[1], + errcode = MPI_File_open(MPI_COMM_WORLD, argv[1], MPI_MODE_WRONLY|MPI_MODE_CREATE, info, &fh); if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_open"); - errcode = MPI_File_write_at_all(fh, off, buffer, BUFSIZE, + errcode = MPI_File_write_at_all(fh, off, buffer, BUFSIZE, MPI_INT, &status); if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_write_at_all"); errcode = MPI_File_close(&fh); if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_close"); - errcode = MPI_File_open(MPI_COMM_WORLD, argv[1], + errcode = MPI_File_open(MPI_COMM_WORLD, argv[1], MPI_MODE_RDONLY, info, &fh); if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_open"); - errcode = MPI_File_read_at_all(fh, off, buf2, BUFSIZE, + errcode = MPI_File_read_at_all(fh, off, buf2, BUFSIZE, MPI_INT, &status); if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_read_at_all"); errcode = MPI_File_close(&fh); diff --git a/ompi/mca/io/romio314/romio/test/async-multiple.c b/ompi/mca/io/romio321/romio/test/async-multiple.c similarity index 87% rename from ompi/mca/io/romio314/romio/test/async-multiple.c rename to ompi/mca/io/romio321/romio/test/async-multiple.c index f52c95a4da..ec9726ce55 100644 --- a/ompi/mca/io/romio314/romio/test/async-multiple.c +++ b/ompi/mca/io/romio321/romio/test/async-multiple.c @@ -1,6 +1,6 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab - * + * * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -14,11 +14,11 @@ /* Uses asynchronous I/O. Each process writes to separate files and reads them back. The file name is taken as a command-line argument, - and the process rank is appended to it.*/ + and the process rank is appended to it.*/ void handle_error(int errcode, const char *str); -void handle_error(int errcode, const char *str) +void handle_error(int errcode, const char *str) { char msg[MPI_MAX_ERROR_STRING]; int resultlen; @@ -39,7 +39,7 @@ int main(int argc, char **argv) MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!rank) { i = 1; @@ -74,14 +74,14 @@ int main(int argc, char **argv) strcpy(tmp, filename); sprintf(filename, "%s.%d", tmp, rank); - errcode = MPI_File_open(MPI_COMM_SELF, filename, + errcode = MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); if (errcode != MPI_SUCCESS) { handle_error(errcode, "MPI_File_open"); } MPI_File_set_view(fh, 0, MPI_INT, MPI_INT, "native", MPI_INFO_NULL); - for (i=0; i /* tests whether atomicity semantics are satisfied for overlapping accesses - in atomic mode. The probability of detecting errors is higher if you run + in atomic mode. The probability of detecting errors is higher if you run it on 8 or more processes. */ /* The file name is taken as a command-line argument. */ @@ -30,7 +30,7 @@ int main(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mynod); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -63,7 +63,7 @@ int main(int argc, char **argv) /* initialize file to all zeros */ if (!mynod) { MPI_File_delete(filename, MPI_INFO_NULL); - MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE | + MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); for (i=0; i - */ + * yet :> + */ #include @@ -16,10 +16,10 @@ #include #include -#define CHECK(fn) {int errcode; errcode = (fn); if (errcode != MPI_SUCCESS) handle_error(errcode, NULL); } +#define CHECK(fn) {int errcode; errcode = (fn); if (errcode != MPI_SUCCESS) handle_error(errcode, NULL); } -static void handle_error(int errcode, char *str) +static void handle_error(int errcode, char *str) { char msg[MPI_MAX_ERROR_STRING]; int resultlen; @@ -28,7 +28,7 @@ static void handle_error(int errcode, char *str) MPI_Abort(MPI_COMM_WORLD, 1); } -static void typestats(MPI_Datatype type) +static void typestats(MPI_Datatype type) { MPI_Aint lb, extent; MPI_Count size; @@ -41,7 +41,7 @@ static void typestats(MPI_Datatype type) } -static int verify_type(char *filename, MPI_Datatype type, +static int verify_type(char *filename, MPI_Datatype type, int64_t expected_extent, int do_coll) { int rank, canary; @@ -53,10 +53,10 @@ static int verify_type(char *filename, MPI_Datatype type, MPI_Comm_rank(MPI_COMM_WORLD, &rank); - CHECK( MPI_File_open(MPI_COMM_WORLD, filename, + CHECK( MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE|MPI_MODE_RDWR, MPI_INFO_NULL, &fh)); - CHECK( MPI_File_set_view(fh, rank*sizeof(int), - MPI_BYTE, type, "native", MPI_INFO_NULL)); + CHECK( MPI_File_set_view(fh, rank*sizeof(int), + MPI_BYTE, type, "native", MPI_INFO_NULL)); MPI_Type_size_x(type, &tsize); @@ -69,14 +69,14 @@ static int verify_type(char *filename, MPI_Datatype type, CHECK( MPI_File_write_at(fh, tsize, &canary, 1, MPI_INT, &status)); } - CHECK( MPI_File_set_view(fh, 0, MPI_INT, MPI_INT, "native", - MPI_INFO_NULL)); + CHECK( MPI_File_set_view(fh, 0, MPI_INT, MPI_INT, "native", + MPI_INFO_NULL)); if (do_coll) { - CHECK( MPI_File_read_at_all(fh, expected_extent/sizeof(int)+rank, + CHECK( MPI_File_read_at_all(fh, expected_extent/sizeof(int)+rank, &compare, 1, MPI_INT, &status)); } else { - CHECK( MPI_File_read_at(fh, expected_extent/sizeof(int)+rank, + CHECK( MPI_File_read_at(fh, expected_extent/sizeof(int)+rank, &compare, 1, MPI_INT, &status)); } @@ -92,7 +92,7 @@ static int verify_type(char *filename, MPI_Datatype type, } else { if (rank == 0) MPI_File_delete(filename, MPI_INFO_NULL); } - + return (toterrs); } @@ -105,14 +105,14 @@ static int testtype(char *filename, MPI_Datatype type, int64_t expected_extent) MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (!rank) typestats(type); - ret = verify_type(filename, type, expected_extent, nocollective); + ret = verify_type(filename, type, expected_extent, nocollective); if (ret) { errs++; fprintf(stderr, "type %d failed indep\n", type); - } else + } else if (!rank) printf("indep: OK "); - ret = verify_type(filename, type, expected_extent, collective); + ret = verify_type(filename, type, expected_extent, collective); if (ret) { errs++; fprintf(stderr, "type %d failed collective\n", type); @@ -133,7 +133,7 @@ int main(int argc, char **argv) int subs[2]; int starts[2]; - MPI_Datatype baseindex, indexed1G, indexed3G, indexed6G; + MPI_Datatype baseindex, indexed1G, indexed3G, indexed6G; MPI_Datatype subarray1G, subarray3G, subarray6G; int ret, rank; @@ -166,7 +166,7 @@ int main(int argc, char **argv) MPI_Type_contiguous(6144, baseindex, &indexed6G); MPI_Type_commit(&indexed6G); - /* TODO: + /* TODO: * - add a darray test * - add a test with crazy extents */ sizes[0] = 1024*16; @@ -174,17 +174,17 @@ int main(int argc, char **argv) subs[0] = subs[1] = 256; starts[0] = starts[1] = 0; - MPI_Type_create_subarray(ndims, sizes, subs, starts, + MPI_Type_create_subarray(ndims, sizes, subs, starts, MPI_ORDER_C, MPI_INT, &subarray1G); MPI_Type_commit(&subarray1G); sizes[1] = 1024*16*3; - MPI_Type_create_subarray(ndims, sizes, subs, starts, + MPI_Type_create_subarray(ndims, sizes, subs, starts, MPI_ORDER_C, MPI_INT, &subarray3G); MPI_Type_commit(&subarray3G); sizes[1] = 1024*16*6; - MPI_Type_create_subarray(ndims, sizes, subs, starts, + MPI_Type_create_subarray(ndims, sizes, subs, starts, MPI_ORDER_C, MPI_INT, &subarray6G); MPI_Type_commit(&subarray6G); @@ -202,11 +202,11 @@ int main(int argc, char **argv) ret = testtype(argv[1], subarray6G, (int64_t)1024*1024*1024*6); if(!ret && !rank) fprintf(stderr, " No Errors\n"); - + MPI_Finalize(); return (-ret); } -/* - * vim: ts=8 sts=4 sw=4 noexpandtab +/* + * vim: ts=8 sts=4 sw=4 noexpandtab */ diff --git a/ompi/mca/io/romio314/romio/test/coll_perf.c b/ompi/mca/io/romio321/romio/test/coll_perf.c similarity index 96% rename from ompi/mca/io/romio314/romio/test/coll_perf.c rename to ompi/mca/io/romio321/romio/test/coll_perf.c index f576e85d5a..0f9042d5ff 100644 --- a/ompi/mca/io/romio314/romio/test/coll_perf.c +++ b/ompi/mca/io/romio321/romio/test/coll_perf.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -14,7 +14,7 @@ block-distributed array to a file corresponding to the global array in row-major (C) order. Note that the file access pattern is noncontiguous. - + Array size 128^3. For other array sizes, change array_of_gsizes below.*/ @@ -35,7 +35,7 @@ int main(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mynod); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -91,7 +91,7 @@ int main(int argc, char **argv) /* to eliminate paging effects, do the operations once but don't time them */ - MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, + MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", MPI_INFO_NULL); MPI_File_write_all(fh, buf, bufcount, MPI_INT, &status); @@ -102,7 +102,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); /* now time write_all */ - MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, + MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", MPI_INFO_NULL); @@ -124,8 +124,8 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); /* now time read_all */ - MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); + MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, + MPI_INFO_NULL, &fh); MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", MPI_INFO_NULL); MPI_Barrier(MPI_COMM_WORLD); diff --git a/ompi/mca/io/romio314/romio/test/coll_test.c b/ompi/mca/io/romio321/romio/test/coll_test.c similarity index 96% rename from ompi/mca/io/romio314/romio/test/coll_test.c rename to ompi/mca/io/romio321/romio/test/coll_test.c index b7aeda221b..4efc4d25b0 100644 --- a/ompi/mca/io/romio314/romio/test/coll_test.c +++ b/ompi/mca/io/romio321/romio/test/coll_test.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -17,7 +17,7 @@ /* The file name is taken as a command-line argument. */ /* Note that the file access pattern is noncontiguous. */ - + void handle_error(int errcode, const char *str); void handle_error(int errcode, const char *str) @@ -49,7 +49,7 @@ int main(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mynod); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -94,7 +94,7 @@ int main(int argc, char **argv) for (i=0; i #include #include -/* +/* * the new defered open code made some changes to the way we manage CREAT|EXCL, * so test out that code path */ @@ -19,7 +19,7 @@ struct options { typedef struct options options; -void handle_error(int errcode, char *str) +void handle_error(int errcode, char *str) { char msg[MPI_MAX_ERROR_STRING]; int resultlen; @@ -28,7 +28,7 @@ void handle_error(int errcode, char *str) MPI_Abort(MPI_COMM_WORLD, 1); } -void parse_args(int argc, char ** argv, int rank, options *opts) +void parse_args(int argc, char ** argv, int rank, options *opts) { int i, len=0; if (rank == 0) { diff --git a/ompi/mca/io/romio314/romio/test/darray_read.c b/ompi/mca/io/romio321/romio/test/darray_read.c similarity index 92% rename from ompi/mca/io/romio314/romio/test/darray_read.c rename to ompi/mca/io/romio321/romio/test/darray_read.c index 418ae4c9ea..7b8e4c59e8 100644 --- a/ompi/mca/io/romio314/romio/test/darray_read.c +++ b/ompi/mca/io/romio321/romio/test/darray_read.c @@ -1,3 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ #include #include @@ -19,9 +24,9 @@ static void handle_error(int errcode, const char *str) } -int main(int argc, char *argv[]) -{ - int i, j, nerrors=0, total_errors=0; +int main(int argc, char *argv[]) +{ + int i, j, nerrors=0, total_errors=0; int rank, size; int bpos; @@ -43,7 +48,7 @@ int main(int argc, char *argv[]) int tsize, nelem; MPI_File dfile; - + MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); @@ -121,4 +126,4 @@ int main(int argc, char *argv[]) exit(total_errors); -} +} diff --git a/ompi/mca/io/romio314/romio/test/error.c b/ompi/mca/io/romio321/romio/test/error.c similarity index 96% rename from ompi/mca/io/romio314/romio/test/error.c rename to ompi/mca/io/romio321/romio/test/error.c index c7aaca61da..ee24e96459 100644 --- a/ompi/mca/io/romio314/romio/test/error.c +++ b/ompi/mca/io/romio321/romio/test/error.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -29,7 +29,7 @@ int main(int argc, char **argv) } #endif -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!rank) { i = 1; @@ -53,7 +53,7 @@ int main(int argc, char **argv) filename = (char *) malloc(len+10); MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); } - + /* each process opens a separate file called filename.'myrank' */ tmp = (char *) malloc(len+10); strcpy(tmp, filename); @@ -61,11 +61,11 @@ int main(int argc, char **argv) err = MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - err = MPI_File_set_view(fh, -1, MPI_BYTE, MPI_BYTE, "native", + err = MPI_File_set_view(fh, -1, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL); /* disp is deliberately passed as -1 */ - /* This test is designed for ROMIO specifically and tests for a + /* This test is designed for ROMIO specifically and tests for a specific error message */ if (err != MPI_SUCCESS) { MPI_Error_string(err, string, &len); @@ -102,5 +102,5 @@ int main(int argc, char **argv) } MPI_Finalize(); - return 0; + return 0; } diff --git a/ompi/mca/io/romio314/romio/test/excl.c b/ompi/mca/io/romio321/romio/test/excl.c similarity index 91% rename from ompi/mca/io/romio314/romio/test/excl.c rename to ompi/mca/io/romio321/romio/test/excl.c index 5deef15779..e48bb3deee 100644 --- a/ompi/mca/io/romio314/romio/test/excl.c +++ b/ompi/mca/io/romio321/romio/test/excl.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -20,7 +20,7 @@ int main(int argc, char **argv) MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!rank) { i = 1; @@ -44,13 +44,13 @@ int main(int argc, char **argv) filename = (char *) malloc(len+10); MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); } - + if (!rank) MPI_File_delete(filename, MPI_INFO_NULL); MPI_Barrier(MPI_COMM_WORLD); /* this open should succeed */ - err = MPI_File_open(MPI_COMM_WORLD, filename, + err = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_EXCL | MPI_MODE_RDWR, MPI_INFO_NULL , &fh); if (err != MPI_SUCCESS) { errs++; @@ -61,7 +61,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); /* this open should fail */ - err = MPI_File_open(MPI_COMM_WORLD, filename, + err = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_EXCL | MPI_MODE_RDWR, MPI_INFO_NULL , &fh); if (err == MPI_SUCCESS) { errs++; @@ -80,5 +80,5 @@ int main(int argc, char **argv) free(filename); MPI_Finalize(); - return 0; + return 0; } diff --git a/ompi/mca/io/romio314/romio/test/external32.c b/ompi/mca/io/romio321/romio/test/external32.c similarity index 97% rename from ompi/mca/io/romio314/romio/test/external32.c rename to ompi/mca/io/romio321/romio/test/external32.c index 17a886cf0d..bca3555ae8 100644 --- a/ompi/mca/io/romio314/romio/test/external32.c +++ b/ompi/mca/io/romio321/romio/test/external32.c @@ -1,6 +1,6 @@ /* * This code was written by Intel Corporation. Copyright (C) 2011-2012 Intel Corporation. - * Intel provides this material to Argonne National Laboratory subject to + * Intel provides this material to Argonne National Laboratory subject to * Software Grant and Corporate Contributor License Agreement dated February 8, 2012. * * See COPYRIGHT in top-level directory. @@ -60,14 +60,14 @@ int main( int argc, char* argv[] ) { for( i = 0; i < 3; i++ ) { /* Open file */ - CHECK(MPI_File_open( MPI_COMM_WORLD, TEST_FILENAME, + CHECK(MPI_File_open( MPI_COMM_WORLD, TEST_FILENAME, MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fileh ) ); /* Set view */ CHECK(MPI_File_set_view( fileh, 0, MPI_INT, MPI_INT, datarep[i], MPI_INFO_NULL )); /* Write into file */ - CHECK(MPI_File_write_at( fileh, (MPI_Offset)rank, (void*)&sample_i, 1, + CHECK(MPI_File_write_at( fileh, (MPI_Offset)rank, (void*)&sample_i, 1, MPI_INT, MPI_STATUS_IGNORE )); /* Close file */ diff --git a/ompi/mca/io/romio314/romio/test/fcoll_test.f.in b/ompi/mca/io/romio321/romio/test/fcoll_test.f.in similarity index 96% rename from ompi/mca/io/romio314/romio/test/fcoll_test.f.in rename to ompi/mca/io/romio321/romio/test/fcoll_test.f.in index 57551d5a6a..d6bae7446c 100644 --- a/ompi/mca/io/romio314/romio/test/fcoll_test.f.in +++ b/ompi/mca/io/romio321/romio/test/fcoll_test.f.in @@ -1,5 +1,5 @@ -! -*- Mode: Fortran; -*- -! +! -*- Mode: Fortran; -*- +! ! (C) 2001 by Argonne National Laboratory. ! See COPYRIGHT in top-level directory. ! @@ -11,7 +11,7 @@ ! Fortran equivalent of coll_test.c - integer FILESIZE + integer FILESIZE parameter (FILESIZE=32*32*32*4) ! A 32^3 array. For other array sizes, change FILESIZE above and @@ -22,7 +22,7 @@ ! back, and checks that the data read is correct. ! Note that the file access pattern is noncontiguous. - + integer newtype, i, ndims, array_of_gsizes(3) integer order, intsize, nprocs, j, array_of_distribs(3) integer array_of_dargs(3), array_of_psizes(3) @@ -39,7 +39,7 @@ call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, ierr) call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr) -! process 0 takes the file name as a command-line argument and +! process 0 takes the file name as a command-line argument and ! broadcasts it to other processes if (mynod .eq. 0) then @@ -61,14 +61,14 @@ @F77GETARG@ call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & & MPI_COMM_WORLD, ierr) - else + else call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & & MPI_COMM_WORLD, ierr) end if ! create the distributed array filetype - + ndims = 3 order = MPI_ORDER_FORTRAN @@ -96,12 +96,12 @@ call MPI_TYPE_COMMIT(newtype, ierr) -! initialize writebuf +! initialize writebuf call MPI_TYPE_SIZE(newtype, bufcount, ierr) call MPI_TYPE_SIZE(MPI_INTEGER, intsize, ierr) bufcount = bufcount/intsize - do i=1, bufcount + do i=1, bufcount writebuf(i) = 1 end do @@ -132,7 +132,7 @@ call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - disp = 0 + disp = 0 call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, "native", & & MPI_INFO_NULL, ierr) call MPI_FILE_WRITE_ALL(fh, writebuf, bufcount, MPI_INTEGER, & @@ -143,7 +143,7 @@ call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - + call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, "native", & & MPI_INFO_NULL, ierr) call MPI_FILE_READ_ALL(fh, readbuf, bufcount, MPI_INTEGER, & @@ -161,7 +161,7 @@ call MPI_TYPE_FREE(newtype, ierr) call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, & - $ MPI_COMM_WORLD, ierr ) + $ MPI_COMM_WORLD, ierr ) if (mynod .eq. 0) then if( toterrs .gt. 0 ) then print *, 'Found ', toterrs, ' errors' @@ -172,5 +172,4 @@ call MPI_FINALIZE(ierr) - stop end diff --git a/ompi/mca/io/romio314/romio/test/file_info.c b/ompi/mca/io/romio321/romio/test/file_info.c similarity index 96% rename from ompi/mca/io/romio314/romio/test/file_info.c rename to ompi/mca/io/romio321/romio/test/file_info.c index 066915f88d..fba618974f 100644 --- a/ompi/mca/io/romio314/romio/test/file_info.c +++ b/ompi/mca/io/romio321/romio/test/file_info.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -44,10 +44,10 @@ hint_defaults UFS_DEFAULTS = { }; hint_defaults BLUEGENE_DEFAULTS = { - .cb_buffer_size = 16777216, - .ind_rd_buffer_size = 4194304, - .ind_wr_buffer_size = 4194304, - .romio_cb_read = "enable", + .cb_buffer_size = 16777216, + .ind_rd_buffer_size = 4194304, + .ind_wr_buffer_size = 4194304, + .romio_cb_read = "enable", .romio_cb_write = "enable", .cb_config_list = NULL}; @@ -76,7 +76,7 @@ int main(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mynod); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -119,7 +119,7 @@ int main(int argc, char **argv) /* open the file with MPI_INFO_NULL */ - ret = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, + ret = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); if (ret != MPI_SUCCESS) handle_error(ret, "MPI_File_open"); @@ -132,8 +132,8 @@ int main(int argc, char **argv) MPI_Info_get_nthkey(info_used, i, key); MPI_Info_get(info_used, key, MPI_MAX_INFO_VAL-1, value, &flag); #ifdef INFO_DEBUG - if (!mynod) - fprintf(stderr, "Process %d, Default: key = %s, value = %s\n", mynod, + if (!mynod) + fprintf(stderr, "Process %d, Default: key = %s, value = %s\n", mynod, key, value); #endif if (!strcmp("striping_factor", key)) { @@ -249,13 +249,13 @@ int main(int argc, char **argv) MPI_Info_set(info, "ind_wr_buffer_size", "1048576"); -/* The following three hints related to file striping are accepted only - on Intel PFS and IBM PIOFS file systems and are ignored elsewhere. - They can be specified only at file-creation time; if specified later +/* The following three hints related to file striping are accepted only + on Intel PFS and IBM PIOFS file systems and are ignored elsewhere. + They can be specified only at file-creation time; if specified later they will be ignored. */ /* number of I/O devices across which the file will be striped. - accepted only if 0 < value < default_striping_factor; + accepted only if 0 < value < default_striping_factor; ignored otherwise */ if (default_striping_factor - 1 > 0) { sprintf(value, "%d", default_striping_factor-1); @@ -275,18 +275,18 @@ int main(int argc, char **argv) #endif /* the I/O device number from which to start striping the file. - accepted only if 0 <= value < default_striping_factor; + accepted only if 0 <= value < default_striping_factor; ignored otherwise */ sprintf(value, "%d", default_striping_factor-2); MPI_Info_set(info, "start_iodevice", value); -/* The following hint about PFS server buffering is accepted only on - Intel PFS. It can be specified anytime. */ +/* The following hint about PFS server buffering is accepted only on + Intel PFS. It can be specified anytime. */ MPI_Info_set(info, "pfs_svr_buf", "true"); /* open the file and set new info */ - ret = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, + ret = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, info, &fh); if (ret != MPI_SUCCESS) handle_error(ret, "MPI_File_open"); @@ -298,8 +298,8 @@ int main(int argc, char **argv) for (i=0; i #include -/* Writes a 4-Gbyte distributed array, reads it back, and then deletes the +/* Writes a 4-Gbyte distributed array, reads it back, and then deletes the file. Uses collective I/O. */ /* The file name is taken as a command-line argument. */ /* Run it only on a machine with sufficient memory and a file system on which ROMIO supports large files, i.e., PIOFS, XFS, SFS, and HFS */ -/* This program will work only if the MPI implementation defines MPI_Aint +/* This program will work only if the MPI implementation defines MPI_Aint as a 64-bit integer. */ - + int main(int argc, char **argv) { MPI_Datatype newtype; @@ -35,7 +35,7 @@ int main(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mynod); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -78,7 +78,7 @@ int main(int argc, char **argv) for (i=0; i #include -/* writes a file of size 4 Gbytes and reads it back. +/* writes a file of size 4 Gbytes and reads it back. should be run on one process only*/ /* The file name is taken as a command-line argument. */ -/* Can be used only on file systems on which ROMIO supports large files, +/* Can be used only on file systems on which ROMIO supports large files, i.e., PIOFS, XFS, SFS, and HFS. */ - + #define SIZE 1048576*4 /* no. of long longs in each write/read */ #define NTIMES 128 /* no. of writes/reads */ @@ -63,7 +63,7 @@ int main(int argc, char **argv) for (i=0; irefct = 1; + array->refct = 1; if (commrank == 0) { /* process 0 keeps the real list */ @@ -102,7 +102,7 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) procname = array->names; /* simpler to read */ procname_len = (int *) ADIOI_Malloc(commsize * sizeof(int)); - if (procname_len == NULL) { + if (procname_len == NULL) { return -1; } } @@ -112,7 +112,7 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) array->names = NULL; } /* gather lengths first */ - MPI_Gather(&my_procname_len, 1, MPI_INT, + MPI_Gather(&my_procname_len, 1, MPI_INT, procname_len, 1, MPI_INT, 0, comm); if (commrank == 0) { @@ -125,7 +125,7 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) for (i=0; i < commsize; i++) { /* add one to the lengths because we need to count the * terminator, and we are going to use this list of lengths - * again in the gatherv. + * again in the gatherv. */ procname_len[i]++; procname[i] = malloc(procname_len[i]); @@ -133,12 +133,12 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) return -1; } } - + /* create our list of displacements for the gatherv. we're going * to do everything relative to the start of the region allocated * for procname[0] * - * I suppose it is theoretically possible that the distance between + * I suppose it is theoretically possible that the distance between * malloc'd regions could be more than will fit in an int. We don't * cover that case. */ @@ -152,7 +152,7 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) /* now gather strings */ if (commrank == 0) { - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, + MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, procname[0], procname_len, disp, MPI_CHAR, 0, comm); } @@ -160,7 +160,7 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) /* if we didn't do this, we would need to allocate procname[] * on all processes...which seems a little silly. */ - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, + MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, NULL, NULL, NULL, MPI_CHAR, 0, comm); } @@ -195,7 +195,7 @@ void default_str(int mynod, int len, ADIO_cb_name_array array, char *dest) } MPI_Bcast(dest, len, MPI_CHAR, 0, MPI_COMM_WORLD); } -void reverse_str(int mynod, int len, ADIO_cb_name_array array, char *dest) +void reverse_str(int mynod, int len, ADIO_cb_name_array array, char *dest) { char *ptr; int i, p; @@ -261,10 +261,10 @@ int main(int argc, char **argv) MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); + MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - /* process 0 takes the file name as a command-line argument and + + /* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -323,7 +323,7 @@ int main(int argc, char **argv) errs += test_file(filename, mynod, nprocs, cb_config_string, "collective w/ hinting: default order", verbose); /* reverse order */ - reverse_str(mynod, cb_config_len, array, cb_config_string); + reverse_str(mynod, cb_config_len, array, cb_config_string); errs += test_file(filename, mynod, nprocs, cb_config_string, "collective w/ hinting: reverse order", verbose); /* reverse, every other */ @@ -335,7 +335,7 @@ int main(int argc, char **argv) errs += test_file(filename, mynod, nprocs, cb_config_string, "collective w/ hinting: permutation2", verbose); MPI_Allreduce(&errs, &sum_errs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - + if (!mynod) { if (sum_errs) fprintf(stderr, "Found %d error cases\n", sum_errs); else printf(" No Errors\n"); @@ -348,7 +348,7 @@ int main(int argc, char **argv) #define SEEDER(x,y,z) ((x)*1000000 + (y) + (x)*(z)) -int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, const char *msg, int verbose) +int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, const char *msg, int verbose) { MPI_Datatype typevec, newtype, t[3]; int *buf, i, b[3], errcode, errors=0; @@ -394,7 +394,7 @@ int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, const char } MPI_Barrier(MPI_COMM_WORLD); - errcode = MPI_File_open(MPI_COMM_WORLD, filename, + errcode = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, info, &fh); if (errcode != MPI_SUCCESS) { handle_error(errcode, "MPI_File_open"); @@ -418,7 +418,7 @@ int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, const char } /* the verification for N compute nodes is tricky. Say we have 3 - * processors. + * processors. * process 0 sees: 0 -1 -1 3 -1 -1 ... * process 1 sees: -1 34 -1 -1 37 -1 ... * process 2 sees: -1 -1 68 -1 -1 71 ... */ @@ -436,7 +436,7 @@ int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, const char for(/* 'i' set in above loop */; i #include -/* A simple performance test. The file name is taken as a +/* A simple performance test. The file name is taken as a command-line argument. */ #define SIZE (1048576*4) /* read/write size per node in bytes */ @@ -26,7 +26,7 @@ int main(int argc, char **argv) MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &mynod); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!mynod) { i = 1; @@ -56,7 +56,7 @@ int main(int argc, char **argv) buf = (int *) malloc(SIZE); for (j=0; j ${bfile}.tout if diff -b $bfile.tout $stdfile > /dev/null ; then true - elif [ -s $stdfile2 ] ; then + elif [ -s $stdfile2 ] ; then # check for alternate in case configuration has fewer datatypes if diff -b $bfile.tout $stdfile2 > /dev/null ; then true @@ -150,7 +150,7 @@ RunTest() { rm -rf $FILENAME* echo "**** Testing ${1}.c ****" mpirun -np 4 ./${1} -fname $FILENAME "$@" >>${1}.out 2>1 - CheckOutput ${1} + CheckOutput ${1} CleanExe ${1} } @@ -194,13 +194,13 @@ $mpirun -np 4 ./async-multiple -fname $FILENAME CleanExe async-multiple # OutTime -if [ $subset_only -eq 0 ] ; then +if [ $subset_only -eq 0 ] ; then testfiles="$testfiles atomicity.out" \rm -f atomicity.out MakeExe atomicity \rm -f $FILENAME* echo '**** Testing atomicity.c ****' - # Atomicity test recommends at least 8 processes (separate processors + # Atomicity test recommends at least 8 processes (separate processors # even better) $mpirun -np 4 ./atomicity -fname $FILENAME # CheckOutput atomicity @@ -300,7 +300,7 @@ CleanExe hindexed # -offm 4 -hints romio_cb_write enable -fname $FILENAME #CleanExe write_all_test OutTime -if [ $subset_only -eq 0 ] ; then +if [ $subset_only -eq 0 ] ; then testfiles="$testfiles misc.out" \rm -f misc.out MakeExe misc @@ -386,8 +386,13 @@ MakeExe darray_read echo '**** Testing darray_read ****' $mpirun -np 4 ./darray_read $FILENAME CleanExe darray_read +MakeExe syshints +echo '**** Testing syshints ****' +$mpirun -np 1 ./syshints $srcdir/test_hintfile +CleanExe syshints + # -if [ @NOF77@ = 0 ] ; then +if [ @NOF77@ = 0 ] ; then echo "" echo "FORTRAN TESTS" OutTime @@ -439,7 +444,7 @@ fi # nodiff=1 # for file in $testfiles ; do # stdfile="${srcdir}/std/`basename $file .out`.std" -# # if basename is sendrecv or isndrcv, then we may want to test +# # if basename is sendrecv or isndrcv, then we may want to test # # with .std2 as well. We should really separate out the long double # # tests ... # if [ -s $stdfile ] ; then @@ -450,7 +455,7 @@ fi # grep -v 'FORTRAN STOP' ${file} > ${bfile} # if diff -b $bfile $stdfile > /dev/null ; then # true -# elif [ -s $stdfile2 ] ; then +# elif [ -s $stdfile2 ] ; then # # check for alternate in case configuration has fewer datatypes # if diff -b $bfile $stdfile2 > /dev/null ; then # true @@ -476,4 +481,4 @@ fi # echo "-- No differences found; test successful" # fi exit 0 - + diff --git a/ompi/mca/io/romio314/romio/test/shared_fp.c b/ompi/mca/io/romio321/romio/test/shared_fp.c similarity index 91% rename from ompi/mca/io/romio314/romio/test/shared_fp.c rename to ompi/mca/io/romio321/romio/test/shared_fp.c index 26f3770c8b..df41bdd818 100644 --- a/ompi/mca/io/romio314/romio/test/shared_fp.c +++ b/ompi/mca/io/romio321/romio/test/shared_fp.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -12,7 +12,7 @@ void handle_error(int errcode, const char *str); -void handle_error(int errcode, const char *str) +void handle_error(int errcode, const char *str) { char msg[MPI_MAX_ERROR_STRING]; int resultlen; @@ -34,7 +34,7 @@ int main(int argc, char **argv) MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); -/* process 0 takes the file name as a command-line argument and +/* process 0 takes the file name as a command-line argument and broadcasts it to other processes */ if (!rank) { i = 1; @@ -58,7 +58,7 @@ int main(int argc, char **argv) filename = (char *) malloc(len+10); MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); } - + buf = (int *) malloc(COUNT * sizeof(int)); MPI_Comm_rank(MPI_COMM_WORLD, &rank); @@ -66,7 +66,7 @@ int main(int argc, char **argv) for (i=0; i +#include +#include +#include + +static void handle_error(int errcode, const char *str) +{ + char msg[MPI_MAX_ERROR_STRING]; + int resultlen; + MPI_Error_string(errcode, msg, &resultlen); + fprintf(stderr, "%s: %s\n", str, msg); + MPI_Abort(MPI_COMM_WORLD, 1); +} + +#define CHECK(fn) {int errcode; errcode = (fn); if (errcode != MPI_SUCCESS) handle_error(errcode, #fn); } + +static int hint_check(MPI_Info info_used, const char * key, const char *expected) { + char value[MPI_MAX_INFO_VAL+1]; + int flag; + + CHECK(MPI_Info_get(info_used, key, MPI_MAX_INFO_VAL, value, &flag)); + if (strcmp(expected, value) ){ + fprintf(stderr, "expected value \"%s\" for key \"%s\" got \"%s\"\n", + expected, key, value); + return 1; + } + return 0; +} + +int main(int argc, char ** argv) +{ + setenv("ROMIO_HINTS", argv[1], 1); + MPI_File fh; + MPI_Info info_used, info_mine; + int nr_errors=0; + + MPI_Init(&argc, &argv); + MPI_Info_create(&info_mine); + MPI_Info_set(info_mine, "romio_cb_read", "disable"); + CHECK(MPI_File_open(MPI_COMM_WORLD, argv[1], MPI_MODE_RDONLY, info_mine, &fh)); + CHECK(MPI_File_get_info(fh, &info_used)); + + nr_errors += hint_check(info_used, "ind_rd_buffer_size", "49"); + nr_errors += hint_check(info_used, "romio_no_indep_rw", "true"); + + if (nr_errors == 0) printf(" No Errors\n"); + + CHECK(MPI_Info_free(&info_mine)); + CHECK(MPI_Info_free(&info_used)); + CHECK(MPI_File_close(&fh)); + MPI_Finalize(); + return nr_errors; +} diff --git a/ompi/mca/io/romio321/romio/test/test_hintfile b/ompi/mca/io/romio321/romio/test/test_hintfile new file mode 100644 index 0000000000..edb72b0d6c --- /dev/null +++ b/ompi/mca/io/romio321/romio/test/test_hintfile @@ -0,0 +1,6 @@ +romio_cb_read enable +# multiple info keys are strage but not an error. Note only the first one will +# be processed +ind_rd_buffer_size 49 +ind_rd_buffer_size 60 +romio_no_indep_rw true diff --git a/ompi/mca/io/romio314/romio/test/types_with_zeros.c b/ompi/mca/io/romio321/romio/test/types_with_zeros.c similarity index 94% rename from ompi/mca/io/romio314/romio/test/types_with_zeros.c rename to ompi/mca/io/romio321/romio/test/types_with_zeros.c index 6a2afe1ca3..e2f7799605 100644 --- a/ompi/mca/io/romio314/romio/test/types_with_zeros.c +++ b/ompi/mca/io/romio321/romio/test/types_with_zeros.c @@ -1,3 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + #include #include #include @@ -70,7 +76,7 @@ static int test_indexed_with_zeros(char *filename, int testcase) MPI_Type_indexed(num, blocklen, indices, MPI_INT, &filetype); break; case HINDEXED: - MPI_Type_create_hindexed(num, blocklen, addrs, MPI_INT, &filetype); + MPI_Type_hindexed(num, blocklen, addrs, MPI_INT, &filetype); break; case STRUCT: MPI_Type_create_struct(num, blocklen, addrs, types, &filetype); diff --git a/ompi/mca/io/romio314/romio/util/nfslock.c b/ompi/mca/io/romio321/romio/util/nfslock.c similarity index 96% rename from ompi/mca/io/romio314/romio/util/nfslock.c rename to ompi/mca/io/romio321/romio/util/nfslock.c index f5209ec28c..69d5e7995c 100644 --- a/ompi/mca/io/romio314/romio/util/nfslock.c +++ b/ompi/mca/io/romio321/romio/util/nfslock.c @@ -1,5 +1,5 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* +/* * (C) 2004 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ @@ -9,21 +9,21 @@ #include /* - * This program tests to see if fcntl returns success when asked to + * This program tests to see if fcntl returns success when asked to * establish a file lock. This test is intended for use on file systems * such as NFS that may not implement file locks. ROMIO makes use * of file locks to implement certain operations, and may not work - * properly if file locks are not available. + * properly if file locks are not available. * * This is a simple test and has at least two limitations: - * - * 1. Some implementations of NFS are known to return success for + * + * 1. Some implementations of NFS are known to return success for * setting a file lock when in fact no lock has been set. This * test will not detect such erroneous implementations of NFS * * 2. Some implementations will hang (enter and wait indefinitately) * within the fcntl call. This program will also hang in that case. - * Under normal conditions, this program should only take a few seconds to + * Under normal conditions, this program should only take a few seconds to * run. * * The program prints a message showing the success or failure of @@ -48,7 +48,7 @@ int main( int argc, char *argv[] ) filename = "conftest.dat"; } - + lock.l_type = F_WRLCK; lock.l_start = 0; lock.l_whence = SEEK_SET; diff --git a/ompi/mca/io/romio314/romio/util/romioinstall.in b/ompi/mca/io/romio321/romio/util/romioinstall.in similarity index 93% rename from ompi/mca/io/romio314/romio/util/romioinstall.in rename to ompi/mca/io/romio321/romio/util/romioinstall.in index e80027a2a5..95a6309231 100644 --- a/ompi/mca/io/romio314/romio/util/romioinstall.in +++ b/ompi/mca/io/romio321/romio/util/romioinstall.in @@ -2,7 +2,7 @@ # # This script needs to be built by configure. # -# This is a script to install ROMIO. It can be invoked with +# This is a script to install ROMIO. It can be invoked with # make install # # (if you used -prefix at configure time) or, @@ -47,8 +47,8 @@ failmode=soft # Shell procedures to copy files and create directories # -# We could use install, but install is too different and too hard to -# test. So here are the routines to copy file, make directories, and +# We could use install, but install is too different and too hard to +# test. So here are the routines to copy file, make directories, and # replace #...# and @...@ in files CP=cp # @@ -72,14 +72,14 @@ elif [ -d $1 ] ; then echo ">>> $1 is a directory; not copied <<<" errs=`expr $errs + 1` if [ $failmode = "hard" ] ; then exit 1 ; fi -elif [ ! -f $1 ] ; then +elif [ ! -f $1 ] ; then echo "**File $1 does not exist (or is not a regular file)!" errs=`expr $errs + 1` if [ $failmode = "hard" ] ; then exit 1 ; fi else if [ $verbose = 1 ] ; then echo "Copying $1 to $dest" ; fi # We don't delete the file in the event that we are copying the - # file over itself (we SHOULD check for that separately, by checking + # file over itself (we SHOULD check for that separately, by checking # that directories are distinct) #if [ -f $dest ] ; then $Show rm -f $dest ; fi $Show $CP $1 $dest @@ -111,7 +111,7 @@ CopyFileP() { # for arg in "$@" ; do - case "$arg" in + case "$arg" in -prefix=*) PREFIX=`echo $arg | sed -e 's/-prefix=//'` prefix=$PREFIX @@ -132,7 +132,7 @@ if test -z "$prefix" ; then fi # Uninstall filename -if [ -z "$UNINSTALLFILE" ] ; then +if [ -z "$UNINSTALLFILE" ] ; then UNINSTALLFILE="$sbindir/romiouninstall" MkDir `dirname $UNINSTALLFILE` fi @@ -162,13 +162,13 @@ if test "$WANT_INSTALL" = "1"; then #cp -r $ROMIO_HOME/lib $PREFIX #chmod 755 $PREFIX/lib for file in $TOP_BUILD_DIR/lib/* ; do - if [ -f $file ] ; then - CopyFileP $file $libdir + if [ -f $file ] ; then + CopyFileP $file $libdir fi done - # Romio also copies directories in the lib directory. + # Romio also copies directories in the lib directory. - if [ -z "$mandir" ] ; then + if [ -z "$mandir" ] ; then mandir=$PREFIX/man fi echo "copying directory $ROMIO_HOME/man to $mandir" @@ -182,7 +182,7 @@ if test "$WANT_INSTALL" = "1"; then echo "copying directory $ROMIO_HOME/test to $exampledir" MkDir $exampledir MkDir $exampledir/std - for file in $ROMIO_HOME/test/std/* ; do + for file in $ROMIO_HOME/test/std/* ; do CopyFile $file $exampledir/std done CopyFile test/Makefile $exampledir @@ -201,9 +201,9 @@ if test "$WANT_INSTALL" = "1"; then NEWLIB=`echo $TMPNEWLIB | sed 's/\//\\\\\//g'` sed -e 5s/INCLUDE_DIR[\ ]*=\ [/a-z0-9.A-Z_-]*/INCLUDE_DIR\ =\ $NEWINC/ \ -e 6s/LIBS[\ ]*=\ [/a-z0-9.A-Z_-]*/LIBS\ =\ $NEWLIB/ $exampledir/Makefile\ - > $exampledir/.romiotmp + > $exampledir/.romiotmp mv $exampledir/.romiotmp $exampledir/Makefile - + # MkDir $sbindir echo "rm -f $UNINSTALLFILE" >> $UNINSTALLFILE diff --git a/ompi/mca/io/romio314/romio/util/tarch b/ompi/mca/io/romio321/romio/util/tarch similarity index 94% rename from ompi/mca/io/romio314/romio/util/tarch rename to ompi/mca/io/romio321/romio/util/tarch index bc077f31a7..ccccf4d514 100755 --- a/ompi/mca/io/romio314/romio/util/tarch +++ b/ompi/mca/io/romio321/romio/util/tarch @@ -55,7 +55,7 @@ for LARCH in $ARCHLIST ; do case $LARCH in SUPER-UX) FARCH=SX4; break ;; AIX|RIOS) FARCH=rs6000; break ;; - HP-UX) + HP-UX) if [ -a /dev/kmem ] ; then FARCH=hpux ; else @@ -68,9 +68,9 @@ for LARCH in $ARCHLIST ; do GARCH=$LARCH ;; sun4*) Version=`$UNAME -r` - # In "improving" SunOS, the useful feature of "substr" was withdrawn - # from expr. Can't let the users have life too easy, can we? This - # means that we can't just use + # In "improving" SunOS, the useful feature of "substr" was withdrawn + # from expr. Can't let the users have life too easy, can we? This + # means that we can't just use # set MajorVersion = `expr substr $Version 1 1` # because it won't work on Solaris systems. The following should work # on both: @@ -93,8 +93,8 @@ for LARCH in $ARCHLIST ; do break ;; mips|dec-5000) FARCH=dec5000 ; break ;; - next) FARCH=NeXT ; break ;; - KSR1|KSR2) FARCH=ksr ; break ;; + next) FARCH=NeXT ; break ;; + KSR1|KSR2) FARCH=ksr ; break ;; FreeBSD) FARCH=freebsd ; break ;; OpenBSD) FARCH=openbsd ; break ;; NetBSD) FARCH=netbsd ; break ;; diff --git a/ompi/mca/io/romio314/src/Makefile.extra b/ompi/mca/io/romio321/src/Makefile.extra similarity index 73% rename from ompi/mca/io/romio314/src/Makefile.extra rename to ompi/mca/io/romio321/src/Makefile.extra index 76174cafd8..0ed9b27b34 100644 --- a/ompi/mca/io/romio314/src/Makefile.extra +++ b/ompi/mca/io/romio321/src/Makefile.extra @@ -11,6 +11,8 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -32,16 +34,16 @@ AM_CPPFLAGS = \ -I$(OMPI_TOP_BUILDDIR)/ompi/include \ -I$(OMPI_TOP_SRCDIR)/ompi \ -I$(OMPI_TOP_SRCDIR)/ompi/include \ - -I$(OMPI_TOP_SRCDIR)/ompi/mca/io/romio314 \ - -I$(OMPI_TOP_SRCDIR)/ompi/mca/io/romio314/romio/include \ - -I$(OMPI_TOP_SRCDIR)/ompi/mca/io/romio314/romio/adio/include \ + -I$(OMPI_TOP_SRCDIR)/ompi/mca/io/romio321 \ + -I$(OMPI_TOP_SRCDIR)/ompi/mca/io/romio321/romio/include \ + -I$(OMPI_TOP_SRCDIR)/ompi/mca/io/romio321/romio/adio/include \ -I$(top_builddir) sources += \ - src/io_romio314.h \ - src/io_romio314_component.c \ - src/io_romio314_file_open.c \ - src/io_romio314_file_read.c \ - src/io_romio314_file_write.c \ - src/io_romio314_module.c + src/io_romio321.h \ + src/io_romio321_component.c \ + src/io_romio321_file_open.c \ + src/io_romio321_file_read.c \ + src/io_romio321_file_write.c \ + src/io_romio321_module.c diff --git a/ompi/mca/io/romio314/src/io_romio314.h b/ompi/mca/io/romio321/src/io_romio321.h similarity index 74% rename from ompi/mca/io/romio314/src/io_romio314.h rename to ompi/mca/io/romio321/src/io_romio321.h index 0ea00dd486..b1c14b2d8c 100644 --- a/ompi/mca/io/romio314/src/io_romio314.h +++ b/ompi/mca/io/romio321/src/io_romio321.h @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -20,8 +20,8 @@ * $HEADER$ */ -#ifndef MCA_IO_ROMIO314_H -#define MCA_IO_ROMIO314_H +#ifndef MCA_IO_ROMIO321_H +#define MCA_IO_ROMIO321_H #include "ompi_config.h" #include "opal/threads/mutex.h" @@ -34,22 +34,22 @@ BEGIN_C_DECLS -OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio314_component; +OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio321_component; /* * global variables, instantiated in module.c */ -extern opal_mutex_t mca_io_romio314_mutex; -extern mca_io_base_module_2_0_0_t mca_io_romio314_module; -OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio314_component; +extern opal_mutex_t mca_io_romio321_mutex; +extern mca_io_base_module_2_0_0_t mca_io_romio321_module; +OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio321_component; /* * Private data for ROMIO modules */ -struct mca_io_romio314_data_t { +struct mca_io_romio321_data_t { ROMIO_PREFIX (MPI_File) romio_fh; }; -typedef struct mca_io_romio314_data_t mca_io_romio314_data_t; +typedef struct mca_io_romio321_data_t mca_io_romio321_data_t; /* @@ -64,84 +64,84 @@ typedef struct mca_io_romio314_data_t mca_io_romio314_data_t; * ROMIO_PREFIX(MPI_File_XXX) */ /* Section 9.2 */ -int mca_io_romio314_file_open (struct ompi_communicator_t *comm, +int mca_io_romio321_file_open (struct ompi_communicator_t *comm, const char *filename, int amode, struct opal_info_t *info, ompi_file_t *fh); -int mca_io_romio314_file_close (struct ompi_file_t *fh); -int mca_io_romio314_file_delete (const char *filename, +int mca_io_romio321_file_close (struct ompi_file_t *fh); +int mca_io_romio321_file_delete (const char *filename, struct opal_info_t *info); -int mca_io_romio314_file_set_size (struct ompi_file_t *fh, +int mca_io_romio321_file_set_size (struct ompi_file_t *fh, MPI_Offset size); -int mca_io_romio314_file_preallocate (struct ompi_file_t *fh, +int mca_io_romio321_file_preallocate (struct ompi_file_t *fh, MPI_Offset size); -int mca_io_romio314_file_get_size (struct ompi_file_t *fh, +int mca_io_romio321_file_get_size (struct ompi_file_t *fh, MPI_Offset * size); -int mca_io_romio314_file_get_amode (struct ompi_file_t *fh, +int mca_io_romio321_file_get_amode (struct ompi_file_t *fh, int *amode); -int mca_io_romio314_file_set_info (struct ompi_file_t *fh, +int mca_io_romio321_file_set_info (struct ompi_file_t *fh, struct opal_info_t *info); -int mca_io_romio314_file_get_info (struct ompi_file_t *fh, +int mca_io_romio321_file_get_info (struct ompi_file_t *fh, struct opal_info_t ** info_used); /* Section 9.3 */ -int mca_io_romio314_file_set_view (struct ompi_file_t *fh, +int mca_io_romio321_file_set_view (struct ompi_file_t *fh, MPI_Offset disp, struct ompi_datatype_t *etype, struct ompi_datatype_t *filetype, const char *datarep, struct opal_info_t *info); -int mca_io_romio314_file_get_view (struct ompi_file_t *fh, +int mca_io_romio321_file_get_view (struct ompi_file_t *fh, MPI_Offset * disp, struct ompi_datatype_t ** etype, struct ompi_datatype_t ** filetype, char *datarep); /* Section 9.4.2 */ -int mca_io_romio314_file_read_at (struct ompi_file_t *fh, +int mca_io_romio321_file_read_at (struct ompi_file_t *fh, MPI_Offset offset, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_read_at_all (struct ompi_file_t *fh, +int mca_io_romio321_file_read_at_all (struct ompi_file_t *fh, MPI_Offset offset, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_write_at (struct ompi_file_t *fh, +int mca_io_romio321_file_write_at (struct ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_write_at_all (struct ompi_file_t *fh, +int mca_io_romio321_file_write_at_all (struct ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_iread_at (struct ompi_file_t *fh, +int mca_io_romio321_file_iread_at (struct ompi_file_t *fh, MPI_Offset offset, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iread_at_all (struct ompi_file_t *fh, +int mca_io_romio321_file_iread_at_all (struct ompi_file_t *fh, MPI_Offset offset, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iwrite_at (struct ompi_file_t *fh, +int mca_io_romio321_file_iwrite_at (struct ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iwrite_at_all (struct ompi_file_t *fh, +int mca_io_romio321_file_iwrite_at_all (struct ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, @@ -149,151 +149,151 @@ int mca_io_romio314_file_iwrite_at_all (struct ompi_file_t *fh, ompi_request_t **request); /* Section 9.4.3 */ -int mca_io_romio314_file_read (struct ompi_file_t *fh, +int mca_io_romio321_file_read (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_read_all (struct ompi_file_t *fh, +int mca_io_romio321_file_read_all (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_write (struct ompi_file_t *fh, +int mca_io_romio321_file_write (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_write_all (struct ompi_file_t *fh, +int mca_io_romio321_file_write_all (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_iread (struct ompi_file_t *fh, +int mca_io_romio321_file_iread (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iread_all (struct ompi_file_t *fh, +int mca_io_romio321_file_iread_all (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iwrite (struct ompi_file_t *fh, +int mca_io_romio321_file_iwrite (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iwrite_all (struct ompi_file_t *fh, +int mca_io_romio321_file_iwrite_all (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_seek (struct ompi_file_t *fh, +int mca_io_romio321_file_seek (struct ompi_file_t *fh, MPI_Offset offset, int whence); -int mca_io_romio314_file_get_position (struct ompi_file_t *fh, +int mca_io_romio321_file_get_position (struct ompi_file_t *fh, MPI_Offset * offset); -int mca_io_romio314_file_get_byte_offset (struct ompi_file_t *fh, +int mca_io_romio321_file_get_byte_offset (struct ompi_file_t *fh, MPI_Offset offset, MPI_Offset * disp); /* Section 9.4.4 */ -int mca_io_romio314_file_read_shared (struct ompi_file_t *fh, +int mca_io_romio321_file_read_shared (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_write_shared (struct ompi_file_t *fh, +int mca_io_romio321_file_write_shared (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_iread_shared (struct ompi_file_t *fh, +int mca_io_romio321_file_iread_shared (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_iwrite_shared (struct ompi_file_t *fh, +int mca_io_romio321_file_iwrite_shared (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); -int mca_io_romio314_file_read_ordered (struct ompi_file_t *fh, +int mca_io_romio321_file_read_ordered (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_write_ordered (struct ompi_file_t *fh, +int mca_io_romio321_file_write_ordered (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); -int mca_io_romio314_file_seek_shared (struct ompi_file_t *fh, +int mca_io_romio321_file_seek_shared (struct ompi_file_t *fh, MPI_Offset offset, int whence); -int mca_io_romio314_file_get_position_shared (struct ompi_file_t *fh, +int mca_io_romio321_file_get_position_shared (struct ompi_file_t *fh, MPI_Offset * offset); /* Section 9.4.5 */ -int mca_io_romio314_file_read_at_all_begin (struct ompi_file_t *fh, +int mca_io_romio321_file_read_at_all_begin (struct ompi_file_t *fh, MPI_Offset offset, void *buf, int count, struct ompi_datatype_t *datatype); -int mca_io_romio314_file_read_at_all_end (struct ompi_file_t *fh, +int mca_io_romio321_file_read_at_all_end (struct ompi_file_t *fh, void *buf, ompi_status_public_t * status); -int mca_io_romio314_file_write_at_all_begin (struct ompi_file_t *fh, +int mca_io_romio321_file_write_at_all_begin (struct ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, struct ompi_datatype_t *datatype); -int mca_io_romio314_file_write_at_all_end (struct ompi_file_t *fh, +int mca_io_romio321_file_write_at_all_end (struct ompi_file_t *fh, const void *buf, ompi_status_public_t * status); -int mca_io_romio314_file_read_all_begin (struct ompi_file_t *fh, +int mca_io_romio321_file_read_all_begin (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype); -int mca_io_romio314_file_read_all_end (struct ompi_file_t *fh, +int mca_io_romio321_file_read_all_end (struct ompi_file_t *fh, void *buf, ompi_status_public_t * status); -int mca_io_romio314_file_write_all_begin (struct ompi_file_t *fh, +int mca_io_romio321_file_write_all_begin (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype); -int mca_io_romio314_file_write_all_end (struct ompi_file_t *fh, +int mca_io_romio321_file_write_all_end (struct ompi_file_t *fh, const void *buf, ompi_status_public_t * status); -int mca_io_romio314_file_read_ordered_begin (struct ompi_file_t *fh, +int mca_io_romio321_file_read_ordered_begin (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype); -int mca_io_romio314_file_read_ordered_end (struct ompi_file_t *fh, +int mca_io_romio321_file_read_ordered_end (struct ompi_file_t *fh, void *buf, ompi_status_public_t * status); -int mca_io_romio314_file_write_ordered_begin (struct ompi_file_t *fh, +int mca_io_romio321_file_write_ordered_begin (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype); -int mca_io_romio314_file_write_ordered_end (struct ompi_file_t *fh, +int mca_io_romio321_file_write_ordered_end (struct ompi_file_t *fh, const void *buf, struct ompi_status_public_t * status); /* Section 9.5.1 */ -int mca_io_romio314_file_get_type_extent (struct ompi_file_t *fh, +int mca_io_romio321_file_get_type_extent (struct ompi_file_t *fh, struct ompi_datatype_t *datatype, MPI_Aint * extent); /* Section 9.6.1 */ -int mca_io_romio314_file_set_atomicity (struct ompi_file_t *fh, +int mca_io_romio321_file_set_atomicity (struct ompi_file_t *fh, int flag); -int mca_io_romio314_file_get_atomicity (struct ompi_file_t *fh, +int mca_io_romio321_file_get_atomicity (struct ompi_file_t *fh, int *flag); -int mca_io_romio314_file_sync (struct ompi_file_t *fh); +int mca_io_romio321_file_sync (struct ompi_file_t *fh); /* End Prototypes */ END_C_DECLS -#endif /* MCA_IO_ROMIO314_H */ +#endif /* MCA_IO_ROMIO321_H */ diff --git a/ompi/mca/io/romio314/src/io_romio314_component.c b/ompi/mca/io/romio321/src/io_romio321_component.c similarity index 85% rename from ompi/mca/io/romio314/src/io_romio314_component.c rename to ompi/mca/io/romio321/src/io_romio321_component.c index 6d53940b2c..e3dbbcf391 100644 --- a/ompi/mca/io/romio314/src/io_romio314_component.c +++ b/ompi/mca/io/romio321/src/io_romio321_component.c @@ -13,7 +13,7 @@ * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -30,7 +30,7 @@ #include "opal/threads/mutex.h" #include "opal/mca/base/base.h" #include "ompi/mca/io/io.h" -#include "io_romio314.h" +#include "io_romio321.h" #define ROMIO_VERSION_STRING "from MPICH v3.1.4" @@ -71,23 +71,23 @@ static int delete_priority_param = 20; /* * Global, component-wide ROMIO mutex because ROMIO is not thread safe */ -opal_mutex_t mca_io_romio314_mutex = {{0}}; +opal_mutex_t mca_io_romio321_mutex = {{0}}; /* * Public string showing this component's version number */ -const char *mca_io_romio314_component_version_string = +const char *mca_io_romio321_component_version_string = "OMPI/MPI ROMIO io MCA component version " OMPI_VERSION ", " ROMIO_VERSION_STRING; -mca_io_base_component_2_0_0_t mca_io_romio314_component = { +mca_io_base_component_2_0_0_t mca_io_romio321_component = { /* First, the mca_base_component_t struct containing meta information about the component itself */ .io_version = { MCA_IO_BASE_VERSION_2_0_0, - .mca_component_name = "romio314", + .mca_component_name = "romio321", MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION), .mca_open_component = open_component, @@ -113,44 +113,44 @@ mca_io_base_component_2_0_0_t mca_io_romio314_component = { .io_register_datarep = register_datarep, }; -static char *ompi_io_romio314_version = ROMIO_VERSION_STRING; -static char *ompi_io_romio314_user_configure_params = MCA_io_romio314_USER_CONFIGURE_FLAGS; -static char *ompi_io_romio314_complete_configure_params = MCA_io_romio314_COMPLETE_CONFIGURE_FLAGS; +static char *ompi_io_romio321_version = ROMIO_VERSION_STRING; +static char *ompi_io_romio321_user_configure_params = MCA_io_romio321_USER_CONFIGURE_FLAGS; +static char *ompi_io_romio321_complete_configure_params = MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS; static int register_component(void) { /* Use a low priority, but allow other components to be lower */ priority_param = 10; - (void) mca_base_component_var_register(&mca_io_romio314_component.io_version, + (void) mca_base_component_var_register(&mca_io_romio321_component.io_version, "priority", "Priority of the io romio component", MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, &priority_param); delete_priority_param = 10; - (void) mca_base_component_var_register(&mca_io_romio314_component.io_version, + (void) mca_base_component_var_register(&mca_io_romio321_component.io_version, "delete_priority", "Delete priority of the io romio component", MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, &delete_priority_param); - (void) mca_base_component_var_register(&mca_io_romio314_component.io_version, + (void) mca_base_component_var_register(&mca_io_romio321_component.io_version, "version", "Version of ROMIO", MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY, OPAL_INFO_LVL_9, - MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio314_version); - (void) mca_base_component_var_register(&mca_io_romio314_component.io_version, + MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio321_version); + (void) mca_base_component_var_register(&mca_io_romio321_component.io_version, "user_configure_params", "User-specified command line parameters passed to ROMIO's configure script", MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY, OPAL_INFO_LVL_9, - MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio314_user_configure_params); - (void) mca_base_component_var_register(&mca_io_romio314_component.io_version, + MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio321_user_configure_params); + (void) mca_base_component_var_register(&mca_io_romio321_component.io_version, "complete_configure_params", "Complete set of command line parameters passed to ROMIO's configure script", MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY, OPAL_INFO_LVL_9, - MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio314_complete_configure_params); + MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio321_complete_configure_params); return OMPI_SUCCESS; } @@ -158,7 +158,7 @@ static int register_component(void) static int open_component(void) { /* Create the mutex */ - OBJ_CONSTRUCT(&mca_io_romio314_mutex, opal_mutex_t); + OBJ_CONSTRUCT(&mca_io_romio321_mutex, opal_mutex_t); return OMPI_SUCCESS; } @@ -166,7 +166,7 @@ static int open_component(void) static int close_component(void) { - OBJ_DESTRUCT(&mca_io_romio314_mutex); + OBJ_DESTRUCT(&mca_io_romio321_mutex); return OMPI_SUCCESS; } @@ -189,14 +189,14 @@ file_query(struct ompi_file_t *file, struct mca_io_base_file_t **private_data, int *priority) { - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; *priority = priority_param; /* Allocate a space for this module to hang private data (e.g., the ROMIO file handle) */ - data = malloc(sizeof(mca_io_romio314_data_t)); + data = malloc(sizeof(mca_io_romio321_data_t)); if (NULL == data) { return NULL; } @@ -205,7 +205,7 @@ file_query(struct ompi_file_t *file, /* All done */ - return &mca_io_romio314_module; + return &mca_io_romio321_module; } @@ -249,9 +249,9 @@ static int delete_select(const char *filename, struct opal_info_t *info, opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_delete)(filename, ompi_info); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -267,10 +267,10 @@ register_datarep(const char * datarep, { int ret; - OPAL_THREAD_LOCK(&mca_io_romio314_mutex); + OPAL_THREAD_LOCK(&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_Register_datarep(datarep, read_fn, write_fn, extent_fn, state)); - OPAL_THREAD_UNLOCK(&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK(&mca_io_romio321_mutex); return ret; } diff --git a/ompi/mca/io/romio314/src/io_romio314_file_open.c b/ompi/mca/io/romio321/src/io_romio321_file_open.c similarity index 60% rename from ompi/mca/io/romio314/src/io_romio314_file_open.c rename to ompi/mca/io/romio321/src/io_romio321_file_open.c index ec93677381..05a70e2947 100644 --- a/ompi/mca/io/romio314/src/io_romio314_file_open.c +++ b/ompi/mca/io/romio321/src/io_romio321_file_open.c @@ -9,10 +9,9 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Cisco Systems, Inc. All rights reserved * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,18 +25,18 @@ #include "ompi/info/info.h" #include "ompi/file/file.h" -#include "io_romio314.h" +#include "io_romio321.h" int -mca_io_romio314_file_open (ompi_communicator_t *comm, +mca_io_romio321_file_open (ompi_communicator_t *comm, const char *filename, int amode, opal_info_t *info, ompi_file_t *fh) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This @@ -48,11 +47,11 @@ mca_io_romio314_file_open (ompi_communicator_t *comm, opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; -// OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; +// OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_open)(comm, filename, amode, ompi_info, &data->romio_fh); -// OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); +// OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -60,17 +59,19 @@ mca_io_romio314_file_open (ompi_communicator_t *comm, int -mca_io_romio314_file_close (ompi_file_t *fh) +mca_io_romio321_file_close (ompi_file_t *fh) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; + int finalized; /* If we've already started MPI_Finalize by this point, then just give up (because ROMIO's file close routine calls MPI_Barrier, which we obviously can't do if we've started to MPI_Finalize). The user didn't close the file, so they should expect unexpected behavior. */ - if (ompi_mpi_state >= OMPI_MPI_STATE_FINALIZE_PAST_COMM_SELF_DESTRUCT) { + PMPI_Finalized(&finalized); + if (finalized) { return OMPI_SUCCESS; } @@ -86,85 +87,85 @@ mca_io_romio314_file_close (ompi_file_t *fh) OBJ_RETAIN(fh->error_handler); } - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_close) (&data->romio_fh); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_set_size (ompi_file_t *fh, +mca_io_romio321_file_set_size (ompi_file_t *fh, MPI_Offset size) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_size) (data->romio_fh, size); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_preallocate (ompi_file_t *fh, +mca_io_romio321_file_preallocate (ompi_file_t *fh, MPI_Offset size) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_preallocate) (data->romio_fh, size); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_get_size (ompi_file_t *fh, +mca_io_romio321_file_get_size (ompi_file_t *fh, MPI_Offset * size) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_size) (data->romio_fh, size); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_get_amode (ompi_file_t *fh, +mca_io_romio321_file_get_amode (ompi_file_t *fh, int *amode) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_amode) (data->romio_fh, amode); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_set_info (ompi_file_t *fh, +mca_io_romio321_file_set_info (ompi_file_t *fh, opal_info_t *info) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This @@ -175,10 +176,10 @@ mca_io_romio314_file_set_info (ompi_file_t *fh, opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_info) (data->romio_fh, ompi_info); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -186,11 +187,11 @@ mca_io_romio314_file_set_info (ompi_file_t *fh, int -mca_io_romio314_file_get_info (ompi_file_t *fh, +mca_io_romio321_file_get_info (ompi_file_t *fh, opal_info_t ** info_used) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This @@ -199,10 +200,10 @@ mca_io_romio314_file_get_info (ompi_file_t *fh, ompi_info = OBJ_NEW(ompi_info_t); if (!ompi_info) { return(MPI_ERR_NO_MEM); } - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_info) (data->romio_fh, &ompi_info); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); opal_info_dup (&(ompi_info->super), info_used); ompi_info_free(&ompi_info); @@ -211,7 +212,7 @@ mca_io_romio314_file_get_info (ompi_file_t *fh, int -mca_io_romio314_file_set_view (ompi_file_t *fh, +mca_io_romio321_file_set_view (ompi_file_t *fh, MPI_Offset disp, struct ompi_datatype_t *etype, struct ompi_datatype_t *filetype, @@ -219,7 +220,7 @@ mca_io_romio314_file_set_view (ompi_file_t *fh, opal_info_t *info) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This @@ -230,12 +231,12 @@ mca_io_romio314_file_set_view (ompi_file_t *fh, opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_view) (data->romio_fh, disp, etype, filetype, datarep, ompi_info); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -243,21 +244,21 @@ mca_io_romio314_file_set_view (ompi_file_t *fh, int -mca_io_romio314_file_get_view (ompi_file_t *fh, +mca_io_romio321_file_get_view (ompi_file_t *fh, MPI_Offset * disp, struct ompi_datatype_t ** etype, struct ompi_datatype_t ** filetype, char *datarep) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_view) (data->romio_fh, disp, etype, filetype, datarep); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; @@ -265,146 +266,146 @@ mca_io_romio314_file_get_view (ompi_file_t *fh, int -mca_io_romio314_file_get_type_extent (ompi_file_t *fh, +mca_io_romio321_file_get_type_extent (ompi_file_t *fh, struct ompi_datatype_t *datatype, MPI_Aint * extent) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_type_extent) (data->romio_fh, datatype, extent); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_set_atomicity (ompi_file_t *fh, +mca_io_romio321_file_set_atomicity (ompi_file_t *fh, int flag) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_atomicity) (data->romio_fh, flag); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_get_atomicity (ompi_file_t *fh, +mca_io_romio321_file_get_atomicity (ompi_file_t *fh, int *flag) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_atomicity) (data->romio_fh, flag); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_sync (ompi_file_t *fh) +mca_io_romio321_file_sync (ompi_file_t *fh) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_sync) (data->romio_fh); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_seek_shared (ompi_file_t *fh, +mca_io_romio321_file_seek_shared (ompi_file_t *fh, MPI_Offset offset, int whence) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_seek_shared) (data->romio_fh, offset, whence); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_get_position_shared (ompi_file_t *fh, +mca_io_romio321_file_get_position_shared (ompi_file_t *fh, MPI_Offset * offset) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_position_shared) (data->romio_fh, offset); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_seek (ompi_file_t *fh, +mca_io_romio321_file_seek (ompi_file_t *fh, MPI_Offset offset, int whence) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_seek) (data->romio_fh, offset, whence); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_get_position (ompi_file_t *fh, +mca_io_romio321_file_get_position (ompi_file_t *fh, MPI_Offset * offset) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_position) (data->romio_fh, offset); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_get_byte_offset (ompi_file_t *fh, +mca_io_romio321_file_get_byte_offset (ompi_file_t *fh, MPI_Offset offset, MPI_Offset * disp) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_byte_offset) (data->romio_fh, offset, disp); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } diff --git a/ompi/mca/io/romio314/src/io_romio314_file_read.c b/ompi/mca/io/romio321/src/io_romio321_file_read.c similarity index 56% rename from ompi/mca/io/romio314/src/io_romio314_file_read.c rename to ompi/mca/io/romio321/src/io_romio321_file_read.c index fae1421c27..8944d926cc 100644 --- a/ompi/mca/io/romio314/src/io_romio314_file_read.c +++ b/ompi/mca/io/romio321/src/io_romio321_file_read.c @@ -1,30 +1,32 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2017 IBM Corporation. All rights reserved. - * $COPYRIGHT$ + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ * - * Additional copyrights may follow + * Additional copyrights may follow * - * $HEADER$ + * $HEADER$ */ #include "ompi_config.h" #include "mpi.h" #include "ompi/file/file.h" -#include "io_romio314.h" +#include "io_romio321.h" int -mca_io_romio314_file_read_at (ompi_file_t *fh, +mca_io_romio321_file_read_at (ompi_file_t *fh, MPI_Offset offset, void *buf, int count, @@ -32,21 +34,21 @@ mca_io_romio314_file_read_at (ompi_file_t *fh, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_at_all (ompi_file_t *fh, +mca_io_romio321_file_read_at_all (ompi_file_t *fh, MPI_Offset offset, void *buf, int count, @@ -54,21 +56,21 @@ mca_io_romio314_file_read_at_all (ompi_file_t *fh, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at_all) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iread_at (ompi_file_t *fh, +mca_io_romio321_file_iread_at (ompi_file_t *fh, MPI_Offset offset, void *buf, int count, @@ -76,20 +78,20 @@ mca_io_romio314_file_iread_at (ompi_file_t *fh, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iread_at) (data->romio_fh, offset, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iread_at_all (ompi_file_t *fh, +mca_io_romio321_file_iread_at_all (ompi_file_t *fh, MPI_Offset offset, void *buf, int count, @@ -97,10 +99,10 @@ mca_io_romio314_file_iread_at_all (ompi_file_t *fh, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -108,88 +110,88 @@ mca_io_romio314_file_iread_at_all (ompi_file_t *fh, // Fake it with individual non-blocking I/O operations. // Similar to OMPIO ret = - ROMIO_PREFIX(MPI_File_iread_at) (data->romio_fh, offset, buf, count, - datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + ROMIO_PREFIX(MPI_File_iread_at_all) (data->romio_fh, offset, buf, count, + datatype, request); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read (ompi_file_t *fh, +mca_io_romio321_file_read (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_all (ompi_file_t *fh, +mca_io_romio321_file_read_all (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_all) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iread (ompi_file_t *fh, +mca_io_romio321_file_iread (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iread) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iread_all (ompi_file_t *fh, +mca_io_romio321_file_iread_all (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -197,184 +199,184 @@ mca_io_romio314_file_iread_all (ompi_file_t *fh, // Fake it with individual non-blocking I/O operations. // Similar to OMPIO ret = - ROMIO_PREFIX(MPI_File_iread) (data->romio_fh, buf, count, datatype, - request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + ROMIO_PREFIX(MPI_File_iread_all) (data->romio_fh, buf, count, datatype, + request); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_shared (ompi_file_t *fh, +mca_io_romio321_file_read_shared (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_shared) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iread_shared (ompi_file_t *fh, +mca_io_romio321_file_iread_shared (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iread_shared) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_ordered (ompi_file_t *fh, +mca_io_romio321_file_read_ordered (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_ordered) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_at_all_begin (ompi_file_t *fh, +mca_io_romio321_file_read_at_all_begin (ompi_file_t *fh, MPI_Offset offset, void *buf, int count, struct ompi_datatype_t *datatype) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at_all_begin) (data->romio_fh, offset, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_at_all_end (ompi_file_t *fh, +mca_io_romio321_file_read_at_all_end (ompi_file_t *fh, void *buf, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_all_begin (ompi_file_t *fh, +mca_io_romio321_file_read_all_begin (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_all_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_all_end (ompi_file_t *fh, +mca_io_romio321_file_read_all_end (ompi_file_t *fh, void *buf, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_ordered_begin (ompi_file_t *fh, +mca_io_romio321_file_read_ordered_begin (ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_ordered_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_read_ordered_end (ompi_file_t *fh, +mca_io_romio321_file_read_ordered_end (ompi_file_t *fh, void *buf, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_ordered_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } diff --git a/ompi/mca/io/romio314/src/io_romio314_file_write.c b/ompi/mca/io/romio321/src/io_romio321_file_write.c similarity index 63% rename from ompi/mca/io/romio314/src/io_romio314_file_write.c rename to ompi/mca/io/romio321/src/io_romio321_file_write.c index f8cb72e265..2eb74d7f5a 100644 --- a/ompi/mca/io/romio314/src/io_romio314_file_write.c +++ b/ompi/mca/io/romio321/src/io_romio321_file_write.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -22,11 +22,11 @@ #include "ompi_config.h" #include "mpi.h" #include "ompi/file/file.h" -#include "io_romio314.h" +#include "io_romio321.h" int -mca_io_romio314_file_write_at (ompi_file_t *fh, +mca_io_romio321_file_write_at (ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, @@ -34,14 +34,14 @@ mca_io_romio314_file_write_at (ompi_file_t *fh, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -49,7 +49,7 @@ mca_io_romio314_file_write_at (ompi_file_t *fh, int -mca_io_romio314_file_write_at_all (ompi_file_t *fh, +mca_io_romio321_file_write_at_all (ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, @@ -57,14 +57,14 @@ mca_io_romio314_file_write_at_all (ompi_file_t *fh, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at_all) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -72,7 +72,7 @@ mca_io_romio314_file_write_at_all (ompi_file_t *fh, int -mca_io_romio314_file_iwrite_at (ompi_file_t *fh, +mca_io_romio321_file_iwrite_at (ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, @@ -80,21 +80,21 @@ mca_io_romio314_file_iwrite_at (ompi_file_t *fh, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iwrite_at) (data->romio_fh, offset, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iwrite_at_all (ompi_file_t *fh, +mca_io_romio321_file_iwrite_at_all (ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, @@ -102,10 +102,10 @@ mca_io_romio314_file_iwrite_at_all (ompi_file_t *fh, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -113,9 +113,9 @@ mca_io_romio314_file_iwrite_at_all (ompi_file_t *fh, // Fake it with individual non-blocking I/O operations. // Similar to OMPIO ret = - ROMIO_PREFIX(MPI_File_iwrite_at) (data->romio_fh, offset, buf, count, - datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + ROMIO_PREFIX(MPI_File_iwrite_at_all) (data->romio_fh, offset, buf, count, + datatype, request); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -123,77 +123,77 @@ mca_io_romio314_file_iwrite_at_all (ompi_file_t *fh, int -mca_io_romio314_file_write (ompi_file_t *fh, +mca_io_romio321_file_write (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_all (ompi_file_t *fh, +mca_io_romio321_file_write_all (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_all) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iwrite (ompi_file_t *fh, +mca_io_romio321_file_iwrite (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iwrite) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iwrite_all (ompi_file_t *fh, +mca_io_romio321_file_iwrite_all (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -201,175 +201,175 @@ mca_io_romio314_file_iwrite_all (ompi_file_t *fh, // Fake it with individual non-blocking I/O operations. // Similar to OMPIO ret = - ROMIO_PREFIX(MPI_File_iwrite) (data->romio_fh, buf, count, datatype, - request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + ROMIO_PREFIX(MPI_File_iwrite_all) (data->romio_fh, buf, count, datatype, + request); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_shared (ompi_file_t *fh, +mca_io_romio321_file_write_shared (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_shared) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_iwrite_shared (ompi_file_t *fh, +mca_io_romio321_file_iwrite_shared (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iwrite_shared) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_ordered (ompi_file_t *fh, +mca_io_romio321_file_write_ordered (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_ordered) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_at_all_begin (ompi_file_t *fh, +mca_io_romio321_file_write_at_all_begin (ompi_file_t *fh, MPI_Offset offset, const void *buf, int count, struct ompi_datatype_t *datatype) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at_all_begin) (data->romio_fh, offset, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_at_all_end (ompi_file_t *fh, +mca_io_romio321_file_write_at_all_end (ompi_file_t *fh, const void *buf, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_all_begin (ompi_file_t *fh, +mca_io_romio321_file_write_all_begin (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_all_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_all_end (ompi_file_t *fh, +mca_io_romio321_file_write_all_end (ompi_file_t *fh, const void *buf, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_ordered_begin (ompi_file_t *fh, +mca_io_romio321_file_write_ordered_begin (ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *datatype) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_ordered_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } int -mca_io_romio314_file_write_ordered_end (ompi_file_t *fh, +mca_io_romio321_file_write_ordered_end (ompi_file_t *fh, const void *buf, ompi_status_public_t * status) { int ret; - mca_io_romio314_data_t *data; + mca_io_romio321_data_t *data; - data = (mca_io_romio314_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio314_mutex); + data = (mca_io_romio321_data_t *) fh->f_io_selected_data; + OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_ordered_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); + OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } diff --git a/ompi/mca/io/romio314/src/io_romio314_module.c b/ompi/mca/io/romio321/src/io_romio321_module.c similarity index 59% rename from ompi/mca/io/romio314/src/io_romio314_module.c rename to ompi/mca/io/romio321/src/io_romio321_module.c index 800c3bd794..0f7016ea7b 100644 --- a/ompi/mca/io/romio314/src/io_romio314_module.c +++ b/ompi/mca/io/romio321/src/io_romio321_module.c @@ -12,6 +12,8 @@ * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,7 +25,7 @@ #include "mpi.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/mca/io/io.h" -#include "io_romio314.h" +#include "io_romio321.h" /* @@ -38,72 +40,72 @@ void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag); /* * The ROMIO module operations */ -mca_io_base_module_2_0_0_t mca_io_romio314_module = { +mca_io_base_module_2_0_0_t mca_io_romio321_module = { /* Back end to MPI API calls (pretty much a 1-to-1 mapping) */ - mca_io_romio314_file_open, - mca_io_romio314_file_close, + mca_io_romio321_file_open, + mca_io_romio321_file_close, - mca_io_romio314_file_set_size, - mca_io_romio314_file_preallocate, - mca_io_romio314_file_get_size, - mca_io_romio314_file_get_amode, - mca_io_romio314_file_set_view, - mca_io_romio314_file_get_view, + mca_io_romio321_file_set_size, + mca_io_romio321_file_preallocate, + mca_io_romio321_file_get_size, + mca_io_romio321_file_get_amode, + mca_io_romio321_file_set_view, + mca_io_romio321_file_get_view, /* Index IO operations */ - mca_io_romio314_file_read_at, - mca_io_romio314_file_read_at_all, - mca_io_romio314_file_write_at, - mca_io_romio314_file_write_at_all, - mca_io_romio314_file_iread_at, - mca_io_romio314_file_iwrite_at, - mca_io_romio314_file_iread_at_all, - mca_io_romio314_file_iwrite_at_all, + mca_io_romio321_file_read_at, + mca_io_romio321_file_read_at_all, + mca_io_romio321_file_write_at, + mca_io_romio321_file_write_at_all, + mca_io_romio321_file_iread_at, + mca_io_romio321_file_iwrite_at, + mca_io_romio321_file_iread_at_all, + mca_io_romio321_file_iwrite_at_all, /* non-indexed IO operations */ - mca_io_romio314_file_read, - mca_io_romio314_file_read_all, - mca_io_romio314_file_write, - mca_io_romio314_file_write_all, - mca_io_romio314_file_iread, - mca_io_romio314_file_iwrite, - mca_io_romio314_file_iread_all, - mca_io_romio314_file_iwrite_all, + mca_io_romio321_file_read, + mca_io_romio321_file_read_all, + mca_io_romio321_file_write, + mca_io_romio321_file_write_all, + mca_io_romio321_file_iread, + mca_io_romio321_file_iwrite, + mca_io_romio321_file_iread_all, + mca_io_romio321_file_iwrite_all, - mca_io_romio314_file_seek, - mca_io_romio314_file_get_position, - mca_io_romio314_file_get_byte_offset, + mca_io_romio321_file_seek, + mca_io_romio321_file_get_position, + mca_io_romio321_file_get_byte_offset, - mca_io_romio314_file_read_shared, - mca_io_romio314_file_write_shared, - mca_io_romio314_file_iread_shared, - mca_io_romio314_file_iwrite_shared, - mca_io_romio314_file_read_ordered, - mca_io_romio314_file_write_ordered, - mca_io_romio314_file_seek_shared, - mca_io_romio314_file_get_position_shared, + mca_io_romio321_file_read_shared, + mca_io_romio321_file_write_shared, + mca_io_romio321_file_iread_shared, + mca_io_romio321_file_iwrite_shared, + mca_io_romio321_file_read_ordered, + mca_io_romio321_file_write_ordered, + mca_io_romio321_file_seek_shared, + mca_io_romio321_file_get_position_shared, /* Split IO operations */ - mca_io_romio314_file_read_at_all_begin, - mca_io_romio314_file_read_at_all_end, - mca_io_romio314_file_write_at_all_begin, - mca_io_romio314_file_write_at_all_end, - mca_io_romio314_file_read_all_begin, - mca_io_romio314_file_read_all_end, - mca_io_romio314_file_write_all_begin, - mca_io_romio314_file_write_all_end, - mca_io_romio314_file_read_ordered_begin, - mca_io_romio314_file_read_ordered_end, - mca_io_romio314_file_write_ordered_begin, - mca_io_romio314_file_write_ordered_end, + mca_io_romio321_file_read_at_all_begin, + mca_io_romio321_file_read_at_all_end, + mca_io_romio321_file_write_at_all_begin, + mca_io_romio321_file_write_at_all_end, + mca_io_romio321_file_read_all_begin, + mca_io_romio321_file_read_all_end, + mca_io_romio321_file_write_all_begin, + mca_io_romio321_file_write_all_end, + mca_io_romio321_file_read_ordered_begin, + mca_io_romio321_file_read_ordered_end, + mca_io_romio321_file_write_ordered_begin, + mca_io_romio321_file_write_ordered_end, - mca_io_romio314_file_get_type_extent, + mca_io_romio321_file_get_type_extent, /* Sync/atomic IO operations */ - mca_io_romio314_file_set_atomicity, - mca_io_romio314_file_get_atomicity, - mca_io_romio314_file_sync + mca_io_romio321_file_set_atomicity, + mca_io_romio321_file_get_atomicity, + mca_io_romio321_file_sync }; @@ -137,14 +139,6 @@ void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) * In addition, if the data is contiguous but true_lb differes * from zero, ROMIO will ignore the displacement. Thus, lie! */ - - size_t size; - opal_datatype_type_size (&datatype->super, &size); - if ( 0 == size ) { - *flag = 1; - return; - } - *flag = ompi_datatype_is_contiguous_memory_layout(datatype, 2); if (*flag) { MPI_Aint true_extent, true_lb;