1
1

Merge pull request #4520 from ggouaillardet/refresh/romio321

io/romio321: refresh ROMIO based on latest stable MPICH 3.2.1
Этот коммит содержится в:
Howard Pritchard 2018-06-22 16:58:46 -05:00 коммит произвёл GitHub
родитель 45b6e785aa 9d7f0e1c95
Коммит 8babaad35c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
579 изменённых файлов: 14301 добавлений и 6796 удалений

Просмотреть файл

@ -1,58 +0,0 @@
1. prepare new romio directory
cp -a <old romio> <new romio>
# cp -a ompi/mca/io/romio ompi/mca/io/romio314
rm -rf <new romio>/romio
# rm -rf ompi/mca/io/romio314/romio
git add <new romio>
# git add ompi/mca/io/romio314
# git commit
2. import new romio
cp -a <mpich dir>/src/mpi/romio <new romio>
# cp -a /.../mpich-3.2b1/src/mpi/romio ompi/mca/io/romio314
git add <new romio>
# git add ompi/mca/io/romio314
# git commit
3. patch romio
cd <new romio>
# cd ompi/mca/io/romio314
# git show 7ad376a7b202b45c8b4f574e873546ab8752e305 | patch -p5
# cd ../../../..
git add <new romio>
# 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 <new romio>/Makefile.am <new romio>/configure.m4 <new romio>/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 <new romio>
# git add ompi/mca/io/romio314
# git commit
5. remove old romio
git rm -r <old romio>
# git rm -r ompi/mca/io/romio
# git commit
rm -rf <old romio>
# rm -rf ompi/mca/io/romio

Двоичные данные
ompi/mca/io/romio314/romio/doc/users-guide.pdf

Двоичный файл не отображается.

Просмотреть файл

@ -1,4 +0,0 @@
#! /bin/sh
LIBS="@LIBS@"
MPI_OFFSET_TYPE="@MPI_OFFSET_TYPE@"
FORTRAN_MPI_OFFSET="@FORTRAN_MPI_OFFSET@"

Просмотреть файл

Просмотреть файл

@ -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_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.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

39
ompi/mca/io/romio321/REFRESH_NOTES.txt Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
1. prepare new romio directory
cp -a <old romio> <new romio>
# cp -a ompi/mca/io/romio ompi/mca/io/romio321
rm -rf <new romio>/romio
# rm -rf ompi/mca/io/romio321/romio
git add <new romio>
# git add ompi/mca/io/romio321
# git commit
2. import new romio
cp -a <mpich dir>/src/mpi/romio <new romio>
# cp -a /.../mpich-3.2b1/src/mpi/romio ompi/mca/io/romio321
git add <new romio>
# git add ompi/mca/io/romio321
# git commit
3. patch romio
cd <new romio>
# cd ompi/mca/io/romio321
# git show 7a7968f02e2bad912426d1535119fb30d881b460 | patch -p5
# cd ../../../..
git add <new romio>
# git add ompi/mca/io/romio321
# git commit
4. prepare ompi to use new romio
vi <new romio>/Makefile.am <new romio>/configure.m4 <new romio>/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 <new romio>
# git add ompi/mca/io/romio321
# git commit
5. remove old romio
git rm -r <old romio>
# git rm -r ompi/mca/io/romio
# git commit
rm -rf <old romio>
# rm -rf ompi/mca/io/romio

Просмотреть файл

@ -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],

Просмотреть файл

@ -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

Просмотреть файл

Просмотреть файл

@ -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;

13
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

1032
ompi/mca/io/romio321/romio/2.diff Обычный файл

Разница между файлами не показана из-за своего большого размера Загрузить разницу

36
ompi/mca/io/romio321/romio/3.diff Обычный файл
Просмотреть файл

@ -0,0 +1,36 @@
commit ae17908f35ee614071ec68eb4643286f7b707e86
Author: Nathan Hjelm <hjelmn@lanl.gov>
Date: Tue May 1 15:11:34 2018 -0600
io/romio314: fix two more MPI-3 compliance issues
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
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);

Просмотреть файл

@ -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.

Просмотреть файл

@ -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

Просмотреть файл

@ -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.

Просмотреть файл

Просмотреть файл

@ -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 */
};

Просмотреть файл

@ -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 <signal.h>
#endif
#ifdef HAVE_AIO_H
#ifdef HAVE_AIO_LITE_H
#include <aio-lite.h>
#elif defined HAVE_AIO_H
#include <aio.h>
#endif

Просмотреть файл

@ -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; i<nprocs; i++)
{
if ( (my_req[i].count) &&
((MPIR_Upint)my_req[i].offsets <= (MPIR_Upint)sendBufForOffsets) )
((MPIU_Upint)my_req[i].offsets <= (MPIU_Upint)sendBufForOffsets) )
{
sendBufForOffsets = my_req[i].offsets;
}
if ( (my_req[i].count) &&
((MPIR_Upint)my_req[i].lens <= (MPIR_Upint)sendBufForLens) )
((MPIU_Upint)my_req[i].lens <= (MPIU_Upint)sendBufForLens) )
{
sendBufForLens = my_req[i].lens;
}
@ -775,9 +775,9 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
sdispls[i] = 0;
else
sdispls[i] = (int)
( ( (MPIR_Upint)my_req[i].offsets -
(MPIR_Upint)sendBufForOffsets ) /
(MPIR_Upint)sizeof(ADIO_Offset) );
( ( (MPIU_Upint)my_req[i].offsets -
(MPIU_Upint)sendBufForOffsets ) /
(MPIU_Upint)sizeof(ADIO_Offset) );
/* Receive these offsets from process i.*/
rcounts[i] = count_others_req_per_proc[i];
@ -785,9 +785,9 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
rdispls[i] = 0;
else
rdispls[i] = (int)
( ( (MPIR_Upint)others_req[i].offsets -
(MPIR_Upint)recvBufForOffsets ) /
(MPIR_Upint)sizeof(ADIO_Offset) );
( ( (MPIU_Upint)others_req[i].offsets -
(MPIU_Upint)recvBufForOffsets ) /
(MPIU_Upint)sizeof(ADIO_Offset) );
}
/* Exchange the offsets */
@ -809,9 +809,9 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
sdispls[i] = 0;
else
sdispls[i] = (int)
( ( (MPIR_Upint)my_req[i].lens -
(MPIR_Upint)sendBufForLens ) /
(MPIR_Upint) sizeof(ADIO_Offset) );
( ( (MPIU_Upint)my_req[i].lens -
(MPIU_Upint)sendBufForLens ) /
(MPIU_Upint) sizeof(ADIO_Offset) );
/* Receive these offsets from process i. */
rcounts[i] = count_others_req_per_proc[i];
@ -819,9 +819,9 @@ void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
rdispls[i] = 0;
else
rdispls[i] = (int)
( ( (MPIR_Upint)others_req[i].lens -
(MPIR_Upint)recvBufForLens ) /
(MPIR_Upint) sizeof(ADIO_Offset) );
( ( (MPIU_Upint)others_req[i].lens -
(MPIU_Upint)recvBufForLens ) /
(MPIU_Upint) sizeof(ADIO_Offset) );
}
/* Exchange the lengths */

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -7,9 +7,9 @@
*/
/* -*- 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.
*/

Просмотреть файл

@ -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.
*/
@ -151,6 +151,6 @@ void ADIOI_GPFS_Open(ADIO_File fd, int *error_code)
}
else *error_code = MPI_SUCCESS;
}
/*
*vim: ts=8 sts=4 sw=4 noexpandtab
/*
*vim: ts=8 sts=4 sw=4 noexpandtab
*/

Просмотреть файл

@ -7,9 +7,9 @@
*/
/* -*- 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.
*/
@ -34,7 +34,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,
@ -42,16 +42,16 @@ 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_R_Exchange_data_alltoallv(ADIO_File fd, void *buf, ADIOI_Flatlist_node
*flat_buf, ADIO_Offset *offset_list, ADIO_Offset
@ -68,14 +68,14 @@ static void ADIOI_R_Exchange_data_alltoallv(ADIO_File fd, void *buf, ADIOI_Flatl
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,
*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);
@ -94,15 +94,15 @@ void ADIOI_GPFS_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. */
@ -114,6 +114,7 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, 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;
ADIO_Offset *len_list = NULL;
int *buf_idx = NULL;
@ -127,7 +128,7 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
#if 0
/* From common code - not implemented for bg. */
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;
} */
@ -162,19 +163,48 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
#ifdef RDCOLL_DEBUG
for (i=0; i<contig_access_count; i++) {
DBG_FPRINTF(stderr, "rank %d off %lld len %lld\n",
DBG_FPRINTF(stderr, "rank %d off %lld len %lld\n",
myrank, offset_list[i], len_list[i]);
}
#endif
/* 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. */
stored 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_read_aggmethod == 1) || (gpfsmpio_read_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_read_aggmethod == 1) || (gpfsmpio_read_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; ii<nprocs; ii++) {
gpfs_offsets0[ii*3] = 0;
gpfs_offsets0[ii*3+1] = 0;
gpfs_offsets0[ii*3+2] = 0;
}
gpfs_offsets0[myrank*3] = start_offset;
gpfs_offsets0[myrank*3+1] = end_offset;
gpfs_offsets0[myrank*3+2] = my_count_size;
MPI_Allreduce( gpfs_offsets0, gpfs_offsets, nprocs*3, ADIO_OFFSET, MPI_MAX, fd->comm );
for (ii=0; ii<nprocs; ii++) {
st_offsets [ii] = gpfs_offsets[ii*3] ;
end_offsets[ii] = gpfs_offsets[ii*3+1];
count_sizes[ii] = gpfs_offsets[ii*3+2];
}
}
else {
gpfs_offsets0 = (ADIO_Offset *) ADIOI_Malloc(2*nprocs*sizeof(ADIO_Offset));
gpfs_offsets = (ADIO_Offset *) ADIOI_Malloc(2*nprocs*sizeof(ADIO_Offset));
for (ii=0; ii<nprocs; ii++) {
@ -190,6 +220,7 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
st_offsets [ii] = gpfs_offsets[ii*2] ;
end_offsets[ii] = gpfs_offsets[ii*2+1];
}
}
ADIOI_Free( gpfs_offsets0 );
ADIOI_Free( gpfs_offsets );
} else {
@ -197,13 +228,17 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
ADIO_OFFSET, fd->comm);
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; i<nprocs; i++)
if ((st_offsets[i] < end_offsets[i-1]) &&
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
@ -213,7 +248,7 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
if (fd->hints->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<nprocs; i++) {
if (count_sizes[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; i<nprocs; i++) {
@ -365,8 +451,8 @@ void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
ADIOI_Free(my_req);
/* read data in sizes of no more than ADIOI_Coll_bufsize,
* communicate, and fill user buf.
/* read data in sizes of no more than ADIOI_Coll_bufsize,
* communicate, and fill user buf.
*/
ADIOI_Read_and_exch(fd, buf, datatype, nprocs, myrank,
others_req, offset_list,
@ -403,8 +489,8 @@ fn_exit:
MPI_Type_size_x(datatype, &size);
bufsize = size * count;
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
during collective I/O. */
#endif
@ -421,7 +507,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
@ -447,7 +533,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype
#endif
*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.
@ -486,11 +572,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;
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; i<nprocs; i++) {
#ifdef RDCOLL_DEBUG
DBG_FPRINTF(stderr, "rank %d, i %d, others_count %d\n", rank, i, others_req[i].count);
DBG_FPRINTF(stderr, "rank %d, i %d, others_count %d\n", rank, i, others_req[i].count);
#endif
if (others_req[i].count) {
start_pos[i] = curr_offlen_ptr[i];
@ -595,7 +679,7 @@ static void ADIOI_Read_and_exch(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_send[i];
partial_send[i];
req_len = others_req[i].lens[j] -
partial_send[i];
partial_send[i] = 0;
@ -609,23 +693,23 @@ 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_Get_address(read_buf+req_off-real_off,
&(others_req[i].mem_ptrs[j]));
ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)read_buf)+req_off-real_off) == (ADIO_Offset)(MPIU_Upint)(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,
(ADIO_Offset)(unsigned)req_len));
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)) {
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
real_off + real_size - others_req[i].offsets[j+1]);
/* max because it must cover requests
from different processes */
}
break;
@ -659,17 +743,17 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype
if (*error_code != MPI_SUCCESS) return;
}
for_curr_iter = for_next_iter;
#ifdef PROFILE
MPE_Log_event(7, 0, "start communication");
#endif
if (gpfsmpio_comm == 1)
ADIOI_R_Exchange_data(fd, buf, flat_buf, offset_list, len_list,
send_size, recv_size, count,
send_size, recv_size, count,
start_pos, partial_send, recd_from_proc, nprocs,
myrank,
myrank,
buftype_is_contig, contig_access_count,
min_st_offset, fd_size, fd_start, fd_end,
others_req,
@ -693,7 +777,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype
if (for_next_iter) {
tmp_buf = (char *) ADIOI_Malloc(for_next_iter);
ADIOI_Assert((((ADIO_Offset)(MPIR_Upint)read_buf)+real_size-for_next_iter) == (ADIO_Offset)(MPIR_Upint)(read_buf+real_size-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+coll_bufsize) == (size_t)(for_next_iter+coll_bufsize));
memcpy(tmp_buf, read_buf+real_size-for_next_iter, for_next_iter);
ADIOI_Free(fd->io_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; m<max_ntimes; m++)
for (m=ntimes; m<max_ntimes; m++)
/* nothing to send, but check for recv. */
if (gpfsmpio_comm == 1)
ADIOI_R_Exchange_data(fd, buf, flat_buf, offset_list, len_list,
send_size, recv_size, count,
send_size, recv_size, count,
start_pos, partial_send, recd_from_proc, nprocs,
myrank,
myrank,
buftype_is_contig, contig_access_count,
min_st_offset, fd_size, fd_start, fd_end,
others_req, m,
buftype_extent, buf_idx);
buftype_extent, buf_idx);
else /* strncmp( env_switch, "alltoall", 8 ) == 0 */
if (gpfsmpio_comm == 0)
ADIOI_R_Exchange_data_alltoallv(fd, buf, flat_buf, offset_list, len_list,
send_size, recv_size, count,
send_size, recv_size, count,
start_pos, partial_send, recd_from_proc, nprocs,
myrank,
myrank,
buftype_is_contig, contig_access_count,
min_st_offset, fd_size, fd_start, fd_end,
others_req,
others_req,
m, buftype_extent, buf_idx);
#ifdef PROFILE
@ -752,17 +836,17 @@ 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 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 iter, MPI_Aint buftype_extent, int *buf_idx)
{
int i, j, k=0, tmp=0, nprocs_recv, nprocs_send;
char **recv_buf = NULL;
char **recv_buf = NULL;
MPI_Request *requests;
MPI_Datatype send_type;
MPI_Status *statuses;
@ -791,9 +875,9 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node
if (buftype_is_contig) {
j = 0;
for (i=0; i < nprocs; i++)
if (recv_size[i]) {
MPI_Irecv(((char *) buf) + buf_idx[i], recv_size[i],
for (i=0; i < nprocs; i++)
if (recv_size[i]) {
MPI_Irecv(((char *) buf) + buf_idx[i], recv_size[i],
MPI_BYTE, i, myrank+i+100*iter, fd->comm, 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<contig_access_count; i++) {
for (i=0; i<contig_access_count; i++) {
off = offset_list[i];
rem_len = len_list[i];
@ -1002,7 +1086,7 @@ static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
if (recv_buf_idx[p] < recv_size[p]) {
if (curr_from_proc[p]+len > 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; i<nprocs; i++) if (recv_size[i]) { nprocs_recv++; break; }
nprocs_send = 0;
for (i=0; i<nprocs; i++) if (send_size[i]) { nprocs_send++; break; }
/* receiver side data structures */
rdispls = (int *) ADIOI_Malloc( nprocs * sizeof(int) );
rtail = 0;
@ -1128,21 +1212,21 @@ static void ADIOI_R_Exchange_data_alltoallv(
//for (i=1; i<nprocs; i++) if(all_send_buf[(i-1)*131072]!=all_send_buf[i*131072]){ DBG_FPRINTF(stderr, "\t\t[%d]%2d,", i, all_send_buf [i*131072] ); }
}
#endif
/* alltoallv */
MPI_Alltoallv(
MPI_Alltoallv(
all_send_buf, send_size, sdispls, MPI_BYTE,
all_recv_buf, recv_size, rdispls, MPI_BYTE,
fd->comm );
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;
}

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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

Просмотреть файл

@ -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; i<confInfo->nProcs; 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<naggs; i++) {
DBG_FPRINTF(stderr, "\taggr %-4d = %6d\n", i, tmp_ranklist[i] );

Просмотреть файл

@ -6,7 +6,7 @@
* \brief ???
*/
/*
/*
*
* Declares functions specific for the BlueGene platform within the GPFS
* parallel I/O solution. Implements aligned file-domain partitioning

Просмотреть файл

@ -3,12 +3,12 @@
/* ---------------------------------------------------------------- */
/**
* \file ad_bg_pset.c
* \brief Definition of functions associated to structs ADIOI_BG_ProcInfo_t and ADIOI_BG_ConfInfo_t
* \brief Definition of functions associated to structs ADIOI_BG_ProcInfo_t and ADIOI_BG_ConfInfo_t
*/
/* -*- 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.
*/
@ -16,14 +16,14 @@
// #define bridgeringaggtrace 1
#include <stdlib.h>
#include <stdbool.h>
#include "../ad_gpfs.h"
#include "ad_bg_pset.h"
#include <spi/include/kernel/process.h>
#include <firmware/include/personality.h>
#ifdef HAVE_MPIX_H
#include <mpix.h>
#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<MPIX_TORUS_MAX_DIMS;i++) {
for (i=0;i<BGQ_TORUS_MAX_DIMS;i++) {
unsigned dimDistance = abs((int)aggCoords[i] - (int)bridgeCoords[i]);
if (dimDistance > 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;i<MPIX_TORUS_MAX_DIMS;i++) {
torusSize[i] = hw.Size[i];
dimTorus[i] = hw.isTorus[i];
proc->numNodesInPartition *= 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;i<BGQ_TORUS_MAX_DIMS;i++) {
torusSize[i] = dimMaxArray[i];
int baseNum = 1, j;
for (j=0;j<i;j++)
baseNum *= hw.Size[j];
proc->nodeRank += (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; i<size; i++)
{
if((bridges[i].bridgeCoord & ~1) == tempCoords)
if((bridges[i].bridgeCoord & ~1) == tempCoords)
countPset++; /* same bridge (pset), count it */
else /* new bridge found */
{
#ifdef TRACE_ON
if(rank == 0)
if(rank == 0)
TRACE_ERR("Bridge set %u, bridge rank %d (%#8.8X) has %d ranks\n",
bridgeIndex, tempRank, tempCoords, countPset);
#endif
@ -294,7 +333,7 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf,
/* Am I the bridge rank? */
if(tempRank == rank)
iambridge = 1;
else
else
iambridge = 0; /* Another rank on my node may have taken over */
TRACE_ERR("Rank %u, bridge set %u, bridge rank %d (%#8.8X) has %d ranks, iambridge %u\n",
rank, bridgeIndex, tempRank, tempCoords, countPset,iambridge);
@ -312,7 +351,7 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf,
/* Process last bridge */
#ifdef TRACE_ON
if(rank == 0)
if(rank == 0)
TRACE_ERR("Bridge set %u, bridge rank %d (%#8.8X) has %d ranks\n",
bridgeIndex, tempRank, tempCoords, countPset);
#endif
@ -327,32 +366,30 @@ ADIOI_BG_persInfo_init(ADIOI_BG_ConfInfo_t *conf,
/* Am I the bridge rank? */
if(tempRank == rank)
iambridge = 1;
else
else
iambridge = 0; /* Another rank on my node may have taken over */
bridgerank = tempRank;
proc->myIOSize = 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 );

Просмотреть файл

@ -17,9 +17,6 @@
#ifndef AD_BG_PSET_H_
#define AD_BG_PSET_H_
#ifdef HAVE_MPIX_H
#include <mpix.h>
#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);

Просмотреть файл

@ -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 */
};

Просмотреть файл

@ -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);

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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)));
}
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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,

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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",

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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 */
};

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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)

Просмотреть файл

@ -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/

Просмотреть файл

@ -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 */
};

Просмотреть файл

@ -35,12 +35,16 @@
#include <signal.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#endif
#endif /* End of HAVE_SYS_AIO_H */
#ifdef HAVE_AIO_LITE_H
#include <aio-lite.h>
#else
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#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);

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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; i<ntimes; i++) {
len = ADIOI_MIN(alloc_size-done, ADIOI_PREALLOC_BUFSZ);
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;
done += len;
}
}
ADIOI_Free(buf);
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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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)
{

Просмотреть файл

@ -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); \

Просмотреть файл

@ -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];

Просмотреть файл

@ -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 */
};

Просмотреть файл

@ -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 <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include "adio.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>
@ -18,14 +19,18 @@
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#ifdef HAVE_AIO_LITE_H
#include <aio-lite.h>
#else
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#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

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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-- */

Просмотреть файл

@ -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:

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 <unistd.h>
#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; j<count; j++)
for (j=0; j<count; j++)
for (i=0; i<flat_buf->count; 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; i<flat_file->count; 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; i<flat_file->count; 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

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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 <unistd.h>
#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; j<count; j++)
for (j=0; j<count; j++)
for (i=0; i<flat_buf->count; 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; i<flat_file->count; 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

Просмотреть файл

@ -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 */
};

Просмотреть файл

@ -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

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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)

Просмотреть файл

@ -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.
*/

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше