diff --git a/.ci/README.md b/.ci/README.md
index 2a9d5c09b15..c32a0fd6400 100644
--- a/.ci/README.md
+++ b/.ci/README.md
@@ -1,16 +1,4 @@
-# Open MPI Continuous Integration (CI) Services
-## Mellanox Open MPI CI
-### Scope
-[Mellanox](https://www.mellanox.com/) Open MPI CI is intended to verify Open MPI with recent Mellanox SW components ([Mellanox OFED](https://www.mellanox.com/page/products_dyn?product_family=26), [UCX](https://www.mellanox.com/page/products_dyn?product_family=281&mtag=ucx) and other [HPC-X](https://www.mellanox.com/page/products_dyn?product_family=189&mtag=hpc-x) components) in the Mellanox lab environment.
+Top-level directory for CI tests.
-CI is managed by [Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops) service.
-
-Mellanox Open MPI CI includes:
-* Open MPI building with internal stable engineering versions of UCX and HCOLL. The building is run in Docker-based environment.
-* Sanity functional testing.
-### How to Run CI
-Mellanox Open MPI CI is triggered upon the following events:
-* Create a pull request (PR). CI status is visible in the PR status. CI is restarted automatically upon each new commit within the PR. CI status and log files are also available on the Azure DevOps server.
-* Trigger CI with special PR comments (for example, `/azp run`). Comment triggers are available only if the comment author has write permission to the PR target repo. Detailed information about comment triggers is available in the official Azure DevOps [documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers).
-### Support
-In case of any issues, questions or suggestions please contact to [Mellanox Open MPI CI support team](mailto:swx-azure-svc@mellanox.com).
+Feel free to make your own subdirectory (e.g., for your organization)
+and put CI tests and supporting infrastructure here.
diff --git a/.ci/community-jenkins/Jenkinsfile b/.ci/community-jenkins/Jenkinsfile
new file mode 100644
index 00000000000..f4b305f1d66
--- /dev/null
+++ b/.ci/community-jenkins/Jenkinsfile
@@ -0,0 +1,107 @@
+// -*- groovy -*-
+//
+// Copyright (c) 2022-2023 Amazon.com, Inc. or its affiliates. All rights
+// reserved.
+// Copyright (c) 2022-2023 Joe Downs. All rights reserved.
+// Copyright (c) 2023 Cisco Systems, Inc. All rights reserved.
+// $COPYRIGHT$
+//
+// Additional copyrights may follow
+//
+// $HEADER$
+//
+// Build an Open MPI Pull Request
+//
+//
+// WORKSPACE Layout:
+// autotools-install/ Autotools install for the builder
+// ompi/ Open MPI source tree
+
+// We if we push changes to a PR, we don't need to keep old jobs running, so
+// we'll use the milestone step in Jenkins. Using an example from
+// https://stackoverflow.com/questions/40760716/jenkins-abort-running-build-if-new-one-is-started:
+//
+// - Build 1 runs and creates milestone 1.
+// - While build 1 is running, build 2 fires. It has milestone 1 and milestone
+// 2. It passes milestone 1, which causes build 1 to abort.
+def buildNumber = env.BUILD_NUMBER as int
+if (buildNumber > 1) {
+ milestone(buildNumber - 1)
+}
+milestone(buildNumber)
+
+// Add build description linking back to PR. This is redundant to the "GitHub"
+// link on the Pull Request page, but the Build page does not have a direct link
+// back to the PR. The "Details" link at the bottom of the GitHub PR page brings
+// you to the Jenkins Build page, so we're adding the link back to the GitHub PR
+// page.
+if (env.CHANGE_URL) {
+ currentBuild.description = "This is a build of Open MPI PR #${CHANGE_ID}"
+} else {
+ currentBuild.description = "Build of ${BRANCH_NAME}"
+}
+
+check_stages = prepare_check_stages()
+println("Initialized Pipeline")
+
+// Today, we only expect to have one stage (do everything), but allow that
+// we may split build and test stages in the future.
+for (check_stage in check_stages) {
+ parallel(check_stage)
+}
+
+println('Tests Completed')
+
+// Returns a list of build stages ("build Open MPI", "Build Tests", etc.),
+// although currently we only support the one stage of "everything", where each
+// build stage is a map of different configurations to test.
+def prepare_check_stages() {
+ def configure_options = ["--disable-dlopen", "--disable-oshmem", "--enable-builtin-atomic", "--enable-ipv6"]
+ def compilers = ["clang10", "gcc7", "gcc8", "gcc9", "gcc10"]
+ def platforms = ["amazon_linux_2", "amazon_linux_2-arm64", "rhel8"]
+ def check_stages_list = []
+
+ // Build everything stage
+ def build_parallel_map = [:]
+ for (platform in platforms) {
+ def name = "Platform: ${platform}".replaceAll("-", "")
+ build_parallel_map.put(name, prepare_build(name, platform, ""))
+ }
+
+ for (compiler in compilers) {
+ def name = "Compiler: ${compiler}".replaceAll("-", "")
+ build_parallel_map.put(name, prepare_build(name, compiler, "--compiler \\\"${compiler}\\\""))
+ }
+
+ for (configure_option in configure_options) {
+ def name = "Configure: ${configure_option}".replaceAll("-", "")
+ build_parallel_map.put(name, prepare_build(name, "amazon_linux_2", "--configure-args \\\"${configure_option}\\\""))
+ }
+
+ build_parallel_map.put("distcheck", prepare_build("distcheck", "tarball_build", "--distcheck"))
+
+ check_stages_list.add(build_parallel_map)
+
+ return check_stages_list
+}
+
+def prepare_build(build_name, label, build_arg) {
+ return {
+ stage("${build_name}") {
+ node(label) {
+ checkout(changelog: false, poll: false, scm: scm)
+ // If pr-builder.sh fails, the sh step will throw an exception,
+ // which we catch so that the job doesn't abort and continues on
+ // to other steps - such as cleanup. Because we catch the
+ // exception, we need to tell Jenkins the overall job has
+ // failed.
+ try {
+ sh "/bin/bash -x .ci/community-jenkins/pr-builder.sh ${build_arg} ompi"
+ } catch (Exception e) {
+ currentBuild.result = "FAILURE"
+ }
+ cleanWs(notFailBuild: true)
+ }
+ }
+ }
+}
diff --git a/.ci/community-jenkins/pr-builder.sh b/.ci/community-jenkins/pr-builder.sh
new file mode 100755
index 00000000000..eb88b4c1538
--- /dev/null
+++ b/.ci/community-jenkins/pr-builder.sh
@@ -0,0 +1,352 @@
+#!/bin/sh
+#
+# Copyright (c) 2022-2023 Amazon.com, Inc. or its affiliates. All rights
+# reserved.
+# Copyright (c) 2022-2023 Joe Downs. All rights reserved.
+# $COPYRIGHT$
+#
+# Additional copyrights may follow
+#
+# $HEADER$
+
+# Abort on error
+set -euo pipefail
+
+BUILD_32BIT=0
+COMPILER=
+DISTCHECK=0
+AUTOGEN_ARGS=
+CONFIGURE_ARGS=
+MAKE_ARGS=
+MAKE_J="-j 8"
+PREFIX="${WORKSPACE}/install"
+MPIRUN_MODE=${MPIRUN_MODE:-runall}
+
+#
+# Options Parsing
+#
+# For each option, we need to remove the quotes from their arguments. Without
+# quotes, the command-line options for later commands (such as
+# --disable-oshmem), are interpreted (in the following switch statement) as
+# options for this script.
+
+strip_quotes() {
+ echo `echo "$1" | sed -e "s/\(\"\)\([[:alnum:]|_|-]*\)\(\"\)/\2/"`
+}
+
+PARAMS=""
+while (( "$#" )); do
+ case "$1" in
+ --distcheck)
+ DISTCHECK=1
+ shift
+ ;;
+ --autogen-args)
+ if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
+ AUTOGEN_ARGS=$(strip_quotes $2)
+ shift 2
+ else
+ echo "Error: Argument for $1 is missing" >&2
+ exit 1
+ fi
+ ;;
+ --configure-args)
+ if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
+ CONFIGURE_ARGS=$(strip_quotes $2)
+ shift 2
+ else
+ echo "Error: Argument for $1 is missing" >&2
+ exit 1
+ fi
+ ;;
+ --compiler)
+ if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
+ COMPILER=$(strip_quotes $2)
+ shift 2
+ else
+ echo "Error: Argument for $1 is missing" >&2
+ exit 1
+ fi
+ ;;
+ --mpirun-mode)
+ if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
+ MPIRUN_MODE=$(strip_quotes $2)
+ shift 2
+ else
+ echo "Error: Argument for $1 is missing" >&2
+ exit 1
+ fi
+ ;;
+ -*|--*=) # Unsupported flags
+ echo "Error: Unsupported flag $1" >&2
+ exit 1
+ ;;
+ *) # Preserve positional arguments
+ PARAMS="$PARAMS $1"
+ shift
+ ;;
+ esac
+done
+# Set positional arguments in their proper place.
+eval set -- "$PARAMS"
+
+#
+# Start by figuring out what we are...
+#
+os=`uname -s`
+if test "${os}" = "Linux"; then
+ eval "PLATFORM_ID=`sed -n 's/^ID=//p' /etc/os-release`"
+ eval "VERSION_ID=`sed -n 's/^VERSION_ID=//p' /etc/os-release`"
+else
+ PLATFORM_ID=`uname -s`
+ VERSION_ID=`uname -r`
+fi
+
+echo "--> platform: $PLATFORM_ID"
+echo "--> version: $VERSION_ID"
+
+#
+# See if builder provided a compiler we should use, and translate it to
+# CONFIGURE_ARGS.
+#
+case ${PLATFORM_ID} in
+ rhel)
+ case "$COMPILER" in
+ gcc48|"")
+ echo "--> Using default compilers"
+ ;;
+ *)
+ echo "Unsupported compiler ${COMPILER}. Aborting"
+ exit 1
+ ;;
+ esac
+ ;;
+ amzn)
+ case "$COMPILER" in
+ "")
+ echo "--> Using default compilers"
+ ;;
+ gcc44)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS CC=gcc44 CXX=g++44 FC=gfortran44"
+ ;;
+ gcc48)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS CC=gcc48 CXX=g++48 FC=gfortran48"
+ ;;
+ clang36)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS CC=clang CXX=clang++ --disable-mpi-fortran"
+ ;;
+ *)
+ echo "Unsupported compiler ${COMPILER}. Aborting"
+ exit 1
+ ;;
+ esac
+ ;;
+ ubuntu)
+ case "$COMPILER" in
+ "")
+ echo "--> Using default compilers"
+ ;;
+ gcc4*)
+ version=`echo "$COMPILER" | sed -e 's/gcc4\([0-9]*\)/4.\1/'`
+ CONFIGURE_ARGS="CC=gcc-${version} CXX=g++-${version} FC=gfortran-${version}"
+ ;;
+ gcc*)
+ version=`echo "$COMPILER" | sed -e 's/gcc\([0-9]*\)/\1/'`
+ CONFIGURE_ARGS="CC=gcc-${version} CXX=g++-${version} FC=gfortran-${version}"
+ ;;
+ clang3*|clang4*|clang5*|clang6*)
+ version=`echo "$COMPILER" | sed -e 's/clang\([0-9]\)\([0-9]*\)/\1.\2/'`
+ CONFIGURE_ARGS="CC=clang-${version} CXX=clang++-${version} --disable-mpi-fortran"
+ ;;
+ clang*)
+ version=`echo "$COMPILER" | sed -e 's/clang\([0-9]*\)/\1/'`
+ CONFIGURE_ARGS="CC=clang-${version} CXX=clang++-${version} --disable-mpi-fortran"
+ ;;
+ *)
+ echo "Unsupported compiler ${COMPILER}. Aborting"
+ exit 1
+ ;;
+ esac
+ ;;
+ sles)
+ case "$COMPILER" in
+ "")
+ echo "--> Using default compilers"
+ ;;
+ gcc48)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS CC=gcc-48 CXX=g++-48 FC=gfortran-48"
+ ;;
+ gcc5)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS CC=gcc-5 CXX=g++-5 FC=gfortran-5"
+ ;;
+ gcc6)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS CC=gcc-6 CXX=g++-6 FC=gfortran-6"
+ ;;
+ *)
+ echo "Unsupported compiler ${COMPILER}. Aborting"
+ exit 1
+ ;;
+ esac
+ ;;
+ FreeBSD)
+ CONFIGURE_ARGS="$CONFIGURE_ARGS LDFLAGS=-Wl,-rpath,/usr/local/lib/gcc5 --with-wrapper-ldflags=-Wl,-rpath,/usr/local/lib/gcc5"
+ ;;
+esac
+CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-silent-rules"
+
+echo "--> Compiler setup: $CONFIGURE_ARGS"
+
+#
+# Add any Autogen or Configure arguments provided by the builder job.
+#
+if test "$AUTOGEN_ARGS" != ""; then
+ # Special case, to work around the fact that Open MPI can't build when
+ # there's a space in the build path name. (sigh)
+ if test "$AUTOGEN_ARGS" = "--no-orte"; then
+ AUTOGEN_ARGS="--no-orte --no-ompi"
+ fi
+fi
+
+echo "--> Autogen arguments: $AUTOGEN_ARGS"
+echo "--> Configure arguments: $CONFIGURE_ARGS"
+
+# Build
+sha1=`git rev-parse HEAD`
+echo "--> Building commit ${sha1}"
+
+if test -f autogen.pl; then
+ echo "--> running ./autogen.pl ${AUTOGEN_ARGS}"
+ ./autogen.pl ${AUTOGEN_ARGS}
+else
+ if test "${AUTOGEN_ARGS}" != ""; then
+ echo "--> Being a coward and not running with special autogen arguments and autogen.sh"
+ exit 1
+ else
+ echo "--> running ./atogen.sh"
+ ./autogen.sh
+ fi
+fi
+
+echo "--> running ./configure --prefix=\"${PREFIX}\" ${CONFIGURE_ARGS}"
+if ! ./configure --prefix="${PREFIX}" ${CONFIGURE_ARGS}; then
+ echo "./configure --prefix=\"${PREFIX}\" ${CONFIGURE_ARGS} failed, ABORTING !"
+ if test -f config.log; then
+ echo "config.log content :"
+ cat config.log
+ else
+ echo "no config.log was generated"
+ fi
+ exit 1
+fi
+
+# Shortcut for the distcheck case, as it won't run any tests beyond the built-in
+# make check tests. We need to install the requirements (Sphinx) so we can build
+# the docs.
+if test "${DISTCHECK}" = "1"; then
+ echo "--> running make ${MAKE_ARGS} distcheck"
+ make ${MAKE_ARGS} distcheck
+ exit $?
+fi
+
+echo "--> running make ${MAKE_J} ${MAKE_ARGS} all"
+make ${MAKE_J} ${MAKE_ARGS} all
+echo "--> running make check"
+make ${MAKE_ARGS} check
+echo "--> running make install"
+make ${MAKE_ARGS} install
+
+export PATH="${PREFIX}/bin":${PATH}
+
+case "$AUTOGEN_ARGS" in
+ *--no-ompi*)
+ echo "--> Skipping MPI tests due to --no-ompi"
+ exit 0
+ ;;
+esac
+
+echo "--> running ompi_info"
+ompi_info
+
+echo "--> running make all in examples"
+cd "examples"
+make ${MAKE_ARGS} all
+cd ..
+
+# It's hard to determine what the failure was and there's no printing of error
+# code with set -e, so for the tests, we do per-command checking...
+set +e
+
+run_example() {
+ example=`basename ${2}`
+ echo "--> Running example: $example"
+ ${1} ${2}
+ ret=$?
+ if test ${ret} -ne 0 ; then
+ echo "Example failed: ${ret}"
+ echo "Command was: ${1} ${2}"
+ exit ${ret}
+ fi
+}
+
+if test "${MPIRUN_MODE}" != "none"; then
+ echo "--> running examples"
+ echo "localhost cpu=2" > "${WORKSPACE}/hostfile"
+ # Note: using perl here because figuring out a portable sed regexp
+ # proved to be a little challenging.
+ mpirun_version=`"${WORKSPACE}/install/bin/mpirun" --version | perl -wnE 'say $1 if /mpirun [^\d]*(\d+.\d+)/'`
+ echo "--> mpirun version: ${mpirun_version}"
+ case ${mpirun_version} in
+ 1.*|2.0*)
+ exec="timeout -s SIGSEGV 3m mpirun -hostfile ${WORKSPACE}/hostfile -np 2 "
+ ;;
+ *)
+ exec="timeout -s SIGSEGV 4m mpirun --get-stack-traces --timeout 180 --hostfile ${WORKSPACE}/hostfile -np 2 --bind-to none "
+ ;;
+ esac
+ singleton="timeout -s SIGSEGV 1m "
+ run_example "${exec}" ./examples/hello_c
+ run_example "${singleton}" ./examples/hello_c
+ run_example "${exec}" ./examples/ring_c
+ run_example "${singleton}" ./examples/ring_c
+ run_example "${exec}" ./examples/connectivity_c
+ if ompi_info --parsable | grep -q bindings:cxx:yes >/dev/null; then
+ echo "--> running C++ examples"
+ run_example "${exec}" ./examples/hello_cxx
+ run_example "${singleton}" ./examples/hello_cxx
+ run_example "${exec}" ./examples/ring_cxx
+ run_example "${singleton}" ./examples/ring_cxx
+ else
+ echo "--> skipping C++ examples"
+ fi
+ if ompi_info --parsable | grep -q bindings:mpif.h:yes >/dev/null; then
+ echo "--> running mpif examples"
+ run_example "${exec}" ./examples/hello_mpifh
+ run_example "${singleton}" ./examples/hello_mpifh
+ run_example "${exec}" ./examples/ring_mpifh
+ run_example "${singleton}" ./examples/ring_mpifh
+ else
+ echo "--> skipping mpif examples"
+ fi
+ if ompi_info --parsable | egrep -q bindings:use_mpi:\"\?yes >/dev/null; then
+ echo "--> running usempi examples"
+ run_example "${exec}" ./examples/hello_usempi
+ run_example "${singleton}" ./examples/hello_usempi
+ run_example "${exec}" ./examples/ring_usempi
+ run_example "${singleton}" ./examples/ring_usempi
+ else
+ echo "--> skipping usempi examples"
+ fi
+ if ompi_info --parsable | grep -q bindings:use_mpi_f08:yes >/dev/null; then
+ echo "--> running usempif08 examples"
+ run_example "${exec}" ./examples/hello_usempif08
+ run_example "${singleton}" ./examples/hello_usempif08
+ run_example "${exec}" ./examples/ring_usempif08
+ run_example "${singleton}" ./examples/ring_usempif08
+ else
+ echo "--> skipping usempif08 examples"
+ fi
+else
+ echo "--> Skipping examples (MPIRUN_MODE = none)"
+fi
+
+echo "--> All done!"
diff --git a/.ci/lanl/gitlab-darwin-ci.yml b/.ci/lanl/gitlab-darwin-ci.yml
new file mode 100644
index 00000000000..decc4ddd0e3
--- /dev/null
+++ b/.ci/lanl/gitlab-darwin-ci.yml
@@ -0,0 +1,182 @@
+variables:
+ SCHEDULER_PARAMETERS: "-pgeneral -t 4:00:00 -N 1 --ntasks-per-node=16"
+ GIT_STRATEGY: clone
+ NPROCS: 4
+
+stages:
+ - build
+ - test
+
+build:intel:
+ id_tokens:
+ SITE_ID_TOKEN:
+ aud: https://re-git.lanl.gov
+ stage: build
+ tags: [darwin-slurm-shared]
+ script:
+ - module load intel/2022.0.1
+ - rm .gitmodules
+ - cp $GITSUBMODULEPATCH .gitmodules
+ - git submodule update --init --recursive
+ - ./autogen.pl
+ - ./configure CC=icx FC=ifx CXX=icpx --prefix=$PWD/install_test --with-libevent=internal
+ - make -j 8 install
+ - make check
+ - export PATH=$PWD/install_test/bin:$PATH
+ - cd examples
+ - make
+ artifacts:
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+ untracked: true
+ paths:
+ - examples
+ - install_test
+ expire_in: 1 week
+
+build:amd:
+ id_tokens:
+ SITE_ID_TOKEN:
+ aud: https://re-git.lanl.gov
+ stage: build
+ tags: [darwin-slurm-shared]
+ variables:
+ SCHEDULER_PARAMETERS: "-pamd-rome -t 4:00:00 -N 1 --ntasks-per-node=16"
+ script:
+ - module load aocc/3.0.0
+ - rm .gitmodules
+ - cp $GITSUBMODULEPATCH .gitmodules
+ - git submodule update --init --recursive
+ - ./autogen.pl
+ - ./configure CC=clang FC=flang CXX=clang++ --prefix=$PWD/install_test --with-libevent=internal LIBS="-lucm -lucs"
+ - make -j 8 install
+ - make check
+ - export PATH=$PWD/install_test/bin:$PATH
+ - cd examples
+ - make
+ artifacts:
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+ untracked: true
+ paths:
+ - examples
+ - install_test
+ expire_in: 1 week
+
+build:gnu:
+ id_tokens:
+ SITE_ID_TOKEN:
+ aud: https://re-git.lanl.gov
+ stage: build
+ tags: [darwin-slurm-shared]
+ script:
+ - module load gcc
+ - rm .gitmodules
+ - cp $GITSUBMODULEPATCH .gitmodules
+ - git submodule update --init --recursive
+ - ./autogen.pl
+ - ./configure --prefix=$PWD/install_test --with-libevent=internal
+ - make -j 8 install
+ - make check
+ - export PATH=$PWD/install_test/bin:$PATH
+ - cd examples
+ - make
+ artifacts:
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+ untracked: true
+ paths:
+ - examples
+ - install_test
+ expire_in: 1 week
+
+test:intel:
+ id_tokens:
+ SITE_ID_TOKEN:
+ aud: https://re-git.lanl.gov
+ stage: test
+ tags: [darwin-slurm-shared]
+ dependencies:
+ - build:intel
+ needs: ["build:intel"]
+ script:
+ - pwd
+ - ls
+ - module load intel/2022.0.1
+ - export PATH=$PWD/install_test/bin:$PATH
+ - which mpirun
+ - cd examples
+ - mpirun -np 4 hostname
+ - mpirun -np 4 ./hello_c
+ - mpirun -np 4 ./ring_c
+ - mpirun -np 4 ./hello_mpifh
+ - mpirun -np 4 ./ring_mpifh
+ - mpirun -np 4 ./hello_usempi
+ - mpirun -np 4 ./ring_usempi
+ - mpirun -np 4 ./hello_usempif08
+ - mpirun -np 4 ./ring_usempif08
+ - mpirun -np 4 ./connectivity_c
+ artifacts:
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+ expire_in: 1 week
+
+test:amd:
+ id_tokens:
+ SITE_ID_TOKEN:
+ aud: https://re-git.lanl.gov
+ stage: test
+ tags: [darwin-slurm-shared]
+ variables:
+ SCHEDULER_PARAMETERS: "-pamd-rome -t 2:00:00 -N 1 --ntasks-per-node=16"
+ dependencies:
+ - build:amd
+ needs: ["build:amd"]
+ script:
+ - pwd
+ - ls
+ - module load aocc/3.0.0
+ - export PATH=$PWD/install_test/bin:$PATH
+ - export LD_LIBRARY_PATH=$PWD/install_test/lib:$LD_LIBRARY_PATH
+ - which mpirun
+ - cd examples
+ - mpirun -np 4 hostname
+ - mpirun -np 4 ./hello_c
+ - mpirun -np 4 ./ring_c
+ - mpirun -np 4 ./hello_mpifh
+ - mpirun -np 4 ./ring_mpifh
+ - mpirun -np 4 ./hello_usempi
+ - mpirun -np 4 ./ring_usempi
+ - mpirun -np 4 ./hello_usempif08
+ - mpirun -np 4 ./ring_usempif08
+ - mpirun -np 4 ./connectivity_c
+ artifacts:
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+ expire_in: 1 week
+
+test:gnu:
+ id_tokens:
+ SITE_ID_TOKEN:
+ aud: https://re-git.lanl.gov
+ stage: test
+ tags: [darwin-slurm-shared]
+ dependencies:
+ - build:gnu
+ needs: ["build:gnu"]
+ script:
+ - pwd
+ - ls
+ - module load gcc
+ - export PATH=$PWD/install_test/bin:$PATH
+ - which mpirun
+ - cd examples
+ - mpirun -np 4 hostname
+ - mpirun -np 4 ./hello_c
+ - mpirun -np 4 ./ring_c
+ - mpirun -np 4 ./hello_mpifh
+ - mpirun -np 4 ./ring_mpifh
+ - mpirun -np 4 ./hello_usempi
+ - mpirun -np 4 ./ring_usempi
+ - mpirun -np 4 ./hello_usempif08
+ - mpirun -np 4 ./ring_usempif08
+ - mpirun -np 4 ./connectivity_c
+ artifacts:
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+ expire_in: 1 week
+
diff --git a/.ci/mellanox/README.md b/.ci/mellanox/README.md
new file mode 100644
index 00000000000..2a9d5c09b15
--- /dev/null
+++ b/.ci/mellanox/README.md
@@ -0,0 +1,16 @@
+# Open MPI Continuous Integration (CI) Services
+## Mellanox Open MPI CI
+### Scope
+[Mellanox](https://www.mellanox.com/) Open MPI CI is intended to verify Open MPI with recent Mellanox SW components ([Mellanox OFED](https://www.mellanox.com/page/products_dyn?product_family=26), [UCX](https://www.mellanox.com/page/products_dyn?product_family=281&mtag=ucx) and other [HPC-X](https://www.mellanox.com/page/products_dyn?product_family=189&mtag=hpc-x) components) in the Mellanox lab environment.
+
+CI is managed by [Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops) service.
+
+Mellanox Open MPI CI includes:
+* Open MPI building with internal stable engineering versions of UCX and HCOLL. The building is run in Docker-based environment.
+* Sanity functional testing.
+### How to Run CI
+Mellanox Open MPI CI is triggered upon the following events:
+* Create a pull request (PR). CI status is visible in the PR status. CI is restarted automatically upon each new commit within the PR. CI status and log files are also available on the Azure DevOps server.
+* Trigger CI with special PR comments (for example, `/azp run`). Comment triggers are available only if the comment author has write permission to the PR target repo. Detailed information about comment triggers is available in the official Azure DevOps [documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers).
+### Support
+In case of any issues, questions or suggestions please contact to [Mellanox Open MPI CI support team](mailto:swx-azure-svc@mellanox.com).
diff --git a/.ci/mellanox/azure-pipelines.yml b/.ci/mellanox/azure-pipelines.yml
index 187bcfb7752..c676cf7d1bc 100644
--- a/.ci/mellanox/azure-pipelines.yml
+++ b/.ci/mellanox/azure-pipelines.yml
@@ -1,6 +1,6 @@
trigger: none
pr:
- - master
+ - main
- v*.*.x
pool:
@@ -10,7 +10,7 @@ pool:
- MLNX_IB_DEVICE -equals yes
variables:
- ompi_jenkins_scripts_git_repo_url: https://github.com/mellanox-hpc/jenkins_scripts.git
+ ompi_jenkins_scripts_git_repo_url: https://github.com/Mellanox/jenkins_scripts.git
ompi_jenkins_scripts_git_branch: master
# Enable debug information, supported values: true, false
debug: true
@@ -25,7 +25,7 @@ jobs:
--ulimit memlock=-1 --security-opt seccomp=unconfined --cap-add=SYS_ADMIN --device=/dev/infiniband/
steps:
- checkout: self
- submodules: true
+ submodules: recursive
path: ompi
clean: true
- bash: |
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 00000000000..d4249d80c2d
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,173 @@
+# This file represents the coding style enforced by Open MPI. This file
+# is based on the long-held, but not enforced, guidelines from the
+# beginning of the project. We will be requiring that all code going
+# forward uses this style. To check your code before attempting to open
+# a PR install clang-format and run your commits through clang-format.
+#
+# To install clang-format:
+#
+# macOS:
+# Homebrew: brew install clang-format
+# Mac Ports: port install clang
+#
+# Linux:
+# debian/ubuntu/rasbian: apt-get install clang-format
+# redhat/fedora: yum install clang-format
+#
+# To run against your code changes:
+#
+# unstaged changes: git clang-format --style file -f
+# staged changes: git clang-format --style file
+#
+# For interactive add the -p option.
+#
+# To run against all of Open MPI:
+#
+# ./contrib/clang-format-ompi.sh
+#
+# This command is intended to be run only once.
+---
+Language: Cpp
+# BasedOnStyle: LLVM
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveMacros: true
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: false
+AllowAllConstructorInitializersOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: MultiLine
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterCaseLabel: false
+ AfterClass: false
+ AfterControlStatement: Never
+ AfterEnum: false
+ AfterFunction: true
+ AfterNamespace: false
+ AfterObjCDeclaration: false
+ AfterStruct: false
+ AfterUnion: false
+ AfterExternBlock: false
+ BeforeCatch: false
+ BeforeElse: false
+ IndentBraces: false
+ SplitEmptyFunction: true
+ SplitEmptyRecord: true
+ SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: true
+BreakBeforeBraces: Custom
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit: 100
+CommentPragmas: '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DeriveLineEnding: true
+DerivePointerAlignment: false
+DisableFormat: false
+FixNamespaceComments: true
+ForEachMacros:
+ - foreach
+ - Q_FOREACH
+ - BOOST_FOREACH
+ - BOOST_FOREACH
+ - OPAL_LIST_FOREACH
+ - OPAL_LIST_FOREACH_DECL
+ - OPAL_LIST_FOREACH_SAFE
+ - OPAL_LIST_FOREACH_REV
+ - OPAL_LIST_FOREACH_SAFE_REV
+ - OPAL_HASH_TABLE_FOREACH
+ - OPAL_HASH_TABLE_FOREACH_PTR
+IncludeBlocks: Preserve
+IncludeCategories:
+ # Ensure config includes always come first (opal_config.h, ompi_config.h, etc)
+ - Regex: '^".*_config\.h"'
+ Priority: -1
+ # In-tree includes come next (after main include)
+ - Regex: '^".*"'
+ Priority: 2
+ # System includes come last
+ - Regex: '^<.*>'
+ Priority: 3
+IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentCaseLabels: false
+IndentGotoLabels: true
+IndentPPDirectives: AfterHash
+IndentWidth: 4
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 4
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 250
+PenaltyBreakBeforeFirstCallParameter: 301
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Right
+ReflowComments: true
+SortIncludes: true
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: true
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+Standard: Latest
+StatementMacros:
+ - Q_UNUSED
+ - QT_REQUIRE_VERSION
+ - BEGIN_C_DECLS
+ - END_C_DECLS
+TabWidth: 8
+UseCRLF: false
+UseTab: Never
+...
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 69945cf0b6d..0d17ee08ec1 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -5,85 +5,7 @@ Open MPI!

-General information about contributing to the Open MPI project can be found at the [Contributing to Open MPI webpage](https://www.open-mpi.org/community/contribute/).
-The instructions below are specifically for opening issues and pull requests against Open MPI.
-
-## Content
-
-We love getting contributions from anyone. But keep in mind that Open
-MPI is used in production environments all around the world.
-
-If you're contributing a small bug fix, awesome!
-
-If you're contributing a large new piece of functionality, that will
-be best viewed if you — or someone, anyone — is also stepping up to
-help maintain that functionality over time. We love new ideas and new
-features, but we do need to be realistic in what we can reliably test
-and deliver to our users.
-
-## Contributor's Declaration
-
-In order to ensure that we can keep distributing Open MPI under our
-[open source license](/LICENSE), we need to ensure that all
-contributions are compatible with that license.
-
-To that end, we require that all Git commits contributed to Open MPI
-have a "Signed-off-by" token indicating that the commit author agrees
-with [Open MPI's Contributor's
-Declaration](https://github.com/open-mpi/ompi/wiki/Administrative-rules#contributors-declaration).
-
-If you have not already done so, please ensure that:
-
-1. Every commit contains exactly the "Signed-off-by" token. You can
-add this token via `git commit -s`.
-1. The email address after "Signed-off-by" must match the Git commit
-email address.
-
-## **Did you find a bug?**
-
-* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/open-mpi/ompi/issues).
-
-* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/open-mpi/ompi/issues/new).
-
-* For more detailed information on submitting a bug report and creating an issue, visit our [Bug Tracking webpage](https://www.open-mpi.org/community/help/bugs.php).
-
-## **Did you write a patch that fixes a bug?**
-
-* Open a new GitHub pull request with the patch.
-
-* Ensure the PR description clearly describes the problem and solution. If there is an existing GitHub issue open describing this bug, please include it in the description so we can close it.
-
-* Before submitting, please read the [Contributing to the Open MPI Project FAQ](https://www.open-mpi.org/faq/?category=contributing) web page, and the [SubmittingPullRequests](https://github.com/open-mpi/ompi/wiki/SubmittingPullRequests) wiki page. In particular, note that all Git commits contributed to Open MPI require a "Signed-off-by" line.
-
-## **Do you intend to add a new feature or change an existing one?**
-
-* Suggest your change on the [devel mail list](https://www.open-mpi.org/community/lists/ompi.php) and start writing code. The [developer level technical information on the internals of Open MPI](https://www.open-mpi.org/faq/?category=developers) may also be useful for large scale features.
-
-* Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes.
-
-## **Do you have questions about the source code?**
-
-* First checkout the [developer level technical information on the internals of Open MPI](https://www.open-mpi.org/faq/?category=developers). A paper describing the [multi-component architecture](https://www.open-mpi.org/papers/ics-2004/ics-2004.pdf) of Open MPI may also be helpful. The [devel mail list](https://www.open-mpi.org/community/lists/ompi.php) is a good place to post questions about the source code as well.
-
-## Style
-
-There are a small number of style rules for Open MPI:
-
-1. For all code:
- * 4 space tabs. No more, no less.
- * No tab characters *at all*. 2 indentations are 8 spaces — not a tab.
- * m4 code is a bit weird in terms of indentation: we don't have a
- good, consistent indentation style in our existing code. But
- still: no tab characters at all.
-1. For C code:
- * We prefer if all blocks are enclosed in `{}` (even 1-line
- blocks).
- * We prefer that if you are testing equality with a constant, put
- the constant on the *left* of the `==`. E.g., `if (NULL ==
- ptr)`.
- * If there are no parameters to a C function, declare it with
- `(void)` (vs. `()`).
-
-That's about it. Thank you!
-
-— The Open MPI Team
+Open MPI is hosted on GitHub, and we gladly accept pull requests.
+Please see the [Contributing
+guidelines](https://docs.open-mpi.org/en/main/contributing.html) for
+details on how to contribute to Open MPI.
diff --git a/.github/ISSUE_TEMPLATE/ask-a-question.md b/.github/ISSUE_TEMPLATE/ask-a-question.md
new file mode 100644
index 00000000000..21583e901d7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/ask-a-question.md
@@ -0,0 +1,45 @@
+---
+name: Ask a question
+about: Got a problem or question? This is the place to ask.
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+Please submit all the information below so that we can understand the working environment that is the context for your question.
+
+* If you have a problem building or installing Open MPI, [be sure to read this](https://docs.open-mpi.org/en/main/getting-help.html#for-problems-building-or-installing-open-mpi).
+* If you have a problem launching MPI or OpenSHMEM applications, [be sure to read this](https://docs.open-mpi.org/en/main/getting-help.html#for-problems-launching-mpi-or-openshmem-applications).
+* If you have a problem running MPI or OpenSHMEM applications (i.e., after launching them), [be sure to read this](https://docs.open-mpi.org/en/main/getting-help.html#for-problems-running-mpi-or-openshmem-applications).
+
+## Background information
+
+### What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
+
+
+
+### Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
+
+
+
+### If you are building/installing from a git clone, please copy-n-paste the output from `git submodule status`.
+
+
+
+### Please describe the system on which you are running
+
+* Operating system/version:
+* Computer hardware:
+* Network type:
+
+-----------------------------
+
+## Details of the problem
+
+Please describe, in detail, the problem that you are having, including the behavior you expect to see, the actual behavior that you are seeing, steps to reproduce the problem, etc. It is most helpful if you can attach a small program that a developer can use to reproduce your problem.
+
+**Note**: If you include verbatim output (or a code block), please use a [GitHub Markdown](https://help.github.com/articles/creating-and-highlighting-code-blocks/) code block like below:
+```shell
+shell$ mpirun -n 2 ./hello_world
+```
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000000..e1c899554ad
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,41 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+Thank you for taking the time to submit an issue!
+
+## Background information
+
+### What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
+
+
+
+### Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
+
+
+
+### If you are building/installing from a git clone, please copy-n-paste the output from `git submodule status`.
+
+
+
+### Please describe the system on which you are running
+
+* Operating system/version:
+* Computer hardware:
+* Network type:
+
+-----------------------------
+
+## Details of the problem
+
+Please describe, in detail, the problem that you are having, including the behavior you expect to see, the actual behavior that you are seeing, steps to reproduce the problem, etc. It is most helpful if you can attach a small program that a developer can use to reproduce your problem.
+
+**Note**: If you include verbatim output (or a code block), please use a [GitHub Markdown](https://help.github.com/articles/creating-and-highlighting-code-blocks/) code block like below:
+```shell
+shell$ mpirun -n 2 ./hello_world
+```
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000000..bbcbbe7d615
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/issue_template.md b/.github/issue_template.md
deleted file mode 100644
index 4e2101b5751..00000000000
--- a/.github/issue_template.md
+++ /dev/null
@@ -1,33 +0,0 @@
-Thank you for taking the time to submit an issue!
-
-## Background information
-
-### What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)
-
-
-
-### Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
-
-
-
-### If you are building/installing from a git clone, please copy-n-paste the output from `git submodule status`.
-
-
-
-### Please describe the system on which you are running
-
-* Operating system/version:
-* Computer hardware:
-* Network type:
-
------------------------------
-
-## Details of the problem
-
-Please describe, in detail, the problem that you are having, including the behavior you expect to see, the actual behavior that you are seeing, steps to reproduce the problem, etc. It is most helpful if you can attach a small program that a developer can use to reproduce your problem.
-
-**Note**: If you include verbatim output (or a code block), please use a [GitHub Markdown](https://help.github.com/articles/creating-and-highlighting-code-blocks/) code block like below:
-```shell
-shell$ mpirun -np 2 ./hello_world
-```
-
diff --git a/.github/workflows/close-stale-issues.yaml b/.github/workflows/close-stale-issues.yaml
new file mode 100644
index 00000000000..e576df6ed9f
--- /dev/null
+++ b/.github/workflows/close-stale-issues.yaml
@@ -0,0 +1,65 @@
+# The idea behind this Action is to prevent the situation where a user
+# files a Github Issue, someone asks for clarification / more
+# information, but the original poster never provides the information.
+# The issue then becomes forgotten and abondoned.
+#
+# Instead of that scenario, Open MPI community members can assign a
+# label to Github Issues indicating that we're waiting for the user to
+# reply. If too much time elapses with no reply, mark the Issue as
+# stale and emit a warning that we'll close the issue if we continue
+# to receive no reply. If we timeout again with no reply after the
+# warning, close the Issue and emit a comment explaining why.
+#
+# If the user *does* reply, the label is removed, and this bot won't
+# touch the Issue. Specifically: this bot will never mark stale /
+# close an Issue that doesn't have the specified label.
+#
+# Additionally, we are *only* marking stale / auto-closing Github
+# Issues -- not Pull Requests.
+#
+# This is a cron-based Action that runs a few times a day, just so
+# that we don't mark stale / close a bunch of issues all at once.
+#
+# While the actions/stale bot Action used here is capable of removing
+# the label when a user replies to the Issue, we actually use a 2nd
+# Action (removing-awaiting-user-info-label.yaml) to remove the label.
+# We do this because that 2nd Action runs whenever a comment is
+# created -- not via cron. Hence, the 2nd Action will remove the
+# label effectively immediately when the user replies (vs. up to
+# several hours later).
+
+name: Close stale issues
+on:
+ schedule:
+ # Run it a few times a day so as not to necessarily mark stale /
+ # close a bunch of issues at once.
+ - cron: '0 1,5,9,13,17,21 * * *'
+
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ # https://github.com/marketplace/actions/close-stale-issues
+ - uses: actions/stale@v9
+ with:
+ # If there are no replies for 14 days, mark the issue as
+ # "stale" (and emit a warning).
+ days-before-stale: 14
+ # If there are no replies for 14 days after becoming stale,
+ # then close the issue (and emit a message explaining why).
+ days-before-close: 14
+
+ # Never close PRs
+ days-before-pr-close: -1
+
+ # We only close issues with this label
+ only-labels: State-Awaiting user information
+ close-issue-label: Closed due to no reply
+
+ # Messages that we put in comments on issues
+ stale-issue-message: |
+ It looks like this issue is expecting a response, but hasn't gotten one yet. If there are no responses in the next 2 weeks, we'll assume that the issue has been abandoned and will close it.
+ close-issue-message: |
+ Per the above comment, it has been a month with no reply on this issue. It looks like this issue has been abandoned.
+
+ I'm going to close this issue. If I'm wrong and this issue is *not* abandoned, please feel free to re-open it. Thank you!
diff --git a/.github/workflows/compile-cuda.yaml b/.github/workflows/compile-cuda.yaml
new file mode 100644
index 00000000000..97d89372ce0
--- /dev/null
+++ b/.github/workflows/compile-cuda.yaml
@@ -0,0 +1,28 @@
+name: CUDA
+
+on: [pull_request]
+
+env:
+ CUDA_PATH: /usr/local/cuda
+jobs:
+ compile-cuda:
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y --no-install-recommends wget
+ - name: Install extra dependencies
+ run: |
+ wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
+ sudo dpkg -i cuda-keyring_1.1-1_all.deb
+ sudo apt update
+ sudo apt install -y cuda-toolkit
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Build Open MPI
+ run: |
+ ./autogen.pl
+ ./configure --prefix=${PWD}/install --with-cuda=${CUDA_PATH} --with-cuda-libdir=${CUDA_PATH}/lib64/stubs --disable-silent-rules
+ make -j
diff --git a/.github/workflows/compile-rocm.yaml b/.github/workflows/compile-rocm.yaml
new file mode 100644
index 00000000000..22af463a164
--- /dev/null
+++ b/.github/workflows/compile-rocm.yaml
@@ -0,0 +1,31 @@
+name: ROCM
+
+on: [pull_request]
+
+env:
+ ROCM_VER: 6.2.2
+jobs:
+ compile-rocm:
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y --no-install-recommends wget lsb-core software-properties-common gpg curl
+ - name: Install extra dependencies
+ run: |
+ sudo mkdir --parents --mode=0755 /etc/apt/keyrings
+ wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
+ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/${ROCM_VER}/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
+ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${ROCM_VER} jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
+ echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
+ sudo apt update
+ sudo apt install -y rocm-hip-runtime hip-dev
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Build Open MPI
+ run: |
+ ./autogen.pl
+ ./configure --prefix=${PWD}/install --with-rocm=/opt/rocm --disable-mpi-fortran --disable-silent-rules
+ LD_LIBRARY_PATH=/opt/rocm/lib make -j
diff --git a/.github/workflows/compile-ze.yaml b/.github/workflows/compile-ze.yaml
new file mode 100644
index 00000000000..cd18cb4719a
--- /dev/null
+++ b/.github/workflows/compile-ze.yaml
@@ -0,0 +1,28 @@
+name: OneAPI ZE
+
+on: [pull_request]
+
+jobs:
+ compile-ze:
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y --no-install-recommends wget lsb-core software-properties-common gpg curl cmake git
+ - name: Build OneAPI ZE
+ run: |
+ git clone https://github.com/oneapi-src/level-zero.git
+ cd level-zero
+ mkdir build
+ cd build
+ cmake ../ -DCMAKE_INSTALL_PREFIX=/opt/ze
+ sudo make -j install
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Build Open MPI
+ run: |
+ ./autogen.pl
+ ./configure --prefix=${PWD}/install --disable-mpi-fortran --disable-oshmem --with-ze --disable-silent-rules
+ make -j
diff --git a/.github/workflows/git-commit-checks.json b/.github/workflows/git-commit-checks.json
deleted file mode 100644
index e587b11fbd4..00000000000
--- a/.github/workflows/git-commit-checks.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "cherry pick required" : 0
-}
diff --git a/.github/workflows/git-commit-checks.py b/.github/workflows/git-commit-checks.py
deleted file mode 100755
index d6ebfbfd1d2..00000000000
--- a/.github/workflows/git-commit-checks.py
+++ /dev/null
@@ -1,336 +0,0 @@
-#!/usr/bin/env python3
-
-"""
-
-Sanity tests on git commits in a Github Pull Request.
-
-This script is designed to run as a Github Action. It assumes environment
-variables that are available in the Github Action environment. Specifically:
-
-* GITHUB_WORKSPACE: directory where the git clone is located
-* GITHUB_SHA: the git commit SHA of the artificial Github PR test merge commit
-* GITHUB_BASE_REF: the git ref for the base branch
-* GITHUB_TOKEN: token authorizing Github API usage
-* GITHUB_REPOSITORY: "org/repo" name of the Github repository of this PR
-* GITHUB_REF: string that includes this Github PR number
-
-This script tests each git commit between (and not including) GITHUB_SHA and
-GITHUB_BASE_REF multiple ways:
-
-1. Ensure that the committer and author do not match any bad patterns (e.g.,
-"root@", "localhost", etc.).
-
-2. Ensure that a proper "Signed-off-by" line exists in the commit message.
- - Merge commits and reverts are exempted from this check.
-
-3. If required (by the git-commit-checks.json config file), ensure that a
-"(cherry picked from commit ...)" line exists in the commit message.
- - Commits that are solely comprised of submodule updates are exempted from
- this check.
- - This check can also be disabled by adding "bot:notacherrypick" in the
- Pull Request description.
-
-4. If a "(cherry picked from commit ...)" message exists, ensure that the commit
-hash it mentions exists in the git repository.
-
-If all checks pass, the script exits with status 0. Otherwise, it exits with
-status 1.
-
-"""
-
-import os
-import re
-import git
-import json
-import copy
-import argparse
-
-from github import Github
-
-GOOD = "good"
-BAD = "bad"
-
-GITHUB_WORKSPACE = os.environ.get('GITHUB_WORKSPACE')
-GITHUB_SHA = os.environ.get('GITHUB_SHA')
-GITHUB_BASE_REF = os.environ.get('GITHUB_BASE_REF')
-GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN')
-GITHUB_REPOSITORY = os.environ.get('GITHUB_REPOSITORY')
-GITHUB_REF = os.environ.get('GITHUB_REF')
-
-# Sanity check
-if (GITHUB_WORKSPACE is None or
- GITHUB_SHA is None or
- GITHUB_BASE_REF is None or
- GITHUB_TOKEN is None or
- GITHUB_REPOSITORY is None or
- GITHUB_REF is None):
- print("Error: this script is designed to run as a Github Action")
- exit(1)
-
-#----------------------------------------------------------------------------
-
-"""
-Simple helper to make a 1-line git commit message summary.
-"""
-def make_commit_message(repo, hash):
- commit = repo.commit(hash)
- lines = commit.message.split('\n')
- message = lines[0][:50]
- if len(lines[0]) > 50:
- message += "..."
-
- return message
-
-#----------------------------------------------------------------------------
-
-"""
-The results dictionary is in the following format:
-
- results[GOOD or BAD][commit hash][check name] = message
-
-If the message is None, there's nothing to print.
-
-A git commit hash will be in either the GOOD or the BAD results -- not both.
-"""
-def print_results(results, repo, hashes):
- def _print_list(entries, prefix=""):
- for hash, entry in entries.items():
- print(f"{prefix}* {hash[:8]}: {make_commit_message(repo, hash)}")
- for check_name, message in entry.items():
- if message is not None:
- print(f"{prefix} * {check_name}: {message}")
-
- # First, print all the commits that have only-good results
- if len(results[GOOD]) > 0:
- print("\nThe following commits passed all tests:\n")
- _print_list(results[GOOD])
-
- # Now print all the results that are bad
- if len(results[BAD]) > 0:
- # The "::error ::" token will cause Github to highlight these
- # lines as errors
- print(f"\n::error ::The following commits caused this test to fail\n")
- _print_list(results[BAD], "::error ::")
-
-#----------------------------------------------------------------------------
-
-"""
-Global regexp, because we use it every time we call
-check_signed_off() (i.e., for each commit in this PR)
-"""
-prog_sob = re.compile(r'Signed-off-by: (.+) <(.+)>')
-
-def check_signed_off(config, repo, commit):
- # If the message starts with "Revert" or if the commit is a
- # merge, don't require a signed-off-by
- if commit.message.startswith("Revert "):
- return GOOD, "skipped (revert)"
- elif len(commit.parents) == 2:
- return GOOD, "skipped (merge)"
-
- matches = prog_sob.search(commit.message)
- if not matches:
- return BAD, "does not contain a valid Signed-off-by line"
-
- return GOOD, None
-
-#----------------------------------------------------------------------------
-
-def check_email(config, repo, commit):
- emails = {
- "author" : commit.author.email.lower(),
- "committer" : commit.committer.email.lower(),
- }
-
- for id, email in emails.items():
- for pattern in config['bad emails']:
- match = re.search(pattern, email)
- if match:
- return BAD, f"{id} email address ({email}) contains '{pattern}'"
-
- return GOOD, None
-
-#----------------------------------------------------------------------------
-
-"""
-Global regexp, because we use it every time we call check_cherry_pick()
-(i.e., for each commit in this PR)
-"""
-prog_cp = re.compile(r'\(cherry picked from commit ([a-z0-9]+)\)')
-
-def check_cherry_pick(config, repo, commit):
- def _is_entirely_submodule_updates(repo, commit):
- # If it's a merge commit, that doesn't fit our definition of
- # "entirely submodule updates"
- if len(commit.parents) == 2:
- return False
-
- # Check the diffs of this commit compared to the prior commit,
- # and see if all the changes are updates to submodules.
- submodule_paths = [ x.path for x in repo.submodules ]
- diffs = repo.commit(f"{commit}~1").tree.diff(commit)
- for diff in diffs:
- if diff.a_path not in submodule_paths:
- # If we get here, we found a diff that was not exclusively
- # a submodule update.
- return False
-
- # If we get here, then all the diffs were submodule updates.
- return True
-
- # If this commit is solely comprised of submodule updates, don't
- # require a cherry pick message.
- if len(repo.submodules) > 0 and _is_entirely_submodule_updates(repo, commit):
- return GOOD, "skipped (submodules updates)"
-
- non_existent = dict()
- found_cherry_pick_line = False
- for match in prog_cp.findall(commit.message):
- found_cherry_pick_line = True
- try:
- c = repo.commit(match)
- except ValueError as e:
- # These errors mean that the git library recognized the
- # hash as a valid commit, but the GitHub Action didn't
- # fetch the entire repo, so we don't have all the meta
- # data about this commit. Bottom line: it's a good hash.
- # So -- no error here.
- pass
- except git.BadName as e:
- # Use a dictionary to track the non-existent hashes, just
- # on the off chance that the same non-existent hash exists
- # more than once in a single commit message (i.e., the
- # dictionary will effectively give us de-duplication for
- # free).
- non_existent[match] = True
-
- # Process the results for this commit
- if found_cherry_pick_line:
- if len(non_existent) == 0:
- return GOOD, None
- else:
- str = f"contains a cherry pick message that refers to non-existent commit"
- if len(non_existent) > 1:
- str += "s"
- str += ": "
- str += ", ".join(non_existent)
- return BAD, str
-
- else:
- if config['cherry pick required']:
- return BAD, "does not include a cherry pick message"
- else:
- return GOOD, None
-
-#----------------------------------------------------------------------------
-
-def check_all_commits(config, repo):
- # Get a list of commits that we'll be examining. Use the progromatic form
- # of "git log GITHUB_BASE_REF..GITHUB_SHA" (i.e., "git log ^GITHUB_BASE_REF
- # GITHUB_SHA") to do the heavy lifting to find that set of commits.
- git_cli = git.cmd.Git(GITHUB_WORKSPACE)
- hashes = git_cli.log(f"--pretty=format:%h", f"origin/{GITHUB_BASE_REF}..{GITHUB_SHA}").splitlines()
-
- # The first entry in the list will be the artificial Github merge commit for
- # this PR. We don't want to examine this commit.
- del hashes[0]
-
- #------------------------------------------------------------------------
-
- # Make an empty set of nested dictionaries to fill in, below. We initially
- # create a "full" template dictionary (with all the hashes for both GOOD and
- # BAD results), but will trim some of them later.
- template = { hash : dict() for hash in hashes }
- results = {
- GOOD : copy.deepcopy(template),
- BAD : copy.deepcopy(template),
- }
-
- for hash in hashes:
- overall = GOOD
-
- # Do the checks on this commit
- commit = repo.commit(hash)
- for check_fn in [check_signed_off, check_email, check_cherry_pick]:
- result, message = check_fn(config, repo, commit)
- overall = BAD if result == BAD else overall
-
- results[result][hash][check_fn.__name__] = message
-
- # Trim the results dictionary so that a hash only appears in GOOD *or*
- # BAD -- not both. Specifically:
- #
- # 1. If a hash has BAD results, delete all of its results from GOOD.
- # 2. If a hash has only GOOD results, delete its empty entry from BAD.
- if overall == BAD:
- del results[GOOD][hash]
- else:
- del results[BAD][hash]
-
- return results, hashes
-
-#----------------------------------------------------------------------------
-
-"""
-If "bot:notacherrypick" is in the PR description, then disable the
-cherry-pick message requirement.
-"""
-def check_github_pr_description(config):
- g = Github(GITHUB_TOKEN)
- repo = g.get_repo(GITHUB_REPOSITORY)
-
- # Extract the PR number from GITHUB_REF
- match = re.search("/(\d+)/", GITHUB_REF)
- pr_num = int(match.group(1))
- pr = repo.get_pull(pr_num)
-
- if "bot:notacherrypick" in pr.body:
- config['cherry pick required'] = False
-
-#----------------------------------------------------------------------------
-
-def load_config():
- # Defaults
- config = {
- 'cherry pick required' : False,
- 'permit empty' : False,
- 'bad emails' : [
- '^root@',
- 'localhost',
- 'localdomain',
- ],
- }
-
- # If the config file exists, read it in and replace default values
- # with the values from the file.
- filename = os.path.join(GITHUB_WORKSPACE, '.github',
- 'workflows', 'git-commit-checks.json')
- if os.path.exists(filename):
- with open(filename) as fp:
- new_config = json.load(fp)
- for key in new_config:
- config[key] = new_config[key]
-
- return config
-
-#----------------------------------------------------------------------------
-
-def main():
- config = load_config()
- check_github_pr_description(config)
-
- repo = git.Repo(GITHUB_WORKSPACE)
- results, hashes = check_all_commits(config, repo)
- print_results(results, repo, hashes)
-
- if len(results[BAD]) == 0:
- print("\nTest passed: everything was good!")
- exit(0)
- else:
- print("\nTest failed: sad panda")
- exit(1)
-
-#----------------------------------------------------------------------------
-
-if __name__ == "__main__":
- main()
diff --git a/.github/workflows/git-commit-checks.yml b/.github/workflows/git-commit-checks.yml
deleted file mode 100644
index 4cf1036878e..00000000000
--- a/.github/workflows/git-commit-checks.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: GitHub Action CI
-
-on:
- pull_request:
- # We don't need this to be run on all types of PR behavior
- # See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
- types:
- - opened
- - synchronize
- - edited
-
-jobs:
- ci:
- name: Git commit checker
- runs-on: ubuntu-latest
- steps:
- - name: Check out the code
- uses: actions/checkout@v2
- with:
- # Get all branches and history
- fetch-depth: 0
-
- - name: Setup Python
- uses: actions/setup-python@v2
- with:
- python-version: '3.x'
-
- - name: Get the GitPython and PyGithub modules
- run: pip install gitpython PyGithub
-
- - name: Check all git commits
- run: $GITHUB_WORKSPACE/.github/workflows/git-commit-checks.py
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/hdf5-tests.yaml b/.github/workflows/hdf5-tests.yaml
new file mode 100644
index 00000000000..42417033a88
--- /dev/null
+++ b/.github/workflows/hdf5-tests.yaml
@@ -0,0 +1,45 @@
+name: HDF5
+
+on: [pull_request]
+
+jobs:
+ hdf5-testsuite:
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y --no-install-recommends wget
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Build Open MPI
+ run: |
+ ./autogen.pl
+ ./configure --prefix=/opt/openmpi --with-pmix=internal --with-prrte=internal --with-hwloc=internal --with-libevent=internal --disable-mpi-fortran --disable-oshmem
+ make -j 8 && make install
+ - name: Install HDF5
+ run: |
+ wget --progress=dot:giga https://github.com/HDFGroup/hdf5/releases/latest/download/hdf5.tar.gz
+ tar -xzf hdf5.tar.gz
+ mv hdf5-1* hdf5
+ cd hdf5
+ export PATH=/opt/openmpi/bin:${PATH}
+ export LD_LIBRARY_PATH=/opt/openmpi/lib:${LD_LIBRARY_PATH}
+ echo ${PATH}
+ echo ${LD_LIBRARY_PATH}
+ ./configure --enable-parallel
+ make -j 8
+ - name: Tweak MPI
+ run: |
+ # Tweak MPI
+ mca_params="$HOME/.prte/mca-params.conf"
+ mkdir -p "$(dirname "$mca_params")"
+ echo rmaps_default_mapping_policy = :oversubscribe >> "$mca_params"
+ - name: Run testsuite (ompio)
+ run: |
+ export PATH=/opt/openmpi/bin:${PATH}
+ export LD_LIBRARY_PATH=/opt/openmpi/lib:${LD_LIBRARY_PATH}
+ HDF5TestExpress=0 mpirun --mca io ompio -np 4 ./hdf5/testpar/t_shapesame
+ mpirun --mca io ompio -np 4 ./hdf5/testpar/t_filters_parallel
+ mpirun --mca io ompio -np 4 ./hdf5/testpar/testphdf5
diff --git a/.github/workflows/macos-checks.yaml b/.github/workflows/macos-checks.yaml
new file mode 100644
index 00000000000..5c50a8fe114
--- /dev/null
+++ b/.github/workflows/macos-checks.yaml
@@ -0,0 +1,46 @@
+name: macOS
+
+on: [pull_request]
+
+jobs:
+ macOS:
+ runs-on: macos-latest
+ steps:
+ - name: Setup macOS
+ run: |
+ # Copied from mpi4py/mpi-publish
+ # create gfortran symlink
+ cd $(brew --prefix)/bin
+ gfortran=$(ls gfortran-* | sort | head -n 1)
+ sudo ln -s $gfortran gfortran
+ # install autotools
+ brew install autoconf
+ brew install automake
+ brew install libtool
+ # unlink libevent
+ brew unlink libevent || true
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Build Open MPI
+ run: |
+ ./autogen.pl
+ ./configure --prefix=/opt/openmpi --disable-silent-rules
+ make -j $(sysctl -n hw.logicalcpu)
+ - name: Run unit tests
+ run: |
+ make check
+ - name: Install Open MPI
+ run: |
+ sudo make install
+ - name: Add Open MPI to PATH
+ run: echo /opt/openmpi/bin >> $GITHUB_PATH
+ - name: Build examples
+ run: |
+ pushd examples
+ make
+ popd
+ - name: Test ring and sessions sanity check
+ run: |
+ mpirun --map-by ppr:1:core examples/ring_c
+ mpirun --map-by ppr:1:core examples/hello_sessions_c
diff --git a/.github/workflows/ompi_mpi4py.yaml b/.github/workflows/ompi_mpi4py.yaml
new file mode 100644
index 00000000000..8e3c450b4be
--- /dev/null
+++ b/.github/workflows/ompi_mpi4py.yaml
@@ -0,0 +1,157 @@
+name: mpi4py
+
+on:
+ pull_request:
+ workflow_dispatch:
+ inputs:
+ repository:
+ description: 'mpi4py repository'
+ default: 'mpi4py/mpi4py'
+ required: false
+ type: string
+ ref:
+ description: 'mpi4py branch/tag/SHA'
+ default: 'master'
+ required: false
+ type: string
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ env:
+ MPI4PY_TEST_SPAWN: true
+ steps:
+ - name: Configure hostname
+ run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
+ if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
+
+ - name: Install depencencies
+ run: sudo apt-get install -y -q
+ libnuma-dev
+ if: ${{ runner.os == 'Linux' }}
+
+ - name: Checkout Open MPI
+ uses: actions/checkout@v4
+ with:
+ path: mpi-build
+ submodules: recursive
+
+ - name: Bootstrap Open MPI
+ run: ./autogen.pl
+ working-directory: mpi-build
+
+ # Install into a separate directory (/opt/openmpi) so that we can
+ # bundle up that tree into an artifact to share with other jobs in
+ # this github action. Specifically don't use /usr/local, because
+ # there's a bunch of other stuff already installed in /usr/local,
+ # and we don't need to include that in our artifact.
+ - name: Configure Open MPI
+ run: ./configure
+ --disable-dependency-tracking
+ --enable-debug
+ --enable-mem-debug
+ --disable-sphinx
+ --disable-mpi-fortran
+ --disable-oshmem
+ --disable-silent-rules
+ --prefix=/opt/openmpi
+ LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
+ working-directory: mpi-build
+
+ - name: Build MPI
+ run: make -j $(nproc)
+ working-directory: mpi-build
+
+ - name: Install MPI
+ run: sudo make install
+ working-directory: mpi-build
+
+ - name: Add Open MPI to PATH
+ run: echo /opt/openmpi/bin >> $GITHUB_PATH
+
+ - name: Tweak MPI
+ run: |
+ # Tweak MPI
+ mca_params="$HOME/.openmpi/mca-params.conf"
+ mkdir -p "$(dirname "$mca_params")"
+ echo mpi_param_check = true >> "$mca_params"
+ echo mpi_show_handle_leaks = true >> "$mca_params"
+ mca_params="$HOME/.prte/mca-params.conf"
+ mkdir -p "$(dirname "$mca_params")"
+ echo rmaps_default_mapping_policy = :oversubscribe >> "$mca_params"
+
+ - name: Show MPI
+ run: ompi_info
+
+ - name: Show MPICC
+ run: mpicc -show
+
+ - name: Use Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: 3
+ architecture: x64
+
+ - name: Install Python packages (build)
+ run: python -m pip install --upgrade
+ setuptools pip wheel
+
+ - name: Install Python packages (test)
+ run: python -m pip install --upgrade
+ numpy cffi pyyaml
+
+ - name: Checkout mpi4py
+ uses: actions/checkout@v4
+ with:
+ repository: ${{ inputs.repository || 'mpi4py/mpi4py' }}
+ ref: ${{ inputs.ref }}
+
+ - name: Install mpi4py
+ run: python -m pip install .
+ env:
+ CFLAGS: "-O0"
+
+ - name: Test mpi4py (singleton)
+ run: python test/main.py -v
+ if: ${{ true }}
+ timeout-minutes: 10
+ - name: Test mpi4py (np=1)
+ run: mpiexec -n 1 python test/main.py -v
+ if: ${{ true }}
+ timeout-minutes: 10
+ - name: Test mpi4py (np=2)
+ run: mpiexec -n 2 python test/main.py -v -f
+ if: ${{ true }}
+ timeout-minutes: 10
+ - name: Test mpi4py (np=3)
+ run: mpiexec -n 3 python test/main.py -v -f
+ if: ${{ true }}
+ timeout-minutes: 10
+ - name: Test mpi4py (np=4)
+ run: mpiexec -n 4 python test/main.py -v -f
+ if: ${{ true }}
+ timeout-minutes: 10
+ - name: Test mpi4py (np=5)
+ run: mpiexec -n 5 python test/main.py -v -f
+ if: ${{ true }}
+ timeout-minutes: 10
+
+ - name: Test mpi4py.run
+ run: python demo/test-run/test_run.py -v
+ if: ${{ true }}
+ timeout-minutes: 10
+
+ - name: Relocate Open MPI installation
+ run: mv /opt/openmpi /opt/ompi
+ - name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
+ run: |
+ sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH
+ echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV
+ echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV
+
+ - name: Test mpi4py (singleton)
+ run: python test/main.py -v
+ if: ${{ true }}
+ timeout-minutes: 10
+
diff --git a/.github/workflows/ompi_nvidia.yaml b/.github/workflows/ompi_nvidia.yaml
new file mode 100644
index 00000000000..6a3201a3648
--- /dev/null
+++ b/.github/workflows/ompi_nvidia.yaml
@@ -0,0 +1,42 @@
+name: ompi_NVIDIA CI
+on: [pull_request]
+jobs:
+
+ deployment:
+ if: github.repository == 'open-mpi/ompi'
+ runs-on: [self-hosted, linux, x64, nvidia]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Checkout CI scripts
+ uses: actions/checkout@v4
+ with:
+ repository: Mellanox/jenkins_scripts
+ path: ompi_ci
+ - name: Deployment infrastructure
+ run: /start deploy
+ build:
+ needs: [deployment]
+ runs-on: [self-hosted, linux, x64, nvidia]
+ steps:
+ - name: Building OMPI,UCX and tests
+ run: /start build
+ test:
+ needs: [deployment, build]
+ runs-on: [self-hosted, linux, x64, nvidia]
+ steps:
+ - name: Running tests
+ run: /start test
+ clean:
+# always() should be used to run "clean" even when the workflow was canceled
+# ( in case of the right repository name)
+# The second condition doesn't work when the workflow was canceled
+
+ if: always() && (github.repository == 'open-mpi/ompi')
+ needs: [deployment, build, test]
+ runs-on: [self-hosted, linux, x64, nvidia]
+ steps:
+ - name: Cleaning
+ run: /start clean
diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml
new file mode 100644
index 00000000000..5c390424560
--- /dev/null
+++ b/.github/workflows/pr-checks.yaml
@@ -0,0 +1,50 @@
+name: Git commit checks
+
+# We're using pull_request_target here instead of just pull_request so that the
+# action runs in the context of the base of the pull request, rather than in the
+# context of the merge commit. For more detail about the differences, see:
+# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
+on:
+ pull_request_target:
+ # We don't need this to be run on all types of PR behavior
+ # See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
+ types:
+ - opened
+ - synchronize
+ - edited
+
+permissions: {} # none
+
+jobs:
+ check:
+ permissions:
+ pull-requests: write
+ name: Check Commits
+ runs-on: ubuntu-latest
+ steps:
+ - name: Pull Request Commit Checker
+ uses: open-mpi/pr-git-commit-checker@v1.0.1
+ with:
+ token: "${{ secrets.GITHUB_TOKEN}}"
+ label:
+ permissions:
+ pull-requests: write
+ name: Label Pull Request
+ runs-on: ubuntu-latest
+ steps:
+ - name: Pull Request Labeler
+ uses: open-mpi/pr-labeler@v1.0.1
+ with:
+ token: "${{ secrets.GITHUB_TOKEN }}"
+
+ milestone:
+ permissions:
+ issues: write
+ pull-requests: write
+ name: Milestone Pull Request
+ runs-on: ubuntu-latest
+ steps:
+ - name: Pull Request Milestoner
+ uses: open-mpi/pr-milestoner@v1.0.1
+ with:
+ token: "${{ secrets.GITHUB_TOKEN }}"
diff --git a/.github/workflows/remove-awaiting-user-info-label.yaml b/.github/workflows/remove-awaiting-user-info-label.yaml
new file mode 100644
index 00000000000..4b9e9072798
--- /dev/null
+++ b/.github/workflows/remove-awaiting-user-info-label.yaml
@@ -0,0 +1,30 @@
+# This Action is run in conjunction with close-stale-issues.yaml. See
+# that file for a more complete description of how they work together.
+
+name: 'Remove "State: Awaiting user information" label when there has been a reply'
+on:
+ issue_comment:
+ types:
+ - created
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ # From
+ # https://github.com/marketplace/actions/close-issues-after-no-reply:
+ # only remove the label if someone replies to an issue who is not
+ # an owner or collaborator on the repo.
+ if: |
+ github.event.comment.author_association != 'OWNER' &&
+ github.event.comment.author_association != 'COLLABORATOR'
+ steps:
+ - name: 'Remove "State: Awaiting user information" label'
+ uses: octokit/request-action@v2.x
+ continue-on-error: true
+ with:
+ route: DELETE /repos/:repository/issues/:issue/labels/:label
+ repository: ${{ github.repository }}
+ issue: ${{ github.event.issue.number }}
+ label: State-Awaiting user information
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 25f6d27908a..dfa2e7c86d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,11 +8,6 @@
.gdb*
.idea
-.hgrc
-.hgignore
-.hg
-.hgignore_local
-
*.la
*.lo
*.o
@@ -105,6 +100,7 @@ ltoptions.m4
!3rd-party/libevent-*.tar.*
3rd-party/hwloc-*
!3rd-party/hwloc-*.tar.*
+3rd-party/treematch/config.h
config/project_list.m4
config/autogen_found_items.m4
@@ -139,6 +135,7 @@ examples/hello_cxx
examples/hello_mpifh
examples/hello_usempi
examples/hello_usempif08
+examples/hello_sessions_c
examples/ring_c
examples/ring_cxx
examples/ring_mpifh
@@ -188,33 +185,11 @@ ompi/mca/coll/ml/coll_ml_lex.c
ompi/mca/coll/self/coll-self-version.h*
ompi/mca/coll/sm/coll-sm-version.h*
-ompi/mca/io/romio321/romio/adio/include/romioconf.h
-ompi/mca/io/romio321/romio/include/mpio.h
-ompi/mca/io/romio321/romio/localdefs
-ompi/mca/io/romio321/romio/test/fcoll_test.f
-ompi/mca/io/romio321/romio/test/fmisc.f
-ompi/mca/io/romio321/romio/test/fperf.f
-ompi/mca/io/romio321/romio/test/large_file.c
-ompi/mca/io/romio321/romio/test/misc.c
-ompi/mca/io/romio321/romio/test/pfcoll_test.f
-ompi/mca/io/romio321/romio/test/runtests
-ompi/mca/io/romio321/romio/util/romioinstall
-ompi/mca/io/romio321/romio/test/syshints.c
-
ompi/mca/osc/monitoring/osc_monitoring_template_gen.h
ompi/mca/pml/v/autogen.vprotocols
ompi/mca/pml/v/mca_vprotocol_config_output
-ompi/mca/rte/orte/ompi-ps.1
-ompi/mca/rte/orte/ompi-clean.1
-ompi/mca/rte/orte/mpiexec.1
-ompi/mca/rte/orte/ompi-top.1
-ompi/mca/rte/orte/ompi-server.1
-ompi/mca/rte/orte/ompi-restart.1
-ompi/mca/rte/orte/ompi-checkpoint.1
-ompi/mca/rte/orte/mpirun.1
-
ompi/mca/sharedfp/addproc/mca_sharedfp_addproc_control
ompi/mca/topo/treematch/config.h
@@ -226,6 +201,7 @@ ompi/mpi/fortran/mpiext/mpi-ext-module.F90
ompi/mpi/fortran/mpiext/mpi-f08-ext-module.F90
ompi/mpi/fortran/mpiext-use-mpi/mpi-ext-module.F90
ompi/mpi/fortran/mpiext-use-mpi-f08/mpi-f08-ext-module.F90
+ompi/mpi/fortran/use-mpi-f08/psizeof_f08.f90
ompi/mpi/fortran/mpif-h/sizeof_f.f90
ompi/mpi/fortran/mpif-h/profile/p*.c
@@ -257,13 +233,8 @@ ompi/mpi/java/java/*.jar
ompi/mpi/java/java/*.h
ompi/mpi/java/java/doc
-ompi/mpi/man/man3/MPI*.3
-ompi/mpi/man/man3/OpenMPI.3
-ompi/mpi/man/man3/.dir-stamp
-
ompi/mpi/tool/profile/*.c
-ompi/mpiext/affinity/c/OMPI_Affinity_str.3
ompi/mpiext/affinity/c/example
ompi/mpiext/ftmpi/c/profile/pcomm_agree.c
@@ -273,64 +244,19 @@ ompi/mpiext/ftmpi/c/profile/pcomm_iagree.c
ompi/mpiext/ftmpi/c/profile/pcomm_is_revoked.c
ompi/mpiext/ftmpi/c/profile/pcomm_revoke.c
ompi/mpiext/ftmpi/c/profile/pcomm_shrink.c
+ompi/mpiext/ftmpi/c/profile/pcomm_ack_failed.c
+ompi/mpiext/ftmpi/c/profile/pcomm_get_failed.c
+ompi/mpiext/ftmpi/c/profile/pcomm_ishrink.c
ompi/mpiext/example/tests/progress_c
ompi/mpiext/example/tests/progress_mpifh
ompi/mpiext/example/tests/progress_usempi
ompi/mpiext/example/tests/progress_usempif08
-ompi/mpiext/cuda/c/MPIX_Query_cuda_support.3
ompi/mpiext/cuda/c/mpiext_cuda_c.h
ompi/mpiext/cuda/c/cuda_c.h
-ompi/mpiext/pcollreq/c/MPIX_*.3
-ompi/mpiext/pcollreq/c/profile/pallgather_init.c
-ompi/mpiext/pcollreq/c/profile/pallgatherv_init.c
-ompi/mpiext/pcollreq/c/profile/pallreduce_init.c
-ompi/mpiext/pcollreq/c/profile/palltoall_init.c
-ompi/mpiext/pcollreq/c/profile/palltoallv_init.c
-ompi/mpiext/pcollreq/c/profile/palltoallw_init.c
-ompi/mpiext/pcollreq/c/profile/pbarrier_init.c
-ompi/mpiext/pcollreq/c/profile/pbcast_init.c
-ompi/mpiext/pcollreq/c/profile/pexscan_init.c
-ompi/mpiext/pcollreq/c/profile/pgather_init.c
-ompi/mpiext/pcollreq/c/profile/pgatherv_init.c
-ompi/mpiext/pcollreq/c/profile/pmpiext_pcollreq_c.h
-ompi/mpiext/pcollreq/c/profile/pneighbor_allgather_init.c
-ompi/mpiext/pcollreq/c/profile/pneighbor_allgatherv_init.c
-ompi/mpiext/pcollreq/c/profile/pneighbor_alltoall_init.c
-ompi/mpiext/pcollreq/c/profile/pneighbor_alltoallv_init.c
-ompi/mpiext/pcollreq/c/profile/pneighbor_alltoallw_init.c
-ompi/mpiext/pcollreq/c/profile/preduce_init.c
-ompi/mpiext/pcollreq/c/profile/preduce_scatter_block_init.c
-ompi/mpiext/pcollreq/c/profile/preduce_scatter_init.c
-ompi/mpiext/pcollreq/c/profile/pscan_init.c
-ompi/mpiext/pcollreq/c/profile/pscatter_init.c
-ompi/mpiext/pcollreq/c/profile/pscatterv_init.c
-ompi/mpiext/pcollreq/c/profile/ppcollreq_c.h
-
-ompi/mpiext/pcollreq/mpif-h/profile/pallgather_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pallgatherv_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pallreduce_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/palltoall_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/palltoallv_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/palltoallw_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pbarrier_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pbcast_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pexscan_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pgather_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pgatherv_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pneighbor_allgather_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pneighbor_allgatherv_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pneighbor_alltoall_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pneighbor_alltoallv_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pneighbor_alltoallw_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/preduce_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/preduce_scatter_block_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/preduce_scatter_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pscan_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pscatter_init_f.c
-ompi/mpiext/pcollreq/mpif-h/profile/pscatterv_init_f.c
+ompi/mpiext/rocm/c/mpiext_rocm_c.h
ompi/mpiext/shortfloat/c/mpiext_shortfloat_c.h
ompi/mpiext/shortfloat/mpif-h/mpiext_shortfloat_mpifh.h
@@ -339,33 +265,23 @@ ompi/mpiext/shortfloat/use-mpi-f08/mpiext_shortfloat_usempif08.h
ompi/tools/mpisync/mpisync
ompi/tools/mpisync/mpirun_prof
ompi/tools/mpisync/ompi_timing_post
-ompi/tools/mpisync/mpisync.1
+ompi/tools/mpirun/mpirun
ompi/tools/ompi_info/ompi_info
-ompi/tools/ompi_info/ompi_info.1
ompi/tools/wrappers/mpic++-wrapper-data.txt
ompi/tools/wrappers/mpicc-wrapper-data.txt
ompi/tools/wrappers/mpifort-wrapper-data.txt
-ompi/tools/wrappers/mpicc.1
-ompi/tools/wrappers/mpic++.1
-ompi/tools/wrappers/mpicxx.1
-ompi/tools/wrappers/mpifort.1
-ompi/tools/wrappers/mpijavac.1
ompi/tools/wrappers/ompi_wrapper_script
ompi/tools/wrappers/ompi.pc
ompi/tools/wrappers/ompi-c.pc
ompi/tools/wrappers/ompi-cxx.pc
ompi/tools/wrappers/ompi-fort.pc
ompi/tools/wrappers/mpijavac.pl
-ompi/tools/wrappers/mpif90.1
-ompi/tools/wrappers/mpif77.1
ompi/tools/wrappers/mpicxx-wrapper-data.txt
ompi/tools/wrappers/mpif77-wrapper-data.txt
ompi/tools/wrappers/mpif90-wrapper-data.txt
-opal/libltdl
-
opal/asm/atomic-asm.S
opal/asm/atomic-test
opal/asm/generated/atomic-*.s
@@ -381,14 +297,8 @@ opal/include/opal/sys/powerpc/atomic-32-64.s
opal/mca/base/mca_base_parse_paramfile_lex.c
-opal/mca/common/libfabric/libfabric/config.h
-
-opal/mca/btl/openib/btl_openib_lex.c
-
opal/mca/btl/usnic/usnic_btl_run_tests
-opal/mca/crs/opal_crs.7
-
opal/mca/event/libevent*/libevent/config.h.in
opal/mca/event/libevent*/libevent/config.h
opal/mca/event/libevent*/libevent/libevent.pc
@@ -398,80 +308,18 @@ opal/mca/event/libevent*/libevent/include/event2/event-config.h
opal/mca/installdirs/config/install_dirs.h
-!opal/mca/pmix/pmix*/openpmix/AUTHORS
-!opal/mca/pmix/pmix*/openpmix/contrib/perf_tools/Makefile
-opal/mca/pmix/pmix*/openpmix/include/pmix/autogen/config.h
-opal/mca/pmix/pmix*/openpmix/include/pmix/autogen/config.h.in
-opal/mca/pmix/pmix*/openpmix/src/include/private/autogen/config.h.in
-opal/mca/pmix/pmix*/openpmix/src/include/private/autogen/config.h
-opal/mca/pmix/pmix*/openpmix/src/include/frameworks.h
-opal/mca/pmix/pmix*/openpmix/src/mca/pinstalldirs/config/pinstall_dirs.h
-opal/mca/pmix/pmix*/openpmix/config/autogen_found_items.m4
-opal/mca/pmix/pmix*/openpmix/config/mca_library_paths.txt
-opal/mca/pmix/pmix*/openpmix/config/test-driver
-opal/mca/pmix/pmix*/openpmix/src/include/pmix_config.h
-opal/mca/pmix/pmix*/openpmix/src/include/pmix_config.h.in
-opal/mca/pmix/pmix*/openpmix/include/pmix_common.h
-opal/mca/pmix/pmix*/openpmix/include/pmix_rename.h
-opal/mca/pmix/pmix*/openpmix/include/pmix_version.h
-opal/mca/pmix/pmix*/openpmix/src/util/keyval/keyval_lex.c
-opal/mca/pmix/pmix*/openpmix/src/util/show_help_lex.c
-opal/mca/pmix/pmix*/openpmix/examples/alloc
-opal/mca/pmix/pmix*/openpmix/examples/client
-opal/mca/pmix/pmix*/openpmix/examples/debugger
-opal/mca/pmix/pmix*/openpmix/examples/debuggerd
-opal/mca/pmix/pmix*/openpmix/examples/dmodex
-opal/mca/pmix/pmix*/openpmix/examples/dynamic
-opal/mca/pmix/pmix*/openpmix/examples/fault
-opal/mca/pmix/pmix*/openpmix/examples/jctrl
-opal/mca/pmix/pmix*/openpmix/examples/pub
-opal/mca/pmix/pmix*/openpmix/examples/server
-opal/mca/pmix/pmix*/openpmix/examples/tool
-opal/mca/pmix/pmix*/openpmix/test/run_tests00.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests01.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests02.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests03.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests04.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests05.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests06.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests07.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests08.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests09.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests10.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests11.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests12.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests13.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests14.pl
-opal/mca/pmix/pmix*/openpmix/test/run_tests15.pl
-opal/mca/pmix/pmix*/openpmix/src/tools/wrapper/pmix.pc
-opal/mca/pmix/pmix*/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt
-
-
-opal/mca/pmix/ext4x/ext4x.c
-opal/mca/pmix/ext4x/ext4x.h
-opal/mca/pmix/ext4x/ext4x_client.c
-opal/mca/pmix/ext4x/ext4x_component.c
-opal/mca/pmix/ext4x/ext4x_server_north.c
-opal/mca/pmix/ext4x/ext4x_server_south.c
-
-opal/tools/opal-checkpoint/opal-checkpoint
-opal/tools/opal-checkpoint/opal-checkpoint.1
-opal/tools/opal-restart/opal-restart
-opal/tools/opal-restart/opal-restart.1
-
opal/tools/wrappers/opalcc-wrapper-data.txt
opal/tools/wrappers/opalc++-wrapper-data.txt
opal/tools/wrappers/opalCC-wrapper-data.txt
opal/tools/wrappers/opal_wrapper
-opal/tools/wrappers/opalcc.1
-opal/tools/wrappers/opalc++.1
-opal/tools/wrappers/generic_wrapper.1
-opal/tools/wrappers/opal_wrapper.1
opal/tools/wrappers/opal.pc
-opal/util/show_help_lex.c
+opal/util/show_help_content.c
opal/util/keyval/keyval_lex.c
+test/monitoring/aggregate_profile.pl
+test/monitoring/profile2mat.pl
+
test/simple/abort
test/simple/accept
test/simple/attach
@@ -561,44 +409,15 @@ oshmem/shmem/fortran/profile/pshpalloc_f.c
oshmem/shmem/fortran/profile/pnum_pes_f.c
oshmem/shmem/fortran/profile/pstart_pes_f.c
-oshmem/shmem/java/java/shmem.jar
-oshmem/shmem/java/java/doc
-oshmem/shmem/java/java/shmem_Constant.h
-oshmem/shmem/java/java/shmem_ShMem.h
-oshmem/shmem/java/java/shmem
-oshmem/shmem/java/java/shmem_Addr.h
-oshmem/shmem/java/java/shmem_PSync.h
-
-oshmem/shmem/man/man3/shmem_*.3
-oshmem/shmem/man/man3/OpenSHMEM.3
-oshmem/shmem/man/man3/intro_shmem.3
-oshmem/shmem/man/man3/_my_pe.3
-oshmem/shmem/man/man3/_num_pes.3
-oshmem/shmem/man/man3/shfree.3
-oshmem/shmem/man/man3/shmalloc.3
-oshmem/shmem/man/man3/shmemalign.3
-oshmem/shmem/man/man3/shrealloc.3
-oshmem/shmem/man/man3/start_pes.3
-oshmem/shmem/man/man3/.dir-stamp
-
oshmem/tools/oshmem_info/oshmem_info
-oshmem/tools/oshmem_info/oshmem_info.1
-
-oshmem/tools/wrappers/oshcc.1
-oshmem/tools/wrappers/oshfort.1
-oshmem/tools/wrappers/oshrun.1
-oshmem/tools/wrappers/shmemcc.1
-oshmem/tools/wrappers/shmemfort.1
-oshmem/tools/wrappers/shmemrun.1
+
+oshmem/tools/wrappers/oshmem-c.pc
+oshmem/tools/wrappers/oshmem-cxx.pc
+oshmem/tools/wrappers/oshmem-fort.pc
+oshmem/tools/wrappers/oshmem.pc
oshmem/tools/wrappers/shmemcc-wrapper-data.txt
oshmem/tools/wrappers/shmemfort-wrapper-data.txt
-oshmem/tools/wrappers/oshCC.1
-oshmem/tools/wrappers/oshc++.1
-oshmem/tools/wrappers/oshcxx.1
-oshmem/tools/wrappers/shmemCC.1
oshmem/tools/wrappers/shmemc++-wrapper-data.txt
-oshmem/tools/wrappers/shmemc++.1
-oshmem/tools/wrappers/shmemcxx.1
test/asm/atomic_math_noinline
test/asm/atomic_barrier
@@ -621,6 +440,7 @@ test/class/ompi_rb_tree
test/class/ompi_bitmap
test/class/opal_bitmap
test/class/opal_fifo
+test/class/opal_cstring
test/class/opal_hash_table
test/class/opal_lifo
test/class/opal_list
@@ -651,7 +471,6 @@ test/monitoring/example_reduce_count
test/monitoring/test_overhead
test/monitoring/test_pvar_access
-
test/mpi/environment/chello
test/runtime/parse_context
@@ -686,8 +505,37 @@ test/util/opal_path_nfs
test/util/opal_path_nfs.out
test/util/opal_bit_ops
test/util/bipartite_graph
+test/util/opal_sha256
opal/test/reachable/reachable_netlink
opal/test/reachable/reachable_weighted
opal/mca/threads/argobots/threads_argobots.h
opal/mca/threads/qthreads/threads_qthreads.h
+
+docs/_build
+docs/_static
+docs/_static/css/custom.css
+docs/_templates
+docs/man-openmpi/man3/bindings
+
+# Common Python virtual environment and cache directory names
+venv
+py??
+__pycache__/
+
+# Copies of PRRTE RST files (i.e., not source controlled in this tree)
+docs/prrte-rst-content
+docs/schizo-ompi-rst-content
+
+# Copies of the built HTML docs and man pages (for distribution
+# tarballs)
+docs/html
+docs/man
+
+# Generated C Bindings
+ompi/mpi/c/*_generated*.c
+
+# Generated Fortran Bindings
+ompi/mpi/fortran/use-mpi-f08/*_generated.F90
+ompi/mpi/fortran/use-mpi-f08/base/*_generated.c
+ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces-generated.h
diff --git a/.gitmodules b/.gitmodules
index 81400e0d6de..5646d8fedc5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,8 +1,14 @@
[submodule "prrte"]
path = 3rd-party/prrte
- url = https://github.com/openpmix/prrte
+ url = ../../open-mpi/prrte
branch = master
[submodule "openpmix"]
path = 3rd-party/openpmix
- url = https://github.com/openpmix/openpmix.git
+ url = ../../openpmix/openpmix.git
branch = master
+[submodule "oac"]
+ path = config/oac
+ url = ../../open-mpi/oac
+[submodule "3rd-party/pympistandard"]
+ path = 3rd-party/pympistandard
+ url = ../../mpi-forum/pympistandard
diff --git a/.mailmap b/.mailmap
index 4ad3e4cbedb..b463497a038 100644
--- a/.mailmap
+++ b/.mailmap
@@ -32,6 +32,7 @@
Jeff Squyres
Jeff Squyres --quiet <--quiet>
Jeff Squyres
+Jeff Squyres
George Bosilca
@@ -44,6 +45,8 @@ Devendar Bureddy
Edgar Gabriel
Edgar Gabriel
+Edgar Gabriel
+Edgar Gabriel
Gilles Gouaillardet
@@ -113,3 +116,24 @@ Anandhi S Jayakumar
Mohan Gandhi
Harumi Kuno
+
+Nick Papior
+Nick Papior
+Nick Papior
+
+Matthew G. F. Dosanjh
+
+Wei-keng Liao
+
+Samuel K. Gutierrez
+Samuel K. Gutierrez
+
+Tomislav Janjusic Tomislavj Janjusic
+
+William P. LePera
+
+George Katevenis
+
+Brian Barrett
+
+Andrii Bilokur B-a-S
diff --git a/.readthedocs-pre-create-environment.sh b/.readthedocs-pre-create-environment.sh
new file mode 100755
index 00000000000..cc461ac2b13
--- /dev/null
+++ b/.readthedocs-pre-create-environment.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -euxo pipefail
+
+# The ReadTheDocs build process does not run autogen/configure/make.
+# Hence, we have to copy the PRRTE RST files (from the 3rd-party/prrte
+# tree) to our docs/ tree manually.
+
+# Ensure that we're in the RTD CI environment
+
+if [[ "${READTHEDOCS:-no}" == "no" ]]; then
+ echo "This script is only intended to be run in the ReadTheDocs CI environment"
+ exit 1
+fi
+
+SCHIZO_SRC_DIR=3rd-party/prrte/src/mca/schizo/ompi
+SCHIZO_TARGET_DIR=docs/schizo-ompi-rst-content
+
+PRRTE_RST_SRC_DIR=3rd-party/prrte/src/docs/prrte-rst-content
+PRRTE_RST_TARGET_DIR=docs/prrte-rst-content
+
+# Copy the OMPI schizo file from PRRTE
+#
+# See lengthy comment in docs/Makefile.am about copying in RST files
+# from PRRTE for a longer explanation of what is happening here.
+
+cp -rp $SCHIZO_SRC_DIR $SCHIZO_TARGET_DIR
+cp -rp $PRRTE_RST_SRC_DIR $PRRTE_RST_TARGET_DIR
+
+cd docs
+python3 ./generate-mpi-man3-bindings.py --srcdir . --builddir .
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 00000000000..2ba1fc07842
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,31 @@
+# .readthedocs.yaml
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Currently, RTD needs to select an OS with OpenSSL>=1.1.1 because of
+# urllib3's dependence on that system library. (alternately, pin urllib3<2
+# See https://github.com/urllib3/urllib3/issues/2168
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.10"
+ jobs:
+ # RTD doesn't run configure or make. So we have to manually copy
+ # in the PRRTE RST files to docs/.
+ pre_create_environment:
+ - ./.readthedocs-pre-create-environment.sh
+
+python:
+ install:
+ - requirements: docs/requirements.txt
+
+# Build documentation in the docs/ directory with Sphinx
+sphinx:
+ configuration: docs/conf.py
+ fail_on_warning: true
+
+submodules:
+ include: all
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c4069c3cfae..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,82 +0,0 @@
-# Use "required" for sudo, because we want to use the "trusty" Debian
-# distro, which is (currently) only available in the legacy Travis
-# infrastructure (i.e., if we put "sudo: false" to use the new container-
-# based Travis infrastructure, then "trusty" is not available). We
-# need the "trusty" distro because it has more recent versions of the
-# GNU Autotools (i.e., autogen.pl will fail if you use the regular
-# distro because the GNU Autotools are too old).
-sudo: required
-dist: trusty
-language: c
-
-# Iterate over 2 different compilers
-compiler:
- - gcc
- - clang
-
-# Test only linux now
-os:
- - linux
-
-addons:
- # For Linux, make sure we have some extra packages that we like to
- # build with
- apt:
- packages:
- - autoconf
- - automake
- - libtool
- - libnl-3-200
- - libnl-3-dev
- - libnl-route-3-200
- - libnl-route-3-dev
- - libibverbs-dev
- - librdmacm-dev
- - libhwloc-dev
- sources:
- - ubuntu-toolchain-r-test
-
-env:
- global:
- - AM_MAKEFLAGS="-j4"
- - LD_LIBRARY_PATH="$HOME/bogus/lib"
- matrix:
- - GCC_VERSION=default
- - GCC_VERSION=6
-
-# Install dependencies for the verbs and usnic providers. Open MPI is
-# not currently using the verbs provider in Libfabric, so we might as
-# well not build it.
-before_install:
- - if [[ "GCC_VERSION" == "6" ]]; then COMPILERS="CC=gcc-6 CXX=g++-6 FC=gfortran-6"; fi
- - export CONFIGURE_ARGS="--prefix=$HOME/bogus $COMPILERS CPPFLAGS=-I$HOME/bogus/include LDFLAGS=-L$HOME/bogus/lib" DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_ARGS"
- - export DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_ARGS"
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git clone https://github.com/ofiwg/libfabric.git ; fi
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$GCC_VERSION" == "6" ]] ; then sudo apt-get --assume-yes install gcc-6 g++-6 gfortran-6; fi
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd libfabric && ./autogen.sh && ./configure --prefix=$HOME/bogus --enable-usnic --disable-verbs $COMPILERS && make install && cd .. ; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew upgrade automake || true; brew upgrade libtool || true; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap homebrew/science || true; brew install hwloc || true; brew upgrade hwloc || true ; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$GCC_VERSION" == "6" ]] ; then brew install gcc || true; brew upgrade gcc || true ; fi
- - mkdir -p $HOME/bogus/include $HOME/bogus/lib
-
-# Note that we use "make -k" to do the entire build, even if there was a
-# build error in there somewhere. This prevents us from needing to submit
-# to Travis, see the first error, fix that first error, submit again, ...etc.
-install:
- - m4 --version
- - autoconf --version
- - automake --version
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then libtool --version; else glibtool --version; fi
- - ./autogen.pl
- - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "gcc" ]]; then ./configure $CONFIGURE_ARGS --with-libfabric=$HOME/bogus --with-usnic --with-verbs; else ./configure $CONFIGURE_ARGS; fi
- - make -k
-
-# We only need to distcheck on one OS / compiler combination (this is just
-# a minor optimization to make the overall set of builds faster).
-script:
- - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "gcc" ]]; then make distcheck; else make check; fi
-
-matrix:
- exclude:
- - env: GCC_VERSION=6
- compiler: clang
diff --git a/3rd-party/Makefile.am b/3rd-party/Makefile.am
index 0fdb5d43d3d..41ace54f31a 100644
--- a/3rd-party/Makefile.am
+++ b/3rd-party/Makefile.am
@@ -1,6 +1,7 @@
#
# Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
# All Rights reserved.
+# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@@ -16,7 +17,7 @@
SUBDIRS = $(OPAL_3RDPARTY_SUBDIRS)
DIST_SUBDIRS = $(OPAL_3RDPARTY_DIST_SUBDIRS)
-EXTRA_DIST = $(OPAL_3RDPARTY_EXTRA_DIST) autogen.subdirs
+EXTRA_DIST = $(OPAL_3RDPARTY_EXTRA_DIST) autogen.subdirs pympistandard
distclean-local:
rm -rf $(OPAL_3RDPARTY_DISTCLEAN_DIRS)
@@ -26,3 +27,12 @@ check:
check-recursive:
@echo "auto-recursing into 3rd-party packages for check disabled"
+
+# We recursively copied the pympystandard directory. As suggested by
+# the Automake docs (see section 14.3, "The dist Hook"), use the
+# dist-hook target to delete a bunch of extra stuff that we might have
+# copied.
+dist-hook:
+ @find $(distdir)/pympistandard -name __pycache__ -exec rm -rf {} \; || :
+ @find $(distdir)/pympistandard -name \*.pyc -exec rm -rf {} \; || :
+ @rm -rf $(distdir)/pympistandard/.git
diff --git a/3rd-party/autogen.subdirs b/3rd-party/autogen.subdirs
index 01e147cbb6e..e69de29bb2d 100644
--- a/3rd-party/autogen.subdirs
+++ b/3rd-party/autogen.subdirs
@@ -1 +0,0 @@
-romio321
diff --git a/3rd-party/hwloc-2.4.0.tar.gz b/3rd-party/hwloc-2.4.0.tar.gz
deleted file mode 100644
index da43f233082..00000000000
Binary files a/3rd-party/hwloc-2.4.0.tar.gz and /dev/null differ
diff --git a/3rd-party/hwloc-2.7.1.tar.gz b/3rd-party/hwloc-2.7.1.tar.gz
new file mode 100644
index 00000000000..d627caba9e4
Binary files /dev/null and b/3rd-party/hwloc-2.7.1.tar.gz differ
diff --git a/3rd-party/libevent-2.1.12-stable-ompi.tar.gz b/3rd-party/libevent-2.1.12-stable-ompi.tar.gz
new file mode 100644
index 00000000000..9a2e9694a3a
Binary files /dev/null and b/3rd-party/libevent-2.1.12-stable-ompi.tar.gz differ
diff --git a/3rd-party/libevent-2.1.12-stable.tar.gz b/3rd-party/libevent-2.1.12-stable.tar.gz
deleted file mode 100644
index 4fcefff24f8..00000000000
Binary files a/3rd-party/libevent-2.1.12-stable.tar.gz and /dev/null differ
diff --git a/3rd-party/openpmix b/3rd-party/openpmix
index 6d4bb1634f9..08e41ed5629 160000
--- a/3rd-party/openpmix
+++ b/3rd-party/openpmix
@@ -1 +1 @@
-Subproject commit 6d4bb1634f992ea34c4e8dd6eba1541020c6830c
+Subproject commit 08e41ed5629b51832f5708181af6d89218c7a74e
diff --git a/3rd-party/prrte b/3rd-party/prrte
index fed9394d227..30cadc6746e 160000
--- a/3rd-party/prrte
+++ b/3rd-party/prrte
@@ -1 +1 @@
-Subproject commit fed9394d227f974b27992677982ca6808b8e60bd
+Subproject commit 30cadc6746ebddd69ea42ca78b964398f782e4e3
diff --git a/3rd-party/pympistandard b/3rd-party/pympistandard
new file mode 160000
index 00000000000..7bc6bb0ff96
--- /dev/null
+++ b/3rd-party/pympistandard
@@ -0,0 +1 @@
+Subproject commit 7bc6bb0ff9630542fb0030ac4d976bef1f1cb026
diff --git a/3rd-party/romio321/.codingcheck b/3rd-party/romio321/.codingcheck
deleted file mode 100644
index 9b52b35ce42..00000000000
--- a/3rd-party/romio321/.codingcheck
+++ /dev/null
@@ -1,55 +0,0 @@
-# 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
-# should be replaced with something more ROMIO-specific.
-%romioDefines = ( 'ROMIO_[A-Za-z0-9_]+' => romio,
- 'PROFILE' => romio,
- 'PRINT_ERR_MSG' => romio,
- 'HPUX' => romio,
- 'SPPUX'=> romio,
- 'SX4'=> romio,
- 'AIO_SUN'=> romio,
- 'AIO_HANDLE_IN_AIOCB'=> romio,
- 'NO_FD_IN_AIOCB'=> romio,
- 'NO_AIO'=> romio,
- 'AIO_PRIORITY_DEFAULT'=> romio,
- 'AIO_SIGNOTIFY_NONE'=> romio,
- 'MPISGI'=> romio,
- 'CRAY'=> romio,
- 'PARAGON'=> romio,
- 'FREEBSD'=> romio,
- 'LINUX'=> romio,
- 'tflops'=> romio,
- 'NFS'=> romio,
- 'XFS'=> romio,
- 'CB_CONFIG_LIST_DEBUG'=> romio,
- 'SFS'=> romio,
- 'HFS'=> romio,
- 'UFS'=> romio,
- 'PVFS_.+' => romio,
- 'MPI_hpux'=> romio,
- 'FORTRANCAPS'=> romio,
- 'MPILAM'=> romio,
- 'NEEDS_ADIOCB_T'=> romio,
- 'AGG_DEBUG'=> romio,
- 'SOLARIS'=> romio,
- 'IRIX'=> romio,
- 'AIX'=> romio,
- 'DEC'=> romio,
- 'NEEDS_MPI_TEST'=> romio,
- 'PFS'=> romio,
- 'PIOFS'=> romio,
- 'MPICH'=> romio,
- 'MPICH' => romio,
- 'MPI_OFFSET_IS_INT'=> romio,
- 'MPI_COMBINER_NAMED'=> romio,
- '_UNICOS'=> romio,
- 'MPIHP'=> romio,
- );
-
-# Only invoke this function if the function is defined (in case the
-# user removed the cpp defines check with -rmchecks=cppdefines)
-if (defined(&PushDefinesNames)) {
- &PushDefinesNames( "romioDefines", "tree", "add" );
-}
-
-1;
diff --git a/3rd-party/romio321/.config_params b/3rd-party/romio321/.config_params
deleted file mode 100644
index fcc2f9146d1..00000000000
--- a/3rd-party/romio321/.config_params
+++ /dev/null
@@ -1,39 +0,0 @@
-__sun4_
-__rs6000_
-__paragon_
-__solaris_
-__solaris86_
-__tflop_
-__tflops_
-__hpux_
-__sppux_
-__SX4_
-__sgi_
-__sgi5_
-__IRIX_
-__IRIX32_
-__IRIXN32_
-__IRIX64_
-__alpha_
-__ALPHA_
-__freebsd_
-__netbsd_
-__LINUX_
-__LINUX_ALPHA_
-__CRAY_
-__Darwin_
-__nfs_
-__ufs_
-__pfs_
-__piofs_
-__pvfs_
-__testfs_
-__xfs_
-__hfs_
-__sfs_
-__mpich_mpi
-__sgi_mpi
-__hp_mpi
-__cray_mpi
-__lam_mpi
-__open_mpi
diff --git a/3rd-party/romio321/.gitignore b/3rd-party/romio321/.gitignore
deleted file mode 100644
index 28f1e98219d..00000000000
--- a/3rd-party/romio321/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/.deps
-/*.bb
-/*.bbg
-/*.gcda
-/*.gcno
-/.libs
-/.libstamp*
-/*.lo
-/.*-cache
-.state-cache
-version.m4
-confdb/config.rpath
diff --git a/3rd-party/romio321/COPYRIGHT b/3rd-party/romio321/COPYRIGHT
deleted file mode 100644
index 609bcfa4e84..00000000000
--- a/3rd-party/romio321/COPYRIGHT
+++ /dev/null
@@ -1,41 +0,0 @@
- COPYRIGHT
-
-The following is a notice of limited availability of the code and
-disclaimer, which must be included in the prologue of the code and in
-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.
-
-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
-Mathematics and Computer Science Division
-Argonne National Laboratory, Argonne IL 60439, USA
-
-
- GOVERNMENT LICENSE
-
-Portions of this material resulted from work developed under a U.S.
-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.
-
- DISCLAIMER
-
-This computer code material was prepared, in part, as an account of
-work sponsored by an agency of the United States Government. Neither
-the United States Government, nor the University of Chicago, nor any
-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.
-
diff --git a/3rd-party/romio321/Makefile.am b/3rd-party/romio321/Makefile.am
deleted file mode 100644
index 71d82a9fa73..00000000000
--- a/3rd-party/romio321/Makefile.am
+++ /dev/null
@@ -1,195 +0,0 @@
-# -*- Mode: Makefile; -*-
-# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
-# University Research and Technology
-# Corporation. All rights reserved.
-# Copyright (c) 2004-2005 The University of Tennessee and The University
-# of Tennessee Research Foundation. All rights
-# reserved.
-# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
-# University of Stuttgart. All rights reserved.
-# Copyright (c) 2004-2005 The Regents of the University of California.
-# All rights reserved.
-# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
-# $COPYRIGHT$
-#
-# Additional copyrights may follow
-#
-# $HEADER$
-#
-# (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
-
-## TODO: need to write an automakefile that handles two primary cases:
-## 1) that ROMIO is being embedded within the MPI library, as in MPICH or Open
-## MPI
-## 2) that ROMIO is being built standalone, old-school style. This case is
-## basically unused in modern practice.
-
-# help autoreconf and friends realize where the macros live
-ACLOCAL_AMFLAGS = -I confdb
-
-# empty variable initializations so that later code can append (+=)
-include_HEADERS =
-nodist_include_HEADERS =
-noinst_HEADERS =
-EXTRA_DIST =
-SUFFIXES =
-doc1_src_txt =
-
-# ------------------------------------------------------------------------
-# variables to be populated by the included Makefile.mk fragments:
-
-# These are files that contain MPI routines (e.g., MPI_File_open).
-# 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 =
-
-# 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 =
-
-# ------------------------------------------------------------------------
-# when building under MPICH we must be able to find mpi.h
-AM_CPPFLAGS += $(MPI_H_INCLUDE)
-
-# ------------------------------------------------------------------------
-# handle the "include" directory here
-AM_CPPFLAGS += -I$(top_builddir)/include -I$(top_srcdir)/include
-# nodist_ b/c these are created by config.status and should not be distributed
-# Open MPI: do not install mpio.h
-noinst_HEADERS += include/mpio.h
-noinst_HEADERS += include/io_romio_conv.h
-
-# Included for Open MPI's --enable-grequest-extensions feature.
-noinst_HEADERS += include/ompi_grequestx.h
-
-# ------------------------------------------------------------------------
-
-SUBDIRS =
-DIST_SUBDIRS = test test-internal
-
-# for the sake of parallel make and avoiding an excessive number of convenience
-# libs, we use a subdir automake fragment strategy
-include mpi-io/Makefile.mk
-include adio/Makefile.mk
-
-EXTRA_DIST += autogen.sh
-
-if BUILD_ROMIO_EMBEDDED
-# Build a libtool convenience library that the enclosing MPI implementation can
-# use by adding it to the right _LIBADD variable.
-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
-## MPICH, these are the objects that need to go into libmpi, while the foo.o
-## objects should go into libpmpi. Furthermore, the -D option for ROMIO's
-## source files is different and inverted (in the boolean sense) compared with
-## MPICH's defintion. And ROMIO was dumping all of the symbols into the main
-## libmpi library, regardless of the separate profiling library's existence.
-##
-## Annoying, right?
-if BUILD_PROFILING_LIB
-# The current best strategy for now is to build the PMPI symbols as a separate
-# convenience lib to permit adding the special "-D..." argument for all objects.
-# MPICH will then link in both convenience library into libmpi, since it
-# 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
-endif BUILD_PROFILING_LIB
-
-else !BUILD_ROMIO_EMBEDDED
-lib_LTLIBRARIES = libromio.la
-libromio_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources)
-if BUILD_PROFILING_LIB
-libpromio_la_SOURCES = $(romio_mpi_sources)
-libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING
-endif BUILD_PROFILING_LIB
-
-endif
-
-# --------------------------------------------------------------------------
-.PHONY: coverage
-gcov_sources = $(libmpl_la_SOURCES)
-# assumes that these sources were compiled appropriately ("-fprofile-arcs"
-# and "-ftest-coverage")
-coverage:
- @for file in $(gcov_sources) ; do \
- dir=`dirname $$file` ; \
- bname=`basename $$file` ; \
- aux=`echo $$bname | sed -e 's,\.*$$,,'` ; \
- echo "( $(GCOV) -b -f -o $$file $$file && mv $${bname}.gcov $$dir )" ; \
- ( $(GCOV) -b -f -o $$file $$file && mv $${bname}.gcov $$dir ) ; \
- rm -f *.gcov ; \
- done
- for subdir in $(SUBDIRS) - ; do \
- if test $$subdir = "-" ; then break ; fi ; \
- ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) coverage ) ; \
- done
-# --------------------------------------------------------------------------
-.PHONY: mandoc mandoc-local htmldoc htmldoc-local
-SUFFIXES += .man-phony .html-phony .man1-phony .html1-phony .txt
-
-# "make V=1" support for our documentation recipes
-doctextman_verbose = $(doctextman_verbose_$(V))
-doctextman_verbose_ = $(doctextman_verbose_$(AM_DEFAULT_VERBOSITY))
-doctextman_verbose_0 = @echo " DOCTEXTMAN " $@;
-doctexthtml_verbose = $(doctexthtml_verbose_$(V))
-doctexthtml_verbose_ = $(doctexthtml_verbose_$(AM_DEFAULT_VERBOSITY))
-doctexthtml_verbose_0 = @echo " DOCTEXTHTML " $@;
-
-# Build dir paths where the man pages will be created. Will usually be
-# overridden by MPICH make.
-mandoc_path1=$(abs_top_builddir)/man/man1
-mandoc_path3=$(abs_top_builddir)/man/man3
-htmldoc_path1=$(abs_top_builddir)/www/www1
-htmldoc_path3=$(abs_top_builddir)/www/www3
-doctext_docnotes=
-# Provide an easily replaced url root for the generated index file.
-# You can override this with URL desired in the index file generated by doctext.
-# You can ignore this if you don't use mapnames or tohtml to add links
-# to the MPI manual pages to documents.
-htmldoc_root3="--your-url-here--"
-
-.c.man-phony:
- $(doctextman_verbose)$(DOCTEXT) -man -mpath $(mandoc_path3) -ext 3 \
- -heading MPI -quotefmt -nolocation $(doctext_docnotes) $<
-.c.html-phony:
- $(doctexthtml_verbose)$(DOCTEXT) -html -mpath $(htmldoc_path3) \
- -heading MPI -quotefmt -nolocation \
- -index $(htmldoc_path3)/mpi.cit -indexdir $(htmldoc_root3) \
- $(doctext_docnotes) $<
-
-.txt.man1-phony:
- $(doctextman_verbose)$(DOCTEXT) -man -mpath $(mandoc_path1) -ext 1 \
- -heading MPI -quotefmt -nolocation $(doctext_docnotes) $<
-.txt.html1-phony:
- $(doctexthtml_verbose)$(DOCTEXT) -html -mpath $(htmldoc_path1) \
- -heading MPI -quotefmt -nolocation $(doctext_docnotes) $<
-
-# use mandoc-local target to force directory creation before running DOCTEXT
-mandoc:
- test -d $(mandoc_path1) || $(MKDIR_P) $(mandoc_path1)
- test -d $(mandoc_path3) || $(MKDIR_P) $(mandoc_path3)
- $(MAKE) $(AM_MAKEFLAGS) mandoc-local
-mandoc-local: $(romio_mpi_sources:.c=.man-phony) $(doc1_src_txt:.txt=.man1-phony)
-
-# use htmldoc-local target to force directory creation before running DOCTEXT
-htmldoc:
- test -d $(top_builddir)/www/www1 || $(MKDIR_P) $(top_builddir)/www/www1
- test -d $(top_builddir)/www/www3 || $(MKDIR_P) $(top_builddir)/www/www3
- $(MAKE) $(AM_MAKEFLAGS) htmldoc-local
-htmldoc-local: $(romio_mpi_sources:.c=.html-phony) $(doc1_src_txt:.txt=.html1-phony)
-
-# --------------------------------------------------------------------------
-
diff --git a/3rd-party/romio321/Makefile.options b/3rd-party/romio321/Makefile.options
deleted file mode 100644
index 0b72829e152..00000000000
--- a/3rd-party/romio321/Makefile.options
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- 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/3rd-party/romio321/README b/3rd-party/romio321/README
deleted file mode 100644
index a6fb25a09a5..00000000000
--- a/3rd-party/romio321/README
+++ /dev/null
@@ -1,660 +0,0 @@
- ROMIO: A High-Performance, Portable MPI-IO Implementation
-
- Version 2008-03-09
-
-Major Changes in this version:
-------------------------------
-* Fixed performance problems with the darray and subarray datatypes
- when using MPICH.
-
-* Better support for building against existing MPICH and MPICH versions.
-
- When building against an existing MPICH installation, use the
- "--with-mpi=mpich" option to ROMIO configure. For MPICH, use the
- "--with-mpi=mpich" option. These will allow ROMIO to take advantage
- of internal features of these implementations.
-
-* Deprecation of SFS, HFS, and PIOFS implementations.
-
- These are no longer actively supported, although the code will continue
- to be distributed for now.
-
-* Initial support for the Panasas PanFS filesystem.
-
- 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
- used if supplied at file-creation time.
-
- panfs_layout_type - Specifies the layout of a file:
- 2 = RAID0
- 3 = RAID5 Parity Stripes
- panfs_layout_stripe_unit - The size of the stripe unit in bytes
- 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
- 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
- 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
- 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
- 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
- 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
- - panfs_layout_parity_stripe_depth = 8
- - panfs_layout_visit_policy = 1
-
- Parity Stripe Group 1 Parity Stripe Group 2 . . . Parity Stripe Group 10
- ---------------------- ---------------------- --------------------
- SB1 SB2 ... SB10 SB11 SB12 ... SB20 ... SB91 SB92 ... SB100
- ----------------------- ----------------------- ---------------------
- D1 D2 ... D10 D91 D92 ... D100 D181 D182 ... D190
- D11 D12 D20 D101 D102 D110 D191 D192 D193
- D21 D22 D30 . . . . . .
- D31 D32 D40
- D41 D42 D50
- D51 D52 D60
- D61 D62 D70
- D71 D72 D80
- D81 D82 D90 D171 D172 D180 D261 D262 D270
- D271 D272 D273 . . . . . .
- ...
-
-* Initial support for the Globus GridFTP filesystem. Work contributed by Troy
- Baer (troy@osc.edu).
-
-Major Changes in Version 1.2.5:
-------------------------------
-
-* Initial support for MPICH-2
-
-* fix for a bug in which ROMIO would get confused for some permutations
- of the aggregator list
-
-* direct io on IRIX's XFS should work now
-
-* fixed an issue with the Fortran bindings that would cause them to fail
- when some compilers tried to build them.
-
-* Initial support for deferred opens
-
-Major Changes in Version 1.2.4:
-------------------------------
-* 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
-
-* Added support for PVFS listio operations, including hints to control use
-
-
-Major Changes in Version 1.2.3:
--------------------------------
-* Enhanced aggregation control via cb_config_list, romio_cb_read,
- and romio_cb_write hints
-
-* Asynchronous IO can be enabled under Linux with the --enable-aio argument
- to configure
-
-* Additional PVFS support
-
-* Additional control over data sieving with romio_ds_read hint
-
-* NTFS ADIO implementation integrated into source tree
-
-* testfs ADIO implementation added for debugging purposes
-
-
-Major Changes in Version 1.0.3:
--------------------------------
-
-* 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
- user's request does not meet the various restrictions needed to use
- 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.)
-
- 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".
-
- Direct I/O will result in higher performance only if you are
- accessing a high-bandwidth disk system. Otherwise, buffered I/O is
- better and is therefore used as the default.
-
-* Miscellaneous bug fixes.
-
-
-Major Changes Version 1.0.2:
----------------------------
-
-* Implemented the shared file pointer functions and
- split collective I/O functions. Therefore, the main
- 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.
- 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
- 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).
- 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 "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
- 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
- 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
- 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 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).
-
-* 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.
-
-* 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
- 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:
- cd /tmp/thakur
- /home/thakur/romio/configure
- make
- The .o files will be created in /tmp/thakur; the library will be created in
- /home/thakur/romio/lib/$ARCH/libmpio.a .
- This method works only if the make utility supports virtual paths.
- If the default make does not, you can install GNU make which does,
- and specify it to configure as
- /home/thakur/romio/configure -make=/usr/gnu/bin/gmake (or whatever)
-
-* Lots of miscellaneous bug fixes and other enhancements.
-
-* 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
- in ROMIO, and therefore NEC MPI has a complete implementation
- of MPI-IO.
-
-
-Major Changes in Version 1.0.1:
-------------------------------
-
-* This version is included in MPICH 1.1.1 and HP MPI 1.4.
-
-* 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
- SGI XFS file system.
-
-* 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,
- HP/Convex HFS, and NEC SFS file systems.
-
-* 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
- program romio/test/misc.c.)
-
-* 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
- parameter. ROMIO understands the following hints (keys in MPI_Info object):
-
- /* 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
- 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
- supplied at file-creation time. */
- striping_factor - no. of I/O devices to stripe the file across
- striping_unit - the striping unit in bytes
- start_iodevice - the number of the I/O device from which to start
- 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
- 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
- can be obtained via MPI_File_get_info.
-
-
-
-General Information
--------------------
-
-ROMIO is a high-performance, portable implementation of MPI-IO (the
-I/O chapter in MPI). ROMIO's home page is at
-http://www.mcs.anl.gov/romio . The MPI standard is available at
-http://www.mpi-forum.org/docs/docs.html .
-
-This version of ROMIO includes everything defined in the MPI I/O
-chapter except support for file interoperability and
-user-defined error handlers for files. The subarray and
-distributed array datatype constructor functions from Chapter 4
-(Sec. 4.14.4 & 4.14.5) have been implemented. They are useful for
-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.
-
-Please read the limitations of this version of ROMIO that are listed
-below (e.g., MPIO_Request object, restriction to homogeneous
-environments).
-
-This version of ROMIO runs on at least the following machines: IBM SP;
-Intel Paragon; HP Exemplar; SGI Origin2000; Cray T3E; NEC SX-4; other
-symmetric multiprocessors from HP, SGI, DEC, Sun, and IBM; and networks of
-workstations (Sun, SGI, HP, IBM, DEC, Linux, and FreeBSD). Supported
-file systems are IBM PIOFS, Intel PFS, HP/Convex HFS, SGI XFS, NEC
-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.
-
-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.
-
-You can open files on multiple file systems in the same program. The
-only restriction is that the directory where the file is to be opened
-must be accessible from the process opening the file. For example, a
-process running on one workstation may not be able to access a
-directory on the local disk of another workstation, and therefore
-ROMIO will not be able to open a file in such a directory. NFS-mounted
-files can be accessed.
-
-An MPI-IO file created by ROMIO is no different than any other file
-created by the underlying file system. Therefore, you may use any of
-the commands provided by the file system to access the file, e.g., ls,
-mv, cp, rm, ftp.
-
-
-Using ROMIO on NFS
-------------------
-
-To use ROMIO on NFS, file locking with fcntl must work correctly on
-the NFS installation. On some installations, fcntl locks don't work.
-To get them to work, you need to use Version 3 of NFS, ensure that the
-lockd daemon is running on all the machines, and have the system
-administrator mount the NFS file system with the "noac" option (no
-attribute caching). Turning off attribute caching may reduce
-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
-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.
-
- >1. first confirm you are running nfs version 3
- >
- >rpcnfo -p `hostname` | grep nfs
- >
- >ie
- > goedel >rpcinfo -p goedel | grep nfs
- > 100003 2 udp 2049 nfs
- > 100003 3 udp 2049 nfs
- >
- >
- >2. then edit /etc/fstab for each nfs directory read/written by MPIO
- > on each machine used for multihost MPIO.
- >
- > 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
- > and then remount this directory
- > on each of the machines that will be used to share MPIO files
- >
- >ie
- >
- >ROOOOT >umount /rmt/gershwin/epm1
- >ROOOOT >mount /rmt/gershwin/epm1
- >
- >3. Confirm that the directory is mounted noac:
- >
- >ROOOOT >grep gershwin /etc/mnttab
- >gershwin:/epm1 /rmt/gershwin/epm1 nfs
- >noac,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0 0 0 899911504
-
-
-
-
-ROMIO Installation Instructions
--------------------------------
-
-Since ROMIO is included in MPICH, LAM, HP MPI, SGI MPI, and NEC MPI,
-you don't need to install it separately if you are using any of these
-MPI implementations. If you are using some other MPI, you can
-configure and build ROMIO as follows:
-
-Untar the tar file as
-
- gunzip -c romio.tar.gz | tar xvf -
-
-OR
-
- zcat romio.tar.Z | tar xvf -
-
-THEN
-
- cd romio
- ./configure
- 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".
-
-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
-explicitly specify the file systems by using the "-file_system" option
-to configure. Multiple file systems can be specified by using "+" as a
-separator. For example,
-
- ./configure -file_system=xfs+nfs
-
-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
-
- make install PREFIX=/usr/local/romio (or whatever directory you like)
-
-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
-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.
-
-To rebuild ROMIO with a different set of configure options, do
-
- make distclean
-
-to clean everything including the Makefiles created by configure.
-Then run configure again with the new options, followed by make.
-
-
-
-Testing ROMIO
--------------
-
-To test if the installation works, do
-
- 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
-default, "make testing" causes the test programs to create files in
-the current directory and use whatever file system that corresponds
-to. To test with other file systems, you need to specify a filename in
-a directory corresponding to that file system as follows:
-
- make testing TESTARGS="-fname=/foo/piofs/test"
-
-
-
-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.
-
-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.
-
-With MPICH, HP MPI, or NEC MPI, you can compile MPI-IO programs as
- mpicc foo.c
-or
- mpif77 foo.f
-or
- 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.
-
-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
- hcc foo.c -lmpi
-or
- hf77 foo.f -lmpi
-
-If you have built ROMIO with some other MPI implementation, you can
-compile MPI-IO programs by explicitly giving the path to the include
-file mpio.h or mpiof.h and explicitly specifying the path to the
-library libmpio.a, which is located in $(ROMIO_HOME)/lib/$(ARCH)/libmpio.a .
-
-
-Run the program as you would run any MPI program on the machine. If
-you use mpirun, make sure you use the correct mpirun for the MPI
-implementation you are using. For example, if you are using MPICH on
-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.
-
-
-
-Limitations of this version of ROMIO
-------------------------------------
-
-* When used with any MPI implementation other than MPICH 1.2.1 (or later),
-the "status" argument is not filled in any MPI-IO function. Consequently,
-MPI_Get_count and MPI_Get_elements will not work when passed the status
-object from an MPI-IO operation.
-
-* All nonblocking I/O functions use a ROMIO-defined "MPIO_Request"
-object instead of the usual "MPI_Request" object. Accordingly, two
-functions, MPIO_Test and MPIO_Wait, are provided to wait and test on
-these MPIO_Request objects. They have the same semantics as MPI_Test
-and MPI_Wait.
-
-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.
-
-* This version works only on a homogeneous cluster of machines,
-and only the "native" file data representation is supported.
-
-* When used with any MPI implementation other than MPICH 1.2.1 (or later),
-all MPI-IO functions return only two possible error codes---MPI_SUCCESS
-on success and MPI_ERR_UNKNOWN on failure.
-
-* Shared file pointers are not supported on PVFS and IBM PIOFS file
-systems because they don't support fcntl file locks, and ROMIO uses
-that feature to implement shared file pointers.
-
-* On HP machines running HPUX and on NEC SX-4, you need to compile
-Fortran programs with mpifort instead of mpif77, because the f77
-compilers on these machines don't support 8-byte integers.
-
-* The file-open mode MPI_MODE_EXCL does not work on Intel PFS file system,
-due to a bug in PFS.
-
-
-
-Usage Tips
-----------
-
-* When using ROMIO with SGI MPI, you may sometimes get an error
-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
-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
-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
-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
- 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
-and, therefore, picks up Intel's mpif.h, which is actually the
-mpif.h of an older version of MPICH.
-
-
-
-ROMIO Users Mailing List
-------------------------
-
-Please register your copy of ROMIO with us by sending email
-to majordomo@mcs.anl.gov with the message
-
-subscribe romio-users
-
-This will enable us to notify you of new releases of ROMIO as well as
-bug fixes.
-
-
-
-Reporting Bugs
---------------
-
-If you have trouble, first check the users guide (in
-romio/doc/users-guide.ps.gz). Then check the on-line list of known
-bugs and patches at http://www.mcs.anl.gov/romio .
-Finally, if you still have problems, send a detailed message containing:
-
- The type of system (often, uname -a)
- The output of configure
- The output of make
- Any programs or tests
-
-to romio-maint@mcs.anl.gov .
-
-
-
-ROMIO Internals
----------------
-
-A key component of ROMIO that enables such a portable MPI-IO
-implementation is an internal abstract I/O device layer called
-ADIO. Most users of ROMIO will not need to deal with the ADIO layer at
-all. However, ADIO is useful to those who want to port ROMIO to some
-other file system. The ROMIO source code and the ADIO paper
-(see doc/README) will help you get started.
-
-MPI-IO implementation issues are discussed in our IOPADS '99 paper,
-"On Implementing MPI-IO Portably and with High Performance."
-All ROMIO-related papers are available online from
-http://www.mcs.anl.gov/romio.
-
-
-Learning MPI-IO
----------------
-
-The book "Using MPI-2: Advanced Features of the Message-Passing
-Interface," published by MIT Press, provides a tutorial introduction to
-all aspects of MPI-2, including parallel I/O. It has lots of example
-programs. See http://www.mcs.anl.gov/mpi/usingmpi2 for further
-information about the book.
diff --git a/3rd-party/romio321/README_OMPI b/3rd-party/romio321/README_OMPI
deleted file mode 100644
index 83f1ffb2233..00000000000
--- a/3rd-party/romio321/README_OMPI
+++ /dev/null
@@ -1,11 +0,0 @@
-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/3rd-party/romio321/adio/Makefile.mk b/3rd-party/romio321/adio/Makefile.mk
deleted file mode 100644
index ffc05cb4151..00000000000
--- a/3rd-party/romio321/adio/Makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-AM_CPPFLAGS += -I$(top_builddir)/adio/include -I$(top_srcdir)/adio/include
-
-noinst_HEADERS += \
- adio/include/adio.h \
- adio/include/adio_cb_config_list.h \
- adio/include/adio_extern.h \
- adio/include/adioi.h \
- adio/include/adioi_errmsg.h \
- adio/include/adioi_error.h \
- adio/include/adioi_fs_proto.h \
- adio/include/heap-sort.h \
- adio/include/mpio_error.h \
- adio/include/mpipr.h \
- adio/include/mpiu_greq.h \
- adio/include/nopackage.h \
- adio/include/romioconf-undefs.h \
- adio/include/mpiu_external32.h \
- adio/include/hint_fns.h
-
-include $(top_srcdir)/adio/ad_gpfs/Makefile.mk
-include $(top_srcdir)/adio/ad_gpfs/bg/Makefile.mk
-include $(top_srcdir)/adio/ad_gpfs/pe/Makefile.mk
-include $(top_srcdir)/adio/ad_gridftp/Makefile.mk
-include $(top_srcdir)/adio/ad_hfs/Makefile.mk
-include $(top_srcdir)/adio/ad_lustre/Makefile.mk
-include $(top_srcdir)/adio/ad_nfs/Makefile.mk
-## NTFS builds are handled entirely by the separate Windows build system
-##include $(top_srcdir)/adio/ad_ntfs/Makefile.mk
-include $(top_srcdir)/adio/ad_panfs/Makefile.mk
-include $(top_srcdir)/adio/ad_pfs/Makefile.mk
-include $(top_srcdir)/adio/ad_piofs/Makefile.mk
-include $(top_srcdir)/adio/ad_pvfs/Makefile.mk
-include $(top_srcdir)/adio/ad_pvfs2/Makefile.mk
-include $(top_srcdir)/adio/ad_sfs/Makefile.mk
-include $(top_srcdir)/adio/ad_testfs/Makefile.mk
-include $(top_srcdir)/adio/ad_ufs/Makefile.mk
-include $(top_srcdir)/adio/ad_xfs/Makefile.mk
-include $(top_srcdir)/adio/ad_zoidfs/Makefile.mk
-include $(top_srcdir)/adio/common/Makefile.mk
-
diff --git a/3rd-party/romio321/adio/ad_gpfs/.gitignore b/3rd-party/romio321/adio/ad_gpfs/.gitignore
deleted file mode 100644
index 509a693e927..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/.deps
-/*.bb
-/*.bbg
-/*.gcda
-/*.gcno
-/.libs
-/.libstamp*
-/*.lo
-/.*-cache
-/.state-cache
diff --git a/3rd-party/romio321/adio/ad_gpfs/Makefile.mk b/3rd-party/romio321/adio/ad_gpfs/Makefile.mk
deleted file mode 100644
index db8737be5c7..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/Makefile.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2012 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_GPFS
-
-noinst_HEADERS += \
- adio/ad_gpfs/ad_gpfs_aggrs.h \
- adio/ad_gpfs/ad_gpfs.h \
- adio/ad_gpfs/ad_gpfs_tuning.h
-
-romio_other_sources += \
- adio/ad_gpfs/ad_gpfs_aggrs.c \
- adio/ad_gpfs/ad_gpfs_close.c \
- adio/ad_gpfs/ad_gpfs_flush.c \
- adio/ad_gpfs/ad_gpfs_tuning.c \
- adio/ad_gpfs/ad_gpfs.c \
- adio/ad_gpfs/ad_gpfs_open.c \
- adio/ad_gpfs/ad_gpfs_hints.c \
- adio/ad_gpfs/ad_gpfs_rdcoll.c \
- adio/ad_gpfs/ad_gpfs_wrcoll.c
-
-endif BUILD_AD_GPFS
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs.c
deleted file mode 100644
index f376150f0ba..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs.c
- * \brief ???
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-#include "ad_gpfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_GPFS_operations = {
- ADIOI_GPFS_Open, /* Open */
- ADIOI_GEN_OpenColl, /* Collective open */
- ADIOI_GEN_ReadContig, /* ReadContig */
- ADIOI_GEN_WriteContig, /* WriteContig */
- ADIOI_GPFS_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GPFS_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_GEN_Fcntl, /* Fcntl */
-#if defined(BGQPLATFORM) || defined(PEPLATFORM)
- ADIOI_GPFS_SetInfo, /* SetInfo for BlueGene or PE */
-#else
- ADIOI_GEN_SetInfo, /* SetInfo for any platform besides BlueGene or PE */
-#endif
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_GEN_WriteStrided, /* WriteStrided */
- ADIOI_GPFS_Close, /* Close */
-#ifdef ROMIO_HAVE_WORKING_AIO
-#warning Consider BG support for NFS before enabling this.
- ADIOI_GEN_IreadContig, /* IreadContig */
- ADIOI_GEN_IwriteContig, /* IwriteContig */
-#else
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
-#endif
- ADIOI_GEN_IODone, /* ReadDone */
- ADIOI_GEN_IODone, /* WriteDone */
- ADIOI_GEN_IOComplete, /* ReadComplete */
- ADIOI_GEN_IOComplete, /* WriteComplete */
- ADIOI_GEN_IreadStrided, /* IreadStrided */
- ADIOI_GEN_IwriteStrided, /* IwriteStrided */
- ADIOI_GPFS_Flush, /* Flush */
- ADIOI_GEN_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_GEN_Feature, /* Features */
-#ifdef BGQPLATFORM
- "GPFS+BGQ: IBM GPFS for Blue Gene",
-#elif PEPLATFORM
- "GPFS+PE: IBM GPFS for PE",
-#else
- "GPFS: IBM GPFS",
-#endif
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs.h b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs.h
deleted file mode 100644
index d64dcaeb998..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs.h
- * \brief ???
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#ifndef AD_GPFS_INCLUDE
-#define AD_GPFS_INCLUDE
-
-#include
-#include
-#include
-#include
-#include "adio.h"
-
-#ifdef HAVE_SIGNAL_H
-#include
-#endif
-#ifdef HAVE_AIO_LITE_H
-#include
-#elif defined HAVE_AIO_H
-#include
-#endif
-
-
-void ADIOI_GPFS_Open(ADIO_File fd, int *error_code);
-
-void ADIOI_GPFS_Close(ADIO_File fd, int *error_code);
-
-void ADIOI_GPFS_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_GPFS_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_GPFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-
-void ADIOI_GPFS_WriteStrided(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_GPFS_ReadStrided(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_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-
-void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-
-void ADIOI_GPFS_Flush(ADIO_File fd, int *error_code);
-
-#include "ad_gpfs_tuning.h"
-
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_aggrs.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_aggrs.c
deleted file mode 100644
index f6df24748f0..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_aggrs.c
+++ /dev/null
@@ -1,817 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008, 2019 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_aggrs.c
- * \brief The externally used function from this file is is declared in ad_gpfs_aggrs.h
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997-2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-
-#include "adio.h"
-#include "adio_cb_config_list.h"
-#include "ad_gpfs.h"
-#include "ad_gpfs_aggrs.h"
-
-#ifdef AGGREGATION_PROFILE
-#include "mpe.h"
-#endif
-
-
-#ifdef USE_DBG_LOGGING
- #define AGG_DEBUG 1
-#endif
-
-#ifndef TRACE_ERR
-# define TRACE_ERR(format...)
-#endif
-
-/* Comments copied from common:
- * This file contains four functions:
- *
- * ADIOI_Calc_aggregator()
- * ADIOI_Calc_file_domains()
- * ADIOI_Calc_my_req()
- * ADIOI_Calc_others_req()
- *
- * 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.
- */
-
-/* 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
- * 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
- * number of processors in the collective I/O communicator
- * ADIO_Offset min_st_offset
- * ADIO_Offset fd_start[0..nprocs_for_coll-1]
- * 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
- * uneven distributions
- */
-
-/* Description from common/ad_aggregate.c. (Does it completely apply to bg?)
- * ADIOI_Calc_aggregator()
- *
- * The intention here is to implement a function which provides basically
- * the same functionality as in Rajeev's original version of
- * ADIOI_Calc_my_req(). He used a ceiling division approach to assign the
- * file domains, and we use the same approach here when calculating the
- * location of an offset/len in a specific file domain. Further we assume
- * this same distribution when calculating the rank_index, which is later
- * used to map to a specific process rank in charge of the file domain.
- *
- * A better (i.e. more general) approach would be to use the list of file
- * domains only. This would be slower in the case where the
- * original ceiling division was used, but it would allow for arbitrary
- * distributions of regions to aggregators. We'd need to know the
- * nprocs_for_coll in that case though, which we don't have now.
- *
- * Note a significant difference between this function and Rajeev's old code:
- * this code doesn't necessarily return a rank in the range
- * 0..nprocs_for_coll; instead you get something in 0..nprocs. This is a
- * result of the rank mapping; any set of ranks in the communicator could be
- * used now.
- *
- * Returns an integer representing a rank in the collective I/O communicator.
- *
- * The "len" parameter is also modified to indicate the amount of data
- * actually available in this file domain.
- */
-/*
- * This is more general aggregator search function which does not base on the assumption
- * that each aggregator hosts the file domain with the same size
- */
-int ADIOI_GPFS_Calc_aggregator(ADIO_File fd,
- ADIO_Offset off,
- ADIO_Offset min_off,
- ADIO_Offset *len,
- ADIO_Offset fd_size,
- ADIO_Offset *fd_start,
- ADIO_Offset *fd_end)
-{
- int rank_index, rank;
- ADIO_Offset avail_bytes;
- TRACE_ERR("Entering ADIOI_GPFS_Calc_aggregator\n");
-
- ADIOI_Assert ( (off <= fd_end[fd->hints->cb_nodes-1] && off >= min_off && fd_start[0] >= min_off ) );
-
- /* binary search --> rank_index is returned */
- int ub = fd->hints->cb_nodes;
- int lb = 0;
- /* get an index into our array of aggregators */
- /* Common code for striping - bg doesn't use it but it's
- here to make diff'ing easier.
- rank_index = (int) ((off - min_off + fd_size)/ fd_size - 1);
-
- if (fd->hints->striping_unit > 0) {
- * wkliao: implementation for file domain alignment
- fd_start[] and fd_end[] have been aligned with file lock
- boundaries when returned from ADIOI_Calc_file_domains() so cannot
- just use simple arithmatic as above *
- rank_index = 0;
- while (off > fd_end[rank_index]) rank_index++;
- }
- bg does it's own striping below
- */
- rank_index = fd->hints->cb_nodes / 2;
- while ( off < fd_start[rank_index] || off > fd_end[rank_index] ) {
- if ( off > fd_end [rank_index] ) {
- lb = rank_index;
- rank_index = (rank_index + ub) / 2;
- }
- else
- if ( off < fd_start[rank_index] ) {
- ub = rank_index;
- rank_index = (rank_index + lb) / 2;
- }
- }
- /* we index into fd_end with rank_index, and fd_end was allocated to be no
- * bigger than fd->hins->cb_nodes. If we ever violate that, we're
- * overrunning arrays. Obviously, we should never ever hit this abort */
- if (rank_index >= fd->hints->cb_nodes || rank_index < 0) {
- FPRINTF(stderr, "Error in ADIOI_Calc_aggregator(): rank_index(%d) >= fd->hints->cb_nodes (%d) fd_size=%lld off=%lld\n",
- rank_index,fd->hints->cb_nodes,fd_size,off);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- /* DBG_FPRINTF ("ADIOI_GPFS_Calc_aggregator: rank_index = %d\n",
- rank_index ); */
-
- /*
- * remember here that even in Rajeev's original code it was the case that
- * different aggregators could end up with different amounts of data to
- * aggregate. here we use fd_end[] to make sure that we know how much
- * data this aggregator is working with.
- *
- * the +1 is to take into account the end vs. length issue.
- */
- avail_bytes = fd_end[rank_index] + 1 - off;
- if (avail_bytes < *len && avail_bytes > 0) {
- /* this file domain only has part of the requested contig. region */
-
- *len = avail_bytes;
- }
-
- /* map our index to a rank */
- /* NOTE: FOR NOW WE DON'T HAVE A MAPPING...JUST DO 0..NPROCS_FOR_COLL */
- rank = fd->hints->ranklist[rank_index];
- TRACE_ERR("Leaving ADIOI_GPFS_Calc_aggregator\n");
-
- return rank;
-}
-
-/*
- * Compute a dynamic access range based file domain partition among I/O aggregators,
- * which align to the GPFS block size
- * Divide the I/O workload among "nprocs_for_coll" processes. This is
- * done by (logically) dividing the file into file domains (FDs); each
- * process may directly access only its own file domain.
- * Additional effort is to make sure that each I/O aggregator get
- * a file domain that aligns to the GPFS block size. So, there will
- * not be any false sharing of GPFS file blocks among multiple I/O nodes.
- *
- * The common version of this now accepts a min_fd_size and striping_unit.
- * It doesn't seem necessary here (using GPFS block sizes) but keep it in mind
- * (e.g. we could pass striping unit instead of using fs_ptr->blksize).
- */
-void ADIOI_GPFS_Calc_file_domains(ADIO_File fd,
- ADIO_Offset *st_offsets,
- ADIO_Offset *end_offsets,
- int nprocs,
- int nprocs_for_coll,
- ADIO_Offset *min_st_offset_ptr,
- ADIO_Offset **fd_start_ptr,
- ADIO_Offset **fd_end_ptr,
- ADIO_Offset *fd_size_ptr,
- void *fs_ptr)
-{
- ADIO_Offset min_st_offset, max_end_offset, *fd_start, *fd_end, *fd_size;
- int i, aggr;
- TRACE_ERR("Entering ADIOI_GPFS_Calc_file_domains\n");
- blksize_t blksize;
-
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5004, 0, NULL);
-#endif
-
-# if AGG_DEBUG
- static char myname[] = "ADIOI_GPFS_Calc_file_domains";
- DBG_FPRINTF(stderr, "%s(%d): %d aggregator(s)\n",
- myname,__LINE__,nprocs_for_coll);
-# endif
- if (fd->blksize <= 0)
- /* default to 1M if blksize unset */
- fd->blksize = 1048576;
- blksize = fd->blksize;
-
-# if AGG_DEBUG
- DBG_FPRINTF(stderr,"%s(%d): Blocksize=%ld\n",myname,__LINE__,blksize);
-# endif
-/* find min of start offsets and max of end offsets of all processes */
- min_st_offset = st_offsets [0];
- max_end_offset = end_offsets[0];
- for (i=1; ihints->fs_hints.bg.numbridges*sizeof(int));
- /* tmpbridgelistnum: copy of the bridgelistnum whose entries can be
- * decremented to keep track of bridge assignments during the actual
- * large block assignments to the agg rank list*/
- int *tmpbridgelistnum =
- (int *) ADIOI_Malloc(fd->hints->fs_hints.bg.numbridges*sizeof(int));
-
- int j;
- for (j=0;jhints->fs_hints.bg.numbridges;j++) {
- int k, bridgerankoffset = 0;
- for (k=0;khints->fs_hints.bg.bridgelistnum[k];
- }
- bridgelistoffset[j] = bridgerankoffset;
- }
-
- for (j=0;jhints->fs_hints.bg.numbridges;j++)
- tmpbridgelistnum[j] = fd->hints->fs_hints.bg.bridgelistnum[j];
- int bridgeiter = 0;
-
- /* distribute the large blocks across the aggs going breadth-first
- * across the bridgelist - this distributes the fd sizes across the
- * ions, so later in the file domain assignment when it iterates thru
- * the ranklist the offsets will be contiguous within the bridge and
- * ion as well */
- for (j=0;j 0) {
- foundbridge = 1;
- /*
- printf("bridgeiter is %d tmpbridgelistnum[bridgeiter] is %d bridgelistoffset[bridgeiter] is %d\n",bridgeiter,tmpbridgelistnum[bridgeiter],bridgelistoffset[bridgeiter]);
- printf("naggs is %d bridgeiter is %d bridgelistoffset[bridgeiter] is %d tmpbridgelistnum[bridgeiter] is %d\n",naggs, bridgeiter,bridgelistoffset[bridgeiter],tmpbridgelistnum[bridgeiter]);
- printf("naggs is %d bridgeiter is %d setting fd_size[%d]\n",naggs, bridgeiter,bridgelistoffset[bridgeiter]+(fd->hints->bridgelistnum[bridgeiter]-tmpbridgelistnum[bridgeiter]));
- */
- int currentbridgelistnum =
- (fd->hints->fs_hints.bg.bridgelistnum[bridgeiter]-
- tmpbridgelistnum[bridgeiter]);
- int currentfdsizeindex = bridgelistoffset[bridgeiter] +
- currentbridgelistnum;
- fd_size[currentfdsizeindex] = (nb_cn_small+1) * blksize;
- tmpbridgelistnum[bridgeiter]--;
- }
- if (bridgeiter == (fd->hints->fs_hints.bg.numbridges-1)) {
- /* guard against infinite loop - should only ever make 1 pass
- * thru bridgelist */
- ADIOI_Assert(numbridgelistpasses == 0);
- numbridgelistpasses++;
- bridgeiter = 0;
- }
- else
- bridgeiter++;
- }
- }
- ADIOI_Free(tmpbridgelistnum);
- ADIOI_Free(bridgelistoffset);
-
- } else {
- /* BG/L- and BG/P-style distribution of file domains: simple allocation of
- * file domins to each aggregator */
- for (i=0; icomm,&myrank);
- if (myrank == 0) {
- fprintf(stderr,"naggs_small is %d nb_cn_small is %d\n",naggs_small,nb_cn_small);
- for (i=0; ihints->ranklist[i]);
- }
- }
-#endif
-
-#else // not BGQ platform
- for (i=0; i 0) {
- off += fd_len; /* point to first remaining byte */
- fd_len = rem_len; /* save remaining size, pass to calc */
- proc = ADIOI_GPFS_Calc_aggregator(fd, off, min_st_offset, &fd_len,
- fd_size, fd_start, fd_end);
-
- count_my_req_per_proc[proc]++;
- rem_len -= fd_len; /* reduce remaining length by amount from fd */
- }
- }
-
-/* now allocate space for my_req, offset, and len */
-
- *my_req_ptr = (ADIOI_Access *)
- ADIOI_Malloc(nprocs*sizeof(ADIOI_Access));
- my_req = *my_req_ptr;
-
- count_my_req_procs = 0;
- for (i=0; i < nprocs; i++) {
- if (count_my_req_per_proc[i]) {
- my_req[i].offsets = (ADIO_Offset *)
- ADIOI_Malloc(count_my_req_per_proc[i] * sizeof(ADIO_Offset));
- my_req[i].lens =
- ADIOI_Malloc(count_my_req_per_proc[i] * sizeof(ADIO_Offset));
- count_my_req_procs++;
- }
- my_req[i].count = 0; /* will be incremented where needed
- later */
- }
-
-/* now fill in my_req */
- curr_idx = 0;
- for (i=0; i 0) {
- off += fd_len;
- fd_len = rem_len;
- proc = ADIOI_GPFS_Calc_aggregator(fd, off, min_st_offset, &fd_len,
- fd_size, fd_start, fd_end);
-
- if (buf_idx[proc] == -1)
- {
- ADIOI_Assert(curr_idx == (int) curr_idx);
- buf_idx[proc] = (int) curr_idx;
- }
-
- l = my_req[proc].count;
- curr_idx += fd_len;
- rem_len -= fd_len;
-
- my_req[proc].offsets[l] = off;
- my_req[proc].lens[l] = fd_len;
- my_req[proc].count++;
- }
- }
-
-
-
-#ifdef AGG_DEBUG
- for (i=0; i 0) {
- DBG_FPRINTF(stderr, "data needed from %d (count = %d):\n", i,
- my_req[i].count);
- for (l=0; l < my_req[i].count; l++) {
- DBG_FPRINTF(stderr, " off[%d] = %lld, len[%d] = %lld\n", l,
- my_req[i].offsets[l], l, my_req[i].lens[l]);
- }
- }
- DBG_FPRINTF(stderr, "buf_idx[%d] = 0x%x\n", i, buf_idx[i]);
- }
-#endif
-
- *count_my_req_procs_ptr = count_my_req_procs;
- *buf_idx_ptr = buf_idx;
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5025, 0, NULL);
-#endif
- TRACE_ERR("Leaving ADIOI_GPFS_Calc_my_req\n");
-}
-
-/*
- * ADIOI_Calc_others_req (copied to bg and switched to all to all for performance)
- *
- * param[in] count_my_req_procs Number of processes whose file domain my
- * request touches.
- * param[in] count_my_req_per_proc count_my_req_per_proc[i] gives the no. of
- * contig. requests of this process in
- * process i's file domain.
- * param[in] my_req A structure defining my request
- * param[in] nprocs Number of nodes in the block
- * param[in] myrank Rank of this node
- * param[out] count_others_req_proc_ptr Number of processes whose requests lie in
- * my process's file domain (including my
- * process itself)
- * param[out] others_req_ptr Array of other process' requests that lie
- * in my process's file domain
- */
-void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
- int *count_my_req_per_proc,
- ADIOI_Access *my_req,
- int nprocs, int myrank,
- int *count_others_req_procs_ptr,
- ADIOI_Access **others_req_ptr)
-{
- TRACE_ERR("Entering ADIOI_GPFS_Calc_others_req\n");
-/* determine what requests of other processes lie in this process's
- file domain */
-
-/* count_others_req_procs = number of processes whose requests lie in
- this process's file domain (including this process itself)
- count_others_req_per_proc[i] indicates how many separate contiguous
- requests of proc. i lie in this process's file domain. */
-
- int *count_others_req_per_proc, count_others_req_procs;
- int i;
- ADIOI_Access *others_req;
-
- /* Parameters for MPI_Alltoallv */
- int *scounts, *sdispls, *rcounts, *rdispls;
-
-/* first find out how much to send/recv and from/to whom */
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5026, 0, NULL);
-#endif
- /* Send 1 int to each process. count_my_req_per_proc[i] is the number of
- * requests that my process will do to the file domain owned by process[i].
- * Receive 1 int from each process. count_others_req_per_proc[i] is the number of
- * requests that process[i] will do to the file domain owned by my process.
- */
- count_others_req_per_proc = (int *) ADIOI_Malloc(nprocs*sizeof(int));
-/* cora2a1=timebase(); */
-/*for(i=0;icomm);
-
-/* total_cora2a+=timebase()-cora2a1; */
-
- /* Allocate storage for an array of other nodes' accesses of our
- * node's file domain. Also allocate storage for the alltoallv
- * parameters.
- */
- *others_req_ptr = (ADIOI_Access *)
- ADIOI_Malloc(nprocs*sizeof(ADIOI_Access));
- others_req = *others_req_ptr;
-
- scounts = ADIOI_Malloc(nprocs*sizeof(int));
- sdispls = ADIOI_Malloc(nprocs*sizeof(int));
- rcounts = ADIOI_Malloc(nprocs*sizeof(int));
- rdispls = ADIOI_Malloc(nprocs*sizeof(int));
-
- /* If process[i] has any requests in my file domain,
- * initialize an ADIOI_Access structure that will describe each request
- * from process[i]. The offsets, lengths, and buffer pointers still need
- * to be obtained to complete the setting of this structure.
- */
- count_others_req_procs = 0;
- for (i=0; icomm);
- for (i=0; icomm);
- for (i=0; i
-
-#ifdef HAVE_GPFS_H
-#include
-#endif
-
-
- /* overriding ADIOI_Calc_file_domains() to apply 'aligned file domain partitioning'. */
- void ADIOI_GPFS_Calc_file_domains(ADIO_File fd,
- ADIO_Offset *st_offsets,
- ADIO_Offset *end_offsets,
- int nprocs,
- int nprocs_for_coll,
- ADIO_Offset *min_st_offset_ptr,
- ADIO_Offset **fd_start_ptr,
- ADIO_Offset **fd_end_ptr,
- ADIO_Offset *fd_size_ptr,
- void *fs_ptr);
-
- /* overriding ADIOI_Calc_aggregator() for the default implementation is specific for
- static file domain partitioning */
- int ADIOI_GPFS_Calc_aggregator(ADIO_File fd,
- ADIO_Offset off,
- ADIO_Offset min_off,
- ADIO_Offset *len,
- ADIO_Offset fd_size,
- ADIO_Offset *fd_start,
- ADIO_Offset *fd_end);
-
- /* overriding ADIOI_Calc_my_req for the default implementation is specific for
- static file domain partitioning */
- void ADIOI_GPFS_Calc_my_req ( ADIO_File fd, ADIO_Offset *offset_list, ADIO_Offset *len_list,
- int contig_access_count, ADIO_Offset
- min_st_offset, ADIO_Offset *fd_start,
- ADIO_Offset *fd_end, ADIO_Offset fd_size,
- int nprocs,
- int *count_my_req_procs_ptr,
- int **count_my_req_per_proc_ptr,
- ADIOI_Access **my_req_ptr,
- int **buf_idx_ptr);
-
- /*
- * ADIOI_Calc_others_req
- *
- * param[in] count_my_req_procs Number of processes whose file domain my
- * request touches.
- * param[in] count_my_req_per_proc count_my_req_per_proc[i] gives the no. of
- * contig. requests of this process in
- * process i's file domain.
- * param[in] my_req A structure defining my request
- * param[in] nprocs Number of nodes in the block
- * param[in] myrank Rank of this node
- * param[out] count_others_req_proc_ptr Number of processes whose requests lie in
- * my process's file domain (including my
- * process itself)
- * param[out] others_req_ptr Array of other process' requests that lie
- * in my process's file domain
- */
- void ADIOI_GPFS_Calc_others_req(ADIO_File fd, int count_my_req_procs,
- int *count_my_req_per_proc,
- ADIOI_Access *my_req,
- int nprocs, int myrank,
- int *count_others_req_procs_ptr,
- ADIOI_Access **others_req_ptr);
-
-
-#endif /* AD_GPFS_AGGRS_H_ */
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_close.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_close.c
deleted file mode 100644
index f8a41671a21..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_close.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_close.c
- * \brief ???
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_gpfs.h"
-#include "ad_gpfs_tuning.h"
-#include
-
-void ADIOI_GPFS_Close(ADIO_File fd, int *error_code)
-{
- int err, derr=0;
- static char myname[] = "ADIOI_GPFS_CLOSE";
-
-#ifdef PROFILE
- MPE_Log_event(9, 0, "start close");
-#endif
-
- if (fd->null_fd >= 0)
- close(fd->null_fd);
-
- err = close(fd->fd_sys);
- if (fd->fd_direct >= 0)
- {
- derr = close(fd->fd_direct);
- }
-
-#ifdef PROFILE
- MPE_Log_event(10, 0, "end close");
-#endif
-
-/* FPRINTF(stderr,"%s(%d):'%s'. Free %#X\n",myname,__LINE__,fd->filename,(int)fd->fs_ptr);*/
- if (fd->fs_ptr != NULL) {
- ADIOI_Free(fd->fs_ptr);
- fd->fs_ptr = NULL;
- }
- fd->fd_sys = -1;
- fd->fd_direct = -1;
-
- if (err == -1 || derr == -1)
- {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_flush.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_flush.c
deleted file mode 100644
index 555002f639d..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_flush.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_flush.c
- * \brief Scalable flush for GPFS
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_gpfs.h"
-
-void ADIOI_GPFS_Flush(ADIO_File fd, int *error_code)
-{
- int err=0;
- static char myname[] = "ADIOI_GPFS_FLUSH";
-
- int rank;
-
- MPI_Comm_rank(fd->comm, &rank);
-
- /* the old logic about who is an fsync aggregator and who is not fell down
- * when deferred open was enabled. Instead, make this look more like
- * ad_pvfs2_flush. If one day the I/O aggregators have something they need
- * to flush, we can consult the 'fd->hints->ranklist[]' array. For now, a
- * flush from one process should suffice */
-
- /* ensure all other proceses are done writing. On many platforms MPI_Reduce
- * is fastest because it has the lightest constraints. On Blue Gene, BARRIER
- * is optimized */
- MPI_Barrier(fd->comm);
-
- if (rank == fd->hints->ranklist[0]) {
- err = fsync(fd->fd_sys);
- DBG_FPRINTF(stderr,"aggregation:fsync %s, err=%#X, errno=%#X\n",fd->filename, err, errno);
- /* We want errno, not the return code if it failed */
- if (err == -1) err = errno;
- else err = 0;
- }
- MPI_Bcast(&err, 1, MPI_UNSIGNED, fd->hints->ranklist[0], fd->comm);
- DBGV_FPRINTF(stderr,"aggregation result:fsync %s, errno %#X,\n",fd->filename, err);
-
- if (err) /* if it's non-zero, it must be an errno */
- {
- errno = err;
- err = -1;
- }
-
- /* --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));
- DBGT_FPRINTF(stderr,"fsync %s, err=%#X, errno=%#X\n",fd->filename, err, errno);
- return;
- }
- /* --END ERROR HANDLING-- */
-
- *error_code = MPI_SUCCESS;
-}
-
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_hints.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_hints.c
deleted file mode 100644
index 7af0a0c67a0..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_hints.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_hints.c
- * \brief GPFS hint processing - for now, only used for BlueGene and PE platforms
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "adio.h"
-#include "adio_extern.h"
-#include "hint_fns.h"
-
-#include "ad_gpfs.h"
-
-#define ADIOI_GPFS_CB_BUFFER_SIZE_DFLT "16777216"
-#define ADIOI_GPFS_IND_RD_BUFFER_SIZE_DFLT "4194304"
-#define ADIOI_GPFS_IND_WR_BUFFER_SIZE_DFLT "4194304"
-
-#ifdef BGQPLATFORM
-#define ADIOI_BG_NAGG_IN_PSET_HINT_NAME "bg_nodes_pset"
-#endif
-
-/** \page mpiio_vars MPIIO Configuration
- *
- * GPFS MPIIO configuration and performance tuning. Used by ad_gpfs ADIO.
- *
- * Used for BlueGene and PE platforms, which each have their own aggregator selection
- * algorithms that ignore user provided cb_config_list.
- *
- * \section hint_sec Hints
- * - bg_nodes_pset - BlueGene only - specify how many aggregators to use per pset.
- * This hint will override the cb_nodes hint based on BlueGene psets.
- * - N - Use N nodes per pset as aggregators.
- * - Default is based on partition configuration and cb_nodes.
- *
- * The following default key/value pairs may differ from other platform defaults.
- *
- * - key = cb_buffer_size value = 16777216
- * - key = romio_cb_read value = enable
- * - key = romio_cb_write value = enable
- * - key = ind_rd_buffer_size value = 4194304
- * - key = ind_wr_buffer_size value = 4194304
- */
-
-#ifdef BGQPLATFORM
-/* Compute the aggregator-related parameters that are required in 2-phase collective IO of ADIO. */
-extern int
-ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_proxy_per_pset);
-#elif PEPLATFORM
-extern int
-ADIOI_PE_gen_agg_ranklist(ADIO_File fd);
-#endif
-
-void ADIOI_GPFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
-{
-/* if fd->info is null, create a new info object.
- Initialize fd->info to default values.
- Initialize fd->hints to default values.
- Examine the info object passed by the user. If it contains values that
- ROMIO understands, override the default. */
-
- MPI_Info info;
- char *value;
- int flag, intval, nprocs=0, nprocs_is_valid = 0;
- static char myname[] = "ADIOI_GPFS_SETINFO";
-
- int did_anything = 0;
-
- if (fd->info == MPI_INFO_NULL) MPI_Info_create(&(fd->info));
- info = fd->info;
-
- /* Note that fd->hints is allocated at file open time; thus it is
- * not necessary to allocate it, or check for allocation, here.
- */
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- ADIOI_Assert ((value != NULL));
-
- /* initialize info and hints to default values if they haven't been
- * previously initialized
- */
- if (!fd->hints->initialized) {
-
- ad_gpfs_get_env_vars();
- did_anything = 1;
-
- /* buffer size for collective I/O */
- ADIOI_Info_set(info, "cb_buffer_size", ADIOI_GPFS_CB_BUFFER_SIZE_DFLT);
- fd->hints->cb_buffer_size = atoi(ADIOI_GPFS_CB_BUFFER_SIZE_DFLT);
-
- /* default is to let romio automatically decide when to use
- * collective buffering
- */
- ADIOI_Info_set(info, "romio_cb_read", "enable");
- fd->hints->cb_read = ADIOI_HINT_ENABLE;
- ADIOI_Info_set(info, "romio_cb_write", "enable");
- fd->hints->cb_write = ADIOI_HINT_ENABLE;
-
- if ( fd->hints->cb_config_list != NULL ) ADIOI_Free (fd->hints->cb_config_list);
- fd->hints->cb_config_list = NULL;
-
- /* number of processes that perform I/O in collective I/O */
- MPI_Comm_size(fd->comm, &nprocs);
- nprocs_is_valid = 1;
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", nprocs);
- ADIOI_Info_set(info, "cb_nodes", value);
- fd->hints->cb_nodes = -1;
-
- /* hint indicating that no indep. I/O will be performed on this file */
- ADIOI_Info_set(info, "romio_no_indep_rw", "false");
- fd->hints->no_indep_rw = 0;
-
- /* gpfs is not implementing file realms (ADIOI_IOStridedColl),
- initialize to disabled it. */
- /* hint instructing the use of persistent file realms */
- ADIOI_Info_set(info, "romio_cb_pfr", "disable");
- fd->hints->cb_pfr = ADIOI_HINT_DISABLE;
-
- /* hint guiding the assignment of persistent file realms */
- ADIOI_Info_set(info, "romio_cb_fr_types", "aar");
- fd->hints->cb_fr_type = ADIOI_FR_AAR;
-
- /* hint to align file realms with a certain byte value */
- ADIOI_Info_set(info, "romio_cb_fr_alignment", "1");
- fd->hints->cb_fr_alignment = 1;
-
- /* hint to set a threshold percentage for a datatype's size/extent at
- * which data sieving should be done in collective I/O */
- ADIOI_Info_set(info, "romio_cb_ds_threshold", "0");
- fd->hints->cb_ds_threshold = 0;
-
- /* hint to switch between point-to-point or all-to-all for two-phase */
- ADIOI_Info_set(info, "romio_cb_alltoall", "automatic");
- fd->hints->cb_alltoall = ADIOI_HINT_AUTO;
-
- /* deferred_open derived from no_indep_rw and cb_{read,write} */
- fd->hints->deferred_open = 0;
-
- /* buffer size for data sieving in independent reads */
- ADIOI_Info_set(info, "ind_rd_buffer_size", ADIOI_GPFS_IND_RD_BUFFER_SIZE_DFLT);
- fd->hints->ind_rd_buffer_size = atoi(ADIOI_GPFS_IND_RD_BUFFER_SIZE_DFLT);
-
- /* buffer size for data sieving in independent writes */
- ADIOI_Info_set(info, "ind_wr_buffer_size", ADIOI_GPFS_IND_WR_BUFFER_SIZE_DFLT);
- fd->hints->ind_wr_buffer_size = atoi(ADIOI_GPFS_IND_WR_BUFFER_SIZE_DFLT);
-
-
- ADIOI_Info_set(info, "romio_ds_read", "automatic");
- fd->hints->ds_read = ADIOI_HINT_AUTO;
- ADIOI_Info_set(info, "romio_ds_write", "automatic");
- fd->hints->ds_write = ADIOI_HINT_AUTO;
-
- /* still to do: tune this a bit for a variety of file systems. there's
- * no good default value so just leave it unset */
- fd->hints->min_fdomain_size = 0;
- fd->hints->striping_unit = 0;
-
- fd->hints->initialized = 1;
- }
-
- /* add in user's info if supplied */
- if (users_info != MPI_INFO_NULL) {
- ADIOI_Info_check_and_install_int(fd, users_info, "cb_buffer_size",
- &(fd->hints->cb_buffer_size), myname, error_code);
- /* new hints for enabling/disabling coll. buffering on
- * reads/writes
- */
- ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_cb_read",
- &(fd->hints->cb_read), myname, error_code);
- if (fd->hints->cb_read == ADIOI_HINT_DISABLE) {
- /* romio_cb_read overrides no_indep_rw */
- ADIOI_Info_set(info, "romio_no_indep_rw", "false");
- fd->hints->no_indep_rw = ADIOI_HINT_DISABLE;
- }
- ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_cb_write",
- &(fd->hints->cb_write), myname, error_code);
- if (fd->hints->cb_write == ADIOI_HINT_DISABLE) {
- /* romio_cb_write overrides no_indep_rw */
- ADIOI_Info_set(info, "romio_no_indep_rw", "false");
- fd->hints->no_indep_rw = ADIOI_HINT_DISABLE;
- }
- /* Has the user indicated all I/O will be done collectively? */
- ADIOI_Info_check_and_install_true(fd, users_info, "romio_no_indep_rw",
- &(fd->hints->no_indep_rw), myname, error_code);
- if (fd->hints->no_indep_rw == 1) {
- /* if 'no_indep_rw' set, also hint that we will do
- * collective buffering: if we aren't doing independent io,
- * then we have to do collective */
- ADIOI_Info_set(info, "romio_cb_write", "enable");
- ADIOI_Info_set(info, "romio_cb_read", "enable");
- fd->hints->cb_read = 1;
- fd->hints->cb_write = 1;
- }
-
- /* new hints for enabling/disabling data sieving on
- * reads/writes
- */
- ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_ds_read",
- &(fd->hints->ds_read), myname, error_code);
- ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_ds_write",
- &(fd->hints->ds_write), myname, error_code);
-
- ADIOI_Info_check_and_install_int(fd, users_info, "ind_wr_buffer_size",
- &(fd->hints->ind_wr_buffer_size), myname, error_code);
- ADIOI_Info_check_and_install_int(fd, users_info, "ind_rd_buffer_size",
- &(fd->hints->ind_rd_buffer_size), myname, error_code);
-
- memset( value, 0, MPI_MAX_INFO_VAL+1 );
- ADIOI_Info_get(users_info, "romio_min_fdomain_size", MPI_MAX_INFO_VAL,
- value, &flag);
- if ( flag && ((intval = atoi(value)) > 0) ) {
- ADIOI_Info_set(info, "romio_min_fdomain_size", value);
- fd->hints->min_fdomain_size = intval;
- }
- /* Now we use striping unit in common code so we should
- process hints for it. */
- ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit",
- &(fd->hints->striping_unit), myname, error_code);
-
-#ifdef BGQPLATFORM
- memset( value, 0, MPI_MAX_INFO_VAL+1 );
- ADIOI_Info_get(users_info, ADIOI_BG_NAGG_IN_PSET_HINT_NAME, MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && ((intval = atoi(value)) > 0)) {
-
- did_anything = 1;
- ADIOI_Info_set(info, ADIOI_BG_NAGG_IN_PSET_HINT_NAME, value);
- fd->hints->cb_nodes = intval;
- }
-#endif
- }
-
- /* special CB aggregator assignment */
- if (did_anything) {
-#ifdef BGQPLATFORM
- ADIOI_BG_gen_agg_ranklist(fd, fd->hints->cb_nodes);
-#elif PEPLATFORM
- ADIOI_PE_gen_agg_ranklist(fd);
-#endif
- }
-
- /* deferred_open won't be set by callers, but if the user doesn't
- * explicitly disable collecitve buffering (two-phase) and does hint that
- * io w/o independent io is going on, we'll set this internal hint as a
- * convenience */
- if ( ( (fd->hints->cb_read != ADIOI_HINT_DISABLE) \
- && (fd->hints->cb_write != ADIOI_HINT_DISABLE)\
- && fd->hints->no_indep_rw ) ) {
- fd->hints->deferred_open = 1;
- } else {
- /* setting romio_no_indep_rw enable and romio_cb_{read,write}
- * disable at the same time doesn't make sense. honor
- * romio_cb_{read,write} and force the no_indep_rw hint to
- * 'disable' */
- ADIOI_Info_set(info, "romio_no_indep_rw", "false");
- fd->hints->no_indep_rw = 0;
- fd->hints->deferred_open = 0;
- }
-
- /* BobC commented this out, but since hint processing runs on both bg and
- * bglockless, we need to keep DS writes enabled on gpfs and disabled on
- * PVFS */
- if (ADIO_Feature(fd, ADIO_DATA_SIEVING_WRITES) == 0) {
- /* disable data sieving for fs that do not
- support file locking */
- ADIOI_Info_get(info, "ind_wr_buffer_size", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- /* get rid of this value if it is set */
- ADIOI_Info_delete(info, "ind_wr_buffer_size");
- }
- /* note: leave ind_wr_buffer_size alone; used for other cases
- * as well. -- Rob Ross, 04/22/2003
- */
- ADIOI_Info_set(info, "romio_ds_write", "disable");
- fd->hints->ds_write = ADIOI_HINT_DISABLE;
- }
-
- ADIOI_Free(value);
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_open.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_open.c
deleted file mode 100644
index f4fef37c85c..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_open.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_open.c
- * \brief ???
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_gpfs.h"
-#include "ad_gpfs_tuning.h"
-
-#include
-#include
-#include
-#include
-
-
-#ifdef HAVE_GPFS_H
-#include
-#endif
-#ifdef HAVE_GPFS_FCNTL_H
-#include
-#endif
-
-#ifdef HAVE_GPFS_FCNTL_H
-static void gpfs_free_all_locks(int fd)
-{
- int rc;
- struct {
- gpfsFcntlHeader_t header;
- gpfsFreeRange_t release;
- } release_all;
-
- release_all.header.totalLength = sizeof(release_all);
- release_all.header.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
- release_all.header.fcntlReserved = 0;
-
- release_all.release.structLen = sizeof(release_all.release);
- release_all.release.structType = GPFS_FREE_RANGE;
- release_all.release.start = 0;
- release_all.release.length = 0;
-
- rc = gpfs_fcntl(fd, &release_all);
- if (rc != 0) {
- DBGV_FPRINTF(stderr,"GPFS fcntl release failed with rc=%d, errno=%d\n",
- rc,errno);
- }
-}
-#endif
-
-
-void ADIOI_GPFS_Open(ADIO_File fd, int *error_code)
-{
- int perm, old_mask, amode, rank, rc;
- static char myname[] = "ADIOI_GPFS_OPEN";
-
- /* set internal variables for tuning environment variables */
- ad_gpfs_get_env_vars();
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_open_a, 0, NULL);
-#endif
- fd->fd_sys = open(fd->filename, amode, perm);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_open_b, 0, NULL);
-#endif
- DBG_FPRINTF(stderr,"open('%s',%#X,%#X) rc=%d, errno=%d\n",fd->filename,amode,perm,fd->fd_sys,errno);
- fd->fd_direct = -1;
-
- if (gpfsmpio_devnullio == 1) {
- fd->null_fd = open("/dev/null", O_RDWR);
- } else {
- fd->null_fd = -1;
- }
-
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND))
- fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
-
- if(fd->fd_sys != -1)
- {
-
- fd->blksize = 1048576; /* default to 1M */
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_stat_a, 0, NULL);
-#endif
- /* in this fs-specific routine, we might not be called over entire
- * communicator (deferred open). Collect statistics on one process.
- * ADIOI_GEN_Opencoll (common-code caller) will take care of the
- * broadcast */
-
- MPI_Comm_rank(fd->comm, &rank);
- if ((rank == fd->hints->ranklist[0]) || (fd->comm == MPI_COMM_SELF)) {
- struct stat64 gpfs_statbuf;
- /* Get the (real) underlying file system block size */
- rc = stat64(fd->filename, &gpfs_statbuf);
- if (rc >= 0)
- {
- fd->blksize = gpfs_statbuf.st_blksize;
- DBGV_FPRINTF(stderr,"Successful stat '%s'. Blocksize=%ld\n",
- fd->filename,gpfs_statbuf.st_blksize);
- }
- else
- {
- DBGV_FPRINTF(stderr,"Stat '%s' failed with rc=%d, errno=%d\n",
- fd->filename,rc,errno);
- }
- }
- /* all other ranks have incorrect fd->blocksize, but ADIOI_GEN_Opencoll
- * will take care of that in both standard and deferred-open case */
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_stat_b, 0, NULL);
-#endif
-
-#ifdef HAVE_GPFS_FCNTL_H
- /* in parallel workload, might be helpful to immediately release block
- * tokens. Or, system call overhead will outweigh any benefits... */
- if (getenv("ROMIO_GPFS_FREE_LOCKS")!=NULL)
- gpfs_free_all_locks(fd->fd_sys);
-
-#endif
- }
-
- if (fd->fd_sys == -1) {
- *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
- }
- else *error_code = MPI_SUCCESS;
-}
-/*
- *vim: ts=8 sts=4 sw=4 noexpandtab
- */
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_rdcoll.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_rdcoll.c
deleted file mode 100644
index f449acb158a..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_rdcoll.c
+++ /dev/null
@@ -1,1255 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_rdcoll.c
- * \brief ???
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "adio.h"
-#include "adio_extern.h"
-#include "ad_gpfs.h"
-#include "ad_gpfs_aggrs.h"
-
-#ifdef PROFILE
-#include "mpe.h"
-#endif
-
-#ifdef USE_DBG_LOGGING
- #define RDCOLL_DEBUG 1
-#endif
-#ifdef AGGREGATION_PROFILE
-#include "mpe.h"
-#endif
-
-/* prototypes of functions used for collective reads only. */
-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
- min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *buf_idx, int *error_code);
-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 myrank, int
- buftype_is_contig, int contig_access_count,
- ADIO_Offset min_st_offset,
- ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- ADIOI_Access *others_req,
- int iter,
- MPI_Aint buftype_extent, int *buf_idx);
-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,
- int *count, int *start_pos,
- int *partial_send,
- int *recd_from_proc, int nprocs,
- int myrank, int
- buftype_is_contig, int contig_access_count,
- ADIO_Offset min_st_offset,
- ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- ADIOI_Access *others_req,
- int iter,
- MPI_Aint buftype_extent, int *buf_idx);
-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,
- MPI_Request *requests, MPI_Status *statuses,
- int *recd_from_proc, int nprocs,
- int contig_access_count,
- ADIO_Offset min_st_offset,
- ADIO_Offset fd_size, ADIO_Offset *fd_start,
- ADIO_Offset *fd_end,
- MPI_Aint buftype_extent);
-
-extern void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype
- datatype, int file_ptr_type, ADIO_Offset
- offset, ADIO_Offset **offset_list_ptr, ADIO_Offset
- **len_list_ptr, ADIO_Offset *start_offset_ptr,
- ADIO_Offset *end_offset_ptr, int
- *contig_access_count_ptr);
-
-
-
-void ADIOI_GPFS_ReadStridedColl(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* Uses a generalized version of the extended two-phase method described
- in "An Extended Two-Phase Method for Accessing Sections of
- Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary,
- Scientific Programming, (5)4:301--317, Winter 1996.
- http://www.mcs.anl.gov/home/thakur/ext2ph.ps */
-
- ADIOI_Access *my_req;
- /* array of nprocs structures, one for each other process in
- whose file domain this process's request lies */
-
- ADIOI_Access *others_req;
- /* array of nprocs structures, one for each other process
- whose request lies in this process's file domain. */
-
- int i, filetype_is_contig, nprocs, nprocs_for_coll, myrank;
- int contig_access_count=0, interleave_count = 0, buftype_is_contig;
- int *count_my_req_per_proc, count_my_req_procs, count_others_req_procs;
- ADIO_Offset start_offset, end_offset, orig_fp, fd_size, min_st_offset, off;
- 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;
-
- GPFSMPIO_T_CIO_RESET( r);
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPI_Count bufsize, size;
-#endif
-
-#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,
- file_ptr_type, offset, status, error_code);
- return;
- } */
-#endif
-#ifdef PROFILE
- MPE_Log_event(13, 0, "start computation");
-#endif
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- /* number of aggregators, cb_nodes, is stored in the hints */
- nprocs_for_coll = fd->hints->cb_nodes;
- orig_fp = fd->fp_ind;
-
- GPFSMPIO_T_CIO_SET_GET( r, 1, 0, GPFSMPIO_CIO_T_MPIO_CRW, GPFSMPIO_CIO_LAST)
- GPFSMPIO_T_CIO_SET_GET( r, 1, 0, GPFSMPIO_CIO_T_LCOMP, GPFSMPIO_CIO_LAST )
-
- /* only check for interleaving if cb_read isn't disabled */
- if (fd->hints->cb_read != ADIOI_HINT_DISABLE) {
- /* For this process's request, calculate the list of offsets and
- lengths in the file and determine the start and end offsets. */
-
- /* Note: end_offset points to the last byte-offset that will be accessed.
- e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/
-
- ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset,
- &offset_list, &len_list, &start_offset,
- &end_offset, &contig_access_count);
-
- GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_GATHER, GPFSMPIO_CIO_T_LCOMP )
-
-#ifdef RDCOLL_DEBUG
- for (i=0; icomm );
- for (ii=0; iicomm );
-
- for (ii=0; iicomm);
- MPI_Allgather(&end_offset, 1, ADIO_OFFSET, end_offsets, 1,
- ADIO_OFFSET, fd->comm);
- if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) {
- MPI_Allgather(&count_sizes, 1, ADIO_OFFSET, count_sizes, 1,
- ADIO_OFFSET, fd->comm);
- }
- }
-
- GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_PATANA, GPFSMPIO_CIO_T_GATHER )
-
- /* are the accesses of different processes interleaved? */
- for (i=1; ihints->cb_read == ADIOI_HINT_DISABLE
- || (!interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO)))
- {
- /* don't do aggregation */
- if (fd->hints->cb_read != ADIOI_HINT_DISABLE) {
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- }
-
- fd->fp_ind = orig_fp;
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- if (buftype_is_contig && filetype_is_contig) {
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset;
- ADIO_ReadContig(fd, buf, count, datatype, ADIO_EXPLICIT_OFFSET,
- off, status, error_code);
- }
- else ADIO_ReadContig(fd, buf, count, datatype, ADIO_INDIVIDUAL,
- 0, status, error_code);
- }
- else ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type,
- offset, status, error_code);
-
- return;
- }
-
- GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_FD_PART, GPFSMPIO_CIO_T_PATANA )
-
- /* We're going to perform aggregation of I/O. Here we call
- * ADIOI_Calc_file_domains() to determine what processes will handle I/O
- * to what regions. We pass nprocs_for_coll into this function; it is
- * used to determine how many processes will perform I/O, which is also
- * the number of regions into which the range of bytes must be divided.
- * These regions are called "file domains", or FDs.
- *
- * When this function returns, fd_start, fd_end, fd_size, and
- * min_st_offset will be filled in. fd_start holds the starting byte
- * location for each file domain. fd_end holds the ending byte location.
- * min_st_offset holds the minimum byte location that will be accessed.
- *
- * Both fd_start[] and fd_end[] are indexed by an aggregator number; this
- * needs to be mapped to an actual rank in the communicator later.
- *
- */
- int currentNonZeroDataIndex = 0;
- if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) {
- /* Take out the 0-data offsets by shifting the indexes with data to the
- * front and keeping track of the non-zero data index for use as the
- * length. By doing this we will optimally use all available aggs
- * and spread the actual data across them instead of having offsets
- * with empty data potentially dilute the file domains and create
- * problems for the one-sided aggregation.
- */
- for (i=0; i 0) {
- st_offsets[currentNonZeroDataIndex] = st_offsets[i];
- end_offsets[currentNonZeroDataIndex] = end_offsets[i];
- currentNonZeroDataIndex++;
- }
- }
- }
- if (gpfsmpio_tuneblocking) {
- if ((gpfsmpio_read_aggmethod == 1) || (gpfsmpio_read_aggmethod == 2)) {
- ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, currentNonZeroDataIndex,
- nprocs_for_coll, &min_st_offset,
- &fd_start, &fd_end, &fd_size, fd->fs_ptr);
- }
- else {
- ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, nprocs,
- nprocs_for_coll, &min_st_offset,
- &fd_start, &fd_end, &fd_size, fd->fs_ptr);
- }
- }
- else {
- 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
- * aggregator, and then these sub-groups will carry out a simplified
- * two-phase over that sub-group.
- *
- * First verify that the filetype is contig and the offsets are
- * increasing in rank order*/
- int x, inOrderAndNoGaps = 1;
- for (x=0;x<(nprocs-1);x++) {
- if (end_offsets[x] != (st_offsets[x+1]-1))
- inOrderAndNoGaps = 0;
- }
- if (inOrderAndNoGaps && buftype_is_contig) {
- /* if these conditions exist then execute the P2PContig code else
- * execute the original code */
- ADIOI_P2PContigReadAggregation(fd, buf,
- error_code, st_offsets, end_offsets, fd_start, fd_end);
-
- /* NOTE: we are skipping the rest of two-phase in this path */
- 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);
- goto fn_exit;
-
- }
- }
-
- /* calculate where the portions of the access requests of this process
- * are located in terms of the file domains. this could be on the same
- * process or on other processes. this function fills in:
- * count_my_req_procs - number of processes (including this one) for which
- * this process has requests in their file domain
- * count_my_req_per_proc - count of requests for each process, indexed
- * by rank of the process
- * my_req[] - array of data structures describing the requests to be
- * performed by each process (including self). indexed by rank.
- * buf_idx[] - array of locations into which data can be directly moved;
- * this is only valid for contiguous buffer case
- */
- 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,
- &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,
- &count_my_req_per_proc, &my_req,
- &buf_idx);
-
- GPFSMPIO_T_CIO_SET_GET( r, 1, 1, GPFSMPIO_CIO_T_OTHREQ, GPFSMPIO_CIO_T_MYREQ )
-
- /* perform a collective communication in order to distribute the
- * data calculated above. fills in the following:
- * count_others_req_procs - number of processes (including this
- * one) which have requests in this process's file domain.
- * count_others_req_per_proc[] - number of separate contiguous
- * requests from proc i lie in this process's file domain.
- */
- if (gpfsmpio_tuneblocking)
- ADIOI_GPFS_Calc_others_req(fd, count_my_req_procs,
- count_my_req_per_proc, my_req,
- nprocs, myrank, &count_others_req_procs,
- &others_req);
-
- else
- ADIOI_Calc_others_req(fd, count_my_req_procs,
- count_my_req_per_proc, my_req,
- 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
- */
- ADIOI_Free(count_my_req_per_proc);
- for (i=0; ifp_sys_posn = -1; /* set it to null. */
-}
-
-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
- min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *buf_idx, int *error_code)
-{
-/* Read in sizes of no more than coll_bufsize, an info parameter.
- Send data to appropriate processes.
- Place recd. data in user buf.
- The idea is to reduce the amount of extra memory required for
- collective I/O. If all data were read all at once, which is much
- easier, it would require temp space more than the size of user_buf,
- which is often unacceptable. For example, to read a distributed
- array from a file, where each local array is 8Mbytes, requiring
- at least another 8Mbytes of temp space is unacceptable. */
-
- int i, j, m, ntimes, max_ntimes, buftype_is_contig;
- ADIO_Offset st_loc=-1, end_loc=-1, off, done, real_off, req_off;
- char *read_buf = NULL, *tmp_buf;
- int *curr_offlen_ptr, *count, *send_size, *recv_size;
- int *partial_send, *recd_from_proc, *start_pos;
- /* Not convinced end_loc-st_loc couldn't be > int, so make these offsets*/
- ADIO_Offset real_size, size, for_curr_iter, for_next_iter;
- int req_len, flag, rank;
- MPI_Status status;
- ADIOI_Flatlist_node *flat_buf=NULL;
- MPI_Aint buftype_extent, buftype_lb;
- int coll_bufsize;
-#ifdef RDCOLL_DEBUG
- int iii;
-#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.
- coll_bufsize is obtained from the hints object. */
-
- coll_bufsize = fd->hints->cb_buffer_size;
-
- /* grab some initial values for st_loc and end_loc */
- for (i=0; i < nprocs; i++) {
- if (others_req[i].count) {
- st_loc = others_req[i].offsets[0];
- end_loc = others_req[i].offsets[0];
- break;
- }
- }
-
- /* now find the real values */
- for (i=0; i < nprocs; i++)
- for (j=0; jcomm);
-
- read_buf = fd->io_buf;
-
- 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));
- /* to store count of how many off-len pairs per proc are satisfied
- 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
- in a particular iteration, the length sent is stored here.
- calloc initializes to 0. */
-
- send_size = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* total size of data to be sent to each proc. in an iteration */
-
- recv_size = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* total size of data to be recd. from each proc. in an iteration.
- Of size nprocs so that I can use MPI_Alltoall later. */
-
- recd_from_proc = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- /* amount of data recd. so far from each proc. Used in
- ADIOI_Fill_user_buffer. initialized to 0 here. */
-
- start_pos = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- /* used to store the starting value of curr_offlen_ptr[i] in
- this iteration */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- if (!buftype_is_contig) {
- flat_buf = ADIOI_Flatten_and_find(datatype);
- }
- MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent);
-
- done = 0;
- off = st_loc;
- for_curr_iter = for_next_iter = 0;
-
- MPI_Comm_rank(fd->comm, &rank);
-
-#ifdef PROFILE
- MPE_Log_event(14, 0, "end computation");
-#endif
-
- for (m=0; mio_buf);
- fd->io_buf = (char *) ADIOI_Malloc(for_next_iter+coll_bufsize);
- memcpy(fd->io_buf, tmp_buf, for_next_iter);
- read_buf = fd->io_buf;
- ADIOI_Free(tmp_buf);
- }
-
- off += size;
- done += size;
- }
-
- for (i=0; icomm);
-
- nprocs_recv = 0;
- for (i=0; i < nprocs; i++) if (recv_size[i]) nprocs_recv++;
-
- nprocs_send = 0;
- for (i=0; icomm, requests+j);
- j++;
- buf_idx[i] += recv_size[i];
- }
- }
- else {
-/* allocate memory for recv_buf and post receives */
- recv_buf = (char **) ADIOI_Malloc(nprocs * sizeof(char*));
- for (i=0; i < nprocs; i++)
- if (recv_size[i]) recv_buf[i] =
- (char *) ADIOI_Malloc(recv_size[i]);
-
- j = 0;
- for (i=0; i < nprocs; i++)
- if (recv_size[i]) {
- MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i,
- myrank+i+100*iter, fd->comm, requests+j);
- j++;
-#ifdef RDCOLL_DEBUG
- DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n",
- myrank, recv_size[i], myrank+i+100*iter);
-#endif
- }
- }
-
-/* create derived datatypes and send data */
-
- j = 0;
- for (i=0; icomm, requests+nprocs_recv+j);
- MPI_Type_free(&send_type);
- if (partial_send[i]) others_req[i].lens[k] = tmp;
- j++;
- }
- }
-
- statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+nprocs_recv+1) * \
- sizeof(MPI_Status));
- /* +1 to avoid a 0-size malloc */
-
- /* wait on the receives */
- if (nprocs_recv) {
-#ifdef NEEDS_MPI_TEST
- j = 0;
- while (!j) MPI_Testall(nprocs_recv, requests, &j, statuses);
-#else
- MPI_Waitall(nprocs_recv, requests, statuses);
-#endif
-
- /* if noncontiguous, to the copies from the recv buffers */
- 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,
- nprocs, contig_access_count,
- min_st_offset, fd_size, fd_start, fd_end,
- buftype_extent);
- }
-
- /* wait on the sends*/
- MPI_Waitall(nprocs_send, requests+nprocs_recv, statuses+nprocs_recv);
-
- ADIOI_Free(statuses);
- ADIOI_Free(requests);
-
- if (!buftype_is_contig) {
- for (i=0; i < nprocs; i++)
- if (recv_size[i]) ADIOI_Free(recv_buf[i]);
- ADIOI_Free(recv_buf);
- }
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5033, 0, NULL);
-#endif
-}
-
-#define ADIOI_BUF_INCR \
-{ \
- while (buf_incr) { \
- size_in_buf = ADIOI_MIN(buf_incr, flat_buf_sz); \
- user_buf_idx += size_in_buf; \
- flat_buf_sz -= size_in_buf; \
- if (!flat_buf_sz) { \
- if (flat_buf_idx < (flat_buf->count - 1)) flat_buf_idx++; \
- else { \
- flat_buf_idx = 0; \
- n_buftypes++; \
- } \
- user_buf_idx = flat_buf->indices[flat_buf_idx] + \
- (ADIO_Offset)n_buftypes*(ADIO_Offset)buftype_extent; \
- flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \
- } \
- buf_incr -= size_in_buf; \
- } \
-}
-
-
-#define ADIOI_BUF_COPY \
-{ \
- while (size) { \
- size_in_buf = ADIOI_MIN(size, flat_buf_sz); \
- 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); \
- recv_buf_idx[p] += size_in_buf; /* already tested (size_t)size_in_buf*/ \
- user_buf_idx += size_in_buf; \
- flat_buf_sz -= size_in_buf; \
- if (!flat_buf_sz) { \
- if (flat_buf_idx < (flat_buf->count - 1)) flat_buf_idx++; \
- else { \
- flat_buf_idx = 0; \
- n_buftypes++; \
- } \
- user_buf_idx = flat_buf->indices[flat_buf_idx] + \
- (ADIO_Offset)n_buftypes*(ADIO_Offset)buftype_extent; \
- flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \
- } \
- size -= size_in_buf; \
- buf_incr -= size_in_buf; \
- } \
- ADIOI_BUF_INCR \
-}
-
-static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
- *flat_buf, char **recv_buf, ADIO_Offset
- *offset_list, ADIO_Offset *len_list,
- unsigned *recv_size,
- MPI_Request *requests, MPI_Status *statuses,
- int *recd_from_proc, int nprocs,
- int contig_access_count,
- ADIO_Offset min_st_offset,
- ADIO_Offset fd_size, ADIO_Offset *fd_start,
- ADIO_Offset *fd_end,
- MPI_Aint buftype_extent)
-{
-
-/* this function is only called if buftype is not contig */
-
- int i, p, flat_buf_idx;
- ADIO_Offset flat_buf_sz, size_in_buf, buf_incr, size;
- int n_buftypes;
- ADIO_Offset off, len, rem_len, user_buf_idx;
- /* Not sure unsigned is necessary, but it makes the math safer */
- unsigned *curr_from_proc, *done_from_proc, *recv_buf_idx;
-
- ADIOI_UNREFERENCED_ARG(requests);
- ADIOI_UNREFERENCED_ARG(statuses);
-
-/* 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
- filled into user buffer in previous iterations
- 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));
- recv_buf_idx = (unsigned *) ADIOI_Malloc(nprocs * sizeof(unsigned));
-
- for (i=0; i < nprocs; i++) {
- recv_buf_idx[i] = curr_from_proc[i] = 0;
- done_from_proc[i] = recd_from_proc[i];
- }
-
- user_buf_idx = flat_buf->indices[0];
- flat_buf_idx = 0;
- n_buftypes = 0;
- flat_buf_sz = flat_buf->blocklens[0];
-
- /* flat_buf_idx = current index into flattened buftype
- flat_buf_sz = size of current contiguous component in
- flattened buf */
-
- for (i=0; i 0) {
- len = rem_len;
- /* NOTE: len value is modified by ADIOI_Calc_aggregator() to be no
- * longer than the single region that processor "p" is responsible
- * for.
- */
- p = ADIOI_GPFS_Calc_aggregator(fd,
- off,
- min_st_offset,
- &len,
- fd_size,
- fd_start,
- fd_end);
-
- 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 -
- done_from_proc[p], recv_size[p]-recv_buf_idx[p]);
- buf_incr = done_from_proc[p] - curr_from_proc[p];
- ADIOI_BUF_INCR
- buf_incr = curr_from_proc[p]+len-done_from_proc[p];
- ADIOI_Assert((done_from_proc[p] + size) == (unsigned)((ADIO_Offset)done_from_proc[p] + size));
- curr_from_proc[p] = done_from_proc[p] + size;
- ADIOI_BUF_COPY
- }
- else {
- size = ADIOI_MIN(len,recv_size[p]-recv_buf_idx[p]);
- buf_incr = len;
- ADIOI_Assert((curr_from_proc[p] + size) == (unsigned)((ADIO_Offset)curr_from_proc[p] + size));
- curr_from_proc[p] += (unsigned) size;
- ADIOI_BUF_COPY
- }
- }
- else {
- ADIOI_Assert((curr_from_proc[p] + len) == (unsigned)((ADIO_Offset)curr_from_proc[p] + len));
- curr_from_proc[p] += (unsigned) len;
- buf_incr = len;
- ADIOI_BUF_INCR
- }
- }
- else {
- buf_incr = len;
- ADIOI_BUF_INCR
- }
- off += len;
- rem_len -= len;
- }
- }
- for (i=0; i < nprocs; i++)
- if (recv_size[i]) recd_from_proc[i] = curr_from_proc[i];
-
- ADIOI_Free(curr_from_proc);
- ADIOI_Free(done_from_proc);
- ADIOI_Free(recv_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
- *len_list, int *send_size, int *recv_size,
- int *count, int *start_pos, int *partial_send,
- int *recd_from_proc, int nprocs,
- int myrank, int
- buftype_is_contig, int contig_access_count,
- ADIO_Offset min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- ADIOI_Access *others_req,
- int iter, MPI_Aint buftype_extent, int *buf_idx)
-{
- int i, j, k=0, tmp=0, nprocs_recv, nprocs_send;
- char **recv_buf = NULL;
- MPI_Request *requests=NULL;
- MPI_Status *statuses=NULL;
- int rtail, stail;
- char *sbuf_ptr, *from_ptr;
- int len;
- int *sdispls, *rdispls;
- char *all_recv_buf, *all_send_buf;
-
- /* exchange send_size info so that each process knows how much to
- receive from whom and how much memory to allocate. */
- MPI_Alltoall(send_size, 1, MPI_INT, recv_size, 1, MPI_INT, fd->comm);
-
- nprocs_recv = 0;
- for (i=0; icomm );
-
-#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 (!buftype_is_contig)
- ADIOI_Fill_user_buffer(fd, buf, flat_buf, recv_buf,
- offset_list, len_list, (unsigned*)recv_size,
- requests, statuses, /* never used inside */
- recd_from_proc,
- nprocs, contig_access_count,
- min_st_offset, fd_size, fd_start, fd_end,
- buftype_extent);
- else {
- rtail = 0;
- for (i=0; i < nprocs; i++)
- if (recv_size[i]) {
- memcpy( (char *)buf + buf_idx[i], all_recv_buf + rtail, recv_size[i] );
- buf_idx[i] += recv_size[i];
- rtail += recv_size[i];
- }
- }
- }
-
- ADIOI_Free( all_send_buf );
- ADIOI_Free( all_recv_buf );
- ADIOI_Free( recv_buf );
- ADIOI_Free( sdispls );
- ADIOI_Free( rdispls );
- return;
-}
diff --git a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_tuning.c b/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_tuning.c
deleted file mode 100644
index 333612b0da1..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/ad_gpfs_tuning.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_gpfs_tuning.c
- * \brief Defines ad_gpfs performance tuning
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 2008 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-/*---------------------------------------------------------------------
- * ad_gpfs_tuning.c
- *
- * defines global variables and functions for performance tuning and
- * functional debugging.
- *---------------------------------------------------------------------*/
-
-#include "ad_gpfs_tuning.h"
-#include "mpi.h"
-
-#if !defined(PVFS2_SUPER_MAGIC)
- #define PVFS2_SUPER_MAGIC (0x20030528)
-#endif
-
-
-int gpfsmpio_timing;
-int gpfsmpio_timing2;
-int gpfsmpio_timing_cw_level;
-int gpfsmpio_comm;
-int gpfsmpio_tunegather;
-int gpfsmpio_tuneblocking;
-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];
-
-/* set internal variables for tuning environment variables */
-/** \page mpiio_vars MPIIO Configuration
- \section env_sec Environment Variables
- * - GPFSMPIO_COMM - Define how data is exchanged on collective
- * reads and writes. Possible values:
- * - 0 - Use MPI_Alltoallv.
- * - 1 - Use MPI_Isend/MPI_Irecv.
- * - Default is 0.
- *
- * - GPFSMPIO_TIMING - collect timing breakdown for MPI I/O collective calls.
- * Possible values:
- * - 0 - Do not collect/report timing.
- * - 1 - Collect/report timing.
- * - Default is 0.
- *
- * - GPFSMPIO_TUNEGATHER - Tune how starting and ending offsets are communicated
- * for aggregator collective i/o. Possible values:
- * - 0 - Use two MPI_Allgather's to collect starting and ending offsets.
- * - 1 - Use MPI_Allreduce(MPI_MAX) to collect starting and ending offsets.
- * - Default is 1.
- *
- * - GPFSMPIO_TUNEBLOCKING - Tune how aggregate file domains are
- * calculated (block size). Possible values:
- * - 0 - Evenly calculate file domains across aggregators. Also use
- * MPI_Isend/MPI_Irecv to exchange domain information.
- * - 1 - Align file domains with the underlying file system's block size. Also use
- * MPI_Alltoallv to exchange domain information.
- * - Default is 1.
- *
- * - BGLOCKLESSMPIO_F_TYPE - Specify a filesystem type that should run
- * the ad_bglockless driver. NOTE: Using romio prefixes (such as
- * "bg:" or "bglockless:") on a file name will override this environment
- * variable. Possible values:
- * - 0xnnnnnnnn - Any valid file system type (or "magic number") from
- * statfs() field f_type.
- * - The default is 0x20030528 (PVFS2_SUPER_MAGIC)
- *
- * - GPFSMPIO_NAGG_PSET - Specify a ratio of "I/O aggregators" to use for each
- * compute group (compute nodes + i/o nodes). Possible values:
- * - any integer
- * - Default is 8
- *
- * - GPFSMPIO_PTHREADIO - Enables a very simple form of asyncronous io where a
- * pthread is spawned to do the posix writes while the main thread does the
- * data aggregation - useful for large files where multiple rounds are
- * required (more that the cb_buffer_size of data per aggregator). User
- * must ensure there is hw resource available for the thread to run. I
- * am sure there is a better way to do this involving comm threads - this is
- * just a start. NOTE: For some reason the stats collected when this is
- * enabled misses some of the data so the data sizes are off a bit - this is
- * a statistical issue only, the data is still accurately written out
- *
- * - GPFSMPIO_P2PCONTIG - Does simple point-to-point communication between the
- * aggregator and the procs that feed it. Performance could be enhanced by a
- * one-sided put algorithm. Current implementation allows only 1 round of
- * data. Useful/allowed only when:
- * 1.) The datatype is contiguous.
- * 2.) The offsets are increasing in rank-order.
- * 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
- * offsets. The breadth-first assignment improves performance in the case of
- * a relatively small file of size less than the gpfs block size multiplied
- * by the number of ions. Files: ad_gpfs_aggrs.c ad_bg_aggrs.c. Possible Values
- * - 0 - assign file domain blocks in the traditional manner
- * - 1 - if there are variable sized file domain blocks, spread them out
- * (balance) across bridge nodes
- *
- * - GPFSMPIO_DEVNULLIO - do everything *except* write to / read from the file
- * system. When experimenting with different two-phase I/O strategies, it's
- * helpful to remove the highly variable file system from the experiment.
- * - 0 (disabled) or 1 (enabled)
- * - Default is 0
- *
- * - GPFSMPIO_BRIDGERINGAGG - Relevant only to BGQ. Aggregator placement
- * optimization whch forms a 5-d ring around the bridge node starting at
- * GPFSMPIO_BRIDGERINGAGG hops away. Experimental performance results
- * suggest best value is 1 and only in conjunction with GPFSMPIO_P2PCONTIG
- * and GPFSMPIO_BALANCECONTIG. The number of aggregators selected is still
- * GPFSMPIO_NAGG_PSET however the bridge node itself is NOT selected.
- *
- */
-
-void ad_gpfs_get_env_vars() {
- char *x, *dummy;
-
- gpfsmpio_comm = 0;
- x = getenv( "GPFSMPIO_COMM" );
- if (x) gpfsmpio_comm = atoi(x);
- gpfsmpio_timing = 0;
- x = getenv( "GPFSMPIO_TIMING" );
- if (x) gpfsmpio_timing = atoi(x);
- gpfsmpio_tunegather = 1;
- x = getenv( "GPFSMPIO_TUNEGATHER" );
- if (x) gpfsmpio_tunegather = atoi(x);
- gpfsmpio_tuneblocking = 1;
- x = getenv( "GPFSMPIO_TUNEBLOCKING" );
- if (x) gpfsmpio_tuneblocking = atoi(x);
- bglocklessmpio_f_type = PVFS2_SUPER_MAGIC;
- x = getenv( "BGLOCKLESSMPIO_F_TYPE" );
- if (x) bglocklessmpio_f_type = strtol(x,&dummy,0);
- DBG_FPRINTF(stderr,"BGLOCKLESSMPIO_F_TYPE=%ld/%#lX\n",
- bglocklessmpio_f_type,bglocklessmpio_f_type);
- /* note: this value will be 'sanity checked' in ADIOI_BG_persInfo_init(),
- * when we know a bit more about what "largest possible value" and
- * "smallest possible value" should be */
- gpfsmpio_bg_nagg_pset = ADIOI_BG_NAGG_PSET_DFLT;
- x = getenv("GPFSMPIO_NAGG_PSET");
- if (x) gpfsmpio_bg_nagg_pset = atoi(x);
-
- gpfsmpio_pthreadio = 0;
- x = getenv( "GPFSMPIO_PTHREADIO" );
- if (x) gpfsmpio_pthreadio = atoi(x);
-
- gpfsmpio_p2pcontig = 0;
- 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);
-
- gpfsmpio_devnullio = 0;
- x = getenv( "GPFSMPIO_DEVNULLIO" );
- if (x) gpfsmpio_devnullio = atoi(x);
-
- 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 */
-void ad_gpfs_timing_crw_report( int rw, ADIO_File fd, int myrank, int nprocs )
-{
- int i;
-
- if (gpfsmpio_timing) {
- /* Timing across the whole communicator is a little bit interesting,
- * but what is *more* interesting is if we single out the aggregators
- * themselves. non-aggregators spend a lot of time in "exchange" not
- * exchanging data, but blocked because they are waiting for
- * aggregators to finish writing. If we focus on just the aggregator
- * processes we will get a more clear picture about the data exchange
- * vs. i/o time breakdown */
-
- /* if deferred open enabled, we could use the aggregator communicator */
- MPI_Comm agg_comm;
- int nr_aggs, agg_rank;
- MPI_Comm_split(fd->comm, (fd->is_agg ? 1 : MPI_UNDEFINED), 0, &agg_comm);
- if(agg_comm != MPI_COMM_NULL) {
- MPI_Comm_size(agg_comm, &nr_aggs);
- MPI_Comm_rank(agg_comm, &agg_rank);
- }
-
- double *gpfsmpio_prof_org = gpfsmpio_prof_cr;
- if (rw) gpfsmpio_prof_org = gpfsmpio_prof_cw;
-
- double gpfsmpio_prof_avg[ GPFSMPIO_CIO_LAST ];
- double gpfsmpio_prof_max[ GPFSMPIO_CIO_LAST ];
-
- if( agg_comm != MPI_COMM_NULL) {
- MPI_Reduce( gpfsmpio_prof_org, gpfsmpio_prof_avg, GPFSMPIO_CIO_LAST, MPI_DOUBLE, MPI_SUM, 0, agg_comm);
- MPI_Reduce( gpfsmpio_prof_org, gpfsmpio_prof_max, GPFSMPIO_CIO_LAST, MPI_DOUBLE, MPI_MAX, 0, agg_comm);
- }
- if (agg_comm != MPI_COMM_NULL && agg_rank == 0) {
-
- for (i=0; i
-
-#ifdef HAVE_GPFS_H
-#include
-#endif
-#ifdef HAVE_GPFS_FCNTL_H
-#include
-#endif
-
-#include
-/* prototypes of functions used for collective writes only. */
-static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype
- datatype, int nprocs, int myrank, ADIOI_Access
- *others_req, ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int contig_access_count, ADIO_Offset
- min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *buf_idx, int *error_code);
-static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf,
- ADIOI_Flatlist_node *flat_buf, ADIO_Offset
- *offset_list, ADIO_Offset *len_list, int *send_size,
- int *recv_size, ADIO_Offset off, int size,
- int *count, int *start_pos, int *partial_recv,
- int *sent_to_proc, int nprocs,
- int myrank, int
- buftype_is_contig, int contig_access_count,
- ADIO_Offset min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- ADIOI_Access *others_req,
- int *send_buf_idx, int *curr_to_proc,
- int *done_to_proc, int *hole, int iter,
- MPI_Aint buftype_extent, int *buf_idx, int *error_code);
-static void ADIOI_W_Exchange_data_alltoallv(
- ADIO_File fd, const void *buf,
- char *write_buf, /* 1 */
- ADIOI_Flatlist_node *flat_buf,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int *send_size, int *recv_size,
- ADIO_Offset off, int size, /* 2 */
- int *count, int *start_pos, int *partial_recv,
- int *sent_to_proc, int nprocs, int myrank,
- int buftype_is_contig, int contig_access_count,
- ADIO_Offset min_st_offset,
- ADIO_Offset fd_size,
- ADIO_Offset *fd_start,
- ADIO_Offset *fd_end,
- ADIOI_Access *others_req,
- int *send_buf_idx, int *curr_to_proc, /* 3 */
- int *done_to_proc, int *hole, /* 4 */
- int iter, MPI_Aint buftype_extent, int *buf_idx,
- int *error_code);
-static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist_node
- *flat_buf, char **send_buf, ADIO_Offset
- *offset_list, ADIO_Offset *len_list, int *send_size,
- MPI_Request *requests, int *sent_to_proc,
- int nprocs, int myrank,
- int contig_access_count, ADIO_Offset
- min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *send_buf_idx, int *curr_to_proc,
- int *done_to_proc, int iter,
- MPI_Aint buftype_extent);
-static void ADIOI_Fill_send_buffer_nosend(ADIO_File fd, const void *buf, ADIOI_Flatlist_node
- *flat_buf, char **send_buf, ADIO_Offset
- *offset_list, ADIO_Offset *len_list, int *send_size,
- MPI_Request *requests, int *sent_to_proc,
- int nprocs, int myrank,
- int contig_access_count, ADIO_Offset
- min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *send_buf_idx, int *curr_to_proc,
- int *done_to_proc, int iter,
- MPI_Aint buftype_extent);
-static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count,
- ADIO_Offset *srt_off, int *srt_len, int *start_pos,
- int nprocs, int nprocs_recv, int total_elements);
-
-
-void ADIOI_GPFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* Uses a generalized version of the extended two-phase method described
- in "An Extended Two-Phase Method for Accessing Sections of
- Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary,
- Scientific Programming, (5)4:301--317, Winter 1996.
- http://www.mcs.anl.gov/home/thakur/ext2ph.ps */
-
- ADIOI_Access *my_req;
- /* array of nprocs access structures, one for each other process in
- whose file domain this process's request lies */
-
- ADIOI_Access *others_req;
- /* array of nprocs access structures, one for each other process
- whose request lies in this process's file domain. */
-
- int i, filetype_is_contig, nprocs, nprocs_for_coll, myrank;
- int contig_access_count=0, interleave_count = 0, buftype_is_contig;
- int *count_my_req_per_proc, count_my_req_procs, count_others_req_procs;
- ADIO_Offset orig_fp, start_offset, end_offset, fd_size, min_st_offset, off;
- ADIO_Offset *offset_list = NULL, *st_offsets = NULL, *fd_start = NULL,
- *fd_end = NULL, *end_offsets = NULL;
- ADIO_Offset *gpfs_offsets0 = NULL, *gpfs_offsets = NULL;
- ADIO_Offset *count_sizes;
- int ii;
-
- int *buf_idx = NULL;
- ADIO_Offset *len_list = NULL;
- GPFSMPIO_T_CIO_RESET( w )
-#ifdef PROFILE
- MPE_Log_event(13, 0, "start computation");
-#endif
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
-/* the number of processes that actually perform I/O, nprocs_for_coll,
- * is stored in the hints off the ADIO_File structure
- */
- nprocs_for_coll = fd->hints->cb_nodes;
- orig_fp = fd->fp_ind;
-
- GPFSMPIO_T_CIO_SET_GET( w, 1, 0, GPFSMPIO_CIO_T_MPIO_CRW, GPFSMPIO_CIO_LAST)
- GPFSMPIO_T_CIO_SET_GET( w, 1, 0, GPFSMPIO_CIO_T_LCOMP, GPFSMPIO_CIO_LAST )
-
-
- /* only check for interleaving if cb_write isn't disabled */
- if (fd->hints->cb_write != ADIOI_HINT_DISABLE) {
- /* For this process's request, calculate the list of offsets and
- lengths in the file and determine the start and end offsets. */
-
- /* Note: end_offset points to the last byte-offset that will be accessed.
- e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/
-
- ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset,
- &offset_list, &len_list, &start_offset,
- &end_offset, &contig_access_count);
-
- GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_GATHER, GPFSMPIO_CIO_T_LCOMP )
-
- /* each process communicates its start and end offsets to other
- processes. The result is an array each of start and end offsets 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_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- count_sizes = (ADIO_Offset *) ADIOI_Malloc(nprocs*sizeof(ADIO_Offset));
- MPI_Count buftype_size;
- MPI_Type_size_x(datatype, &buftype_size);
- my_count_size = (ADIO_Offset) count * (ADIO_Offset)buftype_size;
- }
- if (gpfsmpio_tunegather) {
- if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- gpfs_offsets0 = (ADIO_Offset *) ADIOI_Malloc(3*nprocs*sizeof(ADIO_Offset));
- gpfs_offsets = (ADIO_Offset *) ADIOI_Malloc(3*nprocs*sizeof(ADIO_Offset));
- for (ii=0; iicomm );
- for (ii=0; iicomm );
-
- for (ii=0; iicomm);
- MPI_Allgather(&end_offset, 1, ADIO_OFFSET, end_offsets, 1,
- ADIO_OFFSET, fd->comm);
- if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- MPI_Allgather(&count_sizes, 1, ADIO_OFFSET, count_sizes, 1,
- ADIO_OFFSET, fd->comm);
- }
- }
-
- GPFSMPIO_T_CIO_SET_GET(w, 1, 1, GPFSMPIO_CIO_T_PATANA, GPFSMPIO_CIO_T_GATHER )
-
- /* are the accesses of different processes interleaved? */
- for (i=1; ihints->cb_write == ADIOI_HINT_DISABLE ||
- (!interleave_count && (fd->hints->cb_write == ADIOI_HINT_AUTO)))
- {
- /* use independent accesses */
- if (fd->hints->cb_write != ADIOI_HINT_DISABLE) {
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- }
-
- fd->fp_ind = orig_fp;
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- if (buftype_is_contig && filetype_is_contig) {
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset;
- ADIO_WriteContig(fd, buf, count, datatype,
- ADIO_EXPLICIT_OFFSET,
- off, status, error_code);
- }
- else ADIO_WriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL,
- 0, status, error_code);
- }
- else ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type,
- offset, status, error_code);
-
- return;
- }
-
- GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_FD_PART, GPFSMPIO_CIO_T_PATANA )
-
-/* Divide the I/O workload among "nprocs_for_coll" processes. This is
- done by (logically) dividing the file into file domains (FDs); each
- process may directly access only its own file domain. */
-
- int currentValidDataIndex = 0;
- if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- /* Take out the 0-data offsets by shifting the indexes with data to the front
- * and keeping track of the valid data index for use as the length.
- */
- for (i=0; i 0) {
- st_offsets[currentValidDataIndex] = st_offsets[i];
- end_offsets[currentValidDataIndex] = end_offsets[i];
- currentValidDataIndex++;
- }
- }
- }
-
- if (gpfsmpio_tuneblocking) {
- if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets,
- currentValidDataIndex,
- nprocs_for_coll, &min_st_offset,
- &fd_start, &fd_end, &fd_size, fd->fs_ptr);
- }
- else {
-
- ADIOI_GPFS_Calc_file_domains(fd, st_offsets, end_offsets, nprocs,
- nprocs_for_coll, &min_st_offset,
- &fd_start, &fd_end, &fd_size, fd->fs_ptr);
- }
- }
- else {
- if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- ADIOI_Calc_file_domains(st_offsets, end_offsets, currentValidDataIndex,
- nprocs_for_coll, &min_st_offset,
- &fd_start, &fd_end,
- fd->hints->min_fdomain_size, &fd_size,
- fd->hints->striping_unit);
- }
- else {
- ADIOI_Calc_file_domains(st_offsets, end_offsets, nprocs,
- nprocs_for_coll, &min_st_offset,
- &fd_start, &fd_end,
- fd->hints->min_fdomain_size, &fd_size,
- fd->hints->striping_unit);
- }
- }
-
- GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_MYREQ, GPFSMPIO_CIO_T_FD_PART );
-
- if ((gpfsmpio_write_aggmethod == 1) || (gpfsmpio_write_aggmethod == 2)) {
- /* If the user has specified to use a one-sided aggregation method then do that at
- * this point instead of the two-phase I/O.
- */
- int holeFound = 0;
- ADIOI_OneSidedWriteAggregation(fd, offset_list, len_list, contig_access_count,
- buf, datatype, error_code, st_offsets, end_offsets,
- currentValidDataIndex, fd_start, fd_end, &holeFound);
- int anyHolesFound = 0;
- if (!gpfsmpio_onesided_no_rmw)
- MPI_Allreduce(&holeFound, &anyHolesFound, 1, MPI_INT, MPI_MAX, fd->comm);
- if (anyHolesFound == 0) {
- GPFSMPIO_T_CIO_REPORT( 1, fd, myrank, nprocs)
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- ADIOI_Free(fd_start);
- ADIOI_Free(fd_end);
- ADIOI_Free(count_sizes);
- goto fn_exit;
- }
- else {
- /* Holes are found in the data and the user has not set
- * gpfsmpio_onesided_no_rmw --- set gpfsmpio_onesided_always_rmw to 1
- * and re-call ADIOI_OneSidedWriteAggregation and if the user has
- * gpfsmpio_onesided_inform_rmw set then inform him of this condition
- * and behavior.
- */
-
- if (gpfsmpio_onesided_inform_rmw && (myrank ==0))
- FPRINTF(stderr,"Information: Holes found during one-sided "
- "write aggregation algorithm --- re-running one-sided "
- "write aggregation with GPFSMPIO_ONESIDED_ALWAYS_RMW set to 1.\n");
- gpfsmpio_onesided_always_rmw = 1;
- int prev_gpfsmpio_onesided_no_rmw = gpfsmpio_onesided_no_rmw;
- gpfsmpio_onesided_no_rmw = 1;
- ADIOI_OneSidedWriteAggregation(fd, offset_list, len_list, contig_access_count, buf, datatype, error_code, st_offsets, end_offsets, currentValidDataIndex, fd_start, fd_end, &holeFound);
- gpfsmpio_onesided_no_rmw = prev_gpfsmpio_onesided_no_rmw;
- GPFSMPIO_T_CIO_REPORT( 1, fd, myrank, nprocs)
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- ADIOI_Free(fd_start);
- ADIOI_Free(fd_end);
- ADIOI_Free(count_sizes);
- goto fn_exit;
- }
- }
- if (gpfsmpio_p2pcontig==1) {
- /* For some simple yet common(?) workloads, full-on two-phase I/O is overkill. We can establish sub-groups of processes and their aggregator, and then these sub-groups will carry out a simplified two-phase over that sub-group.
- *
- * First verify that the filetype is contig and the offsets are
- * increasing in rank order*/
- int inOrderAndNoGaps = 1;
- for (i=0;i<(nprocs-1);i++) {
- if (end_offsets[i] != (st_offsets[i+1]-1))
- inOrderAndNoGaps = 0;
- }
- if (inOrderAndNoGaps && buftype_is_contig) {
- /* if these conditions exist then execute the P2PContig code else
- * execute the original code */
- ADIOI_P2PContigWriteAggregation(fd, buf,
- error_code, st_offsets, end_offsets, fd_start, fd_end);
- /* NOTE: we are skipping the rest of two-phase in this path */
- GPFSMPIO_T_CIO_REPORT( 1, fd, myrank, nprocs)
-
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- ADIOI_Free(fd_start);
- ADIOI_Free(fd_end);
-
- goto fn_exit;
- }
- }
-
-/* calculate what portions of the access requests of this process are
- located in what file domains */
-
- 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,
- &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,
- &count_my_req_per_proc, &my_req,
- &buf_idx);
-
- GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_OTHREQ, GPFSMPIO_CIO_T_MYREQ )
-
-/* based on everyone's my_req, calculate what requests of other
- processes lie in this process's file domain.
- count_others_req_procs = number of processes whose requests lie in
- this process's file domain (including this process itself)
- count_others_req_per_proc[i] indicates how many separate contiguous
- requests of proc. i lie in this process's file domain. */
-
- if (gpfsmpio_tuneblocking)
- ADIOI_GPFS_Calc_others_req(fd, count_my_req_procs,
- count_my_req_per_proc, my_req,
- nprocs, myrank,
- &count_others_req_procs, &others_req);
- else
- ADIOI_Calc_others_req(fd, count_my_req_procs,
- count_my_req_per_proc, my_req,
- nprocs, myrank,
- &count_others_req_procs, &others_req);
-
- GPFSMPIO_T_CIO_SET_GET( w, 1, 1, GPFSMPIO_CIO_T_DEXCH, GPFSMPIO_CIO_T_OTHREQ )
-
- ADIOI_Free(count_my_req_per_proc);
- for (i=0; i < nprocs; i++) {
- if (my_req[i].count) {
- ADIOI_Free(my_req[i].offsets);
- ADIOI_Free(my_req[i].lens);
- }
- }
- ADIOI_Free(my_req);
-
-/* exchange data and write in sizes of no more than coll_bufsize. */
- ADIOI_Exch_and_write(fd, buf, datatype, nprocs, myrank,
- others_req, offset_list,
- len_list, contig_access_count, min_st_offset,
- fd_size, fd_start, fd_end, buf_idx, error_code);
-
- GPFSMPIO_T_CIO_SET_GET( w, 0, 1, GPFSMPIO_CIO_LAST, GPFSMPIO_CIO_T_DEXCH )
- GPFSMPIO_T_CIO_SET_GET( w, 0, 1, GPFSMPIO_CIO_LAST, GPFSMPIO_CIO_T_MPIO_CRW )
-
- GPFSMPIO_T_CIO_REPORT( 1, fd, myrank, nprocs)
-
-/* free all memory allocated for collective I/O */
- if (!buftype_is_contig) ADIOI_Delete_flattened(datatype);
-
- for (i=0; ifp_sys_posn = -1; /* set it to null. */
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5013, 0, NULL);
-#endif
-}
-
-static void gpfs_wr_access_start(int fd, ADIO_Offset offset, ADIO_Offset length)
-{
- int rc=0;
-#ifdef HAVE_GPFS_FCNTL_H
- struct {
- gpfsFcntlHeader_t header;
- gpfsAccessRange_t access;
- } take_locks;
-
- take_locks.header.totalLength = sizeof(take_locks);
- take_locks.header.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
- take_locks.header.fcntlReserved = 0;
-
- take_locks.access.structLen = sizeof(take_locks.access);
- take_locks.access.structType = GPFS_ACCESS_RANGE;
- take_locks.access.start = offset;
- take_locks.access.length = length;
- take_locks.access.isWrite = 1;
-
- rc = gpfs_fcntl(fd, &take_locks);
-#endif
- ADIOI_Assert(rc == 0);
-}
-
-static void gpfs_wr_access_end(int fd, ADIO_Offset offset, ADIO_Offset length)
-{
- int rc=0;
-#ifdef HAVE_GPFS_FCNTL_H
- struct {
- gpfsFcntlHeader_t header;
- gpfsFreeRange_t free;
- } free_locks;
-
-
- free_locks.header.totalLength = sizeof(free_locks);
- free_locks.header.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
- free_locks.header.fcntlReserved = 0;
-
- free_locks.free.structLen = sizeof(free_locks.free);
- free_locks.free.structType = GPFS_FREE_RANGE;
- free_locks.free.start = offset;
- free_locks.free.length = length;
-
- rc = gpfs_fcntl(fd, &free_locks);
-#endif
- ADIOI_Assert(rc == 0);
-}
-
-#ifdef BGQPLATFORM
-/* my_start, my_end: this processes file domain. coudd be -1,-1 for "no i/o"
- * fd_start, fd_end: arrays of length fd->hints->cb_nodes specifying all file domains */
-static int gpfs_find_access_for_ion(ADIO_File fd,
- ADIO_Offset my_start, ADIO_Offset my_end,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- ADIO_Offset *start, ADIO_Offset *end)
-{
- int my_ionode = BGQ_IO_node_id();
- int *rank_to_ionode;
- int i, nprocs, rank;
- ADIO_Offset group_start=LLONG_MAX, group_end=0;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &rank);
-
- rank_to_ionode = ADIOI_Calloc(nprocs, sizeof(int));
- MPI_Allgather(&my_ionode, 1, MPI_INT, rank_to_ionode, 1, MPI_INT, fd->comm);
-
- /* rank_to_ionode now contains a mapping from MPI rank to IO node */
- /* fd->hints->ranklist[] contains a list of MPI ranks that are aggregators */
- /* fd_start[] and fd_end[] contain a list of file domains. */
-
- /* what we really want to do is take all the file domains associated
- * with a given i/o node and find the begin/end of that range.
- *
- * Because gpfs_fcntl hints are expected to be released, we'll pass this
- * start/end back to the caller, who will both declare and free this range
- */
- if (my_start == -1 || my_end == -1) {
- ADIOI_Free(rank_to_ionode);
- return 0; /* no work to do */
- }
-
- for (i=0; ihints->cb_nodes; i++ ){
- if (my_ionode == rank_to_ionode[fd->hints->ranklist[i]] ) {
- group_start = ADIOI_MIN(fd_start[i], group_start);
- group_end = ADIOI_MAX(fd_end[i], group_end);
- }
- }
- *start = group_start;
- *end = group_end;
- ADIOI_Free(rank_to_ionode);
- return 1;
-}
-#endif // BGQPLATFORM
-
-
-/* If successful, error_code is set to MPI_SUCCESS. Otherwise an error
- * code is created and returned in error_code.
- */
-static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype
- datatype, int nprocs,
- int myrank,
- ADIOI_Access
- *others_req, ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int contig_access_count,
- ADIO_Offset min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *buf_idx, int *error_code)
-{
-/* Send data to appropriate processes and write in sizes of no more
- than coll_bufsize.
- The idea is to reduce the amount of extra memory required for
- collective I/O. If all data were written all at once, which is much
- easier, it would require temp space more than the size of user_buf,
- which is often unacceptable. For example, to write a distributed
- array to a file, where each local array is 8Mbytes, requiring
- at least another 8Mbytes of temp space is unacceptable. */
-
- /* Not convinced end_loc-st_loc couldn't be > int, so make these offsets*/
- ADIO_Offset size=0;
- int hole, i, j, m, ntimes, max_ntimes, buftype_is_contig;
- ADIO_Offset st_loc=-1, end_loc=-1, off, done, req_off;
- char *write_buf=NULL, *write_buf2=NULL;
- int *curr_offlen_ptr, *count, *send_size, req_len, *recv_size;
- int *partial_recv, *sent_to_proc, *start_pos, flag;
- int *send_buf_idx, *curr_to_proc, *done_to_proc;
- MPI_Status status;
- ADIOI_Flatlist_node *flat_buf=NULL;
- MPI_Aint buftype_extent, buftype_lb;
- int info_flag, coll_bufsize;
- char *value;
- static char myname[] = "ADIOI_EXCH_AND_WRITE";
- pthread_t io_thread;
- void *thread_ret;
- ADIOI_IO_ThreadFuncData io_thread_args;
-
- *error_code = MPI_SUCCESS; /* changed below if error */
- /* only I/O errors are currently reported */
-
-/* calculate the number of writes of size coll_bufsize
- to be done by each process and the max among all processes.
- That gives the no. of communication phases as well. */
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value,
- &info_flag);
- coll_bufsize = atoi(value);
- ADIOI_Free(value);
-
- if (gpfsmpio_pthreadio == 1){
- /* ROMIO will spawn an additional thread. both threads use separate
- * halves of the collective buffer*/
- coll_bufsize = coll_bufsize/2;
- }
-
- for (i=0; i < nprocs; i++) {
- if (others_req[i].count) {
- st_loc = others_req[i].offsets[0];
- end_loc = others_req[i].offsets[0];
- break;
- }
- }
-
- for (i=0; i < nprocs; i++)
- for (j=0; j < others_req[i].count; j++) {
- st_loc = ADIOI_MIN(st_loc, others_req[i].offsets[j]);
- end_loc = ADIOI_MAX(end_loc, (others_req[i].offsets[j]
- + others_req[i].lens[j] - 1));
- }
-
-/* ntimes=ceiling_div(end_loc - st_loc + 1, coll_bufsize)*/
-
- ntimes = (int) ((end_loc - st_loc + coll_bufsize)/coll_bufsize);
-
- if ((st_loc==-1) && (end_loc==-1)) {
- ntimes = 0; /* this process does no writing. */
- }
- if (ntimes > 0) { /* only set the gpfs hint if we have io - ie this rank is
- an aggregator -- otherwise will fail for deferred open */
- if (getenv("ROMIO_GPFS_DECLARE_ACCESS")!=NULL) {
- gpfs_wr_access_start(fd->fd_sys, st_loc, end_loc - st_loc);
- }
- }
-
- ADIO_Offset st_loc_ion=0, end_loc_ion=0, needs_gpfs_access_cleanup=0;
-#ifdef BGQPLATFORM
- if (ntimes > 0) { /* only set the gpfs hint if we have io - ie this rank is
- an aggregator -- otherwise will fail for deferred open */
-
- if (getenv("ROMIO_GPFS_DECLARE_ION_ACCESS")!=NULL) {
- if (gpfs_find_access_for_ion(fd, st_loc, end_loc, fd_start, fd_end,
- &st_loc_ion, &end_loc_ion)) {
- gpfs_wr_access_start(fd->fd_sys, st_loc_ion, end_loc_ion-st_loc_ion);
- needs_gpfs_access_cleanup=1;
- }
- }
- }
-#endif
-
- MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX,
- fd->comm);
-
- write_buf = fd->io_buf;
- if (gpfsmpio_pthreadio == 1) {
- write_buf2 = fd->io_buf + coll_bufsize;
- }
-
- curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- /* its use is explained below. calloc initializes to 0. */
-
- count = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- /* to store count of how many off-len pairs per proc are satisfied
- in an iteration. */
-
- partial_recv = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- /* if only a portion of the last off-len pair is recd. from a process
- in a particular iteration, the length recd. is stored here.
- calloc initializes to 0. */
-
- send_size = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- /* total size of data to be sent to each proc. in an iteration.
- Of size nprocs so that I can use MPI_Alltoall later. */
-
- recv_size = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- /* total size of data to be recd. from each proc. in an iteration.*/
-
- sent_to_proc = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- /* amount of data sent to each proc so far. Used in
- ADIOI_Fill_send_buffer. initialized to 0 here. */
-
- send_buf_idx = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- curr_to_proc = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- done_to_proc = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- /* Above three are used in ADIOI_Fill_send_buffer*/
-
- start_pos = (int *) ADIOI_Malloc(nprocs*sizeof(int));
- /* used to store the starting value of curr_offlen_ptr[i] in
- this iteration */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- if (!buftype_is_contig) {
- 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
- the file, which could potentially interfere with the writes taking
- place in this collective write call. Since this is not likely to be
- common, let me do the simplest thing possible here: Each process
- completes all pending nonblocking operations before completing. */
-
- /*ADIOI_Complete_async(error_code);
- if (*error_code != MPI_SUCCESS) return;
- MPI_Barrier(fd->comm);
- */
-
- done = 0;
- off = st_loc;
-
- if(gpfsmpio_pthreadio == 1)
- io_thread = pthread_self();
-
-#ifdef PROFILE
- MPE_Log_event(14, 0, "end computation");
-#endif
-
- for (m=0; m < ntimes; m++) {
- /* go through all others_req and check which will be satisfied
- by the current write */
-
- /* Note that MPI guarantees that displacements in filetypes are in
- monotonically nondecreasing order and that, for writes, the
- filetypes cannot specify overlapping regions in the file. This
- simplifies implementation a bit compared to reads. */
-
- /* off = start offset in the file for the data to be written in
- this iteration
- size = size of data written (bytes) corresponding to off
- req_off = off in file for a particular contiguous request
- minus what was satisfied in previous iteration
- req_size = size corresponding to req_off */
-
- /* first calculate what should be communicated */
-
-#ifdef PROFILE
- MPE_Log_event(13, 0, "start computation");
-#endif
- for (i=0; i < nprocs; i++) count[i] = recv_size[i] = 0;
-
- size = ADIOI_MIN((unsigned)coll_bufsize, end_loc-st_loc+1-done);
-
- for (i=0; i < nprocs; i++) {
- if (others_req[i].count) {
- start_pos[i] = curr_offlen_ptr[i];
- for (j=curr_offlen_ptr[i]; jfd_sys, st_loc, end_loc-st_loc);
- }
-
- if (needs_gpfs_access_cleanup) {
- gpfs_wr_access_end(fd->fd_sys, st_loc_ion, end_loc_ion-st_loc_ion);
- needs_gpfs_access_cleanup=0;
- }
-
- unsetenv("LIBIOLOG_EXTRA_INFO");
-}
-
-
-/* Sets error_code to MPI_SUCCESS if successful, or creates an error code
- * in the case of error.
- */
-static void ADIOI_W_Exchange_data(ADIO_File fd, const void *buf, char *write_buf,
- ADIOI_Flatlist_node *flat_buf, ADIO_Offset
- *offset_list, ADIO_Offset *len_list, int *send_size,
- int *recv_size, ADIO_Offset off, int size,
- int *count, int *start_pos,
- int *partial_recv,
- int *sent_to_proc, int nprocs,
- int myrank, int
- buftype_is_contig, int contig_access_count,
- ADIO_Offset min_st_offset,
- ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- ADIOI_Access *others_req,
- int *send_buf_idx, int *curr_to_proc,
- int *done_to_proc, int *hole, int iter,
- MPI_Aint buftype_extent, int *buf_idx,
- int *error_code)
-{
- int i, j, k, *tmp_len, nprocs_recv, nprocs_send, err;
- char **send_buf = NULL;
- MPI_Request *requests, *send_req;
- MPI_Datatype *recv_types;
- MPI_Status *statuses, status;
- int *srt_len, sum;
- ADIO_Offset *srt_off;
- static char myname[] = "ADIOI_W_EXCHANGE_DATA";
-
-/* exchange recv_size info so that each process knows how much to
- send to whom. */
-
- MPI_Alltoall(recv_size, 1, MPI_INT, send_size, 1, MPI_INT, fd->comm);
-
- /* create derived datatypes for recv */
-
- nprocs_recv = 0;
- for (i=0; i srt_len[0]) srt_len[0] = new_len;
- }
- else
- break;
- }
- if (i < sum || size != srt_len[0]) /* hole in middle or end */
- *hole = 1;
- }
-
- ADIOI_Free(srt_off);
- ADIOI_Free(srt_len);
-
- if (nprocs_recv) {
- if (*hole) {
- const char * stuff = "data-sieve-in-two-phase";
- setenv("LIBIOLOG_EXTRA_INFO", stuff, 1);
- ADIO_ReadContig(fd, write_buf, size, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET, off, &status, &err);
- /* --BEGIN ERROR HANDLING-- */
- if (err != MPI_SUCCESS) {
- *error_code = MPIO_Err_create_code(err,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO,
- "**ioRMWrdwr", 0);
- return;
- }
- /* --END ERROR HANDLING-- */
- unsetenv("LIBIOLOG_EXTRA_INFO");
- }
- }
-
- nprocs_send = 0;
- for (i=0; i < nprocs; i++) if (send_size[i]) nprocs_send++;
-
- if (fd->atomicity) {
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- requests = (MPI_Request *)
- ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request));
- send_req = requests;
- }
- else {
- requests = (MPI_Request *)
- ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request));
- /* +1 to avoid a 0-size malloc */
-
- /* post receives */
- j = 0;
- for (i=0; icomm, requests+j);
- j++;
- }
- }
- send_req = requests + nprocs_recv;
- }
-
-/* post sends. if buftype_is_contig, data can be directly sent from
- user buf at location given by buf_idx. else use send_buf. */
-
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5032, 0, NULL);
-#endif
- if (buftype_is_contig) {
- j = 0;
- for (i=0; i < nprocs; i++)
- if (send_size[i]) {
- MPI_Isend(((char *) buf) + buf_idx[i], send_size[i],
- MPI_BYTE, i, myrank+i+100*iter, fd->comm,
- send_req+j);
- j++;
- buf_idx[i] += send_size[i];
- }
- }
- else if (nprocs_send) {
- /* buftype is not contig */
- send_buf = (char **) ADIOI_Malloc(nprocs*sizeof(char*));
- for (i=0; i < nprocs; i++)
- if (send_size[i])
- send_buf[i] = (char *) ADIOI_Malloc(send_size[i]);
-
- ADIOI_Fill_send_buffer(fd, buf, flat_buf, send_buf,
- offset_list, len_list, send_size,
- send_req,
- sent_to_proc, nprocs, myrank,
- contig_access_count,
- min_st_offset, fd_size, fd_start, fd_end,
- send_buf_idx, curr_to_proc, done_to_proc, iter,
- buftype_extent);
- /* the send is done in ADIOI_Fill_send_buffer */
- }
-
- if (fd->atomicity) {
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- j = 0;
- for (i=0; icomm, &wkl_status);
- j++;
- }
- }
- }
-
- for (i=0; iatomicity) {
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+1) * \
- sizeof(MPI_Status));
- /* +1 to avoid a 0-size malloc */
- }
- else {
- statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send+nprocs_recv+1) * \
- sizeof(MPI_Status));
- /* +1 to avoid a 0-size malloc */
- }
-
-#ifdef NEEDS_MPI_TEST
- i = 0;
- if (fd->atomicity) {
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- while (!i) MPI_Testall(nprocs_send, send_req, &i, statuses);
- }
- else {
- while (!i) MPI_Testall(nprocs_send+nprocs_recv, requests, &i, statuses);
- }
-#else
- if (fd->atomicity)
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- MPI_Waitall(nprocs_send, send_req, statuses);
- else
- MPI_Waitall(nprocs_send+nprocs_recv, requests, statuses);
-#endif
-
-#ifdef AGGREGATION_PROFILE
- MPE_Log_event (5033, 0, NULL);
-#endif
- ADIOI_Free(statuses);
- ADIOI_Free(requests);
- if (!buftype_is_contig && nprocs_send) {
- for (i=0; i < nprocs; i++)
- if (send_size[i]) ADIOI_Free(send_buf[i]);
- ADIOI_Free(send_buf);
- }
-}
-
-
-#define ADIOI_BUF_INCR \
-{ \
- while (buf_incr) { \
- size_in_buf = ADIOI_MIN(buf_incr, flat_buf_sz); \
- user_buf_idx += size_in_buf; \
- flat_buf_sz -= size_in_buf; \
- if (!flat_buf_sz) { \
- if (flat_buf_idx < (flat_buf->count - 1)) flat_buf_idx++; \
- else { \
- flat_buf_idx = 0; \
- n_buftypes++; \
- } \
- user_buf_idx = flat_buf->indices[flat_buf_idx] + \
- (ADIO_Offset)n_buftypes*(ADIO_Offset)buftype_extent; \
- flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \
- } \
- buf_incr -= size_in_buf; \
- } \
-}
-
-
-#define ADIOI_BUF_COPY \
-{ \
- while (size) { \
- size_in_buf = ADIOI_MIN(size, flat_buf_sz); \
- 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); \
- send_buf_idx[p] += size_in_buf; \
- user_buf_idx += size_in_buf; \
- flat_buf_sz -= size_in_buf; \
- if (!flat_buf_sz) { \
- if (flat_buf_idx < (flat_buf->count - 1)) flat_buf_idx++; \
- else { \
- flat_buf_idx = 0; \
- n_buftypes++; \
- } \
- user_buf_idx = flat_buf->indices[flat_buf_idx] + \
- (ADIO_Offset)n_buftypes*(ADIO_Offset)buftype_extent; \
- flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \
- } \
- size -= size_in_buf; \
- buf_incr -= size_in_buf; \
- } \
- ADIOI_BUF_INCR \
-}
-
-static void ADIOI_Fill_send_buffer(ADIO_File fd, const void *buf, ADIOI_Flatlist_node
- *flat_buf, char **send_buf, ADIO_Offset
- *offset_list, ADIO_Offset *len_list, int *send_size,
- MPI_Request *requests, int *sent_to_proc,
- int nprocs, int myrank,
- int contig_access_count,
- ADIO_Offset min_st_offset, ADIO_Offset fd_size,
- ADIO_Offset *fd_start, ADIO_Offset *fd_end,
- int *send_buf_idx, int *curr_to_proc,
- int *done_to_proc, int iter,
- MPI_Aint buftype_extent)
-{
-/* this function is only called if buftype is not contig */
-
- int i, p, flat_buf_idx;
- ADIO_Offset flat_buf_sz, size_in_buf, buf_incr, size;
- int jj, n_buftypes;
- ADIO_Offset off, len, rem_len, user_buf_idx;
-
-/* curr_to_proc[p] = amount of data sent to proc. p that has already
- been accounted for so far
- done_to_proc[p] = amount of data already sent to proc. p in
- previous iterations
- user_buf_idx = current location in user buffer
- send_buf_idx[p] = current location in send_buf of proc. p */
-
- for (i=0; i < nprocs; i++) {
- send_buf_idx[i] = curr_to_proc[i] = 0;
- done_to_proc[i] = sent_to_proc[i];
- }
- jj = 0;
-
- user_buf_idx = flat_buf->indices[0];
- flat_buf_idx = 0;
- n_buftypes = 0;
- flat_buf_sz = flat_buf->blocklens[0];
-
- /* flat_buf_idx = current index into flattened buftype
- flat_buf_sz = size of current contiguous component in
- flattened buf */
-
- for (i=0; i done_to_proc[p]) {
- if (done_to_proc[p] > curr_to_proc[p]) {
- size = ADIOI_MIN(curr_to_proc[p] + len -
- done_to_proc[p], send_size[p]-send_buf_idx[p]);
- buf_incr = done_to_proc[p] - curr_to_proc[p];
- ADIOI_BUF_INCR
- ADIOI_Assert((curr_to_proc[p] + len - done_to_proc[p]) == (unsigned)(curr_to_proc[p] + len - done_to_proc[p]));
- buf_incr = curr_to_proc[p] + len - done_to_proc[p];
- ADIOI_Assert((done_to_proc[p] + size) == (unsigned)(done_to_proc[p] + size));
- curr_to_proc[p] = done_to_proc[p] + size;
- ADIOI_BUF_COPY
- }
- else {
- size = ADIOI_MIN(len,send_size[p]-send_buf_idx[p]);
- buf_incr = len;
- ADIOI_Assert((curr_to_proc[p] + size) == (unsigned)((ADIO_Offset)curr_to_proc[p] + size));
- curr_to_proc[p] += size;
- ADIOI_BUF_COPY
- }
- if (send_buf_idx[p] == send_size[p]) {
- MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p,
- myrank+p+100*iter, fd->comm, requests+jj);
- jj++;
- }
- }
- else {
- ADIOI_Assert((curr_to_proc[p] + len) == (unsigned)((ADIO_Offset)curr_to_proc[p] + len));
- curr_to_proc[p] += len;
- buf_incr = len;
- ADIOI_BUF_INCR
- }
- }
- else {
- buf_incr = len;
- ADIOI_BUF_INCR
- }
- off += len;
- rem_len -= len;
- }
- }
- for (i=0; i < nprocs; i++)
- if (send_size[i]) sent_to_proc[i] = curr_to_proc[i];
-}
-
-
-
-static void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count,
- ADIO_Offset *srt_off, int *srt_len, int *start_pos,
- int nprocs, int nprocs_recv, int total_elements)
-{
- typedef struct {
- ADIO_Offset *off_list;
- ADIO_Offset *len_list;
- int nelem;
- } heap_struct;
-
- heap_struct *a, tmp;
- int i, j, heapsize, l, r, k, smallest;
-
- a = (heap_struct *) ADIOI_Malloc((nprocs_recv+1)*sizeof(heap_struct));
-
- j = 0;
- for (i=0; i=0; i--) {
- /* Heapify(a, i, heapsize); Algorithm from Cormen et al. pg. 143
- modified for a heap with smallest element at root. I have
- removed the recursion so that there are no function calls.
- Function calls are too expensive. */
- k = i;
- while (1) {
- l = 2*(k+1) - 1;
- r = 2*(k+1);
-
- if ((l < heapsize) &&
- (*(a[l].off_list) < *(a[k].off_list)))
- smallest = l;
- else smallest = k;
-
- if ((r < heapsize) &&
- (*(a[r].off_list) < *(a[smallest].off_list)))
- smallest = r;
-
- if (smallest != k) {
- tmp.off_list = a[k].off_list;
- tmp.len_list = a[k].len_list;
- tmp.nelem = a[k].nelem;
-
- a[k].off_list = a[smallest].off_list;
- a[k].len_list = a[smallest].len_list;
- a[k].nelem = a[smallest].nelem;
-
- a[smallest].off_list = tmp.off_list;
- a[smallest].len_list = tmp.len_list;
- a[smallest].nelem = tmp.nelem;
-
- k = smallest;
- }
- else break;
- }
- }
-
- for (i=0; icomm);
-
- gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_RECV_EXCH] += MPI_Wtime() - io_time;
- io_time = MPI_Wtime();
-
- nprocs_recv = 0;
- for (i=0; icomm );
-
- ADIOI_Free( all_send_buf );
- ADIOI_Free(sdispls);
-
- gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_NET] += MPI_Wtime() - io_time;
- io_time = MPI_Wtime();
- /* data sieving pre-read */
- /* To avoid a read-modify-write, check if there are holes in the
- data to be written. For this, merge the (sorted) offset lists
- others_req using a heap-merge. */
-
- sum = 0;
- for (i=0; i off) ||
- ((srt_off[sum-1] + srt_len[sum-1]) < (off + size)))
- {
- *hole = 1;
- }
- else /* See if there are holes between the requests, if there are more than one */
- for (i=0; iindices[0];
- flat_buf_idx = 0;
- n_buftypes = 0;
- flat_buf_sz = flat_buf->blocklens[0];
-
- /* flat_buf_idx = current index into flattened buftype
- flat_buf_sz = size of current contiguous component in
- flattened buf */
-
- for (i=0; i done_to_proc[p]) {
- if (done_to_proc[p] > curr_to_proc[p]) {
- size = ADIOI_MIN(curr_to_proc[p] + len -
- done_to_proc[p], send_size[p]-send_buf_idx[p]);
- buf_incr = done_to_proc[p] - curr_to_proc[p];
- ADIOI_BUF_INCR
- ADIOI_Assert((curr_to_proc[p] + len - done_to_proc[p]) == (unsigned)(curr_to_proc[p] + len - done_to_proc[p]));
- buf_incr = curr_to_proc[p] + len - done_to_proc[p];
- ADIOI_Assert((done_to_proc[p] + size) == (unsigned)(done_to_proc[p] + size));
- curr_to_proc[p] = done_to_proc[p] + size;
- ADIOI_BUF_COPY
- }
- else {
- size = ADIOI_MIN(len,send_size[p]-send_buf_idx[p]);
- buf_incr = len;
- ADIOI_Assert((curr_to_proc[p] + size) == (unsigned)((ADIO_Offset)curr_to_proc[p] + size));
- curr_to_proc[p] += size;
- ADIOI_BUF_COPY
- }
- /* moved to alltoallv */
- /*
- if (send_buf_idx[p] == send_size[p]) {
- MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p,
- myrank+p+100*iter, fd->comm, requests+jj);
- jj++;
- }
- */
- }
- else {
- ADIOI_Assert((curr_to_proc[p] + len) == (unsigned)((ADIO_Offset)curr_to_proc[p] + len));
- curr_to_proc[p] += (int)len;
- buf_incr = len;
- ADIOI_BUF_INCR
- }
- }
- else {
- buf_incr = len;
- ADIOI_BUF_INCR
- }
- off += len;
- rem_len -= len;
- }
- }
- for (i=0; i < nprocs; i++)
- if (send_size[i]) sent_to_proc[i] = curr_to_proc[i];
-}
diff --git a/3rd-party/romio321/adio/ad_gpfs/bg/Makefile.mk b/3rd-party/romio321/adio/ad_gpfs/bg/Makefile.mk
deleted file mode 100644
index 1d957ef8f6f..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/bg/Makefile.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2012 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_BG
-
-noinst_HEADERS += \
- adio/ad_gpfs/bg/ad_bg_aggrs.h \
- adio/ad_gpfs/bg/ad_bg_pset.h
-
-romio_other_sources += \
- adio/ad_gpfs/bg/ad_bg_aggrs.c \
- adio/ad_gpfs/bg/ad_bg_pset.c
-
-endif BUILD_AD_BG
diff --git a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_aggrs.c b/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_aggrs.c
deleted file mode 100644
index f81e460fe94..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_aggrs.c
+++ /dev/null
@@ -1,682 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_bg_aggrs.c
- * \brief The externally used function from this file is is declared in ad_bg_aggrs.h
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997-2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-/*#define TRACE_ON */
-
-// Uncomment this line to turn tracing on for the gpfsmpio_balancecontig aggr selection optimization
-// #define balancecontigtrace 1
-// #define bridgeringaggtrace 1
-
-#include "adio.h"
-#include "adio_cb_config_list.h"
-#include "../ad_gpfs.h"
-#include "ad_bg_pset.h"
-#include "ad_bg_aggrs.h"
-#ifdef AGGREGATION_PROFILE
-#include "mpe.h"
-#endif
-
-
-#ifdef USE_DBG_LOGGING
- #define AGG_DEBUG 1
-#endif
-
-#ifndef TRACE_ERR
-# define TRACE_ERR(format...)
-#endif
-
-/* Comments copied from common:
- * This file contains four functions:
- *
- * ADIOI_Calc_aggregator()
- * ADIOI_Calc_file_domains()
- * ADIOI_Calc_my_req()
- * ADIOI_Calc_others_req()
- *
- * 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.
- */
-
-/* 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
- * 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
- * number of processors in the collective I/O communicator
- * ADIO_Offset min_st_offset
- * ADIO_Offset fd_start[0..nprocs_for_coll-1]
- * 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
- * uneven distributions
- */
-
-/* forward declaration */
-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 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
- * ADIO can work more efficiently.
- */
-int
-ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset)
-{
- int r, s;
- ADIOI_BG_ProcInfo_t *procInfo, *all_procInfo;
- ADIOI_BG_ConfInfo_t *confInfo;
- TRACE_ERR("Entering ADIOI_BG_gen_agg_ranklist\n");
-
- MPI_Comm_size( fd->comm, &s );
- MPI_Comm_rank( fd->comm, &r );
-
- /* Collect individual BG personality information */
- confInfo = ADIOI_BG_ConfInfo_new ();
- procInfo = ADIOI_BG_ProcInfo_new ();
- ADIOI_BG_persInfo_init( confInfo, procInfo, s, r, n_aggrs_per_pset, fd->comm);
-
- /* Gather BG personality infomation onto process 0 */
- /* 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,
- fd->comm );
-
- /* Compute a list of the ranks of chosen IO proxy CN on process 0 */
- if (r == 0) {
- ADIOI_BG_compute_agg_ranklist_serial (fd, confInfo, all_procInfo);
- /* ADIOI_BG_ProcInfo_free (all_procInfo);*/
- }
- ADIOI_BG_ProcInfo_free (all_procInfo);
-
- /* Send the info of IO proxy CN to all processes and keep the info in fd->hints struct.
- Declared in adio_cb_config_list.h */
- ADIOI_cb_bcast_rank_map(fd);
- if (gpfsmpio_balancecontig == 1) { /* additionally need to send bridgelist,
- bridgelistnum and numbridges to all
- ranks */
- if (r != 0) {
- fd->hints->fs_hints.bg.bridgelist =
- ADIOI_Malloc(fd->hints->cb_nodes*sizeof(int));
- if (fd->hints->fs_hints.bg.bridgelist == NULL) {
- /* NEED TO HANDLE ENOMEM */
- }
- }
- MPI_Bcast(fd->hints->fs_hints.bg.bridgelist, fd->hints->cb_nodes, MPI_INT, 0,
- fd->comm);
-
- if (r != 0) {
- fd->hints->fs_hints.bg.bridgelistnum =
- ADIOI_Malloc(fd->hints->cb_nodes*sizeof(int));
- if (fd->hints->fs_hints.bg.bridgelistnum == NULL) {
- /* NEED TO HANDLE ENOMEM */
- }
- }
- MPI_Bcast(fd->hints->fs_hints.bg.bridgelistnum, fd->hints->cb_nodes,
- MPI_INT, 0, fd->comm);
-
- MPI_Bcast(&fd->hints->fs_hints.bg.numbridges, 1, MPI_INT, 0,
- fd->comm);
-
- }
-
-
- ADIOI_BG_persInfo_free( confInfo, procInfo );
- TRACE_ERR("Leaving ADIOI_BG_gen_agg_ranklist\n");
- return 0;
-}
-
-
-/* There are some number of bridge nodes (randomly) distributed through the job
- * We need to split the nodes among the bridge nodes */
-/* 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.
- */
-typedef struct
-{
- int rank;
- int bridge;
-} sortstruct;
-
-typedef struct
-{
- int bridgeRank;
- int numAggsAssigned;
-} bridgeAggAssignment;
-
-static int intsort(const void *p1, const void *p2)
-{
- sortstruct *i1, *i2;
- i1 = (sortstruct *)p1;
- i2 = (sortstruct *)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,
- int *tmp_ranklist)
-{
- TRACE_ERR("Entering ADIOI_BG_compute_agg_ranklist_serial_do\n");
- /* BES: This should be done in the init routines probably. */
- int i, j;
- int aggTotal;
- int *aggList;
-
- if (gpfsmpio_bridgeringagg > 0) {
-
- int numAggs = confInfo->aggRatio * confInfo->ioMinSize /*virtualPsetSize*/;
- /* the number of aggregators is (numAggs per bridgenode) */
- if(numAggs == 1)
- aggTotal = 1;
- else
- aggTotal = confInfo->numBridgeRanks * numAggs;
-
- aggList = (int *)ADIOI_Malloc(aggTotal * sizeof(int));
- if(aggTotal == 1) { /* special case when we only have one bridge node */
-
- sortstruct *bridgelist = (sortstruct *)ADIOI_Malloc(confInfo->nProcs * sizeof(sortstruct));
- for(i=0; i < confInfo->nProcs; i++)
- {
- bridgelist[i].bridge = all_procInfo[i].bridgeRank;
- 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);
-
- aggList[0] = bridgelist[0].bridge;
- ADIOI_Free(bridgelist);
-
- }
- else { // aggTotal > 1
-
- int currentAggListSize = 0;
- int numBridgesWithAggAssignments = 0;
- bridgeAggAssignment *aggAssignments = (bridgeAggAssignment *)ADIOI_Malloc(confInfo->numBridgeRanks * sizeof(bridgeAggAssignment));
-
- int partitionSize = all_procInfo[0].numNodesInPartition;
- int *nodesAssigned = (int *)ADIOI_Malloc(partitionSize * sizeof(int));
- for (i=0;inProcs;i++) {
- if (all_procInfo[i].manhattanDistanceToBridge == currentNumHops) {
- if (nodesAssigned[all_procInfo[i].nodeRank] == 0) { // node is not assigned as an agg yet
- int foundBridge = 0;
- for (j=0;(jnumBridgeRanks) {
- allAggsAssigned = 1;
- for (i=0;(i 16)
- currentNumHops = 0;
- /* If 3 rounds go by without selecting an agg abort to avoid
- infinite loop.
- */
- if (startingCurrentAggListSize == currentAggListSize)
- numIterForHopsWithNoAggs++;
- else
- numIterForHopsWithNoAggs = 0;
- ADIOI_Assert(numIterForHopsWithNoAggs <= 3);
- }
-
- ADIOI_Free(aggAssignments);
- ADIOI_Free(nodesAssigned);
-
- } // else aggTotal > 1
-
- memcpy(tmp_ranklist, aggList, aggTotal*sizeof(int));
- } // gpfsmpio_bridgeringagg > 0
-
- else { // gpfsmpio_bridgeringagg unset - default code
-
- int distance, numAggs;
-
- /* Aggregators will be midpoints between sorted MPI rank lists of who shares a given
- * bridge node */
-
- sortstruct *bridgelist = (sortstruct *)ADIOI_Malloc(confInfo->nProcs * sizeof(sortstruct));
- for(i=0; i < confInfo->nProcs; i++)
- {
- bridgelist[i].bridge = all_procInfo[i].bridgeRank;
- 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);
-
- /* In this array, we can pick an appropriate number of midpoints based on
- * our bridgenode index and the number of aggregators */
-
- numAggs = confInfo->aggRatio * confInfo->ioMinSize /*virtualPsetSize*/;
- if(numAggs == 1)
- aggTotal = 1;
- else
- /* the number of aggregators is (numAggs per bridgenode) plus each
- * bridge node is an aggregator */
- aggTotal = confInfo->numBridgeRanks * (numAggs+1);
-
- if(aggTotal>confInfo->nProcs) aggTotal=confInfo->nProcs;
-
- TRACE_ERR("numBridgeRanks: %d, aggRatio: %f numBridge: %d pset size: %d/%d numAggs: %d, aggTotal: %d\n", confInfo->numBridgeRanks, confInfo->aggRatio, confInfo->numBridgeRanks, confInfo->ioMinSize, confInfo->ioMaxSize /*virtualPsetSize*/, numAggs, aggTotal);
- aggList = (int *)ADIOI_Malloc(aggTotal * sizeof(int));
-
-
- /* For each bridge node, determine who the aggregators will be */
- /* basically, the n*distance and bridge node */
- if(aggTotal == 1) /* special case when we only have one bridge node */
- aggList[0] = bridgelist[0].bridge;
- else
- {
- int lastBridge = bridgelist[confInfo->nProcs-1].bridge;
- int nextBridge = 0, nextAggr = confInfo->numBridgeRanks;
- int psetSize = 0;
- int procIndex;
- for(procIndex=confInfo->nProcs-1; procIndex>=0; procIndex--)
- {
- TRACE_ERR("bridgelist[%d].bridge %u/rank %u\n",procIndex, bridgelist[procIndex].bridge, bridgelist[procIndex].rank);
- if(lastBridge == bridgelist[procIndex].bridge)
- {
- psetSize++;
- if(procIndex) continue;
- else procIndex--;/* procIndex == 0 */
- }
- /* Sets up a list of nodes which will act as aggregators. numAggs
- * per bridge node total. The list of aggregators is
- * bridgeNode 0
- * bridgeNode 1
- * bridgeNode ...
- * bridgeNode N
- * bridgeNode[0]aggr[0]
- * bridgeNode[0]aggr[1]...
- * bridgeNode[0]aggr[N]...
- * ...
- * bridgeNode[N]aggr[0]..
- * bridgeNode[N]aggr[N]
- */
- aggList[nextBridge]=lastBridge;
- distance = psetSize/numAggs;
- TRACE_ERR("nextBridge %u is bridge %u, distance %u, size %u\n",nextBridge, aggList[nextBridge],distance,psetSize);
- if(numAggs>1)
- {
- for(j = 0; j < numAggs; j++)
- {
- ADIOI_Assert(nextAggr 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]);
- }
- nextAggr++;
- }
- }
- if(procIndex<0) break;
- lastBridge = bridgelist[procIndex].bridge;
- psetSize = 1;
- nextBridge++;
- }
- }
-
- TRACE_ERR("memcpy(tmp_ranklist, aggList, (numAggs(%u)*confInfo->numBridgeRanks(%u)+numAggs(%u)) (%u) %u*sizeof(int))\n",numAggs,confInfo->numBridgeRanks,numAggs,(numAggs*confInfo->numBridgeRanks+numAggs),aggTotal);
- memcpy(tmp_ranklist, aggList, aggTotal*sizeof(int));
- for(i=0;ihints struct
- */
-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 size;
- int *tmp_ranklist;
-
- /* compute the ranklist of IO aggregators and put into tmp_ranklist */
- tmp_ranklist = (int *) ADIOI_Malloc (confInfo->nProcs * sizeof(int));
-
-# if AGG_DEBUG
- for (i=0; inProcs; i++) {
- DBG_FPRINTF(stderr, "\trank = %6d\n", all_procInfo[i].rank );
- }
-# endif
-
- 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, ratio: %.4f; naggs = %d\n",
- confInfo->ioMinSize ,
- confInfo->ioMaxSize ,
- confInfo->nAggrs ,
- confInfo->numBridgeRanks ,
- confInfo->nProcs ,
- confInfo->ioMaxSize /*virtualPsetSize*/ ,
- confInfo->aggRatio ,
- naggs );
-# endif
- MPI_Comm_size( fd->comm, &size );
- /* This fix is for when the bridgenode rnk is not part of the particular
- * subcomm associated with this MPI File operation. I don't know if
- * this is the best/right answer but it passes the test cases at least.
- * I don't know how common file IO in subcomms is anyway... */
- for(i=0;i size)
- {
- TRACE_ERR("Using 0 as tmp_ranklist[%d] instead of %d for comm %x\n",
- i, tmp_ranklist[i], fd->comm);
- tmp_ranklist[i] = 0;
- }
- }
-
-# if AGG_DEBUG
- for (i=0; i aggbridgerank)
- summarybridgeminionaggrank[summaryranklistbridgeindex] = aggbridgerank;
- numbridges++;
- }
-
- bridgelistnum[summaryranklistbridgeindex]++;
- }
-
- /* at this point summarybridgeminionaggrank has the agg rank of the bridge for entries,
- * need to make each entry the minimum bridge rank for the entire ion. */
- for (i=0;i summarybridgeminionaggrank[i+1]) {
- int tmpminionaggrank = summarybridgeminionaggrank[i];
- summarybridgeminionaggrank[i] = summarybridgeminionaggrank[i+1];
- summarybridgeminionaggrank[i+1] = tmpminionaggrank;
- int tmpionid = ionlist[i];
- ionlist[i] = ionlist[i+1];
- ionlist[i+1] = tmpionid;
- int tmpbridgerank = bridgelist[i];
- bridgelist[i] = bridgelist[i+1];
- bridgelist[i+1] = tmpbridgerank;
- int tmpbridgeranknum = bridgelistnum[i];
- bridgelistnum[i] = bridgelistnum[i+1];
- bridgelistnum[i+1] = tmpbridgeranknum;
- }
- }
- }
-
- // for each io node make sure bridgelist is in rank order
- int startSortIndex = -1;
- int endSortIndex = -1;
- int currentBridgeIndex = 0;
-
- while (currentBridgeIndex < numbridges) {
- int currentIonId = ionlist[currentBridgeIndex];
- startSortIndex = currentBridgeIndex;
- while (ionlist[currentBridgeIndex] == currentIonId)
- currentBridgeIndex++;
- endSortIndex = currentBridgeIndex-1;
- for (x=startSortIndex;x<=endSortIndex;x++) {
- for (i=startSortIndex;i bridgelist[i+1]) {
- int tmpbridgerank = bridgelist[i];
- bridgelist[i] = bridgelist[i+1];
- bridgelist[i+1] = tmpbridgerank;
- int tmpbridgeranknum = bridgelistnum[i];
- bridgelistnum[i] = bridgelistnum[i+1];
- bridgelistnum[i+1] = tmpbridgeranknum;
- }
- }
- }
- }
-
-
- /* populate interleavedbridgeranklist - essentially the agg rank list
- * is now sorted by the ion minimum bridge rank and bridge node */
- int currentrankoffset = 0;
- for (i=0;i thisBridgeAggList[n+1]) {
- int tmpthisBridgeAggList = thisBridgeAggList[n];
- thisBridgeAggList[n] = thisBridgeAggList[n+1];
- thisBridgeAggList[n+1] = tmpthisBridgeAggList;
- }
- }
- }
- int n;
- for (n=0;nhints */
- if(fd->hints->ranklist != NULL)
- ADIOI_Free (fd->hints->ranklist);
- if(fd->hints->fs_hints.bg.bridgelist != NULL)
- ADIOI_Free (fd->hints->fs_hints.bg.bridgelist);
- if(fd->hints->fs_hints.bg.bridgelistnum != NULL)
- ADIOI_Free (fd->hints->fs_hints.bg.bridgelistnum);
-
- fd->hints->cb_nodes = naggs;
- fd->hints->fs_hints.bg.numbridges = numbridges;
- fd->hints->ranklist = (int *) ADIOI_Malloc (naggs * sizeof(int));
- memcpy( fd->hints->ranklist, interleavedbridgeranklist, naggs*sizeof(int) );
-
- fd->hints->fs_hints.bg.bridgelist = (int *) ADIOI_Malloc (naggs * sizeof(int));
- memcpy( fd->hints->fs_hints.bg.bridgelist, bridgelist, naggs*sizeof(int) );
-
- fd->hints->fs_hints.bg.bridgelistnum = (int *) ADIOI_Malloc (naggs * sizeof(int));
- memcpy( fd->hints->fs_hints.bg.bridgelistnum, bridgelistnum, naggs*sizeof(int) );
-
- ADIOI_Free(summarybridgeminionaggrank);
- ADIOI_Free( tmp_ranklist );
- ADIOI_Free( bridgelistnum );
- ADIOI_Free( bridgelist );
- ADIOI_Free( interleavedbridgeranklist );
- ADIOI_Free(ionlist);
-
- } else {
- /* classic topology-agnostic copy of the ranklist of IO aggregators to
- * fd->hints */
- if(fd->hints->ranklist != NULL) ADIOI_Free (fd->hints->ranklist);
-
- fd->hints->cb_nodes = naggs;
- fd->hints->ranklist = (int *) ADIOI_Malloc (naggs * sizeof(int));
- memcpy( fd->hints->ranklist, tmp_ranklist, naggs*sizeof(int) );
-
- ADIOI_Free( tmp_ranklist );
- }
- TRACE_ERR("Leaving ADIOI_BG_compute_agg_ranklist_serial\n");
- return;
-}
diff --git a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_aggrs.h b/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_aggrs.h
deleted file mode 100644
index b154722850c..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_aggrs.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_bg_aggrs.h
- * \brief ???
- */
-
-/*
- *
- * Declares functions specific for the BlueGene platform within the GPFS
- * parallel I/O solution. Implements aligned file-domain partitioning
- * (7/28/2005); persistent file doamin work not implemented
- *
- */
-
-#ifndef AD_BG_AGGRS_H_
-#define AD_BG_AGGRS_H_
-
-#include "adio.h"
-#include
-
-#ifdef HAVE_GPFS_H
-#include
-#endif
-#if !defined(GPFS_SUPER_MAGIC)
- #define GPFS_SUPER_MAGIC (0x47504653)
-#endif
-
- /* generate a list of I/O aggregators that utilizes BG-PSET orginization. */
- int ADIOI_BG_gen_agg_ranklist(ADIO_File fd, int n_aggrs_per_pset);
-
-#endif /* AD_BG_AGGRS_H_ */
diff --git a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_pset.c b/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_pset.c
deleted file mode 100644
index 58b051af89a..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_pset.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_bg_pset.c
- * \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.
- * See COPYRIGHT notice in top-level directory.
- */
-
-/* #define TRACE_ON */
-// #define bridgeringaggtrace 1
-
-#include
-#include
-#include "../ad_gpfs.h"
-#include "ad_bg_pset.h"
-#include
-#include
-
-#define BGQ_TORUS_MAX_DIMS 5
-#define BGQ_FULL_TORUS_SIZE 512
-
-#ifndef TRACE_ERR
-# define TRACE_ERR(fmt...)
-#endif
-
-ADIOI_BG_ProcInfo_t *
-ADIOI_BG_ProcInfo_new()
-{
- ADIOI_BG_ProcInfo_t *p = (ADIOI_BG_ProcInfo_t *) ADIOI_Malloc (sizeof(ADIOI_BG_ProcInfo_t));
- ADIOI_Assert ((p != NULL));
- return p;
-}
-
-ADIOI_BG_ProcInfo_t *
-ADIOI_BG_ProcInfo_new_n( int n )
-{
- ADIOI_BG_ProcInfo_t *p = (ADIOI_BG_ProcInfo_t *) ADIOI_Malloc (n * sizeof(ADIOI_BG_ProcInfo_t));
- ADIOI_Assert ((p != NULL));
- return p;
-}
-
-void
-ADIOI_BG_ProcInfo_free( ADIOI_BG_ProcInfo_t *info )
-{
- if (info != NULL) ADIOI_Free (info);
-}
-
-ADIOI_BG_ConfInfo_t *
-ADIOI_BG_ConfInfo_new ()
-{
- ADIOI_BG_ConfInfo_t *p = (ADIOI_BG_ConfInfo_t *) ADIOI_Malloc (sizeof(ADIOI_BG_ConfInfo_t));
- ADIOI_Assert ((p != NULL));
- return p;
-}
-
-
-void
-ADIOI_BG_ConfInfo_free( ADIOI_BG_ConfInfo_t *info )
-{
- if (info != NULL) ADIOI_Free (info);
-}
-
-
-typedef struct
-{
- int rank;
- int bridgeCoord;
-} sortstruct;
-
-static int intsort(const void *p1, const void *p2)
-{
- sortstruct *i1, *i2;
- i1 = (sortstruct *)p1;
- i2 = (sortstruct *)p2;
- return(i1->bridgeCoord - i2->bridgeCoord);
-}
-
-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.
-*/
-static unsigned procManhattanDistance(unsigned *aggCoords, unsigned *bridgeCoords) {
-
- unsigned totalDistance = 0;
- int i;
- for (i=0;i 0) { // could torus make it closer?
- if (dimTorus[i]) {
- if (aggCoords[i] == torusSize[i]) { // is wrap-around closer
- if ((bridgeCoords[i]+1) < dimDistance) // assume will use torus link
- dimDistance = bridgeCoords[i]+1;
- }
- else if (bridgeCoords[i] == torusSize[i]) { // is wrap-around closer
- if ((aggCoords[i]+1) < dimDistance) // assume will use torus link
- dimDistance = aggCoords[i]+1;
- }
- }
- } /* else: dimDistance == 0, meaning aggCoords[i] and bridgeCoords[i] are
- the same and there's no closer point to pick */
- totalDistance += dimDistance;
- }
- return totalDistance;
-}
-
-int BGQ_IO_node_id ()
-{
- static unsigned long IO_node_id = ULONG_MAX;
-
- 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;
- int countPset;
- sortstruct *bridges;
- int commsize;
-
- 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;
-
-
- 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;
-
- if (gpfsmpio_bridgeringagg > 0) {
-#ifdef bridgeringaggtrace
- if (rank == 0)
- fprintf(stderr,"Block dimensions:\n");
-#endif
-
- /* Set the numNodesInPartition and nodeRank for this proc
- */
- 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;
- /* Set the indicator for if a dimension in the partitions is a torus or not.
- */
- dimTorus[0] = (bool) (ND_ENABLE_TORUS_DIM_A & net->NetFlags);
- dimTorus[1] = (bool) (ND_ENABLE_TORUS_DIM_B & net->NetFlags);
- dimTorus[2] = (bool) (ND_ENABLE_TORUS_DIM_C & net->NetFlags);
- dimTorus[3] = (bool) (ND_ENABLE_TORUS_DIM_D & net->NetFlags);
- dimTorus[4] = (bool) (ND_ENABLE_TORUS_DIM_E & net->NetFlags);
- for (i=0;inodeRank += (hwCoordsArray[i] * baseNum);
-#ifdef bridgeringaggtrace
- if (rank == 0)
- 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 = BGQ_IO_node_id ();
-
- if(size == 1)
- {
- proc->iamBridge = 1;
- proc->bridgeRank = rank;
- if (gpfsmpio_bridgeringagg > 0) {
- proc->manhattanDistanceToBridge = 0;
- }
-
- /* Set up the other parameters */
- proc->myIOSize = size;
- proc->ioNodeIndex = 0;
- conf->ioMinSize = size;
- conf->ioMaxSize = size;
- conf->numBridgeRanks = 1;
- conf->nProcs = size;
- conf->nAggrs = 1;
- conf->aggRatio = 1. * conf->nAggrs / conf->ioMinSize /*virtualPsetSize*/;
- if(conf->aggRatio > 1) conf->aggRatio = 1.;
- TRACE_ERR("I am (single) Bridge rank\n");
- return;
- }
-
- /* 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 |
- pers.Network_Config.cnBridge_E << 2;
- ADIOI_Assert((bridgeCoords >= 0)); /* A dim is < 6 bits or sorting won't work */
-
- 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;
- }
- }
- else { // calculate manhattan distance to bridge if gpfsmpio_bridgeringagg is set
- if (gpfsmpio_bridgeringagg > 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] = net->Bcoord;
- manhattanBridgeCoords[1] = pers.Network_Config.cnBridge_B;
- aggCoords[2] = net->Ccoord;
- manhattanBridgeCoords[2] = pers.Network_Config.cnBridge_C;
- aggCoords[3] = net->Dcoord;
- manhattanBridgeCoords[3] = pers.Network_Config.cnBridge_D;
- aggCoords[4] = net->Ecoord;
- manhattanBridgeCoords[4] = pers.Network_Config.cnBridge_E;
-
- proc->manhattanDistanceToBridge= procManhattanDistance(aggCoords, manhattanBridgeCoords);
-#ifdef bridgeringaggtrace
- fprintf(stderr,"agg coords are %u %u %u %u %u bridge coords are %u %u %u %u %u distance is %u\n",aggCoords[0],aggCoords[1],aggCoords[2],aggCoords[3],aggCoords[4],manhattanBridgeCoords[0],manhattanBridgeCoords[1],manhattanBridgeCoords[2],manhattanBridgeCoords[3],manhattanBridgeCoords[4], proc->manhattanDistanceToBridge);
-#endif
- }
- }
-
- TRACE_ERR("Bridge coords(%8.8X): %d %d %d %d %d, %d. iambridge %d\n",bridgeCoords, pers.Network_Config.cnBridge_A,pers.Network_Config.cnBridge_B,pers.Network_Config.cnBridge_C,pers.Network_Config.cnBridge_D,pers.Network_Config.cnBridge_E,0, iambridge);
-
- /* Allgather the ranks and bridgeCoords to determine the bridge
- rank and how many ranks belong to each bridge rank*/
- 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.
- */
-
- /* My input to the collective */
- bridges[rank].rank = rank;
- bridges[rank].bridgeCoord = bridgeCoords;
- if(!iambridge)
- bridges[rank].bridgeCoord |= 1; /* I am not bridge, turn on bit */
-
-
- MPI_Allgather(MPI_IN_PLACE, 2, MPI_INT, bridges, 2, MPI_INT, comm);
-
- qsort(bridges, size, sizeof(sortstruct), intsort);
-
- /* Once the list is sorted walk through it to setup bridge
- info and find bridge ranks, etc. */
-
- int tempCoords, tempRank, mincompute, maxcompute;
- tempCoords = bridges[0].bridgeCoord & ~1;
- tempRank = bridges[0].rank;
-
- countPset=1;
- bridgeIndex = 0;
- mincompute = size+1;
- maxcompute = 1;
-
- for(i=1; i maxcompute)
- maxcompute = countPset;
- if(countPset < mincompute)
- mincompute = countPset;
-
- /* Was this my bridge we finished? */
- if(tempCoords == bridgeCoords)
- {
- /* Am I the bridge rank? */
- if(tempRank == rank)
- iambridge = 1;
- 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);
- bridgerank = tempRank;
- proc->myIOSize = countPset;
- proc->ioNodeIndex = bridgeIndex;
- }
- /* Setup next bridge */
- tempCoords = bridges[i].bridgeCoord & ~1;
- tempRank = bridges[i].rank;
- bridgeIndex++;
- countPset = 1;
- }
- }
- /* Process last bridge */
-
-#ifdef TRACE_ON
- if(rank == 0)
- TRACE_ERR("Bridge set %u, bridge rank %d (%#8.8X) has %d ranks\n",
- bridgeIndex, tempRank, tempCoords, countPset);
-#endif
- if(countPset > maxcompute)
- maxcompute = countPset;
- if(countPset < mincompute)
- mincompute = countPset;
-
- /* Was this my bridge? */
- if(tempCoords == bridgeCoords)
- {
- /* Am I the bridge rank? */
- if(tempRank == rank)
- iambridge = 1;
- else
- iambridge = 0; /* Another rank on my node may have taken over */
- bridgerank = tempRank;
- proc->myIOSize = countPset;
- proc->ioNodeIndex = bridgeIndex;
- }
-
-
- 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->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;
-*/
- conf->aggRatio = 1. * conf->nAggrs / conf->ioMinSize /*virtualPsetSize*/;
-/* if(conf->aggRatio > 1) conf->aggRatio = 1.; */
- TRACE_ERR("n_aggrs %zd, conf->nProcs %zu, conf->ioMaxSize %zu, ADIOI_BG_NAGG_PSET_DFLT %zu,conf->numBridgeRanks %zu,conf->nAggrs %zu\n",(size_t)n_aggrs, (size_t)conf->nProcs, (size_t)conf->ioMaxSize, (size_t)ADIOI_BG_NAGG_PSET_DFLT,(size_t)conf->numBridgeRanks,(size_t)conf->nAggrs);
- TRACE_ERR("Maximum ranks under a bridge rank: %d, minimum: %d, nAggrs: %d, numBridgeRanks: %d pset dflt: %d naggrs: %d ratio: %f\n", maxcompute, mincompute, conf->nAggrs, conf->numBridgeRanks, ADIOI_BG_NAGG_PSET_DFLT, conf->nAggrs, conf->aggRatio);
- }
-
- ADIOI_Assert((bridgerank != -1));
- proc->bridgeRank = bridgerank;
- proc->iamBridge = iambridge;
- TRACE_ERR("Rank %d has bridge set index %d (bridge rank: %d) with %d other ranks, ioNodeIndex: %d\n", rank, proc->ioNodeIndex, bridgerank, proc->myIOSize, proc->ioNodeIndex);
-
- ADIOI_Free(bridges);
-
-}
-
-void
-ADIOI_BG_persInfo_free( ADIOI_BG_ConfInfo_t *conf, ADIOI_BG_ProcInfo_t *proc )
-{
- ADIOI_BG_ConfInfo_free( conf );
- ADIOI_BG_ProcInfo_free( proc );
-}
diff --git a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_pset.h b/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_pset.h
deleted file mode 100644
index 3f251e8275e..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/bg/ad_bg_pset.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_bg_pset.h
- * \brief ???
- */
-
-/* File: ad_bg_pset.h
- *
- * Defines two structures that keep BlueGene PSET specific information and their public interfaces:
- * . ADIOI_BG_ProcInfo_t object keeps specific information to each process
- * . ADIOI_BG_ConfInfo_t object keeps general information for the whole communicator, only kept
- * on process 0.
- */
-
-#ifndef AD_BG_PSET_H_
-#define AD_BG_PSET_H_
-
-
-/* Keeps specific information to each process, will be exchanged among processes */
-typedef struct {
- int ioNodeIndex; /* similar to psetNum on BGL/BGP */
- int rank; /* my rank */
- int ionID; /* ion id this cn is using */
-/* int myCoords[5]; */
- int bridgeRank; /* my bridge node (or proxy) rank */
- 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
- node, i.e. psetsize*/
- int iamBridge; /* am *I* the bridge rank? */
- int __ipad[2];
- unsigned nodeRank; /* torus coords converted to an integer for use with gpfsmpio_bridgeringagg */
- unsigned numNodesInPartition; /* number of physical nodes in the job partition */
- unsigned manhattanDistanceToBridge; /* number of hops between this rank and the bridge node */
-} ADIOI_BG_ProcInfo_t __attribute__((aligned(16)));
-
-/* Keeps general information for the whole communicator, only on process 0 */
-typedef struct {
- int ioMinSize; /* Smallest number of ranks shareing 1 bridge node */
- int ioMaxSize; /* Largest number of ranks sharing 1 bridge node */
- /* ioMaxSize will be the "psetsize" */
- int nAggrs;
- int numBridgeRanks;
- /*int virtualPsetSize; ppn * pset size */
- int nProcs;
- int cpuIDsize; /* num ppn */
- float aggRatio;
-
-} ADIOI_BG_ConfInfo_t __attribute__((aligned(16)));
-
-
-#undef MIN
-#define MIN(a,b) (((a)<(b) ? (a) : (b)))
-
-
-
-
-/* public funcs for ADIOI_BG_ProcInfo_t objects */
- ADIOI_BG_ProcInfo_t * ADIOI_BG_ProcInfo_new();
- ADIOI_BG_ProcInfo_t * ADIOI_BG_ProcInfo_new_n( int n );
- void ADIOI_BG_ProcInfo_free( ADIOI_BG_ProcInfo_t *info );
-
-
-/* public funcs for ADIOI_BG_ConfInfo_t objects */
- ADIOI_BG_ConfInfo_t * ADIOI_BG_ConfInfo_new ();
- void ADIOI_BG_ConfInfo_free( ADIOI_BG_ConfInfo_t *info );
-
-
-/* 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);
- void ADIOI_BG_persInfo_free( ADIOI_BG_ConfInfo_t *conf,
- ADIOI_BG_ProcInfo_t *proc );
-
-
-#endif /* AD_BG_PSET_H_ */
diff --git a/3rd-party/romio321/adio/ad_gpfs/pe/Makefile.mk b/3rd-party/romio321/adio/ad_gpfs/pe/Makefile.mk
deleted file mode 100644
index 6173bd7fe0a..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/pe/Makefile.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2012 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_PE
-
-noinst_HEADERS += \
- adio/ad_gpfs/pe/ad_pe_aggrs.h
-
-romio_other_sources += \
- adio/ad_gpfs/pe/ad_pe_aggrs.c
-
-endif BUILD_AD_PE
diff --git a/3rd-party/romio321/adio/ad_gpfs/pe/ad_pe_aggrs.c b/3rd-party/romio321/adio/ad_gpfs/pe/ad_pe_aggrs.c
deleted file mode 100644
index 8453238a833..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/pe/ad_pe_aggrs.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_pe_aggrs.c
- * \brief The externally used function from this file is is declared in ad_pe_aggrs.h
- */
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * Copyright (C) 1997-2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-/*#define TRACE_ON */
-
-#include "adio.h"
-#include "adio_cb_config_list.h"
-#include "../ad_gpfs.h"
-#include "ad_pe_aggrs.h"
-#include "mpiimpl.h"
-
-#ifdef AGGREGATION_PROFILE
-#include "mpe.h"
-#endif
-
-#ifdef USE_DBG_LOGGING
- #define AGG_DEBUG 1
-#endif
-
-#ifndef TRACE_ERR
-# define TRACE_ERR(format...)
-#endif
-
-/*
- * Compute the aggregator-related parameters that are required in 2-phase
- * collective IO of ADIO.
- * The parameters are
- * . the number of aggregators (proxies) : fd->hints->cb_nodes
- * . the ranks of the aggregators : fd->hints->ranklist
- * If MP_IONODEFILE is defined, POE determines all tasks on every node listed
- * in the node file and defines MP_IOTASKLIST with them, making them all
- * aggregators. Alternatively, the user can explictly set MP_IOTASKLIST
- * themselves. The format of the MP_IOTASKLIST is a colon-delimited list of
- * task ids, the first entry being the total number of aggregators, for example
- * to specify 4 aggregators on task ids 0,8,16,24 the value would be:
- * 4:0:8:16:24. If there is no MP_IONODEFILE, or MP_IOTASKLIST, then the
- * default aggregator selection is 1 task per node for every node of the job -
- * additionally, an environment variable MP_IOAGGR_CNT can be specified, which
- * defines the total number of aggregators, spread evenly across all the nodes.
- * The romio_cb_nodes and romio_cb_config_list hint user settings are ignored.
- */
-int
-ADIOI_PE_gen_agg_ranklist(ADIO_File fd)
-{
-
- int numAggs = 0;
- char *ioTaskList = getenv( "MP_IOTASKLIST" );
- char *ioAggrCount = getenv("MP_IOAGGR_CNT");
- int i,j;
- int inTERcommFlag = 0;
-
- int myRank,commSize;
- MPI_Comm_rank(fd->comm, &myRank);
- MPI_Comm_size(fd->comm, &commSize);
-
- MPI_Comm_test_inter(fd->comm, &inTERcommFlag);
- if (inTERcommFlag) {
- FPRINTF(stderr,"ERROR: ATTENTION: inTERcomms are not supported in MPI-IO - aborting....\n");
- perror("ADIOI_PE_gen_agg_ranklist:");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
-
- if (ioTaskList) {
- int ioTaskListLen = strlen(ioTaskList);
- int ioTaskListPos = 0;
- char tmpBuf[8]; /* Big enough for 1M tasks (7 digits task ID). */
- tmpBuf[7] = '\0';
- for (i=0; i<7; i++) {
- tmpBuf[i] = *ioTaskList++; /* Maximum is 7 digits for 1 million. */
- ioTaskListPos++;
- if (*ioTaskList == ':') { /* If the next char is a ':' ends it. */
- tmpBuf[i+1] = '\0';
- break;
- }
- }
- numAggs = atoi(tmpBuf);
- if (numAggs == 0)
- FPRINTF(stderr,"ERROR: ATTENTION: Number of aggregators specified in MP_IOTASKLIST set at 0 - default aggregator selection will be used.\n");
- else if (!((numAggs > 0 ) && (numAggs <= commSize))) {
- FPRINTF(stderr,"ERROR: ATTENTION: The number of aggregators (%s) specified in MP_IOTASKLIST is outside the communicator task range of %d.\n",tmpBuf,commSize);
- numAggs = commSize;
- }
- fd->hints->ranklist = (int *) ADIOI_Malloc (numAggs * sizeof(int));
-
- int aggIndex = 0;
- while (aggIndex < numAggs) {
- ioTaskList++; /* Advance past the ':' */
- ioTaskListPos++;
- int allDigits=1;
- for (i=0; i<7; i++) {
- if (*ioTaskList < '0' || *ioTaskList > '9')
- allDigits=0;
- tmpBuf[i] = *ioTaskList++;
- ioTaskListPos++;
- if ( (*ioTaskList == ':') || (*ioTaskList == '\0') ) {
- tmpBuf[i+1] = '\0';
- break;
- }
- }
- if (allDigits) {
- int newAggRank = atoi(tmpBuf);
- if (!((newAggRank >= 0 ) && (newAggRank < commSize))) {
- FPRINTF(stderr,"ERROR: ATTENTION: The aggregator '%s' specified in MP_IOTASKLIST is not within the communicator task range of 0 to %d - it will be ignored.\n",tmpBuf,commSize-1);
- }
- else {
- int aggAlreadyAdded = 0;
- for (i=0;ihints->ranklist[i] == newAggRank) {
- aggAlreadyAdded = 1;
- break;
- }
- if (!aggAlreadyAdded)
- fd->hints->ranklist[aggIndex++] = newAggRank;
- else
- FPRINTF(stderr,"ERROR: ATTENTION: The aggregator '%d' is specified multiple times in MP_IOTASKLIST - duplicates are ignored.\n",newAggRank);
- }
- }
- else {
- FPRINTF(stderr,"ERROR: ATTENTION: The aggregator '%s' specified in MP_IOTASKLIST is not a valid integer task id - it will be ignored.\n",tmpBuf);
- }
-
- /* At the end check whether the list is shorter than specified. */
- if (ioTaskListPos == ioTaskListLen) {
- if (aggIndex == 0) {
- FPRINTF(stderr,"ERROR: ATTENTION: No aggregators were correctly specified in MP_IOTASKLIST - default aggregator selection will be used.\n");
- ADIOI_Free(fd->hints->ranklist);
- }
- else if (aggIndex < numAggs)
- FPRINTF(stderr,"ERROR: ATTENTION: %d aggregators were specified in MP_IOTASKLIST but only %d were correctly specified - setting the number of aggregators to %d.\n",numAggs, aggIndex,aggIndex);
- numAggs = aggIndex;
- }
- }
- }
- if (numAggs == 0) {
- MPID_Comm *mpidCommData;
-
- MPID_Comm_get_ptr(fd->comm,mpidCommData);
- int localSize = mpidCommData->local_size;
-
- // get my node rank
- int myNodeRank = mpidCommData->intranode_table[mpidCommData->rank];
-
- int *allNodeRanks = (int *) ADIOI_Malloc (localSize * sizeof(int));
-
- allNodeRanks[myRank] = myNodeRank;
- MPI_Allgather(MPI_IN_PLACE, 1, MPI_INT, allNodeRanks, 1, MPI_INT, fd->comm);
-
-#ifdef AGG_DEBUG
- printf("MPID_Comm data: local_size is %d\nintranode_table entries:\n",mpidCommData->local_size);
- for (i=0;iintranode_table[i]);
- }
- printf("\ninternode_table entries:\n");
- for (i=0;iinternode_table[i]);
- }
- printf("\n");
-
- printf("\nallNodeRanks entries:\n");
- for (i=0;ihints->ranklist = (int *) ADIOI_Malloc (localSize * sizeof(int));
- for (i=0;ihints->ranklist[rankListIndex++] = i;
- numAggs++;
- }
- }
- }
- break;
- case -2:
- /* ALL tasks case */
- fd->hints->ranklist = (int *) ADIOI_Malloc (localSize * sizeof(int));
- for (i=0;ihints->ranklist[i] = i;
- numAggs++;
- }
- break;
- default:
- /* Specific aggr count case -- MUST be less than localSize, otherwise set to localSize */
- if (cntType > localSize)
- cntType = localSize;
-
- numAggs = cntType;
- // Round-robin thru allNodeRanks - pick the 0's, then the 1's, etc
- int currentNodeRank = 0; // node rank currently being selected as aggregator
- int rankListIndex = 0;
- int currentAllNodeIndex = 0;
-
- fd->hints->ranklist = (int *) ADIOI_Malloc (numAggs * sizeof(int));
-
- while (rankListIndex < numAggs) {
- int foundEntry = 0;
- while (!foundEntry && (currentAllNodeIndex < localSize)) {
- if (allNodeRanks[currentAllNodeIndex] == currentNodeRank) {
- fd->hints->ranklist[rankListIndex++] = currentAllNodeIndex;
- foundEntry = 1;
- }
- currentAllNodeIndex++;
- }
- if (!foundEntry) {
- currentNodeRank++;
- currentAllNodeIndex = 0;
- }
- } // while
- break;
- } // switch(cntType)
- } // if (ioAggrCount)
-
- else { // default is 1 aggregator per node
- // take the 0 entries from allNodeRanks
- int rankListIndex = 0;
- fd->hints->ranklist = (int *) ADIOI_Malloc (localSize * sizeof(int));
- for (i=0;ihints->ranklist[rankListIndex++] = i;
- numAggs++;
- }
- }
- }
-
- ADIOI_Free(allNodeRanks);
-
- }
-
- if ( getenv("MP_I_SHOW_AGGRS") ) {
- if (myRank == 0) {
- printf("Agg rank list of %d generated:\n", numAggs);
- for (i=0;ihints->ranklist[i]);
- }
- printf("\n");
- }
- }
-
- fd->hints->cb_nodes = numAggs;
-
- return 0;
-}
-
diff --git a/3rd-party/romio321/adio/ad_gpfs/pe/ad_pe_aggrs.h b/3rd-party/romio321/adio/ad_gpfs/pe/ad_pe_aggrs.h
deleted file mode 100644
index f779d182a5d..00000000000
--- a/3rd-party/romio321/adio/ad_gpfs/pe/ad_pe_aggrs.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* ---------------------------------------------------------------- */
-/* (C)Copyright IBM Corp. 2007, 2008 */
-/* ---------------------------------------------------------------- */
-/**
- * \file ad_pe_aggrs.h
- * \brief ???
- */
-
-/*
- *
- * Declares functions specific for the PE platform within the GPFS
- * parallel I/O solution. For now simply processes the MP_IOTASKLIST
- * env var.
- *
- */
-
-#ifndef AD_PE_AGGRS_H_
-#define AD_PE_AGGRS_H_
-
-#include "adio.h"
-#include
-
-#if !defined(GPFS_SUPER_MAGIC)
- #define GPFS_SUPER_MAGIC (0x47504653)
-#endif
-
- /* generate a list of I/O aggregators following a methodology specific for PE */
- int ADIOI_PE_gen_agg_ranklist(ADIO_File fd);
-
-#endif /* AD_PE_AGGRS_H_ */
diff --git a/3rd-party/romio321/adio/ad_gridftp/Makefile.mk b/3rd-party/romio321/adio/ad_gridftp/Makefile.mk
deleted file mode 100644
index 2cd83a2ad28..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/Makefile.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_GRIDFTP
-
-noinst_HEADERS += adio/ad_gridftp/ad_gridftp.h
-
-romio_other_sources += \
- adio/ad_gridftp/ad_gridftp_close.c \
- adio/ad_gridftp/ad_gridftp_open.c \
- adio/ad_gridftp/ad_gridftp_read.c \
- adio/ad_gridftp/ad_gridftp_write.c \
- adio/ad_gridftp/ad_gridftp_fcntl.c \
- adio/ad_gridftp/ad_gridftp_flush.c \
- adio/ad_gridftp/ad_gridftp_resize.c \
- adio/ad_gridftp/ad_gridftp_hints.c \
- adio/ad_gridftp/ad_gridftp_delete.c \
- adio/ad_gridftp/ad_gridftp.c \
- adio/ad_gridftp/globus_routines.c \
- adio/ad_gridftp/ad_gridftp_features.c
-
-endif BUILD_AD_GRIDFTP
-
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp.c
deleted file mode 100644
index f3767dcda21..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_GRIDFTP_operations = {
- ADIOI_GRIDFTP_Open, /* Open */
- ADIOI_GRIDFTP_ReadContig, /* ReadContig */
- ADIOI_GRIDFTP_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_GRIDFTP_Fcntl, /* Fcntl */
- ADIOI_GRIDFTP_SetInfo, /* SetInfo */
- ADIOI_GRIDFTP_ReadStrided, /* ReadStrided */
- ADIOI_GRIDFTP_WriteStrided, /* WriteStrided */
- ADIOI_GRIDFTP_Close, /* Close */
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
- ADIOI_FAKE_IODone, /* ReadDone */
- ADIOI_FAKE_IODone, /* WriteDone */
- ADIOI_FAKE_IOComplete, /* ReadComplete */
- ADIOI_FAKE_IOComplete, /* WriteComplete */
- ADIOI_FAKE_IreadStrided, /* IreadStrided */
- ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
- ADIOI_GRIDFTP_Flush, /* Flush */
- ADIOI_GRIDFTP_Resize, /* Resize */
- ADIOI_GRIDFTP_Delete, /* Delete */
- ADIOI_GRIDFTP_Feature, /* Features */
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp.h b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp.h
deleted file mode 100644
index 0b94c780eaa..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- 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.
- */
-
-#ifndef AD_GRIDFTP_INCLUDE
-#define AD_GRIDFTP_INCLUDE
-
-#include
-#include
-#include
-#include
-#include "adio.h"
-#include
-
-/* These live in globus_routines.c */
-extern int num_gridftp_handles;
-#ifndef ADIO_GRIDFTP_HANDLES_MAX
-#define ADIO_GRIDFTP_HANDLES_MAX 200
-#endif /* ! ADIO_GRIDFTP_HANDLES_MAX */
-extern globus_ftp_client_handle_t gridftp_fh[ADIO_GRIDFTP_HANDLES_MAX];
-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,
- 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,
- 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,
- 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,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *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);
-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);
-void ADIOI_GRIDFTP_WriteStrided(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_ReadStrided(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_WriteStridedColl(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_ReadStridedColl(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_GRIDFTP_IreadStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *error_code);
-void ADIOI_GRIDFTP_IwriteStrided(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_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,
- int *error_code);
-void ADIOI_GRIDFTP_Set_shared_fp(ADIO_File fd, ADIO_Offset offset,
- int *error_code);
-void ADIOI_GRIDFTP_Delete(char *filename, int *error_code);
-
-void globus_err_handler(const char *routine, const char *caller,
- globus_result_t result);
-
-#endif
-
-
-
-
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_close.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_close.c
deleted file mode 100644
index c1693d65ce0..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_close.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-
-void ADIOI_GRIDFTP_Close(ADIO_File fd, int *error_code)
-{
- int err;
- static char myname[]="ADIOI_GRIDFTP_Close";
-
- globus_result_t result;
-
- MPI_Barrier(fd->comm);
-
- /* Destroy the ftp handle and opattr */
- result = globus_ftp_client_operationattr_destroy(&(oattr[fd->fd_sys]));
- if (result != GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_operationattr_destroy",
- myname,result);
- *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;
- }
- result=globus_ftp_client_handle_destroy(&(gridftp_fh[fd->fd_sys]));
- if (result != GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_handle_destroy",
- myname,result);
- *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;
- }
-
- fd->fd_sys = -1;
- fd->fp_ind=0;
- fd->fp_sys_posn=0;
- num_gridftp_handles--;
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_delete.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_delete.c
deleted file mode 100644
index 54eb7144295..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_delete.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-
-static globus_mutex_t lock;
-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));
- }
- else
- {
- delete_success=GLOBUS_TRUE;
- }
- delete_done=GLOBUS_TRUE;
-}
-
-void ADIOI_GRIDFTP_Delete(char *filename, int *error_code)
-{
- char myname[]="ADIOI_GRIDFTP_Delete";
- int myrank, nprocs;
- globus_ftp_client_handle_t handle;
- globus_result_t result;
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-
- 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);
- *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;
- }
-
- delete_done=GLOBUS_FALSE;
- delete_success=GLOBUS_FALSE;
- result=globus_ftp_client_delete(&handle,filename,GLOBUS_NULL,delete_cb,GLOBUS_NULL);
- if (result != 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- globus_mutex_lock(&lock);
- while ( delete_done!=GLOBUS_TRUE )
- globus_cond_wait(&cond,&lock);
- globus_mutex_unlock(&lock);
- result=globus_ftp_client_handle_destroy(&handle);
- if (result != GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_handle_destroy",myname,result);
- *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;
- }
-
- if ( delete_success!=GLOBUS_TRUE )
- {
- *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)));
- }
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_fcntl.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_fcntl.c
deleted file mode 100644
index dd9cb5ee098..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_fcntl.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-#include "adio_extern.h"
-
-globus_mutex_t fcntl_size_lock;
-globus_cond_t fcntl_size_cond;
-globus_bool_t fcntl_size_done;
-
-void fcntl_size_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));
- }
- globus_mutex_lock(&fcntl_size_lock);
- fcntl_size_done=GLOBUS_TRUE;
- globus_cond_signal(&fcntl_size_cond);
- globus_mutex_unlock(&fcntl_size_lock);
-}
-
-void ADIOI_GRIDFTP_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct,
- int *error_code)
-{
- MPI_Datatype copy_etype, copy_filetype;
- int combiner, i, j, k, filetype_is_contig, err;
- ADIOI_Flatlist_node *flat_file;
- char myname[]="ADIOI_GRIDFTP_Fcntl";
-
- int myrank, nprocs;
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
- {
- 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;
- if ( (result=globus_ftp_client_size(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- &(fsize),
- fcntl_size_cb,
- GLOBUS_NULL))!=GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_size",myname,result);
- *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;
- }
- globus_mutex_lock(&fcntl_size_lock);
- while ( fcntl_size_done!=GLOBUS_TRUE )
- globus_cond_wait(&fcntl_size_lock,&fcntl_size_cond);
- globus_mutex_unlock(&fcntl_size_lock);
- globus_mutex_destroy(&fcntl_size_lock);
- globus_cond_destroy(&fcntl_size_cond);
- fcntl_struct->fsize=fsize;
- }
- *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- default:
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_ARG,
- "**flag", "**flag %d", flag);
- }
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_features.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_features.c
deleted file mode 100644
index cbdc39586f8..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_features.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-int ADIOI_GRIDFTP_Feature (ADIO_File fd, int flag)
-{
- switch(flag) {
- case ADIO_SCALABLE_OPEN:
- case ADIO_SHARED_FP:
- case ADIO_LOCKS:
- case ADIO_SEQUENTIAL:
- case ADIO_DATA_SIEVING_WRITES:
- default:
- return 0;
- }
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_flush.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_flush.c
deleted file mode 100644
index 795341e8889..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_flush.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-
-/* GridFTP doesn't give you a way to cache writes on the client side, so
- is essentially a no-op */
-/* if there is a mechanism where we can ask the server to flush data to disk we
- * should do it here. I'll leave that up to Troy */
-
-void ADIOI_GRIDFTP_Flush(ADIO_File fd, int *error_code)
-{
- return;
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_hints.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_hints.c
deleted file mode 100644
index c0b0a40ebb2..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_hints.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- 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.
- */
-
-/*
-
-Valid hints for ftp:// and gsiftp:// URLs (aside from the std. ones):
-
- ftp_control_mode extended|block|stream|compressed
- (default extended for gsiftp:// URLs and stream for ftp:// URLs)
-
- parallelism integer number of simultaneous threads connecting to
- ftp server (default 1)
-
- striped_ftp true|false or enable|disable; enables gsiftp striped data transfer
-
- tcp_buffer integer size of tcp stream buffers in bytes
-
- transfer_type ascii or binary (default binary)
-
-These *must* be specified at open time currently.
-*/
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-
-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. */
- MPI_Info_create(&(fd->info));
- }
- else
- {
- MPI_Info_dup(users_info,&(fd->info));
- }
- }
- else
- {
- 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);
- for (i=0;iinfo,key,value);
- }
- }
- }
- }
-
- /* let the generic ROMIO and MPI-I/O stuff happen... */
- ADIOI_GEN_SetInfo(fd, users_info, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_open.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_open.c
deleted file mode 100644
index 45aab921051..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_open.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-
-static globus_mutex_t lock;
-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));
- }
- else
- {
- file_exists=GLOBUS_TRUE;
- }
- exists_done=GLOBUS_TRUE;
-}
-
-static globus_bool_t touch_ctl_done;
-static void touch_ctl_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));
- }
- globus_mutex_lock(&lock);
- touch_ctl_done=GLOBUS_TRUE;
- globus_cond_signal(&cond);
- globus_mutex_unlock(&lock);
-}
-
-static void touch_data_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error,
- globus_byte_t *buffer, globus_size_t length, globus_off_t offset,
- globus_bool_t eof)
-{
- if (error)
- FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error));
- globus_ftp_client_register_read(handle,buffer,length,touch_data_cb,myargs);
- return;
-}
-
-void ADIOI_GRIDFTP_Open(ADIO_File fd, int *error_code)
-{
- static char myname[]="ADIOI_GRIDFTP_Open";
- int myrank, nprocs, keyfound;
- char hintval[MPI_MAX_INFO_VAL+1];
- globus_ftp_client_handleattr_t hattr;
- globus_result_t result;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- /* activate Globus ftp client module -- can be called multiple times, so
- it's safest to call once per file/connection */
- globus_module_activate(GLOBUS_FTP_CLIENT_MODULE);
- fd->fd_sys = num_gridftp_handles;
- /* No shared file pointers for now */
- fd->shared_fp_fname = NULL;
- *error_code = MPI_SUCCESS;
-
- /* Access modes here mean something very different here than they
- would on a "real" filesystem... As a result, the amode and hint
- processing here is intermingled and a little weird because many
- of them have to do with the connection rather than the file itself.
- The thing that sucks about this is that read and write ops will
- have to check themselves if the file is being accessed rdonly, rdwr,
- or wronly.
- */
- result=globus_ftp_client_handleattr_init(&hattr);
- if ( result != GLOBUS_SUCCESS )
- {
-
-
- globus_err_handler("globus_ftp_client_handleattr_init",
- myname,result);
- fd->fd_sys = -1;
- *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;
- }
- result = globus_ftp_client_operationattr_init(&(oattr[fd->fd_sys]));
- if ( result != GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_operationattr_init",
- myname,result);
- fd->fd_sys = -1;
- *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;
- }
-
-
- /* Always use connection caching unless told otherwise */
- result=globus_ftp_client_handleattr_set_cache_all(&hattr,GLOBUS_TRUE);
- if ( result !=GLOBUS_SUCCESS )
- globus_err_handler("globus_ftp_client_handleattr_set_cache_all",myname,result);
-
- /* Assume that it's safe to cache a file if it's read-only */
- if ( (fd->access_mode&ADIO_RDONLY) &&
- (result=globus_ftp_client_handleattr_add_cached_url(&hattr,fd->filename))!=GLOBUS_SUCCESS )
- globus_err_handler("globus_ftp_client_handleattr_add_cached_url",myname,result);
-
- /* 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
- by default. This behavior can be overridden by the ftp_control_mode
- hint. */
-
- /*
- 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) &&
- (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) &&
- ((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
- 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") ) &&
- (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") &&
- (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") &&
- (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") &&
- (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);
- }
-
- ADIOI_Info_get(fd->info,"parallelism",MPI_MAX_INFO_VAL,hintval,&keyfound);
- if ( keyfound )
- {
- int nftpthreads;
-
- if ( sscanf(hintval,"%d",&nftpthreads)==1 )
- {
- globus_ftp_control_parallelism_t parallelism;
-
- parallelism.mode = GLOBUS_FTP_CONTROL_PARALLELISM_FIXED;
- parallelism.fixed.size = nftpthreads;
- if ( (result=globus_ftp_client_operationattr_set_parallelism(&(oattr[fd->fd_sys]),
- ¶llelism))!=GLOBUS_SUCCESS )
- globus_err_handler("globus_ftp_client_operationattr_set_parallelism",myname,result);
- }
- }
-
- ADIOI_Info_get(fd->info,"striped_ftp",MPI_MAX_INFO_VAL,hintval,&keyfound);
- if ( keyfound )
- {
- /* if set to "true" or "enable", set up round-robin block layout */
- if ( !strncmp("true",hintval,4) || !strncmp("TRUE",hintval,4) ||
- !strncmp("enable",hintval,4) || !strncmp("ENABLE",hintval,4) )
- {
- ADIOI_Info_get(fd->info,"striping_factor",MPI_MAX_INFO_VAL,hintval,&keyfound);
- if ( keyfound )
- {
- int striping_factor;
-
- if ( sscanf(hintval,"%d",&striping_factor)==1 )
- {
- globus_ftp_control_layout_t layout;
-
- layout.mode = GLOBUS_FTP_CONTROL_STRIPING_BLOCKED_ROUND_ROBIN;
- layout.round_robin.block_size = striping_factor;
- if ( (result=globus_ftp_client_operationattr_set_layout(&(oattr[fd->fd_sys]),
- &layout))!=GLOBUS_SUCCESS )
- globus_err_handler("globus_ftp_client_operationattr_set_layout",
- myname,result);
- }
- }
- }
- }
-
- ADIOI_Info_get(fd->info,"tcp_buffer",MPI_MAX_INFO_VAL,hintval,&keyfound);
- if ( keyfound )
- {
- /* set tcp buffer size */
- int buffer_size;
- if ( sscanf(hintval,"%d",&buffer_size)==1 )
- {
- globus_ftp_control_tcpbuffer_t tcpbuf;
-
- tcpbuf.mode = GLOBUS_FTP_CONTROL_TCPBUFFER_FIXED;
- tcpbuf.fixed.size = buffer_size;
- if ( (result=globus_ftp_client_operationattr_set_tcp_buffer(&(oattr[fd->fd_sys]),
- &tcpbuf))!=GLOBUS_SUCCESS )
- globus_err_handler("globus_ftp_client_operationattr_set_tcp_buffer",myname,result);
- }
- }
-
- ADIOI_Info_get(fd->info,"transfer_type",MPI_MAX_INFO_VAL,hintval,&keyfound);
- if ( keyfound )
- {
- globus_ftp_control_type_t filetype;
- /* set transfer type (i.e. ASCII or binary) */
- if ( !strcmp("ascii",hintval) || !strcmp("ASCII",hintval) )
- {
- filetype=GLOBUS_FTP_CONTROL_TYPE_ASCII;
- }
- else
- {
- filetype=GLOBUS_FTP_CONTROL_TYPE_IMAGE;
- }
- if ( (result=globus_ftp_client_operationattr_set_type(&(oattr[fd->fd_sys]),filetype))!=GLOBUS_SUCCESS )
- globus_err_handler("globus_ftp_client_operationattr_set_type",myname,result);
- }
- }
- else
- FPRINTF(stderr,"no MPI_Info object associated with %s\n",fd->filename);
-
- /* Create the ftp handle */
- result=globus_ftp_client_handle_init(&(gridftp_fh[fd->fd_sys]),&hattr);
- if ( result != GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_handle_init",myname,result);
- fd->fd_sys = -1;
- *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;
- }
-
- /* Check for existence of the file */
- globus_mutex_init(&lock, GLOBUS_NULL);
- globus_cond_init(&cond, GLOBUS_NULL);
- file_exists=GLOBUS_FALSE;
- exists_done=GLOBUS_FALSE;
- if ( myrank==0 )
- {
- if ( (result=globus_ftp_client_exists(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- exists_cb,
- GLOBUS_NULL))!=GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_exists",myname,result);
- fd->fd_sys = -1;
- *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;
- }
- /* wait till the callback completes */
- globus_mutex_lock(&lock);
- while ( exists_done!=GLOBUS_TRUE )
- globus_cond_wait(&cond,&lock);
- globus_mutex_unlock(&lock);
- }
- MPI_Barrier(fd->comm);
- MPI_Bcast(&file_exists,1,MPI_INT,0,fd->comm);
-
- /* It turns out that this is handled by MPI_File_open() directly */
- if ( (file_exists!=GLOBUS_TRUE) && (fd->access_mode&ADIO_CREATE) &&
- !(fd->access_mode&ADIO_EXCL) && !(fd->access_mode&ADIO_RDONLY) )
- {
- if ( myrank==0 )
- {
- /* if the file doesn't exist, write a single NULL to it */
- globus_byte_t touchbuf=(globus_byte_t)'\0';
- touch_ctl_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_put(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- touch_ctl_cb,
- GLOBUS_NULL))!=GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_put",myname,result);
- fd->fd_sys = -1;
- *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;
- }
- result=globus_ftp_client_register_write(&(gridftp_fh[fd->fd_sys]),
- (globus_byte_t *)&touchbuf, 0,
- (globus_off_t)0, GLOBUS_TRUE,
- touch_data_cb, GLOBUS_NULL);
-
- if ( result != 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- globus_mutex_lock(&lock);
- while ( touch_ctl_done!=GLOBUS_TRUE )
- globus_cond_wait(&cond,&lock);
- globus_mutex_unlock(&lock);
- }
- MPI_Barrier(fd->comm);
- }
- else if ( (fd->access_mode&ADIO_EXCL) && (file_exists==GLOBUS_TRUE) )
- {
- fd->fd_sys = -1;
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", 0);
- return;
- }
- else if ( (fd->access_mode&ADIO_RDONLY) && (file_exists!=GLOBUS_TRUE) )
- {
- if ( myrank==0 )
- {
- FPRINTF(stderr,"WARNING: read-only file %s does not exist!\n",fd->filename);
- }
- }
- num_gridftp_handles++;
-}
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_read.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_read.c
deleted file mode 100644
index 91ed544c807..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_read.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-#include "adio_extern.h"
-
-static globus_mutex_t readcontig_ctl_lock;
-static globus_cond_t readcontig_ctl_cond;
-static globus_bool_t readcontig_ctl_done;
-static void readcontig_ctl_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));
- }
- globus_mutex_lock(&readcontig_ctl_lock);
- if ( readcontig_ctl_done!=GLOBUS_TRUE )
- readcontig_ctl_done=GLOBUS_TRUE;
- globus_cond_signal(&readcontig_ctl_cond);
- globus_mutex_unlock(&readcontig_ctl_lock);
- return;
-}
-
-static void readcontig_data_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error,
- globus_byte_t *buffer, globus_size_t length, globus_off_t offset,
- globus_bool_t eof)
-{
- globus_size_t *bytes_read;
-
- bytes_read=(globus_size_t *)myargs;
- if (error)
- {
- FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error));
- }
- *bytes_read+=length;
- /* I don't understand why the data callback has to keep recalling register_read,
- but everything I've done and all the examples I've seen seem to require
- that behavior to work... */
- /*
- * Using buffer+length seems to work, but is probably not the correct
- * solution. A big read of 256kB chunks will have lines like this:
- readcontig_data_cb: buffer 0x404e0008 length 0 offset 31719424 eof 1
- readcontig_data_cb: buffer 0x404a0008 length 65536 offset 31981568 eof 0
- readcontig_data_cb: buffer 0x404b0008 length 65536 offset 32047104 eof 0
- readcontig_data_cb: buffer 0x404c0008 length 65536 offset 32112640 eof 0
- readcontig_data_cb: buffer 0x404d0008 length 65536 offset 32178176 eof 0
- */
- if ( !eof )
- globus_ftp_client_register_read(handle,
- buffer+length,
- length,
- readcontig_data_cb,
- (void *)(bytes_read));
- return;
-}
-
-static globus_mutex_t readdiscontig_ctl_lock;
-static globus_cond_t readdiscontig_ctl_cond;
-static globus_bool_t readdiscontig_ctl_done;
-static void readdiscontig_ctl_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));
- }
- globus_mutex_lock(&readdiscontig_ctl_lock);
- if ( readdiscontig_ctl_done!=GLOBUS_TRUE )
- readdiscontig_ctl_done=GLOBUS_TRUE;
- globus_cond_signal(&readdiscontig_ctl_cond);
- globus_mutex_unlock(&readdiscontig_ctl_lock);
- return;
-}
-
-static void readdiscontig_data_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error,
- globus_byte_t *buffer, globus_size_t length, globus_off_t offset,
- globus_bool_t eof)
-{
- globus_size_t *bytes_read;
-
- bytes_read=(globus_size_t *)myargs;
- if (error)
- {
- FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error));
- }
- *bytes_read+=length;
- /* I don't understand why the data callback has to keep recalling register_read,
- but everything I've done and all the examples I've seen seem to require
- that behavior to work... */
- if ( !eof )
- globus_ftp_client_register_read(handle,
- buffer,
- length,
- readdiscontig_data_cb,
- (void *)(bytes_read));
- return;
-}
-
-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)
-{
- static char myname[]="ADIOI_GRIDFTP_ReadContig";
- int myrank, nprocs;
- MPI_Count datatype_size;
- globus_size_t len,bytes_read=0;
- globus_off_t goff;
- globus_result_t result;
-
- if ( fd->access_mode&ADIO_WRONLY )
- {
- *error_code=MPIR_ERR_MODE_WRONLY;
- return;
- }
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
- MPI_Type_size_x(datatype, &datatype_size);
-
- if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
- {
- offset = fd->fp_ind;
- }
-
- /* Do the gridftp I/O transfer */
- goff = (globus_off_t)offset;
- len = ((globus_size_t)datatype_size)*((globus_size_t)count);
-
- globus_mutex_init(&readcontig_ctl_lock, GLOBUS_NULL);
- globus_cond_init(&readcontig_ctl_cond, GLOBUS_NULL);
- readcontig_ctl_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_partial_get(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- goff,
- goff+(globus_off_t)len,
- readcontig_ctl_cb,
- GLOBUS_NULL))!=GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_partial_get",myname,result);
- *error_code=MPI_ERR_IO;
- ADIOI_Error(fd,*error_code,myname);
- return;
- }
- result=globus_ftp_client_register_read(&(gridftp_fh[fd->fd_sys]),
- (globus_byte_t *)buf, len, readcontig_data_cb,
- (void *)(&bytes_read));
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
-
-
- /* 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(&readcontig_ctl_lock);
- while ( readcontig_ctl_done!=GLOBUS_TRUE )
- globus_cond_wait(&readcontig_ctl_cond,&readcontig_ctl_lock);
- globus_mutex_unlock(&readcontig_ctl_lock);
-
- globus_mutex_destroy(&readcontig_ctl_lock);
- globus_cond_destroy(&readcontig_ctl_cond);
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bytes_read);
-#endif
- if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
- {
- fd->fp_ind += bytes_read;
- fd->fp_sys_posn = fd->fp_ind;
- }
- else {
- fd->fp_sys_posn = offset + bytes_read;
- }
-}
-
-void ADIOI_GRIDFTP_ReadDiscontig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
- char myname[]="ADIOI_GRIDFTP_ReadDiscontig";
- int myrank,nprocs;
- /* size and extent of buffer in memory */
- MPI_Aint btype_size,btype_extent,btype_lb;
- /* size and extent of file record layout */
- MPI_Aint ftype_size,ftype_extent,ftype_lb;
- /* size of file elemental type; seeks are done in units of this */
- MPI_Aint etype_size;
- MPI_Aint extent;
- ADIOI_Flatlist_node *flat_file;
- int i,buf_contig,boff,nblks;
- globus_off_t start,end,goff;
- globus_size_t bytes_read;
- globus_result_t result;
- globus_byte_t *tmp;
-
- if ( fd->access_mode&ADIO_WRONLY )
- {
- *error_code=MPIR_ERR_MODE_WRONLY;
- return;
- }
-
- *error_code=MPI_SUCCESS;
-
- MPI_Comm_rank(fd->comm,&myrank);
- MPI_Comm_size(fd->comm,&nprocs);
-
- etype_size=fd->etype_size;
- MPI_Type_size_x(fd->filetype,&ftype_size);
- MPI_Type_get_extent(fd->filetype,&ftype_lb,&ftype_extent);
- /* This is arguably unnecessary, as this routine assumes that the
- buffer in memory is contiguous */
- 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__,
- 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 */
- flat_file = ADIOI_Flatten_and_find(fd->filetype);
-
- /* Figure out how big the area to read is */
- start=(globus_off_t)(offset*etype_size);
- goff=start;
- boff=0;
- extent=0;
- nblks=0;
- while ( boff < (count*btype_size) )
- {
- int blklen=0;
-
- for (i=0;icount;i++)
- {
- /* find the length of the next block */
- if ( (boff+flat_file->blocklens[i]) < (count*btype_size) )
- blklen=flat_file->blocklens[i];
- else
- blklen=(count*btype_size)-boff;
- /* increment buffer size to be used */
- boff+=blklen;
- /* compute extent -- the nblks*ftype_extent bit is
- there so we remember how many ftypes we've already
- been through */
- extent=MAX(extent,nblks*ftype_extent+flat_file->indices[i]+blklen);
- if ( boff>=(count*btype_size) )
- break;
- }
- nblks++;
- }
- if ( extent < count*btype_size )
- {
- 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__,
- MPI_ERR_IO, "**io", 0);
- return;
- }
- end=start+(globus_off_t)extent;
- tmp=(globus_byte_t *)ADIOI_Malloc((size_t)extent*sizeof(globus_byte_t));
-
- /* start up the globus partial read */
- globus_mutex_init(&readdiscontig_ctl_lock, GLOBUS_NULL);
- globus_cond_init(&readdiscontig_ctl_cond, GLOBUS_NULL);
- readdiscontig_ctl_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_partial_get(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- start,
- end,
- readdiscontig_ctl_cb,
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
-
- /* Do all the actual I/Os */
- /* Since globus_ftp_client_register_read() is brain-dead and doesn't
- let you specify an offset, we have to slurp the entire extent into
- memory and then parse out the pieces we want... Sucks, doesn't it?
-
- This should probably be done in chunks (preferably of a size
- set using a file hint), but that'll have to come later.
- --TB */
- if ( (result=globus_ftp_client_register_read(&(gridftp_fh[fd->fd_sys]),
- tmp,
- (globus_size_t)extent,
- readdiscontig_data_cb,
- (void *)(&bytes_read)))!=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", globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- /* 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(&readdiscontig_ctl_lock);
- while ( readdiscontig_ctl_done!=GLOBUS_TRUE )
- globus_cond_wait(&readdiscontig_ctl_cond,&readdiscontig_ctl_lock);
- globus_mutex_unlock(&readdiscontig_ctl_lock);
-
- globus_mutex_destroy(&readdiscontig_ctl_lock);
- globus_cond_destroy(&readdiscontig_ctl_cond);
-
- boff=0;
- nblks=0;
- goff=0;
- while ( boff < (count*btype_size) )
- {
- int i,blklen;
-
- for (i=0;icount;i++)
- {
- if ( (boff+flat_file->blocklens[i]) < (count*btype_size) )
- blklen=flat_file->blocklens[i];
- else
- blklen=(count*btype_size)-boff;
- if ( blklen > 0 )
- {
- goff=nblks*ftype_extent+flat_file->indices[i];
- memcpy((globus_byte_t *)buf+boff,tmp+goff,(size_t)blklen);
- boff+=blklen;
- if ( boff>=(count*btype_size) )
- break;
- }
- }
- nblks++;
- }
- ADIOI_Free(tmp);
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bytes_read);
-#endif
- if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
- {
- fd->fp_ind += extent;
- fd->fp_sys_posn = fd->fp_ind;
- }
- else {
- fd->fp_sys_posn = offset + extent;
- }
-}
-
-void ADIOI_GRIDFTP_ReadStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
- /*
- int myrank, nprocs;
-
- *error_code = MPI_SUCCESS;
-
- 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,
- nprocs, fd->filename);
- 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";
- int myrank, nprocs;
- int i,j;
- int buf_contig,file_contig;
- MPI_Aint btype_size,bufsize;
- globus_off_t start,disp;
- globus_size_t bytes_read;
- globus_byte_t *intermediate;
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- MPI_Type_size_x(datatype,&btype_size);
- bufsize=count*btype_size;
- ADIOI_Datatype_iscontig(fd->filetype,&file_contig);
- ADIOI_Datatype_iscontig(datatype,&buf_contig);
- if ( buf_contig && !file_contig )
- {
- /* Contiguous in memory, discontig in file */
- ADIOI_GRIDFTP_ReadDiscontig(fd, buf, count, datatype,
- file_ptr_type, offset, status, error_code);
- }
- else if ( !buf_contig && file_contig )
- {
- /* Discontiguous in mem, contig in file -- comparatively easy */
- int posn=0;
-
- /* read contiguous data into intermediate buffer */
- intermediate=(globus_byte_t *)ADIOI_Malloc((size_t)bufsize);
- ADIOI_GRIDFTP_ReadContig(fd, intermediate, bufsize, MPI_BYTE,
- file_ptr_type, offset, status, error_code);
-
- /* explode contents of intermediate buffer into main buffer */
- MPI_Unpack(intermediate,bufsize,&posn,buf,count,datatype,fd->comm);
-
- ADIOI_Free(intermediate);
- }
- else if ( !buf_contig && !file_contig )
- {
- /* Discontig in both mem and file -- the hardest case */
- int posn=0;
-
- /* Read discontiguous data into intermediate buffer */
- intermediate=(globus_byte_t *)ADIOI_Malloc((size_t)bufsize);
- ADIOI_GRIDFTP_ReadDiscontig(fd, intermediate, bufsize, MPI_BYTE,
- file_ptr_type, offset, status, error_code);
-
- /* explode contents of intermediate buffer into main buffer */
- posn=0;
- MPI_Unpack(intermediate,bufsize,&posn,buf,count,datatype,fd->comm);
-
- ADIOI_Free(intermediate);
- }
- else
- {
- /* Why did you bother calling ReadStrided?!?!?! */
- ADIOI_GRIDFTP_ReadContig(fd, buf, count, datatype,
- file_ptr_type, offset, status, error_code);
- }
-
-}
-
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_resize.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_resize.c
deleted file mode 100644
index 96c0460c42f..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_resize.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-
-static globus_mutex_t resize_lock;
-static globus_cond_t resize_cond;
-static globus_bool_t resize_done;
-static globus_bool_t resize_success;
-
-void resize_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));
- globus_mutex_lock(&resize_lock);
- resize_success=GLOBUS_FALSE;
- globus_mutex_unlock(&resize_lock);
- }
- else
- {
- globus_mutex_lock(&resize_lock);
- resize_success=GLOBUS_TRUE;
- globus_mutex_unlock(&resize_lock);
- }
- globus_mutex_lock(&resize_lock);
- resize_done=GLOBUS_TRUE;
- globus_cond_signal(&resize_cond);
- globus_mutex_unlock(&resize_lock);
-}
-
-
-static void resize_wrdata_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error,
- globus_byte_t *buffer, globus_size_t length, globus_off_t offset,
- globus_bool_t eof)
-{
- if (error)
- FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error));
- if (!eof)
- globus_ftp_client_register_read(handle,
- buffer,
- length,
- resize_wrdata_cb,
- myargs);
- return;
-}
-
-
-void ADIOI_GRIDFTP_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
-{
- int myrank, nprocs;
- char myname[]="ADIOI_GRIDFTP_Resize";
- globus_off_t fsize;
- globus_result_t result;
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- /* Sanity check */
- if ( fd->access_mode&ADIO_RDONLY )
- {
- FPRINTF(stderr,"%s: attempt to resize read-only file %s!\n",
- myname,fd->filename);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", 0);
- return;
- }
-
- /* This routine is supposed to do the moral equivalent of truncate(),
- but there's not an equivalent operation in the globus_ftp_client API. */
- globus_mutex_init(&resize_lock,GLOBUS_NULL);
- globus_cond_init(&resize_cond,GLOBUS_NULL);
- resize_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_size(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- &(fsize),
- resize_cb,
- GLOBUS_NULL))!=GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_size",myname,result);
- *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;
- }
- globus_mutex_lock(&resize_lock);
- while ( resize_done!=GLOBUS_TRUE )
- globus_cond_wait(&resize_lock,&resize_cond);
- if ( fsize < (globus_off_t)size )
- {
- /* The file is smaller than the requested size, so
- do a zero-byte write to where the new EOF should be. */
- globus_byte_t touchbuf=(globus_byte_t)'\0';
- resize_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_partial_put(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- (globus_off_t)size,
- (globus_off_t)size,
- resize_cb,
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
-
- if ( (result=globus_ftp_client_register_write(&(gridftp_fh[fd->fd_sys]),
- (globus_byte_t *)&touchbuf,
- 0,
- (globus_off_t)0,
- GLOBUS_TRUE,
- resize_wrdata_cb,
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- globus_mutex_lock(&resize_lock);
- while ( resize_done!=GLOBUS_TRUE )
- globus_cond_wait(&resize_cond,&resize_lock);
- globus_mutex_unlock(&resize_lock);
- }
- else if ( fsize > (globus_off_t)size )
- {
- /* The file is bigger than the requested size, so
- we'll abuse globus_ftp_client_third_party_partial_put()
- into truncating it for us. */
- char *urlold;
- size_t urllen;
-
- urllen=strlen(fd->filename);
- urlold=(char *)ADIOI_Malloc(urllen+5);
- ADIOI_Snprintf(urlold,urllen+5,"%s.old",fd->filename);
- resize_done=GLOBUS_FALSE;
- resize_success=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_move(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- urlold,
- &(oattr[fd->fd_sys]),
- resize_cb,
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- globus_mutex_lock(&resize_lock);
- while ( resize_done!=GLOBUS_TRUE )
- globus_cond_wait(&resize_cond,&resize_lock);
- globus_mutex_unlock(&resize_lock);
- if ( resize_success!=GLOBUS_TRUE )
- {
- *error_code = MPI_ERR_IO;
- return;
- }
- resize_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_partial_third_party_transfer(&(gridftp_fh[fd->fd_sys]),
- urlold,
- &(oattr[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- 0,
- (globus_off_t)size,
- resize_cb,
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- globus_mutex_lock(&resize_lock);
- while ( resize_done!=GLOBUS_TRUE )
- globus_cond_wait(&resize_cond,&resize_lock);
- globus_mutex_unlock(&resize_lock);
- if ( resize_success!=GLOBUS_TRUE )
- {
- *error_code = MPI_ERR_IO;
- ADIOI_Error(fd,*error_code,myname);
- return;
- }
- resize_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_delete(&(gridftp_fh[fd->fd_sys]),
- urlold,
- &(oattr[fd->fd_sys]),
- resize_cb,
- 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",
- globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- globus_mutex_lock(&resize_lock);
- while ( resize_done!=GLOBUS_TRUE )
- globus_cond_wait(&resize_cond,&resize_lock);
- globus_mutex_unlock(&resize_lock);
- if ( resize_success!=GLOBUS_TRUE )
- {
- *error_code = MPI_ERR_IO;
- ADIOI_Error(fd,*error_code,myname);
- return;
- }
- ADIOI_Free(urlold);
- }
- globus_mutex_destroy(&resize_lock);
- globus_cond_destroy(&resize_cond);
-}
-
-
-
-
-
diff --git a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_write.c b/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_write.c
deleted file mode 100644
index d349d5c2318..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/ad_gridftp_write.c
+++ /dev/null
@@ -1,470 +0,0 @@
-/* -*- 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.
- */
-
-#include "ad_gridftp.h"
-#include "adioi.h"
-#include "adio_extern.h"
-
-static globus_mutex_t writecontig_ctl_lock;
-static globus_cond_t writecontig_ctl_cond;
-static globus_bool_t writecontig_ctl_done;
-static void writecontig_ctl_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));
- }
- globus_mutex_lock(&writecontig_ctl_lock);
- if ( writecontig_ctl_done!=GLOBUS_TRUE )
- writecontig_ctl_done=GLOBUS_TRUE;
- globus_cond_signal(&writecontig_ctl_cond);
- globus_mutex_unlock(&writecontig_ctl_lock);
-#ifdef PRINT_ERR_MSG
- FPRINTF(stderr,"finished with contig write transaction\n");
-#endif /* PRINT_ERR_MSG */
- return;
-}
-
-static void writecontig_data_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error,
- globus_byte_t *buffer, globus_size_t length, globus_off_t offset,
- globus_bool_t eof)
-{
- globus_size_t *bytes_written;
-
- bytes_written=(globus_size_t *)myargs;
- if (error)
- {
- FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error));
- }
- *bytes_written+=length;
- /* I don't understand why the data callback has to keep recalling register_write,
- but everything I've done and all the examples I've seen seem to require
- that behavior to work... */
- if ( !eof )
- {
- globus_ftp_client_register_write(handle,
- buffer,
- length,
- offset,
- GLOBUS_TRUE,
- writecontig_data_cb,
- (void *)(bytes_written));
- }
-#ifdef PRINT_ERR_MSG
- FPRINTF(stderr,"wrote %Ld bytes...",(long long)length);
-#endif /* PRINT_ERR_MSG */
- return;
-}
-
-
-static globus_mutex_t writediscontig_ctl_lock;
-static globus_cond_t writediscontig_ctl_cond;
-static globus_bool_t writediscontig_ctl_done;
-static void writediscontig_ctl_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));
- }
- globus_mutex_lock(&writediscontig_ctl_lock);
- if ( writediscontig_ctl_done!=GLOBUS_TRUE )
- writediscontig_ctl_done=GLOBUS_TRUE;
- globus_cond_signal(&writediscontig_ctl_cond);
- globus_mutex_unlock(&writediscontig_ctl_lock);
- return;
-}
-
-static void writediscontig_data_cb(void *myargs, globus_ftp_client_handle_t *handle, globus_object_t *error,
- globus_byte_t *buffer, globus_size_t length, globus_off_t offset,
- globus_bool_t eof)
-{
- globus_size_t *bytes_written;
-
- bytes_written=(globus_size_t *)myargs;
- if (error)
- {
- FPRINTF(stderr, "%s\n", globus_object_printable_to_string(error));
- }
- *bytes_written+=length;
- /* I don't understand why the data callback has to keep recalling register_read,
- but everything I've done and all the examples I've seen seem to require
- that behavior to work... */
- if ( !eof )
- globus_ftp_client_register_write(handle,
- buffer,
- length,
- offset,
- eof,
- writediscontig_data_cb,
- (void *)(bytes_written));
- FPRINTF(stderr,"wrote %Ld bytes...",(long long)length);
- return;
-}
-
-
-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)
-{
- char myname[]="ADIOI_GRIDFTP_WriteContig";
- int myrank, nprocs;
- MPI_Count datatype_size;
- globus_size_t len,bytes_written=0;
- globus_off_t goff;
- globus_result_t result;
-
- if ( fd->access_mode&ADIO_RDONLY )
- {
- *error_code=MPI_ERR_AMODE;
- return;
- }
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
- MPI_Type_size_x(datatype, &datatype_size);
-
- if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
- {
- offset = fd->fp_ind;
- }
-
- /* Do the gridftp I/O transfer */
- goff = (globus_off_t)offset;
- len = ((globus_size_t)datatype_size)*((globus_size_t)count);
-
- globus_mutex_init(&writecontig_ctl_lock, GLOBUS_NULL);
- globus_cond_init(&writecontig_ctl_cond, GLOBUS_NULL);
- writecontig_ctl_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_partial_put(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- goff,
- goff+(globus_off_t)len,
- writecontig_ctl_cb,
- 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", globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- if ( (result=globus_ftp_client_register_write(&(gridftp_fh[fd->fd_sys]),
- (globus_byte_t *)buf,
- len,
- goff,
- GLOBUS_TRUE,
- writecontig_data_cb,
- (void *)(&bytes_written)))!=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", globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
-
-
- /* 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(&writecontig_ctl_lock);
- while ( writecontig_ctl_done!=GLOBUS_TRUE )
- globus_cond_wait(&writecontig_ctl_cond,&writecontig_ctl_lock);
- globus_mutex_unlock(&writecontig_ctl_lock);
-
- globus_mutex_destroy(&writecontig_ctl_lock);
- globus_cond_destroy(&writecontig_ctl_cond);
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bytes_written);
-#endif
- if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
- {
- offset = fd->fp_ind;
- fd->fp_ind += bytes_written;
- fd->fp_sys_posn = fd->fp_ind;
- }
- else {
- fd->fp_sys_posn = offset + bytes_written;
- }
-}
-
-
-void ADIOI_GRIDFTP_WriteDiscontig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
- char myname[]="ADIOI_GRIDFTP_WriteDiscontig";
- int myrank,nprocs;
- MPI_Aint btype_size,btype_extent,btype_lb;
- MPI_Aint ftype_size,ftype_extent,ftype_lb;
- MPI_Aint etype_size;
- MPI_Aint extent;
- ADIOI_Flatlist_node *flat_file;
- int buf_contig,boff,i,nblks;
- globus_off_t start,end,goff;
- globus_size_t bytes_written;
- globus_result_t result;
-
- MPI_Comm_rank(fd->comm,&myrank);
- MPI_Comm_size(fd->comm,&nprocs);
- etype_size=fd->etype_size;
- MPI_Type_size_x(fd->filetype,&ftype_size);
- MPI_Type_get_extent(fd->filetype,&ftype_lb,&ftype_extent);
- /* This is arguably unnecessary, as this routine assumes that the
- buffer in memory is contiguous */
- 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__, MPI_ERR_IO,
- "**io",
- "**io %s", globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- /* from here we can assume btype_extent==btype_size */
-
- /* Flatten out fd->filetype so we know which blocks to skip */
- 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. */
- start=(globus_off_t)(offset*etype_size);
- goff=start;
- boff=0;
- extent=0;
- nblks=0;
- while ( boff < (count*btype_size) )
- {
- int blklen;
-
- for (i=0;icount;i++)
- {
- if ( (boff+flat_file->blocklens[i]) < (count*btype_size) )
- blklen=flat_file->blocklens[i];
- else
- blklen=(count*btype_size)-boff;
- boff+=blklen;
- extent=MAX(extent,nblks*ftype_extent+flat_file->indices[i]+blklen);
- if ( boff>=(count*btype_size) )
- break;
- }
- nblks++;
- }
- if ( extent < count*btype_size )
- {
- 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__, MPI_ERR_IO,
- "**io",
- "**io %s", globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
- end=start+(globus_off_t)extent;
- FPRINTF(stderr,"[%d/%d] %s writing %d bytes into extent of %d bytes starting at offset %Ld\n",
- myrank,nprocs,myname,count*btype_size,extent,(long long)start);
- fflush(stderr);
-
- /* start up the globus partial write */
- globus_mutex_init(&writediscontig_ctl_lock, GLOBUS_NULL);
- globus_cond_init(&writediscontig_ctl_cond, GLOBUS_NULL);
- writediscontig_ctl_done=GLOBUS_FALSE;
- if ( (result=globus_ftp_client_partial_put(&(gridftp_fh[fd->fd_sys]),
- fd->filename,
- &(oattr[fd->fd_sys]),
- GLOBUS_NULL,
- start,
- end,
- writediscontig_ctl_cb,
- 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", globus_object_printable_to_string(globus_error_get(result)));
- return;
- }
-
- /* Do all the actual I/Os */
- boff=0;
- nblks=0;
- while ( boff < (count*btype_size) )
- {
- int i,blklen;
-
- for (i=0;icount;i++)
- {
- if ( (boff+flat_file->blocklens[i]) < (count*btype_size) )
- blklen=flat_file->blocklens[i];
- else
- blklen=(count*btype_size)-boff;
- if ( blklen > 0 )
- {
- goff=start+nblks*ftype_extent+((globus_off_t)flat_file->indices[i]);
- /*
- FPRINTF(stderr,"[%d/%d] %s writing %d bytes from boff=%d at goff=%Ld\n",myrank,nprocs,myname,blklen,boff,goff);
- */
- if ( (result=globus_ftp_client_register_write(&(gridftp_fh[fd->fd_sys]),
- ((globus_byte_t *)buf)+boff,
- (globus_size_t)blklen,
- goff,
- GLOBUS_TRUE,
- writediscontig_data_cb,
- (void *)(&bytes_written)))!=GLOBUS_SUCCESS )
- {
- globus_err_handler("globus_ftp_client_register_write",myname,result);
- *error_code=MPI_ERR_IO;
- ADIOI_Error(fd,*error_code,myname);
- return;
- }
- boff+=blklen;
- if ( boff>=(count*btype_size) )
- break;
- }
- }
- 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);
- while ( writediscontig_ctl_done!=GLOBUS_TRUE )
- globus_cond_wait(&writediscontig_ctl_cond,&writediscontig_ctl_lock);
- globus_mutex_unlock(&writediscontig_ctl_lock);
- globus_mutex_destroy(&writediscontig_ctl_lock);
- globus_cond_destroy(&writediscontig_ctl_cond);
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bytes_written);
-#endif
- if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
- {
- fd->fp_ind += extent;
- fd->fp_sys_posn = fd->fp_ind;
- }
- else {
- fd->fp_sys_posn = offset + extent;
- }
-}
-
-
-#define GRIDFTP_USE_GENERIC_STRIDED
-void ADIOI_GRIDFTP_WriteStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code)
-{
-#ifdef GRIDFTP_USE_GENERIC_STRIDED
- int myrank, nprocs;
-
- if ( fd->access_mode&ADIO_RDONLY )
- {
- *error_code=MPI_ERR_AMODE;
- return;
- }
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset,
- status, error_code);
- return;
-#else
- char myname[]="ADIOI_GRIDFTP_WriteStrided";
- int myrank, nprocs;
- int buf_contig,file_contig;
- MPI_Aint btype_size,bufsize;
- globus_byte_t *intermediate;
-
- *error_code = MPI_SUCCESS;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- MPI_Type_size_x(datatype,&btype_size);
- bufsize=count*btype_size;
- ADIOI_Datatype_iscontig(fd->filetype,&file_contig);
- ADIOI_Datatype_iscontig(datatype,&buf_contig);
- if ( buf_contig && !file_contig )
- {
- /* Contiguous in memory, discontig in file */
- FPRINTF(stderr,"[%d/%d] %s called w/ contig mem, discontig file\n",
- myrank,nprocs,myname);
- fflush(stderr);
-
- ADIOI_GRIDFTP_WriteDiscontig(fd, buf, count, datatype,
- file_ptr_type, offset, status, error_code);
- }
- else if ( !buf_contig && file_contig )
- {
- /* Discontiguous in mem, contig in file -- comparatively easy */
- int posn=0;
-
- FPRINTF(stderr,"[%d/%d] %s called w/ discontig mem, contig file\n",
- myrank,nprocs,myname);
- fflush(stderr);
-
-
- /* squeeze contents of main buffer into intermediate buffer*/
- intermediate=(globus_byte_t *)ADIOI_Malloc((size_t)bufsize);
- MPI_Pack(buf,count,datatype,intermediate,bufsize,&posn,fd->comm);
-
- /* write contiguous data from intermediate buffer */
- ADIOI_GRIDFTP_WriteContig(fd, intermediate, bufsize, MPI_BYTE,
- file_ptr_type, offset, status, error_code);
-
- ADIOI_Free(intermediate);
- }
- else if ( !buf_contig && !file_contig )
- {
- /* Discontig in both mem and file -- the hardest case */
- int posn=0;
-
- FPRINTF(stderr,"[%d/%d] %s called w/ discontig mem, discontig file\n",
- myrank,nprocs,myname);
- fflush(stderr);
-
- /* squeeze contents of main buffer into intermediate buffer*/
- intermediate=(globus_byte_t *)ADIOI_Malloc((size_t)bufsize);
- MPI_Pack(buf,count,datatype,intermediate,bufsize,&posn,fd->comm);
-
- /* write contiguous data from intermediate buffer */
- ADIOI_GRIDFTP_WriteDiscontig(fd, intermediate, bufsize, MPI_BYTE,
- file_ptr_type, offset, status, error_code);
-
- ADIOI_Free(intermediate);
- }
- 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",
- myrank,nprocs,myname);
- ADIOI_GRIDFTP_WriteContig(fd, buf, count, datatype,
- file_ptr_type, offset, status, error_code);
- }
-#endif /* ! GRIDFTP_USE_GENERIC_STRIDED */
-}
-
diff --git a/3rd-party/romio321/adio/ad_gridftp/globus_routines.c b/3rd-party/romio321/adio/ad_gridftp/globus_routines.c
deleted file mode 100644
index 1cca367a3f7..00000000000
--- a/3rd-party/romio321/adio/ad_gridftp/globus_routines.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- 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.
- */
-
-#include
-#include
-#include
-#include
-#include "adio.h"
-#include
-
-/* Here are the canonical definitions of the extern's referenced by
- ad_gridftp.h */
-int num_gridftp_handles=0;
-#ifndef ADIO_GRIDFTP_HANDLES_MAX
-#define ADIO_GRIDFTP_HANDLES_MAX 200
-#endif /* ! ADIO_GRIDFTP_HANDLES_MAX */
-/* having to keep not one but two big global tables sucks... */
-globus_ftp_client_handle_t gridftp_fh[ADIO_GRIDFTP_HANDLES_MAX];
-globus_ftp_client_operationattr_t oattr[ADIO_GRIDFTP_HANDLES_MAX];
-
-void globus_err_handler(const char *routine, const char *caller,
- globus_result_t result)
-{
- int myrank,nprocs;
- globus_object_t *err;
-
- MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
- MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
- err = globus_error_get(result);
- FPRINTF(stderr, "[%d/%d] %s error \"%s\", called from %s\n",
- myrank,nprocs,routine,globus_object_printable_to_string(err),caller);
-}
diff --git a/3rd-party/romio321/adio/ad_hfs/Makefile.mk b/3rd-party/romio321/adio/ad_hfs/Makefile.mk
deleted file mode 100644
index 318b5076396..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/Makefile.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_HFS
-
-noinst_HEADERS += adio/ad_hfs/ad_hfs.h
-
-romio_other_sources += \
- adio/ad_hfs/ad_hfs_read.c \
- adio/ad_hfs/ad_hfs_open.c \
- adio/ad_hfs/ad_hfs_write.c \
- adio/ad_hfs/ad_hfs_fcntl.c \
- adio/ad_hfs/ad_hfs_resize.c \
- adio/ad_hfs/ad_hfs.c
-
-endif BUILD_AD_HFS
-
diff --git a/3rd-party/romio321/adio/ad_hfs/README b/3rd-party/romio321/adio/ad_hfs/README
deleted file mode 100644
index 933677b1770..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/README
+++ /dev/null
@@ -1 +0,0 @@
-This code is no longer supported.
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs.c b/3rd-party/romio321/adio/ad_hfs/ad_hfs.c
deleted file mode 100644
index 5b34354cabe..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_hfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_HFS_operations = {
- ADIOI_HFS_Open, /* Open */
- ADIOI_HFS_ReadContig, /* ReadContig */
- ADIOI_HFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_HFS_Fcntl, /* Fcntl */
- ADIOI_GEN_SetInfo, /* SetInfo */
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_GEN_WriteStrided, /* WriteStrided */
- ADIOI_GEN_Close, /* Close */
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
- ADIOI_FAKE_IODone, /* ReadDone */
- ADIOI_FAKE_IODone, /* WriteDone */
- ADIOI_FAKE_IOComplete, /* ReadComplete */
- ADIOI_FAKE_IOComplete, /* WriteComplete */
- ADIOI_FAKE_IreadStrided, /* IreadStrided */
- ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
- ADIOI_GEN_Flush, /* Flush */
- ADIOI_HFS_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs.h b/3rd-party/romio321/adio/ad_hfs/ad_hfs.h
deleted file mode 100644
index 2950aa50fcf..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#ifndef AD_HFS_INCLUDE
-#define AD_HFS_INCLUDE
-
-#include
-#include
-#include
-#include "adio.h"
-#ifdef SPPUX
-# include
-# include
-# include
-#endif
-
-void ADIOI_HFS_Open(ADIO_File fd, int *error_code);
-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,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_HFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
- *error_code);
-void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs_fcntl.c b/3rd-party/romio321/adio/ad_hfs/ad_hfs_fcntl.c
deleted file mode 100644
index 460c73666fe..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs_fcntl.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_hfs.h"
-#include "adio_extern.h"
-
-#ifndef HAVE_LSEEK64
-#define lseek64 lseek
-#endif
-void ADIOI_HFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code)
-{
- int i, ntimes, err;
- ADIO_Offset curr_fsize, alloc_size, size, len, done;
- ADIO_Status status;
- char *buf;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_HFS_FCNTL";
-#endif
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
- fcntl_struct->fsize = lseek64(fd->fd_sys, 0, SEEK_END);
-#ifdef HPUX
- 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",
- "**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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- /* will be called by one process only */
-
-#ifdef HPUX
- err = prealloc64(fd->fd_sys, fcntl_struct->diskspace);
- /* 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",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *error_code = MPI_ERR_UNKNOWN;
-#else
- *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
- myname, "I/O Error", "%s", strerror(errno));
- ADIOI_Error(fd, *error_code, myname);
-#endif
- return;
- }
- if (err && (errno == ENOTEMPTY)) {
-#endif
-
-#ifdef SPPUX
- /* SPPUX has no prealloc64. therefore, use prealloc
- if size < (2GB - 1), otherwise use long method. */
- if (fcntl_struct->diskspace <= 2147483647) {
- err = prealloc(fd->fd_sys, (off_t) fcntl_struct->diskspace);
- if (err && (errno != ENOTEMPTY)) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *error_code = MPI_ERR_UNKNOWN;
-#else
- *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
- myname, "I/O Error", "%s", strerror(errno));
- ADIOI_Error(fd, *error_code, myname);
-#endif
- return;
- }
- }
-
- 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)
- lseek64(fd->fd_sys, fd->fp_sys_posn, SEEK_SET);
- /* not required in SPPUX since there we use pread/pwrite */
-#endif
- }
- *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
- *error_code = MPI_SUCCESS;
- break;
-
- default:
- FPRINTF(stderr, "Unknown flag passed to ADIOI_HFS_Fcntl\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
-}
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs_open.c b/3rd-party/romio321/adio/ad_hfs/ad_hfs_open.c
deleted file mode 100644
index 46ee2848e56..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs_open.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_hfs.h"
-
-#ifndef HAVE_LSEEK64
-#define lseek64 lseek
-#endif
-
-void ADIOI_HFS_Open(ADIO_File fd, int *error_code)
-{
- int perm, old_mask, amode;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_HFS_OPEN";
-#endif
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- fd->fd_sys = open64(fd->filename, amode, perm);
- fd->fd_direct = -1;
-
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) {
- fd->fp_ind = lseek64(fd->fd_sys, 0, SEEK_END);
-#ifdef HPUX
- fd->fp_sys_posn = fd->fp_ind;
-#endif
- }
-
-#ifdef SPPUX
- fd->fp_sys_posn = -1; /* set it to null bec. we use pread, pwrite*/
-#endif
-
- if (fd->fd_sys == -1 ) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs_read.c b/3rd-party/romio321/adio/ad_hfs/ad_hfs_read.c
deleted file mode 100644
index eac03ab6f80..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs_read.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_hfs.h"
-
-#ifndef HAVE_LSEEK64
-#define lseek64 lseek
-#endif
-
-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)
-{
- MPI_Count err=-1, datatype_size, len;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_HFS_READCONTIG";
-#endif
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
-#ifdef SPPUX
- fd->fp_sys_posn = -1; /* set it to null, since we are using pread */
-
- 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);
- fd->fp_ind += err;
- }
-#endif
-
-#ifdef HPUX
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- if (fd->fp_sys_posn != offset)
- 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 */
- }
- 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_sys_posn = fd->fp_ind;
- }
-#endif
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1 ) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *error_code = (err == -1) ? MPI_ERR_UNKNOWN : MPI_SUCCESS;
-#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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs_resize.c b/3rd-party/romio321/adio/ad_hfs/ad_hfs_resize.c
deleted file mode 100644
index de24ad672ae..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs_resize.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_hfs.h"
-
-void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
-{
- int err;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_HFS_RESIZE";
-#endif
-
- err = ftruncate64(fd->fd_sys, size);
- if (err == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_hfs/ad_hfs_write.c b/3rd-party/romio321/adio/ad_hfs/ad_hfs_write.c
deleted file mode 100644
index 4bffa82a2f9..00000000000
--- a/3rd-party/romio321/adio/ad_hfs/ad_hfs_write.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_hfs.h"
-
-#ifndef HAVE_LSEEK64
-#define lseek64 lseek
-#endif
-
-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)
-{
- MPI_Count err=-1, datatype_size, len;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_HFS_WRITECONTIG";
-#endif
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
-#ifdef SPPUX
- fd->fp_sys_posn = -1; /* set it to null, since we are using pwrite */
- 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);
- fd->fp_ind += err;
- }
-#endif
-
-#ifdef HPUX
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- if (fd->fp_sys_posn != offset)
- 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 */
- }
- else { /* write 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 = write(fd->fd_sys, buf, len);
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-#endif
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *error_code = MPI_SUCCESS;
-#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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/Makefile.mk b/3rd-party/romio321/adio/ad_lustre/Makefile.mk
deleted file mode 100644
index 43eaa025b94..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/Makefile.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_LUSTRE
-
-noinst_HEADERS += adio/ad_lustre/ad_lustre.h
-
-romio_other_sources += \
- adio/ad_lustre/ad_lustre.c \
- adio/ad_lustre/ad_lustre_open.c \
- adio/ad_lustre/ad_lustre_rwcontig.c \
- adio/ad_lustre/ad_lustre_wrcoll.c \
- adio/ad_lustre/ad_lustre_wrstr.c \
- adio/ad_lustre/ad_lustre_hints.c \
- adio/ad_lustre/ad_lustre_aggregate.c
-
-endif BUILD_AD_LUSTRE
-
diff --git a/3rd-party/romio321/adio/ad_lustre/README b/3rd-party/romio321/adio/ad_lustre/README
deleted file mode 100644
index a217c0f8fe5..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/README
+++ /dev/null
@@ -1,55 +0,0 @@
-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:
------------------------------------------------------
-Improved data redistribution
- o Improve I/O pattern identification. Besides checking interleaving,
- if request I/O size is small, collective I/O will be performed.
- The hint bigsize can be used to define the req size value.
- o Provide hint CO for load balancing to control the number of
- IO clients for each OST
- o Produce stripe-contiguous I/O pattern that Lustre prefers
- o Control read-modify-write in data sieving in collective IO
- by hint ds_in_coll.
- o Reduce extent lock conflicts by make each OST accessed by one or
- more constant clients.
-
------------------------------------------------------
-V04:
------------------------------------------------------
- o Direct IO and Lockless IO support
-
------------------------------------------------------
-V03:
------------------------------------------------------
- o Correct detection of fs_type when lustre: prefix is not given
- o Further fix on stripe alignment
- o Tested/Enabled striping hints over Cray XT (Catamount and CNL)
-
------------------------------------------------------
-V02:
------------------------------------------------------
-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
- Lustre stripe boundary
-
-Contributing:
- 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.
-
-Contact info:
- For more info, visit http://ft.ornl.gov/projects/io/
-
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre.c
deleted file mode 100644
index f3bc3d091b0..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include "ad_lustre.h"
-
-struct ADIOI_Fns_struct ADIO_LUSTRE_operations = {
- ADIOI_LUSTRE_Open, /* Open */
- ADIOI_GEN_OpenColl, /* OpenColl */
- ADIOI_LUSTRE_ReadContig, /* ReadContig */
- ADIOI_LUSTRE_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_LUSTRE_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_GEN_Fcntl, /* Fcntl */
- ADIOI_LUSTRE_SetInfo, /* SetInfo */
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_LUSTRE_WriteStrided, /* WriteStrided */
- ADIOI_GEN_Close, /* Close */
-#if defined(ROMIO_HAVE_WORKING_AIO) && !defined(CRAY_XT_LUSTRE)
- ADIOI_GEN_IreadContig, /* IreadContig */
- ADIOI_GEN_IwriteContig, /* IwriteContig */
-#else
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
-#endif
- ADIOI_GEN_IODone, /* ReadDone */
- ADIOI_GEN_IODone, /* WriteDone */
- ADIOI_GEN_IOComplete, /* ReadComplete */
- ADIOI_GEN_IOComplete, /* WriteComplete */
- ADIOI_GEN_IreadStrided, /* IreadStrided */
- ADIOI_GEN_IwriteStrided, /* IwriteStrided */
- ADIOI_GEN_Flush, /* Flush */
- ADIOI_GEN_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_GEN_Feature, /* Features */
- "LUSTRE:",
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre.h b/3rd-party/romio321/adio/ad_lustre/ad_lustre.h
deleted file mode 100644
index edd2bd35efd..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#ifndef AD_UNIX_INCLUDE
-#define AD_UNIX_INCLUDE
-
-/* temp*/
-#define HAVE_ASM_TYPES_H 1
-
-#include
-#include
-
-#ifdef __linux__
-# include /* necessary for: */
-# include
-# define __USE_GNU /* O_DIRECT and */
-# include /* IO operations */
-# undef __USE_GNU
-#endif /* __linux__ */
-
-/*#include */
-#include
-#include
-#include "adio.h"
-/*#include "adioi.h"*/
-
-#ifdef HAVE_SIGNAL_H
-#include
-#endif
-
-#ifdef HAVE_AIO_LITE_H
-#include
-#else
- #ifdef HAVE_AIO_H
- #include
- #endif
- #ifdef HAVE_SYS_AIO_H
- #include
- #endif
-#endif /* End of HAVE_AIO_LITE_H */
-
-void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code);
-void ADIOI_LUSTRE_Close(ADIO_File fd, int *error_code);
-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);
-void ADIOI_LUSTRE_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_LUSTRE_WriteStrided(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_LUSTRE_WriteStridedColl(ADIO_File fd, const void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code);
-void ADIOI_LUSTRE_ReadStridedColl(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code);
-void ADIOI_LUSTRE_ReadStrided(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_LUSTRE_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct,
- int *error_code);
-void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-
-/* the lustre utilities: */
-int ADIOI_LUSTRE_Docollect(ADIO_File fd, int contig_access_count,
- ADIO_Offset *len_list, int nprocs);
-
-void ADIOI_LUSTRE_Get_striping_info(ADIO_File fd, int **striping_info_ptr,
- int mode);
-void ADIOI_LUSTRE_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int contig_access_count,
- int *striping_info, int nprocs,
- int *count_my_req_procs_ptr,
- int **count_my_req_per_proc_ptr,
- ADIOI_Access **my_req_ptr,
- int ***buf_idx_ptr);
-
-int ADIOI_LUSTRE_Calc_aggregator(ADIO_File fd, ADIO_Offset off,
- ADIO_Offset *len, int *striping_info);
-#endif /* End of AD_UNIX_INCLUDE */
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_aggregate.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_aggregate.c
deleted file mode 100644
index da54d71cf59..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_aggregate.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include "ad_lustre.h"
-#include "adio_extern.h"
-
-#undef AGG_DEBUG
-
-void ADIOI_LUSTRE_Get_striping_info(ADIO_File fd, int **striping_info_ptr,
- int mode)
-{
- int *striping_info = NULL;
- /* get striping information:
- * striping_info[0]: stripe_size
- * striping_info[1]: stripe_count
- * striping_info[2]: avail_cb_nodes
- */
- int stripe_size, stripe_count, CO = 1;
- int avail_cb_nodes, divisor, nprocs_for_coll = fd->hints->cb_nodes;
-
- /* Get hints value */
- /* stripe size */
- stripe_size = fd->hints->striping_unit;
- /* stripe count */
- /* stripe_size and stripe_count have been validated in ADIOI_LUSTRE_Open() */
- stripe_count = fd->hints->striping_factor;
-
- /* Calculate the available number of I/O clients */
- if (!mode) {
- /* for collective read,
- * if "CO" clients access the same OST simultaneously,
- * the OST disk seek time would be much. So, to avoid this,
- * it might be better if 1 client only accesses 1 OST.
- * So, we set CO = 1 to meet the above requirement.
- */
- CO = 1;
- /*XXX: maybe there are other better way for collective read */
- } else {
- /* CO also has been validated in ADIOI_LUSTRE_Open(), >0 */
- CO = fd->hints->fs_hints.lustre.co_ratio;
- }
- /* 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
- * - 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
- * avail_cb_nodes should be equal to 40 */
- 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
- * avail_cb_nodes should be egal to 6 */
- /* This could be done with :
- while (stripe_count % avail_cb_nodes != 0) avail_cb_nodes--;
- but this can be optimized for large values of nprocs_for_coll and
- stripe_count */
- divisor = 2;
- avail_cb_nodes = 1;
- /* try to divise */
- while (stripe_count >= divisor*divisor) {
- if ((stripe_count % divisor) == 0) {
- if (stripe_count/divisor <= nprocs_for_coll) {
- /* The value is found ! */
- avail_cb_nodes = stripe_count/divisor;
- break;
- }
- /* 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)
- avail_cb_nodes = divisor;
- }
- divisor++;
- }
- }
-
- *striping_info_ptr = (int *) ADIOI_Malloc(3 * sizeof(int));
- striping_info = *striping_info_ptr;
- striping_info[0] = stripe_size;
- striping_info[1] = stripe_count;
- striping_info[2] = avail_cb_nodes;
-}
-
-int ADIOI_LUSTRE_Calc_aggregator(ADIO_File fd, ADIO_Offset off,
- ADIO_Offset *len, int *striping_info)
-{
- int rank_index, rank;
- ADIO_Offset avail_bytes;
- int stripe_size = striping_info[0];
- int avail_cb_nodes = striping_info[2];
-
- /* Produce the stripe-contiguous pattern for Lustre */
- rank_index = (int)((off / stripe_size) % avail_cb_nodes);
-
- /* we index into fd_end with rank_index, and fd_end was allocated to be no
- * bigger than fd->hins->cb_nodes. If we ever violate that, we're
- * overrunning arrays. Obviously, we should never ever hit this abort
- */
- if (rank_index >= fd->hints->cb_nodes)
- MPI_Abort(MPI_COMM_WORLD, 1);
-
- avail_bytes = (off / (ADIO_Offset)stripe_size + 1) *
- (ADIO_Offset)stripe_size - off;
- if (avail_bytes < *len) {
- /* this proc only has part of the requested contig. region */
- *len = avail_bytes;
- }
- /* map our index to a rank */
- /* NOTE: FOR NOW WE DON'T HAVE A MAPPING...JUST DO 0..NPROCS_FOR_COLL */
- rank = fd->hints->ranklist[rank_index];
-
- return rank;
-}
-
-/* ADIOI_LUSTRE_Calc_my_req() - calculate what portions of the access requests
- * of this process are located in the file domains of various processes
- * (including this one)
- */
-
-
-void ADIOI_LUSTRE_Calc_my_req(ADIO_File fd, ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int contig_access_count,
- int *striping_info, int nprocs,
- int *count_my_req_procs_ptr,
- int **count_my_req_per_proc_ptr,
- ADIOI_Access **my_req_ptr,
- int ***buf_idx_ptr)
-{
- /* Nothing different from ADIOI_Calc_my_req(), except calling
- * ADIOI_Lustre_Calc_aggregator() instead of the old one */
- int *count_my_req_per_proc, count_my_req_procs, **buf_idx;
- int i, l, proc;
- ADIO_Offset avail_len, rem_len, curr_idx, off;
- ADIOI_Access *my_req;
-
- *count_my_req_per_proc_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- count_my_req_per_proc = *count_my_req_per_proc_ptr;
- /* count_my_req_per_proc[i] gives the no. of contig. requests of this
- * process in process i's file domain. calloc initializes to zero.
- * I'm allocating memory of size nprocs, so that I can do an
- * MPI_Alltoall later on.
- */
-
- buf_idx = (int **) ADIOI_Malloc(nprocs * sizeof(int*));
-
- /* one pass just to calculate how much space to allocate for my_req;
- * contig_access_count was calculated way back in ADIOI_Calc_my_off_len()
- */
- for (i = 0; i < contig_access_count; i++) {
- /* short circuit offset/len processing if len == 0
- * (zero-byte read/write
- */
- if (len_list[i] == 0)
- continue;
- off = offset_list[i];
- avail_len = len_list[i];
- /* note: we set avail_len to be the total size of the access.
- * then ADIOI_LUSTRE_Calc_aggregator() will modify the value to return
- * the amount that was available.
- */
- proc = ADIOI_LUSTRE_Calc_aggregator(fd, off, &avail_len, striping_info);
- count_my_req_per_proc[proc]++;
-
- /* figure out how many data is remaining in the access
- * we'll take care of this data (if there is any)
- * in the while loop below.
- */
- rem_len = len_list[i] - avail_len;
-
- while (rem_len != 0) {
- off += avail_len; /* point to first remaining byte */
- avail_len = rem_len; /* save remaining size, pass to calc */
- proc = ADIOI_LUSTRE_Calc_aggregator(fd, off, &avail_len, striping_info);
- count_my_req_per_proc[proc]++;
- rem_len -= avail_len; /* reduce remaining length by amount from fd */
- }
- }
-
- /* buf_idx is relevant only if buftype_is_contig.
- * buf_idx[i] gives the index into user_buf where data received
- * from proc 'i' should be placed. This allows receives to be done
- * without extra buffer. This can't be done if buftype is not contig.
- */
-
- /* initialize buf_idx vectors */
- 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));
- }
-
- /* now allocate space for my_req, offset, and len */
- *my_req_ptr = (ADIOI_Access *) ADIOI_Malloc(nprocs * sizeof(ADIOI_Access));
- my_req = *my_req_ptr;
-
- count_my_req_procs = 0;
- for (i = 0; i < nprocs; i++) {
- if (count_my_req_per_proc[i]) {
- my_req[i].offsets = (ADIO_Offset *)
- ADIOI_Malloc(count_my_req_per_proc[i] *
- sizeof(ADIO_Offset));
- my_req[i].lens = ADIOI_Malloc(count_my_req_per_proc[i] *
- sizeof(ADIO_Offset));
- count_my_req_procs++;
- }
- my_req[i].count = 0; /* will be incremented where needed later */
- }
-
- /* now fill in my_req */
- curr_idx = 0;
- for (i = 0; i < contig_access_count; i++) {
- /* short circuit offset/len processing if len == 0
- * (zero-byte read/write */
- if (len_list[i] == 0)
- continue;
- off = offset_list[i];
- avail_len = len_list[i];
- proc = ADIOI_LUSTRE_Calc_aggregator(fd, off, &avail_len, striping_info);
-
- l = my_req[proc].count;
-
- ADIOI_Assert(curr_idx == (int) curr_idx);
- ADIOI_Assert(l < count_my_req_per_proc[proc]);
- buf_idx[proc][l] = (int) curr_idx;
- curr_idx += avail_len;
-
- rem_len = len_list[i] - avail_len;
-
- /* store the proc, offset, and len information in an array
- * of structures, my_req. Each structure contains the
- * offsets and lengths located in that process's FD,
- * and the associated count.
- */
- my_req[proc].offsets[l] = off;
- ADIOI_Assert(avail_len == (int) avail_len);
- my_req[proc].lens[l] = (int) avail_len;
- my_req[proc].count++;
-
- while (rem_len != 0) {
- off += avail_len;
- avail_len = rem_len;
- proc = ADIOI_LUSTRE_Calc_aggregator(fd, off, &avail_len,
- striping_info);
-
- l = my_req[proc].count;
- ADIOI_Assert(curr_idx == (int) curr_idx);
- ADIOI_Assert(l < count_my_req_per_proc[proc]);
- buf_idx[proc][l] = (int) curr_idx;
-
- curr_idx += avail_len;
- rem_len -= avail_len;
-
- my_req[proc].offsets[l] = off;
- ADIOI_Assert(avail_len == (int) avail_len);
- my_req[proc].lens[l] = (int) avail_len;
- my_req[proc].count++;
- }
- }
-
-#ifdef AGG_DEBUG
- for (i = 0; i < nprocs; i++) {
- if (count_my_req_per_proc[i] > 0) {
- FPRINTF(stdout, "data needed from %d (count = %d):\n",
- i, my_req[i].count);
- for (l = 0; l < my_req[i].count; l++) {
- FPRINTF(stdout, " off[%d] = %lld, len[%d] = %d\n",
- l, my_req[i].offsets[l], l, my_req[i].lens[l]);
- }
- }
- }
-#endif
-
- *count_my_req_procs_ptr = count_my_req_procs;
- *buf_idx_ptr = buf_idx;
-}
-
-int ADIOI_LUSTRE_Docollect(ADIO_File fd, int contig_access_count,
- ADIO_Offset *len_list, int nprocs)
-{
- /* If the processes are non-interleaved, we will check the req_size.
- * if (avg_req_size > big_req_size) {
- * docollect = 0;
- * }
- */
-
- int i, docollect = 1, big_req_size = 0;
- ADIO_Offset req_size = 0, total_req_size;
- int avg_req_size, total_access_count;
-
- /* calculate total_req_size and total_access_count */
- for (i = 0; i < contig_access_count; i++)
- req_size += len_list[i];
- MPI_Allreduce(&req_size, &total_req_size, 1, MPI_LONG_LONG_INT, MPI_SUM,
- fd->comm);
- MPI_Allreduce(&contig_access_count, &total_access_count, 1, MPI_INT, MPI_SUM,
- fd->comm);
- /* 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 */
- if ((big_req_size > 0) && (avg_req_size > big_req_size))
- docollect = 0;
-
- return docollect;
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_fcntl.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_fcntl.c
deleted file mode 100644
index a4bd6fc6d17..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_fcntl.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- */
-
-#include "ad_lustre.h"
-#include "adio_extern.h"
-
-void ADIOI_LUSTRE_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code)
-{
- int i, ntimes;
- ADIO_Offset curr_fsize, alloc_size, size, len, done;
- ADIO_Status status;
- char *buf;
-#if defined(MPICH) || !defined(PRINT_ERR_MSG)
- static char myname[] = "ADIOI_LUSTRE_FCNTL";
-#endif
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
- fcntl_struct->fsize = lseek(fd->fd_sys, 0, SEEK_END);
- 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__,
- MPI_ERR_IO, "**io", "**io %s", strerror(errno));
- }
- else *error_code = MPI_SUCCESS;
- break;
-
- 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
- preallocation is needed.
- read/write in sizes of no more than ADIOI_PREALLOC_BUFSZ */
-
- curr_fsize = lseek(fd->fd_sys, 0, SEEK_END);
- 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;
-
- for (i=0; i curr_fsize) {
- memset(buf, 0, ADIOI_PREALLOC_BUFSZ);
- size = alloc_size - curr_fsize;
- ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ;
- for (i=0; ifp_sys_posn != -1)
- lseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET);
- *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
- *error_code = MPI_SUCCESS;
- break;
-
- default:
- FPRINTF(stderr, "Unknown flag passed to ADIOI_LUSTRE_Fcntl\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_hints.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_hints.c
deleted file mode 100644
index 1d40c86f26a..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_hints.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include "ad_lustre.h"
-#include "adio_extern.h"
-#include "hint_fns.h"
-#ifdef HAVE_LIMITS_H
-#include
-#endif
-
-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 myrank;
- static char myname[] = "ADIOI_LUSTRE_SETINFO";
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- if ( (fd->info) == MPI_INFO_NULL) {
- /* This must be part of the open call. can set striping parameters
- if necessary. */
- MPI_Info_create(&(fd->info));
-
- ADIOI_Info_set(fd->info, "direct_read", "false");
- ADIOI_Info_set(fd->info, "direct_write", "false");
- fd->direct_read = fd->direct_write = 0;
- /* initialize lustre hints */
- ADIOI_Info_set(fd->info, "romio_lustre_co_ratio", "1");
- fd->hints->fs_hints.lustre.co_ratio = 1;
- ADIOI_Info_set(fd->info, "romio_lustre_coll_threshold", "0");
- fd->hints->fs_hints.lustre.coll_threshold = 0;
- ADIOI_Info_set(fd->info, "romio_lustre_ds_in_coll", "enable");
- fd->hints->fs_hints.lustre.ds_in_coll = ADIOI_HINT_ENABLE;
-
- /* has user specified striping or server buffering parameters
- and do they have the same value on all processes? */
- if (users_info != MPI_INFO_NULL) {
- /* striping information */
- ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- ADIOI_Info_set(fd->info, "striping_unit", value);
- str_unit=atoll(value);
- }
-
- ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- ADIOI_Info_set(fd->info, "striping_factor", value);
- str_factor=atoll(value);
- }
-
- ADIOI_Info_get(users_info, "romio_lustre_start_iodevice",
- MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
- start_iodev=atoll(value);
- }
-
-
- /* direct read and write */
- ADIOI_Info_get(users_info, "direct_read", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (!strcmp(value, "true") || !strcmp(value, "TRUE"))) {
- ADIOI_Info_set(fd->info, "direct_read", "true");
- fd->direct_read = 1;
- }
- ADIOI_Info_get(users_info, "direct_write", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (!strcmp(value, "true") || !strcmp(value, "TRUE"))) {
- ADIOI_Info_set(fd->info, "direct_write", "true");
- fd->direct_write = 1;
- }
- }
-
- /* set striping information with ioctl */
- MPI_Comm_rank(fd->comm, &myrank);
- if (myrank == 0) {
- stripe_val[0] = str_factor;
- stripe_val[1] = str_unit;
- stripe_val[2] = start_iodev;
- }
- MPI_Bcast(stripe_val, 3, MPI_OFFSET, 0, fd->comm);
-
- /* do not open file in hint processing. Open file in open routines,
- * where we can better deal with EXCL flag . Continue to check the
- * "all processors set a value" condition holds. */
- if (stripe_val[0] != str_factor
- || stripe_val[1] != str_unit
- || stripe_val[2] != start_iodev) {
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME("ADIOI_LUSTRE_SetInfo",
- "str_factor or str_unit or start_iodev",
- error_code);
- ADIOI_Free(value);
- return;
- }
- }
-
- /* get other hint */
- 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",
- &(fd->hints->fs_hints.lustre.co_ratio), myname, error_code );
-
- /* coll_threshold:
- * if the req size is bigger than this, collective IO may not be performed.
- */
- ADIOI_Info_check_and_install_int(fd, users_info, "romio_lustre_coll_threshold",
- &(fd->hints->fs_hints.lustre.coll_threshold), myname, error_code );
-
- /* ds_in_coll: disable data sieving in collective IO */
- ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_lustre_ds_in_coll",
- &(fd->hints->fs_hints.lustre.ds_in_coll), myname, 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;
-
- ADIOI_Free(value);
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_open.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_open.c
deleted file mode 100644
index a3b03be9eaf..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_open.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include "ad_lustre.h"
-
-/* what is the basis for this define?
- * what happens if there are more than 1k UUIDs? */
-
-#define MAX_LOV_UUID_COUNT 1000
-
-void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
-{
- int perm, old_mask, amode, amode_direct;
- int lumlen, myrank, flag, set_layout=0, err;
- struct lov_user_md *lum = NULL;
- char *value;
- ADIO_Offset str_factor = -1, str_unit=0, start_iodev=-1;
-
-#if defined(MPICH) || !defined(PRINT_ERR_MSG)
- static char myname[] = "ADIOI_LUSTRE_OPEN";
-#endif
-
- MPI_Comm_rank(fd->comm, &myrank);
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- amode_direct = amode | O_DIRECT;
-
- /* odd length here because lov_user_md contains some fixed data and
- * then a list of 'lmm_objects' representing stripe */
- lumlen = sizeof(struct lov_user_md) +
- MAX_LOV_UUID_COUNT * sizeof(struct lov_user_ost_data);
- lum = (struct lov_user_md *)ADIOI_Calloc(1,lumlen);
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- /* we already validated in LUSTRE_SetInfo that these are going to be the same */
- if (fd->info != MPI_INFO_NULL) {
- /* striping information */
- ADIOI_Info_get(fd->info, "striping_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag)
- str_unit=atoll(value);
-
- ADIOI_Info_get(fd->info, "striping_factor", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag)
- str_factor=atoll(value);
-
- ADIOI_Info_get(fd->info, "romio_lustre_start_iodevice",
- MPI_MAX_INFO_VAL, value, &flag);
- if (flag)
- start_iodev=atoll(value);
- }
- if ((str_factor > 0) || (str_unit > 0) || (start_iodev >= 0))
- set_layout = 1;
-
- /* if hints were set, we need to delay creation of any lustre objects.
- * However, if we open the file with O_LOV_DELAY_CREATE and don't call the
- * follow-up ioctl, subsequent writes will fail */
- if (myrank == 0 && set_layout)
- amode = amode | O_LOV_DELAY_CREATE;
-
- fd->fd_sys = open(fd->filename, amode, perm);
- if (fd->fd_sys == -1) goto fn_exit;
-
- /* we can only set these hints on new files */
- /* It was strange and buggy to open the file in the hint path. Instead,
- * we'll apply the file tunings at open time */
- if ((amode & O_CREAT) && set_layout ) {
- /* if user has specified striping info, process 0 tries to set it */
- if (!myrank) {
- lum->lmm_magic = LOV_USER_MAGIC;
- lum->lmm_pattern = 0;
- /* crude check for overflow of lustre internal datatypes.
- * Silently cap to large value if user provides a value
- * larger than lustre supports */
- if (str_unit > UINT_MAX)
- lum->lmm_stripe_size = UINT_MAX;
- else
- lum->lmm_stripe_size = str_unit;
-
- if (str_factor > USHRT_MAX)
- lum->lmm_stripe_count = USHRT_MAX;
- else
- lum->lmm_stripe_count = str_factor;
-
- if (start_iodev > USHRT_MAX)
- lum->lmm_stripe_offset = USHRT_MAX;
- else
- lum->lmm_stripe_offset = start_iodev;
- err = ioctl(fd->fd_sys, LL_IOC_LOV_SETSTRIPE, lum);
- if (err == -1 && errno != EEXIST) {
- fprintf(stderr, "Failure to set stripe info %s \n", strerror(errno));
- /* not a fatal error, but user might care to know */
- }
- } /* End of striping parameters validation */
- }
-
- /* Pascal Deveze reports that, even though we pass a
- * "GETSTRIPE" (read) flag to the ioctl, if some of the values of this
- * struct are uninitialzed, the call can give an error. zero it out in case
- * there are other members that must be initialized and in case
- * lov_user_md struct changes in future */
- memset(lum, 0, lumlen);
- lum->lmm_magic = LOV_USER_MAGIC;
- err = ioctl(fd->fd_sys, LL_IOC_LOV_GETSTRIPE, (void *)lum);
- if (!err) {
-
- fd->hints->striping_unit = lum->lmm_stripe_size;
- sprintf(value, "%d", lum->lmm_stripe_size);
- ADIOI_Info_set(fd->info, "striping_unit", value);
-
- fd->hints->striping_factor = lum->lmm_stripe_count;
- sprintf(value, "%d", lum->lmm_stripe_count);
- ADIOI_Info_set(fd->info, "striping_factor", value);
-
- fd->hints->fs_hints.lustre.start_iodevice = lum->lmm_stripe_offset;
- sprintf(value, "%d", lum->lmm_stripe_offset);
- ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
-
- }
-
- if (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);
- if (fd->fd_direct != -1) {
- fd->d_mem = fd->d_miniosz = (1<<12);
- } else {
- perror("cannot open file with O_Direct");
- 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) &&
- (fd->direct_write || fd->direct_read))) {
- *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
- }
- /* --END ERROR HANDLING-- */
- else *error_code = MPI_SUCCESS;
-
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_rwcontig.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_rwcontig.c
deleted file mode 100644
index cb187a39e9c..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_rwcontig.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include
-
-#include
-#include
-#include "ad_lustre.h"
-
-#define LUSTRE_MEMALIGN (1<<12) /* to use page_shift */
-
-static void ADIOI_LUSTRE_Aligned_Mem_File_Write(ADIO_File fd, const void *buf, int len,
- ADIO_Offset offset, int *err);
-static void ADIOI_LUSTRE_Aligned_Mem_File_Write(ADIO_File fd, const void *buf, int len,
- ADIO_Offset offset, int *err)
-{
- int rem, size, nbytes;
- if (!(len % fd->d_miniosz) && (len >= fd->d_miniosz)) {
- *err = pwrite(fd->fd_direct, buf, len, offset);
- } else if (len < fd->d_miniosz) {
- *err = pwrite(fd->fd_sys, buf, len, offset);
- } else {
- rem = len % fd->d_miniosz;
- size = len - rem;
- nbytes = pwrite(fd->fd_direct, buf, size, offset);
- nbytes += pwrite(fd->fd_sys, ((char *)buf) + size, rem, offset+size);
- *err = nbytes;
- }
-}
-
-static void ADIOI_LUSTRE_Aligned_Mem_File_Read(ADIO_File fd, const void *buf, int len,
- ADIO_Offset offset, int *err);
-static void ADIOI_LUSTRE_Aligned_Mem_File_Read(ADIO_File fd, const void *buf, int len,
- ADIO_Offset offset, int *err)
-{
- int rem, size, nbytes;
- if (!(len % fd->d_miniosz) && (len >= fd->d_miniosz))
- *err = pread(fd->fd_direct, (void *)buf, len, offset);
- else if (len < fd->d_miniosz)
- *err = pread(fd->fd_sys, (void *)buf, len, offset);
- else {
- rem = len % fd->d_miniosz;
- size = len - rem;
- nbytes = pread(fd->fd_direct, (void *)buf, size, offset);
- nbytes += pread(fd->fd_sys, ((char *)buf) + size, rem, offset+size);
- *err = nbytes;
- }
-}
-
-
-static int ADIOI_LUSTRE_Directio(ADIO_File fd, const void *buf, int len,
- off_t offset, int rw);
-static int ADIOI_LUSTRE_Directio(ADIO_File fd, const void *buf, int len,
- off_t offset, int rw)
-{
- int err=-1, diff, size=len, nbytes = 0;
- void *newbuf;
-
- if (offset % fd->d_miniosz) {
- diff = fd->d_miniosz - (offset % fd->d_miniosz);
- diff = ADIOI_MIN(diff, len);
- if (rw)
- nbytes = pwrite(fd->fd_sys, (void *)buf, diff, offset);
- else
- nbytes = pread(fd->fd_sys, (void *)buf, diff, offset);
- buf = ((char *) buf) + diff;
- offset += diff;
- size = len - diff;
- }
-
- if (!size) {
- return diff;
- }
-
- if (rw) { /* direct I/O enabled */
- if (!(((long) buf) % fd->d_mem)) {
- ADIOI_LUSTRE_Aligned_Mem_File_Write(fd, buf, size, offset, &err);
- nbytes += err;
- } else {
- newbuf = (void *) memalign(LUSTRE_MEMALIGN, size);
- if (newbuf) {
- memcpy(newbuf, buf, size);
- ADIOI_LUSTRE_Aligned_Mem_File_Write(fd, newbuf, size, offset, &err);
- nbytes += err;
- ADIOI_Free(newbuf);
- }
- else nbytes += pwrite(fd->fd_sys, buf, size, offset);
- }
- err = nbytes;
- } else {
- if (!(((long) buf) % fd->d_mem)) {
- ADIOI_LUSTRE_Aligned_Mem_File_Read(fd, buf, size, offset, &err);
- nbytes += err;
- } else {
- newbuf = (void *) memalign(LUSTRE_MEMALIGN, size);
- if (newbuf) {
- ADIOI_LUSTRE_Aligned_Mem_File_Read(fd, newbuf, size, offset, &err);
- if (err > 0) memcpy((void *)buf, newbuf, err);
- nbytes += err;
- ADIOI_Free(newbuf);
- }
- else nbytes += pread(fd->fd_sys, (void *)buf, size, offset);
- }
- err = nbytes;
- }
- return err;
-}
-
-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,
- 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,
- int io_mode, int *error_code)
-{
- int err=-1;
- MPI_Count datatype_size, len;
- static char myname[] = "ADIOI_LUSTRE_IOCONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind;
- }
-
- if (!(fd->direct_read || fd->direct_write)) {
- if (fd->fp_sys_posn != offset) {
- 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);
-#endif
- err = write(fd->fd_sys, buf, len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_write_b, 0, NULL);
-#endif
- } else {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_read_a, 0, NULL);
-#endif
- err = read(fd->fd_sys, (void *)buf, len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_read_b, 0, NULL);
-#endif
- }
- } else {
- err = ADIOI_LUSTRE_Directio(fd, buf, len, offset, io_mode);
- }
-
- if (err == -1) goto ioerr;
- fd->fp_sys_posn = offset + err;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- fd->fp_ind += err;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (status) MPIR_Status_set_bytes(status, datatype, err);
-#endif
- *error_code = MPI_SUCCESS;
-
-ioerr:
- /* --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-- */
-}
-
-void ADIOI_LUSTRE_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)
-{
- ADIOI_LUSTRE_IOContig(fd, buf, count, datatype, file_ptr_type,
- offset, status, 1, error_code);
-}
-
-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)
-{
- ADIOI_LUSTRE_IOContig(fd, buf, count, datatype, file_ptr_type,
- offset, status, 0, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_wrcoll.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_wrcoll.c
deleted file mode 100644
index c034d42827a..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_wrcoll.c
+++ /dev/null
@@ -1,986 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include "ad_lustre.h"
-#include "adio_extern.h"
-
-/* prototypes of functions used for collective writes only. */
-static void ADIOI_LUSTRE_Exch_and_write(ADIO_File fd, const void *buf,
- MPI_Datatype datatype, int nprocs,
- int myrank,
- ADIOI_Access *others_req,
- ADIOI_Access *my_req,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list,
- int contig_access_count,
- int *striping_info,
- int **buf_idx, int *error_code);
-static void ADIOI_LUSTRE_Fill_send_buffer(ADIO_File fd, const void *buf,
- ADIOI_Flatlist_node *flat_buf,
- char **send_buf,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int *send_size,
- MPI_Request *requests,
- int *sent_to_proc, int nprocs,
- int myrank, int contig_access_count,
- int *striping_info,
- int *send_buf_idx,
- int *curr_to_proc,
- int *done_to_proc, int iter,
- MPI_Aint buftype_extent);
-static void ADIOI_LUSTRE_W_Exchange_data(ADIO_File fd, const void *buf,
- char *write_buf,
- ADIOI_Flatlist_node *flat_buf,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int *send_size,
- int *recv_size, ADIO_Offset off,
- int size, int *count,
- int *start_pos,
- int *sent_to_proc, int nprocs,
- int myrank, int buftype_is_contig,
- int contig_access_count,
- int *striping_info,
- ADIOI_Access *others_req,
- int *send_buf_idx,
- int *curr_to_proc,
- int *done_to_proc, int *hole,
- int iter, MPI_Aint buftype_extent,
- int *buf_idx,
- ADIO_Offset **srt_off, int **srt_len, int *srt_num,
- int *error_code);
-void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count,
- ADIO_Offset *srt_off, int *srt_len, int *start_pos,
- int nprocs, int nprocs_recv, int total_elements);
-
-void ADIOI_LUSTRE_WriteStridedColl(ADIO_File fd, const void *buf, int count,
- MPI_Datatype datatype,
- int file_ptr_type, ADIO_Offset offset,
- ADIO_Status *status, int *error_code)
-{
- /* Uses a generalized version of the extended two-phase method described
- * in "An Extended Two-Phase Method for Accessing Sections of
- * Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary,
- * Scientific Programming, (5)4:301--317, Winter 1996.
- * http://www.mcs.anl.gov/home/thakur/ext2ph.ps
- */
-
- ADIOI_Access *my_req;
- /* array of nprocs access structures, one for each other process has
- this process's request */
-
- ADIOI_Access *others_req;
- /* array of nprocs access structures, one for each other process
- whose request is written by this process. */
-
- int i, filetype_is_contig, nprocs, myrank, do_collect = 0;
- int contig_access_count = 0, buftype_is_contig, interleave_count = 0;
- int *count_my_req_per_proc, count_my_req_procs, count_others_req_procs;
- ADIO_Offset orig_fp, start_offset, end_offset, off;
- ADIO_Offset *offset_list = NULL, *st_offsets = NULL, *end_offsets = NULL;
- ADIO_Offset *len_list = NULL;
- int **buf_idx = NULL, *striping_info = NULL;
- int old_error, tmp_error;
-
- MPI_Comm_size(fd->comm, &nprocs);
- MPI_Comm_rank(fd->comm, &myrank);
-
- orig_fp = fd->fp_ind;
-
- /* IO patten identification if cb_write isn't disabled */
- if (fd->hints->cb_write != ADIOI_HINT_DISABLE) {
- /* For this process's request, calculate the list of offsets and
- lengths in the file and determine the start and end offsets. */
-
- /* Note: end_offset points to the last byte-offset that will be accessed.
- * e.g., if start_offset=0 and 100 bytes to be read, end_offset=99
- */
-
- ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset,
- &offset_list, &len_list, &start_offset,
- &end_offset, &contig_access_count);
-
- /* each process communicates its start and end offsets to other
- * processes. The result is an array each of start and end offsets
- * stored in order of process rank.
- */
- st_offsets = (ADIO_Offset *) ADIOI_Malloc(nprocs * sizeof(ADIO_Offset));
- end_offsets = (ADIO_Offset *) ADIOI_Malloc(nprocs * sizeof(ADIO_Offset));
- MPI_Allgather(&start_offset, 1, ADIO_OFFSET, st_offsets, 1,
- ADIO_OFFSET, fd->comm);
- MPI_Allgather(&end_offset, 1, ADIO_OFFSET, end_offsets, 1,
- ADIO_OFFSET, fd->comm);
- /* are the accesses of different processes interleaved? */
- for (i = 1; i < nprocs; i++)
- if ((st_offsets[i] < end_offsets[i-1]) &&
- (st_offsets[i] <= end_offsets[i]))
- interleave_count++;
- /* This is a rudimentary check for interleaving, but should suffice
- for the moment. */
-
- /* Two typical access patterns can benefit from collective write.
- * 1) the processes are interleaved, and
- * 2) the req size is small.
- */
- if (interleave_count > 0) {
- do_collect = 1;
- } else {
- do_collect = ADIOI_LUSTRE_Docollect(fd, contig_access_count,
- len_list, nprocs);
- }
- }
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
-
- /* Decide if collective I/O should be done */
- if ((!do_collect && fd->hints->cb_write == ADIOI_HINT_AUTO) ||
- fd->hints->cb_write == ADIOI_HINT_DISABLE) {
-
- /* use independent accesses */
- if (fd->hints->cb_write != ADIOI_HINT_DISABLE) {
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- }
-
- fd->fp_ind = orig_fp;
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- if (buftype_is_contig && filetype_is_contig) {
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset;
- ADIO_WriteContig(fd, buf, count, datatype,
- ADIO_EXPLICIT_OFFSET,
- off, status, error_code);
- } else
- ADIO_WriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL,
- 0, status, error_code);
- } else {
- ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type,
- offset, status, error_code);
- }
- return;
- }
-
- /* Get Lustre hints information */
- ADIOI_LUSTRE_Get_striping_info(fd, &striping_info, 1);
-
- /* calculate what portions of the access requests of this process are
- * located in which process
- */
- ADIOI_LUSTRE_Calc_my_req(fd, offset_list, len_list, contig_access_count,
- striping_info, nprocs, &count_my_req_procs,
- &count_my_req_per_proc, &my_req,
- &buf_idx);
-
- /* based on everyone's my_req, calculate what requests of other processes
- * will be accessed by this process.
- * count_others_req_procs = number of processes whose requests (including
- * this process itself) will be accessed by this process
- * count_others_req_per_proc[i] indicates how many separate contiguous
- * requests of proc. i will be accessed by this process.
- */
-
- 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_Free(count_my_req_per_proc);
-
- /* exchange data and write in sizes of no more than stripe_size. */
- ADIOI_LUSTRE_Exch_and_write(fd, buf, datatype, nprocs, myrank,
- others_req, my_req, offset_list, len_list,
- contig_access_count, striping_info,
- buf_idx, error_code);
-
- /* If this collective write is followed by an independent write,
- * it's possible to have those subsequent writes on other processes
- * race ahead and sneak in before the read-modify-write completes.
- * We carry out a collective communication at the end here so no one
- * can start independent i/o before collective I/O completes.
- *
- * need to do some gymnastics with the error codes so that if something
- * went wrong, all processes report error, but if a process has a more
- * specific error code, we can still have that process report the
- * additional information */
-
- old_error = *error_code;
- if (*error_code != MPI_SUCCESS)
- *error_code = MPI_ERR_IO;
-
- /* optimization: if only one process performing i/o, we can perform
- * a less-expensive Bcast */
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_postwrite_a, 0, NULL);
-#endif
- if (fd->hints->cb_nodes == 1)
- MPI_Bcast(error_code, 1, MPI_INT,
- fd->hints->ranklist[0], fd->comm);
- else {
- tmp_error = *error_code;
- MPI_Allreduce(&tmp_error, error_code, 1, MPI_INT,
- MPI_MAX, fd->comm);
- }
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event(ADIOI_MPE_postwrite_b, 0, NULL);
-#endif
-
- if ((old_error != MPI_SUCCESS) && (old_error != MPI_ERR_IO))
- *error_code = old_error;
-
-
- if (!buftype_is_contig)
- ADIOI_Delete_flattened(datatype);
-
- /* free all memory allocated for collective I/O */
- /* free others_req */
- for (i = 0; i < nprocs; i++) {
- if (others_req[i].count) {
- ADIOI_Free(others_req[i].offsets);
- ADIOI_Free(others_req[i].lens);
- ADIOI_Free(others_req[i].mem_ptrs);
- }
- }
- ADIOI_Free(others_req);
- /* free my_req here */
- for (i = 0; i < nprocs; i++) {
- if (my_req[i].count) {
- ADIOI_Free(my_req[i].offsets);
- ADIOI_Free(my_req[i].lens);
- }
- }
- ADIOI_Free(my_req);
- for (i = 0; i < nprocs; i++) {
- ADIOI_Free(buf_idx[i]);
- }
- ADIOI_Free(buf_idx);
- ADIOI_Free(offset_list);
- ADIOI_Free(len_list);
- ADIOI_Free(st_offsets);
- ADIOI_Free(end_offsets);
- ADIOI_Free(striping_info);
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (status) {
- MPI_Count bufsize, size;
- /* Don't set status if it isn't needed */
- 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 written during collective I/O.
- */
-#endif
-
- fd->fp_sys_posn = -1; /* set it to null. */
-}
-
-/* If successful, error_code is set to MPI_SUCCESS. Otherwise an error
- * code is created and returned in error_code.
- */
-static void ADIOI_LUSTRE_Exch_and_write(ADIO_File fd, const void *buf,
- MPI_Datatype datatype, int nprocs,
- int myrank, ADIOI_Access *others_req,
- ADIOI_Access *my_req,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list,
- int contig_access_count,
- int *striping_info, int **buf_idx,
- int *error_code)
-{
- /* Send data to appropriate processes and write in sizes of no more
- * than lustre stripe_size.
- * The idea is to reduce the amount of extra memory required for
- * collective I/O. If all data were written all at once, which is much
- * easier, it would require temp space more than the size of user_buf,
- * which is often unacceptable. For example, to write a distributed
- * array to a file, where each local array is 8Mbytes, requiring
- * at least another 8Mbytes of temp space is unacceptable.
- */
-
- int hole, i, j, m, flag, ntimes = 1 , max_ntimes, buftype_is_contig;
- ADIO_Offset st_loc = -1, end_loc = -1, min_st_loc, max_end_loc;
- ADIO_Offset off, req_off, send_off, iter_st_off, *off_list;
- ADIO_Offset max_size, step_size = 0;
- int real_size, req_len, send_len;
- int *recv_curr_offlen_ptr, *recv_count, *recv_size;
- int *send_curr_offlen_ptr, *send_size;
- int *sent_to_proc, *recv_start_pos;
- int *send_buf_idx, *curr_to_proc, *done_to_proc;
- int *this_buf_idx;
- char *write_buf = NULL;
- MPI_Status status;
- ADIOI_Flatlist_node *flat_buf = NULL;
- MPI_Aint buftype_extent, buftype_lb;
- int stripe_size = striping_info[0], avail_cb_nodes = striping_info[2];
- int data_sieving = 0;
- ADIO_Offset *srt_off = NULL;
- int *srt_len = NULL;
- int srt_num = 0;
- ADIO_Offset block_offset;
- int block_len;
-
- *error_code = MPI_SUCCESS; /* changed below if error */
- /* only I/O errors are currently reported */
-
- /* calculate the number of writes of stripe size to be done.
- * That gives the no. of communication phases as well.
- * Note:
- * Because we redistribute data in stripe-contiguous pattern for Lustre,
- * each process has the same no. of communication phases.
- */
-
- for (i = 0; i < nprocs; i++) {
- if (others_req[i].count) {
- st_loc = others_req[i].offsets[0];
- end_loc = others_req[i].offsets[0];
- break;
- }
- }
- for (i = 0; i < nprocs; i++) {
- for (j = 0; j < others_req[i].count; j++) {
- st_loc = ADIOI_MIN(st_loc, others_req[i].offsets[j]);
- end_loc = ADIOI_MAX(end_loc, (others_req[i].offsets[j] +
- others_req[i].lens[j] - 1));
- }
- }
- /* this process does no writing. */
- if ((st_loc == -1) && (end_loc == -1))
- ntimes = 0;
- MPI_Allreduce(&end_loc, &max_end_loc, 1, MPI_LONG_LONG_INT, MPI_MAX, fd->comm);
- /* avoid min_st_loc be -1 */
- if (st_loc == -1)
- st_loc = max_end_loc;
- MPI_Allreduce(&st_loc, &min_st_loc, 1, MPI_LONG_LONG_INT, MPI_MIN, fd->comm);
- /* align downward */
- min_st_loc -= min_st_loc % (ADIO_Offset)stripe_size;
-
- /* Each time, only avail_cb_nodes number of IO clients perform IO,
- * so, step_size=avail_cb_nodes*stripe_size IO will be performed at most,
- * and ntimes=whole_file_portion/step_size
- */
- step_size = (ADIO_Offset) avail_cb_nodes * stripe_size;
- max_ntimes = (max_end_loc - min_st_loc + 1) / step_size
- + (((max_end_loc - min_st_loc + 1) % step_size) ? 1 : 0);
-/* max_ntimes = (int)((max_end_loc - min_st_loc) / step_size + 1); */
- if (ntimes)
- write_buf = (char *) ADIOI_Malloc(stripe_size);
-
- /* calculate the start offset for each iteration */
- off_list = (ADIO_Offset *) ADIOI_Malloc(max_ntimes * sizeof(ADIO_Offset));
- for (m = 0; m < max_ntimes; m ++)
- off_list[m] = max_end_loc;
- for (i = 0; i < nprocs; i++) {
- for (j = 0; j < others_req[i].count; j ++) {
- req_off = others_req[i].offsets[j];
- m = (int)((req_off - min_st_loc) / step_size);
- off_list[m] = ADIOI_MIN(off_list[m], req_off);
- }
- }
-
- recv_curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- send_curr_offlen_ptr = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- /* their use is explained below. calloc initializes to 0. */
-
- recv_count = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* to store count of how many off-len pairs per proc are satisfied
- in an iteration. */
-
- send_size = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* total size of data to be sent to each proc. in an iteration.
- Of size nprocs so that I can use MPI_Alltoall later. */
-
- recv_size = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* total size of data to be recd. from each proc. in an iteration. */
-
- sent_to_proc = (int *) ADIOI_Calloc(nprocs, sizeof(int));
- /* amount of data sent to each proc so far. Used in
- ADIOI_Fill_send_buffer. initialized to 0 here. */
-
- send_buf_idx = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- curr_to_proc = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- done_to_proc = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* Above three are used in ADIOI_Fill_send_buffer */
-
- this_buf_idx = (int *) ADIOI_Malloc(nprocs * sizeof(int));
-
- recv_start_pos = (int *) ADIOI_Malloc(nprocs * sizeof(int));
- /* used to store the starting value of recv_curr_offlen_ptr[i] in
- this iteration */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- if (!buftype_is_contig) {
- 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
- * the file, which could potentially interfere with the writes taking
- * place in this collective write call. Since this is not likely to be
- * common, let me do the simplest thing possible here: Each process
- * completes all pending nonblocking operations before completing.
- */
- /*ADIOI_Complete_async(error_code);
- if (*error_code != MPI_SUCCESS) return;
- MPI_Barrier(fd->comm);
- */
-
- iter_st_off = min_st_loc;
-
- /* Although we have recognized the data according to OST index,
- * a read-modify-write will be done if there is a hole between the data.
- * For example: if blocksize=60, xfersize=30 and stripe_size=100,
- * then rank0 will collect data [0, 30] and [60, 90] then write. There
- * is a hole in [30, 60], which will cause a read-modify-write in [0, 90].
- *
- * To reduce its impact on the performance, we can disable data sieving
- * by hint "ds_in_coll".
- */
- /* check the hint for data sieving */
- data_sieving = fd->hints->fs_hints.lustre.ds_in_coll;
-
- for (m = 0; m < max_ntimes; m++) {
- /* go through all others_req and my_req to check which will be received
- * and sent in this iteration.
- */
-
- /* Note that MPI guarantees that displacements in filetypes are in
- monotonically nondecreasing order and that, for writes, the
- filetypes cannot specify overlapping regions in the file. This
- simplifies implementation a bit compared to reads. */
-
- /*
- off = start offset in the file for the data to be written in
- this iteration
- iter_st_off = start offset of this iteration
- real_size = size of data written (bytes) corresponding to off
- max_size = possible maximum size of data written in this iteration
- req_off = offset in the file for a particular contiguous request minus
- what was satisfied in previous iteration
- send_off = offset the request needed by other processes in this iteration
- req_len = size corresponding to req_off
- send_len = size corresponding to send_off
- */
-
- /* first calculate what should be communicated */
- for (i = 0; i < nprocs; i++)
- recv_count[i] = recv_size[i] = send_size[i] = 0;
-
- off = off_list[m];
- max_size = ADIOI_MIN(step_size, max_end_loc - iter_st_off + 1);
- real_size = (int) ADIOI_MIN((off / stripe_size + 1) * stripe_size -
- off,
- end_loc - off + 1);
-
- for (i = 0; i < nprocs; i++) {
- if (my_req[i].count) {
- this_buf_idx[i] = buf_idx[i][send_curr_offlen_ptr[i]];
- for (j = send_curr_offlen_ptr[i]; j < my_req[i].count; j++) {
- send_off = my_req[i].offsets[j];
- send_len = my_req[i].lens[j];
- if (send_off < iter_st_off + max_size) {
- send_size[i] += send_len;
- } else {
- break;
- }
- }
- send_curr_offlen_ptr[i] = j;
- }
- if (others_req[i].count) {
- recv_start_pos[i] = recv_curr_offlen_ptr[i];
- for (j = recv_curr_offlen_ptr[i]; j < others_req[i].count; j++) {
- req_off = others_req[i].offsets[j];
- req_len = others_req[i].lens[j];
- if (req_off < iter_st_off + max_size) {
- recv_count[i]++;
- 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;
- } else {
- break;
- }
- }
- recv_curr_offlen_ptr[i] = j;
- }
- }
- /* use variable "hole" to pass data_sieving flag into W_Exchange_data */
- hole = data_sieving;
- ADIOI_LUSTRE_W_Exchange_data(fd, buf, write_buf, flat_buf, offset_list,
- len_list, send_size, recv_size, off, real_size,
- recv_count, recv_start_pos,
- sent_to_proc, nprocs, myrank,
- buftype_is_contig, contig_access_count,
- striping_info, others_req, send_buf_idx,
- curr_to_proc, done_to_proc, &hole, m,
- buftype_extent, this_buf_idx,
- &srt_off, &srt_len, &srt_num, error_code);
-
- if (*error_code != MPI_SUCCESS)
- goto over;
-
- flag = 0;
- for (i = 0; i < nprocs; i++)
- if (recv_count[i]) {
- flag = 1;
- break;
- }
- if (flag) {
- /* check whether to do data sieving */
- if(data_sieving == ADIOI_HINT_ENABLE) {
- ADIO_WriteContig(fd, write_buf, real_size, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET, off, &status,
- error_code);
- } else {
- /* if there is no hole, write data in one time;
- * otherwise, write data in several times */
- if (!hole) {
- ADIO_WriteContig(fd, write_buf, real_size, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET, off, &status,
- error_code);
- } else {
- block_offset = -1;
- block_len = 0;
- for (i = 0; i < srt_num; ++i) {
- if (srt_off[i] < off + real_size &&
- srt_off[i] >= off) {
- if (block_offset == -1) {
- block_offset = srt_off[i];
- block_len = srt_len[i];
- } else {
- if (srt_off[i] == block_offset + block_len) {
- block_len += srt_len[i];
- } else {
- ADIO_WriteContig(fd,
- write_buf + block_offset - off,
- block_len,
- MPI_BYTE, ADIO_EXPLICIT_OFFSET,
- block_offset, &status,
- error_code);
- if (*error_code != MPI_SUCCESS)
- goto over;
- block_offset = srt_off[i];
- block_len = srt_len[i];
- }
- }
- }
- }
- if (block_offset != -1) {
- ADIO_WriteContig(fd,
- write_buf + block_offset - off,
- block_len,
- MPI_BYTE, ADIO_EXPLICIT_OFFSET,
- block_offset, &status,
- error_code);
- if (*error_code != MPI_SUCCESS)
- goto over;
- }
- }
- }
- if (*error_code != MPI_SUCCESS)
- goto over;
- }
- iter_st_off += max_size;
- }
-over:
- if (srt_off)
- ADIOI_Free(srt_off);
- if (srt_len)
- ADIOI_Free(srt_len);
- if (ntimes)
- ADIOI_Free(write_buf);
- ADIOI_Free(recv_curr_offlen_ptr);
- ADIOI_Free(send_curr_offlen_ptr);
- ADIOI_Free(recv_count);
- ADIOI_Free(send_size);
- ADIOI_Free(recv_size);
- ADIOI_Free(sent_to_proc);
- ADIOI_Free(recv_start_pos);
- ADIOI_Free(send_buf_idx);
- ADIOI_Free(curr_to_proc);
- ADIOI_Free(done_to_proc);
- ADIOI_Free(this_buf_idx);
- ADIOI_Free(off_list);
-}
-
-/* Sets error_code to MPI_SUCCESS if successful, or creates an error code
- * in the case of error.
- */
-static void ADIOI_LUSTRE_W_Exchange_data(ADIO_File fd, const void *buf,
- char *write_buf,
- ADIOI_Flatlist_node *flat_buf,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int *send_size,
- int *recv_size, ADIO_Offset off,
- int size, int *count,
- int *start_pos,
- int *sent_to_proc, int nprocs,
- int myrank, int buftype_is_contig,
- int contig_access_count,
- int *striping_info,
- ADIOI_Access *others_req,
- int *send_buf_idx,
- int *curr_to_proc, int *done_to_proc,
- int *hole, int iter,
- MPI_Aint buftype_extent,
- int *buf_idx,
- ADIO_Offset **srt_off, int **srt_len, int *srt_num,
- int *error_code)
-{
- int i, j, nprocs_recv, nprocs_send, err;
- char **send_buf = NULL;
- MPI_Request *requests, *send_req;
- MPI_Datatype *recv_types;
- MPI_Status *statuses, status;
- int sum_recv;
- int data_sieving = *hole;
- static char myname[] = "ADIOI_W_EXCHANGE_DATA";
-
- /* create derived datatypes for recv */
- nprocs_recv = 0;
- for (i = 0; i < nprocs; i++)
- if (recv_size[i])
- nprocs_recv++;
-
- recv_types = (MPI_Datatype *) ADIOI_Malloc((nprocs_recv + 1) *
- sizeof(MPI_Datatype));
- /* +1 to avoid a 0-size malloc */
-
- j = 0;
- for (i = 0; i < nprocs; i++) {
- if (recv_size[i]) {
- ADIOI_Type_create_hindexed_x(count[i],
- &(others_req[i].lens[start_pos[i]]),
- &(others_req[i].mem_ptrs[start_pos[i]]),
- MPI_BYTE, recv_types + j);
- /* absolute displacements; use MPI_BOTTOM in recv */
- MPI_Type_commit(recv_types + j);
- j++;
- }
- }
-
- /* To avoid a read-modify-write,
- * check if there are holes in the data to be written.
- * For this, merge the (sorted) offset lists others_req using a heap-merge.
- */
-
- *srt_num = 0;
- for (i = 0; i < nprocs; i++)
- *srt_num += count[i];
- if (*srt_off)
- *srt_off = (ADIO_Offset *) ADIOI_Realloc(*srt_off, (*srt_num + 1) * sizeof(ADIO_Offset));
- else
- *srt_off = (ADIO_Offset *) ADIOI_Malloc((*srt_num + 1) * sizeof(ADIO_Offset));
- if (*srt_len)
- *srt_len = (int *) ADIOI_Realloc(*srt_len, (*srt_num + 1) * sizeof(int));
- else
- *srt_len = (int *) ADIOI_Malloc((*srt_num + 1) * sizeof(int));
- /* +1 to avoid a 0-size malloc */
-
- ADIOI_Heap_merge(others_req, count, *srt_off, *srt_len, start_pos,
- nprocs, nprocs_recv, *srt_num);
-
- /* check if there are any holes */
- *hole = 0;
- for (i = 0; i < *srt_num - 1; i++) {
- if ((*srt_off)[i] + (*srt_len)[i] < (*srt_off)[i + 1]) {
- *hole = 1;
- break;
- }
- }
- /* In some cases (see John Bent ROMIO REQ # 835), an odd interaction
- * between aggregation, nominally contiguous regions, and cb_buffer_size
- * should be handled with a read-modify-write (otherwise we will write out
- * more data than we receive from everyone else (inclusive), so override
- * hole detection
- */
- if (*hole == 0) {
- sum_recv = 0;
- for (i = 0; i < nprocs; i++)
- sum_recv += recv_size[i];
- if (size > sum_recv)
- *hole = 1;
- }
- /* check the hint for data sieving */
- if (data_sieving == ADIOI_HINT_ENABLE && nprocs_recv && *hole) {
- ADIO_ReadContig(fd, write_buf, size, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET, off, &status, &err);
- // --BEGIN ERROR HANDLING--
- if (err != MPI_SUCCESS) {
- *error_code = MPIO_Err_create_code(err,
- MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_IO,
- "**ioRMWrdwr", 0);
- ADIOI_Free(recv_types);
- return;
- }
- // --END ERROR HANDLING--
- }
-
- nprocs_send = 0;
- for (i = 0; i < nprocs; i++)
- if (send_size[i])
- nprocs_send++;
-
- if (fd->atomicity) {
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- requests = (MPI_Request *) ADIOI_Malloc((nprocs_send + 1) *
- sizeof(MPI_Request));
- send_req = requests;
- } else {
- requests = (MPI_Request *) ADIOI_Malloc((nprocs_send + nprocs_recv + 1)*
- sizeof(MPI_Request));
- /* +1 to avoid a 0-size malloc */
-
- /* post receives */
- j = 0;
- for (i = 0; i < nprocs; i++) {
- if (recv_size[i]) {
- MPI_Irecv(MPI_BOTTOM, 1, recv_types[j], i,
- myrank + i + 100 * iter, fd->comm, requests + j);
- j++;
- }
- }
- send_req = requests + nprocs_recv;
- }
-
- /* post sends.
- * if buftype_is_contig, data can be directly sent from
- * user buf at location given by buf_idx. else use send_buf.
- */
- if (buftype_is_contig) {
- j = 0;
- for (i = 0; i < nprocs; i++)
- if (send_size[i]) {
- ADIOI_Assert(buf_idx[i] != -1);
- MPI_Isend(((char *) buf) + buf_idx[i], send_size[i],
- MPI_BYTE, i, myrank + i + 100 * iter, fd->comm,
- send_req + j);
- j++;
- }
- } else
- if (nprocs_send) {
- /* buftype is not contig */
- send_buf = (char **) ADIOI_Malloc(nprocs * sizeof(char *));
- for (i = 0; i < nprocs; i++)
- if (send_size[i])
- send_buf[i] = (char *) ADIOI_Malloc(send_size[i]);
-
- ADIOI_LUSTRE_Fill_send_buffer(fd, buf, flat_buf, send_buf, offset_list,
- len_list, send_size, send_req,
- sent_to_proc, nprocs, myrank,
- contig_access_count, striping_info,
- send_buf_idx, curr_to_proc, done_to_proc,
- iter, buftype_extent);
- /* the send is done in ADIOI_Fill_send_buffer */
- }
-
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- if (fd->atomicity) {
- j = 0;
- for (i = 0; i < nprocs; i++) {
- MPI_Status wkl_status;
- if (recv_size[i]) {
- MPI_Recv(MPI_BOTTOM, 1, recv_types[j], i,
- myrank + i + 100 * iter, fd->comm, &wkl_status);
- j++;
- }
- }
- }
-
- for (i = 0; i < nprocs_recv; i++)
- MPI_Type_free(recv_types + i);
- ADIOI_Free(recv_types);
-
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- /* +1 to avoid a 0-size malloc */
- if (fd->atomicity) {
- statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send + 1) *
- sizeof(MPI_Status));
- } else {
- statuses = (MPI_Status *) ADIOI_Malloc((nprocs_send + nprocs_recv + 1) *
- sizeof(MPI_Status));
- }
-
-#ifdef NEEDS_MPI_TEST
- i = 0;
- if (fd->atomicity) {
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- while (!i)
- MPI_Testall(nprocs_send, send_req, &i, statuses);
- } else {
- while (!i)
- MPI_Testall(nprocs_send + nprocs_recv, requests, &i, statuses);
- }
-#else
- /* bug fix from Wei-keng Liao and Kenin Coloma */
- if (fd->atomicity)
- MPI_Waitall(nprocs_send, send_req, statuses);
- else
- MPI_Waitall(nprocs_send + nprocs_recv, requests, statuses);
-#endif
- ADIOI_Free(statuses);
- ADIOI_Free(requests);
- if (!buftype_is_contig && nprocs_send) {
- for (i = 0; i < nprocs; i++)
- if (send_size[i])
- ADIOI_Free(send_buf[i]);
- ADIOI_Free(send_buf);
- }
-}
-
-#define ADIOI_BUF_INCR \
-{ \
- while (buf_incr) { \
- size_in_buf = ADIOI_MIN(buf_incr, flat_buf_sz); \
- user_buf_idx += size_in_buf; \
- flat_buf_sz -= size_in_buf; \
- if (!flat_buf_sz) { \
- if (flat_buf_idx < (flat_buf->count - 1)) flat_buf_idx++; \
- else { \
- flat_buf_idx = 0; \
- n_buftypes++; \
- } \
- user_buf_idx = flat_buf->indices[flat_buf_idx] + \
- (ADIO_Offset)n_buftypes*(ADIO_Offset)buftype_extent; \
- flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \
- } \
- buf_incr -= size_in_buf; \
- } \
-}
-
-
-#define ADIOI_BUF_COPY \
-{ \
- while (size) { \
- size_in_buf = ADIOI_MIN(size, flat_buf_sz); \
- 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); \
- send_buf_idx[p] += size_in_buf; \
- user_buf_idx += size_in_buf; \
- flat_buf_sz -= size_in_buf; \
- if (!flat_buf_sz) { \
- if (flat_buf_idx < (flat_buf->count - 1)) flat_buf_idx++; \
- else { \
- flat_buf_idx = 0; \
- n_buftypes++; \
- } \
- user_buf_idx = flat_buf->indices[flat_buf_idx] + \
- (ADIO_Offset)n_buftypes*(ADIO_Offset)buftype_extent; \
- flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \
- } \
- size -= size_in_buf; \
- buf_incr -= size_in_buf; \
- } \
- ADIOI_BUF_INCR \
-}
-
-static void ADIOI_LUSTRE_Fill_send_buffer(ADIO_File fd, const void *buf,
- ADIOI_Flatlist_node *flat_buf,
- char **send_buf,
- ADIO_Offset *offset_list,
- ADIO_Offset *len_list, int *send_size,
- MPI_Request *requests,
- int *sent_to_proc, int nprocs,
- int myrank,
- int contig_access_count,
- int *striping_info,
- int *send_buf_idx,
- int *curr_to_proc,
- int *done_to_proc, int iter,
- MPI_Aint buftype_extent)
-{
- /* this function is only called if buftype is not contig */
- int i, p, flat_buf_idx, size;
- int flat_buf_sz, buf_incr, size_in_buf, jj, n_buftypes;
- ADIO_Offset off, len, rem_len, user_buf_idx;
-
- /* curr_to_proc[p] = amount of data sent to proc. p that has already
- * been accounted for so far
- * done_to_proc[p] = amount of data already sent to proc. p in
- * previous iterations
- * user_buf_idx = current location in user buffer
- * send_buf_idx[p] = current location in send_buf of proc. p
- */
-
- for (i = 0; i < nprocs; i++) {
- send_buf_idx[i] = curr_to_proc[i] = 0;
- done_to_proc[i] = sent_to_proc[i];
- }
- jj = 0;
-
- user_buf_idx = flat_buf->indices[0];
- flat_buf_idx = 0;
- n_buftypes = 0;
- flat_buf_sz = flat_buf->blocklens[0];
-
- /* flat_buf_idx = current index into flattened buftype
- * flat_buf_sz = size of current contiguous component in flattened buf
- */
- for (i = 0; i < contig_access_count; i++) {
- off = offset_list[i];
- rem_len = (ADIO_Offset) len_list[i];
-
- /*this request may span to more than one process */
- while (rem_len != 0) {
- len = rem_len;
- /* NOTE: len value is modified by ADIOI_Calc_aggregator() to be no
- * longer than the single region that processor "p" is responsible
- * for.
- */
- p = ADIOI_LUSTRE_Calc_aggregator(fd, off, &len, striping_info);
-
- if (send_buf_idx[p] < send_size[p]) {
- if (curr_to_proc[p] + len > done_to_proc[p]) {
- if (done_to_proc[p] > curr_to_proc[p]) {
- size = (int) ADIOI_MIN(curr_to_proc[p] + len -
- done_to_proc[p],
- send_size[p] -
- send_buf_idx[p]);
- buf_incr = done_to_proc[p] - curr_to_proc[p];
- ADIOI_BUF_INCR
- ADIOI_Assert((curr_to_proc[p] + len - done_to_proc[p]) == (unsigned)(curr_to_proc[p] + len - done_to_proc[p]));
- buf_incr = (int) (curr_to_proc[p] + len -
- done_to_proc[p]);
- ADIOI_Assert((done_to_proc[p] + size) == (unsigned)(done_to_proc[p] + size));
- curr_to_proc[p] = done_to_proc[p] + size;
- ADIOI_BUF_COPY
- } else {
- size = (int) ADIOI_MIN(len, send_size[p] -
- send_buf_idx[p]);
- buf_incr = (int) len;
- ADIOI_Assert((curr_to_proc[p] + size) == (unsigned)((ADIO_Offset)curr_to_proc[p] + size));
- curr_to_proc[p] += size;
- ADIOI_BUF_COPY
- }
- if (send_buf_idx[p] == send_size[p]) {
- MPI_Isend(send_buf[p], send_size[p], MPI_BYTE, p,
- myrank + p + 100 * iter, fd->comm,
- requests + jj);
- jj++;
- }
- } else {
- ADIOI_Assert((curr_to_proc[p] + len) == (unsigned)((ADIO_Offset)curr_to_proc[p] + len));
- curr_to_proc[p] += (int) len;
- buf_incr = (int) len;
- ADIOI_BUF_INCR
- }
- } else {
- buf_incr = (int) len;
- ADIOI_BUF_INCR
- }
- off += len;
- rem_len -= len;
- }
- }
- for (i = 0; i < nprocs; i++)
- if (send_size[i])
- sent_to_proc[i] = curr_to_proc[i];
-}
diff --git a/3rd-party/romio321/adio/ad_lustre/ad_lustre_wrstr.c b/3rd-party/romio321/adio/ad_lustre/ad_lustre_wrstr.c
deleted file mode 100644
index ce538d4a6b6..00000000000
--- a/3rd-party/romio321/adio/ad_lustre/ad_lustre_wrstr.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- * Copyright (C) 2007 Oak Ridge National Laboratory
- *
- * Copyright (C) 2008 Sun Microsystems, Lustre group
- */
-
-#include "ad_lustre.h"
-#include "adio_extern.h"
-
-#define ADIOI_BUFFERED_WRITE \
-{ \
- if (req_off >= writebuf_off + writebuf_len) { \
- if (writebuf_len) { \
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
- ADIO_EXPLICIT_OFFSET, writebuf_off, \
- &status1, error_code); \
- if (!(fd->atomicity)) \
- ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (*error_code != MPI_SUCCESS) { \
- *error_code = MPIO_Err_create_code(*error_code, \
- MPIR_ERR_RECOVERABLE, \
- myname, \
- __LINE__, MPI_ERR_IO, \
- "**iowswc", 0); \
- ADIOI_Free(writebuf); \
- return; \
- } \
- } \
- writebuf_off = req_off; \
- /* stripe_size alignment */ \
- writebuf_len = (unsigned) ADIOI_MIN(end_offset - writebuf_off + 1, \
- (writebuf_off / stripe_size + 1) * \
- stripe_size - writebuf_off); \
- if (!(fd->atomicity)) \
- ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
- ADIO_EXPLICIT_OFFSET, \
- writebuf_off, &status1, error_code); \
- if (*error_code != MPI_SUCCESS) { \
- *error_code = MPIO_Err_create_code(*error_code, \
- MPIR_ERR_RECOVERABLE, \
- myname, \
- __LINE__, MPI_ERR_IO, \
- "**iowsrc", 0); \
- ADIOI_Free(writebuf); \
- return; \
- } \
- } \
- write_sz = (unsigned) (ADIOI_MIN(req_len, \
- writebuf_off + writebuf_len - req_off)); \
- ADIOI_Assert((ADIO_Offset)write_sz == \
- ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off)); \
- memcpy(writebuf + req_off - writebuf_off, (char *)buf +userbuf_off, write_sz); \
- while (write_sz != req_len) { \
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
- ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
- if (!(fd->atomicity)) \
- ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (*error_code != MPI_SUCCESS) { \
- *error_code = MPIO_Err_create_code(*error_code, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**iowswc", 0); \
- ADIOI_Free(writebuf); \
- return; \
- } \
- req_len -= write_sz; \
- userbuf_off += write_sz; \
- writebuf_off += writebuf_len; \
- /* stripe_size alignment */ \
- writebuf_len = (unsigned) ADIOI_MIN(end_offset - writebuf_off + 1, \
- (writebuf_off / stripe_size + 1) * \
- stripe_size - writebuf_off); \
- if (!(fd->atomicity)) \
- ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- ADIO_ReadContig(fd, writebuf, writebuf_len, MPI_BYTE, \
- ADIO_EXPLICIT_OFFSET, \
- writebuf_off, &status1, error_code); \
- if (*error_code != MPI_SUCCESS) { \
- *error_code = MPIO_Err_create_code(*error_code, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**iowsrc", 0); \
- ADIOI_Free(writebuf); \
- return; \
- } \
- write_sz = ADIOI_MIN(req_len, writebuf_len); \
- memcpy(writebuf, (char *)buf + userbuf_off, write_sz); \
- } \
-}
-
-
-/* this macro is used when filetype is contig and buftype is not contig.
- it does not do a read-modify-write and does not lock*/
-#define ADIOI_BUFFERED_WRITE_WITHOUT_READ \
-{ \
- if (req_off >= writebuf_off + writebuf_len) { \
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
- ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, \
- error_code); \
- if (*error_code != MPI_SUCCESS) { \
- *error_code = MPIO_Err_create_code(*error_code, \
- MPIR_ERR_RECOVERABLE, \
- myname, \
- __LINE__, MPI_ERR_IO, \
- "**iowswc", 0); \
- ADIOI_Free(writebuf); \
- return; \
- } \
- writebuf_off = req_off; \
- /* stripe_size alignment */ \
- writebuf_len = (unsigned) ADIOI_MIN(end_offset - writebuf_off + 1, \
- (writebuf_off / stripe_size + 1) * \
- stripe_size - writebuf_off); \
- } \
- write_sz = (unsigned) ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off); \
- ADIOI_Assert((ADIO_Offset)write_sz == ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off)); \
- memcpy(writebuf + req_off - writebuf_off, \
- (char *)buf + userbuf_off, write_sz); \
- while (write_sz != req_len) { \
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE, \
- ADIO_EXPLICIT_OFFSET, writebuf_off, &status1, error_code); \
- if (*error_code != MPI_SUCCESS) { \
- *error_code = MPIO_Err_create_code(*error_code, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**iowswc", 0); \
- ADIOI_Free(writebuf); \
- return; \
- } \
- req_len -= write_sz; \
- userbuf_off += write_sz; \
- writebuf_off += writebuf_len; \
- /* stripe_size alignment */ \
- writebuf_len = (unsigned) ADIOI_MIN(end_offset - writebuf_off + 1, \
- (writebuf_off / stripe_size + 1) * \
- stripe_size - writebuf_off); \
- write_sz = ADIOI_MIN(req_len, writebuf_len); \
- memcpy(writebuf, (char *)buf + userbuf_off, write_sz); \
- } \
-}
-
-void ADIOI_LUSTRE_WriteStrided(ADIO_File fd, const void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status * status,
- int *error_code)
-{
- /* offset is in units of etype relative to the filetype. */
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- ADIO_Offset i_offset, sum, size_in_filetype;
- int i, j, k, st_index=0;
- int n_etypes_in_filetype;
- ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes;
- ADIO_Offset abs_off_in_filetype=0;
- MPI_Count filetype_size, etype_size, buftype_size;
- MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb;
- 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;
- char *writebuf;
- unsigned bufsize, writebuf_len, write_sz;
- ADIO_Status status1;
- ADIO_Offset new_bwr_size, new_fwr_size, st_fwr_size, fwr_size=0, bwr_size, req_len;
- int stripe_size;
- static char myname[] = "ADIOI_LUSTRE_WriteStrided";
-
- if (fd->hints->ds_write == ADIOI_HINT_DISABLE) {
- /* if user has disabled data sieving on writes, use naive
- * approach instead.
- */
- ADIOI_GEN_WriteStrided_naive(fd,
- buf,
- count,
- datatype,
- file_ptr_type,
- offset, status, error_code);
- return;
- }
-
- *error_code = MPI_SUCCESS; /* changed below if error */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if (!filetype_size) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count));
- bufsize = buftype_size * count;
-
- /* get striping info */
- stripe_size = fd->hints->striping_unit;
-
- /* Different buftype to different filetype */
- if (!buftype_is_contig && filetype_is_contig) {
- /* noncontiguous in memory, contiguous in file. */
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind :
- fd->disp + (ADIO_Offset)etype_size * offset;
-
- start_off = off;
- end_offset = start_off + bufsize - 1;
- /* write stripe size buffer each time */
- writebuf = (char *) ADIOI_Malloc(ADIOI_MIN(bufsize, stripe_size));
- writebuf_off = 0;
- writebuf_len = 0;
-
- /* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity)
- ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, bufsize);
-
- for (j = 0; j < count; j++) {
- for (i = 0; i < flat_buf->count; i++) {
- userbuf_off = (ADIO_Offset)j * (ADIO_Offset)buftype_extent +
- flat_buf->indices[i];
- req_off = off;
- req_len = flat_buf->blocklens[i];
- ADIOI_BUFFERED_WRITE_WITHOUT_READ
- off += flat_buf->blocklens[i];
- }
- }
-
- /* write the buffer out finally */
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET, writebuf_off, &status1,
- error_code);
-
- if (fd->atomicity)
- ADIOI_UNLOCK(fd, start_off, SEEK_SET, bufsize);
- if (*error_code != MPI_SUCCESS) {
- ADIOI_Free(writebuf);
- return;
- }
- ADIOI_Free(writebuf);
- if (file_ptr_type == ADIO_INDIVIDUAL)
- fd->fp_ind = off;
- } else {
- /* noncontiguous in file */
- /* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype)
- flat_file = flat_file->next;
- disp = fd->disp;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- /* Wei-keng reworked type processing to be a bit more efficient */
- offset = fd->fp_ind - disp;
- n_filetypes = (offset - flat_file->indices[0]) / filetype_extent;
- offset -= (ADIO_Offset)n_filetypes * filetype_extent;
- /* now offset is local to this extent */
-
- /* find the block where offset is located, skip blocklens[i]==0 */
- for (i=0; icount; i++) {
- ADIO_Offset dist;
- if (flat_file->blocklens[i] == 0) continue;
- dist = flat_file->indices[i] + flat_file->blocklens[i] - offset;
- /* fwr_size is from offset to the end of block i */
- if (dist == 0) {
- i++;
- offset = flat_file->indices[i];
- fwr_size = flat_file->blocklens[i];
- break;
- }
- if (dist > 0) {
- fwr_size = dist;
- break;
- }
- }
- st_index = i; /* starting index in flat_file->indices[] */
- offset += disp + (ADIO_Offset)n_filetypes*filetype_extent;
- }
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = offset / n_etypes_in_filetype;
- etype_in_filetype = offset % n_etypes_in_filetype;
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i = 0; i < flat_file->count; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- fwr_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes *filetype_extent +
- abs_off_in_filetype;
- }
-
- start_off = offset;
-
- /* Wei-keng Liao:write request is within single flat_file
- * contig block*/
- /* this could happen, for example, with subarray types that are
- * actually fairly contiguous */
- if (buftype_is_contig && bufsize <= fwr_size) {
- req_off = start_off;
- req_len = bufsize;
- end_offset = start_off + bufsize - 1;
- writebuf = (char *) ADIOI_Malloc(ADIOI_MIN(bufsize, stripe_size));
- memset(writebuf, -1, ADIOI_MIN(bufsize, stripe_size));
- writebuf_off = 0;
- writebuf_len = 0;
- userbuf_off = 0;
- ADIOI_BUFFERED_WRITE_WITHOUT_READ
- /* write the buffer out finally */
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET, writebuf_off, &status1,
- error_code);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- /* 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) {
- do {
- st_index++;
- if (st_index == flat_file->count) {
- st_index = 0;
- n_filetypes++;
- }
- } while (flat_file->blocklens[st_index] == 0);
- fd->fp_ind = disp + flat_file->indices[st_index]
- + (ADIO_Offset)n_filetypes*filetype_extent;
- }
- }
- fd->fp_sys_posn = -1; /* set it to null. */
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-#endif
- ADIOI_Free(writebuf);
- return;
- }
-
- /* Calculate end_offset, the last byte-offset that will be accessed.
- e.g., if start_offset=0 and 100 bytes to be write, end_offset=99*/
-
- st_fwr_size = fwr_size;
- st_n_filetypes = n_filetypes;
- i_offset = 0;
- j = st_index;
- off = offset;
- fwr_size = ADIOI_MIN(st_fwr_size, bufsize);
- while (i_offset < bufsize) {
- i_offset += fwr_size;
- end_offset = off + fwr_size - 1;
-
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
-
- off = disp + flat_file->indices[j] +
- n_filetypes*(ADIO_Offset)filetype_extent;
- fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset);
- }
-
-/* if atomicity is true, lock the region to be accessed */
- if (fd->atomicity)
- ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- writebuf_off = 0;
- writebuf_len = 0;
- writebuf = (char *) ADIOI_Malloc(stripe_size);
- memset(writebuf, -1, stripe_size);
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- i_offset = 0;
- j = st_index;
- off = offset;
- n_filetypes = st_n_filetypes;
- fwr_size = ADIOI_MIN(st_fwr_size, bufsize);
- while (i_offset < bufsize) {
- if (fwr_size) {
- /* TYPE_UB and TYPE_LB can result in
- fwr_size = 0. save system call in such cases */
- /* lseek(fd->fd_sys, off, SEEK_SET);
- err = write(fd->fd_sys, ((char *) buf) + i_offset, fwr_size);*/
-
- req_off = off;
- req_len = fwr_size;
- userbuf_off = i_offset;
- ADIOI_BUFFERED_WRITE
- }
- i_offset += fwr_size;
-
- if (off + fwr_size < disp + flat_file->indices[j] +
- flat_file->blocklens[j] +
- n_filetypes*(ADIO_Offset)filetype_extent)
- off += fwr_size;
- /* did not reach end of contiguous block in filetype.
- no more I/O needed. off is incremented by fwr_size. */
- else {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
- off = disp + flat_file->indices[j] +
- n_filetypes*(ADIO_Offset)filetype_extent;
- fwr_size = ADIOI_MIN(flat_file->blocklens[j],
- bufsize-i_offset);
- }
- }
- }
- else {
-/* noncontiguous in memory as well as in file */
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- k = num = buf_count = 0;
- i_offset = flat_buf->indices[0];
- j = st_index;
- off = offset;
- n_filetypes = st_n_filetypes;
- fwr_size = st_fwr_size;
- bwr_size = flat_buf->blocklens[0];
-
- while (num < bufsize) {
- size = ADIOI_MIN(fwr_size, bwr_size);
- if (size) {
- /* lseek(fd->fd_sys, off, SEEK_SET);
- err = write(fd->fd_sys, ((char *) buf) + i_offset, size); */
-
- req_off = off;
- req_len = size;
- userbuf_off = i_offset;
- ADIOI_BUFFERED_WRITE
- }
-
- new_fwr_size = fwr_size;
- new_bwr_size = bwr_size;
-
- if (size == fwr_size) {
-/* reached end of contiguous block in file */
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
-
- off = disp + flat_file->indices[j] +
- n_filetypes*(ADIO_Offset)filetype_extent;
-
- new_fwr_size = flat_file->blocklens[j];
- if (size != bwr_size) {
- i_offset += size;
- new_bwr_size -= size;
- }
- }
-
- if (size == bwr_size) {
-/* reached end of contiguous block in memory */
-
- k = (k + 1)%flat_buf->count;
- buf_count++;
- i_offset = (ADIO_Offset)buftype_extent *
- (ADIO_Offset)(buf_count/flat_buf->count) +
- flat_buf->indices[k];
- new_bwr_size = flat_buf->blocklens[k];
- if (size != fwr_size) {
- off += size;
- new_fwr_size -= size;
- }
- }
- num += size;
- fwr_size = new_fwr_size;
- bwr_size = new_bwr_size;
- }
- }
-
- /* write the buffer out finally */
- if (writebuf_len) {
- ADIO_WriteContig(fd, writebuf, writebuf_len, MPI_BYTE,
- ADIO_EXPLICIT_OFFSET,
- writebuf_off, &status1, error_code);
- if (!(fd->atomicity))
- ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
- if (*error_code != MPI_SUCCESS) return;
- }
- if (fd->atomicity)
- ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- ADIOI_Free(writebuf);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
- }
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-/* This is a temporary way of filling in status. The right way is to
- keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */
-#endif
-
- if (!buftype_is_contig)
- ADIOI_Delete_flattened(datatype);
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/Makefile.mk b/3rd-party/romio321/adio/ad_nfs/Makefile.mk
deleted file mode 100644
index ca25e20cbea..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/Makefile.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_NFS
-
-noinst_HEADERS += adio/ad_nfs/ad_nfs.h
-
-romio_other_sources += \
- adio/ad_nfs/ad_nfs_read.c \
- adio/ad_nfs/ad_nfs_open.c \
- adio/ad_nfs/ad_nfs_write.c \
- adio/ad_nfs/ad_nfs_done.c \
- adio/ad_nfs/ad_nfs_fcntl.c \
- adio/ad_nfs/ad_nfs_iread.c \
- adio/ad_nfs/ad_nfs_iwrite.c \
- adio/ad_nfs/ad_nfs_wait.c \
- adio/ad_nfs/ad_nfs_setsh.c \
- adio/ad_nfs/ad_nfs_getsh.c \
- adio/ad_nfs/ad_nfs.c \
- adio/ad_nfs/ad_nfs_resize.c \
- adio/ad_nfs/ad_nfs_features.c
-
-endif BUILD_AD_NFS
-
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs.c
deleted file mode 100644
index 763a1b4c7e5..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_NFS_operations = {
- ADIOI_NFS_Open, /* Open */
- ADIOI_FAILSAFE_OpenColl, /* OpenColl */
- ADIOI_NFS_ReadContig, /* ReadContig */
- ADIOI_NFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_NFS_Fcntl, /* Fcntl */
- ADIOI_GEN_SetInfo, /* SetInfo */
- ADIOI_NFS_ReadStrided, /* ReadStrided */
- ADIOI_NFS_WriteStrided, /* WriteStrided */
- ADIOI_GEN_Close, /* Close */
- /* Even with lockd running and NFS mounted 'noac', we have been unable to
- * gaurantee correct behavior over NFS with asyncronous I/O operations */
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
- ADIOI_NFS_ReadDone, /* ReadDone */
- ADIOI_NFS_WriteDone, /* WriteDone */
- ADIOI_NFS_ReadComplete, /* ReadComplete */
- ADIOI_NFS_WriteComplete, /* WriteComplete */
- ADIOI_GEN_IreadStrided, /* IreadStrided */
- ADIOI_GEN_IwriteStrided, /* IwriteStrided */
- ADIOI_GEN_Flush, /* Flush */
- ADIOI_NFS_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_NFS_Feature, /* Features */
- "NFS:", /* fsname: just a string */
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs.h b/3rd-party/romio321/adio/ad_nfs/ad_nfs.h
deleted file mode 100644
index dd02bf4a2c3..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#ifndef AD_NFS_INCLUDE
-#define AD_NFS_INCLUDE
-
-#include "adio.h"
-
-#include
-#include
-#include
-
-#ifdef HAVE_SIGNAL_H
-#include
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include
-#endif
-#ifdef HAVE_AIO_LITE_H
-#include
-#else
- #ifdef HAVE_AIO_H
- #include
- #endif
- #ifdef HAVE_SYS_AIO_H
- #include
- #endif
-#endif
-
-/* Workaround for incomplete set of definitions if __REDIRECT is not
- defined and large file support is used in aio.h */
-#if !defined(__REDIRECT) && defined(__USE_FILE_OFFSET64)
-#define aiocb aiocb64
-#endif
-
-int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
- int wr, MPI_Request *request);
-
-#ifdef SX4
-#define lseek llseek
-#endif
-
-void ADIOI_NFS_Open(ADIO_File fd, int *error_code);
-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,
- 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,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *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);
-void ADIOI_NFS_WriteComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code);
-void ADIOI_NFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
- *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
- *error_code);
-void ADIOI_NFS_ReadStrided(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_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp,
- int *error_code);
-void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code);
-void ADIOI_NFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
-int ADIOI_NFS_Feature(ADIO_File fd, int feature_flag);
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_done.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_done.c
deleted file mode 100644
index ff688546cab..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_done.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-int ADIOI_NFS_ReadDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- *error_code = MPI_SUCCESS;
- return 1;
-}
-int ADIOI_NFS_WriteDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return ADIOI_NFS_ReadDone(request, status, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_fcntl.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_fcntl.c
deleted file mode 100644
index c73006e6cd9..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_fcntl.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-#include "adio_extern.h"
-/* #ifdef MPISGI
-#include "mpisgi2.h"
-#endif */
-
-void ADIOI_NFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code)
-{
- static char myname[] = "ADIOI_NFS_FCNTL";
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
- ADIOI_READ_LOCK(fd, 0, SEEK_SET, 1);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- fcntl_struct->fsize = lseek(fd->fd_sys, 0, SEEK_END);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- ADIOI_UNLOCK(fd, 0, SEEK_SET, 1);
- if (fd->fp_sys_posn != -1) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- lseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
- if (fcntl_struct->fsize == -1) {
- *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;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
- *error_code = MPI_SUCCESS;
- break;
-
- default:
- /* --BEGIN ERROR HANDLING-- */
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_ARG,
- "**flag", "**flag %d", flag);
- return;
- /* --END ERROR HANDLING-- */
- }
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_features.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_features.c
deleted file mode 100644
index 05b061acf47..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_features.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#include "adio.h"
-#include "ad_nfs.h"
-
-int ADIOI_NFS_Feature(ADIO_File fd, int flag)
-{
- switch(flag) {
- case ADIO_SHARED_FP:
- case ADIO_LOCKS:
- case ADIO_SEQUENTIAL:
- case ADIO_DATA_SIEVING_WRITES:
- return 1;
- case ADIO_SCALABLE_OPEN:
- case ADIO_UNLINK_AFTER_CLOSE:
- case ADIO_SCALABLE_RESIZE:
- default:
- return 0;
- }
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_getsh.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_getsh.c
deleted file mode 100644
index 974d547cc13..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_getsh.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-/* returns the current location of the shared_fp in terms of the
- no. of etypes relative to the current view, and also increments the
- shared_fp by the number of etypes to be accessed (incr) in the read
- or write following this function. */
-
-void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
- int *error_code)
-{
- ADIO_Offset new_fp;
- ssize_t err;
- MPI_Comm dupcommself;
- static char myname[] = "ADIOI_NFS_GET_SHARED_FP";
-
- if (fd->shared_fp_fd == ADIO_FILE_NULL) {
- MPI_Comm_dup(MPI_COMM_SELF, &dupcommself);
- fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself,
- fd->shared_fp_fname,
- fd->file_system,
- fd->fns,
- 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;
- ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset));
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
-#endif
- err = read(fd->shared_fp_fd->fd_sys, shared_fp, sizeof(ADIO_Offset));
-#ifdef ADIOI_MPE_LOGGING
- 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,
- set above, is the correct value. */
- }
- else {
- ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset));
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- err = lseek(fd->shared_fp_fd->fd_sys, 0, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- if (err == 0) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
-#endif
- err = read(fd->shared_fp_fd->fd_sys, shared_fp,
- sizeof(ADIO_Offset));
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
-#endif
- }
- if (err == -1) {
- ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset));
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
- return;
- }
- }
-
- if (incr == 0) {goto done;}
-
- new_fp = *shared_fp + incr;
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- err = lseek(fd->shared_fp_fd->fd_sys, 0, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- if (err == 0) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
-#endif
- err = write(fd->shared_fp_fd->fd_sys, &new_fp, sizeof(ADIO_Offset));
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- }
-done:
- ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset));
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_hints.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_hints.c
deleted file mode 100644
index 0e5386d22bb..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_hints.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-void ADIOI_NFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
-{
- ADIOI_GEN_SetInfo(fd, users_info, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_iread.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_iread.c
deleted file mode 100644
index 28d20281059..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_iread.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-#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,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request,
- int *error_code)
-{
- MPI_Count len, typesize;
- int aio_errno = 0;
- static char myname[] = "ADIOI_NFS_IREADCONTIG";
-
- MPI_Type_size_x(datatype, &typesize);
- len = count * typesize;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind;
- aio_errno = ADIOI_NFS_aio(fd, buf, len, offset, 0, request);
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
-
- fd->fp_sys_posn = -1;
-
- if (aio_errno != 0) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- else *error_code = MPI_SUCCESS;
-}
-#endif
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_iwrite.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_iwrite.c
deleted file mode 100644
index a5f988cf205..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_iwrite.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-#include "../../mpi-io/mpioimpl.h"
-#include "../../mpi-io/mpioprof.h"
-#include "mpiu_greq.h"
-
-#include
-
-#ifdef ROMIO_HAVE_WORKING_AIO
-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,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int *error_code)
-{
- MPI_Count len, typesize;
- int aio_errno = 0;
- static char myname[] = "ADIOI_NFS_IWRITECONTIG";
-
- MPI_Type_size_x(datatype, &typesize);
- len = count * typesize;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind;
- aio_errno = ADIOI_NFS_aio(fd, buf, len, offset, 1, request);
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
-
- fd->fp_sys_posn = -1;
-
- if (aio_errno != 0) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- else *error_code = MPI_SUCCESS;
- return;
-}
-#endif
-
-/* This function is for implementation convenience. It is not user-visible.
- * It takes care of the differences in the interface for nonblocking I/O
- * on various Unix machines! If wr==1 write, wr==0 read.
- *
- * Returns 0 on success, -errno on failure.
- */
-#ifdef ROMIO_HAVE_WORKING_AIO
-int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
- int wr, MPI_Request *request)
-{
- int err=-1, fd_sys;
- int error_code, this_errno;
-
- struct aiocb *aiocbp;
- ADIOI_AIO_Request *aio_req;
- MPI_Status status;
-
- fd_sys = fd->fd_sys;
-
- aio_req = (ADIOI_AIO_Request*)ADIOI_Calloc(sizeof(ADIOI_AIO_Request), 1);
- aiocbp = (struct aiocb *) ADIOI_Calloc(sizeof(struct aiocb), 1);
- aiocbp->aio_offset = offset;
- aiocbp->aio_buf = buf;
- aiocbp->aio_nbytes = len;
-
-#ifdef HAVE_STRUCT_AIOCB_AIO_WHENCE
- aiocbp->aio_whence = SEEK_SET;
-#endif
-#ifdef HAVE_STRUCT_AIOCB_AIO_FILDES
- aiocbp->aio_fildes = fd_sys;
-#endif
-#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 HAVE_STRUCT_AIOCB_AIO_REQPRIO
-# ifdef AIO_PRIO_DFL
- aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */
-# else
- aiocbp->aio_reqprio = 0;
-# endif
-#endif
-
- if (wr) ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
- else ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
-
-#ifndef ROMIO_HAVE_AIO_CALLS_NEED_FILEDES
- if (wr) err = aio_write(aiocbp);
- else err = aio_read(aiocbp);
-#else
- /* Broken IBM interface */
- if (wr) err = aio_write(fd_sys, aiocbp);
- else err = aio_read(fd_sys, aiocbp);
-#endif
-
- this_errno = errno;
- ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
-
- if (err == -1) {
- if (this_errno == EAGAIN) {
- /* exceeded the max. no. of outstanding requests.
- complete all previous async. requests and try again. */
- ADIO_WriteContig(fd, buf, len, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
- offset, &status, &error_code);
- MPIO_Completed_request_create(&fd, len, &error_code, request);
- return 0;
- } else {
- return -this_errno;
- }
- }
- aio_req->aiocbp = aiocbp;
- if (ADIOI_GEN_greq_class == 0) {
- MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn,
- ADIOI_GEN_aio_free_fn, MPIU_Greq_cancel_fn,
- ADIOI_GEN_aio_poll_fn, ADIOI_GEN_aio_wait_fn,
- &ADIOI_GEN_greq_class);
- }
- MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, aio_req, request);
- memcpy(&(aio_req->req), request, sizeof(MPI_Request));
- return 0;
-}
-#endif
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_open.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_open.c
deleted file mode 100644
index d8763292b91..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_open.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-void ADIOI_NFS_Open(ADIO_File fd, int *error_code)
-{
- int perm, amode;
- mode_t old_mask;
- static char myname[] = "ADIOI_NFS_OPEN";
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_open_a, 0, NULL );
-#endif
- fd->fd_sys = open(fd->filename, amode, perm);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_open_b, 0, NULL );
-#endif
- fd->fd_direct = -1;
-
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
-
- if (fd->fd_sys == -1) {
- *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_read.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_read.c
deleted file mode 100644
index 6dce2893118..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_read.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-#include "adio_extern.h"
-
-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)
-{
- int err=-1;
- MPI_Count datatype_size, len;
- static char myname[] = "ADIOI_NFS_READCONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- 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, 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_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
- }
- 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;
- }
-
- /* --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, err);
-#endif
-
- *error_code = MPI_SUCCESS;
-}
-
-
-
-#ifdef ADIOI_MPE_LOGGING
-#define ADIOI_BUFFERED_READ \
-{ \
- if (req_off >= readbuf_off + readbuf_len) { \
- readbuf_off = req_off; \
- readbuf_len = (int) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));\
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, readbuf_off, SEEK_SET);\
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);\
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); \
- err = read(fd->fd_sys, readbuf, readbuf_len);\
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);\
- if (err == -1) err_flag = 1; \
- } \
- while (req_len > readbuf_off + readbuf_len - req_off) { \
- partial_read = (int) (readbuf_off + readbuf_len - req_off); \
- tmp_buf = (char *) ADIOI_Malloc(partial_read); \
- memcpy(tmp_buf, readbuf+readbuf_len-partial_read, partial_read); \
- ADIOI_Free(readbuf); \
- readbuf = (char *) ADIOI_Malloc(partial_read + max_bufsize); \
- memcpy(readbuf, tmp_buf, partial_read); \
- ADIOI_Free(tmp_buf); \
- readbuf_off += readbuf_len-partial_read; \
- readbuf_len = (int) (partial_read + ADIOI_MIN(max_bufsize, \
- end_offset-readbuf_off+1)); \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, readbuf_off+partial_read, SEEK_SET);\
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);\
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); \
- err = read(fd->fd_sys, readbuf+partial_read, readbuf_len-partial_read);\
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);\
- if (err == -1) err_flag = 1; \
- } \
- memcpy((char *)buf + userbuf_off, readbuf+req_off-readbuf_off, req_len); \
-}
-#else
-#define ADIOI_BUFFERED_READ \
-{ \
- if (req_off >= readbuf_off + readbuf_len) { \
- readbuf_off = req_off; \
- readbuf_len = (int) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));\
- lseek(fd->fd_sys, readbuf_off, SEEK_SET);\
- if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);\
- err = read(fd->fd_sys, readbuf, readbuf_len);\
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);\
- if (err == -1) err_flag = 1; \
- } \
- while (req_len > readbuf_off + readbuf_len - req_off) { \
- partial_read = (int) (readbuf_off + readbuf_len - req_off); \
- tmp_buf = (char *) ADIOI_Malloc(partial_read); \
- memcpy(tmp_buf, readbuf+readbuf_len-partial_read, partial_read); \
- ADIOI_Free(readbuf); \
- readbuf = (char *) ADIOI_Malloc(partial_read + max_bufsize); \
- memcpy(readbuf, tmp_buf, partial_read); \
- ADIOI_Free(tmp_buf); \
- readbuf_off += readbuf_len-partial_read; \
- readbuf_len = (int) (partial_read + ADIOI_MIN(max_bufsize, \
- end_offset-readbuf_off+1)); \
- lseek(fd->fd_sys, readbuf_off+partial_read, SEEK_SET);\
- if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);\
- err = read(fd->fd_sys, readbuf+partial_read, readbuf_len-partial_read);\
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off+partial_read, SEEK_SET, readbuf_len-partial_read);\
- if (err == -1) err_flag = 1; \
- } \
- memcpy((char *)buf + userbuf_off, readbuf+req_off-readbuf_off, req_len); \
-}
-#endif
-
-
-void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* offset is in units of etype relative to the filetype. */
-
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- int i, j, k, err=-1, brd_size, st_index=0;
- int num, size, sum, n_etypes_in_filetype, size_in_filetype;
- MPI_Count bufsize;
- int n_filetypes, etype_in_filetype;
- 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;
- 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;
- char *readbuf, *tmp_buf, *value;
- int st_n_filetypes, readbuf_len;
- ADIO_Offset frd_size=0, new_frd_size, st_frd_size;
- int new_brd_size, err_flag=0, info_flag, max_bufsize;
-
- static char myname[] = "ADIOI_NFS_READSTRIDED";
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if ( ! filetype_size ) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- bufsize = buftype_size * 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,
- &info_flag);
- max_bufsize = atoi(value);
- ADIOI_Free(value);
-
- if (!buftype_is_contig && filetype_is_contig) {
-
-/* noncontiguous in memory, contiguous in file. */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind :
- fd->disp + etype_size * offset;
-
- start_off = off;
- end_offset = off + bufsize - 1;
- readbuf_off = off;
- readbuf = (char *) ADIOI_Malloc(max_bufsize);
- readbuf_len = (int) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));
-
-/* if atomicity is true, lock (exclusive) the region to be accessed */
- if (fd->atomicity)
- ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- lseek(fd->fd_sys, readbuf_off, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- if (!(fd->atomicity)) ADIOI_READ_LOCK(fd, readbuf_off, SEEK_SET, readbuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
-#endif
- err = read(fd->fd_sys, readbuf, readbuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
-#endif
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, readbuf_off, SEEK_SET, readbuf_len);
- if (err == -1) err_flag = 1;
-
- for (j=0; jcount; i++) {
- userbuf_off = j*buftype_extent + flat_buf->indices[i];
- req_off = off;
- req_len = flat_buf->blocklens[i];
- ADIOI_BUFFERED_READ
- off += flat_buf->blocklens[i];
- }
-
- 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;
-
- ADIOI_Free(readbuf); /* malloced in the buffered_read macro */
-
- if (err_flag) {
- *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;
- }
-
- else { /* noncontiguous in file */
-
-/* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype) flat_file = flat_file->next;
- disp = fd->disp;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- /* Wei-keng reworked type processing to be a bit more efficient */
- offset = fd->fp_ind - disp;
- n_filetypes = (offset - flat_file->indices[0]) / filetype_extent;
- offset -= (ADIO_Offset)n_filetypes * filetype_extent;
- /* now offset is local to this extent */
-
- /* find the block where offset is located, skip blocklens[i]==0 */
- for (i=0; icount; i++) {
- ADIO_Offset dist;
- if (flat_file->blocklens[i] == 0) continue;
- dist = flat_file->indices[i] + flat_file->blocklens[i] - offset;
- /* frd_size is from offset to the end of block i */
- if (dist == 0) {
- i++;
- offset = flat_file->indices[i];
- frd_size = flat_file->blocklens[i];
- break;
- }
- if (dist > 0 ) {
- frd_size = dist;
- break;
- }
- }
- st_index = i; /* starting index in flat_file->indices[] */
- offset += disp + (ADIO_Offset)n_filetypes*filetype_extent;
- }
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = (int) (offset / n_etypes_in_filetype);
- etype_in_filetype = (int) (offset % n_etypes_in_filetype);
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i=0; icount; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- frd_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes*filetype_extent +
- abs_off_in_filetype;
- }
-
- start_off = offset;
-
- /* Wei-keng Liao: read request is within a single flat_file contig
- * block e.g. with subarray types that actually describe the whole
- * array */
- if (buftype_is_contig && bufsize <= frd_size) {
- ADIO_ReadContig(fd, buf, bufsize, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
- offset, status, error_code);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- /* 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) {
- do {
- st_index++;
- if (st_index == flat_file->count) {
- st_index = 0;
- n_filetypes++;
- }
- } while (flat_file->blocklens[st_index] == 0);
- fd->fp_ind = disp + flat_file->indices[st_index]
- + n_filetypes*filetype_extent;
- }
- }
- fd->fp_sys_posn = -1; /* set it to null. */
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-#endif
- return;
- }
-
- /* Calculate end_offset, the last byte-offset that will be accessed.
- e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/
-
- st_frd_size = frd_size;
- st_n_filetypes = n_filetypes;
- i = 0;
- j = st_index;
- off = offset;
- frd_size = ADIOI_MIN(st_frd_size, bufsize);
- while (i < bufsize) {
- i += frd_size;
- end_offset = off + frd_size - 1;
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
-
- off = disp + flat_file->indices[j] + (ADIO_Offset) n_filetypes*filetype_extent;
- frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i);
- }
-
-/* if atomicity is true, lock (exclusive) the region to be accessed */
- if (fd->atomicity)
- ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- /* initial read into readbuf */
- readbuf_off = offset;
- readbuf = (char *) ADIOI_Malloc(max_bufsize);
- readbuf_len = (int) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));
-
-#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_READ_LOCK(fd, offset, SEEK_SET, readbuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL );
-#endif
- err = read(fd->fd_sys, readbuf, readbuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
-#endif
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, offset, SEEK_SET, readbuf_len);
-
- if (err == -1) err_flag = 1;
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- i = 0;
- j = st_index;
- off = offset;
- 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 */
- /* lseek(fd->fd_sys, off, SEEK_SET);
- err = read(fd->fd_sys, ((char *) buf) + i, frd_size);*/
-
- req_off = off;
- req_len = frd_size;
- userbuf_off = i;
- ADIOI_BUFFERED_READ
- }
- i += frd_size;
-
- if (off + frd_size < disp + flat_file->indices[j] +
- flat_file->blocklens[j] + (ADIO_Offset) n_filetypes*filetype_extent)
- off += frd_size;
- /* did not reach end of contiguous block in filetype.
- no more I/O needed. off is incremented by frd_size. */
- else {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
- frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i);
- }
- }
- }
- else {
-/* noncontiguous in memory as well as in file */
-
- ADIO_Offset i;
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- k = num = buf_count = 0;
- i = flat_buf->indices[0];
- j = st_index;
- off = offset;
- n_filetypes = st_n_filetypes;
- frd_size = st_frd_size;
- brd_size = flat_buf->blocklens[0];
-
- while (num < bufsize) {
- size = ADIOI_MIN(frd_size, brd_size);
- if (size) {
- /* lseek(fd->fd_sys, off, SEEK_SET);
- err = read(fd->fd_sys, ((char *) buf) + i, size); */
-
- req_off = off;
- req_len = size;
- userbuf_off = i;
- ADIOI_BUFFERED_READ
- }
-
- new_frd_size = frd_size;
- new_brd_size = brd_size;
-
- if (size == frd_size) {
-/* reached end of contiguous block in file */
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
-
- new_frd_size = flat_file->blocklens[j];
- if (size != brd_size) {
- i += size;
- new_brd_size -= size;
- }
- }
-
- if (size == brd_size) {
-/* reached end of contiguous block in memory */
-
- k = (k + 1)%flat_buf->count;
- buf_count++;
- i = buftype_extent*(buf_count/flat_buf->count) +
- flat_buf->indices[k];
- new_brd_size = flat_buf->blocklens[k];
- if (size != frd_size) {
- off += size;
- new_frd_size -= size;
- }
- }
- num += size;
- frd_size = new_frd_size;
- brd_size = new_brd_size;
- }
- }
-
- 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;
-
- ADIOI_Free(readbuf); /* malloced in the buffered_read macro */
-
- if (err_flag) {
- *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;
- }
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-/* This is a temporary way of filling in status. The right way is to
- keep track of how much data was actually read and placed in buf
- by ADIOI_BUFFERED_READ. */
-#endif
-
- if (!buftype_is_contig) ADIOI_Delete_flattened(datatype);
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_resize.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_resize.c
deleted file mode 100644
index d86dfcc77ed..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_resize.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2004 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-/* NFS resize
- *
- * Note: we resize on all processors to guarantee that all processors
- * will have updated cache values. This used to be the generic
- * implementation used by the majority of the ADIO implementations.
- */
-void ADIOI_NFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
-{
- int err;
- static char myname[] = "ADIOI_NFS_RESIZE";
-
- err = ftruncate(fd->fd_sys, size);
-
- /* --BEGIN ERROR HANDLING-- */
- if (err == -1) {
- *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
- return;
- }
- /* --END ERROR HANDLING-- */
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_setsh.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_setsh.c
deleted file mode 100644
index 42e558cb476..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_setsh.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * 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
- view */
-
-/*
-This looks very similar to ADIOI_GEN_Set_shared_fp, except this
-function avoids locking the file twice. The generic version does
-
-Write lock
-ADIO_WriteContig
-Unlock
-
-For NFS, ADIOI_NFS_WriteContig does a lock before writing to disable
-caching. To avoid the lock being called twice, this version for NFS does
-
-Write lock
-Lseek
-Write
-Unlock
-
-*/
-
-void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code)
-{
- ssize_t err;
- MPI_Comm dupcommself;
- static char myname[] = "ADIOI_NFS_SET_SHARED_FP";
-
- if (fd->shared_fp_fd == ADIO_FILE_NULL) {
- MPI_Comm_dup(MPI_COMM_SELF, &dupcommself);
- fd->shared_fp_fd = ADIO_Open(MPI_COMM_SELF, dupcommself,
- fd->shared_fp_fname,
- fd->file_system, fd->fns,
- 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;
-
- ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset));
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- lseek(fd->shared_fp_fd->fd_sys, 0, 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_write_a, 0, NULL );
-#endif
- err = write(fd->shared_fp_fd->fd_sys, &offset, sizeof(ADIO_Offset));
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset));
-
- if (err == -1) {
- *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;
-}
-
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_wait.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_wait.c
deleted file mode 100644
index e1037fc5513..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_wait.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-
-void ADIOI_NFS_ReadComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return;
-}
-
-
-void ADIOI_NFS_WriteComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- ADIOI_NFS_ReadComplete(request, status, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_nfs/ad_nfs_write.c b/3rd-party/romio321/adio/ad_nfs/ad_nfs_write.c
deleted file mode 100644
index 06dca92ef84..00000000000
--- a/3rd-party/romio321/adio/ad_nfs/ad_nfs_write.c
+++ /dev/null
@@ -1,678 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_nfs.h"
-#include "adio_extern.h"
-
-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)
-{
- int err=-1;
- MPI_Count datatype_size, len;
- static char myname[] = "ADIOI_NFS_WRITECONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- 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
- 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_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;
- }
-
- /* --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, err);
-#endif
-
- *error_code = MPI_SUCCESS;
-}
-
-
-
-
-#ifdef ADIOI_MPE_LOGGING
-#define ADIOI_BUFFERED_WRITE \
-{ \
- if (req_off >= writebuf_off + writebuf_len) { \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- writebuf_off = req_off; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); \
- err = read(fd->fd_sys, writebuf, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); \
- if (err == -1) { \
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**ioRMWrdwr", 0); \
- goto fn_exit; \
- } \
- } \
- write_sz = (int) (ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off)); \
- memcpy(writebuf+req_off-writebuf_off, (char *)buf +userbuf_off, write_sz);\
- while (write_sz != req_len) { \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- req_len -= write_sz; \
- userbuf_off += write_sz; \
- writebuf_off += writebuf_len; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); \
- err = read(fd->fd_sys, writebuf, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); \
- if (err == -1) { \
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**ioRMWrdwr", 0); \
- goto fn_exit; \
- } \
- write_sz = ADIOI_MIN(req_len, writebuf_len); \
- memcpy(writebuf, (char *)buf + userbuf_off, write_sz);\
- } \
-}
-#else
-#define ADIOI_BUFFERED_WRITE \
-{ \
- if (req_off >= writebuf_off + writebuf_len) { \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- writebuf_off = req_off; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- err = read(fd->fd_sys, writebuf, writebuf_len); \
- if (err == -1) { \
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**ioRMWrdwr", 0); \
- goto fn_exit; \
- } \
- } \
- write_sz = (int) (ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off)); \
- memcpy(writebuf+req_off-writebuf_off, (char *)buf +userbuf_off, write_sz);\
- while (write_sz != req_len) { \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- req_len -= write_sz; \
- userbuf_off += write_sz; \
- writebuf_off += writebuf_len; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- err = read(fd->fd_sys, writebuf, writebuf_len); \
- if (err == -1) { \
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, \
- MPIR_ERR_RECOVERABLE, myname, \
- __LINE__, MPI_ERR_IO, \
- "**ioRMWrdwr", 0); \
- goto fn_exit; \
- } \
- write_sz = ADIOI_MIN(req_len, writebuf_len); \
- memcpy(writebuf, (char *)buf + userbuf_off, write_sz);\
- } \
-}
-#endif
-
-/* this macro is used when filetype is contig and buftype is not contig.
- it does not do a read-modify-write and does not lock*/
-#ifdef ADIOI_MPE_LOGGING
-#define ADIOI_BUFFERED_WRITE_WITHOUT_READ \
-{ \
- if (req_off >= writebuf_off + writebuf_len) { \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- writebuf_off = req_off; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- } \
- write_sz = (int) (ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off)); \
- memcpy(writebuf+req_off-writebuf_off, (char *)buf +userbuf_off, write_sz);\
- while (write_sz != req_len) { \
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- req_len -= write_sz; \
- userbuf_off += write_sz; \
- writebuf_off += writebuf_len; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- write_sz = ADIOI_MIN(req_len, writebuf_len); \
- memcpy(writebuf, (char *)buf + userbuf_off, write_sz);\
- } \
-}
-#else
-#define ADIOI_BUFFERED_WRITE_WITHOUT_READ \
-{ \
- if (req_off >= writebuf_off + writebuf_len) { \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- writebuf_off = req_off; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- } \
- write_sz = (int) (ADIOI_MIN(req_len, writebuf_off + writebuf_len - req_off)); \
- memcpy(writebuf+req_off-writebuf_off, (char *)buf +userbuf_off, write_sz);\
- while (write_sz != req_len) { \
- lseek(fd->fd_sys, writebuf_off, SEEK_SET); \
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- err = write(fd->fd_sys, writebuf, writebuf_len); \
- if (!(fd->atomicity)) ADIOI_UNLOCK(fd, writebuf_off, SEEK_SET, writebuf_len); \
- if (err == -1) err_flag = 1; \
- req_len -= write_sz; \
- userbuf_off += write_sz; \
- writebuf_off += writebuf_len; \
- writebuf_len = (int) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\
- write_sz = ADIOI_MIN(req_len, writebuf_len); \
- memcpy(writebuf, (char *)buf + userbuf_off, write_sz);\
- } \
-}
-#endif
-
-
-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
- *error_code)
-{
-/* offset is in units of etype relative to the filetype. */
-
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- int i, j, k, err=-1, bwr_size, st_index=0;
- int num, size, sum, n_etypes_in_filetype, size_in_filetype;
- MPI_Count bufsize;
- int n_filetypes, etype_in_filetype;
- 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;
- 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;
- char *writebuf=NULL, *value;
- int st_n_filetypes, writebuf_len, write_sz;
- ADIO_Offset fwr_size = 0, new_fwr_size, st_fwr_size;
- int new_bwr_size, err_flag=0, info_flag, max_bufsize;
- static char myname[] = "ADIOI_NFS_WRITESTRIDED";
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if ( ! filetype_size ) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- bufsize = buftype_size * 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,
- &info_flag);
- max_bufsize = atoi(value);
- ADIOI_Free(value);
-
- if (!buftype_is_contig && filetype_is_contig) {
-
-/* noncontiguous in memory, contiguous in file. */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind :
- fd->disp + etype_size * offset;
-
- start_off = off;
- end_offset = off + bufsize - 1;
- writebuf_off = off;
- writebuf = (char *) ADIOI_Malloc(max_bufsize);
- 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)
- ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- for (j=0; jcount; i++) {
- userbuf_off = j*buftype_extent + flat_buf->indices[i];
- req_off = off;
- req_len = flat_buf->blocklens[i];
- ADIOI_BUFFERED_WRITE_WITHOUT_READ
- off += flat_buf->blocklens[i];
- }
-
- /* 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);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
-#endif
- 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 (fd->atomicity)
- ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
- if (err_flag) {
- *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;
- }
-
- else { /* noncontiguous in file */
-
-/* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype) flat_file = flat_file->next;
- disp = fd->disp;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- /* Wei-keng reworked type processing to be a bit more efficient */
- offset = fd->fp_ind - disp;
- n_filetypes = (offset - flat_file->indices[0]) / filetype_extent;
- offset -= (ADIO_Offset)n_filetypes * filetype_extent;
- /* now offset is local to this extent */
-
- /* find the block where offset is located, skip blocklens[i]==0 */
- for (i=0; icount; i++) {
- ADIO_Offset dist;
- if (flat_file->blocklens[i] == 0) continue;
- dist = flat_file->indices[i] + flat_file->blocklens[i] - offset;
- /* fwr_size is from offset to the end of block i */
- if (dist == 0) {
- i++;
- offset = flat_file->indices[i];
- fwr_size = flat_file->blocklens[i];
- break;
- }
- if (dist > 0) {
- fwr_size = dist;
- break;
- }
- }
- st_index = i; /* starting index in flat_file->indices[] */
- offset += disp + (ADIO_Offset)n_filetypes*filetype_extent;
- }
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = (int) (offset / n_etypes_in_filetype);
- etype_in_filetype = (int) (offset % n_etypes_in_filetype);
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i=0; icount; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- fwr_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes*filetype_extent +
- abs_off_in_filetype;
- }
-
- start_off = offset;
- /* Wei-keng Liao:write request is within single flat_file contig block*/
- /* this could happen, for example, with subarray types that are
- * actually fairly contiguous */
- if (buftype_is_contig && bufsize <= fwr_size) {
- ADIO_WriteContig(fd, buf, bufsize, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
- offset, status, error_code);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- /* 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) {
- do {
- st_index++;
- if (st_index == flat_file->count) {
- st_index = 0;
- n_filetypes++;
- }
- } while (flat_file->blocklens[st_index] == 0);
- fd->fp_ind = disp + flat_file->indices[st_index]
- + (ADIO_Offset)n_filetypes*filetype_extent;
- }
- }
- fd->fp_sys_posn = -1; /* set it to null. */
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-#endif
- return;
- }
-
- /* Calculate end_offset, the last byte-offset that will be accessed.
- e.g., if start_offset=0 and 100 bytes to be write, end_offset=99*/
-
- st_fwr_size = fwr_size;
- st_n_filetypes = n_filetypes;
- i = 0;
- j = st_index;
- off = offset;
- fwr_size = ADIOI_MIN(st_fwr_size, bufsize);
- while (i < bufsize) {
- i += fwr_size;
- end_offset = off + fwr_size - 1;
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
-
- 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)
- ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- /* initial read for the read-modify-write */
- writebuf_off = offset;
- writebuf = (char *) ADIOI_Malloc(max_bufsize);
- writebuf_len = (int)(ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- 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);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
-#endif
- if (err == -1) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_IO,
- "ADIOI_NFS_WriteStrided: ROMIO tries to optimize this access by doing a read-modify-write, but is unable to read the file. Please give the file read permission and open it with MPI_MODE_RDWR.", 0);
- goto fn_exit;
- }
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- i = 0;
- j = st_index;
- off = offset;
- 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 */
- /* lseek(fd->fd_sys, off, SEEK_SET);
- err = write(fd->fd_sys, ((char *) buf) + i, fwr_size);*/
-
- req_off = off;
- req_len = fwr_size;
- userbuf_off = i;
- ADIOI_BUFFERED_WRITE
- }
- i += fwr_size;
-
- if (off + fwr_size < disp + flat_file->indices[j] +
- flat_file->blocklens[j] + (ADIO_Offset) n_filetypes*filetype_extent)
- off += fwr_size;
- /* did not reach end of contiguous block in filetype.
- no more I/O needed. off is incremented by fwr_size. */
- else {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
- fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i);
- }
- }
- }
- else {
-/* noncontiguous in memory as well as in file */
-
- ADIO_Offset i;
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- k = num = buf_count = 0;
- i = flat_buf->indices[0];
- j = st_index;
- off = offset;
- n_filetypes = st_n_filetypes;
- fwr_size = st_fwr_size;
- bwr_size = flat_buf->blocklens[0];
-
- while (num < bufsize) {
- size = ADIOI_MIN(fwr_size, bwr_size);
- if (size) {
- /* lseek(fd->fd_sys, off, SEEK_SET);
- err = write(fd->fd_sys, ((char *) buf) + i, size); */
-
- req_off = off;
- req_len = size;
- userbuf_off = i;
- ADIOI_BUFFERED_WRITE
- }
-
- new_fwr_size = fwr_size;
- new_bwr_size = bwr_size;
-
- if (size == fwr_size) {
-/* reached end of contiguous block in file */
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- while (flat_file->blocklens[j]==0) {
- j = (j+1) % flat_file->count;
- n_filetypes += (j == 0) ? 1 : 0;
- }
-
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
-
- new_fwr_size = flat_file->blocklens[j];
- if (size != bwr_size) {
- i += size;
- new_bwr_size -= size;
- }
- }
-
- if (size == bwr_size) {
-/* reached end of contiguous block in memory */
-
- k = (k + 1)%flat_buf->count;
- buf_count++;
- i = buftype_extent*(buf_count/flat_buf->count) +
- flat_buf->indices[k];
- new_bwr_size = flat_buf->blocklens[k];
- if (size != fwr_size) {
- off += size;
- new_fwr_size -= size;
- }
- }
- num += size;
- fwr_size = new_fwr_size;
- bwr_size = new_bwr_size;
- }
- }
-
- /* 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);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- if (!(fd->atomicity)) ADIOI_WRITE_LOCK(fd, writebuf_off, SEEK_SET, writebuf_len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
-#endif
- 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);
- else ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1);
-
- if (err == -1) err_flag = 1;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
- if (err_flag) {
- *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;
- }
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-/* This is a temporary way of filling in status. The right way is to
- keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */
-#endif
-
- if (!buftype_is_contig) ADIOI_Delete_flattened(datatype);
-fn_exit:
- if (writebuf != NULL) ADIOI_Free(writebuf);
-
- return;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs.c
deleted file mode 100644
index 97882741217..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_NTFS_operations = {
- ADIOI_NTFS_Open, /* Open */
- ADIOI_FAILSAFE_OpenColl, /* OpenColl */
- ADIOI_NTFS_ReadContig, /* ReadContig */
- ADIOI_NTFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_NTFS_Fcntl, /* Fcntl */
- ADIOI_GEN_SetInfo, /* SetInfo */
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_GEN_WriteStrided, /* WriteStrided */
- ADIOI_NTFS_Close, /* Close */
- ADIOI_NTFS_IreadContig, /* IreadContig */
- ADIOI_NTFS_IwriteContig, /* IwriteContig */
- ADIOI_NTFS_ReadDone, /* ReadDone */
- ADIOI_NTFS_WriteDone, /* WriteDone */
- ADIOI_NTFS_ReadComplete, /* ReadComplete */
- ADIOI_NTFS_WriteComplete, /* WriteComplete */
- ADIOI_FAKE_IreadStrided, /* IreadStrided */
- ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
- ADIOI_NTFS_Flush, /* Flush */
- ADIOI_NTFS_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_NTFS_Feature, /* Features */
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs.h b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs.h
deleted file mode 100644
index aed6168bd8b..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#ifndef AD_NTFS_INCLUDE
-#define AD_NTFS_INCLUDE
-
-#include
-#include
-#include "adio.h"
-
-#ifdef HAVE_INT64
-#define DWORDLOW(x) ( (DWORD) ( x & (__int64) 0xFFFFFFFF ) )
-#define DWORDHIGH(x) ( (DWORD) ( (x >> 32) & (__int64) 0xFFFFFFFF ) )
-#define DWORDTOINT64(x,y) ( (__int64) ( ( (__int64 x) << 32 ) + (__int64) y ) )
-#else
-#define DWORDLOW(x) x
-#define DWORDHIGH(x) 0
-#define DWORDTOINT64(x,y) x
-#endif
-
-int ADIOI_NTFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
- int wr, void *handle);
-
-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,
- 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,
- 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,
- 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,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *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);
-void ADIOI_NTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code);
-void ADIOI_NTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
- *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
- *error_code);
-void ADIOI_NTFS_Flush(ADIO_File fd, int *error_code);
-void ADIOI_NTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
-
-#define FORMAT_MESSAGE_MIN_SIZE 100
-#define ADIOI_NTFS_ERR_MSG_MAX FORMAT_MESSAGE_MIN_SIZE
-void ADIOI_NTFS_Strerror(int error, char *errMsg, int errMsgLen);
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_close.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_close.c
deleted file mode 100644
index 95022dca77b..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_close.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_Close(ADIO_File fd, int *error_code)
-{
- int err;
- static char myname[] = "ADIOI_NTFS_Close";
-
- err = CloseHandle(fd->fd_sys);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_done.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_done.c
deleted file mode 100644
index 9f4967b48ba..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_done.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-int ADIOI_NTFS_ReadDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return 0;
-}
-
-
-int ADIOI_NTFS_WriteDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return 0;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_fcntl.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_fcntl.c
deleted file mode 100644
index 4c7d66cd074..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_fcntl.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-#include "adio_extern.h"
-
-void ADIOI_NTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code)
-{
- DWORD err;
- LONG dwTemp;
- static char myname[] = "ADIOI_NTFS_FCNTL";
-
- switch(flag)
- {
- case ADIO_FCNTL_GET_FSIZE:
- fcntl_struct->fsize = SetFilePointer(fd->fd_sys, 0, 0, FILE_END);
- 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)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- if (err != NO_ERROR)
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- return;
- }
- }
- }
- /* --BEGIN ERROR HANDLING-- */
- if (fcntl_struct->fsize == INVALID_SET_FILE_POINTER)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- dwTemp = GetLastError();
- ADIOI_NTFS_Strerror(dwTemp, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
- *error_code = MPI_SUCCESS;
- /*
- fd->atomicity = 0;
- *error_code = MPI_ERR_UNSUPPORTED_OPERATION;
- */
- break;
-
- default:
- /* --BEGIN ERROR HANDLING-- */
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_ARG,
- "**flag", "**flag %d", flag);
- return;
- /* --END ERROR HANDLING-- */
- }
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_feature.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_feature.c
deleted file mode 100644
index 335b5aed57e..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_feature.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#include "adio.h"
-
-int ADIOI_NTFS_Feature(ADIO_File fd, int flag)
-{
- switch(flag) {
- /* supported features */
- case ADIO_LOCKS:
- case ADIO_SHARED_FP:
- case ADIO_ATOMIC_MODE:
- case ADIO_DATA_SIEVING_WRITES:
- return 1;
- break;
- /* unsupported features */
- case ADIO_SCALABLE_OPEN:
- case ADIO_UNLINK_AFTER_CLOSE:
- default:
- return 0;
- break;
- }
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_flush.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_flush.c
deleted file mode 100644
index 7656d60fb66..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_flush.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_Flush(ADIO_File fd, int *error_code)
-{
- int err;
- static char myname[] = "ADIOI_NTFS_Flush";
-
- err = (fd->access_mode & ADIO_RDONLY) ? TRUE :
- FlushFileBuffers(fd->fd_sys);
-
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_iread.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_iread.c
deleted file mode 100644
index 845401ad44a..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_iread.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_IreadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int *error_code)
-{
- MPI_Count len, typesize;
- int err;
- static char myname[] = "ADIOI_NTFS_IreadContig";
-
- MPI_Type_size_x(datatype, &typesize);
- len = count * typesize;
-
- if (file_ptr_type == ADIO_INDIVIDUAL)
- {
- offset = fd->fp_ind;
- }
- err = ADIOI_NTFS_aio(fd, buf, len, offset, 0, request);
- if (file_ptr_type == ADIO_INDIVIDUAL)
- {
- fd->fp_ind += len;
- }
-
- /* --BEGIN ERROR HANDLING-- */
- if (err != MPI_SUCCESS)
- {
- *error_code = MPIO_Err_create_code(err, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", 0);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-
- fd->fp_sys_posn = -1; /* set it to null. */
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_iwrite.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_iwrite.c
deleted file mode 100644
index 40a567e564b..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_iwrite.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-#include "../../mpi-io/mpioimpl.h"
-#include "../../mpi-io/mpioprof.h"
-#include "mpiu_greq.h"
-
-static MPIX_Grequest_class ADIOI_NTFS_greq_class = 0;
-
-/* Fills the input buffer, errMsg, with the error message
- corresponding to error code, error */
-void ADIOI_NTFS_Strerror(int error, char *errMsg, int errMsgLen)
-{
- LPTSTR str;
- int num_bytes;
- num_bytes = FormatMessage(
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_ALLOCATE_BUFFER,
- NULL,
- error,
- 0,
- &str,
- FORMAT_MESSAGE_MIN_SIZE,
- 0);
- if (num_bytes == 0)
- {
- strncpy(errMsg, "\0", errMsgLen);
- }
- else
- {
- strncpy(errMsg, str, errMsgLen);
- LocalFree(str);
- }
-}
-
-/* poll for completion of a single outstanding AIO request */
-int ADIOI_NTFS_aio_poll_fn(void *extra_state, MPI_Status *status)
-{
- ADIOI_AIO_Request *aio_req;
- int mpi_errno = MPI_SUCCESS;
-
- /* FIXME: Validate the args -- has it already been done by the
- caller ? */
-
- aio_req = (ADIOI_AIO_Request *)extra_state;
-
- /* XXX: test for AIO completion here */
- if(!GetOverlappedResult( aio_req->fd, aio_req->lpOvl,
- &(aio_req->nbytes), FALSE)){
- if(GetLastError() == ERROR_IO_INCOMPLETE){
- /* IO in progress */
- /* TODO: need to diddle with status somehow */
- }else{
- /* Error occured */
- /* TODO: unsure how to handle this */
- }
- }else{
- mpi_errno = MPI_Grequest_complete(aio_req->req);
- if (mpi_errno != MPI_SUCCESS) {
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- "ADIOI_NTFS_aio_poll_fn", __LINE__,
- MPI_ERR_IO, "**mpi_grequest_complete",
- 0);
- }
- }
- return mpi_errno;
-}
-
-
-/* Wait for completion of one of the outstanding AIO requests */
-int ADIOI_NTFS_aio_wait_fn(int count, void **array_of_states,
- double timeout, MPI_Status *status)
-{
- int i, mpi_errno = MPI_SUCCESS;
- ADIOI_AIO_Request **aio_reqlist;
- LPHANDLE lpHandles;
- DWORD retObject=0;
-
- /* FIXME: Validate the args -- has it already been done by the
- caller ? */
- aio_reqlist = (ADIOI_AIO_Request **)array_of_states;
- lpHandles = (LPHANDLE) ADIOI_Calloc(count, sizeof(HANDLE));
- if (lpHandles == NULL)
- {
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- "ADIOI_NTFS_aio_wait_fn", __LINE__, MPI_ERR_IO,
- "**nomem", "**nomem %s", "Event handles");
- return mpi_errno;
- }
- /* XXX: set-up arrays of outstanding requests */
- for(i=0; ilpOvl->hEvent;
- }
-
- /* XXX: wait for one request to complete */
- /* FIXME: Is the timeout in seconds ? */
- timeout = (timeout <= 0) ? INFINITE : (timeout * 1000);
-
- if((retObject = WaitForMultipleObjects(count, lpHandles,
- FALSE, timeout)) != WAIT_FAILED){
- retObject = retObject - WAIT_OBJECT_0;
- if(GetOverlappedResult( aio_reqlist[retObject]->fd,
- aio_reqlist[retObject]->lpOvl, &(aio_reqlist[retObject]->nbytes),
- FALSE)){
- /* XXX: mark completed requests as 'done'*/
- mpi_errno = MPI_Grequest_complete(aio_reqlist[retObject]->req);
- if (mpi_errno != MPI_SUCCESS) {
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- "ADIOI_NTFS_aio_wait_fn", __LINE__,
- MPI_ERR_IO, "**mpi_grequest_complete",
- 0);
- }
- }else{
- if(GetLastError() == ERROR_IO_INCOMPLETE){
- /* IO in progress */
- /* TODO: need to diddle with status somehow */
- }else{
- /* Error occured */
- /* TODO: not sure how to handle this */
- }
- }
- }else{
- /* TODO: How to handle error while waiting ? */
- }
- ADIOI_Free(lpHandles);
- return mpi_errno;
-}
-
-int ADIOI_NTFS_aio_query_fn(void *extra_state, MPI_Status *status)
-{
- ADIOI_AIO_Request *aio_req;
-
- aio_req = (ADIOI_AIO_Request *)extra_state;
-
-
- MPI_Status_set_elements(status, MPI_BYTE, aio_req->nbytes);
-
- /* can never cancel so always true */
- MPI_Status_set_cancelled(status, 0);
-
- /* choose not to return a value for this */
- status->MPI_SOURCE = MPI_UNDEFINED;
- /* tag has no meaning for this generalized request */
- status->MPI_TAG = MPI_UNDEFINED;
- /* this generalized request never fails */
- return MPI_SUCCESS;
-}
-
-
-int ADIOI_NTFS_aio_free_fn(void *extra_state)
-{
- ADIOI_AIO_Request *aio_req;
- /* FIXME: Validate the args -- has it already been done by the
- caller ? */
- aio_req = (ADIOI_AIO_Request*)extra_state;
- CloseHandle(aio_req->lpOvl->hEvent);
- ADIOI_Free(aio_req->lpOvl);
- ADIOI_Free(aio_req);
- return MPI_SUCCESS;
-}
-
-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)
-{
- MPI_Count len, typesize;
- int err;
- static char myname[] = "ADIOI_NTFS_IwriteContig";
-
- MPI_Type_size_x(datatype, &typesize);
- len = count * typesize;
-
- if (file_ptr_type == ADIO_INDIVIDUAL)
- {
- offset = fd->fp_ind;
- }
- err = ADIOI_NTFS_aio(fd, buf, len, offset, 1, request);
- if (file_ptr_type == ADIO_INDIVIDUAL)
- {
- fd->fp_ind += len;
- }
-
- /* --BEGIN ERROR HANDLING-- */
- if (err != MPI_SUCCESS)
- {
- *error_code = MPIO_Err_create_code(err, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", 0);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-
- fd->fp_sys_posn = -1; /* set it to null. */
-}
-
-
-/* This function is for implementation convenience. It is not user-visible.
- * If wr==1 write, wr==0 read.
- *
- * Returns MPI_SUCCESS on success, mpi_errno on failure.
- */
-int ADIOI_NTFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
- int wr, MPI_Request *request)
-{
- static char myname[] = "ADIOI_NTFS_aio";
-
- ADIOI_AIO_Request *aio_req;
- static DWORD dwNumWritten, dwNumRead;
- BOOL ret_val = FALSE;
- FDTYPE fd_sys;
- int mpi_errno = MPI_SUCCESS;
- DWORD err;
-
- fd_sys = fd->fd_sys;
-
- aio_req = (ADIOI_AIO_Request *)ADIOI_Calloc(sizeof(ADIOI_AIO_Request), 1);
- if (aio_req == NULL)
- {
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**nomem", "**nomem %s", "AIO_REQ");
- return mpi_errno;
- }
- aio_req->lpOvl = (LPOVERLAPPED ) ADIOI_Calloc(sizeof(OVERLAPPED), 1);
- if (aio_req->lpOvl == NULL)
- {
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**nomem", "**nomem %s", "OVERLAPPED");
- ADIOI_Free(aio_req);
- return mpi_errno;
- }
- aio_req->lpOvl->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- if (aio_req->lpOvl->hEvent == NULL)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- ADIOI_Free(aio_req->lpOvl);
- ADIOI_Free(aio_req);
- return mpi_errno;
- }
- aio_req->lpOvl->Offset = DWORDLOW(offset);
- aio_req->lpOvl->OffsetHigh = DWORDHIGH(offset);
- aio_req->fd = fd_sys;
-
- /* XXX: initiate async I/O */
- if (wr)
- {
- ret_val = WriteFile(fd_sys, buf, len, &dwNumWritten, aio_req->lpOvl);
- }
- else
- {
- ret_val = ReadFile(fd_sys, buf, len, &dwNumRead, aio_req->lpOvl);
- }
-
- /* --BEGIN ERROR HANDLING-- */
- if (ret_val == FALSE)
- {
- mpi_errno = GetLastError();
- if (mpi_errno != ERROR_IO_PENDING)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- ADIOI_NTFS_Strerror(mpi_errno, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- mpi_errno = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return mpi_errno;
- }
- mpi_errno = MPI_SUCCESS;
- }
- /* --END ERROR HANDLING-- */
-
- /* XXX: set up generalized request class and request */
- if (ADIOI_NTFS_greq_class == 0) {
- mpi_errno = MPIX_Grequest_class_create(ADIOI_NTFS_aio_query_fn,
- ADIOI_NTFS_aio_free_fn, MPIU_Greq_cancel_fn,
- ADIOI_NTFS_aio_poll_fn, ADIOI_NTFS_aio_wait_fn,
- &ADIOI_NTFS_greq_class);
- if(mpi_errno != MPI_SUCCESS){
- /* FIXME: Pass appropriate error code to user */
- }
- }
- mpi_errno = MPIX_Grequest_class_allocate(ADIOI_NTFS_greq_class, aio_req, request);
- if(mpi_errno != MPI_SUCCESS){
- /* FIXME: Pass appropriate error code to user */
- }
- memcpy(&(aio_req->req), request, sizeof(MPI_Request));
- return mpi_errno;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_open.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_open.c
deleted file mode 100644
index 3a49418dbaa..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_open.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_Open(ADIO_File fd, int *error_code)
-{
- int err;
- int cmode, amode, attrib;
- static char myname[] = "ADIOI_NTFS_Open";
-
- amode = 0;
- cmode = OPEN_EXISTING;
-#ifdef USE_WIN_THREADED_IO
- attrib = FILE_FLAG_OVERLAPPED;
-#else
- attrib = FILE_ATTRIBUTE_NORMAL;
-#endif
-
- if (fd->access_mode & ADIO_CREATE)
- {
- cmode = OPEN_ALWAYS;
- }
- if (fd->access_mode & ADIO_EXCL)
- {
- cmode = CREATE_NEW;
- }
-
- if (fd->access_mode & ADIO_RDONLY)
- {
- amode = GENERIC_READ;
- }
- if (fd->access_mode & ADIO_WRONLY)
- {
- amode = GENERIC_WRITE;
- }
- if (fd->access_mode & ADIO_RDWR)
- {
- amode = GENERIC_READ | GENERIC_WRITE;
- }
-
- if (fd->access_mode & ADIO_DELETE_ON_CLOSE)
- {
- attrib = attrib | FILE_FLAG_DELETE_ON_CLOSE;
- }
- if (fd->access_mode & ADIO_SEQUENTIAL)
- {
- attrib = attrib | FILE_FLAG_SEQUENTIAL_SCAN;
- }
- else
- {
- attrib = attrib | FILE_FLAG_RANDOM_ACCESS;
- }
-
- fd->fd_sys = CreateFile(fd->filename,
- amode,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- NULL,
- cmode,
- attrib,
- NULL);
- fd->fd_direct = -1;
-
- if ((fd->fd_sys != INVALID_HANDLE_VALUE) && (fd->access_mode & ADIO_APPEND))
- {
- fd->fp_ind = fd->fp_sys_posn = SetFilePointer(fd->fd_sys, 0, NULL, FILE_END);
- if (fd->fp_ind == INVALID_SET_FILE_POINTER)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- if (err != NO_ERROR)
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- return;
- }
- }
- }
-
- /* --BEGIN ERROR HANDLING-- */
- if (fd->fd_sys == INVALID_HANDLE_VALUE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_read.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_read.c
deleted file mode 100644
index 7c55c1bc376..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_read.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code)
-{
- LONG dwTemp;
- DWORD dwNumRead = 0;
- int err=-1;
- MPI_Count datatype_size, len;
- static char myname[] = "ADIOI_NTFS_ReadContig";
- OVERLAPPED *pOvl;
-
- /* If file pointer is of type ADIO_INDIVIDUAL ignore the offset
- and use the current location of file pointer */
- if(file_ptr_type == ADIO_INDIVIDUAL){
- offset = fd->fp_ind;
- }
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- pOvl = (OVERLAPPED *) ADIOI_Calloc(sizeof(OVERLAPPED), 1);
- if (pOvl == NULL)
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**nomem", "**nomem %s", "OVERLAPPED");
- return;
- }
- pOvl->hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
- if (pOvl->hEvent == NULL)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- ADIOI_Free(pOvl);
- return;
- }
- pOvl->Offset = DWORDLOW(offset);
- pOvl->OffsetHigh = DWORDHIGH(offset);
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET)
- {
- if (fd->fp_sys_posn != offset)
- {
- dwTemp = DWORDHIGH(offset);
- if (SetFilePointer(fd->fd_sys, DWORDLOW(offset), &dwTemp, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- if (err != NO_ERROR)
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- }
- /*
- {
- ADIO_Fcntl_t fcntl_struct;
- int error_code;
- ADIO_Fcntl(fd, ADIO_FCNTL_GET_FSIZE, &fcntl_struct, &error_code);
- printf("File size b: %d\n", fcntl_struct.fsize);
- }
- printf("ReadFile(%d bytes)\n", len);fflush(stdout);
- */
- err = ReadFile(fd->fd_sys, buf, len, &dwNumRead, pOvl);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- switch (err)
- {
- case ERROR_IO_PENDING:
- break;
- case ERROR_HANDLE_EOF:
- /*printf("EOF error\n");fflush(stdout);*/
- SetEvent(pOvl->hEvent);
- break;
- default:
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- /* --END ERROR HANDLING-- */
- err = GetOverlappedResult(fd->fd_sys, pOvl, &dwNumRead, TRUE);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- if (err != ERROR_HANDLE_EOF) /* Ignore EOF errors */
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- /* --END ERROR HANDLING-- */
- if (!CloseHandle(pOvl->hEvent))
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- ADIOI_Free(pOvl);
-
- fd->fp_sys_posn = offset + (ADIO_Offset)dwNumRead;
- /* individual file pointer not updated */
- }
- else
- {
- /* read from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind)
- {
- dwTemp = DWORDHIGH(fd->fp_ind);
- if (SetFilePointer(fd->fd_sys, DWORDLOW(fd->fp_ind), &dwTemp, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- if (err != NO_ERROR)
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- }
- /*
- {
- ADIO_Fcntl_t fcntl_struct;
- int error_code;
- ADIO_Fcntl(fd, ADIO_FCNTL_GET_FSIZE, &fcntl_struct, &error_code);
- printf("File size c: %d\n", fcntl_struct.fsize);
- }
- printf("ReadFile(%d bytes)\n", len);fflush(stdout);
- */
- err = ReadFile(fd->fd_sys, buf, len, &dwNumRead, pOvl);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- switch (err)
- {
- case ERROR_IO_PENDING:
- break;
- case ERROR_HANDLE_EOF:
- /*printf("EOF error\n");fflush(stdout);*/
- SetEvent(pOvl->hEvent);
- break;
- default:
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- /* --END ERROR HANDLING-- */
- err = GetOverlappedResult(fd->fd_sys, pOvl, &dwNumRead, TRUE);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- if (err != ERROR_HANDLE_EOF) /* Ignore EOF errors */
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- /* --END ERROR HANDLING-- */
- if (!CloseHandle(pOvl->hEvent))
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- ADIOI_Free(pOvl);
- return;
- }
- ADIOI_Free(pOvl);
-
- fd->fp_ind = fd->fp_ind + (ADIO_Offset)dwNumRead;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != FALSE)
- {
- MPIR_Status_set_bytes(status, datatype, dwNumRead);
- }
-#endif
-
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_resize.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_resize.c
deleted file mode 100644
index 0fbeaaf9728..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_resize.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
-{
- LONG dwTemp;
- DWORD err;
- BOOL result;
- static char myname[] = "ADIOI_NTFS_Resize";
-
- dwTemp = DWORDHIGH(size);
- err = SetFilePointer(fd->fd_sys, DWORDLOW(size), &dwTemp, FILE_BEGIN);
- /* --BEGIN ERROR HANDLING-- */
- if (err == INVALID_SET_FILE_POINTER)
- {
- err = GetLastError();
- if (err != NO_ERROR)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- }
- /*printf("setting file length to %d\n", size);fflush(stdout);*/
- /* --END ERROR HANDLING-- */
- result = SetEndOfFile(fd->fd_sys);
- /* --BEGIN ERROR HANDLING-- */
- if (result == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_wait.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_wait.c
deleted file mode 100644
index 80dfa4d3349..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_wait.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return;
-}
-
-
-void ADIOI_NTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return;
-}
diff --git a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_write.c b/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_write.c
deleted file mode 100644
index 389e8669362..00000000000
--- a/3rd-party/romio321/adio/ad_ntfs/ad_ntfs_write.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_ntfs.h"
-
-void ADIOI_NTFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code)
-{
- static char myname[] = "ADIOI_NTFS_WriteContig";
- LONG dwTemp;
- DWORD dwNumWritten = 0;
- MPI_Count err=-1, datatype_size, len;
- OVERLAPPED *pOvl;
-
- /* If file pointer type in ADIO_INDIVIDUAL then offset should be
- ignored and the current location of file pointer should be used */
- if(file_ptr_type == ADIO_INDIVIDUAL){
- offset = fd->fp_ind;
- }
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- pOvl = (OVERLAPPED *) ADIOI_Calloc(sizeof(OVERLAPPED), 1);
- if (pOvl == NULL)
- {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**nomem", "**nomem %s", "OVERLAPPED");
- return;
- }
- pOvl->hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
- if (pOvl->hEvent == NULL)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- ADIOI_Free(pOvl);
- return;
- }
- pOvl->Offset = DWORDLOW(offset);
- pOvl->OffsetHigh = DWORDHIGH(offset);
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET)
- {
- if (fd->fp_sys_posn != offset)
- {
- dwTemp = DWORDHIGH(offset);
- if (SetFilePointer(fd->fd_sys, DWORDLOW(offset), &dwTemp, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
- {
- err = GetLastError();
- if (err != NO_ERROR)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- }
- /*printf("WriteFile(%d bytes)\n", len);fflush(stdout);*/
- err = WriteFile(fd->fd_sys, buf, len, &dwNumWritten, pOvl);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- err = GetLastError();
- if (err != ERROR_IO_PENDING)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- /* --END ERROR HANDLING-- */
- err = GetOverlappedResult(fd->fd_sys, pOvl, &dwNumWritten, TRUE);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- /* --END ERROR HANDLING-- */
- if (!CloseHandle(pOvl->hEvent))
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- ADIOI_Free(pOvl);
-
- fd->fp_sys_posn = offset + dwNumWritten;
- /* individual file pointer not updated */
- }
- else
- {
- /* write from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind)
- {
- dwTemp = DWORDHIGH(fd->fp_ind);
- if (SetFilePointer(fd->fd_sys, DWORDLOW(fd->fp_ind), &dwTemp, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
- {
- err = GetLastError();
- if (err != NO_ERROR)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- }
- /*printf("WriteFile(%d bytes)\n", len);fflush(stdout);*/
- err = WriteFile(fd->fd_sys, buf, len, &dwNumWritten, pOvl);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- err = GetLastError();
- if (err != ERROR_IO_PENDING)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- }
- /* --END ERROR HANDLING-- */
- err = GetOverlappedResult(fd->fd_sys, pOvl, &dwNumWritten, TRUE);
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", errMsg);
- CloseHandle(pOvl->hEvent);
- ADIOI_Free(pOvl);
- return;
- }
- /* --END ERROR HANDLING-- */
- if (!CloseHandle(pOvl->hEvent))
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io", "**io %s", errMsg);
- ADIOI_Free(pOvl);
- return;
- }
- ADIOI_Free(pOvl);
-
- fd->fp_ind = fd->fp_ind + dwNumWritten;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != FALSE)
- {
- MPIR_Status_set_bytes(status, datatype, dwNumWritten);
- }
-#endif
-
- /* --BEGIN ERROR HANDLING-- */
- if (err == FALSE)
- {
- char errMsg[ADIOI_NTFS_ERR_MSG_MAX];
- err = GetLastError();
- ADIOI_NTFS_Strerror(err, errMsg, ADIOI_NTFS_ERR_MSG_MAX);
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", errMsg);
- return;
- }
- /* --END ERROR HANDLING-- */
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_panfs/Makefile.mk b/3rd-party/romio321/adio/ad_panfs/Makefile.mk
deleted file mode 100644
index ad412d9bb08..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/Makefile.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_PANFS_OPEN6
-# override open with one that uses newer features
-panfs_open = adio/ad_panfs/ad_panfs_open6.c
-else
-panfs_open = adio/ad_panfs/ad_panfs_open.c
-endif
-
-if BUILD_AD_PANFS
-
-noinst_HEADERS += adio/ad_panfs/ad_panfs.h
-
-romio_other_sources += \
- adio/ad_panfs/ad_panfs.c \
- $(panfs_open) \
- adio/ad_panfs/ad_panfs_hints.c \
- adio/ad_panfs/ad_panfs_read.c \
- adio/ad_panfs/ad_panfs_resize.c \
- adio/ad_panfs/ad_panfs_write.c
-
-endif BUILD_AD_PANFS
-
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs.c
deleted file mode 100644
index 8bc14fccdf2..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * ad_panfs.c
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-#ifndef ROMIOCONF_H_INCLUDED
-#include "romioconf.h"
-#define ROMIOCONF_H_INCLUDED
-#endif
-
-
-struct ADIOI_Fns_struct ADIO_PANFS_operations = {
-#ifdef HAVE_PAN_FS_CLIENT_RAIDN_ENCODING_T
- ADIOI_PANFS_Open6, /* Open, using newer Panasas features */
-#else
- ADIOI_PANFS_Open, /* open, but using Panasas5 and earlier features */
-#endif
- ADIOI_GEN_OpenColl,
- ADIOI_PANFS_ReadContig, /* ReadContig */
- ADIOI_PANFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_GEN_Fcntl, /* Fcntl */
- ADIOI_PANFS_SetInfo, /* SetInfo */
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_GEN_WriteStrided, /* WriteStrided */
- ADIOI_GEN_Close, /* Close */
-#ifdef ROMIO_HAVE_WORKING_AIO
- ADIOI_GEN_IreadContig, /* IreadContig */
- ADIOI_GEN_IwriteContig, /* IwriteContig */
-#else
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
-#endif
- ADIOI_GEN_IODone, /* ReadDone */
- ADIOI_GEN_IODone, /* WriteDone */
- ADIOI_GEN_IOComplete, /* ReadComplete */
- ADIOI_GEN_IOComplete, /* WriteComplete */
- ADIOI_GEN_IreadStrided, /* IreadStrided */
- ADIOI_GEN_IwriteStrided, /* IwriteStrided */
- ADIOI_GEN_Flush, /* Flush */
- ADIOI_PANFS_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_GEN_Feature,
- "PANFS: Panasas PanFS",
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs.h b/3rd-party/romio321/adio/ad_panfs/ad_panfs.h
deleted file mode 100644
index 31a0f3d8a8b..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * ad_panfs.h
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#ifndef AD_PANFS_INCLUDE
-#define AD_PANFS_INCLUDE
-
-#include
-#include
-#include
-#include "adio.h"
-
-#ifndef NO_AIO
-# ifdef AIO_SUN
-# include
-# else
- #ifdef HAVE_AIO_LITE_H
- #include
- #else
- #ifdef HAVE_AIO_H
- #include
- #endif
- #ifdef HAVE_SYS_AIO_H
- #include
- #endif
- #endif
-# endif
-#endif
-
-void ADIOI_PANFS_Open(ADIO_File fd, int *error_code);
-/* Panasas 6 introduced some new features */
-void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code);
-void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code);
-void ADIOI_PANFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
-void ADIOI_PANFS_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);
-
-/* TODO: move this to common code and have all routines retry. */
-/* TODO: also check for EWOULDBLOCK */
-#if defined(NEEDS_USLEEP_DECL)
-int usleep(useconds_t usec);
-#endif
-
-/* Delay 1 ms */
-#define AD_PANFS_RETRY_DELAY 1000
-
-#define AD_PANFS_RETRY(_op_,_rc_) \
-{ \
- _rc_ = (_op_); \
- while(_rc_ == -1 && errno == EAGAIN) \
- { \
- if(usleep(AD_PANFS_RETRY_DELAY) == -1) \
- { \
- break; \
- } \
- _rc_ = (_op_); \
- } \
-}
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs_hints.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs_hints.c
deleted file mode 100644
index 94178ab0cfe..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs_hints.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * ad_panfs_hints.c
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-#include
-#include "hint_fns.h"
-
-void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
-{
-#if defined(MPICH) || !defined(PRINT_ERR_MSG)
- static char myname[] = "ADIOI_PANFS_SETINFO";
-#endif
- int gen_error_code;
-
- *error_code = MPI_SUCCESS;
-
- if (fd->info == MPI_INFO_NULL) {
- /* This must be part of the open call. can set striping parameters
- * if necessary.
- */
- MPI_Info_create(&(fd->info));
-
- /* anticipate concurrent writes in an MPI-IO application */
- ADIOI_Info_set (fd->info, "panfs_concurrent_write", "1");
-
- /* has user specified striping parameters
- and do they have the same value on all processes? */
- if (users_info != MPI_INFO_NULL) {
-
- ADIOI_Info_check_and_install_int(fd, users_info, "panfs_concurrent_write",
- NULL, myname, error_code);
-
- ADIOI_Info_check_and_install_int(fd, users_info, "panfs_layout_type",
- NULL, myname, error_code);
-
- ADIOI_Info_check_and_install_int(fd, users_info, "panfs_layout_stripe_unit",
- NULL, myname, error_code);
-
- /* strange: there was a check "layout_type ==
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE, but
- * nothing ever touched layout_type */
- ADIOI_Info_check_and_install_int(fd, users_info,
- "panfs_layout_parity_stripe_width", NULL, myname, error_code);
-
- ADIOI_Info_check_and_install_int(fd, users_info,
- "panfs_layout_parity_stripe_depth", NULL, myname, error_code);
-
- ADIOI_Info_check_and_install_int(fd, users_info,
- "panfs_layout_total_num_comps", NULL, myname, error_code);
- /* this hint used to check for
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE or
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAID10, but again, layout_type never
- * gets updated */
- ADIOI_Info_check_and_install_int(fd, users_info,
- "panfs_layout_visit_policy", NULL, myname, error_code);
- }
- }
-
- ADIOI_GEN_SetInfo(fd, users_info, &gen_error_code);
- /* If this function is successful, use the error code returned from ADIOI_GEN_SetInfo
- * otherwise use the error_code generated by this function
- */
- if(*error_code == MPI_SUCCESS)
- {
- *error_code = gen_error_code;
- }
-}
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs_open.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs_open.c
deleted file mode 100644
index d5374ebf448..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs_open.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * ad_panfs_open.c
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-#include
-#include
-#define TEMP_BUFFER_SIZE 64
-
-void ADIOI_PANFS_Open(ADIO_File fd, int *error_code)
-{
- char* value;
- int perm, old_mask, amode, flag;
- static char myname[] = "ADIOI_PANFS_OPEN";
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = ~old_mask & 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- {
- pan_fs_client_layout_agg_type_t layout_type = PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT;
- unsigned long int layout_stripe_unit = 0;
- unsigned long int layout_parity_stripe_width = 0;
- unsigned long int layout_parity_stripe_depth = 0;
- unsigned long int layout_total_num_comps = 0;
- pan_fs_client_layout_visit_t layout_visit_policy = PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN;
- int myrank;
-
- MPI_Comm_rank(fd->comm, &myrank);
-
- *error_code = MPI_SUCCESS;
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- ADIOI_Info_get(fd->info, "panfs_layout_type", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_type = strtoul(value,NULL,10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_stripe_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_stripe_unit = strtoul(value,NULL,10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_total_num_comps", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_total_num_comps = strtoul(value,NULL,10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_width", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_parity_stripe_width = strtoul(value,NULL,10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_depth", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_parity_stripe_depth = strtoul(value,NULL,10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_visit_policy = strtoul(value,NULL,10);
- }
- ADIOI_Free(value);
-
- amode = amode | O_CREAT;
- /* Check for valid set of hints */
- if ((layout_type < PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT) ||
- (layout_type > PAN_FS_CLIENT_LAYOUT_TYPE__RAID10))
- {
- FPRINTF(stderr, "%s: panfs_layout_type is not a valid value: %u.\n", myname, layout_type);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) &&
- ((layout_stripe_unit == 0) || (layout_total_num_comps == 0)))
- {
- if(layout_stripe_unit == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID0 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- if(layout_total_num_comps == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID0 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE)
- {
- if ((layout_stripe_unit == 0) ||
- (layout_parity_stripe_width == 0) ||
- (layout_parity_stripe_depth == 0) ||
- (layout_total_num_comps == 0))
- {
- if(layout_stripe_unit == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- if(layout_total_num_comps == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- if(layout_parity_stripe_width == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- if(layout_parity_stripe_depth == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) ||
- (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET))
- {
- FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname, layout_visit_policy);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
- if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)
- {
- if ((layout_stripe_unit == 0) || (layout_total_num_comps == 0))
- {
- if(layout_stripe_unit == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- if(layout_total_num_comps == 0)
- {
- FPRINTF(stderr, "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n", myname);
- }
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) ||
- (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET))
- {
- FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname, layout_visit_policy);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
- /* Create the file via ioctl() or open(). ADIOI_PANFS_Open's caller
- * already optimizes performance by only calling this function with
- * ADIO_CREATE on rank 0. Therefore, we don't need to worry about
- * implementing that optimization here. */
- if((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0) || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE)
- || (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)) {
- pan_fs_client_layout_create_args_t file_create_args;
- int fd_dir;
- char* slash;
- struct stat stat_buf;
- int err;
- char *path;
-
- /* Check that the file does not exist before
- * trying to create it. The ioctl itself should
- * be able to handle this condition. Currently,
- * the ioctl will return successfully if the file
- * has been previously created. Filed bug 33862
- * to track the problem.
- */
- err = stat(fd->filename,&stat_buf);
- if((err == -1) && (errno != ENOENT))
- {
- FPRINTF(stderr,"%s: Unexpected I/O Error calling stat() on PanFS file: %s.\n", myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- else if (err == 0)
- {
- FPRINTF(stderr,"%s: Cannot create PanFS file with ioctl when file already exists.\n", myname);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- else
- {
- /* (err == -1) && (errno == ENOENT) */
- /* File does not exist */
- path = ADIOI_Strdup(fd->filename);
- slash = strrchr(path, '/');
- if (!slash)
- ADIOI_Strncpy(path, ".", 2);
- else {
- if (slash == path)
- *(path + 1) = '\0';
- else *slash = '\0';
- }
-
- /* create PanFS object */
- memset(&file_create_args,0,sizeof(pan_fs_client_layout_create_args_t));
- /* open directory */
- fd_dir = open(path, O_RDONLY);
- if (fd_dir < 0) {
- FPRINTF(stderr, "%s: I/O Error opening parent directory to create PanFS file using ioctl: %s.\n", myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- else
- {
- char *file_name_ptr = fd->filename;
- slash = strrchr(fd->filename, '/');
- if (slash)
- {
- file_name_ptr = slash + 1;
- }
- /* create file in the directory */
- file_create_args.mode = perm;
- file_create_args.version = PAN_FS_CLIENT_LAYOUT_VERSION;
- file_create_args.flags = PAN_FS_CLIENT_LAYOUT_CREATE_F__NONE;
- ADIOI_Strncpy(file_create_args.filename, file_name_ptr, strlen(fd->filename)+1);
- file_create_args.layout.agg_type = layout_type;
- file_create_args.layout.layout_is_valid = 1;
- if(layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE)
- {
- file_create_args.layout.u.raid1_5_parity_stripe.total_num_comps = layout_total_num_comps;
- file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_width = layout_parity_stripe_width;
- file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_depth = layout_parity_stripe_depth;
- file_create_args.layout.u.raid1_5_parity_stripe.stripe_unit = layout_stripe_unit;
- file_create_args.layout.u.raid1_5_parity_stripe.layout_visit_policy = layout_visit_policy;
- }
- else if(layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID0)
- {
- file_create_args.layout.u.raid0.total_num_comps = layout_total_num_comps;
- file_create_args.layout.u.raid0.stripe_unit = layout_stripe_unit;
- }
- else if(layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10)
- {
- file_create_args.layout.u.raid10.total_num_comps = layout_total_num_comps;
- file_create_args.layout.u.raid10.stripe_unit = layout_stripe_unit;
- file_create_args.layout.u.raid10.layout_visit_policy = layout_visit_policy;
- }
- err = ioctl(fd_dir, PAN_FS_CLIENT_LAYOUT_CREATE_FILE, &file_create_args);
- if (err < 0) {
- FPRINTF(stderr, "%s: I/O Error doing ioctl on parent directory to create PanFS file using ioctl: %s.\n", myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- err = close(fd_dir);
- }
- ADIOI_Free(path);
- }
- }
- else
- {
- int create_fd = open(fd->filename,amode,perm);
- if(create_fd != -1)
- {
- close(create_fd);
- }
- else
- {
- FPRINTF(stderr, "%s: I/O Error creating PanFS file using open: %s.\n", myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
- }
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- ADIOI_Info_get(fd->info, "panfs_concurrent_write", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- unsigned long int concurrent_write = strtoul(value,NULL,10);
- if(concurrent_write == 1)
- {
- amode = amode | O_CONCURRENT_WRITE;
- }
- }
- ADIOI_Free(value);
-
- fd->fd_sys = open(fd->filename, amode, perm);
- fd->fd_direct = -1;
-
- if (fd->fd_sys != -1)
- {
- int rc;
- char temp_buffer[TEMP_BUFFER_SIZE];
- pan_fs_client_layout_query_args_t file_query_args;
- memset(&file_query_args,0,sizeof(pan_fs_client_layout_query_args_t));
- file_query_args.version = PAN_FS_CLIENT_LAYOUT_VERSION;
- rc = ioctl(fd->fd_sys, PAN_FS_CLIENT_LAYOUT_QUERY_FILE, &file_query_args);
- if (rc < 0)
- {
- /* Error - set layout type to unknown */
- ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
- }
- else
- {
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.agg_type);
- ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer);
- if (file_query_args.layout.layout_is_valid == 1)
- {
- switch (file_query_args.layout.agg_type)
- {
- case PAN_FS_CLIENT_LAYOUT_TYPE__RAID0:
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid0.stripe_unit);
- ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid0.total_num_comps);
- ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
- break;
- case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE:
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
- ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid1_5_parity_stripe.parity_stripe_width);
- ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid1_5_parity_stripe.parity_stripe_depth);
- ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid1_5_parity_stripe.total_num_comps);
- ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid1_5_parity_stripe.layout_visit_policy);
- ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
- break;
- case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10:
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid10.stripe_unit);
- ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid10.total_num_comps);
- ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
- ADIOI_Snprintf(temp_buffer,TEMP_BUFFER_SIZE,"%u",file_query_args.layout.u.raid10.layout_visit_policy);
- ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
- break;
- case PAN_FS_CLIENT_LAYOUT_TYPE__INVALID:
- case PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT:
- MPI_Info_set(fd->info, "panfs_layout_type",
- "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
- default:
- break;
- }
- }
- }
- }
-
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND))
- fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
-
- if (fd->fd_sys == -1) {
- *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs_open6.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs_open6.c
deleted file mode 100644
index 6906ff08d7e..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs_open6.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * ad_panfs_open.c
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-#include
-#include
-#define TEMP_BUFFER_SIZE 64
-
-void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
-{
- char *value;
- int perm, old_mask, amode, flag;
- static char myname[] = "ADIOI_PANFS_OPEN6";
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = ~old_mask & 0666;
- }
- else
- perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE) {
- pan_fs_client_layout_agg_type_t layout_type = PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT;
- unsigned long int layout_stripe_unit = 0;
- unsigned long int layout_parity_stripe_width = 0;
- unsigned long int layout_parity_stripe_depth = 0;
- unsigned long int layout_total_num_comps = 0;
- unsigned long int layout_max_faults = 2;
- pan_fs_client_layout_visit_t layout_visit_policy = PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN;
- pan_fs_client_raidn_encoding_t layout_encoding = PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS;
- int myrank;
-
- MPI_Comm_rank(fd->comm, &myrank);
-
- *error_code = MPI_SUCCESS;
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
- ADIOI_Info_get(fd->info, "panfs_layout_type", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- layout_type = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_stripe_unit", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- layout_stripe_unit = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_total_num_comps", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- layout_total_num_comps = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_width", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_parity_stripe_width = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_parity_stripe_depth", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- layout_parity_stripe_depth = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_max_faults", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- layout_max_faults = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_visit_policy", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- layout_visit_policy = strtoul(value, NULL, 10);
- }
- ADIOI_Info_get(fd->info, "panfs_layout_encoding", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- layout_encoding = strtoul(value, NULL, 10);
- }
- ADIOI_Free(value);
-
- amode = amode | O_CREAT;
- /* Check for valid set of hints
- *
- * Note that RAID0 has been dropped. In the event PAN_FS_CLIENT_LAYOUT_TYPE__RAID0
- * enumeraion no longer exists, the following check will still be correct.
- *
- * The enumerations looks as follows:
- *
- * enum pan_fs_client_layout_agg_type_e {
- * PAN_FS_CLIENT_LAYOUT_TYPE__INVALID = 0, - *INVALID
- * PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT = 1, - VALID
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAID0 = 2, - *INVALID
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE = 3, - VALID
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAID10 = 4, - VALID
- * PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE = 5 - VALID
- * };
- */
- if (((layout_type < PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) &&
- (layout_type != PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT)) ||
- (layout_type > PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE)) {
- FPRINTF(stderr, "%s: panfs_layout_type is not a valid value: %u.\n", myname,
- layout_type);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE) {
- if ((layout_stripe_unit == 0) ||
- (layout_parity_stripe_width == 0) ||
- (layout_parity_stripe_depth == 0) || (layout_total_num_comps == 0)) {
- if (layout_stripe_unit == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_total_num_comps == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_parity_stripe_width == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_parity_stripe_depth == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAIDN parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- /* as of 6.0.x release, we only support max_faults == 2 */
- if (layout_max_faults != 2) {
- FPRINTF(stderr,
- "%s: panfs_layout_max_faults is not a valid value. Setting default of 2\n",
- myname);
- layout_max_faults = 2;
- }
- /* as of 6.0.x release, we only support RS enconding */
- if (layout_encoding != PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS) {
- FPRINTF(stderr,
- "%s: panfs_layout_encoding is not a valid value: %u. Setting to default of %u\n",
- myname, layout_encoding, PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS);
- layout_encoding = PAN_FS_CLIENT_LAYOUT_RAIDN_ENCODING_RS;
- }
- }
- if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
- if ((layout_stripe_unit == 0) ||
- (layout_parity_stripe_width == 0) ||
- (layout_parity_stripe_depth == 0) || (layout_total_num_comps == 0)) {
- if (layout_stripe_unit == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_total_num_comps == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_parity_stripe_width == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_parity_stripe_width hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_parity_stripe_depth == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_parity_stripe_depth hint which is necessary to specify a valid RAID5 parity stripe layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) ||
- (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET))
- {
- FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname,
- layout_visit_policy);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
- if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) {
- if ((layout_stripe_unit == 0) || (layout_total_num_comps == 0)) {
- if (layout_stripe_unit == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_stripe_unit hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- if (layout_total_num_comps == 0) {
- FPRINTF(stderr,
- "%s: MPI_Info does not contain the panfs_layout_total_num_comps hint which is necessary to specify a valid RAID10 layout to the PAN_FS_CLIENT_LAYOUT_CREATE_FILE ioctl.\n",
- myname);
- }
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- if ((layout_visit_policy < PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN) ||
- (layout_visit_policy > PAN_FS_CLIENT_LAYOUT_VISIT__ROUND_ROBIN_WITH_HASHED_OFFSET))
- {
- FPRINTF(stderr, "%s: panfs_layout_visit_policy is not a valid value: %u.\n", myname,
- layout_visit_policy);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
- /* Create the file via ioctl() or open(). ADIOI_PANFS_Open's caller
- * already optimizes performance by only calling this function with
- * ADIO_CREATE on rank 0. Therefore, we don't need to worry about
- * implementing that optimization here. */
- if ((layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) ||
- (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) ||
- (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE)) {
- pan_fs_client_layout_create_args_t file_create_args;
- int fd_dir;
- char *slash;
- struct stat stat_buf;
- int err;
- char *path;
-
- /* Check that the file does not exist before
- * trying to create it. The ioctl itself should
- * be able to handle this condition. Currently,
- * the ioctl will return successfully if the file
- * has been previously created. Filed bug 33862
- * to track the problem.
- */
- err = stat(fd->filename, &stat_buf);
- if ((err == -1) && (errno != ENOENT)) {
- FPRINTF(stderr, "%s: Unexpected I/O Error calling stat() on PanFS file: %s.\n",
- myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- else if (err == 0) {
- /* ensure that we have the same semantics here and in the call to creat(). In the latter, we do not
- * use O_EXCL so a create on an existing file should not fail.
- */
- FPRINTF(stderr,
- "%s: Cannot create PanFS file with ioctl when file already exists, using open() syscall.\n",
- myname);
- goto use_open_syscall;
- }
- else {
- /* (err == -1) && (errno == ENOENT) */
- /* File does not exist */
- path = ADIOI_Strdup(fd->filename);
- slash = strrchr(path, '/');
- if (!slash)
- ADIOI_Strncpy(path, ".", 2);
- else {
- if (slash == path)
- *(path + 1) = '\0';
- else
- *slash = '\0';
- }
-
- /* create PanFS object */
- memset(&file_create_args, 0, sizeof(pan_fs_client_layout_create_args_t));
- /* open directory */
- fd_dir = open(path, O_RDONLY);
- if (fd_dir < 0) {
- FPRINTF(stderr,
- "%s: I/O Error opening parent directory to create PanFS file using ioctl: %s.\n",
- myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- else {
- char *file_name_ptr = fd->filename;
- slash = strrchr(fd->filename, '/');
- if (slash) {
- file_name_ptr = slash + 1;
- }
- /* create file in the directory */
- file_create_args.mode = perm;
- file_create_args.version = PAN_FS_CLIENT_LAYOUT_VERSION;
- file_create_args.flags = PAN_FS_CLIENT_LAYOUT_CREATE_F__NONE;
- ADIOI_Strncpy(file_create_args.filename, file_name_ptr,
- strlen(fd->filename) + 1);
- file_create_args.layout.agg_type = layout_type;
- file_create_args.layout.layout_is_valid = 1;
- if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE) {
- file_create_args.layout.u.raidn_parity_stripe.total_num_comps =
- layout_total_num_comps;
- file_create_args.layout.u.raidn_parity_stripe.parity_stripe_width =
- layout_parity_stripe_width;
- file_create_args.layout.u.raidn_parity_stripe.parity_stripe_depth =
- layout_parity_stripe_depth;
- file_create_args.layout.u.raidn_parity_stripe.stripe_unit =
- layout_stripe_unit;
- file_create_args.layout.u.raidn_parity_stripe.max_faults =
- layout_max_faults;
- file_create_args.layout.u.raidn_parity_stripe.encoding = layout_encoding;
- }
- else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE) {
- file_create_args.layout.u.raid1_5_parity_stripe.total_num_comps =
- layout_total_num_comps;
- file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_width =
- layout_parity_stripe_width;
- file_create_args.layout.u.raid1_5_parity_stripe.parity_stripe_depth =
- layout_parity_stripe_depth;
- file_create_args.layout.u.raid1_5_parity_stripe.stripe_unit =
- layout_stripe_unit;
- file_create_args.layout.u.raid1_5_parity_stripe.layout_visit_policy =
- layout_visit_policy;
- }
- else if (layout_type == PAN_FS_CLIENT_LAYOUT_TYPE__RAID10) {
- file_create_args.layout.u.raid10.total_num_comps = layout_total_num_comps;
- file_create_args.layout.u.raid10.stripe_unit = layout_stripe_unit;
- file_create_args.layout.u.raid10.layout_visit_policy = layout_visit_policy;
- }
- err = ioctl(fd_dir, PAN_FS_CLIENT_LAYOUT_CREATE_FILE, &file_create_args);
- if (err < 0) {
- FPRINTF(stderr,
- "%s: I/O Error doing ioctl on parent directory to create PanFS file using ioctl: %s.\n",
- myname, strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- err = close(fd_dir);
- }
- ADIOI_Free(path);
- }
- }
- else {
- use_open_syscall:;
- int create_fd = open(fd->filename, amode, perm);
- if (create_fd != -1) {
- close(create_fd);
- }
- else {
- FPRINTF(stderr, "%s: I/O Error creating PanFS file using open: %s.\n", myname,
- strerror(errno));
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
- }
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
- ADIOI_Info_get(fd->info, "panfs_concurrent_write", MPI_MAX_INFO_VAL, value, &flag);
- if (flag) {
- unsigned long int concurrent_write = strtoul(value, NULL, 10);
- if (concurrent_write == 1) {
- amode = amode | O_CONCURRENT_WRITE;
- }
- }
- ADIOI_Free(value);
-
- fd->fd_sys = open(fd->filename, amode, perm);
- fd->fd_direct = -1;
-
- if (fd->fd_sys != -1) {
- int rc;
- char temp_buffer[TEMP_BUFFER_SIZE];
- pan_fs_client_layout_query_args_t file_query_args;
- memset(&file_query_args, 0, sizeof(pan_fs_client_layout_query_args_t));
- file_query_args.version = PAN_FS_CLIENT_LAYOUT_VERSION;
- rc = ioctl(fd->fd_sys, PAN_FS_CLIENT_LAYOUT_QUERY_FILE, &file_query_args);
- if (rc < 0) {
- /* Error - set layout type to unknown */
- ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
- }
- else {
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type);
- ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer);
- if (file_query_args.layout.layout_is_valid == 1) {
- switch (file_query_args.layout.agg_type) {
- case PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE:
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raidn_parity_stripe.stripe_unit);
- ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raidn_parity_stripe.
- parity_stripe_width);
- ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raidn_parity_stripe.
- parity_stripe_depth);
- ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raidn_parity_stripe.total_num_comps);
- ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raidn_parity_stripe.max_faults);
- ADIOI_Info_set(fd->info, "panfs_layout_max_faults", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raidn_parity_stripe.encoding);
- ADIOI_Info_set(fd->info, "panfs_layout_encoding", temp_buffer);
- break;
- case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE:
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
- ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid1_5_parity_stripe.
- parity_stripe_width);
- ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid1_5_parity_stripe.
- parity_stripe_depth);
- ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid1_5_parity_stripe.total_num_comps);
- ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid1_5_parity_stripe.
- layout_visit_policy);
- ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
- break;
- case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10:
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid10.stripe_unit);
- ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid10.total_num_comps);
- ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
- ADIOI_Snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
- file_query_args.layout.u.raid10.layout_visit_policy);
- ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
- break;
- case PAN_FS_CLIENT_LAYOUT_TYPE__INVALID:
- case PAN_FS_CLIENT_LAYOUT_TYPE__DEFAULT:
- MPI_Info_set(fd->info, "panfs_layout_type",
- "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
- default:
- break;
- }
- }
- }
- }
-
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND))
- fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
-
- if (fd->fd_sys == -1) {
- *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
- }
- else
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs_read.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs_read.c
deleted file mode 100644
index 237e4929de3..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs_read.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code)
-{
- MPI_Count err = -1, datatype_size, len;
- static char myname[] = "ADIOI_PANFS_READCONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind;
- }
-
- if (fd->fp_sys_posn != offset) {
- err = lseek(fd->fd_sys, offset, SEEK_SET);
- /* --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-- */
- }
-
- AD_PANFS_RETRY(read(fd->fd_sys, buf, len),err)
- /* --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-- */
-
- fd->fp_sys_posn = offset + err;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- fd->fp_ind += err;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs_resize.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs_resize.c
deleted file mode 100644
index 5c41126c4de..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs_resize.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2004 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-void ADIOI_PANFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
-{
- int err;
- int myrank;
- struct stat stat_buf;
- static char myname[] = "ADIOI_PANFS_RESIZE";
-
- MPI_Comm_rank(fd->comm, &myrank);
- if (!myrank)
- {
- AD_PANFS_RETRY(ftruncate(fd->fd_sys,size),err);
- MPI_Barrier(fd->comm);
- }
- else
- {
- MPI_Barrier(fd->comm);
- AD_PANFS_RETRY(fstat(fd->fd_sys,&stat_buf),err);
- if(((ADIO_Offset)stat_buf.st_size) != size)
- {
- /* This should never happen otherwise there is a coherency problem. */
- FPRINTF(stderr, "%s: Rank %d: Resize failed: requested=%llu actual=%llu.\n",myname,myrank,size,(unsigned long long)stat_buf.st_size);
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
-
- /* --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-- */
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_panfs/ad_panfs_write.c b/3rd-party/romio321/adio/ad_panfs/ad_panfs_write.c
deleted file mode 100644
index 920d2f473e7..00000000000
--- a/3rd-party/romio321/adio/ad_panfs/ad_panfs_write.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2004 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_panfs.h"
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-void ADIOI_PANFS_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)
-{
- MPI_Count err = -1, datatype_size, len;
- static char myname[] = "ADIOI_PANFS_WRITECONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind;
- }
-
- if (fd->fp_sys_posn != offset) {
- err = lseek(fd->fd_sys, offset, SEEK_SET);
- /* --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-- */
- }
-
- AD_PANFS_RETRY(write(fd->fd_sys, buf, len),err)
- /* --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-- */
-
- fd->fp_sys_posn = offset + err;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- fd->fp_ind += err;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1 && status) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/Makefile.mk b/3rd-party/romio321/adio/ad_pfs/Makefile.mk
deleted file mode 100644
index 3521c07c863..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/Makefile.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_PFS
-
-noinst_HEADERS += adio/ad_pfs/ad_pfs.h
-
-romio_other_sources += \
- adio/ad_pfs/ad_pfs_read.c \
- adio/ad_pfs/ad_pfs_open.c \
- adio/ad_pfs/ad_pfs_write.c \
- adio/ad_pfs/ad_pfs_done.c \
- adio/ad_pfs/ad_pfs_fcntl.c \
- adio/ad_pfs/ad_pfs_iread.c \
- adio/ad_pfs/ad_pfs_iwrite.c \
- adio/ad_pfs/ad_pfs_wait.c \
- adio/ad_pfs/ad_pfs_flush.c \
- adio/ad_pfs/ad_pfs_hints.c \
- adio/ad_pfs/ad_pfs.c
-
-endif BUILD_AD_PFS
-
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs.c
deleted file mode 100644
index cc480b01114..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_PFS_operations = {
- ADIOI_PFS_Open, /* Open */
- ADIOI_PFS_ReadContig, /* ReadContig */
- ADIOI_PFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_PFS_Fcntl, /* Fcntl */
- ADIOI_PFS_SetInfo, /* SetInfo */
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_GEN_WriteStrided, /* WriteStrided */
- ADIOI_GEN_Close, /* Close */
- ADIOI_PFS_IreadContig, /* IreadContig */
- ADIOI_PFS_IwriteContig, /* IwriteContig */
- ADIOI_PFS_ReadDone, /* ReadDone */
- ADIOI_PFS_WriteDone, /* WriteDone */
- ADIOI_PFS_ReadComplete, /* ReadComplete */
- ADIOI_PFS_WriteComplete, /* WriteComplete */
- ADIOI_FAKE_IreadStrided, /* IreadStrided */
- ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
- ADIOI_PFS_Flush, /* Flush */
- ADIOI_GEN_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs.h b/3rd-party/romio321/adio/ad_pfs/ad_pfs.h
deleted file mode 100644
index fbe055ccf75..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-/* contains definitions, declarations, and macros specific to the
- implementation of ADIO on PFS */
-
-#ifndef AD_PFS_INCLUDE
-#define AD_PFS_INCLUDE
-
-#include
-#include
-#include
-#include
-#include
-#include "adio.h"
-
-#ifdef tflops
-#define lseek eseek
-#define _gopen(n,m,i,p) open(n,m,p)
-#endif
-
-/* PFS file-pointer modes (removed most of them because they are unused) */
-#ifndef M_ASYNC
-#define M_UNIX 0
-#define M_ASYNC 5
-#endif
-
-void ADIOI_PFS_Open(ADIO_File fd, int *error_code);
-void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *error_code);
-void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int
- *error_code);
-int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int
- *error_code);
-int ADIOI_PFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int
- *error_code);
-void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int
- *error_code);
-void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code);
-void ADIOI_PFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
- *error_code);
-void ADIOI_PFS_Flush(ADIO_File fd, int *error_code);
-void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_done.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_done.c
deleted file mode 100644
index 60e2d7da298..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_done.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- int done=0;
- static char myname[] = "ADIOI_PFS_READDONE";
-
- if (*request == ADIO_REQUEST_NULL) {
- *error_code = MPI_SUCCESS;
- return 1;
- }
-
- if ((*request)->queued)
- done = _iodone(*((long *) (*request)->handle));
- else done = 1; /* ADIOI_Complete_Async completed this request,
- but request object was not freed. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- if ((done >= 0) && ((*request)->nbytes != -1))
- MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
-#endif
-
- if (done >= 0) {
- /* if request is still queued in the system, it is also there
- on ADIOI_Async_list. Delete it from there. */
- if ((*request)->queued) ADIOI_Del_req_from_list(request);
-
- (*request)->fd->async_count--;
- if ((*request)->handle) ADIOI_Free((*request)->handle);
- ADIOI_Free_request((ADIOI_Req_node *) (*request));
- *request = ADIO_REQUEST_NULL;
- }
-
- if (done == -1 && errno != 0) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", strerror(errno));
- }
- else *error_code = MPI_SUCCESS;
- return done;
-}
-
-
-int ADIOI_PFS_WriteDone(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- return ADIOI_PFS_ReadDone(request, status, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_fcntl.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_fcntl.c
deleted file mode 100644
index 4a2c0fd3827..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_fcntl.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-#include "adio_extern.h"
-
-void ADIOI_PFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct,
- int *error_code)
-{
- int i, err;
- int iomod, np_total, np_comm;
- static char myname[] = "ADIOI_PFS_FCNTL";
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
- if (!(fd->atomicity)) {
- /* in M_ASYNC mode, all processes are not aware of changes
- in file size (although the manual says otherwise). Therefore,
- temporarily change to M_UNIX and then change
- back to M_ASYNC.*/
- MPI_Comm_size(MPI_COMM_WORLD, &np_total);
- MPI_Comm_size(fd->comm, &np_comm);
- if (np_total == np_comm) {
- err = _setiomode(fd->fd_sys, M_UNIX);
- err = _setiomode(fd->fd_sys, M_ASYNC);
- }
- /* else it is M_UNIX anyway, so no problem */
- }
- fcntl_struct->fsize = lseek(fd->fd_sys, 0, SEEK_END);
- if (fd->fp_sys_posn != -1)
- lseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET);
- *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- err = _lsize(fd->fd_sys, fcntl_struct->diskspace, SEEK_SET);
- if (err == -1) {
- *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;
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- MPI_Comm_size(MPI_COMM_WORLD, &np_total);
- MPI_Comm_size(fd->comm, &np_comm);
- if (np_total == np_comm) {
- iomod = (fcntl_struct->atomicity == 0) ? M_ASYNC : M_UNIX;
- err = _setiomode(fd->fd_sys, iomod);
- }
- /* else can't do anything because setiomode is global. but
- the file will have been opened with M_UNIX anyway, because
- gopen is also global. */
-
- fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
- if (err == -1) {
- /* --BEGIN ERROR HANDLING-- */
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
- /* --END ERROR HANDLING-- */
- }
- else *error_code = MPI_SUCCESS;
- break;
-
- default:
- /* --BEGIN ERROR HANDLING-- */
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPI_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_ARG,
- "**flag", "**flag %d", flag);
- return;
- /* --END ERROR HANDLING-- */
- }
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_flush.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_flush.c
deleted file mode 100644
index 98dedc099c3..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_flush.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_Flush(ADIO_File fd, int *error_code)
-{
- int err, np_total, np_comm;
- static char myname[] = "ADIOI_PFS_FLUSH";
-
-/* fsync is not actually needed in PFS, because it uses something
- called fast-path I/O. However, it doesn't do any harm either. */
- err = fsync(fd->fd_sys);
- if (err == -1) {
- *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;
-
-/* MPI-IO requires that after an fsync all processes must see the same
- file size. In PFS M_ASYNC mode, this doesn't automatically happen.
- Therefore, if M_ASYNC mode, temporarily change it to M_UNIX mode
- and then switch back to M_ASYNC. That updates the file size! */
-
- MPI_Comm_size(MPI_COMM_WORLD, &np_total);
- MPI_Comm_size(fd->comm, &np_comm);
- if ((np_total == np_comm) && (!(fd->atomicity))) {
- err = _setiomode(fd->fd_sys, M_UNIX);
- err = _setiomode(fd->fd_sys, M_ASYNC);
- }
- /* else it is M_UNIX anyway. don't do anything. */
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_hints.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_hints.c
deleted file mode 100644
index 407a0eb7758..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_hints.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
-{
- char *value, *value_in_fd;
- int flag, tmp_val, str_factor=-1, str_unit=-1, start_iodev=-1;
- struct sattr attr;
- int err, myrank, fd_sys, perm, amode, old_mask;
-
- if ( (fd->info) == MPI_INFO_NULL) {
- /* This must be part of the open call. can set striping parameters
- if necessary. */
- MPI_Info_create(&(fd->info));
-
- /* has user specified striping or server buffering parameters
- and do they have the same value on all processes? */
- if (users_info != MPI_INFO_NULL) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- str_factor=atoi(value);
- tmp_val = str_factor;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- /* --BEGIN ERROR HANDLING-- */
- if (tmp_val != str_factor) {
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "striping_factor",
- error_code);
- return;
- }
- /* --END ERROR HANDLING-- */
- }
-
- ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- str_unit=atoi(value);
- tmp_val = str_unit;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- /* --BEGIN ERROR HANDLING-- */
- if (tmp_val != str_unit) {
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "striping_unit",
- error_code);
- return;
- }
- /* --END ERROR HANDLING-- */
- }
-
- ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- start_iodev=atoi(value);
- tmp_val = start_iodev;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- /* --BEGIN ERROR HANDLING-- */
- if (tmp_val != start_iodev) {
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "start_iodevice",
- error_code);
- return;
- }
- /* --END ERROR HANDLING-- */
- }
-
- /* if user has specified striping info, process 0 tries to set it */
- if ((str_factor > 0) || (str_unit > 0) || (start_iodev >= 0)) {
- MPI_Comm_rank(fd->comm, &myrank);
- if (!myrank) {
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- fd_sys = open(fd->filename, amode, perm);
- err = fcntl(fd_sys, F_GETSATTR, &attr);
-
- if (!err) {
- if (str_unit > 0) attr.s_sunitsize = str_unit;
- if ((start_iodev >= 0) &&
- (start_iodev < attr.s_sfactor))
- attr.s_start_sdir = start_iodev;
- if ((str_factor > 0) && (str_factor < attr.s_sfactor))
- attr.s_sfactor = str_factor;
-
- err = fcntl(fd_sys, F_SETSATTR, &attr);
- }
-
- close(fd_sys);
- }
-
- MPI_Barrier(fd->comm);
- }
-
- /* Has user asked for pfs server buffering to be turned on?
- If so, mark it as true in fd->info and turn it on in
- ADIOI_PFS_Open after the file is opened */
-
- ADIOI_Info_get(users_info, "pfs_svr_buf", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (!strcmp(value, "true")))
- ADIOI_Info_set(fd->info, "pfs_svr_buf", "true");
- else ADIOI_Info_set(fd->info, "pfs_svr_buf", "false");
-
- ADIOI_Free(value);
- }
- else ADIOI_Info_set(fd->info, "pfs_svr_buf", "false");
-
- /* set the values for collective I/O and data sieving parameters */
- ADIOI_GEN_SetInfo(fd, users_info, error_code);
- }
-
- else {
- /* The file has been opened previously and fd->fd_sys is a valid
- file descriptor. cannot set striping parameters now. */
-
- /* set the values for collective I/O and data sieving parameters */
- ADIOI_GEN_SetInfo(fd, users_info, error_code);
-
- /* has user specified value for pfs_svr_buf? */
- if (users_info != MPI_INFO_NULL) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- ADIOI_Info_get(users_info, "pfs_svr_buf", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (!strcmp(value, "true") || !strcmp(value, "false"))) {
- value_in_fd = (char *)
- ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
- ADIOI_Info_get(fd->info, "pfs_svr_buf", MPI_MAX_INFO_VAL,
- value_in_fd, &flag);
- if (strcmp(value, value_in_fd)) {
- if (!strcmp(value, "true")) {
- err = fcntl(fd->fd_sys, F_PFS_SVR_BUF, TRUE);
- if (!err)
- ADIOI_Info_set(fd->info, "pfs_svr_buf", "true");
- }
- else {
- err = fcntl(fd->fd_sys, F_PFS_SVR_BUF, FALSE);
- if (!err)
- ADIOI_Info_set(fd->info, "pfs_svr_buf", "false");
- }
- }
- ADIOI_Free(value_in_fd);
- }
- ADIOI_Free(value);
- }
-
- }
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_iread.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_iread.c
deleted file mode 100644
index 78b3c592fb7..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_iread.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_IreadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request,
- int *error_code)
-{
- long *id_sys;
- int err=-1;
- MPI_Count len, typesize;
- ADIO_Offset off;
- static char myname[] = "ADIOI_PFS_IREADCONTIG";
-
- *request = ADIOI_Malloc_request();
- (*request)->optype = ADIOI_READ;
- (*request)->fd = fd;
- (*request)->datatype = datatype;
-
- MPI_Type_size_x(datatype, &typesize);
- len = count * typesize;
-
- id_sys = (long *) ADIOI_Malloc(sizeof(long));
- (*request)->handle = (void *) id_sys;
-
- off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : offset;
-
- lseek(fd->fd_sys, off, SEEK_SET);
- *id_sys = _iread(fd->fd_sys, buf, len);
-
- if ((*id_sys == -1) && (errno == EQNOMID)) {
- /* the man pages say EMREQUEST, but in reality errno is set to EQNOMID! */
-
- /* exceeded the max. no. of outstanding requests. */
-
- /* complete all previous async. requests */
- /*ADIOI_Complete_async(error_code); */
- if (*error_code != MPI_SUCCESS) return;
-
- /* try again */
- *id_sys = _iread(fd->fd_sys, buf, len);
-
- if ((*id_sys == -1) && (errno == EQNOMID)) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
- return;
- }
- }
- else if (*id_sys == -1) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", strerror(errno));
- return;
- }
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
-
- (*request)->queued = 1;
- (*request)->nbytes = len;
- ADIOI_Add_req_to_list(request);
- fd->async_count++;
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
- if (*id_sys == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_iwrite.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_iwrite.c
deleted file mode 100644
index 5dda2fbdeb6..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_iwrite.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_IwriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Request *request, int *error_code)
-{
- long *id_sys;
- ADIO_Offset off;
- int err;
- MPI_Count len, typesize;
- static char myname[] = "ADIOI_PFS_IWRITECONTIG";
-
- *request = ADIOI_Malloc_request();
- (*request)->optype = ADIOI_WRITE;
- (*request)->fd = fd;
- (*request)->datatype = datatype;
-
- MPI_Type_size_x(datatype, &typesize);
- len = count * typesize;
-
- id_sys = (long *) ADIOI_Malloc(sizeof(long));
- (*request)->handle = (void *) id_sys;
-
- off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : offset;
-
- lseek(fd->fd_sys, off, SEEK_SET);
- *id_sys = _iwrite(fd->fd_sys, buf, len);
-
- if ((*id_sys == -1) && (errno == EQNOMID)) {
- /* the man pages say EMREQUEST, but in reality errno is set to EQNOMID! */
-
- /* exceeded the max. no. of outstanding requests. */
-
- /* complete all previous async. requests */
- ADIOI_Complete_async(error_code);
- if (error_code != MPI_SUCCESS) return;
-
- /* try again */
- *id_sys = _iwrite(fd->fd_sys, buf, len);
-
- if ((*id_sys == -1) && (errno == EQNOMID)) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE, myname,
- __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
- return;
- }
- }
- else if (*id_sys == -1) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__, MPI_ERR_IO,
- "**io",
- "**io %s", strerror(errno));
- return;
- }
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
-
- (*request)->queued = 1;
- (*request)->nbytes = len;
- ADIOI_Add_req_to_list(request);
- fd->async_count++;
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
- if (*id_sys == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_open.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_open.c
deleted file mode 100644
index f814b7c0a14..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_open.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_Open(ADIO_File fd, int *error_code)
-{
- int perm, amode, old_mask, np_comm, np_total, err, flag;
- char *value;
- struct sattr attr;
- static char myname[] = "ADIOI_PFS_OPEN";
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- MPI_Comm_size(MPI_COMM_WORLD, &np_total);
- MPI_Comm_size(fd->comm, &np_comm);
-
- if (np_total == np_comm)
- fd->fd_sys = _gopen(fd->filename, amode, M_ASYNC, perm);
- else fd->fd_sys = open(fd->filename, amode, perm);
- fd->fd_direct = -1;
-
- if (fd->fd_sys != -1) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- /* if user has asked for pfs server buffering to be turned on,
- it will be set to true in fd->info in the earlier call
- to ADIOI_PFS_SetInfo. Turn it on now, since we now have a
- valid file descriptor. */
-
- ADIOI_Info_get(fd->info, "pfs_svr_buf", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (!strcmp(value, "true"))) {
- err = fcntl(fd->fd_sys, F_PFS_SVR_BUF, TRUE);
- if (err) ADIOI_Info_set(fd->info, "pfs_svr_buf", "false");
- }
-
- /* get file striping information and set it in info */
- err = fcntl(fd->fd_sys, F_GETSATTR, &attr);
-
- if (!err) {
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", attr.s_sunitsize);
- ADIOI_Info_set(fd->info, "striping_unit", value);
-
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", attr.s_sfactor);
- ADIOI_Info_set(fd->info, "striping_factor", value);
-
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", attr.s_start_sdir);
- ADIOI_Info_set(fd->info, "start_iodevice", value);
- }
- ADIOI_Free(value);
-
- 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) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_read.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_read.c
deleted file mode 100644
index bd3b7e70e47..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_read.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int *error_code)
-{
- MPI_Count err=-1, datatype_size, len;
- static char myname[] = "ADIOI_PFS_READCONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- if (fd->fp_sys_posn != offset) {
- lseek(fd->fd_sys, offset, SEEK_SET);
- }
- err = _cread(fd->fd_sys, buf, len);
- fd->fp_sys_posn = offset + err;
- /* individual file pointer not updated */
- }
- else { /* read from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind) {
- lseek(fd->fd_sys, fd->fp_ind, SEEK_SET);
- }
- err = _cread(fd->fd_sys, buf, len);
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_wait.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_wait.c
deleted file mode 100644
index e14159521a5..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_wait.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status,
- int *error_code)
-{
- int err=0;
- static char myname[] = "ADIOI_PFS_READCOMPLETE";
-
- if (*request == ADIO_REQUEST_NULL) {
- *error_code = MPI_SUCCESS;
- return;
- }
-
- if ((*request)->queued) {
- err = _iowait(*((long *) (*request)->handle));
- if (err == -1) {
- *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;
- } /* if ((*request)->queued) ... */
- else *error_code = MPI_SUCCESS;
-#ifdef HAVE_STATUS_SET_BYTES
- if ((*request)->nbytes != -1)
- MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
-#endif
-
- if ((*request)->queued != -1) {
-
- /* queued = -1 is an internal hack used when the request must
- be completed, but the request object should not be
- freed. This is used in ADIOI_Complete_async, because the user
- will call MPI_Wait later, which would require status to
- be filled. Ugly but works. queued = -1 should be used only
- in ADIOI_Complete_async.
- This should not affect the user in any way. */
-
- /* if request is still queued in the system, it is also there
- on ADIOI_Async_list. Delete it from there. */
- if ((*request)->queued) ADIOI_Del_req_from_list(request);
-
- (*request)->fd->async_count--;
- if ((*request)->handle) ADIOI_Free((*request)->handle);
- ADIOI_Free_request((ADIOI_Req_node *) (*request));
- *request = ADIO_REQUEST_NULL;
- }
-}
-
-
-void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int *error_code)
-{
- ADIOI_PFS_ReadComplete(request, status, error_code);
-}
diff --git a/3rd-party/romio321/adio/ad_pfs/ad_pfs_write.c b/3rd-party/romio321/adio/ad_pfs/ad_pfs_write.c
deleted file mode 100644
index c64e976a2b4..00000000000
--- a/3rd-party/romio321/adio/ad_pfs/ad_pfs_write.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pfs.h"
-
-void ADIOI_PFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code)
-{
- MPI_Count err=-1, datatype_size, len;
- static char myname[] = "ADIOI_PFS_WRITECONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- if (fd->fp_sys_posn != offset) {
- lseek(fd->fd_sys, offset, SEEK_SET);
- }
- err = _cwrite(fd->fd_sys, buf, len);
- fd->fp_sys_posn = offset + err;
- /* individual file pointer not updated */
- }
- else { /* write from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind) {
- lseek(fd->fd_sys, fd->fp_ind, SEEK_SET);
- }
- err = _cwrite(fd->fd_sys, buf, len);
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_piofs/Makefile.mk b/3rd-party/romio321/adio/ad_piofs/Makefile.mk
deleted file mode 100644
index 4bcbd61f243..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/Makefile.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_PIOFS
-
-noinst_HEADERS += adio/ad_piofs/ad_piofs.h
-
-romio_other_sources += \
- adio/ad_piofs/ad_piofs_read.c \
- adio/ad_piofs/ad_piofs_open.c \
- adio/ad_piofs/ad_piofs_write.c \
- adio/ad_piofs/ad_piofs_fcntl.c \
- adio/ad_piofs/ad_piofs_hints.c \
- adio/ad_piofs/ad_piofs.c
-
-endif BUILD_AD_PIOFS
-
diff --git a/3rd-party/romio321/adio/ad_piofs/README b/3rd-party/romio321/adio/ad_piofs/README
deleted file mode 100644
index 933677b1770..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/README
+++ /dev/null
@@ -1 +0,0 @@
-This code is no longer supported.
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs.c
deleted file mode 100644
index 726bbf15f87..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_piofs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_PIOFS_operations = {
- ADIOI_PIOFS_Open, /* Open */
- ADIOI_PIOFS_ReadContig, /* ReadContig */
- ADIOI_PIOFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_PIOFS_Fcntl, /* Fcntl */
- ADIOI_PIOFS_SetInfo, /* SetInfo */
- ADIOI_GEN_ReadStrided, /* ReadStrided */
- ADIOI_PIOFS_WriteStrided, /* WriteStrided */
- ADIOI_GEN_Close, /* Close */
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
- ADIOI_FAKE_IODone, /* ReadDone */
- ADIOI_FAKE_IODone, /* WriteDone */
- ADIOI_FAKE_IOComplete, /* ReadComplete */
- ADIOI_FAKE_IOComplete, /* WriteComplete */
- ADIOI_FAKE_IreadStrided, /* IreadStrided */
- ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
- ADIOI_GEN_Flush, /* Flush */
- ADIOI_GEN_Resize, /* Resize */
- ADIOI_GEN_Delete, /* Delete */
- ADIOI_PIOFS_Feature,
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs.h b/3rd-party/romio321/adio/ad_piofs/ad_piofs.h
deleted file mode 100644
index e9b74c9e872..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-/* contains definitions, declarations, and macros specific to the
- implementation of ADIO on PIOFS */
-
-#ifndef AD_PIOFS_INCLUDE
-#define AD_PIOFS_INCLUDE
-
-#include
-#include
-#include
-#include
-#include
-#include "adio.h"
-
-void ADIOI_PIOFS_Open(ADIO_File fd, int *error_code);
-void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
- *error_code);
-void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-
-void ADIOI_PIOFS_Feature(ADIO_File fd, int flag);
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs_fcntl.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs_fcntl.c
deleted file mode 100644
index 7d4a37cbfd5..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs_fcntl.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_piofs.h"
-#include "adio_extern.h"
-
-void ADIOI_PIOFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code)
-{
- MPI_Datatype copy_etype, copy_filetype;
- int i, ntimes, err;
- ADIO_Offset curr_fsize, alloc_size, size, len, done;
- ADIO_Status status;
- char *buf;
- piofs_change_view_t *piofs_change_view;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_PIOFS_FCNTL";
-#endif
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
- fcntl_struct->fsize = llseek(fd->fd_sys, 0, SEEK_END);
- if (fd->fp_sys_posn != -1)
- llseek(fd->fd_sys, fd->fp_sys_posn, SEEK_SET);
- if (fcntl_struct->fsize == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- piofs_change_view = (piofs_change_view_t *)
- ADIOI_Malloc(sizeof(piofs_change_view_t));
- piofs_change_view->Vbs = piofs_change_view->Vn =
- piofs_change_view->Hbs = piofs_change_view->Hn = 1;
- piofs_change_view->subfile = 0;
- piofs_change_view->flags = (fcntl_struct->atomicity == 0)
- ? (ACTIVE | NORMAL) : (ACTIVE | CAUTIOUS);
- err = piofsioctl(fd->fd_sys, PIOFS_CHANGE_VIEW, piofs_change_view);
- ADIOI_Free(piofs_change_view);
- fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
- if (err == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
- break;
-
- default:
- FPRINTF(stderr, "Unknown flag passed to ADIOI_PIOFS_Fcntl\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
-}
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs_features.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs_features.c
deleted file mode 100644
index f3b0df6b21a..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs_features.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-int ADIOI_PIOFS_Features(int flag)
-{
- switch(flag) {
- case ADIO_LOCKS:
- case ADIO_SHARED_FP:
- case ADIO_ATOMIC_MODE:
- case ADIO_DATA_SIEVING_WRITES:
- case ADIO_SCALABLE_OPEN:
- default:
- return 0;
- break;
- }
-}
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs_hints.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs_hints.c
deleted file mode 100644
index 242ebb3f07d..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs_hints.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_piofs.h"
-
-void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
-{
- piofs_create_t piofs_create;
- piofs_statfs_t piofs_statfs;
- char *value, *path, *slash;
- int flag, tmp_val, str_factor=-1, str_unit=-1, start_iodev=-1;
- int err, myrank, perm, old_mask, nioservers;
-
- if ((fd->info) == MPI_INFO_NULL) {
- /* This must be part of the open call. can set striping parameters
- if necessary. */
- MPI_Info_create(&(fd->info));
-
- /* has user specified striping parameters
- and do they have the same value on all processes? */
- if (users_info != MPI_INFO_NULL) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- str_factor=atoi(value);
- tmp_val = str_factor;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != str_factor) {
- FPRINTF(stderr, "ADIOI_PIOFS_SetInfo: the value for key \"striping_factor\" must be the same on all processes\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
-
- ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- str_unit=atoi(value);
- tmp_val = str_unit;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != str_unit) {
- FPRINTF(stderr, "ADIOI_PIOFS_SetInfo: the value for key \"striping_unit\" must be the same on all processes\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
-
- ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- start_iodev=atoi(value);
- tmp_val = start_iodev;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != start_iodev) {
- FPRINTF(stderr, "ADIOI_PIOFS_SetInfo: the value for key \"start_iodevice\" must be the same on all processes\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
- }
-
- ADIOI_Free(value);
-
- /* if user has specified striping info, process 0 tries to set it */
- if ((str_factor > 0) || (str_unit > 0) || (start_iodev >= 0)) {
- MPI_Comm_rank(fd->comm, &myrank);
- if (!myrank) {
- int len;
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- /* to find out the number of I/O servers, I need
- the path to the directory containing the file */
-
- path = ADIOI_Strdup(fd->filename);
- len = strlen(path) + 1;
- slash = strrchr(path, '/');
- if (!slash) ADIOI_Strncpy(path, ".", len);
- else {
- if (slash == path) *(path + 1) = '\0';
- else *slash = '\0';
- }
- ADIOI_Strncpy(piofs_statfs.name, path, len);
- err = piofsioctl(0, PIOFS_STATFS, &piofs_statfs);
- nioservers = (err) ? -1 : piofs_statfs.f_nodes;
-
- ADIOI_Free(path);
-
- str_factor = ADIOI_MIN(nioservers, str_factor);
- if (start_iodev >= nioservers) start_iodev = -1;
-
- ADIOI_Strncpy(piofs_create.name, fd->filename, len);
- piofs_create.bsu = (str_unit > 0) ? str_unit : -1;
- piofs_create.cells = (str_factor > 0) ? str_factor : -1;
- piofs_create.permissions = perm;
- piofs_create.base_node = (start_iodev >= 0) ?
- start_iodev : -1;
- piofs_create.flags = 0;
-
- err = piofsioctl(0, PIOFS_CREATE, &piofs_create);
- }
- MPI_Barrier(fd->comm);
- }
- }
- }
-
- /* set the values for collective I/O and data sieving parameters */
- ADIOI_GEN_SetInfo(fd, users_info, error_code);
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs_open.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs_open.c
deleted file mode 100644
index e02e90cf325..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs_open.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_piofs.h"
-
-void ADIOI_PIOFS_Open(ADIO_File fd, int *error_code)
-{
- int amode, perm, old_mask, err;
- piofs_fstat_t piofs_fstat;
- char *value;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_PIOFS_OPEN";
-#endif
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- fd->fd_sys = open(fd->filename, amode, perm);
- fd->fd_direct = -1;
-
- llseek(fd->fd_sys, 0, SEEK_SET);
-/* required to initiate use of 64-bit offset */
-
- if (fd->fd_sys != -1) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- /* get file striping information and set it in info */
- err = piofsioctl(fd->fd_sys, PIOFS_FSTAT, &piofs_fstat);
-
- if (!err) {
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", piofs_fstat.st_bsu);
- ADIOI_Info_set(fd->info, "striping_unit", value);
-
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", piofs_fstat.st_cells);
- ADIOI_Info_set(fd->info, "striping_factor", value);
-
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", piofs_fstat.st_base_node);
- ADIOI_Info_set(fd->info, "start_iodevice", value);
- }
- ADIOI_Free(value);
-
- if (fd->access_mode & ADIO_APPEND)
- fd->fp_ind = fd->fp_sys_posn = llseek(fd->fd_sys, 0, SEEK_END);
- }
-
- if (fd->fd_sys == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs_read.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs_read.c
deleted file mode 100644
index 278548656e3..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs_read.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_piofs.h"
-
-void ADIOI_PIOFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int *error_code)
-{
- MPI_Count err=-1, datatype_size, len;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_PIOFS_READCONTIG";
-#endif
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- if (fd->fp_sys_posn != offset) {
- llseek(fd->fd_sys, offset, SEEK_SET);
- }
- err = read(fd->fd_sys, buf, len);
- fd->fp_sys_posn = offset + err;
- /* individual file pointer not updated */
- }
- else { /* read from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind) {
- llseek(fd->fd_sys, fd->fp_ind, SEEK_SET);
- }
- err = read(fd->fd_sys, buf, len);
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *error_code = MPI_ERR_UNKNOWN;
-#else
- *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
- myname, "I/O Error", "%s", strerror(errno));
- ADIOI_Error(fd, *error_code, myname);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_piofs/ad_piofs_write.c b/3rd-party/romio321/adio/ad_piofs/ad_piofs_write.c
deleted file mode 100644
index 31836a82406..00000000000
--- a/3rd-party/romio321/adio/ad_piofs/ad_piofs_write.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_piofs.h"
-#include "adio_extern.h"
-
-void ADIOI_PIOFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int *error_code)
-{
- MPI_Count err=-1, datatype_size, len;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_PIOFS_WRITECONTIG";
-#endif
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- if (fd->fp_sys_posn != offset) {
- llseek(fd->fd_sys, offset, SEEK_SET);
- }
- err = write(fd->fd_sys, buf, len);
- fd->fp_sys_posn = offset + err;
- /* individual file pointer not updated */
- }
- else { /* write from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind) {
- llseek(fd->fd_sys, fd->fp_ind, SEEK_SET);
- }
- err = write(fd->fd_sys, buf, len);
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *error_code = MPI_ERR_UNKNOWN;
-#else
- *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
- myname, "I/O Error", "%s", strerror(errno));
- ADIOI_Error(fd, *error_code, myname);
-#endif
- }
- else *error_code = MPI_SUCCESS;
-}
-
-
-
-void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* Since PIOFS does not support file locking, can't do buffered writes
- as on Unix */
-
-/* offset is in units of etype relative to the filetype. */
-
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- struct iovec *iov;
- int i, j, k, err=-1, bwr_size, fwr_size=0, st_index=0;
- int num, size, sum, n_etypes_in_filetype, size_in_filetype;
- MPI_Count bufsize;
- int n_filetypes, etype_in_filetype;
- ADIO_Offset abs_off_in_filetype=0;
- MPI_Count filetype_size, etype_size, buftype_size;
- MPI_Aint filetype_extent, buftype_extent, indx, filetype_lb, buftype_lb;
- int buf_count, buftype_is_contig, filetype_is_contig;
- ADIO_Offset off, disp;
- int flag, new_bwr_size, new_fwr_size, err_flag=0;
-#ifndef PRINT_ERR_MSG
- static char myname[] = "ADIOI_PIOFS_WRITESTRIDED";
-#endif
-
- if (fd->atomicity) {
- FPRINTF(stderr, "ROMIO cannot guarantee atomicity of noncontiguous accesses in atomic mode, as PIOFS doesn't support file locking. Use nonatomic mode and its associated semantics.\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- }
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if ( ! filetype_size ) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- bufsize = buftype_size * count;
-
- if (!buftype_is_contig && filetype_is_contig) {
-
-/* noncontiguous in memory, contiguous in file. use writev */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
-/* There is a limit of 16 on the number of iovecs for readv/writev! */
-
- iov = (struct iovec *) ADIOI_Malloc(16*sizeof(struct iovec));
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- off = fd->disp + etype_size * offset;
- llseek(fd->fd_sys, off, SEEK_SET);
- }
- else off = llseek(fd->fd_sys, fd->fp_ind, SEEK_SET);
-
- k = 0;
- for (j=0; jcount; i++) {
- iov[k].iov_base = ((char *) buf) + j*buftype_extent +
- flat_buf->indices[i];
- iov[k].iov_len = flat_buf->blocklens[i];
- /*FPRINTF(stderr, "%d %d\n", iov[k].iov_base, iov[k].iov_len);*/
-
- off += flat_buf->blocklens[i];
- k = (k+1)%16;
-
- if (!k) {
- err = writev(fd->fd_sys, iov, 16);
- if (err == -1) err_flag = 1;
- }
- }
-
- if (k) {
- err = writev(fd->fd_sys, iov, k);
- if (err == -1) err_flag = 1;
- }
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
-
- ADIOI_Free(iov);
- if (err_flag) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
- } /* if (!buftype_is_contig && filetype_is_contig) ... */
-
- else { /* noncontiguous in file */
-
-/* split up into several contiguous writes */
-
-/* find starting location in the file */
-
-/* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype) flat_file = flat_file->next;
- disp = fd->disp;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind; /* in bytes */
- n_filetypes = -1;
- flag = 0;
- while (!flag) {
- n_filetypes++;
- for (i=0; icount; i++) {
- if (disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i]
- >= offset) {
- st_index = i;
- fwr_size = disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent
- + flat_file->blocklens[i] - offset;
- flag = 1;
- break;
- }
- }
- }
- }
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = (int) (offset / n_etypes_in_filetype);
- etype_in_filetype = (int) (offset % n_etypes_in_filetype);
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i=0; icount; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- fwr_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype;
- }
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- i = 0;
- j = st_index;
- off = offset;
- fwr_size = ADIOI_MIN(fwr_size, bufsize);
- while (i < bufsize) {
- if (fwr_size) {
- /* TYPE_UB and TYPE_LB can result in
- fwr_size = 0. save system call in such cases */
- llseek(fd->fd_sys, off, SEEK_SET);
- err = write(fd->fd_sys, ((char *) buf) + i, fwr_size);
- if (err == -1) err_flag = 1;
- }
- i += fwr_size;
-
- if (off + fwr_size < disp + flat_file->indices[j] +
- flat_file->blocklens[j] + (ADIO_Offset) n_filetypes*filetype_extent)
- off += fwr_size;
- /* did not reach end of contiguous block in filetype.
- no more I/O needed. off is incremented by fwr_size. */
- else {
- if (j < (flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
- fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i);
- }
- }
- }
- else {
-/* noncontiguous in memory as well as in file */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- k = num = buf_count = 0;
- indx = flat_buf->indices[0];
- j = st_index;
- off = offset;
- bwr_size = flat_buf->blocklens[0];
-
- while (num < bufsize) {
- size = ADIOI_MIN(fwr_size, bwr_size);
- if (size) {
- llseek(fd->fd_sys, off, SEEK_SET);
- err = write(fd->fd_sys, ((char *) buf) + indx, size);
- if (err == -1) err_flag = 1;
- }
-
- new_fwr_size = fwr_size;
- new_bwr_size = bwr_size;
-
- if (size == fwr_size) {
-/* reached end of contiguous block in file */
- if (j < (flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
-
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
-
- new_fwr_size = flat_file->blocklens[j];
- if (size != bwr_size) {
- indx += size;
- new_bwr_size -= size;
- }
- }
-
- if (size == bwr_size) {
-/* reached end of contiguous block in memory */
-
- k = (k + 1)%flat_buf->count;
- buf_count++;
- indx = buftype_extent*(buf_count/flat_buf->count) +
- flat_buf->indices[k];
- new_bwr_size = flat_buf->blocklens[k];
- if (size != fwr_size) {
- off += size;
- new_fwr_size -= size;
- }
- }
- num += size;
- fwr_size = new_fwr_size;
- bwr_size = new_bwr_size;
- }
- }
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
- if (err_flag) {
-#ifdef MPICH
- *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
- "**io %s", strerror(errno));
-#elif defined(PRINT_ERR_MSG)
- *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);
-#endif
- }
- else *error_code = MPI_SUCCESS;
- }
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-/* This is a temporary way of filling in status. The right way is to
- keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */
-#endif
-
- if (!buftype_is_contig) ADIOI_Delete_flattened(datatype);
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/Makefile.mk b/3rd-party/romio321/adio/ad_pvfs/Makefile.mk
deleted file mode 100644
index 50e7bd0ae60..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/Makefile.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_AD_PVFS
-
-noinst_HEADERS += adio/ad_pvfs/ad_pvfs.h
-
-romio_other_sources += \
- adio/ad_pvfs/ad_pvfs_close.c \
- adio/ad_pvfs/ad_pvfs_read.c \
- adio/ad_pvfs/ad_pvfs_open.c \
- adio/ad_pvfs/ad_pvfs_write.c \
- adio/ad_pvfs/ad_pvfs_fcntl.c \
- adio/ad_pvfs/ad_pvfs_flush.c \
- adio/ad_pvfs/ad_pvfs_resize.c \
- adio/ad_pvfs/ad_pvfs_hints.c \
- adio/ad_pvfs/ad_pvfs_delete.c \
- adio/ad_pvfs/ad_pvfs.c
-
-endif BUILD_AD_PVFS
-
-
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs.c
deleted file mode 100644
index 27a3df8af4a..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 2001 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-
-/* adioi.h has the ADIOI_Fns_struct define */
-#include "adioi.h"
-
-struct ADIOI_Fns_struct ADIO_PVFS_operations = {
- ADIOI_PVFS_Open, /* Open */
- ADIOI_PVFS_ReadContig, /* ReadContig */
- ADIOI_PVFS_WriteContig, /* WriteContig */
- ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
- ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
- ADIOI_GEN_SeekIndividual, /* SeekIndividual */
- ADIOI_PVFS_Fcntl, /* Fcntl */
- ADIOI_PVFS_SetInfo, /* SetInfo */
- ADIOI_PVFS_ReadStrided, /* ReadStrided */
- ADIOI_PVFS_WriteStrided, /* WriteStrided */
- ADIOI_PVFS_Close, /* Close */
- ADIOI_FAKE_IreadContig, /* IreadContig */
- ADIOI_FAKE_IwriteContig, /* IwriteContig */
- ADIOI_FAKE_IODone, /* ReadDone */
- ADIOI_FAKE_IODone, /* WriteDone */
- ADIOI_FAKE_IOComplete, /* ReadComplete */
- ADIOI_FAKE_IOComplete, /* WriteComplete */
- ADIOI_FAKE_IreadStrided, /* IreadStrided */
- ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
- ADIOI_PVFS_Flush, /* Flush */
- ADIOI_PVFS_Resize, /* Resize */
- ADIOI_PVFS_Delete, /* Delete */
- ADIOI_PVFS_Feature, /* Features */
- ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
- ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
-};
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs.h b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs.h
deleted file mode 100644
index 88e1a9f2253..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#ifndef AD_PVFS_INCLUDE
-#define AD_PVFS_INCLUDE
-
-#ifndef ROMIOCONF_H_INCLUDED
-#include "romioconf.h"
-#define ROMIOCONF_H_INCLUDED
-#endif
-#ifdef ROMIO_PVFS_NEEDS_INT64_DEFINITION
-typedef long long int int64_t;
-#endif
-
-#include
-#include
-#include
-#include
-#ifdef HAVE_PVFS_H
-#include
-#endif
-#include "adio.h"
-
-void ADIOI_PVFS_Open(ADIO_File fd, int *error_code);
-void ADIOI_PVFS_Close(ADIO_File fd, int *error_code);
-void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PVFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
- *error_code);
-void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PVFS_ReadStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-void ADIOI_PVFS_Flush(ADIO_File fd, int *error_code);
-void ADIOI_PVFS_Delete(char *filename, int *error_code);
-void ADIOI_PVFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
-void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-
-
-#endif
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_close.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_close.c
deleted file mode 100644
index c2da2e360ef..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_close.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-
-void ADIOI_PVFS_Close(ADIO_File fd, int *error_code)
-{
- int err;
- static char myname[] = "ADIOI_PVFS_CLOSE";
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_close_a, 0, NULL );
-#endif
- err = pvfs_close(fd->fd_sys);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_close_b, 0, NULL );
-#endif
- fd->fd_sys = -1;
-
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_delete.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_delete.c
deleted file mode 100644
index 0e322ad32ae..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_delete.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-#include "adio.h"
-
-void ADIOI_PVFS_Delete(char *filename, int *error_code)
-{
- int err;
- static char myname[] = "ADIOI_PVFS_DELETE";
-
- err = pvfs_unlink(filename);
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_fcntl.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_fcntl.c
deleted file mode 100644
index eeff2507189..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_fcntl.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-#include "adio_extern.h"
-
-void ADIOI_PVFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct,
- int *error_code)
-{
- static char myname[] = "ADIOI_PVFS_FCNTL";
-
- switch(flag) {
- case ADIO_FCNTL_GET_FSIZE:
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- fcntl_struct->fsize = pvfs_lseek64(fd->fd_sys, 0, SEEK_END);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- if (fd->fp_sys_posn != -1) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, fd->fp_sys_posn, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
- if (fcntl_struct->fsize == -1) {
- *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;
- break;
-
- case ADIO_FCNTL_SET_DISKSPACE:
- ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
- break;
-
- case ADIO_FCNTL_SET_ATOMICITY:
- fd->atomicity = 0;
- /* --BEGIN ERROR HANDLING-- */
- if (fcntl_struct->atomicity != 0) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_UNSUPPORTED_OPERATION,
- "PVFS does not support atomic mode",
- 0);
- return;
- }
- /* --END ERROR HANDLING-- */
- break;
-
- default:
- /* --BEGIN ERROR HANDLING-- */
- *error_code = MPIO_Err_create_code(MPI_SUCCESS,
- MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_ARG,
- "**flag", "**flag %d", flag);
- return;
- /* --END ERROR HANDLING-- */
- }
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_flush.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_flush.c
deleted file mode 100644
index 340f0cb3395..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_flush.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-
-void ADIOI_PVFS_Flush(ADIO_File fd, int *error_code)
-{
- int err, rank, dummy=0, dummy_in=0;
- static char myname[] = "ADIOI_PVFS_FLUSH";
-
- /* a collective routine: because we do not cache data in PVFS1, one process
- * can initiate the fsync operation and broadcast the result to the others.
- * One catch: MPI_File_sync has special meaning with respect to file system
- * consistency. Ensure no clients have outstanding write operations.
- */
-
- MPI_Comm_rank(fd->comm, &rank);
- MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM,
- fd->hints->ranklist[0], fd->comm);
- if (rank == fd->hints->ranklist[0]) {
- err = pvfs_fsync(fd->fd_sys);
- }
- MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
-
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_hints.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_hints.c
deleted file mode 100644
index fdc06ed8465..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_hints.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-
-void ADIOI_PVFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
-{
- char *value;
- int flag, tmp_val, str_factor=-1, str_unit=-1, start_iodev=-1;
- static char myname[] = "ADIOI_PVFS_SETINFO";
-
- if ((fd->info) == MPI_INFO_NULL) {
- /* This must be part of the open call. can set striping parameters
- if necessary. */
- MPI_Info_create(&(fd->info));
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_read", "disable");
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", "disable");
- fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_DISABLE;
- fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_DISABLE;
-
- /* has user specified any pvfs-specific hints (striping params, listio)
- and do they have the same value on all processes? */
- if (users_info != MPI_INFO_NULL) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- str_factor=atoi(value);
- tmp_val = str_factor;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != str_factor) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "striping_factor",
- error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- else ADIOI_Info_set(fd->info, "striping_factor", value);
- }
-
- ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- str_unit=atoi(value);
- tmp_val = str_unit;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != str_unit) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "striping_unit",
- error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- else ADIOI_Info_set(fd->info, "striping_unit", value);
- }
-
- ADIOI_Info_get(users_info, "start_iodevice", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- start_iodev=atoi(value);
- tmp_val = start_iodev;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != start_iodev) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "start_iodevice",
- error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- else ADIOI_Info_set(fd->info, "start_iodevice", value);
- }
-
- ADIOI_Info_get(users_info, "romio_pvfs_listio_read",
- MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
- {
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_read", value);
- fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_ENABLE;
- } else if ( !strcmp(value, "disable") || !strcmp(value, "DISABLE"))
- {
- ADIOI_Info_set(fd->info , "romio_pvfs_listio_read", value);
- fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_DISABLE;
- }
- else if ( !strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC"))
- {
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_read", value);
- fd->hints->fs_hints.pvfs.listio_read = ADIOI_HINT_AUTO;
- }
- tmp_val = fd->hints->fs_hints.pvfs.listio_read;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != fd->hints->fs_hints.pvfs.listio_read) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "romio_pvfs_listio_read",
- error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- }
- ADIOI_Info_get(users_info, "romio_pvfs_listio_write", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag) {
- if ( !strcmp(value, "enable") || !strcmp(value, "ENABLE"))
- {
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", value);
- fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_ENABLE;
- } else if ( !strcmp(value, "disable") || !strcmp(value, "DISABLE"))
- {
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", value);
- fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_DISABLE;
- }
- else if ( !strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC"))
- {
- ADIOI_Info_set(fd->info, "romio_pvfs_listio_write", value);
- fd->hints->fs_hints.pvfs.listio_write = ADIOI_HINT_AUTO;
- }
- tmp_val = fd->hints->fs_hints.pvfs.listio_write;
- MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
- if (tmp_val != fd->hints->fs_hints.pvfs.listio_write) {
- /* --BEGIN ERROR HANDLING-- */
- MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
- "romio_pvfs_listio_write",
- error_code);
- return;
- /* --END ERROR HANDLING-- */
- }
- }
- ADIOI_Free(value);
- }
- }
-
- /* set the values for collective I/O and data sieving parameters */
- ADIOI_GEN_SetInfo(fd, users_info, error_code);
-
- *error_code = MPI_SUCCESS;
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_open.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_open.c
deleted file mode 100644
index c4fa28805da..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_open.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-
-void ADIOI_PVFS_Open(ADIO_File fd, int *error_code)
-{
- int perm, amode, old_mask, flag;
- char *value;
- /* some really old versions of pvfs may not have a release nr */
- /* we changed the structure of pvfs_filestat in pvfs-1.5.7 */
- struct pvfs_filestat pstat = {-1,-1,-1};
- static char myname[] = "ADIOI_PVFS_OPEN";
-
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = O_META;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- ADIOI_Info_get(fd->info, "striping_factor", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (atoi(value) > 0)) pstat.pcount = atoi(value);
-
- ADIOI_Info_get(fd->info, "striping_unit", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (atoi(value) > 0)) pstat.ssize = atoi(value);
-
- ADIOI_Info_get(fd->info, "start_iodevice", MPI_MAX_INFO_VAL,
- value, &flag);
- if (flag && (atoi(value) >= 0)) pstat.base = atoi(value);
-
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_open_a, 0, NULL );
-#endif
- fd->fd_sys = pvfs_open64(fd->filename, amode, perm, &pstat, NULL);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_open_b, 0, NULL );
-#endif
- fd->fd_direct = -1;
-
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- fd->fp_ind = fd->fp_sys_posn = pvfs_lseek64(fd->fd_sys, 0, SEEK_END);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- }
-
- if (fd->fd_sys != -1) {
- pvfs_ioctl(fd->fd_sys, GETMETA, &pstat);
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", pstat.pcount);
- ADIOI_Info_set(fd->info, "striping_factor", value);
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", pstat.ssize);
- ADIOI_Info_set(fd->info, "striping_unit", value);
- ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", pstat.base);
- ADIOI_Info_set(fd->info, "start_iodevice", value);
- }
-
- ADIOI_Free(value);
-
- if (fd->fd_sys == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_read.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_read.c
deleted file mode 100644
index 7ea249f28a4..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_read.c
+++ /dev/null
@@ -1,784 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "adio.h"
-#include "adio_extern.h"
-#include "ad_pvfs.h"
-
-#ifdef HAVE_PVFS_LISTIO
-void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-#endif
-
-void ADIOI_PVFS_ReadContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int *error_code)
-{
- MPI_Count err=-1, datatype_size, len;
- static char myname[] = "ADIOI_PVFS_READCONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- 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
- pvfs_lseek64(fd->fd_sys, offset, 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 = pvfs_read(fd->fd_sys, buf, len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
-#endif
- if (err>0)
- fd->fp_sys_posn = offset + err;
- /* individual file pointer not updated */
- }
- else { /* read from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, fd->fp_ind, 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 = pvfs_read(fd->fd_sys, buf, len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_read_b, 0, NULL );
-#endif
- if (err > 0)
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
- *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;
-}
-
-
-void ADIOI_PVFS_ReadStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-#ifdef HAVE_PVFS_LISTIO
- if ( fd->hints->fs_hints.pvfs.listio_read == ADIOI_HINT_ENABLE) {
- ADIOI_PVFS_ReadStridedListIO(fd, buf, count, datatype, file_ptr_type,
- offset, status, error_code);
- return;
- }
-#endif
-/* If hint set to DISABLE or AUTOMATIC, don't use listio */
- ADIOI_GEN_ReadStrided(fd, buf, count, datatype, file_ptr_type,
- offset, status, error_code);
-}
-
-#ifdef HAVE_PVFS_LISTIO
-void ADIOI_PVFS_ReadStridedListIO(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* offset is in units of etype relative to the filetype. */
-
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- int i, j, k, l, brd_size, frd_size=0, st_index=0;
- int sum, n_etypes_in_filetype, size_in_filetype;
- MPI_Count bufsize;
- int n_filetypes, etype_in_filetype;
- ADIO_Offset abs_off_in_filetype=0;
- MPI_Count filetype_size, etype_size, buftype_size;
- MPI_Aint filetype_extent, buftype_extent;
- int buf_count, buftype_is_contig, filetype_is_contig;
- ADIO_Offset userbuf_off;
- ADIO_Offset off, disp, start_off;
- int flag, st_frd_size, st_n_filetypes;
- int new_brd_size, new_frd_size;
-
- int mem_list_count, file_list_count;
- char **mem_offsets;
- int64_t *file_offsets;
- int *mem_lengths;
- int32_t *file_lengths;
- int total_blks_to_read;
-
- int max_mem_list, max_file_list;
-
- int b_blks_read;
- int f_data_read;
- int size_read=0, n_read_lists, extra_blks;
-
- int end_brd_size, end_frd_size;
- int start_k, start_j, new_file_read, new_buffer_read;
- int start_mem_offset;
-
-#define MAX_ARRAY_SIZE 1024
-
-#ifndef PRINT_ERR_MESG
- static char myname[] = "ADIOI_PVFS_ReadStrided";
-#endif
-
- *error_code = MPI_SUCCESS; /* changed below if error */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if ( ! filetype_size ) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- bufsize = buftype_size * count;
-
- if (!buftype_is_contig && filetype_is_contig) {
-
-/* noncontiguous in memory, contiguous in file. */
- int64_t file_offsets;
- int32_t file_lengths;
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind :
- fd->disp + etype_size * offset;
-
- file_list_count = 1;
- file_offsets = off;
- file_lengths = 0;
- total_blks_to_read = count*flat_buf->count;
- b_blks_read = 0;
-
- /* allocate arrays according to max usage */
- if (total_blks_to_read > MAX_ARRAY_SIZE)
- mem_list_count = MAX_ARRAY_SIZE;
- else mem_list_count = total_blks_to_read;
- mem_offsets = (char**)ADIOI_Malloc(mem_list_count*sizeof(char*));
- mem_lengths = (int*)ADIOI_Malloc(mem_list_count*sizeof(int));
-
- j = 0;
- /* step through each block in memory, filling memory arrays */
- while (b_blks_read < total_blks_to_read) {
- for (i=0; icount; i++) {
- mem_offsets[b_blks_read % MAX_ARRAY_SIZE] =
- (char*)((char *)buf + j*buftype_extent + flat_buf->indices[i]);
- mem_lengths[b_blks_read % MAX_ARRAY_SIZE] =
- flat_buf->blocklens[i];
- file_lengths += flat_buf->blocklens[i];
- b_blks_read++;
- if (!(b_blks_read % MAX_ARRAY_SIZE) ||
- (b_blks_read == total_blks_to_read)) {
-
- /* in the case of the last read list call,
- adjust mem_list_count */
- if (b_blks_read == total_blks_to_read) {
- mem_list_count = total_blks_to_read % MAX_ARRAY_SIZE;
- /* in case last read list call fills max arrays */
- if (!mem_list_count) mem_list_count = MAX_ARRAY_SIZE;
- }
-
- pvfs_read_list(fd->fd_sys ,mem_list_count, mem_offsets,
- mem_lengths, file_list_count,
- &file_offsets, &file_lengths);
-
- /* in the case of the last read list call, leave here */
- if (b_blks_read == total_blks_to_read) break;
-
- file_offsets += file_lengths;
- file_lengths = 0;
- }
- } /* for (i=0; icount; i++) */
- j++;
- } /* while (b_blks_read < total_blks_to_read) */
- ADIOI_Free(mem_offsets);
- ADIOI_Free(mem_lengths);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
- /* This isa temporary way of filling in status. The right way is to
- keep tracke of how much data was actually read adn placed in buf
- by ADIOI_BUFFERED_READ. */
-#endif
- ADIOI_Delete_flattened(datatype);
-
- return;
- } /* if (!buftype_is_contig && filetype_is_contig) */
-
- /* know file is noncontiguous from above */
- /* noncontiguous in file */
-
- /* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype) flat_file = flat_file->next;
-
- disp = fd->disp;
-
- /* for each case - ADIO_Individual pointer or explicit, find the file
- offset in bytes (offset), n_filetypes (how many filetypes into
- file to start), frd_size (remaining amount of data in present
- file block), and st_index (start point in terms of blocks in
- starting filetype) */
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind; /* in bytes */
- n_filetypes = -1;
- flag = 0;
- while (!flag) {
- n_filetypes++;
- for (i=0; icount; i++) {
- if (disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent +
- flat_file->blocklens[i] >= offset) {
- st_index = i;
- frd_size = (int) (disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent
- + flat_file->blocklens[i] - offset);
- flag = 1;
- break;
- }
- }
- } /* while (!flag) */
- } /* if (file_ptr_type == ADIO_INDIVIDUAL) */
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = (int) (offset / n_etypes_in_filetype);
- etype_in_filetype = (int) (offset % n_etypes_in_filetype);
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i=0; icount; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- frd_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes*filetype_extent +
- abs_off_in_filetype;
- } /* else [file_ptr_type != ADIO_INDIVIDUAL] */
-
- start_off = offset;
- st_frd_size = frd_size;
- st_n_filetypes = n_filetypes;
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- int mem_lengths;
- char *mem_offsets;
-
- i = 0;
- j = st_index;
- n_filetypes = st_n_filetypes;
-
- mem_list_count = 1;
-
- /* determine how many blocks in file to read */
- f_data_read = ADIOI_MIN(st_frd_size, bufsize);
- total_blks_to_read = 1;
- j++;
- while (f_data_read < bufsize) {
- f_data_read += flat_file->blocklens[j];
- total_blks_to_read++;
- if (j<(flat_file->count-1)) j++;
- else j = 0;
- }
-
- j = st_index;
- n_filetypes = st_n_filetypes;
- n_read_lists = total_blks_to_read/MAX_ARRAY_SIZE;
- extra_blks = total_blks_to_read%MAX_ARRAY_SIZE;
-
- mem_offsets = buf;
- mem_lengths = 0;
-
- /* if at least one full readlist, allocate file arrays
- at max array size and don't free until very end */
- if (n_read_lists) {
- file_offsets = (int64_t*)ADIOI_Malloc(MAX_ARRAY_SIZE*
- sizeof(int64_t));
- file_lengths = (int32_t*)ADIOI_Malloc(MAX_ARRAY_SIZE*
- sizeof(int32_t));
- }
- /* if there's no full readlist allocate file arrays according
- to needed size (extra_blks) */
- else {
- file_offsets = (int64_t*)ADIOI_Malloc(extra_blks*
- sizeof(int64_t));
- file_lengths = (int32_t*)ADIOI_Malloc(extra_blks*
- sizeof(int32_t));
- }
-
- /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */
- for (i=0; iindices[j];
- file_lengths[k] = flat_file->blocklens[j];
- mem_lengths += file_lengths[k];
- }
- if (j<(flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (k=0; kfd_sys, mem_list_count,
- &mem_offsets, &mem_lengths,
- file_list_count, file_offsets,
- file_lengths);
- mem_offsets += mem_lengths;
- mem_lengths = 0;
- } /* for (i=0; iindices[j];
- if (k == (extra_blks - 1)) {
- file_lengths[k] = bufsize - (int32_t) mem_lengths
- - (int32_t) mem_offsets + (int32_t) buf;
- }
- else file_lengths[k] = flat_file->blocklens[j];
- } /* if(i || k) */
- mem_lengths += file_lengths[k];
- if (j<(flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (k=0; kfd_sys, mem_list_count, &mem_offsets,
- &mem_lengths, file_list_count, file_offsets,
- file_lengths);
- }
- }
- else {
-/* noncontiguous in memory as well as in file */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- size_read = 0;
- n_filetypes = st_n_filetypes;
- frd_size = st_frd_size;
- brd_size = flat_buf->blocklens[0];
- buf_count = 0;
- start_mem_offset = 0;
- start_k = k = 0;
- start_j = st_index;
- max_mem_list = 0;
- max_file_list = 0;
-
- /* run through and file max_file_list and max_mem_list so that you
- can allocate the file and memory arrays less than MAX_ARRAY_SIZE
- if possible */
-
- while (size_read < bufsize) {
- k = start_k;
- new_buffer_read = 0;
- mem_list_count = 0;
- while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_read < bufsize-size_read)) {
- /* find mem_list_count and file_list_count such that both are
- less than MAX_ARRAY_SIZE, the sum of their lengths are
- equal, and the sum of all the data read and data to be
- read in the next immediate read list is less than
- bufsize */
- if(mem_list_count) {
- if((new_buffer_read + flat_buf->blocklens[k] +
- size_read) > bufsize) {
- end_brd_size = new_buffer_read +
- flat_buf->blocklens[k] - (bufsize - size_read);
- new_buffer_read = bufsize - size_read;
- }
- else {
- new_buffer_read += flat_buf->blocklens[k];
- end_brd_size = flat_buf->blocklens[k];
- }
- }
- else {
- if (brd_size > (bufsize - size_read)) {
- new_buffer_read = bufsize - size_read;
- brd_size = new_buffer_read;
- }
- else new_buffer_read = brd_size;
- }
- mem_list_count++;
- k = (k + 1)%flat_buf->count;
- } /* while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_read < bufsize-size_read)) */
- j = start_j;
- new_file_read = 0;
- file_list_count = 0;
- while ((file_list_count < MAX_ARRAY_SIZE) &&
- (new_file_read < new_buffer_read)) {
- if(file_list_count) {
- if((new_file_read + flat_file->blocklens[j]) >
- new_buffer_read) {
- end_frd_size = new_buffer_read - new_file_read;
- new_file_read = new_buffer_read;
- j--;
- }
- else {
- new_file_read += flat_file->blocklens[j];
- end_frd_size = flat_file->blocklens[j];
- }
- }
- else {
- if (frd_size > new_buffer_read) {
- new_file_read = new_buffer_read;
- frd_size = new_file_read;
- }
- else new_file_read = frd_size;
- }
- file_list_count++;
- if (j < (flat_file->count - 1)) j++;
- else j = 0;
-
- k = start_k;
- if ((new_file_read < new_buffer_read) &&
- (file_list_count == MAX_ARRAY_SIZE)) {
- new_buffer_read = 0;
- mem_list_count = 0;
- while (new_buffer_read < new_file_read) {
- if(mem_list_count) {
- if((new_buffer_read + flat_buf->blocklens[k]) >
- new_file_read) {
- end_brd_size = new_file_read - new_buffer_read;
- new_buffer_read = new_file_read;
- k--;
- }
- else {
- new_buffer_read += flat_buf->blocklens[k];
- end_brd_size = flat_buf->blocklens[k];
- }
- }
- else {
- new_buffer_read = brd_size;
- if (brd_size > (bufsize - size_read)) {
- new_buffer_read = bufsize - size_read;
- brd_size = new_buffer_read;
- }
- }
- mem_list_count++;
- k = (k + 1)%flat_buf->count;
- } /* while (new_buffer_read < new_file_read) */
- } /* if ((new_file_read < new_buffer_read) && (file_list_count
- == MAX_ARRAY_SIZE)) */
- } /* while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_read < bufsize-size_read)) */
-
- /* fakes filling the readlist arrays of lengths found above */
- k = start_k;
- j = start_j;
- for (i=0; iblocklens[k] == end_brd_size)
- brd_size = flat_buf->blocklens[(k+1)%
- flat_buf->count];
- else {
- brd_size = flat_buf->blocklens[k] - end_brd_size;
- k--;
- buf_count--;
- }
- }
- }
- buf_count++;
- k = (k + 1)%flat_buf->count;
- } /* for (i=0; iblocklens[j] == end_frd_size)
- frd_size = flat_file->blocklens[(j+1)%
- flat_file->count];
- else {
- frd_size = flat_file->blocklens[j] - end_frd_size;
- j--;
- }
- }
- }
- if (j < flat_file->count - 1) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (i=0; iblocklens[0];
- buf_count = 0;
- start_mem_offset = 0;
- start_k = k = 0;
- start_j = st_index;
-
- /* this section calculates mem_list_count and file_list_count
- and also finds the possibly odd sized last array elements
- in new_frd_size and new_brd_size */
-
- while (size_read < bufsize) {
- k = start_k;
- new_buffer_read = 0;
- mem_list_count = 0;
- while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_read < bufsize-size_read)) {
- /* find mem_list_count and file_list_count such that both are
- less than MAX_ARRAY_SIZE, the sum of their lengths are
- equal, and the sum of all the data read and data to be
- read in the next immediate read list is less than
- bufsize */
- if(mem_list_count) {
- if((new_buffer_read + flat_buf->blocklens[k] +
- size_read) > bufsize) {
- end_brd_size = new_buffer_read +
- flat_buf->blocklens[k] - (bufsize - size_read);
- new_buffer_read = bufsize - size_read;
- }
- else {
- new_buffer_read += flat_buf->blocklens[k];
- end_brd_size = flat_buf->blocklens[k];
- }
- }
- else {
- if (brd_size > (bufsize - size_read)) {
- new_buffer_read = bufsize - size_read;
- brd_size = new_buffer_read;
- }
- else new_buffer_read = brd_size;
- }
- mem_list_count++;
- k = (k + 1)%flat_buf->count;
- } /* while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_read < bufsize-size_read)) */
- j = start_j;
- new_file_read = 0;
- file_list_count = 0;
- while ((file_list_count < MAX_ARRAY_SIZE) &&
- (new_file_read < new_buffer_read)) {
- if(file_list_count) {
- if((new_file_read + flat_file->blocklens[j]) >
- new_buffer_read) {
- end_frd_size = new_buffer_read - new_file_read;
- new_file_read = new_buffer_read;
- j--;
- }
- else {
- new_file_read += flat_file->blocklens[j];
- end_frd_size = flat_file->blocklens[j];
- }
- }
- else {
- if (frd_size > new_buffer_read) {
- new_file_read = new_buffer_read;
- frd_size = new_file_read;
- }
- else new_file_read = frd_size;
- }
- file_list_count++;
- if (j < (flat_file->count - 1)) j++;
- else j = 0;
-
- k = start_k;
- if ((new_file_read < new_buffer_read) &&
- (file_list_count == MAX_ARRAY_SIZE)) {
- new_buffer_read = 0;
- mem_list_count = 0;
- while (new_buffer_read < new_file_read) {
- if(mem_list_count) {
- if((new_buffer_read + flat_buf->blocklens[k]) >
- new_file_read) {
- end_brd_size = new_file_read - new_buffer_read;
- new_buffer_read = new_file_read;
- k--;
- }
- else {
- new_buffer_read += flat_buf->blocklens[k];
- end_brd_size = flat_buf->blocklens[k];
- }
- }
- else {
- new_buffer_read = brd_size;
- if (brd_size > (bufsize - size_read)) {
- new_buffer_read = bufsize - size_read;
- brd_size = new_buffer_read;
- }
- }
- mem_list_count++;
- k = (k + 1)%flat_buf->count;
- } /* while (new_buffer_read < new_file_read) */
- } /* if ((new_file_read < new_buffer_read) && (file_list_count
- == MAX_ARRAY_SIZE)) */
- } /* while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_read < bufsize-size_read)) */
-
- /* fills the allocated readlist arrays */
- k = start_k;
- j = start_j;
- for (i=0; icount) +
- (int)flat_buf->indices[k]);
- if(!i) {
- mem_lengths[0] = brd_size;
- mem_offsets[0] += flat_buf->blocklens[k] - brd_size;
- }
- else {
- if (i == (mem_list_count - 1)) {
- mem_lengths[i] = end_brd_size;
- if (flat_buf->blocklens[k] == end_brd_size)
- brd_size = flat_buf->blocklens[(k+1)%
- flat_buf->count];
- else {
- brd_size = flat_buf->blocklens[k] - end_brd_size;
- k--;
- buf_count--;
- }
- }
- else {
- mem_lengths[i] = flat_buf->blocklens[k];
- }
- }
- buf_count++;
- k = (k + 1)%flat_buf->count;
- } /* for (i=0; iindices[j] + n_filetypes *
- filetype_extent;
- if (!i) {
- file_lengths[0] = frd_size;
- file_offsets[0] += flat_file->blocklens[j] - frd_size;
- }
- else {
- if (i == (file_list_count - 1)) {
- file_lengths[i] = end_frd_size;
- if (flat_file->blocklens[j] == end_frd_size)
- frd_size = flat_file->blocklens[(j+1)%
- flat_file->count];
- else {
- frd_size = flat_file->blocklens[j] - end_frd_size;
- j--;
- }
- }
- else file_lengths[i] = flat_file->blocklens[j];
- }
- if (j < flat_file->count - 1) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (i=0; ifd_sys,mem_list_count, mem_offsets,
- mem_lengths, file_list_count, file_offsets,
- file_lengths);
- size_read += new_buffer_read;
- start_k = k;
- start_j = j;
- } /* while (size_read < bufsize) */
- ADIOI_Free(mem_offsets);
- ADIOI_Free(mem_lengths);
- }
- ADIOI_Free(file_offsets);
- ADIOI_Free(file_lengths);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
- /* This is a temporary way of filling in status. The right way is to
- keep track of how much data was actually read and placed in buf
- by ADIOI_BUFFERED_READ. */
-#endif
-
- if (!buftype_is_contig) ADIOI_Delete_flattened(datatype);
-}
-#endif /* HAVE_PVFS_LISTIO */
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_resize.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_resize.c
deleted file mode 100644
index b4b9553633f..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_resize.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-
-void ADIOI_PVFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
-{
- int err;
- int rank;
- static char myname[] = "ADIOI_PVFS_RESIZE";
-
- /* because MPI_File_set_size is a collective operation, and PVFS1 clients
- * do not cache metadata locally, one client can resize and broadcast the
- * result to the others */
- MPI_Comm_rank(fd->comm, &rank);
- if (rank == fd->hints->ranklist[0]) {
- err = pvfs_ftruncate64(fd->fd_sys, size);
- }
- MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
-
- if (err == -1) {
- *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;
-}
diff --git a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_write.c b/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_write.c
deleted file mode 100644
index 5f8d7e0f12e..00000000000
--- a/3rd-party/romio321/adio/ad_pvfs/ad_pvfs_write.c
+++ /dev/null
@@ -1,1167 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * Copyright (C) 1997 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- */
-
-#include "ad_pvfs.h"
-#include "adio_extern.h"
-
-#ifdef HAVE_PVFS_LISTIO
-void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code);
-#endif
-
-void ADIOI_PVFS_WriteContig(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status,
- int *error_code)
-{
- MPI_Count err=-1, datatype_size, len;
- static char myname[] = "ADIOI_PVFS_WRITECONTIG";
-
- MPI_Type_size_x(datatype, &datatype_size);
- len = datatype_size * count;
-
- 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
- pvfs_lseek64(fd->fd_sys, offset, 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_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys, buf, len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err > 0)
- fd->fp_sys_posn = offset + err;
- /* individual file pointer not updated */
- }
- else { /* write from curr. location of ind. file pointer */
- if (fd->fp_sys_posn != fd->fp_ind) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, fd->fp_ind, 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_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys, buf, len);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err > 0)
- fd->fp_ind += err;
- fd->fp_sys_posn = fd->fp_ind;
- }
-
-#ifdef HAVE_STATUS_SET_BYTES
- if (err != -1) MPIR_Status_set_bytes(status, datatype, err);
-#endif
-
- if (err == -1) {
- *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;
-}
-
-
-
-void ADIOI_PVFS_WriteStrided(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* Since PVFS does not support file locking, can't do buffered writes
- as on Unix */
-
-/* offset is in units of etype relative to the filetype. */
-
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- int i, j, k, err=-1, bwr_size, fwr_size=0, st_index=0;
- int num, size, sum, n_etypes_in_filetype, size_in_filetype;
- MPI_Count bufsize;
- int n_filetypes, etype_in_filetype;
- ADIO_Offset abs_off_in_filetype=0;
- MPI_Count filetype_size, etype_size, buftype_size;
- MPI_Aint filetype_extent, buftype_extent, indx, filetype_lb, buftype_lb;
- int buf_count, buftype_is_contig, filetype_is_contig;
- ADIO_Offset off, disp;
- int flag, new_bwr_size, new_fwr_size, err_flag=0;
- static char myname[] = "ADIOI_PVFS_WRITESTRIDED";
-
-#ifdef HAVE_PVFS_LISTIO
- if ( fd->hints->fs_hints.pvfs.listio_write == ADIOI_HINT_ENABLE ) {
- ADIOI_PVFS_WriteStridedListIO(fd, buf, count, datatype,
- file_ptr_type, offset, status, error_code);
- return;
- }
-#endif
- /* if hint set to DISABLE or AUTOMATIC, don't use listio */
-
- /* --BEGIN ERROR HANDLING-- */
- if (fd->atomicity) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_INTERN,
- "Atomic mode set in PVFS I/O function", 0);
- return;
- }
- /* --END ERROR HANDLING-- */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if ( ! filetype_size ) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- bufsize = buftype_size * count;
-
- if (!buftype_is_contig && filetype_is_contig) {
- char *combine_buf, *combine_buf_ptr;
- ADIO_Offset combine_buf_remain;
-/* noncontiguous in memory, contiguous in file. use writev */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- /* allocate our "combine buffer" to pack data into before writing */
- combine_buf = (char *) ADIOI_Malloc(fd->hints->ind_wr_buffer_size);
- combine_buf_ptr = combine_buf;
- combine_buf_remain = fd->hints->ind_wr_buffer_size;
-
- /* seek to the right spot in the file */
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- off = fd->disp + etype_size * offset;
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, off, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
- else {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- off = pvfs_lseek64(fd->fd_sys, fd->fp_ind, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
-
- /* loop through all the flattened pieces. combine into buffer until
- * no more will fit, then write.
- *
- * special case of a given piece being bigger than the combine buffer
- * is also handled.
- */
- for (j=0; jcount; i++) {
- if (flat_buf->blocklens[i] > combine_buf_remain && combine_buf != combine_buf_ptr) {
- /* there is data in the buffer; write out the buffer so far */
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys,
- combine_buf,
- fd->hints->ind_wr_buffer_size - combine_buf_remain);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err == -1) err_flag = 1;
-
- /* reset our buffer info */
- combine_buf_ptr = combine_buf;
- combine_buf_remain = fd->hints->ind_wr_buffer_size;
- }
-
- /* TODO: heuristic for when to not bother to use combine buffer? */
- if (flat_buf->blocklens[i] >= combine_buf_remain) {
- /* special case: blocklen is as big as or bigger than the combine buf;
- * write directly
- */
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys,
- ((char *) buf) + j*buftype_extent + flat_buf->indices[i],
- flat_buf->blocklens[i]);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err == -1) err_flag = 1;
- off += flat_buf->blocklens[i]; /* keep up with the final file offset too */
- }
- else {
- /* copy more data into combine buffer */
- memcpy(combine_buf_ptr,
- ((char *) buf) + j*buftype_extent + flat_buf->indices[i],
- flat_buf->blocklens[i]);
- combine_buf_ptr += flat_buf->blocklens[i];
- combine_buf_remain -= flat_buf->blocklens[i];
- off += flat_buf->blocklens[i]; /* keep up with the final file offset too */
- }
- }
- }
-
- if (combine_buf_ptr != combine_buf) {
- /* data left in buffer to write */
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys,
- combine_buf,
- fd->hints->ind_wr_buffer_size - combine_buf_remain);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err == -1) err_flag = 1;
- }
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
-
- ADIOI_Free(combine_buf);
-
- if (err_flag) {
- *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;
- } /* if (!buftype_is_contig && filetype_is_contig) ... */
-
- else { /* noncontiguous in file */
-
-/* split up into several contiguous writes */
-
-/* find starting location in the file */
-
-/* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype) flat_file = flat_file->next;
- disp = fd->disp;
-
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind; /* in bytes */
- n_filetypes = -1;
- flag = 0;
- while (!flag) {
- n_filetypes++;
- for (i=0; icount; i++) {
- if (disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent + flat_file->blocklens[i]
- >= offset) {
- st_index = i;
- fwr_size = disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent
- + flat_file->blocklens[i] - offset;
- flag = 1;
- break;
- }
- }
- }
- }
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = (int) (offset / n_etypes_in_filetype);
- etype_in_filetype = (int) (offset % n_etypes_in_filetype);
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i=0; icount; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- fwr_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes*filetype_extent + abs_off_in_filetype;
- }
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- i = 0;
- j = st_index;
- off = offset;
- fwr_size = ADIOI_MIN(fwr_size, bufsize);
- while (i < bufsize) {
- if (fwr_size) {
- /* TYPE_UB and TYPE_LB can result in
- fwr_size = 0. save system call in such cases */
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, 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_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys, ((char *) buf) + i, fwr_size);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err == -1) err_flag = 1;
- }
- i += fwr_size;
-
- if (off + fwr_size < disp + flat_file->indices[j] +
- flat_file->blocklens[j] + (ADIO_Offset) n_filetypes*filetype_extent)
- off += fwr_size;
- /* did not reach end of contiguous block in filetype.
- no more I/O needed. off is incremented by fwr_size. */
- else {
- if (j < (flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
- fwr_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i);
- }
- }
- }
- else {
-/* noncontiguous in memory as well as in file */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- k = num = buf_count = 0;
- indx = flat_buf->indices[0];
- j = st_index;
- off = offset;
- bwr_size = flat_buf->blocklens[0];
-
- while (num < bufsize) {
- size = ADIOI_MIN(fwr_size, bwr_size);
- if (size) {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, 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_write_a, 0, NULL );
-#endif
- err = pvfs_write(fd->fd_sys, ((char *) buf) + indx, size);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_write_b, 0, NULL );
-#endif
- if (err == -1) err_flag = 1;
- }
-
- new_fwr_size = fwr_size;
- new_bwr_size = bwr_size;
-
- if (size == fwr_size) {
-/* reached end of contiguous block in file */
- if (j < (flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
-
- off = disp + flat_file->indices[j] +
- (ADIO_Offset) n_filetypes*filetype_extent;
-
- new_fwr_size = flat_file->blocklens[j];
- if (size != bwr_size) {
- indx += size;
- new_bwr_size -= size;
- }
- }
-
- if (size == bwr_size) {
-/* reached end of contiguous block in memory */
-
- k = (k + 1)%flat_buf->count;
- buf_count++;
- indx = buftype_extent*(buf_count/flat_buf->count) +
- flat_buf->indices[k];
- new_bwr_size = flat_buf->blocklens[k];
- if (size != fwr_size) {
- off += size;
- new_fwr_size -= size;
- }
- }
- num += size;
- fwr_size = new_fwr_size;
- bwr_size = new_bwr_size;
- }
- }
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
- if (err_flag) {
- *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;
- }
-
- fd->fp_sys_posn = -1; /* set it to null. */
-
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, bufsize);
-/* This is a temporary way of filling in status. The right way is to
- keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */
-#endif
-
- if (!buftype_is_contig) ADIOI_Delete_flattened(datatype);
-}
-
-#ifdef HAVE_PVFS_LISTIO
-void ADIOI_PVFS_WriteStridedListIO(ADIO_File fd, void *buf, int count,
- MPI_Datatype datatype, int file_ptr_type,
- ADIO_Offset offset, ADIO_Status *status, int
- *error_code)
-{
-/* Since PVFS does not support file locking, can't do buffered writes
- as on Unix */
-
-/* offset is in units of etype relative to the filetype. */
-
- ADIOI_Flatlist_node *flat_buf, *flat_file;
- int i, j, k, err=-1, bwr_size, fwr_size=0, st_index=0;
- int size, sum, n_etypes_in_filetype, size_in_filetype;
- MPI_Count bufsize;
- int n_filetypes, etype_in_filetype;
- ADIO_Offset abs_off_in_filetype=0;
- MPI_Count filetype_size, etype_size, buftype_size;
- MPI_Aint filetype_extent, buftype_extent, filetype_lb, buftype_lb;
- int buf_count, buftype_is_contig, filetype_is_contig;
- ADIO_Offset userbuf_off;
- ADIO_Offset off, disp, start_off;
- int flag, st_fwr_size, st_n_filetypes;
- int new_bwr_size, new_fwr_size, err_flag=0;
-
- int mem_list_count, file_list_count;
- char ** mem_offsets;
- int64_t *file_offsets;
- int *mem_lengths;
- int32_t *file_lengths;
- int total_blks_to_write;
-
- int max_mem_list, max_file_list;
-
- int b_blks_wrote;
- int f_data_wrote;
- int size_wrote=0, n_write_lists, extra_blks;
-
- int end_bwr_size, end_fwr_size;
- int start_k, start_j, new_file_write, new_buffer_write;
- int start_mem_offset;
-#define MAX_ARRAY_SIZE 1024
- static char myname[] = "ADIOI_PVFS_WRITESTRIDED";
-
-/* PFS file pointer modes are not relevant here, because PFS does
- not support strided accesses. */
-
- /* --BEGIN ERROR HANDLING-- */
- if (fd->atomicity) {
- *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
- myname, __LINE__,
- MPI_ERR_INTERN,
- "Atomic mode set in PVFS I/O function", 0);
- return;
- }
- /* --END ERROR HANDLING-- */
-
- ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
- ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
-
- MPI_Type_size_x(fd->filetype, &filetype_size);
- if ( ! filetype_size ) {
-#ifdef HAVE_STATUS_SET_BYTES
- MPIR_Status_set_bytes(status, datatype, 0);
-#endif
- *error_code = MPI_SUCCESS;
- return;
- }
-
- MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent);
- MPI_Type_size_x(datatype, &buftype_size);
- MPI_Type_get_extent(datatype, &buftype_lb, &buftype_extent);
- etype_size = fd->etype_size;
-
- bufsize = buftype_size * count;
-
- if (!buftype_is_contig && filetype_is_contig) {
-
-/* noncontiguous in memory, contiguous in file. */
- int64_t file_offsets;
- int32_t file_lengths;
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- if (file_ptr_type == ADIO_EXPLICIT_OFFSET) {
- off = fd->disp + etype_size * offset;
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- pvfs_lseek64(fd->fd_sys, fd->fp_ind, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
- else {
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL );
-#endif
- off = pvfs_lseek64(fd->fd_sys, fd->fp_ind, SEEK_SET);
-#ifdef ADIOI_MPE_LOGGING
- MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL );
-#endif
- }
-
- file_list_count = 1;
- file_offsets = off;
- file_lengths = 0;
- total_blks_to_write = count*flat_buf->count;
- b_blks_wrote = 0;
-
- /* allocate arrays according to max usage */
- if (total_blks_to_write > MAX_ARRAY_SIZE)
- mem_list_count = MAX_ARRAY_SIZE;
- else mem_list_count = total_blks_to_write;
- mem_offsets = (char**)ADIOI_Malloc(mem_list_count*sizeof(char*));
- mem_lengths = (int*)ADIOI_Malloc(mem_list_count*sizeof(int));
-
- j = 0;
- /* step through each block in memory, filling memory arrays */
- while (b_blks_wrote < total_blks_to_write) {
- for (i=0; icount; i++) {
- mem_offsets[b_blks_wrote % MAX_ARRAY_SIZE] =
- ((char*)buf + j*buftype_extent + flat_buf->indices[i]);
- mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] =
- flat_buf->blocklens[i];
- file_lengths += flat_buf->blocklens[i];
- b_blks_wrote++;
- if (!(b_blks_wrote % MAX_ARRAY_SIZE) ||
- (b_blks_wrote == total_blks_to_write)) {
-
- /* in the case of the last read list call,
- adjust mem_list_count */
- if (b_blks_wrote == total_blks_to_write) {
- mem_list_count = total_blks_to_write % MAX_ARRAY_SIZE;
- /* in case last read list call fills max arrays */
- if (!mem_list_count) mem_list_count = MAX_ARRAY_SIZE;
- }
-
- pvfs_write_list(fd->fd_sys ,mem_list_count, mem_offsets,
- mem_lengths, file_list_count,
- &file_offsets, &file_lengths);
-
- /* in the case of the last read list call, leave here */
- if (b_blks_wrote == total_blks_to_write) break;
-
- file_offsets += file_lengths;
- file_lengths = 0;
- }
- } /* for (i=0; icount; i++) */
- j++;
- } /* while (b_blks_wrote < total_blks_to_write) */
- ADIOI_Free(mem_offsets);
- ADIOI_Free(mem_lengths);
-
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off;
-
- if (err_flag) {
- *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;
-
- fd->fp_sys_posn = -1; /* clear this. */
-
-#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 written by ADIOI_BUFFERED_WRITE. */
-#endif
-
- ADIOI_Delete_flattened(datatype);
- return;
- } /* if (!buftype_is_contig && filetype_is_contig) */
-
- /* already know that file is noncontiguous from above */
- /* noncontiguous in file */
-
-/* filetype already flattened in ADIO_Open */
- flat_file = ADIOI_Flatlist;
- while (flat_file->type != fd->filetype) flat_file = flat_file->next;
-
- disp = fd->disp;
-
- /* for each case - ADIO_Individual pointer or explicit, find offset
- (file offset in bytes), n_filetypes (how many filetypes into file
- to start), fwr_size (remaining amount of data in present file
- block), and st_index (start point in terms of blocks in starting
- filetype) */
- if (file_ptr_type == ADIO_INDIVIDUAL) {
- offset = fd->fp_ind; /* in bytes */
- n_filetypes = -1;
- flag = 0;
- while (!flag) {
- n_filetypes++;
- for (i=0; icount; i++) {
- if (disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent +
- flat_file->blocklens[i] >= offset) {
- st_index = i;
- fwr_size = disp + flat_file->indices[i] +
- (ADIO_Offset) n_filetypes*filetype_extent
- + flat_file->blocklens[i] - offset;
- flag = 1;
- break;
- }
- }
- } /* while (!flag) */
- } /* if (file_ptr_type == ADIO_INDIVIDUAL) */
- else {
- n_etypes_in_filetype = filetype_size/etype_size;
- n_filetypes = (int) (offset / n_etypes_in_filetype);
- etype_in_filetype = (int) (offset % n_etypes_in_filetype);
- size_in_filetype = etype_in_filetype * etype_size;
-
- sum = 0;
- for (i=0; icount; i++) {
- sum += flat_file->blocklens[i];
- if (sum > size_in_filetype) {
- st_index = i;
- fwr_size = sum - size_in_filetype;
- abs_off_in_filetype = flat_file->indices[i] +
- size_in_filetype - (sum - flat_file->blocklens[i]);
- break;
- }
- }
-
- /* abs. offset in bytes in the file */
- offset = disp + (ADIO_Offset) n_filetypes*filetype_extent +
- abs_off_in_filetype;
- } /* else [file_ptr_type != ADIO_INDIVIDUAL] */
-
- start_off = offset;
- st_fwr_size = fwr_size;
- st_n_filetypes = n_filetypes;
-
- if (buftype_is_contig && !filetype_is_contig) {
-
-/* contiguous in memory, noncontiguous in file. should be the most
- common case. */
-
- int mem_lengths;
- char *mem_offsets;
-
- i = 0;
- j = st_index;
- off = offset;
- n_filetypes = st_n_filetypes;
-
- mem_list_count = 1;
-
- /* determine how many blocks in file to read */
- f_data_wrote = ADIOI_MIN(st_fwr_size, bufsize);
- total_blks_to_write = 1;
- j++;
- while (f_data_wrote < bufsize) {
- f_data_wrote += flat_file->blocklens[j];
- total_blks_to_write++;
- if (j<(flat_file->count-1)) j++;
- else j = 0;
- }
-
- j = st_index;
- n_filetypes = st_n_filetypes;
- n_write_lists = total_blks_to_write/MAX_ARRAY_SIZE;
- extra_blks = total_blks_to_write%MAX_ARRAY_SIZE;
-
- mem_offsets = buf;
- mem_lengths = 0;
-
- /* if at least one full readlist, allocate file arrays
- at max array size and don't free until very end */
- if (n_write_lists) {
- file_offsets = (int64_t*)ADIOI_Malloc(MAX_ARRAY_SIZE*
- sizeof(int64_t));
- file_lengths = (int32_t*)ADIOI_Malloc(MAX_ARRAY_SIZE*
- sizeof(int32_t));
- }
- /* if there's no full readlist allocate file arrays according
- to needed size (extra_blks) */
- else {
- file_offsets = (int64_t*)ADIOI_Malloc(extra_blks*
- sizeof(int64_t));
- file_lengths = (int32_t*)ADIOI_Malloc(extra_blks*
- sizeof(int32_t));
- }
-
- /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */
- for (i=0; iindices[j];
- file_lengths[k] = flat_file->blocklens[j];
- mem_lengths += file_lengths[k];
- }
- if (j<(flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (k=0; kfd_sys, mem_list_count,
- &mem_offsets, &mem_lengths,
- file_list_count, file_offsets,
- file_lengths);
- mem_offsets += mem_lengths;
- mem_lengths = 0;
- } /* for (i=0; iindices[j];
- if (k == (extra_blks - 1)) {
- file_lengths[k] = bufsize - (int32_t) mem_lengths
- - (int32_t) mem_offsets + (int32_t) buf;
- }
- else file_lengths[k] = flat_file->blocklens[j];
- } /* if(i || k) */
- mem_lengths += file_lengths[k];
- if (j<(flat_file->count - 1)) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (k=0; kfd_sys, mem_list_count, &mem_offsets,
- &mem_lengths, file_list_count, file_offsets,
- file_lengths);
- }
- }
- else {
- /* noncontiguous in memory as well as in file */
-
- flat_buf = ADIOI_Flatten_and_find(datatype);
-
- size_wrote = 0;
- n_filetypes = st_n_filetypes;
- fwr_size = st_fwr_size;
- bwr_size = flat_buf->blocklens[0];
- buf_count = 0;
- start_mem_offset = 0;
- start_k = k = 0;
- start_j = st_index;
- max_mem_list = 0;
- max_file_list = 0;
-
- /* run through and file max_file_list and max_mem_list so that you
- can allocate the file and memory arrays less than MAX_ARRAY_SIZE
- if possible */
-
- while (size_wrote < bufsize) {
- k = start_k;
- new_buffer_write = 0;
- mem_list_count = 0;
- while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_write < bufsize-size_wrote)) {
- /* find mem_list_count and file_list_count such that both are
- less than MAX_ARRAY_SIZE, the sum of their lengths are
- equal, and the sum of all the data read and data to be
- read in the next immediate read list is less than
- bufsize */
- if(mem_list_count) {
- if((new_buffer_write + flat_buf->blocklens[k] +
- size_wrote) > bufsize) {
- end_bwr_size = new_buffer_write +
- flat_buf->blocklens[k] - (bufsize - size_wrote);
- new_buffer_write = bufsize - size_wrote;
- }
- else {
- new_buffer_write += flat_buf->blocklens[k];
- end_bwr_size = flat_buf->blocklens[k];
- }
- }
- else {
- if (bwr_size > (bufsize - size_wrote)) {
- new_buffer_write = bufsize - size_wrote;
- bwr_size = new_buffer_write;
- }
- else new_buffer_write = bwr_size;
- }
- mem_list_count++;
- k = (k + 1)%flat_buf->count;
- } /* while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_write < bufsize-size_wrote)) */
- j = start_j;
- new_file_write = 0;
- file_list_count = 0;
- while ((file_list_count < MAX_ARRAY_SIZE) &&
- (new_file_write < new_buffer_write)) {
- if(file_list_count) {
- if((new_file_write + flat_file->blocklens[j]) >
- new_buffer_write) {
- end_fwr_size = new_buffer_write - new_file_write;
- new_file_write = new_buffer_write;
- j--;
- }
- else {
- new_file_write += flat_file->blocklens[j];
- end_fwr_size = flat_file->blocklens[j];
- }
- }
- else {
- if (fwr_size > new_buffer_write) {
- new_file_write = new_buffer_write;
- fwr_size = new_file_write;
- }
- else new_file_write = fwr_size;
- }
- file_list_count++;
- if (j < (flat_file->count - 1)) j++;
- else j = 0;
-
- k = start_k;
- if ((new_file_write < new_buffer_write) &&
- (file_list_count == MAX_ARRAY_SIZE)) {
- new_buffer_write = 0;
- mem_list_count = 0;
- while (new_buffer_write < new_file_write) {
- if(mem_list_count) {
- if((new_buffer_write + flat_buf->blocklens[k]) >
- new_file_write) {
- end_bwr_size = new_file_write -
- new_buffer_write;
- new_buffer_write = new_file_write;
- k--;
- }
- else {
- new_buffer_write += flat_buf->blocklens[k];
- end_bwr_size = flat_buf->blocklens[k];
- }
- }
- else {
- new_buffer_write = bwr_size;
- if (bwr_size > (bufsize - size_wrote)) {
- new_buffer_write = bufsize - size_wrote;
- bwr_size = new_buffer_write;
- }
- }
- mem_list_count++;
- k = (k + 1)%flat_buf->count;
- } /* while (new_buffer_write < new_file_write) */
- } /* if ((new_file_write < new_buffer_write) &&
- (file_list_count == MAX_ARRAY_SIZE)) */
- } /* while ((mem_list_count < MAX_ARRAY_SIZE) &&
- (new_buffer_write < bufsize-size_wrote)) */
-
- /* fakes filling the writelist arrays of lengths found above */
- k = start_k;
- j = start_j;
- for (i=0; iblocklens[k] == end_bwr_size)
- bwr_size = flat_buf->blocklens[(k+1)%
- flat_buf->count];
- else {
- bwr_size = flat_buf->blocklens[k] - end_bwr_size;
- k--;
- buf_count--;
- }
- }
- }
- buf_count++;
- k = (k + 1)%flat_buf->count;
- } /* for (i=0; iblocklens[j] == end_fwr_size)
- fwr_size = flat_file->blocklens[(j+1)%
- flat_file->count];
- else {
- fwr_size = flat_file->blocklens[j] - end_fwr_size;
- j--;
- }
- }
- }
- if (j < flat_file->count - 1) j++;
- else {
- j = 0;
- n_filetypes++;
- }
- } /* for (i=0; i