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! ![You're awesome!](https://www.open-mpi.org/images/youre-awesome.jpg) -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; 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_fwr_size and new_bwr_size */ - - while (size_wrote < bufsize) { - k = start_k; - new_buffer_write = 0; - mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && - (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)) */ - - /* fills the allocated readlist arrays */ - k = start_k; - j = start_j; - for (i=0; icount) + - (int)flat_buf->indices[k]); - - if(!i) { - mem_lengths[0] = bwr_size; - mem_offsets[0] += flat_buf->blocklens[k] - bwr_size; - } - else { - if (i == (mem_list_count - 1)) { - mem_lengths[i] = end_bwr_size; - if (flat_buf->blocklens[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--; - } - } - 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] = fwr_size; - file_offsets[0] += flat_file->blocklens[j] - fwr_size; - } - else { - if (i == (file_list_count - 1)) { - file_lengths[i] = end_fwr_size; - if (flat_file->blocklens[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--; - } - } - 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_wrote += new_buffer_write; - start_k = k; - start_j = j; - } /* while (size_wrote < 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; - 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); -} -#endif /* HAVE_PVFS_LISTIO */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/Makefile.mk b/3rd-party/romio321/adio/ad_pvfs2/Makefile.mk deleted file mode 100644 index 4ee9d0fd362..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/Makefile.mk +++ /dev/null @@ -1,34 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if BUILD_AD_PVFS2 - -noinst_HEADERS += adio/ad_pvfs2/ad_pvfs2.h \ - adio/ad_pvfs2/ad_pvfs2_io.h \ - adio/ad_pvfs2/ad_pvfs2_common.h - -romio_other_sources += \ - adio/ad_pvfs2/ad_pvfs2_close.c \ - adio/ad_pvfs2/ad_pvfs2_read.c \ - adio/ad_pvfs2/ad_pvfs2_open.c \ - adio/ad_pvfs2/ad_pvfs2_write.c \ - adio/ad_pvfs2/ad_pvfs2_fcntl.c \ - adio/ad_pvfs2/ad_pvfs2_flush.c \ - adio/ad_pvfs2/ad_pvfs2_resize.c \ - adio/ad_pvfs2/ad_pvfs2_hints.c \ - adio/ad_pvfs2/ad_pvfs2_delete.c \ - adio/ad_pvfs2/ad_pvfs2.c \ - adio/ad_pvfs2/ad_pvfs2_common.c \ - adio/ad_pvfs2/ad_pvfs2_aio.c \ - adio/ad_pvfs2/ad_pvfs2_read_list_classic.c \ - adio/ad_pvfs2/ad_pvfs2_io_list.c \ - adio/ad_pvfs2/ad_pvfs2_io_dtype.c \ - adio/ad_pvfs2/ad_pvfs2_write_list_classic.c \ - adio/ad_pvfs2/ad_pvfs2_features.c - -endif BUILD_AD_PVFS2 - diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2.c deleted file mode 100644 index bdebe19d37a..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_pvfs2.h" - -#include "adio.h" - -struct ADIOI_Fns_struct ADIO_PVFS2_operations = { - ADIOI_PVFS2_Open, /* Open */ - ADIOI_SCALEABLE_OpenColl, /* OpenColl */ - ADIOI_PVFS2_ReadContig, /* ReadContig */ - ADIOI_PVFS2_WriteContig, /* WriteContig */ - ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ - ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ - ADIOI_GEN_SeekIndividual, /* SeekIndividual */ - ADIOI_PVFS2_Fcntl, /* Fcntl */ - ADIOI_PVFS2_SetInfo, /* SetInfo */ - ADIOI_PVFS2_ReadStrided, /* ReadStrided */ - ADIOI_PVFS2_WriteStrided, /* WriteStrided */ - ADIOI_PVFS2_Close, /* Close */ -#ifdef HAVE_MPI_GREQUEST_EXTENSIONS - ADIOI_PVFS2_IReadContig, /* IreadContig */ - ADIOI_PVFS2_IWriteContig, /* IwriteContig */ -#else - ADIOI_FAKE_IreadContig, /* IreadContig */ - ADIOI_FAKE_IwriteContig, /* IwriteContig */ -#endif - 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_PVFS2_Flush, /* Flush */ - ADIOI_PVFS2_Resize, /* Resize */ - ADIOI_PVFS2_Delete, /* Delete */ - ADIOI_PVFS2_Feature, - "PVFS2: the PVFS v2 or OrangeFS file systems", - ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ - ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ -}; - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2.h b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2.h deleted file mode 100644 index 95c5912376b..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2.h +++ /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. - */ - -#ifndef AD_PVFS2_INCLUDE -#define AD_PVFS2_INCLUDE - -#include "adio.h" -#ifdef HAVE_PVFS2_H -#include "pvfs2.h" -#endif - -#ifdef PVFS2_VERSION_MAJOR -#include "pvfs2-compat.h" -#endif - -void ADIOI_PVFS2_Open(ADIO_File fd, int *error_code); -void ADIOI_PVFS2_Close(ADIO_File fd, int *error_code); -void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_PVFS2_WriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_PVFS2_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); -void ADIOI_PVFS2_WriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_PVFS2_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_PVFS2_Flush(ADIO_File fd, int *error_code); -void ADIOI_PVFS2_Delete(const char *filename, int *error_code); -void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -int ADIOI_PVFS2_Feature(ADIO_File fd, int flag); - -void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code); -void ADIOI_PVFS2_IWriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code); -void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int flag, int *error_code); -void ADIOI_PVFS2_OldWriteStrided(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_PVFS2_OldReadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); - -int ADIOI_PVFS2_WriteStridedListIO(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 ADIOI_PVFS2_WriteStridedDtypeIO(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code); - -#endif diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_aio.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_aio.c deleted file mode 100644 index 88be6f1eaff..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_aio.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "ad_pvfs2.h" -#include - -#include "ad_pvfs2_common.h" -#include "mpiu_greq.h" -#include "../../mpi-io/mpioimpl.h" - -#define READ 0 -#define WRITE 1 - -static int ADIOI_PVFS2_greq_class = 0; -int ADIOI_PVFS2_aio_free_fn(void *extra_state); -int ADIOI_PVFS2_aio_poll_fn(void *extra_state, MPI_Status *status); -int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, - double timeout, MPI_Status *status); - -void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code) -{ - ADIOI_PVFS2_AIO_contig(fd, buf, count, datatype, file_ptr_type, - offset, request, READ, error_code); -} - -void ADIOI_PVFS2_IWriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code) -{ - ADIOI_PVFS2_AIO_contig(fd, (void *)buf, count, datatype, file_ptr_type, - offset, request, WRITE, error_code); -} - -void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int flag, int *error_code) -{ - - int ret; - MPI_Count datatype_size, len; - ADIOI_PVFS2_fs *pvfs_fs; - ADIOI_AIO_Request *aio_req; - static char myname[] = "ADIOI_PVFS2_AIO_contig"; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - aio_req = (ADIOI_AIO_Request*)ADIOI_Calloc(sizeof(ADIOI_AIO_Request), 1); - - MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * count; - - ret = PVFS_Request_contiguous(len, PVFS_BYTE, &(aio_req->mem_req)); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in pvfs_request_contig (memory)", 0); - return; - } - /* --END ERROR HANDLING-- */ - - ret = PVFS_Request_contiguous(len, PVFS_BYTE, &(aio_req->file_req)); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in pvfs_request_contig (file)", 0); - return; - } - /* --END ERROR HANDLING-- */ - - if (file_ptr_type == ADIO_INDIVIDUAL) { - /* copy individual file pointer into offset variable, continue */ - offset = fd->fp_ind; - } - if (flag == READ) { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_iread_a, 0, NULL ); -#endif - ret = PVFS_isys_read(pvfs_fs->object_ref, aio_req->file_req, offset, - buf, aio_req->mem_req, &(pvfs_fs->credentials), - &(aio_req->resp_io), &(aio_req->op_id), NULL); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_iread_b, 0, NULL ); -#endif - } else if (flag == WRITE) { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_iwrite_a, 0, NULL ); -#endif - ret = PVFS_isys_write(pvfs_fs->object_ref, aio_req->file_req, offset, - buf, aio_req->mem_req, &(pvfs_fs->credentials), - &(aio_req->resp_io), &(aio_req->op_id), NULL); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_iwrite_b, 0, NULL ); -#endif - } - - /* --BEGIN ERROR HANDLING-- */ - if (ret < 0 ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_isys_io", 0); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - /* posted. defered completion */ - if (ret == 0) { - if (ADIOI_PVFS2_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, - ADIOI_PVFS2_aio_free_fn, MPIU_Greq_cancel_fn, - ADIOI_PVFS2_aio_poll_fn, ADIOI_PVFS2_aio_wait_fn, - &ADIOI_PVFS2_greq_class); - } - MPIX_Grequest_class_allocate(ADIOI_PVFS2_greq_class, aio_req, request); - memcpy(&(aio_req->req), request, sizeof(*request)); - } - - /* immediate completion */ - if (ret == 1) { - MPIO_Completed_request_create(&fd, len, error_code, request); - } - - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += len; - } - fd->fp_sys_posn = offset + len; - - *error_code = MPI_SUCCESS; -fn_exit: - return; -} - -int ADIOI_PVFS2_aio_free_fn(void *extra_state) -{ - ADIOI_AIO_Request *aio_req; - aio_req = (ADIOI_AIO_Request*)extra_state; - - PVFS_Request_free(&(aio_req->mem_req)); - PVFS_Request_free(&(aio_req->file_req)); - ADIOI_Free(aio_req); - - return MPI_SUCCESS; -} - -int ADIOI_PVFS2_aio_poll_fn(void *extra_state, MPI_Status *status) -{ - ADIOI_AIO_Request *aio_req; - int ret, error; - - aio_req = (ADIOI_AIO_Request *)extra_state; - - /* BUG: cannot PVFS_sys_testsome: does not work for a specific request */ - ret = PVFS_sys_wait(aio_req->op_id, "ADIOI_PVFS2_aio_poll_fn", &error); - if (ret == 0) { - aio_req->nbytes = aio_req->resp_io.total_completed; - MPI_Grequest_complete(aio_req->req); - return MPI_SUCCESS; - } else - return MPI_UNDEFINED; /* TODO: what's this error? */ -} - -/* wait for multiple requests to complete */ -int ADIOI_PVFS2_aio_wait_fn(int count, void ** array_of_states, - double timeout, MPI_Status *status) -{ - - ADIOI_AIO_Request **aio_reqlist; - PVFS_sys_op_id *op_id_array; - int i,j, greq_count, completed_count=0; - int *error_array; - - aio_reqlist = (ADIOI_AIO_Request **)array_of_states; - - op_id_array = (PVFS_sys_op_id*)ADIOI_Calloc(count, sizeof(PVFS_sys_op_id)); - error_array = (int *)ADIOI_Calloc(count, sizeof(int)); - greq_count = count; - - - /* PVFS-2.6: testsome actually tests all requests and fills in op_id_array - * with the ones that have completed. count is an in/out parameter. - * returns with the number of completed operations. what a mess! */ - while (completed_count < greq_count ) { - count = greq_count; - PVFS_sys_testsome(op_id_array, &count, NULL, error_array, INT_MAX); - completed_count += count; - for (i=0; i< count; i++) { - for (j=0; jop_id) { - aio_reqlist[j]->nbytes = - aio_reqlist[j]->resp_io.total_completed; - MPI_Grequest_complete(aio_reqlist[j]->req); - } - } - } - } - return MPI_SUCCESS; /* TODO: no idea how to deal with errors */ -} - - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_close.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_close.c deleted file mode 100644 index 847dd8341cd..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_close.c +++ /dev/null @@ -1,28 +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_pvfs2.h" - -void ADIOI_PVFS2_Close(ADIO_File fd, int *error_code) -{ - ADIOI_Free(fd->fs_ptr); - fd->fs_ptr = NULL; - /* PVFS2 doesn't have a 'close', but MPI-IO semantics dictate that we - * ensure all data has been flushed. - */ - - /* At some point or another it was decided that ROMIO would not - * explicitly flush (other than any local cache) on close, because - * there is no way to *avoid* that overhead if you implement it here - * and don't actually want it. - */ - - *error_code = MPI_SUCCESS; -} -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_common.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_common.c deleted file mode 100644 index ccd3c1916c6..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_common.c +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_pvfs2.h" -#include "ad_pvfs2_common.h" -#include -#include -#include -#include - -/* maybe give romio access to the globalconfig struct */ -/* keyval hack to both tell us if we've already initialized pvfs2 and also - * close it down when mpi exits */ -int ADIOI_PVFS2_Initialized = MPI_KEYVAL_INVALID; - -void ADIOI_PVFS2_End(int *error_code) -{ - int ret; - static char myname[] = "ADIOI_PVFS2_END"; - - ret = PVFS_sys_finalize(); - - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0 ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_finalize", 0); - return; - } - /* --END ERROR HANDLING-- */ - - *error_code = MPI_SUCCESS; -} - -int ADIOI_PVFS2_End_call(MPI_Comm comm, int keyval, - void *attribute_val, void *extra_state) -{ - int error_code; - ADIOI_PVFS2_End(&error_code); - MPI_Keyval_free(&keyval); - return error_code; -} - -void ADIOI_PVFS2_Init(int *error_code ) -{ - int ret; - static char myname[] = "ADIOI_PVFS2_INIT"; - char * ncache_timeout; - - /* do nothing if we've already fired up the pvfs2 interface */ - if (ADIOI_PVFS2_Initialized != MPI_KEYVAL_INVALID) { - *error_code = MPI_SUCCESS; - return; - } - - /* for consistency, we should disable the pvfs2 ncache. If the - * environtment variable is already set, assume a user knows it - * won't be a problem */ - ncache_timeout = getenv("PVFS2_NCACHE_TIMEOUT"); - if (ncache_timeout == NULL ) - setenv("PVFS2_NCACHE_TIMEOUT", "0", 1); - - ret = PVFS_util_init_defaults(); - if (ret < 0 ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_util_init_defaults", - 0); - PVFS_perror("PVFS_util_init_defaults", ret); - - return; - } - - MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_PVFS2_End_call, - &ADIOI_PVFS2_Initialized, (void *)0); - /* just like romio does, we make a dummy attribute so we - * get cleaned up */ - MPI_Attr_put(MPI_COMM_SELF, ADIOI_PVFS2_Initialized, (void *)0); -} - -void ADIOI_PVFS2_makeattribs(PVFS_sys_attr * attribs) -{ - memset(attribs, 0, sizeof(PVFS_sys_attr)); - - attribs->owner = geteuid(); - attribs->group = getegid(); - attribs->perms = 0644; - attribs->mask = PVFS_ATTR_SYS_ALL_SETABLE; - attribs->atime = time(NULL); - attribs->mtime = attribs->atime; - attribs->ctime = attribs->atime; -} - - -void ADIOI_PVFS2_makecredentials(PVFS_credentials * credentials) -{ - memset(credentials, 0, sizeof(PVFS_credentials)); - - PVFS_util_gen_credentials(credentials); -} - -int ADIOI_PVFS2_error_convert(int pvfs_error) -{ - switch(pvfs_error) - { - case PVFS_EPERM: - case PVFS_EACCES: - return MPI_ERR_ACCESS; - case PVFS_ENOENT: - case PVFS_ENXIO: - case PVFS_ENODEV: - return MPI_ERR_NO_SUCH_FILE; - case PVFS_EIO: - return MPI_ERR_IO; - case PVFS_EEXIST: - return MPI_ERR_FILE_EXISTS; - case PVFS_ENOTDIR: /* ??? */ - case PVFS_EISDIR: /* ??? */ - case PVFS_ENAMETOOLONG: - return MPI_ERR_BAD_FILE; - case PVFS_EINVAL: - return MPI_ERR_FILE; - case PVFS_EFBIG: /* ??? */ - case PVFS_ENOSPC: - return MPI_ERR_NO_SPACE; - case PVFS_EROFS: - return MPI_ERR_READ_ONLY; - case PVFS_ENOSYS: - return MPI_ERR_UNSUPPORTED_OPERATION; - /* PVFS does not support quotas */ - case EDQUOT: - return MPI_ERR_QUOTA; - case PVFS_ENOMEM: - return MPI_ERR_INTERN; - default: - return MPI_UNDEFINED; - } - -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_common.h b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_common.h deleted file mode 100644 index f63f84a27bd..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_common.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#ifndef _AD_PVFS2_COMMON_H -#define _AD_PVFS2_COMMON_H -#include "ad_pvfs2.h" - -/* useful values: - * 0: no debugging - * CLIENT_DEBUG: debug client state machines - */ -#define ADIOI_PVFS2_DEBUG_MASK 0 - - -struct ADIOI_PVFS2_fs_s { - PVFS_object_ref object_ref; - PVFS_credentials credentials; -} ADIOI_PVFS2_fs_s; - -typedef struct ADIOI_PVFS2_fs_s ADIOI_PVFS2_fs; - - -void ADIOI_PVFS2_Init(int *error_code ); -void ADIOI_PVFS2_makeattribs(PVFS_sys_attr * attribs); -void ADIOI_PVFS2_makecredentials(PVFS_credentials * credentials); -void ADIOI_PVFS2_End(int *error_code); -int ADIOI_PVFS2_End_call(MPI_Comm comm, int keyval, - void *attribute_val, void *extra_state); -int ADIOI_PVFS2_error_convert(int pvfs_error); - -#endif diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_delete.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_delete.c deleted file mode 100644 index f5770bb393c..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_delete.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_pvfs2.h" -#include "adio.h" - -#include "ad_pvfs2_common.h" - -void ADIOI_PVFS2_Delete(const char *filename, int *error_code) -{ - PVFS_credentials credentials; - PVFS_sysresp_getparent resp_getparent; - int ret; - PVFS_fs_id cur_fs; - static char myname[] = "ADIOI_PVFS2_DELETE"; - char pvfs_path[PVFS_NAME_MAX] = {0}; - - ADIOI_PVFS2_Init(error_code); - /* --BEGIN ERROR HANDLING-- */ - if (*error_code != MPI_SUCCESS) - { - /* ADIOI_PVFS2_INIT handles creating error codes itself */ - return; - } - /* --END ERROR HANDLING-- */ - - /* in most cases we'll store the credentials in the fs struct, but we don't - * have one of those in Delete */ - ADIOI_PVFS2_makecredentials(&credentials); - - /* given the filename, figure out which pvfs filesystem it is on */ - ret = PVFS_util_resolve(filename, &cur_fs, pvfs_path, PVFS_NAME_MAX); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_util_resolve", 0); - return; - } - /* --END ERROR HANDLING-- */ - - ret = PVFS_sys_getparent(cur_fs, pvfs_path, &credentials, &resp_getparent); - - ret = PVFS_sys_remove(resp_getparent.basename, - resp_getparent.parent_ref, &credentials); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_remove", 0); - return; - } - /* --END ERROR HANDLING-- */ - - *error_code = MPI_SUCCESS; - return; -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_fcntl.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_fcntl.c deleted file mode 100644 index e07291f7575..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_fcntl.c +++ /dev/null @@ -1,59 +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_pvfs2.h" -#include "adio_extern.h" -#include "ad_pvfs2_common.h" - -void ADIOI_PVFS2_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code) -{ - int ret; - ADIOI_PVFS2_fs *pvfs_fs; - PVFS_sysresp_getattr resp_getattr; - static char myname[] = "ADIOI_PVFS2_FCNTL"; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - switch(flag) { - case ADIO_FCNTL_GET_FSIZE: - ret = PVFS_sys_getattr(pvfs_fs->object_ref, PVFS_ATTR_SYS_SIZE, - &(pvfs_fs->credentials), &resp_getattr); - if (ret != 0 ) { - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_getattr", 0); - /* --END ERROR HANDLING-- */ - } - else { - *error_code = MPI_SUCCESS; - } - fcntl_struct->fsize = resp_getattr.attr.size; - return; - - case ADIO_FCNTL_SET_DISKSPACE: - ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code); - break; - - /* --BEGIN ERROR HANDLING-- */ - 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); - /* --END ERROR HANDLING-- */ - } -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_features.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_features.c deleted file mode 100644 index 89a82c129fe..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_features.c +++ /dev/null @@ -1,23 +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_pvfs2.h" - -int ADIOI_PVFS2_Feature(ADIO_File fd, int flag) -{ - switch(flag) { - case ADIO_SCALABLE_OPEN: - case ADIO_SCALABLE_RESIZE: - return 1; - 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_pvfs2/ad_pvfs2_flush.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_flush.c deleted file mode 100644 index 18061084a85..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_flush.c +++ /dev/null @@ -1,55 +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_pvfs2.h" -#include "ad_pvfs2_common.h" - -/* we want to be a bit clever here: at scale, if every client sends a - * flush request, it will stress the PVFS2 servers with redundant - * PVFS_sys_flush requests. Instead, one process should wait for - * everyone to catch up, do the sync, then broadcast the result. We can - * get away with this thanks to PVFS2's stateless design - */ - -void ADIOI_PVFS2_Flush(ADIO_File fd, int *error_code) -{ - int ret, rank, dummy=0, dummy_in=0; - ADIOI_PVFS2_fs *pvfs_fs; - static char myname[] = "ADIOI_PVFS2_FLUSH"; - - *error_code = MPI_SUCCESS; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - MPI_Comm_rank(fd->comm, &rank); - - - /* unlike ADIOI_PVFS2_Resize, MPI_File_sync() does not perform any - * syncronization */ - MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, - fd->hints->ranklist[0], fd->comm); - - /* io_worker computed in ADIO_Open */ - if (rank == fd->hints->ranklist[0]) { - ret = PVFS_sys_flush(pvfs_fs->object_ref, &(pvfs_fs->credentials)); - } - MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_flush", 0); - } - /* --END ERROR HANDLING-- */ -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_hints.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_hints.c deleted file mode 100644 index 47522064e30..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_hints.c +++ /dev/null @@ -1,120 +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 -#include "ad_pvfs2.h" - -#include "hint_fns.h" - -void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) -{ - char *value; - int flag, tmp_value; - static char myname[] = "ADIOI_PVFS_SETINFO"; - - if ((fd->info) == MPI_INFO_NULL) { - /* part of the open call */ - MPI_Info_create(&(fd->info)); - ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", "0"); - fd->hints->fs_hints.pvfs2.debugmask = 0; - - ADIOI_Info_set(fd->info, "striping_factor", "0"); - fd->hints->striping_factor = 0; - - ADIOI_Info_set(fd->info, "striping_unit", "0"); - fd->hints->striping_unit = 0; - - /* disable the aggressive strided optimizations by default */ - ADIOI_Info_set(fd->info, "romio_pvfs2_posix_read", "disable"); - ADIOI_Info_set(fd->info, "romio_pvfs2_posix_write", "disable"); - fd->hints->fs_hints.pvfs2.posix_read = ADIOI_HINT_DISABLE; - fd->hints->fs_hints.pvfs2.posix_write = ADIOI_HINT_DISABLE; - - ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_read", "disable"); - ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_write", "disable"); - fd->hints->fs_hints.pvfs2.dtype_read = ADIOI_HINT_DISABLE; - fd->hints->fs_hints.pvfs2.dtype_write = ADIOI_HINT_DISABLE; - - ADIOI_Info_set(fd->info, "romio_pvfs2_listio_read", "disable"); - ADIOI_Info_set(fd->info, "romio_pvfs2_listio_write", "disable"); - fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_DISABLE; - fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_DISABLE; - - - /* any user-provided hints? */ - if (users_info != MPI_INFO_NULL) { - value = (char *) ADIOI_Malloc( (MPI_MAX_INFO_VAL+1)*sizeof(char)); - /* pvfs2 debugging */ - ADIOI_Info_get(users_info, "romio_pvfs2_debugmask", - MPI_MAX_INFO_VAL, value, &flag); - if (flag) { - tmp_value = fd->hints->fs_hints.pvfs2.debugmask = - PVFS_debug_eventlog_to_mask(value); - - MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm); - /* --BEGIN ERROR HANDLING-- */ - if (tmp_value != fd->hints->fs_hints.pvfs2.debugmask) { - MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname, - "romio_pvfs2_debugmask", - error_code); - return; - } - /* --END ERROR HANDLING-- */ - - ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", value); - } - - /* the striping factor */ - ADIOI_Info_check_and_install_int(fd, users_info, "striping_factor", - &(fd->hints->striping_factor), myname, error_code); - - - /* the striping unit */ - ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit", - &(fd->hints->striping_unit), myname, error_code); - - /* distribution name */ - ADIOI_Info_get(users_info, "romio_pvfs2_distribution_name", - MPI_MAX_INFO_VAL, value, &flag); - if (flag) { - } - - /* POSIX read */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_posix_read", - &(fd->hints->fs_hints.pvfs2.posix_read), myname, error_code); - - /* POSIX write */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_posix_write", - &(fd->hints->fs_hints.pvfs2.posix_write), myname, error_code); - - /* Datatype read */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_dtype_read", - &(fd->hints->fs_hints.pvfs2.dtype_read), myname, error_code); - - /* Datatype write */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_dtype_write", - &(fd->hints->fs_hints.pvfs2.dtype_write), myname, error_code); - - /* Listio read */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_listio_read", - &(fd->hints->fs_hints.pvfs2.listio_read), myname, error_code); - - /* Datatype write */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_listio_write", - &(fd->hints->fs_hints.pvfs2.listio_write), myname, error_code); - 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; -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io.h b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io.h deleted file mode 100644 index aefe0653ecb..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2006 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -/* Contig I/O helper prototypes */ - -#define READ 0 -#define WRITE 1 - -/* #define DEBUG_CONTIG */ -/* #define DEBUG_LIST */ -/* #define DEBUG_DTYPE */ - -/* Contig I/O helper prototypes */ -int ADIOI_PVFS2_Contig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code, int rw_type); - -/* List I/O helper prototypes */ -int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code, int rw_type); - -int gen_listio_arr(ADIOI_Flatlist_node *flat_buf, - int *flat_buf_index_p, - int64_t *cur_flat_buf_reg_off_p, - int flat_buf_size, - int flat_buf_extent, - ADIOI_Flatlist_node *flat_file, - int *flat_file_index_p, - int64_t *cur_flat_file_reg_off_p, - int flat_file_size, - int flat_file_extent, - int max_ol_count, - ADIO_Offset disp, - int bytes_into_filetype, - int64_t *bytes_completed, - int64_t total_io_size, - int64_t buf_off_arr[], - int32_t buf_len_arr[], - int32_t *buf_ol_count_p, - int64_t file_off_arr[], - int32_t file_len_arr[], - int32_t *file_ol_count_p); - -void print_buf_file_ol_pairs(int64_t buf_off_arr[], - int32_t buf_len_arr[], - int32_t buf_ol_count, - int64_t file_off_arr[], - int32_t file_len_arr[], - int32_t file_ol_count, - void *buf, - int rw_type); - -/* Datatype I/O helper prototypes */ -int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code, int rw_type); - -int convert_named(MPI_Datatype *mpi_dtype, - PVFS_Request *pvfs_dtype, int combiner); - -void print_dtype_info(int combiner, - int num_int, - int num_addr, - int num_dtype, - int *arr_int, - MPI_Aint *arr_addr, - MPI_Datatype *arr_dtype); - -int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, - PVFS_Request *pvfs_dtype); - diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io_dtype.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io_dtype.c deleted file mode 100644 index 02219293cad..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io_dtype.c +++ /dev/null @@ -1,739 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2006 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include -#include "adio.h" -#include "adio_extern.h" -#include "ad_pvfs2.h" -#include "ad_pvfs2_io.h" -#include "ad_pvfs2_common.h" - -int ADIOI_PVFS2_StridedDtypeIO(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code, - int rw_type) -{ - int ret = -1, filetype_is_contig = -1; - MPI_Count filetype_size = -1; - int num_filetypes = 0, cur_flat_file_reg_off = 0; - PVFS_Request tmp_mem_req, mem_req, tmp_file_req, file_req; - PVFS_sysresp_io resp_io; - ADIO_Offset off = -1, bytes_into_filetype = 0; - MPI_Aint filetype_extent = -1, filetype_lb = -1; - int i = -1; - MPI_Count etype_size; - PVFS_size pvfs_disp = -1; - ADIOI_Flatlist_node *flat_file_p = ADIOI_Flatlist; - - /* Use for offseting the PVFS2 filetype */ - int pvfs_blk = 1; - ADIOI_PVFS2_fs *pvfs_fs; - static char myname[] = "ADIOI_PVFS2_STRIDED_DTYPE"; - - memset(&tmp_mem_req, 0, sizeof(PVFS_Request)); - memset(&mem_req, 0, sizeof(PVFS_Request)); - memset(&tmp_file_req, 0, sizeof(PVFS_Request)); - memset(&file_req, 0, sizeof(PVFS_Request)); - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - - /* changed below if error */ - *error_code = MPI_SUCCESS; - - /* datatype is the memory type - * fd->filetype is the file type */ - MPI_Type_size_x(fd->filetype, &filetype_size); - if (filetype_size == 0) { - *error_code = MPI_SUCCESS; - return -1; - } - MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent); - MPI_Type_size_x(fd->etype, &etype_size); - if (filetype_size == 0) { - *error_code = MPI_SUCCESS; - return -1; - } - - /* offset is in units of etype relative to the filetype. We - * convert this to off in terms of actual data bytes (the offset - * minus the number of bytes that are not used). We are allowed - * to do this since PVFS2 handles offsets with respect to a - * file_req in bytes, otherwise we would have to convert into a - * pure byte offset as is done in other methods. Explicit offset - * case is handled by using fd->disp and byte-converted off. */ - - pvfs_disp = fd->disp; - if (file_ptr_type == ADIO_INDIVIDUAL) - { - if (filetype_is_contig) - { - off = fd->fp_ind - fd->disp; - } - else - { - int flag = 0; - /* Should have already been flattened in ADIO_Open*/ - while (flat_file_p->type != fd->filetype) - { - flat_file_p = flat_file_p->next; - } - num_filetypes = -1; - while (!flag) - { - num_filetypes++; - for (i = 0; i < flat_file_p->count; i++) - { - /* Start on a non zero-length region */ - if (flat_file_p->blocklens[i]) - { - if (fd->disp + flat_file_p->indices[i] + - (num_filetypes * filetype_extent) + - flat_file_p->blocklens[i] > fd->fp_ind && - fd->disp + flat_file_p->indices[i] <= - fd->fp_ind) - { - cur_flat_file_reg_off = fd->fp_ind - - (fd->disp + flat_file_p->indices[i] + - (num_filetypes * filetype_extent)); - flag = 1; - break; - } - else - bytes_into_filetype += flat_file_p->blocklens[i]; - } - } - } - /* Impossible that we don't find it in this datatype */ - assert(i != flat_file_p->count); - off = bytes_into_filetype + cur_flat_file_reg_off; - } - } - else /* ADIO_EXPLICIT */ - { - off = etype_size * offset; - } - -#ifdef DEBUG_DTYPE - fprintf(stderr, "ADIOI_PVFS2_StridedDtypeIO: (fd->fp_ind=%Ld,fd->disp=%Ld," - " offset=%Ld),(pvfs_disp=%Ld,off=%Ld)\n", - fd->fp_ind, fd->disp, offset, pvfs_disp, off); -#endif - - - /* Convert the MPI memory and file datatypes into - * PVFS2 datatypes */ - ret = convert_mpi_pvfs2_dtype(&datatype, &tmp_mem_req); - if (ret < 0) - { - goto error_state; - } - ret = convert_mpi_pvfs2_dtype(&(fd->filetype), &tmp_file_req); - if (ret < 0) - { - goto error_state; - } - - ret = PVFS_Request_contiguous(count, tmp_mem_req, &mem_req); - if (ret != 0) /* TODO: convert this to MPIO error handling */ - fprintf(stderr, "ADIOI_PVFS2_stridedDtypeIO: error in final" - " CONTIG memory type\n"); - PVFS_Request_free(&tmp_mem_req); - - /* pvfs_disp is used to offset the filetype */ - ret = PVFS_Request_hindexed(1, &pvfs_blk, &pvfs_disp, - tmp_file_req, &file_req); - if (ret != 0) - fprintf(stderr, "ADIOI_PVFS2_StridedDtypeIO: error in final" - " HINDEXED file type\n"); - PVFS_Request_free(&tmp_file_req); - - if (rw_type == READ) - ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, off, buf, - mem_req, &(pvfs_fs->credentials), &resp_io); - else - ret = PVFS_sys_write(pvfs_fs->object_ref, file_req, off, buf, - mem_req, &(pvfs_fs->credentials), &resp_io); - - if (ret != 0) { - fprintf(stderr, "ADIOI_PVFS2_StridedDtypeIO: Warning - PVFS_sys_" - "read/write returned %d and completed %Ld bytes.\n", - ret, (long long)resp_io.total_completed); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_io \n", 0); - goto error_state; - } - - if (file_ptr_type == ADIO_INDIVIDUAL) - { - fd->fp_ind = off += resp_io.total_completed; - } - - error_state: - fd->fp_sys_posn = -1; /* set it to null. */ - - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - -#ifdef DEBUG_DTYPE - fprintf(stderr, "ADIOI_PVFS2_StridedDtypeIO: " - "resp_io.total_completed=%Ld,ret=%d\n", - resp_io.total_completed, ret); -#endif - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, resp_io.total_completed); - /* This is a temporary way of filling in status. The right way is to - * keep track of how much data was actually acccessed by - * ADIOI_BUFFERED operations */ -#endif - return ret; -} - -/* convert_mpi_pvfs2_dtype - Convert a MPI datatype into - * a PVFS2 datatype so that we can natively use the PVFS2 - * datatypes in the PVFS2 I/O calls instead of converting - * all datatypes to the hindexed method - * return 1 - a leaf node - * return 0 - normal return - * return -1 - problems */ - -int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype, - PVFS_Request *pvfs_dtype) -{ - int num_int = -1, num_addr = -1, num_dtype = -1, - combiner = -1, i = -1, ret = -1, leaf = -1; - int *arr_int = NULL; - MPI_Aint *arr_addr = NULL; - MPI_Datatype *arr_dtype = NULL; - PVFS_Request *old_pvfs_dtype = NULL; - PVFS_Request *old_pvfs_dtype_arr = NULL; - int arr_count = -1; - PVFS_size *pvfs_arr_disp = NULL; - int *pvfs_arr_len = NULL; - - MPI_Type_get_envelope(*mpi_dtype, - &num_int, - &num_addr, - &num_dtype, - &combiner); - - /* Depending on type of datatype do the following - * operations */ - - if (combiner == MPI_COMBINER_NAMED) - { - convert_named(mpi_dtype, pvfs_dtype, combiner); - return 1; - } - - /* Allocate space for the arrays necessary for - * MPI_Type_get_contents */ - - if ((arr_int = ADIOI_Malloc(sizeof(int)*num_int)) == NULL) - { - fprintf(stderr, "Failed to allocate array_int\n"); - return -1; - } - if ((arr_addr = ADIOI_Malloc(sizeof(int)*num_addr)) == NULL) - { - ADIOI_Free(arr_int); - fprintf(stderr, "Failed to allocate array_addr\n"); - return -1; - } - if ((arr_dtype = ADIOI_Malloc(sizeof(MPI_Datatype)*num_dtype)) == NULL) - { - ADIOI_Free(arr_int); - ADIOI_Free(arr_addr); - fprintf(stderr, "Failed to allocate array_dtypes\n"); - return -1; - } - - MPI_Type_get_contents(*mpi_dtype, - num_int, - num_addr, - num_dtype, - arr_int, - arr_addr, - arr_dtype); - - /* If it's not a predefined datatype, it is either a - * derived datatype or a structured datatype */ - - if (combiner != MPI_COMBINER_STRUCT) - { - if ((old_pvfs_dtype = ADIOI_Malloc(sizeof(PVFS_Request))) == NULL) - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate PVFS_Request\n"); - switch (combiner) - { - case MPI_COMBINER_CONTIGUOUS: - leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - ret = PVFS_Request_contiguous(arr_int[0], - *old_pvfs_dtype, pvfs_dtype); - break; - case MPI_COMBINER_VECTOR: - leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - ret = PVFS_Request_vector(arr_int[0], arr_int[1], - arr_int[2], *old_pvfs_dtype, - pvfs_dtype); - break; - case MPI_COMBINER_HVECTOR: - leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - ret = PVFS_Request_hvector(arr_int[0], arr_int[1], - arr_addr[0], *old_pvfs_dtype, - pvfs_dtype); - break; - /* Both INDEXED and HINDEXED types require PVFS_size - * address arrays. Therefore, we need to copy and - * convert the data from MPI_get_contents() into - * a PVFS_size buffer */ - case MPI_COMBINER_INDEXED: - leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - if ((pvfs_arr_disp = - ADIOI_Malloc(arr_int[0]*sizeof(PVFS_size))) == 0) - { - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate pvfs_arr_disp\n"); - } - for (i = 0; i < arr_int[0]; i++) - { - pvfs_arr_disp[i] = - (PVFS_size) arr_int[arr_int[0]+1+i]; - } - ret = PVFS_Request_indexed(arr_int[0], &arr_int[1], - pvfs_arr_disp, - *old_pvfs_dtype, pvfs_dtype); - ADIOI_Free(pvfs_arr_disp); - break; - case MPI_COMBINER_HINDEXED: - leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - if ((pvfs_arr_disp = - ADIOI_Malloc(arr_int[0]*sizeof(PVFS_size))) == 0) - { - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate pvfs_arr_disp\n"); - } - for (i = 0; i < arr_int[0]; i++) - { - pvfs_arr_disp[i] = - (PVFS_size) arr_addr[i]; - } - ret = PVFS_Request_hindexed(arr_int[0], &arr_int[1], - (int64_t *)&arr_addr[0], - *old_pvfs_dtype, pvfs_dtype); - ADIOI_Free(pvfs_arr_disp); - break; - case MPI_COMBINER_DUP: - leaf = convert_mpi_pvfs2_dtype(&arr_dtype[0], old_pvfs_dtype); - ret = PVFS_Request_contiguous(1, - *old_pvfs_dtype, pvfs_dtype); - - break; - case MPI_COMBINER_INDEXED_BLOCK: - /* No native PVFS2 support for this operation currently */ - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "INDEXED_BLOCK is unsupported\n"); - break; - case MPI_COMBINER_HINDEXED_BLOCK: - /* No native PVFS2 support for this operation currently */ - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "HINDEXED_BLOCK is unsupported\n"); - break; - case MPI_COMBINER_HINDEXED_INTEGER: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "HINDEXED_INTEGER is unsupported\n"); - break; - case MPI_COMBINER_STRUCT_INTEGER: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "STRUCT_INTEGER is unsupported\n"); - break; - case MPI_COMBINER_SUBARRAY: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "SUBARRAY is unsupported\n"); - break; - case MPI_COMBINER_DARRAY: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "DARRAY is unsupported\n"); - break; - case MPI_COMBINER_F90_REAL: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "F90_REAL is unsupported\n"); - break; - case MPI_COMBINER_F90_COMPLEX: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "F90_COMPLEX is unsupported\n"); - break; - case MPI_COMBINER_F90_INTEGER: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "F90_INTEGER is unsupported\n"); - break; - case MPI_COMBINER_RESIZED: - ADIOI_Free(old_pvfs_dtype); - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "RESIZED is unsupported\n"); - break; - default: - break; - } - - if (ret != 0) - fprintf(stderr, "Error in PVFS_Request_* " - "for a derived datatype\n"); - -#ifdef DEBUG_DTYPE - print_dtype_info(combiner, - num_int, - num_addr, - num_dtype, - arr_int, - arr_addr, - arr_dtype); -#endif - - if (leaf != 1 && combiner != MPI_COMBINER_DUP) - MPI_Type_free(&arr_dtype[0]); - - ADIOI_Free(arr_int); - ADIOI_Free(arr_addr); - ADIOI_Free(arr_dtype); - - PVFS_Request_free(old_pvfs_dtype); - ADIOI_Free(old_pvfs_dtype); - - return ret; - } - else /* MPI_COMBINER_STRUCT */ - { - MPI_Aint mpi_lb = -1, mpi_extent = -1; - PVFS_offset pvfs_lb = -1; - PVFS_size pvfs_extent = -1; - int has_lb_ub = 0; - - /* When converting into a PVFS_Request_struct, we no longer - * can use MPI_LB and MPI_UB. Therfore, we have to do the - * following. - * We simply ignore all the MPI_LB and MPI_UB types and - * get the lb and extent and pass it on through a - * PVFS resized_req */ - - arr_count = 0; - for (i = 0; i < arr_int[0]; i++) - { - if (arr_dtype[i] != MPI_LB && - arr_dtype[i] != MPI_UB) - { - arr_count++; - } - } - - if (arr_int[0] != arr_count) - { - MPI_Type_get_extent(*mpi_dtype, &mpi_lb, &mpi_extent); - pvfs_lb = mpi_lb; - pvfs_extent = mpi_extent; - if ((pvfs_arr_len = ADIOI_Malloc(arr_count*sizeof(int))) - == NULL) - { - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate pvfs_arr_len\n"); - } - has_lb_ub = 1; - } - - if ((old_pvfs_dtype_arr - = ADIOI_Malloc(arr_count*sizeof(PVFS_Request))) == NULL) - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate PVFS_Requests\n"); - - if ((pvfs_arr_disp = ADIOI_Malloc(arr_count*sizeof(PVFS_size))) - == NULL) - { - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate pvfs_arr_disp\n"); - } - - arr_count = 0; - for (i = 0; i < arr_int[0]; i++) - { - if (arr_dtype[i] != MPI_LB && - arr_dtype[i] != MPI_UB) - { - leaf = convert_mpi_pvfs2_dtype( - &arr_dtype[i], &old_pvfs_dtype_arr[arr_count]); - if (leaf != 1) - MPI_Type_free(&arr_dtype[i]); - pvfs_arr_disp[arr_count] = - (PVFS_size) arr_addr[i]; - if (has_lb_ub) - { - pvfs_arr_len[arr_count] = - arr_int[i+1]; - } - arr_count++; - } - } - - /* If a MPI_UB or MPI_LB did exist, we have to - * resize the datatype */ - if (has_lb_ub) - { - PVFS_Request *tmp_pvfs_dtype = NULL; - if ((tmp_pvfs_dtype = ADIOI_Malloc(sizeof(PVFS_Request))) == NULL) - fprintf(stderr, "convert_mpi_pvfs2_dtype: " - "Failed to allocate PVFS_Request\n"); - - ret = PVFS_Request_struct(arr_count, pvfs_arr_len, - pvfs_arr_disp, - old_pvfs_dtype_arr, tmp_pvfs_dtype); - if (ret != 0) - fprintf(stderr, "Error in PVFS_Request_struct\n"); - - arr_count = 0; - for (i = 0; i < arr_int[0]; i++) - { - if (arr_dtype[i] != MPI_LB && - arr_dtype[i] != MPI_UB) - { - PVFS_Request_free(&old_pvfs_dtype_arr[arr_count]); - arr_count++; - } - } - -#ifdef DEBUG_DTYPE - fprintf(stderr, "STRUCT(WITHOUT %d LB or UB)(%d,[", - arr_int[0] - arr_count, arr_count); - for (i = 0; i < arr_count; i++) - fprintf(stderr, "(%d,%Ld) ", - pvfs_arr_len[i], - pvfs_arr_disp[i]); - fprintf(stderr, "]\n"); - fprintf(stderr, "RESIZED(LB = %Ld, EXTENT = %Ld)\n", - pvfs_lb, pvfs_extent); -#endif - ret = PVFS_Request_resized(*tmp_pvfs_dtype, - pvfs_lb, pvfs_extent, pvfs_dtype); - if (ret != 0) - fprintf(stderr, "Error in PVFS_Request_resize\n"); - - PVFS_Request_free(tmp_pvfs_dtype); - ADIOI_Free(tmp_pvfs_dtype); - } - else /* No MPI_LB or MPI_UB datatypes */ - { - ret = PVFS_Request_struct(arr_int[0], &arr_int[1], - pvfs_arr_disp, - old_pvfs_dtype_arr, pvfs_dtype); - if (ret != 0) - fprintf(stderr, "Error in PVFS_Request_struct\n"); - - for (i = 0; i < arr_int[0]; i++) - { - if (arr_dtype[i] != MPI_LB && - arr_dtype[i] != MPI_UB) - PVFS_Request_free(&old_pvfs_dtype_arr[i]); - } - -#ifdef DEBUG_DTYPE - print_dtype_info(combiner, - num_int, - num_addr, - num_dtype, - arr_int, - arr_addr, - arr_dtype); -#endif - } - - ADIOI_Free(arr_int); - ADIOI_Free(arr_addr); - ADIOI_Free(arr_dtype); - - ADIOI_Free(old_pvfs_dtype_arr); - ADIOI_Free(pvfs_arr_disp); - ADIOI_Free(pvfs_arr_len); - - return ret; - } - - /* Shouldn't have gotten here */ - fprintf(stderr, "convert_mpi_pvfs2_dtype: SERIOUS ERROR\n"); - return -1; -} - -int convert_named(MPI_Datatype *mpi_dtype, - PVFS_Request *pvfs_dtype, int combiner) -{ - int ret = -1; -#ifdef DEBUG_DTYPE - fprintf(stderr, "NAMED"); -#endif - - if (MPI_CHAR == *mpi_dtype) - { - ret = PVFS_Request_contiguous(1, PVFS_CHAR, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_CHAR\n"); -#endif - } - else if ( MPI_BYTE == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_BYTE, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_BYTE\n"); -#endif - } - else if ( MPI_SHORT == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_SHORT, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_SHORT\n"); -#endif - } - else if ( MPI_INT == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_INT, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_INT\n"); -#endif - } - else if ( MPI_LONG == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_LONG, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_LONG\n"); -#endif - } - else if ( MPI_FLOAT == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_FLOAT, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_FLOAT\n"); -#endif - } - else if ( MPI_DOUBLE == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_DOUBLE, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_DOUBLE\n"); -#endif - } - else if ( MPI_UNSIGNED_CHAR == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED_CHAR, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_UNSIGNED_CHAR\n"); -#endif - } - else if ( MPI_UNSIGNED_SHORT == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_UNSIGNED_SHORT\n"); -#endif - } - else if ( MPI_UNSIGNED == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_SHORT\n"); -#endif - } - else if ( MPI_UNSIGNED_LONG == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_UNSIGNED_LONG, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_UNSIGNED_LONG\n"); -#endif - } - else if ( MPI_LONG_DOUBLE == *mpi_dtype ) - { - ret = PVFS_Request_contiguous(1, PVFS_LONG_DOUBLE, pvfs_dtype); -#ifdef DEBUG_DTYPE - fprintf(stderr, "-MPI_LONG_DOUBLE\n"); -#endif - } - else - { - fprintf(stderr, "convert_named: predefined type not found"); - return -1; - } - if (ret != 0) - fprintf(stderr, "convert_named: Datatype creation failed\n"); - return ret; -} - -void print_dtype_info(int combiner, - int num_int, - int num_addr, - int num_dtype, - int *arr_int, - MPI_Aint *arr_addr, - MPI_Datatype *arr_dtype) -{ - int i = -1; - switch (combiner) - { - case MPI_COMBINER_CONTIGUOUS: - fprintf(stderr, "CONTIG(%d)\n", arr_int[0]); - break; - case MPI_COMBINER_VECTOR: - fprintf(stderr, "VECTOR(%d,%d,%d)\n", - arr_int[0], arr_int[1], arr_int[2]); - break; - case MPI_COMBINER_HVECTOR: - fprintf(stderr, "HVECTOR(%d,%d,%ld)\n", - arr_int[0], arr_int[1],arr_addr[0]); - break; - case MPI_COMBINER_INDEXED: - fprintf(stderr, "INDEXED(%d,[", - arr_int[0]); - for (i = 0; i < arr_int[0]; i++) - fprintf(stderr, "(%d,%d) ", - arr_int[1+i], - arr_int[arr_int[0]+1+i]); - fprintf(stderr, "]\n"); - break; - case MPI_COMBINER_HINDEXED: - fprintf(stderr, "HINDEXED(%d,[", - arr_int[0]); - for (i = 0; i < arr_int[0]; i++) - fprintf(stderr, "(%d,%lld) ", - arr_int[1+i], - (long long)arr_addr[i]); - fprintf(stderr, "]\n"); - break; - case MPI_COMBINER_STRUCT: - fprintf(stderr, "STRUCT(%d,[", - arr_int[0]); - for (i = 0; i < arr_int[0]; i++) - fprintf(stderr, "(%d,%lld) ", - arr_int[1+i], - (long long) arr_addr[i]); - fprintf(stderr, "]\n"); - break; - case MPI_COMBINER_DUP: - fprintf(stderr, "DUP\n"); - break; - default: - fprintf(stderr, "no available information on this datatype"); - } -} diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io_list.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io_list.c deleted file mode 100644 index a88aaf39faa..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_io_list.c +++ /dev/null @@ -1,660 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2006 Unknown (TODO: fix this) - */ - -#include -#include "adio.h" -#include "adio_extern.h" -#include "ad_pvfs2.h" -#include "ad_pvfs2_io.h" -#include "ad_pvfs2_common.h" - -#define COALESCE_REGIONS /* TODO: would we ever want to *not* coalesce? */ -#define MAX_OL_COUNT 64 -int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code, int rw_type) -{ - /* list I/O parameters */ - int i = -1, ret = -1; - int tmp_filetype_size = -1; - int64_t cur_io_size = 0, io_size = 0; - int etype_size = -1; - int num_etypes_in_filetype = -1, num_filetypes = -1; - int etypes_in_filetype = -1, size_in_filetype = -1; - int bytes_into_filetype = 0; - MPI_Offset total_bytes_accessed = 0; - - /* parameters for offset-length pairs arrays */ - int64_t buf_off_arr[MAX_OL_COUNT]; - int32_t buf_len_arr[MAX_OL_COUNT]; - int64_t file_off_arr[MAX_OL_COUNT]; - int32_t file_len_arr[MAX_OL_COUNT]; - int32_t buf_ol_count = 0; - int32_t file_ol_count = 0; - - /* parameters for flattened memory and file datatypes*/ - int flat_buf_index = 0; - int flat_file_index = 0; - int64_t cur_flat_buf_reg_off = 0; - int64_t cur_flat_file_reg_off = 0; - ADIOI_Flatlist_node *flat_buf_p, *flat_file_p; - MPI_Count buftype_size = -1, filetype_size = -1; - MPI_Aint filetype_extent = -1, buftype_extent = -1;; - MPI_Aint filetype_lb = -1, buftype_lb = -1;; - int buftype_is_contig = -1, filetype_is_contig = -1; - - /* PVFS2 specific parameters */ - PVFS_Request mem_req, file_req; - ADIOI_PVFS2_fs * pvfs_fs; - PVFS_sysresp_io resp_io; - static char myname[] = "ADIOI_PVFS2_STRIDED_LISTIO"; - - if (fd->atomicity) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "Atomic noncontiguous writes" - " are not supported by PVFS2", 0); - return -1; - } - - MPI_Type_size_x(fd->filetype, &filetype_size); - if (filetype_size == 0) { - *error_code = MPI_SUCCESS; - return -1; - } - 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); - io_size = buftype_size*count; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - /* Flatten the memory datatype - * (file datatype has already been flattened in ADIO open - * unless it is contibuous, then we need to flatten it manually) - * and set the correct buffers for flat_buf and flat_file */ - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - if (buftype_is_contig == 0) - { - flat_buf_p = ADIOI_Flatten_and_find(datatype); - } - else - { - /* flatten and add to the list */ - flat_buf_p = (ADIOI_Flatlist_node *) ADIOI_Malloc - (sizeof(ADIOI_Flatlist_node)); - flat_buf_p->blocklens = (ADIO_Offset*)ADIOI_Malloc(sizeof(ADIO_Offset)); - flat_buf_p->indices = - (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset)); - /* For the buffer, we can optimize the buftype, this is not - * possible with the filetype since it is tiled */ - buftype_size = buftype_size*count; - buftype_extent = buftype_size*count; - flat_buf_p->blocklens[0] = buftype_size; - flat_buf_p->indices[0] = 0; - flat_buf_p->count = 1; - } - if (filetype_is_contig == 0) - { - /* TODO: why does avery say this should already have been - * flattened in Open, but also says contig types don't get - * flattened */ - flat_file_p = ADIOI_Flatten_and_find(fd->filetype); - } - else - { - /* flatten and add to the list */ - flat_file_p = (ADIOI_Flatlist_node *) ADIOI_Malloc - (sizeof(ADIOI_Flatlist_node)); - flat_file_p->blocklens =(ADIO_Offset*)ADIOI_Malloc(sizeof(ADIO_Offset)); - flat_file_p->indices = - (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset)); - flat_file_p->blocklens[0] = filetype_size; - flat_file_p->indices[0] = 0; - flat_file_p->count = 1; - } - - /* Find out where we are in the flattened filetype (the block index, - * how far into the block, and how many bytes_into_filetype) - * If the file_ptr_type == ADIO_INDIVIDUAL we will use disp, fp_ind - * to figure this out (offset should always be zero) - * If file_ptr_type == ADIO_EXPLICIT, we will use disp and offset - * to figure this out. */ - - etype_size = fd->etype_size; - num_etypes_in_filetype = filetype_size / etype_size; - if (file_ptr_type == ADIO_INDIVIDUAL) - { - int flag = 0; - /* Should have already been flattened in ADIO_Open*/ - num_filetypes = -1; - while (!flag) - { - num_filetypes++; - for (i = 0; i < flat_file_p->count; i++) - { - /* Start on a non zero-length region */ - if (flat_file_p->blocklens[i]) - { - if (fd->disp + flat_file_p->indices[i] + - (num_filetypes * filetype_extent) + - flat_file_p->blocklens[i] > fd->fp_ind && - fd->disp + flat_file_p->indices[i] <= - fd->fp_ind) - { - flat_file_index = i; - cur_flat_file_reg_off = fd->fp_ind - - (fd->disp + flat_file_p->indices[i] + - (num_filetypes * filetype_extent)); - flag = 1; - break; - } - else - bytes_into_filetype += flat_file_p->blocklens[i]; - } - } - } - /* Impossible that we don't find it in this datatype */ - assert(i != flat_file_p->count); - } - else - { - num_filetypes = (int) (offset / num_etypes_in_filetype); - etypes_in_filetype = (int) (offset % num_etypes_in_filetype); - size_in_filetype = etypes_in_filetype * etype_size; - - tmp_filetype_size = 0; - for (i=0; icount; i++) { - tmp_filetype_size += flat_file_p->blocklens[i]; - if (tmp_filetype_size > size_in_filetype) - { - flat_file_index = i; - cur_flat_file_reg_off = flat_file_p->blocklens[i] - - (tmp_filetype_size - size_in_filetype); - bytes_into_filetype = offset * filetype_size - - flat_file_p->blocklens[i]; - break; - } - } - } -#ifdef DEBUG_LIST - fprintf(stderr, "ADIOI_PVFS2_StridedListIO: (fd->fp_ind=%Ld,fd->disp=%Ld," - " offset=%Ld)\n(flat_file_index=%d,cur_flat_file_reg_off=%Ld," - "bytes_into_filetype=%d)\n", - fd->fp_ind, fd->disp, offset, flat_file_index, - cur_flat_file_reg_off, bytes_into_filetype); -#endif -#ifdef DEBUG_LIST2 - fprintf(stderr, "flat_buf:\n"); - for (i = 0; i < flat_buf_p->count; i++) - fprintf(stderr, "(offset, length) = (%Ld, %d)\n", - flat_buf_p->indices[i], - flat_buf_p->blocklens[i]); - fprintf(stderr, "flat_file:\n"); - for (i = 0; i < flat_file_p->count; i++) - fprintf(stderr, "(offset, length) = (%Ld, %d)\n", - flat_file_p->indices[i], - flat_file_p->blocklens[i]); -#endif - - /* total data written */ - cur_io_size = 0; - while (cur_io_size != io_size) - { - /* Initialize the temporarily unrolling lists and - * and associated variables */ - buf_ol_count = 0; - file_ol_count = 0; - for (i = 0; i < MAX_OL_COUNT; i++) - { - buf_off_arr[i] = 0; - buf_len_arr[i] = 0; - file_off_arr[i] = 0; - file_len_arr[i] = 0; - } - - /* Generate the offset-length pairs for a - * list I/O operation */ - gen_listio_arr(flat_buf_p, - &flat_buf_index, - &cur_flat_buf_reg_off, - buftype_size, - buftype_extent, - flat_file_p, - &flat_file_index, - &cur_flat_file_reg_off, - filetype_size, - filetype_extent, - MAX_OL_COUNT, - fd->disp, - bytes_into_filetype, - &cur_io_size, - io_size, - buf_off_arr, - buf_len_arr, - &buf_ol_count, - file_off_arr, - file_len_arr, - &file_ol_count); - - assert(buf_ol_count <= MAX_OL_COUNT); - assert(file_ol_count <= MAX_OL_COUNT); -#ifdef DEBUG_LIST2 - print_buf_file_ol_pairs(buf_off_arr, - buf_len_arr, - buf_ol_count, - file_off_arr, - file_len_arr, - file_ol_count, - buf, - rw_type); -#endif -#ifdef DEBUG_LIST2 - do { - int y, z; - fprintf(stderr, "ad_pvfs2_io_list.c::\n"); - for (y = 0; y < buf_ol_count; y++) - { - for (z = 0; z < buf_len_arr[y]; z++) - { - fprintf(stderr, "buf[%d][%d]=%c\n", - y, z, ((char *) buf + buf_off_arr[y])[z]); - } - } - } while (0); -#endif - - /* Run list I/O operation */ - ret = PVFS_Request_hindexed(buf_ol_count, buf_len_arr, - buf_off_arr, PVFS_BYTE, &mem_req); - - ret = PVFS_Request_hindexed(file_ol_count, file_len_arr, - file_off_arr, PVFS_BYTE, &file_req); - if (rw_type == READ) - { - ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, - buf, mem_req, - &(pvfs_fs->credentials), &resp_io); - } - else - { - ret = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, - buf, mem_req, - &(pvfs_fs->credentials), &resp_io); - } - if (ret != 0) - { - fprintf(stderr, "ADIOI_PVFS2_StridedListIO: Warning - PVFS_sys_" - "read/write returned %d and completed %lld bytes.\n", - ret, (long long)resp_io.total_completed); - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_io \n", 0); - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - goto error_state; - } - total_bytes_accessed += resp_io.total_completed; - - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - } - -#ifdef DEBUG_LIST - fprintf(stderr, "ADIOI_PVFS2_StridedListIO: " - "total_bytes_accessed=%Ld,ret=%d\n", - total_bytes_accessed, ret); -#endif - - if (file_ptr_type == ADIO_INDIVIDUAL) - fd->fp_ind += total_bytes_accessed; - *error_code = MPI_SUCCESS; - -error_state: -#ifdef HAVE_STATUS_SET_BYTES - /* TODO: why the cast? */ - MPIR_Status_set_bytes(status, datatype, total_bytes_accessed); -/* 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 == 0) - ADIOI_Delete_flattened(datatype); - else - { - ADIOI_Free(flat_buf_p->blocklens); - ADIOI_Free(flat_buf_p->indices); - ADIOI_Free(flat_buf_p); - } - - if (filetype_is_contig == 0) - ADIOI_Delete_flattened(fd->filetype); - else - { - ADIOI_Free(flat_file_p->blocklens); - ADIOI_Free(flat_file_p->indices); - ADIOI_Free(flat_file_p); - } - - return 0; -} - -/* To do: Fix the code to coalesce the offset-length pairs for memory - * and file. */ - -/* gen_listio_arr - fills in offset-length pairs for memory and file - * for list I/O */ -int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p, - int *flat_buf_index_p, - int64_t *cur_flat_buf_reg_off_p, - int flat_buf_size, - int flat_buf_extent, - ADIOI_Flatlist_node *flat_file_p, - int *flat_file_index_p, - int64_t *cur_flat_file_reg_off_p, - int flat_file_size, - int flat_file_extent, - int max_ol_count, - ADIO_Offset disp, - int bytes_into_filetype, - int64_t *bytes_completed, - int64_t total_io_size, - int64_t buf_off_arr[], - int32_t buf_len_arr[], - int32_t *buf_ol_count_p, - int64_t file_off_arr[], - int32_t file_len_arr[], - int32_t *file_ol_count_p) -{ - int region_size = -1; - - /* parameters for flattened memory and file datatypes*/ - int64_t cur_flat_buf_reg_left = 0; - int64_t cur_flat_file_reg_left = 0; - -#ifdef DEBUG_LIST2 - fprintf(stderr, "gen_list_arr:\n"); -#endif - - if ((*buf_ol_count_p) != 0 ||(*file_ol_count_p) != 0) - { - fprintf(stderr, "buf_ol_count != 0 || file_ol_count != 0\n"); - return -1; - } - - /* Start on a non-zero memory and file region - * Note this does not affect the bytes_completed - * since no data is in these regions. Initialize the - * first memory and file offsets. */ - while (flat_buf_p->blocklens[(*flat_buf_index_p)] == 0) - { - (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % - flat_buf_p->count; - } - buf_off_arr[*buf_ol_count_p] = - (*bytes_completed / flat_buf_size) * - flat_buf_extent + - flat_buf_p->indices[*flat_buf_index_p] + - *cur_flat_buf_reg_off_p; - buf_len_arr[*buf_ol_count_p] = 0; - - while (flat_file_p->blocklens[(*flat_file_index_p)] == 0) - { - (*flat_file_index_p) = ((*flat_file_index_p) + 1) % - flat_file_p->count; - } - file_off_arr[*file_ol_count_p] = disp + - (((bytes_into_filetype + *bytes_completed) / flat_file_size) * - flat_file_extent) + - flat_file_p->indices[*flat_file_index_p] + - *cur_flat_file_reg_off_p; - file_len_arr[*file_ol_count_p] = 0; - -#ifdef DEBUG_LIST2 - fprintf(stderr, "initial buf_off_arr[%d] = %Ld\n", *buf_ol_count_p, - buf_off_arr[*buf_ol_count_p]); - fprintf(stderr, "initial file_off_arr[%d] = %Ld\n", *file_ol_count_p, - file_off_arr[*file_ol_count_p]); -#endif - - while (*bytes_completed != total_io_size - && (*buf_ol_count_p) < max_ol_count - && (*file_ol_count_p) < max_ol_count) - { - /* How much data is left in the current piece in - * the flattened datatypes */ - cur_flat_buf_reg_left = flat_buf_p->blocklens[*flat_buf_index_p] - - *cur_flat_buf_reg_off_p; - cur_flat_file_reg_left = flat_file_p->blocklens[*flat_file_index_p] - - *cur_flat_file_reg_off_p; - -#ifdef DEBUG_LIST2 - fprintf(stderr, - "flat_buf_index=%d flat_buf->blocklens[%d]=%d\n" - "cur_flat_buf_reg_left=%Ld " - "*cur_flat_buf_reg_off_p=%Ld\n" - "flat_file_index=%d flat_file->blocklens[%d]=%d\n" - "cur_flat_file_reg_left=%Ld " - "*cur_flat_file_reg_off_p=%Ld\n" - "bytes_completed=%Ld\n" - "buf_ol_count=%d file_ol_count=%d\n" - "buf_len_arr[%d]=%d file_len_arr[%d]=%d\n\n", - *flat_buf_index_p, *flat_buf_index_p, - flat_buf_p->blocklens[*flat_buf_index_p], - cur_flat_buf_reg_left, - *cur_flat_buf_reg_off_p, - *flat_file_index_p, *flat_file_index_p, - flat_file_p->blocklens[*flat_file_index_p], - cur_flat_file_reg_left, - *cur_flat_file_reg_off_p, - *bytes_completed, - *buf_ol_count_p, *file_ol_count_p, - *buf_ol_count_p, - buf_len_arr[*buf_ol_count_p], - *file_ol_count_p, - file_len_arr[*file_ol_count_p]); -#endif - - /* What is the size of the next contiguous region agreed - * upon by both memory and file regions that does not - * surpass the file size */ - if (cur_flat_buf_reg_left > cur_flat_file_reg_left) - region_size = cur_flat_file_reg_left; - else - region_size = cur_flat_buf_reg_left; - - if (region_size > total_io_size - *bytes_completed) - region_size = total_io_size - *bytes_completed; - - /* Add this piece to both the mem and file arrays - * coalescing offset-length pairs if possible and advance - * the pointers through the flatten mem and file datatypes - * as well Note: no more than a single piece can be done - * since we take the smallest one possible */ - - if (cur_flat_buf_reg_left == region_size) - { -#ifdef DEBUG_LIST2 - fprintf(stderr, "reached end of memory block...\n"); -#endif - (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % - flat_buf_p->count; - while (flat_buf_p->blocklens[(*flat_buf_index_p)] == 0) - { - (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % - flat_buf_p->count; - } - *cur_flat_buf_reg_off_p = 0; - -#ifdef COALESCE_REGIONS - if (*buf_ol_count_p != 0) - { - if (buf_off_arr[(*buf_ol_count_p) - 1] + - buf_len_arr[(*buf_ol_count_p) - 1] == - buf_off_arr[*buf_ol_count_p]) - { - buf_len_arr[(*buf_ol_count_p) - 1] += - region_size; - } - else - { - buf_len_arr[*buf_ol_count_p] += region_size; - (*buf_ol_count_p)++; - } - } - else - { -#endif - buf_len_arr[*buf_ol_count_p] += region_size; - (*buf_ol_count_p)++; -#ifdef COALESCE_REGIONS - } -#endif - - /* Don't prepare for the next piece if we have reached - * the limit or else it will segment fault. */ - if ((*buf_ol_count_p) != max_ol_count) - { - buf_off_arr[*buf_ol_count_p] = - ((*bytes_completed + region_size) / flat_buf_size) * - flat_buf_extent + - flat_buf_p->indices[*flat_buf_index_p] + - (*cur_flat_buf_reg_off_p); - buf_len_arr[*buf_ol_count_p] = 0; - } - } - else if (cur_flat_buf_reg_left > region_size) - { -#ifdef DEBUG_LIST2 - fprintf(stderr, "advanced %d in memory block...\n", - region_size); -#endif - (*cur_flat_buf_reg_off_p) += region_size; - buf_len_arr[*buf_ol_count_p] += region_size; - } - else - { - fprintf(stderr, "gen_listio_arr: Error\n"); - } - - /* To calculate the absolute file offset we need to - * add the disp, how many filetypes we have gone through, - * the relative block offset in the filetype and how far - * into the block we have gone. */ - if (cur_flat_file_reg_left == region_size) - { -#ifdef DEBUG_LIST2 - fprintf(stderr, "reached end of file block...\n"); -#endif - (*flat_file_index_p) = ((*flat_file_index_p) + 1) % - flat_file_p->count; - while (flat_file_p->blocklens[(*flat_file_index_p)] == 0) - { - (*flat_file_index_p) = ((*flat_file_index_p) + 1) % - flat_file_p->count; - } - (*cur_flat_file_reg_off_p) = 0; - -#ifdef COALESCE_REGIONS - if (*file_ol_count_p != 0) - { - if (file_off_arr[(*file_ol_count_p) - 1] + - file_len_arr[(*file_ol_count_p) - 1] == - file_off_arr[*file_ol_count_p]) - { - file_len_arr[(*file_ol_count_p) - 1] += - region_size; - } - else - { - file_len_arr[*file_ol_count_p] += region_size; - (*file_ol_count_p)++; - } - } - else - { -#endif - file_len_arr[*file_ol_count_p] += region_size; - (*file_ol_count_p)++; -#ifdef COALESCE_REGIONS - } -#endif - - /* Don't prepare for the next piece if we have reached - * the limit or else it will segment fault. */ - if ((*file_ol_count_p) != max_ol_count) - { - file_off_arr[*file_ol_count_p] = disp + - (((bytes_into_filetype + *bytes_completed + region_size) - / flat_file_size) * - flat_file_extent) + - flat_file_p->indices[*flat_file_index_p] + - (*cur_flat_file_reg_off_p); - file_len_arr[*file_ol_count_p] = 0; - } - } - else if (cur_flat_file_reg_left > region_size) - { -#ifdef DEBUG_LIST2 - fprintf(stderr, "advanced %d in file block...\n", - region_size); -#endif - (*cur_flat_file_reg_off_p) += region_size; - file_len_arr[*file_ol_count_p] += region_size; - } - else - { - fprintf(stderr, "gen_listio_arr: Error\n"); - } -#ifdef DEBUG_LIST2 - fprintf(stderr, - "------------------------------\n\n"); -#endif - *bytes_completed += region_size; - } - /* Increment the count if we stopped in the middle of a - * memory or file region */ - if (*cur_flat_buf_reg_off_p != 0) - (*buf_ol_count_p)++; - if (*cur_flat_file_reg_off_p != 0) - (*file_ol_count_p)++; - - return 0; -} - -void print_buf_file_ol_pairs(int64_t buf_off_arr[], - int32_t buf_len_arr[], - int32_t buf_ol_count, - int64_t file_off_arr[], - int32_t file_len_arr[], - int32_t file_ol_count, - void *buf, - int rw_type) -{ - int i = -1; - - fprintf(stderr, "buf_ol_pairs(offset,length) count = %d\n", - buf_ol_count); - for (i = 0; i < buf_ol_count; i++) - { - fprintf(stderr, "(%lld, %d) ", (long long)buf_off_arr[i], buf_len_arr[i]); - } - fprintf(stderr, "\n"); - - fprintf(stderr, "file_ol_pairs(offset,length) count = %d\n", - file_ol_count); - for (i = 0; i < file_ol_count; i++) - { - fprintf(stderr, "(%lld, %d) ", (long long)file_off_arr[i], file_len_arr[i]); - } - fprintf(stderr, "\n\n"); - -} diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_open.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_open.c deleted file mode 100644 index f266c88e5c9..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_open.c +++ /dev/null @@ -1,246 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_pvfs2.h" -#include "ad_pvfs2_common.h" - -/* open_status is helpful for bcasting values around */ -struct open_status_s { - int error; - PVFS_object_ref object_ref; -}; -typedef struct open_status_s open_status; - - /* steps for getting a handle: (it gets a little convoluted, but at least - * it's deterministic) - * . lookup the file. - * . if lookup succeeds, but we were passed MPI_MODE_EXCL, that's an error - * . if lookup fails, the file might not exist. - * in that case, create the file if we were passed MPI_MODE_CREATE - * . if the create fails, that means someone else created the file between - * our call to lookup and our call to create (like if N processors all - * open the same file with MPI_COMM_SELF). Then we can just look up the - * file (which now exists). - * - * the good news is that only one processor does this and broadcasts the - * handle to everyone else in the communicator - */ -static void fake_an_open(PVFS_fs_id fs_id, char *pvfs_name, int access_mode, - int nr_datafiles, PVFS_size strip_size, - ADIOI_PVFS2_fs *pvfs2_fs, - open_status *o_status) -{ - int ret; - PVFS_sysresp_lookup resp_lookup; - PVFS_sysresp_getparent resp_getparent; - PVFS_sysresp_create resp_create; - PVFS_sys_attr attribs; - PVFS_sys_dist* dist; - - ADIOI_PVFS2_makeattribs(&attribs); - if (nr_datafiles > 0 ) { - attribs.dfile_count = nr_datafiles; - attribs.mask |= PVFS_ATTR_SYS_DFILE_COUNT; - } - - dist = NULL; - - memset(&resp_lookup, 0, sizeof(resp_lookup)); - memset(&resp_getparent, 0, sizeof(resp_getparent)); - memset(&resp_create, 0, sizeof(resp_create)); - - - ret = PVFS_sys_lookup(fs_id, pvfs_name, - &(pvfs2_fs->credentials), &resp_lookup, PVFS2_LOOKUP_LINK_FOLLOW); - if ( ret == (-PVFS_ENOENT)) { - if (access_mode & ADIO_CREATE) { - ret = PVFS_sys_getparent(fs_id, pvfs_name, - &(pvfs2_fs->credentials), &resp_getparent); - if (ret < 0) { - FPRINTF(stderr, "pvfs_sys_getparent returns with %d\n", ret); - o_status->error = ret; - return; - } - - /* Set the distribution strip size if specified */ - if (0 < strip_size) { - /* Note that the distribution is hardcoded here */ - dist = PVFS_sys_dist_lookup("simple_stripe"); - ret = PVFS_sys_dist_setparam(dist, - "strip_size", - &strip_size); - if (ret < 0) - { - FPRINTF(stderr, - "pvfs_sys_dist_setparam returns with %d\n", ret); - o_status->error = ret; - } - } - - /* Perform file creation */ -#ifdef HAVE_PVFS2_CREATE_WITHOUT_LAYOUT - ret = PVFS_sys_create(resp_getparent.basename, - resp_getparent.parent_ref, attribs, - &(pvfs2_fs->credentials), dist, &resp_create); -#else - ret = PVFS_sys_create(resp_getparent.basename, - resp_getparent.parent_ref, attribs, - &(pvfs2_fs->credentials), dist, NULL, &resp_create); -#endif - - /* if many creates are happening in this directory, the earlier - * sys_lookup may have returned ENOENT, but the sys_create could - * return EEXISTS. That means the file has been created anyway, so - * less work for us and we can just open it up and return the - * handle */ - if (ret == (-PVFS_EEXIST)) { - ret = PVFS_sys_lookup(fs_id, pvfs_name, - &(pvfs2_fs->credentials), &resp_lookup, - PVFS2_LOOKUP_LINK_FOLLOW); - if ( ret < 0 ) { - o_status->error = ret; - return; - } - o_status->error = ret; - o_status->object_ref = resp_lookup.ref; - return; - } - o_status->object_ref = resp_create.ref; - } else { - FPRINTF(stderr, "cannot create file without MPI_MODE_CREATE\n"); - o_status->error = ret; - return; - } - } else if (access_mode & ADIO_EXCL) { - /* lookup should not succeed if opened with EXCL */ - o_status->error = -PVFS_EEXIST; - return; - } else { - o_status->object_ref = resp_lookup.ref; - } - o_status->error = ret; - return; - -} - - -/* ADIOI_PVFS2_Open: - * one process opens (or creates) the file, then broadcasts the result to the - * remaining processors. - * - * ADIO_Open used to perform an optimization when MPI_MODE_CREATE (and before - * that, MPI_MODE_EXCL) was set. Because PVFS2 handles file lookup and - * creation more scalably than other file systems, ADIO_Open now skips any - * special handling when CREATE is set. */ -void ADIOI_PVFS2_Open(ADIO_File fd, int *error_code) -{ - int rank, ret; - PVFS_fs_id cur_fs; - static char myname[] = "ADIOI_PVFS2_OPEN"; - char pvfs_path[PVFS_NAME_MAX] = {0}; - - ADIOI_PVFS2_fs *pvfs2_fs; - - /* since one process is doing the open, that means one process is also - * doing the error checking. define a struct for both the object reference - * and the error code to broadcast to all the processors */ - - open_status o_status = {0, {0, 0}}; - MPI_Datatype open_status_type; - MPI_Datatype types[2] = {MPI_INT, MPI_BYTE}; - int lens[2] = {1, sizeof(PVFS_object_ref)}; - MPI_Aint offsets[2]; - - pvfs2_fs = (ADIOI_PVFS2_fs *) ADIOI_Malloc(sizeof(ADIOI_PVFS2_fs)); - - /* --BEGIN ERROR HANDLING-- */ - if (pvfs2_fs == NULL) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_UNKNOWN, - "Error allocating memory", 0); - return; - } - /* --END ERROR HANDLING-- */ - - MPI_Comm_rank(fd->comm, &rank); - - ADIOI_PVFS2_Init(error_code); - if (*error_code != MPI_SUCCESS) - { - /* ADIOI_PVFS2_INIT handles creating error codes on its own */ - return; - } - - /* currently everyone gets their own credentials */ - ADIOI_PVFS2_makecredentials(&(pvfs2_fs->credentials)); - - /* one process resolves name and will later bcast to others */ -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_open_a, 0, NULL ); -#endif - if (rank == fd->hints->ranklist[0] && fd->fs_ptr == NULL) { - /* given the filename, figure out which pvfs filesystem it is on */ - ret = PVFS_util_resolve(fd->filename, &cur_fs, - pvfs_path, PVFS_NAME_MAX); - if (ret < 0 ) { - PVFS_perror("PVFS_util_resolve", ret); - /* TODO: pick a good error for this */ - o_status.error = -1; - } else { - fake_an_open(cur_fs, pvfs_path, - fd->access_mode, fd->hints->striping_factor, - fd->hints->striping_unit, - pvfs2_fs, &o_status); - } - - /* store credentials and object reference in fd */ - pvfs2_fs->object_ref = o_status.object_ref; - fd->fs_ptr = pvfs2_fs; - } -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_open_b, 0, NULL ); -#endif - - /* broadcast status and (possibly valid) object reference */ - MPI_Get_address(&o_status.error, &offsets[0]); - MPI_Get_address(&o_status.object_ref, &offsets[1]); - - MPI_Type_struct(2, lens, offsets, types, &open_status_type); - MPI_Type_commit(&open_status_type); - - /* Assertion: if we hit this Bcast, then all processes collectively - * called this open. - * - * That's because deferred open never happens with PVFS2. - */ - MPI_Bcast(MPI_BOTTOM, 1, open_status_type, fd->hints->ranklist[0], - fd->comm); - MPI_Type_free(&open_status_type); - - /* --BEGIN ERROR HANDLING-- */ - if (o_status.error != 0) - { - ADIOI_Free(pvfs2_fs); - fd->fs_ptr = NULL; - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(o_status.error), - "Unknown error", 0); - /* TODO: FIX STRING */ - return; - } - /* --END ERROR HANDLING-- */ - - pvfs2_fs->object_ref = o_status.object_ref; - fd->fs_ptr = pvfs2_fs; - - *error_code = MPI_SUCCESS; - return; -} diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_read.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_read.c deleted file mode 100644 index 007b4dc3933..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_read.c +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "ad_pvfs2.h" -#include "ad_pvfs2_io.h" -#include "ad_pvfs2_common.h" - -void ADIOI_PVFS2_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - int ret; - MPI_Count datatype_size, len; - PVFS_Request file_req, mem_req; - PVFS_sysresp_io resp_io; - ADIOI_PVFS2_fs *pvfs_fs; - static char myname[] = "ADIOI_PVFS2_READCONTIG"; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * count; - - ret = PVFS_Request_contiguous(len, PVFS_BYTE, &mem_req); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in pvfs_request_contig (memory)", 0); - return; - } - /* --END ERROR HANDLING-- */ - - ret = PVFS_Request_contiguous(len, PVFS_BYTE, &file_req); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in pvfs_request_contig (file)", 0); - return; - } - /* --END ERROR HANDLING-- */ - - if (file_ptr_type == ADIO_INDIVIDUAL) { - /* copy individual file pointer into offset variable, continue */ - offset = fd->fp_ind; - } - -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); -#endif - ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, offset, buf, - mem_req, &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0 ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_read", 0); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += (int) resp_io.total_completed; - /* TODO: WHY THE INT CAST? */ - } - fd->fp_sys_posn = offset + (int)resp_io.total_completed; - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, resp_io.total_completed); -#endif - - *error_code = MPI_SUCCESS; -fn_exit: - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - return; -} - -static int ADIOI_PVFS2_ReadStridedListIO(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - return ADIOI_PVFS2_StridedListIO(fd, buf, count, - datatype, file_ptr_type, - offset, status, - error_code, READ); -} - -static int ADIOI_PVFS2_ReadStridedDtypeIO(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - return ADIOI_PVFS2_StridedDtypeIO(fd, buf, count, - datatype, file_ptr_type, - offset, status, error_code, - READ); -} - -void ADIOI_PVFS2_ReadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code) -{ - /* four ways (to date) that we can carry out strided i/o accesses: - * - naive posix - * - 'true' Datatype (from avery) - * - new List I/O (from avery) - * - classic List I/O (the one that's always been in ROMIO) - * I imagine we'll keep Datatype as an optional optimization, and afer a - * release or two promote it to the default - */ - int ret = -1; - - if (fd->hints->fs_hints.pvfs2.posix_read == ADIOI_HINT_ENABLE) { - ADIOI_GEN_ReadStrided(fd, buf, count, datatype, - file_ptr_type, offset, status, error_code); - return; - } - if (fd->hints->fs_hints.pvfs2.dtype_read == ADIOI_HINT_ENABLE) { - ret = ADIOI_PVFS2_ReadStridedDtypeIO(fd, buf, count, - datatype, file_ptr_type, - offset, status, error_code); - - /* Fall back to list I/O if datatype I/O didn't work */ - if (ret != 0) - { - fprintf(stderr, - "Falling back to list I/O since datatype I/O failed\n"); - ret = ADIOI_PVFS2_ReadStridedListIO(fd, buf, count, - datatype, file_ptr_type, - offset, status, error_code); - } - return; - } - if (fd->hints->fs_hints.pvfs2.listio_read == ADIOI_HINT_ENABLE) { - ret = ADIOI_PVFS2_ReadStridedListIO(fd, buf, count, datatype, - file_ptr_type, offset, status, error_code); - return; - } - /* Use classic list I/O if no hints given base case */ - - ADIOI_PVFS2_OldReadStrided(fd, buf, count, datatype, - file_ptr_type, offset, status, error_code); - return; -} - - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c deleted file mode 100644 index 856c5b8c2fb..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_read_list_classic.c +++ /dev/null @@ -1,909 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "ad_pvfs2.h" - -#include "ad_pvfs2_common.h" - -void ADIOI_PVFS2_OldReadStrided(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, 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, filetype_lb, buftype_lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset off, disp, start_off, initial_off; - int flag, st_frd_size, st_n_filetypes; - - int mem_list_count, file_list_count; - PVFS_size *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; - PVFS_Request mem_req, file_req; - ADIOI_PVFS2_fs * pvfs_fs; - PVFS_sysresp_io resp_io; - int err_flag=0; - MPI_Offset total_bytes_read = 0; - static char myname[] = "ADIOI_PVFS2_ReadStrided"; - -#define MAX_ARRAY_SIZE 64 - - *error_code = MPI_SUCCESS; /* changed below if error */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - - /* the HDF5 tests showed a bug in this list processing code (see many many - * lines down below). We added a workaround, but common HDF5 file types - * are actually contiguous and do not need the expensive workarond */ - if (!filetype_is_contig) { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - if (flat_file->count == 1 && !buftype_is_contig) - filetype_is_contig = 1; - } - - 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; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - if (!buftype_is_contig && filetype_is_contig) { - -/* noncontiguous in memory, contiguous in file. */ - int64_t file_offset; - int32_t file_length; - - 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_offset = off; - file_length = 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 = (PVFS_size*)ADIOI_Malloc(mem_list_count*sizeof(PVFS_size)); - mem_lengths = (int*)ADIOI_Malloc(mem_list_count*sizeof(int)); - - /* TODO: CHECK RESULTS OF MEMORY ALLOCATION */ - - 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] = - /* TODO: fix this compiler warning */ - ((PVFS_size)buf + j*buftype_extent + flat_buf->indices[i]); - mem_lengths[b_blks_read % MAX_ARRAY_SIZE] = - flat_buf->blocklens[i]; - file_length += 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; - } - err_flag = PVFS_Request_hindexed(mem_list_count, - mem_lengths, mem_offsets, PVFS_BYTE, &mem_req); - if (err_flag < 0) break; - err_flag = PVFS_Request_contiguous(file_length, - PVFS_BYTE, &file_req); - if (err_flag < 0) break; -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); -#endif - err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, - file_offset, PVFS_BOTTOM, mem_req, - &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_read", 0); - goto error_state; - } - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - total_bytes_read += resp_io.total_completed; - /* --END ERROR HANDLING-- */ - - /* in the case of error or the last read list call, - * leave here */ - if (err_flag || b_blks_read == total_blks_to_read) break; - - file_offset += file_length; - file_length = 0; - } - } /* for (i=0; icount; i++) */ - j++; - } /* while (b_blks_read < total_blks_to_read) */ - ADIOI_Free(mem_offsets); - ADIOI_Free(mem_lengths); - - if (file_ptr_type == ADIO_INDIVIDUAL) - fd->fp_ind += total_bytes_read; - - 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; - initial_off = offset; - - - /* 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_length=0; - intptr_t mem_offset; - - i = 0; - j = st_index; - n_filetypes = st_n_filetypes; - - mem_list_count = 1; - - /* determine how many blocks in file to read */ - f_data_read = ADIOI_MIN(st_frd_size, bufsize); - total_blks_to_read = 1; - if (j < (flat_file->count-1)) j++; - else { - j = 0; - n_filetypes++; - } - 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_offset = (intptr_t)buf; - mem_lengths = 0; - - /* if at least one full readlist, allocate file arrays - at max array size and don't free until very end */ - if (n_read_lists) { - 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; kobject_ref, file_req, 0, - (void *)mem_offset, mem_req, - &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_read", 0); - goto error_state; - } - /* --END ERROR HANDING-- */ - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - - total_bytes_read += resp_io.total_completed; - - mem_offset += mem_length; - mem_lengths = 0; - } /* for (i=0; iindices[j]; - if (k == (extra_blks - 1)) { - file_lengths[k] = bufsize - (int32_t) mem_lengths - - mem_offset + (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; kobject_ref, file_req, 0, - (void *)mem_offset, mem_req, &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_read", 0); - goto error_state; - } - /* --END ERROR HANDLING-- */ - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - total_bytes_read += resp_io.total_completed; - } - } - 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] ) ) || - ((mem_list_count == 1) && - (new_buffer_read < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && - (new_file_read < flat_buf->blocklens[0]) ) || - ( (mem_list_count == MAX_ARRAY_SIZE) && - (new_buffer_read < flat_file->blocklens[0])) ) - { - - ADIOI_Delete_flattened(datatype); - ADIOI_GEN_ReadStrided_naive(fd, buf, count, datatype, - file_ptr_type, initial_off, status, error_code); - return; - } - - mem_offsets = (PVFS_size*)ADIOI_Malloc(max_mem_list*sizeof(PVFS_size)); - mem_lengths = (int *)ADIOI_Malloc(max_mem_list*sizeof(int)); - file_offsets = (int64_t *)ADIOI_Malloc(max_file_list*sizeof(int64_t)); - file_lengths = (int32_t *)ADIOI_Malloc(max_file_list*sizeof(int32_t)); - - size_read = 0; - n_filetypes = st_n_filetypes; - frd_size = st_frd_size; - brd_size = flat_buf->blocklens[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] + - ((ADIO_Offset)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; iobject_ref, file_req, 0, - PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_read", 0); - } - /* --END ERROR HANDLING-- */ - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - total_bytes_read += resp_io.total_completed; - size_read += new_buffer_read; - start_k = k; - start_j = j; - } /* while (size_read < bufsize) */ - ADIOI_Free(mem_offsets); - ADIOI_Free(mem_lengths); - } - /* Other ADIO routines will convert absolute bytes into counts of datatypes */ - /* when incrementing fp_ind, need to also take into account the file type: - * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| - * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1) - * - * As we discussed on mpich-discuss in may/june 2009, the code below might - * look wierd, but by putting fp_ind at the last byte written, the next - * time we run through the strided code we'll update the fp_ind to the - * right location. */ - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind = file_offsets[file_list_count-1]+ - file_lengths[file_list_count-1]; - } - - ADIOI_Free(file_offsets); - ADIOI_Free(file_lengths); - - if (err_flag == 0) *error_code = MPI_SUCCESS; - -error_state: - 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_pvfs2/ad_pvfs2_resize.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_resize.c deleted file mode 100644 index db219db0fde..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_resize.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_pvfs2.h" -#include "ad_pvfs2_common.h" - -/* as with ADIOI_PVFS2_Flush, implement the resize operation in a scalable - * manner. one process does the work, then broadcasts the result to everyone - * else. fortunately, this operation is defined to be collective */ -void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) -{ - int ret, rank; - ADIOI_PVFS2_fs *pvfs_fs; - static char myname[] = "ADIOI_PVFS2_RESIZE"; - - *error_code = MPI_SUCCESS; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - MPI_Comm_rank(fd->comm, &rank); - - /* We desginate one node in the communicator to be an 'io_worker' in - * ADIO_Open. This node can perform operations on files and then - * inform the other nodes of the result */ - - /* MPI-IO semantics treat conflicting MPI_File_set_size requests the - * same as conflicting write requests. Thus, a resize from one - * process does not have to be visible to the other processes until a - * syncronization point is reached */ - - if (rank == fd->hints->ranklist[0]) { - ret = PVFS_sys_truncate(pvfs_fs->object_ref, - size, &(pvfs_fs->credentials)); - MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - } else { - MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - } - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_truncate", 0); - return; - } - /* --END ERROR HANDLING-- */ -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_write.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_write.c deleted file mode 100644 index 93e142bb687..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_write.c +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_pvfs2.h" -#include "adio_extern.h" -#include "ad_pvfs2_io.h" -#include "ad_pvfs2_common.h" - -void ADIOI_PVFS2_WriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - int ret; - MPI_Count datatype_size, len; - PVFS_Request file_req, mem_req; - PVFS_sysresp_io resp_io; - ADIOI_PVFS2_fs *pvfs_fs; - static char myname[] = "ADIOI_PVFS2_WRITECONTIG"; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * count; - - ret = PVFS_Request_contiguous(len, PVFS_BYTE, &mem_req); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_Request_contiguous (memory)", 0); - return; - } - /* --END ERROR HANDLING-- */ - - ret = PVFS_Request_contiguous(len, PVFS_BYTE, &file_req); - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_Request_contiguous (file)", 0); - return; - } - /* --END ERROR HANDLING-- */ - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - ret = PVFS_sys_write(pvfs_fs->object_ref, file_req, offset, (void *)buf, - mem_req, &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_write", 0); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - fd->fp_sys_posn = offset + (int) resp_io.total_completed; - } - else { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - ret = PVFS_sys_write(pvfs_fs->object_ref, file_req, fd->fp_ind, (void *)buf, - mem_req, &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(ret), - "Error in PVFS_sys_write", 0); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - fd->fp_ind += (int)resp_io.total_completed; - fd->fp_sys_posn = fd->fp_ind; - } -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, resp_io.total_completed); -#endif - *error_code = MPI_SUCCESS; -fn_exit: - PVFS_Request_free(&file_req); - PVFS_Request_free(&mem_req); - return; -} - -int ADIOI_PVFS2_WriteStridedListIO(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - return ADIOI_PVFS2_StridedListIO(fd, (void *)buf, count, - datatype, file_ptr_type, - offset, status, - error_code, WRITE); -} - -int ADIOI_PVFS2_WriteStridedDtypeIO(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - return ADIOI_PVFS2_StridedDtypeIO(fd, (void *)buf, count, - datatype, file_ptr_type, - offset, status, error_code, - WRITE); -} - - -void ADIOI_PVFS2_WriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - /* four ways (to date) that we can carry out strided i/o accesses: - * - naive posix - * - 'true' Datatype (from avery) - * - new List I/O (from avery) - * - classic List I/O (the one that's always been in ROMIO) - * I imagine we'll keep Datatype as an optional optimization, and afer a - * release or two promote it to the default - */ - - /* a lot of near-duplication from ADIOI_PVFS2_ReadStrided: for - * debugging/testing it's helpful to be able to turn on and off these - * optimizations separately for the read and write cases */ - int ret = -1; - if ( fd->hints->fs_hints.pvfs2.posix_write == ADIOI_HINT_ENABLE) { - ADIOI_GEN_WriteStrided_naive(fd, buf, count, - datatype, file_ptr_type, - offset, status, error_code); - return; - } - if ( fd->hints->fs_hints.pvfs2.dtype_write == ADIOI_HINT_ENABLE) { - ret = ADIOI_PVFS2_WriteStridedDtypeIO(fd, buf, count, - datatype, file_ptr_type, - offset, status, error_code); - - /* Fall back to list I/O if datatype I/O didn't work */ - if (ret != 0) - { - fprintf(stderr, - "Falling back to list I/O since datatype I/O failed\n"); - ret = ADIOI_PVFS2_WriteStridedListIO(fd, buf, count, - datatype, file_ptr_type, - offset, status, error_code); - } - return; - } - /* Use list I/O in the base case */ - if (fd->hints->fs_hints.pvfs2.listio_write == ADIOI_HINT_ENABLE) { - ret = ADIOI_PVFS2_WriteStridedListIO(fd, buf, count, datatype, - file_ptr_type, offset, status, error_code); - return; - } - - /* Use classic list I/O if no hints given base case */ - ADIOI_PVFS2_OldWriteStrided(fd, buf, count, datatype, - file_ptr_type, offset, status, error_code); - return; -} diff --git a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c b/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c deleted file mode 100644 index 7a9758c30e3..00000000000 --- a/3rd-party/romio321/adio/ad_pvfs2/ad_pvfs2_write_list_classic.c +++ /dev/null @@ -1,963 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "ad_pvfs2.h" - -#include "ad_pvfs2_common.h" - -void ADIOI_PVFS2_OldWriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - /* as with all the other WriteStrided functions, offset is in units of - * etype relative to the filetype */ - - /* Since PVFS2 does not support file locking, can't do buffered writes - as on Unix */ - - ADIOI_Flatlist_node *flat_buf, *flat_file; - int i, j, k, bwr_size, fwr_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, filetype_lb, buftype_lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset off, disp, start_off, initial_off; - int flag, st_fwr_size, st_n_filetypes; - int err_flag=0; - - int mem_list_count, file_list_count; - PVFS_size * 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; - PVFS_Request mem_req, file_req; - ADIOI_PVFS2_fs * pvfs_fs; - PVFS_sysresp_io resp_io; - MPI_Offset total_bytes_written=0; - static char myname[] = "ADIOI_PVFS2_WRITESTRIDED"; - - /* note: don't increase this: several parts of PVFS2 now - * assume this limit*/ -#define MAX_ARRAY_SIZE 64 - - /* --BEGIN ERROR HANDLING-- */ - if (fd->atomicity) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "Atomic noncontiguous writes are not supported by PVFS2", 0); - return; - } - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - - /* the HDF5 tests showed a bug in this list processing code (see many many - * lines down below). We added a workaround, but common HDF5 file types - * are actually contiguous and do not need the expensive workarond */ - if (!filetype_is_contig) { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - if (flat_file->count == 1 && !buftype_is_contig) - filetype_is_contig = 1; - } - - 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; - - pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr; - - if (!buftype_is_contig && filetype_is_contig) { - -/* noncontiguous in memory, contiguous in file. */ - int64_t file_offset; - int32_t file_length; - - flat_buf = ADIOI_Flatten_and_find(datatype); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + etype_size * offset; - } - else off = fd->fp_ind; - - file_list_count = 1; - file_offset = off; - file_length = 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 = (PVFS_size*)ADIOI_Malloc(mem_list_count*sizeof(PVFS_size)); - 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] = - /* TODO: fix this warning by casting to an integer that's - * the same size as a char * and /then/ casting to - * PVFS_size */ - ((PVFS_size)buf + j*buftype_extent + flat_buf->indices[i]); - mem_lengths[b_blks_wrote % MAX_ARRAY_SIZE] = - flat_buf->blocklens[i]; - file_length += 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 write 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 write list call fills max arrays */ - if (!mem_list_count) mem_list_count = MAX_ARRAY_SIZE; - } - err_flag = PVFS_Request_hindexed(mem_list_count, - mem_lengths, mem_offsets, - PVFS_BYTE, &mem_req); - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_Request_hindexed (memory)", 0); - break; - } - /* --END ERROR HANDLING-- */ - - err_flag = PVFS_Request_contiguous(file_length, - PVFS_BYTE, &file_req); - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_Request_contiguous (file)", 0); - break; - } - /* --END ERROR HANDLING-- */ - -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, - file_offset, PVFS_BOTTOM, - mem_req, - &(pvfs_fs->credentials), - &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - total_bytes_written += resp_io.total_completed; - - /* in the case of error or the last write list call, - * leave here */ - /* --BEGIN ERROR HANDLING-- */ - if (err_flag) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_write", 0); - break; - } - /* --END ERROR HANDLING-- */ - if (b_blks_wrote == total_blks_to_write) break; - - file_offset += file_length; - file_length = 0; - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - } - } /* for (i=0; icount; i++) */ - j++; - } /* while (b_blks_wrote < total_blks_to_write) */ - ADIOI_Free(mem_offsets); - ADIOI_Free(mem_lengths); - - if (file_ptr_type == ADIO_INDIVIDUAL) - fd->fp_ind += total_bytes_written; - - if (!err_flag) *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; - initial_off = offset; - - /* 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_length; - intptr_t mem_offset; - - i = 0; - j = st_index; - off = offset; - n_filetypes = st_n_filetypes; - - mem_list_count = 1; - - /* determine how many blocks in file to write */ - f_data_wrote = ADIOI_MIN(st_fwr_size, bufsize); - total_blks_to_write = 1; - if (j < (flat_file->count -1)) j++; - else { - j = 0; - n_filetypes++; - } - 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_offset = (intptr_t) buf; - mem_length = 0; - - /* if at least one full writelist, allocate file arrays - at max array size and don't free until very end */ - if (n_write_lists) { - 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 writelist 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_length += file_lengths[k]; - } - if (j<(flat_file->count - 1)) j++; - else { - j = 0; - n_filetypes++; - } - } /* for (k=0; kobject_ref, file_req, 0, - (void *)mem_offset, mem_req, - &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_write", 0); - goto error_state; - } - /* --END ERROR HANDLING-- */ - total_bytes_written += resp_io.total_completed; - - mem_offset += mem_length; - mem_lengths = 0; - PVFS_Request_free(&file_req); - PVFS_Request_free(&mem_req); - - } /* for (i=0; iindices[j]; - if (k == (extra_blks - 1)) { - file_lengths[k] = bufsize - (int32_t) mem_lengths - - mem_offset + (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; kobject_ref, file_req, 0, - (void *)mem_offset, mem_req, - &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_write", 0); - goto error_state; - } - /* --END ERROR HANDLING-- */ - total_bytes_written += resp_io.total_completed; - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - } - } - 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 written and data to be - written in the next immediate write 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; iblocklens[0] ) ) || - ((mem_list_count == 1) && - (new_buffer_write < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && - (new_file_write < flat_buf->blocklens[0]) ) || - ( (mem_list_count == MAX_ARRAY_SIZE) && - (new_buffer_write < flat_file->blocklens[0])) ) - { - ADIOI_Delete_flattened(datatype); - ADIOI_GEN_WriteStrided_naive(fd, buf, count, datatype, - file_ptr_type, initial_off, status, error_code); - return; - } - - - mem_offsets = (PVFS_size*)ADIOI_Malloc(max_mem_list*sizeof(PVFS_size)); - mem_lengths = (int *)ADIOI_Malloc(max_mem_list*sizeof(int)); - file_offsets = (int64_t *)ADIOI_Malloc(max_file_list*sizeof(int64_t)); - file_lengths = (int32_t *)ADIOI_Malloc(max_file_list*sizeof(int32_t)); - - size_wrote = 0; - n_filetypes = st_n_filetypes; - fwr_size = st_fwr_size; - bwr_size = flat_buf->blocklens[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_fwr_size and new_bwr_size */ - - while (size_wrote < bufsize) { - k = start_k; - new_buffer_write = 0; - mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && - (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 written and data to be - written in the next immediate write 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)) */ - - /* fills the allocated writelist arrays */ - k = start_k; - j = start_j; - for (i=0; icount) + - (int)flat_buf->indices[k]); - - if(!i) { - mem_lengths[0] = bwr_size; - mem_offsets[0] += flat_buf->blocklens[k] - bwr_size; - } - else { - if (i == (mem_list_count - 1)) { - mem_lengths[i] = end_bwr_size; - if (flat_buf->blocklens[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--; - } - } - else { - mem_lengths[i] = flat_buf->blocklens[k]; - } - } - buf_count++; - k = (k + 1)%flat_buf->count; - } /* for (i=0; iindices[j] + - ((ADIO_Offset)n_filetypes) * filetype_extent; - if (!i) { - file_lengths[0] = fwr_size; - file_offsets[0] += flat_file->blocklens[j] - fwr_size; - } - else { - if (i == (file_list_count - 1)) { - file_lengths[i] = end_fwr_size; - if (flat_file->blocklens[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--; - } - } - else file_lengths[i] = flat_file->blocklens[j]; - } - if (j < flat_file->count - 1) j++; - else { - j = 0; - n_filetypes++; - } - } /* for (i=0; iobject_ref, file_req, 0, - PVFS_BOTTOM, mem_req, - &(pvfs_fs->credentials), &resp_io); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_PVFS2_error_convert(err_flag), - "Error in PVFS_sys_write", 0); - goto error_state; - } - /* --END ERROR HANDLING-- */ - - size_wrote += new_buffer_write; - total_bytes_written += resp_io.total_completed; - start_k = k; - start_j = j; - PVFS_Request_free(&mem_req); - PVFS_Request_free(&file_req); - } /* while (size_wrote < bufsize) */ - ADIOI_Free(mem_offsets); - ADIOI_Free(mem_lengths); - } - /* when incrementing fp_ind, need to also take into account the file type: - * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| - * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1). - * - * As we discussed on mpich-discuss in may/june 2009, the code below might - * look wierd, but by putting fp_ind at the last byte written, the next - * time we run through the strided code we'll update the fp_ind to the - * right location. */ - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind = file_offsets[file_list_count-1]+ - file_lengths[file_list_count-1]; - } - ADIOI_Free(file_offsets); - ADIOI_Free(file_lengths); - - *error_code = MPI_SUCCESS; - -error_state: - 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_sfs/Makefile.mk b/3rd-party/romio321/adio/ad_sfs/Makefile.mk deleted file mode 100644 index 2db1ac26cbe..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/Makefile.mk +++ /dev/null @@ -1,19 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if BUILD_AD_SFS - -noinst_HEADERS += adio/ad_sfs/ad_sfs.h - -romio_other_sources += \ - adio/ad_sfs/ad_sfs_open.c \ - adio/ad_sfs/ad_sfs_fcntl.c \ - adio/ad_sfs/ad_sfs_flush.c \ - adio/ad_sfs/ad_sfs.c - -endif BUILD_AD_SFS - diff --git a/3rd-party/romio321/adio/ad_sfs/README b/3rd-party/romio321/adio/ad_sfs/README deleted file mode 100644 index 933677b1770..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/README +++ /dev/null @@ -1 +0,0 @@ -This code is no longer supported. diff --git a/3rd-party/romio321/adio/ad_sfs/ad_sfs.c b/3rd-party/romio321/adio/ad_sfs/ad_sfs.c deleted file mode 100644 index c4c1609dd29..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/ad_sfs.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_sfs.h" - -/* adioi.h has the ADIOI_Fns_struct define */ -#include "adioi.h" - -struct ADIOI_Fns_struct ADIO_SFS_operations = { - ADIOI_SFS_Open, /* Open */ - ADIOI_GEN_ReadContig, /* ReadContig */ - ADIOI_GEN_WriteContig, /* WriteContig */ - ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ - ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ - ADIOI_GEN_SeekIndividual, /* SeekIndividual */ - ADIOI_SFS_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_SFS_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_sfs/ad_sfs.h b/3rd-party/romio321/adio/ad_sfs/ad_sfs.h deleted file mode 100644 index 9f029f05580..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/ad_sfs.h +++ /dev/null @@ -1,21 +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_SFS_INCLUDE -#define AD_SFS_INCLUDE - -#include -#include -#include -#include "adio.h" - -void ADIOI_SFS_Open(ADIO_File fd, int *error_code); -void ADIOI_SFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); -void ADIOI_SFS_Flush(ADIO_File fd, int *error_code); - -#endif diff --git a/3rd-party/romio321/adio/ad_sfs/ad_sfs_fcntl.c b/3rd-party/romio321/adio/ad_sfs/ad_sfs_fcntl.c deleted file mode 100644 index 533e26a77b6..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/ad_sfs_fcntl.c +++ /dev/null @@ -1,64 +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_sfs.h" -#include "adio_extern.h" - -void ADIOI_SFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code) -{ - int i, ntimes, len; - ADIO_Offset curr_fsize, alloc_size, size, done; - ADIO_Status status; - char *buf; -#ifndef PRINT_ERR_MSG - static char myname[] = "ADIOI_SFS_FCNTL"; -#endif - - switch(flag) { - case ADIO_FCNTL_GET_FSIZE: - /* On SFS, I find that a write from one process, which changes - the file size, does not automatically make the new file size - visible to other processes. Therefore, a sync-barrier-sync is - needed. (Other processes are able to read the data written - though; only file size is returned incorrectly.) */ - - fsync(fd->fd_sys); - MPI_Barrier(fd->comm); - fsync(fd->fd_sys); - - fcntl_struct->fsize = llseek(fd->fd_sys, 0, SEEK_END); - if (fd->fp_sys_posn != -1) - 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: - fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1; - *error_code = MPI_SUCCESS; - break; - - default: - FPRINTF(stderr, "Unknown flag passed to ADIOI_SFS_Fcntl\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } -} diff --git a/3rd-party/romio321/adio/ad_sfs/ad_sfs_flush.c b/3rd-party/romio321/adio/ad_sfs/ad_sfs_flush.c deleted file mode 100644 index 8fc7e358cf6..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/ad_sfs_flush.c +++ /dev/null @@ -1,27 +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_sfs.h" - -void ADIOI_SFS_Flush(ADIO_File fd, int *error_code) -{ -#ifndef PRINT_ERR_MSG - static char myname[] = "ADIOI_SFS_FLUSH"; -#endif - - /* there is no fsync on SX-4 */ -#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_UNSUPPORTED_OPERATION, 1, - myname, (char *) 0, (char *) 0); - ADIOI_Error(fd, *error_code, myname); -#endif -} diff --git a/3rd-party/romio321/adio/ad_sfs/ad_sfs_open.c b/3rd-party/romio321/adio/ad_sfs/ad_sfs_open.c deleted file mode 100644 index ebeefdcbcba..00000000000 --- a/3rd-party/romio321/adio/ad_sfs/ad_sfs_open.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_sfs.h" - -void ADIOI_SFS_Open(ADIO_File fd, int *error_code) -{ - int perm, old_mask, amode; -#ifndef PRINT_ERR_MSG - static char myname[] = "ADIOI_SFS_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; - - if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) { - fd->fp_ind = llseek(fd->fd_sys, 0, SEEK_END); - fd->fp_sys_posn = fd->fp_ind; - } - - 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_testfs/Makefile.mk b/3rd-party/romio321/adio/ad_testfs/Makefile.mk deleted file mode 100644 index 7f9c6172171..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/Makefile.mk +++ /dev/null @@ -1,32 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if BUILD_AD_TESTFS - -noinst_HEADERS += adio/ad_testfs/ad_testfs.h - -romio_other_sources += \ - adio/ad_testfs/ad_testfs_close.c \ - adio/ad_testfs/ad_testfs_read.c \ - adio/ad_testfs/ad_testfs_rdcoll.c \ - adio/ad_testfs/ad_testfs_wrcoll.c \ - adio/ad_testfs/ad_testfs_open.c \ - adio/ad_testfs/ad_testfs_write.c \ - adio/ad_testfs/ad_testfs_done.c \ - adio/ad_testfs/ad_testfs_fcntl.c \ - adio/ad_testfs/ad_testfs_iread.c \ - adio/ad_testfs/ad_testfs_iwrite.c \ - adio/ad_testfs/ad_testfs_wait.c \ - adio/ad_testfs/ad_testfs_flush.c \ - adio/ad_testfs/ad_testfs_seek.c \ - adio/ad_testfs/ad_testfs_resize.c \ - adio/ad_testfs/ad_testfs_hints.c \ - adio/ad_testfs/ad_testfs_delete.c \ - adio/ad_testfs/ad_testfs.c - -endif BUILD_AD_TESTFS - diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs.c deleted file mode 100644 index 6696847c3e1..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs.c +++ /dev/null @@ -1,41 +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_testfs.h" - -/* adioi.h has the ADIOI_Fns_struct define */ -#include "adioi.h" - -struct ADIOI_Fns_struct ADIO_TESTFS_operations = { - ADIOI_TESTFS_Open, /* Open */ - ADIOI_GEN_OpenColl, /* OpenColl */ - ADIOI_TESTFS_ReadContig, /* ReadContig */ - ADIOI_TESTFS_WriteContig, /* WriteContig */ - ADIOI_TESTFS_ReadStridedColl, /* ReadStridedColl */ - ADIOI_TESTFS_WriteStridedColl, /* WriteStridedColl */ - ADIOI_TESTFS_SeekIndividual, /* SeekIndividual */ - ADIOI_TESTFS_Fcntl, /* Fcntl */ - ADIOI_TESTFS_SetInfo, /* SetInfo */ - ADIOI_TESTFS_ReadStrided, /* ReadStrided */ - ADIOI_TESTFS_WriteStrided, /* WriteStrided */ - ADIOI_TESTFS_Close, /* Close */ - ADIOI_TESTFS_IreadContig, /* IreadContig */ - ADIOI_TESTFS_IwriteContig, /* IwriteContig */ - ADIOI_TESTFS_ReadDone, /* ReadDone */ - ADIOI_TESTFS_WriteDone, /* WriteDone */ - ADIOI_TESTFS_ReadComplete, /* ReadComplete */ - ADIOI_TESTFS_WriteComplete, /* WriteComplete */ - ADIOI_TESTFS_IreadStrided, /* IreadStrided */ - ADIOI_TESTFS_IwriteStrided, /* IwriteStrided */ - ADIOI_TESTFS_Flush, /* Flush */ - ADIOI_TESTFS_Resize, /* Resize */ - ADIOI_TESTFS_Delete, /* Delete */ - ADIOI_GEN_Feature, /* Features */ - "TESTFS: the logging-only file system", - ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ - ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ -}; diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs.h b/3rd-party/romio321/adio/ad_testfs/ad_testfs.h deleted file mode 100644 index 7f51ced0d2d..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs.h +++ /dev/null @@ -1,85 +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. - */ - -#ifndef AD_TESTFS_INCLUDE -#define AD_TESTFS_INCLUDE - -#include "adio.h" -#include -#include -#include -#include - -void ADIOI_TESTFS_Open(ADIO_File fd, int *error_code); -void ADIOI_TESTFS_Close(ADIO_File fd, int *error_code); -void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_TESTFS_WriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_TESTFS_IwriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -int ADIOI_TESTFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int - *error_code); -int ADIOI_TESTFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int - *error_code); -void ADIOI_TESTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); -void ADIOI_TESTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code); -void ADIOI_TESTFS_WriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code); -void ADIOI_TESTFS_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_TESTFS_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_TESTFS_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_TESTFS_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_TESTFS_IwriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_TESTFS_Flush(ADIO_File fd, int *error_code); -void ADIOI_TESTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, - int whence, int *error_code); -void ADIOI_TESTFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, - ADIO_Offset *shared_fp, - int *error_code); -void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, - int *error_code); -void ADIOI_TESTFS_Delete(const char *filename, int *error_code); - -#endif - - - - diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_close.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_close.c deleted file mode 100644 index a1b85e600d0..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_close.c +++ /dev/null @@ -1,22 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Close(ADIO_File fd, int *error_code) -{ - int myrank, nprocs; - - fd->fd_sys = -1; - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Close called on %s\n", myrank, - nprocs, fd->filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_delete.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_delete.c deleted file mode 100644 index 9a1b6f37e12..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_delete.c +++ /dev/null @@ -1,21 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Delete(const char *filename, int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Delete called on %s\n", - myrank, nprocs, filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_done.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_done.c deleted file mode 100644 index 2ee3111587e..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_done.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_testfs.h" -#include "adioi.h" - -int ADIOI_TESTFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int - *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size( MPI_COMM_WORLD, &nprocs ); - MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadDone called on ADIO_REQUEST_NULL\n", - myrank, nprocs); - return 1; -} - - -int ADIOI_TESTFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int - *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size( MPI_COMM_WORLD, &nprocs ); - MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); - FPRINTF(stdout, - "[%d/%d] ADIOI_TESTFS_WriteDone called on ADIO_REQUEST_NULL\n", - myrank, nprocs); - return 1; -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_fcntl.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_fcntl.c deleted file mode 100644 index 8b1e516d9a2..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_fcntl.c +++ /dev/null @@ -1,49 +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_testfs.h" -#include "adioi.h" -#include "adio_extern.h" - -void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code) -{ - int myrank, nprocs; - static char myname[] = "ADIOI_TESTFS_FCNTL"; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Fcntl called on %s\n", - myrank, nprocs, fd->filename); - - switch(flag) { - case ADIO_FCNTL_GET_FSIZE: - fcntl_struct->fsize = 0; - *error_code = MPI_SUCCESS; - break; - - case ADIO_FCNTL_SET_DISKSPACE: - *error_code = MPI_SUCCESS; - 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_testfs/ad_testfs_flush.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_flush.c deleted file mode 100644 index 23d559787d3..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_flush.c +++ /dev/null @@ -1,21 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Flush(ADIO_File fd, int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Flush called on %s\n", - myrank, nprocs, fd->filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_getsh.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_getsh.c deleted file mode 100644 index 2bdb3dceb80..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_getsh.c +++ /dev/null @@ -1,23 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Get_shared_fp(ADIO_File fd, int size, - ADIO_Offset *shared_fp, - int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Get_shared_fp called on %s\n", - myrank, nprocs, fd->filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_hints.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_hints.c deleted file mode 100644 index a6c1be9e9fa..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_hints.c +++ /dev/null @@ -1,27 +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_testfs.h" -#include "adioi.h" -#ifdef ROMIO_BGL -#include "../ad_bgl/ad_bgl.h" -#endif -void ADIOI_TESTFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_SetInfo called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_SetInfo\n", - myrank, nprocs); - - ADIOI_GEN_SetInfo(fd, users_info, error_code); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_iread.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_iread.c deleted file mode 100644 index 77e862438c6..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_iread.c +++ /dev/null @@ -1,62 +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_testfs.h" -#include "adioi.h" - -/* ADIOI_TESTFS_IreadContig() - * - * Implemented by immediately calling ReadContig() - */ -void ADIOI_TESTFS_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code) -{ - ADIO_Status status; - int myrank, nprocs; - MPI_Count typesize, len; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - MPI_Type_size_x(datatype, &typesize); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IreadContig called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_ReadContig\n", - myrank, nprocs); - - len = count * typesize; - ADIOI_TESTFS_ReadContig(fd, buf, len, MPI_BYTE, file_ptr_type, - offset, &status, error_code); - - MPIO_Completed_request_create(&fd, len, error_code, request); -} - -void ADIOI_TESTFS_IreadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code) -{ - ADIO_Status status; - int myrank, nprocs; - MPI_Count typesize; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - MPI_Type_size_x(datatype, &typesize); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IreadStrided called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_ReadStrided\n", - myrank, nprocs); - - ADIOI_TESTFS_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - MPIO_Completed_request_create(&fd, count*typesize, error_code, request); -} - diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_iwrite.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_iwrite.c deleted file mode 100644 index e29c9f6ee03..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_iwrite.c +++ /dev/null @@ -1,68 +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_testfs.h" -#include "adioi.h" - -#include "mpiu_greq.h" -#include "../../mpi-io/mpioimpl.h" - -/* ADIOI_TESTFS_IwriteContig() - * - * Implemented by immediately calling WriteContig() - */ -void ADIOI_TESTFS_IwriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code) -{ - ADIO_Status status; - int myrank, nprocs; - MPI_Count typesize, len; - - *error_code = MPI_SUCCESS; - - MPI_Type_size_x(datatype, &typesize); - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IwriteContig called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_WriteContig\n", - myrank, nprocs); - - len = count * typesize; - ADIOI_TESTFS_WriteContig(fd, buf, len, MPI_BYTE, file_ptr_type, - offset, &status, error_code); - MPIO_Completed_request_create(&fd, len, error_code, request); - -} - -void ADIOI_TESTFS_IwriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code) -{ - ADIO_Status status; - int myrank, nprocs; - MPI_Count typesize; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - MPI_Type_size_x(datatype, &typesize); - - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_IwriteStrided called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_TESTFS_WriteStrided\n", - myrank, nprocs); - - ADIOI_TESTFS_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - MPIO_Completed_request_create(&fd, count*typesize, error_code, request); - -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_open.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_open.c deleted file mode 100644 index 6b1595b99ca..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_open.c +++ /dev/null @@ -1,23 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Open(ADIO_File fd, int *error_code) -{ - int myrank, nprocs; - - fd->fd_sys = 1; - fd->fd_direct = -1; - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Open called on %s\n", myrank, - nprocs, fd->filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_rdcoll.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_rdcoll.c deleted file mode 100644 index 5df94458fdd..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_rdcoll.c +++ /dev/null @@ -1,29 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_ReadStridedColl(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); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStridedColl called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStridedColl\n", - myrank, nprocs); - - ADIOI_GEN_ReadStridedColl(fd, buf, count, datatype, file_ptr_type, - offset, status, error_code); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_read.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_read.c deleted file mode 100644 index f60a9920f76..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_read.c +++ /dev/null @@ -1,62 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code) -{ - int myrank, nprocs; - MPI_Count datatype_size; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - MPI_Type_size_x(datatype, &datatype_size); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadContig called on %s\n", myrank, - nprocs, fd->filename); - if (file_ptr_type != ADIO_EXPLICIT_OFFSET) - { - offset = fd->fp_ind; - fd->fp_ind += datatype_size * count; - fd->fp_sys_posn = fd->fp_ind; - } - else { - fd->fp_sys_posn = offset + datatype_size * count; - } - - FPRINTF(stdout, "[%d/%d] reading (buf = %p, loc = %lld, sz = %lld)\n", - myrank, nprocs, buf, (long long) offset, - (long long) datatype_size * count); - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, datatype_size * count); -#endif -} - -void ADIOI_TESTFS_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); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStrided called on %s\n", myrank, - nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStrided\n", myrank, - nprocs); - - ADIOI_GEN_ReadStrided(fd, buf, count, datatype, file_ptr_type, offset, - status, error_code); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_resize.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_resize.c deleted file mode 100644 index a4a37eb94bb..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_resize.c +++ /dev/null @@ -1,21 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Resize called on %s\n", - myrank, nprocs, fd->filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_seek.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_seek.c deleted file mode 100644 index 9366a1215e5..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_seek.c +++ /dev/null @@ -1,82 +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_testfs.h" -#include "adioi.h" -#include "adio_extern.h" - -/* ADIOI_TESTFS_SeekIndividual() - * - * Implements SEEK_SET only (and doesn't test for whence type); all - * other types of whence must be converted before calling this. - * - * Returns an absolute offset in bytes. The offset passed into the call is in - * terms of the etype relative to the filetype, so some calculations are - * necessary. - */ -ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset, - int whence, int *error_code) -{ - int myrank, nprocs; - - ADIO_Offset off; - ADIOI_Flatlist_node *flat_file; - int i, n_etypes_in_filetype, n_filetypes, etype_in_filetype; - ADIO_Offset abs_off_in_filetype=0, sum; - int size_in_filetype; - int filetype_is_contig; - MPI_Count filetype_size; - MPI_Aint etype_size, filetype_extent, lb; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_SeekIndividual called on %s\n", - myrank, nprocs, fd->filename); - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - etype_size = fd->etype_size; - - if (filetype_is_contig) off = fd->disp + etype_size * offset; - else { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - MPI_Type_size_x(fd->filetype, &filetype_size); - if ( ! filetype_size ) { - *error_code = MPI_SUCCESS; - return 0; - } - - n_etypes_in_filetype = filetype_size/etype_size; - ADIOI_Assert((offset / n_etypes_in_filetype) == (int) (offset / n_etypes_in_filetype)); - 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) { - abs_off_in_filetype = flat_file->indices[i] + - size_in_filetype - (sum - flat_file->blocklens[i]); - break; - } - } - - /* abs. offset in bytes in the file */ - off = fd->disp + (ADIO_Offset)n_filetypes * (ADIO_Offset)filetype_extent + - abs_off_in_filetype; - } - - fd->fp_ind = off; - - return off; -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_setsh.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_setsh.c deleted file mode 100644 index 6fc8a04be9f..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_setsh.c +++ /dev/null @@ -1,22 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, - int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Set_shared_fp called on %s\n", - myrank, nprocs, fd->filename); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_wait.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_wait.c deleted file mode 100644 index 6eef9ef7060..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_wait.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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadComplete called \n", - myrank, nprocs); - - /* do something with status set bytes? */ -} - -void ADIOI_TESTFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteComplete called\n", - myrank, nprocs); - - /* do something with status_set_bytes? */ -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_wrcoll.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_wrcoll.c deleted file mode 100644 index ac11f5847f3..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_wrcoll.c +++ /dev/null @@ -1,29 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_WriteStridedColl(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStridedColl called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_WriteStridedColl\n", - myrank, nprocs); - - ADIOI_GEN_WriteStridedColl(fd, buf, count, datatype, file_ptr_type, - offset, status, error_code); -} diff --git a/3rd-party/romio321/adio/ad_testfs/ad_testfs_write.c b/3rd-party/romio321/adio/ad_testfs/ad_testfs_write.c deleted file mode 100644 index e1a59ff0101..00000000000 --- a/3rd-party/romio321/adio/ad_testfs/ad_testfs_write.c +++ /dev/null @@ -1,63 +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_testfs.h" -#include "adioi.h" - -void ADIOI_TESTFS_WriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code) -{ - int myrank, nprocs; - MPI_Count datatype_size; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - MPI_Type_size_x(datatype, &datatype_size); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteContig called on %s\n", myrank, - nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] writing (buf = %p, loc = %lld, sz = %lld)\n", - myrank, nprocs, buf, (long long) offset, - (long long)datatype_size * (long long)count); - - if (file_ptr_type != ADIO_EXPLICIT_OFFSET) - { - fd->fp_ind += datatype_size * count; - fd->fp_sys_posn = fd->fp_ind; - FPRINTF(stdout, "[%d/%d] new file position is %lld\n", myrank, - nprocs, (long long) fd->fp_ind); - } - else { - fd->fp_sys_posn = offset + datatype_size * count; - } - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, datatype_size * count); -#endif -} - -void ADIOI_TESTFS_WriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - int myrank, nprocs; - - *error_code = MPI_SUCCESS; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStrided called on %s\n", - myrank, nprocs, fd->filename); - FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_WriteStrided\n", - myrank, nprocs); - - ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, - status, error_code); -} diff --git a/3rd-party/romio321/adio/ad_ufs/Makefile.mk b/3rd-party/romio321/adio/ad_ufs/Makefile.mk deleted file mode 100644 index 40ecdb4ae4e..00000000000 --- a/3rd-party/romio321/adio/ad_ufs/Makefile.mk +++ /dev/null @@ -1,17 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if BUILD_AD_UFS - -noinst_HEADERS += adio/ad_ufs/ad_ufs.h - -romio_other_sources += \ - adio/ad_ufs/ad_ufs.c \ - adio/ad_ufs/ad_ufs_open.c - -endif BUILD_AD_UFS - diff --git a/3rd-party/romio321/adio/ad_ufs/ad_ufs.c b/3rd-party/romio321/adio/ad_ufs/ad_ufs.c deleted file mode 100644 index a7134dce0b0..00000000000 --- a/3rd-party/romio321/adio/ad_ufs/ad_ufs.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. - */ - -#include "ad_ufs.h" - -/* adioi.h has the ADIOI_Fns_struct define */ -#include "adioi.h" - -struct ADIOI_Fns_struct ADIO_UFS_operations = { - ADIOI_UFS_Open, /* Open */ - ADIOI_GEN_OpenColl, /* OpenColl */ - ADIOI_GEN_ReadContig, /* ReadContig */ - ADIOI_GEN_WriteContig, /* WriteContig */ - ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ - ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ - ADIOI_GEN_SeekIndividual, /* SeekIndividual */ - ADIOI_GEN_Fcntl, /* Fcntl */ - ADIOI_GEN_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_GEN_Resize, /* Resize */ - ADIOI_GEN_Delete, /* Delete */ - ADIOI_GEN_Feature, /* Features */ - "UFS: Generic ROMIO driver for all UNIX-like file systems", - ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ - ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ -}; diff --git a/3rd-party/romio321/adio/ad_ufs/ad_ufs.h b/3rd-party/romio321/adio/ad_ufs/ad_ufs.h deleted file mode 100644 index 72d66f853bf..00000000000 --- a/3rd-party/romio321/adio/ad_ufs/ad_ufs.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. - */ - -#ifndef AD_UNIX_INCLUDE -#define AD_UNIX_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_UFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, - int wr, void *handle); - -void ADIOI_UFS_Open(ADIO_File fd, int *error_code); -void ADIOI_UFS_IwriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_UFS_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -int ADIOI_UFS_ReadDone(ADIO_Request *request, ADIO_Status *status, int - *error_code); -int ADIOI_UFS_WriteDone(ADIO_Request *request, ADIO_Status *status, int - *error_code); -void ADIOI_UFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); -void ADIOI_UFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIOI_UFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); - -#endif diff --git a/3rd-party/romio321/adio/ad_ufs/ad_ufs_open.c b/3rd-party/romio321/adio/ad_ufs/ad_ufs_open.c deleted file mode 100644 index 9d5a2a11741..00000000000 --- a/3rd-party/romio321/adio/ad_ufs/ad_ufs_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_ufs.h" - -void ADIOI_UFS_Open(ADIO_File fd, int *error_code) -{ - int perm, old_mask, amode; - static char myname[] = "ADIOI_UFS_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_xfs/Makefile.mk b/3rd-party/romio321/adio/ad_xfs/Makefile.mk deleted file mode 100644 index 9a2d7078a3e..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/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_XFS - -noinst_HEADERS += adio/ad_xfs/ad_xfs.h - -romio_other_sources += \ - adio/ad_xfs/ad_xfs.c \ - adio/ad_xfs/ad_xfs_fcntl.c \ - adio/ad_xfs/ad_xfs_hints.c \ - adio/ad_xfs/ad_xfs_open.c \ - adio/ad_xfs/ad_xfs_read.c \ - adio/ad_xfs/ad_xfs_resize.c \ - adio/ad_xfs/ad_xfs_write.c - -endif BUILD_AD_XFS - diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs.c deleted file mode 100644 index f43e0e86b7c..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs.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. - */ - -#include "ad_xfs.h" - -/* adioi.h has the ADIOI_Fns_struct define */ -#include "adioi.h" - -struct ADIOI_Fns_struct ADIO_XFS_operations = { - ADIOI_XFS_Open, /* Open */ - ADIOI_GEN_OpenColl, /* OpenColl */ - ADIOI_XFS_ReadContig, /* ReadContig */ - ADIOI_XFS_WriteContig, /* WriteContig */ - ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ - ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ - ADIOI_GEN_SeekIndividual, /* SeekIndividual */ - ADIOI_XFS_Fcntl, /* Fcntl */ - ADIOI_XFS_SetInfo, /* SetInfo */ - ADIOI_GEN_ReadStrided, /* ReadStrided */ - ADIOI_GEN_WriteStrided, /* WriteStrided */ - ADIOI_GEN_Close, /* Close */ -#if defined(ROMIO_HAVE_WORKING_AIO) - ADIOI_GEN_IreadContig, /* IreadContig */ - ADIOI_GEN_IwriteContig, /* IwriteContig */ -#else - ADIOI_FAKE_IreadContig, /* IreadContig */ - ADIOI_FAKE_IwriteContig, /* IwriteContig */ -#endif /* ROMIO_HAVE_WORKING_AIO */ - 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_XFS_Resize, /* Resize */ - ADIOI_GEN_Delete, /* Delete */ - ADIOI_GEN_Feature, /* Features */ - "XFS: SGI XFS", - ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ - ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ -}; diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs.h b/3rd-party/romio321/adio/ad_xfs/ad_xfs.h deleted file mode 100644 index d14858d4aa5..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs.h +++ /dev/null @@ -1,39 +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_XFS_INCLUDE -#define AD_XFS_INCLUDE - -#include -#include -#include -#include "adio.h" - -#if defined(MPISGI) -#include "xfs/xfs_fs.h" -#ifndef __USE_LARGEFILE64 -#define __USE_LARGEFILE64 -#endif -typedef struct aiocb64 aiocb64_t; -#endif - -void ADIOI_XFS_Open(ADIO_File fd, int *error_code); -void ADIOI_XFS_Close(ADIO_File fd, int *error_code); -void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_XFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); -void ADIOI_XFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -void ADIOI_XFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); - -#endif diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs_fcntl.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs_fcntl.c deleted file mode 100644 index 1f19081afca..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs_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_xfs.h" -#include "adio_extern.h" -#include - -#ifndef HAVE_LSEEK64 -#define lseek64 lseek -#endif - -void ADIOI_XFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code) -{ - int i, err; -#if defined(LINUX) && defined(MPISGI) - struct xfs_flock64 fl; -#else - struct flock64 fl; -#endif - static char myname[] = "ADIOI_XFS_FCNTL"; - - switch(flag) { - case ADIO_FCNTL_GET_FSIZE: - fcntl_struct->fsize = lseek64(fd->fd_sys, 0, SEEK_END); - 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: - i = 0; - fl.l_start = 0; - fl.l_whence = SEEK_SET; - fl.l_len = fcntl_struct->diskspace; - -#if defined(LINUX) && defined(MPISGI) - err = ioctl(fd->fd_sys, XFS_IOC_RESVSP64, &fl); -#else - err = fcntl(fd->fd_sys, F_RESVSP64, &fl); -#endif - - if (err) i = 1; - if (fcntl_struct->diskspace > lseek64(fd->fd_sys, 0, SEEK_END)) { - /* also need to set the file size */ - err = ftruncate64(fd->fd_sys, fcntl_struct->diskspace); - if (err) i = 1; - } - - if (i == 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: - 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_xfs/ad_xfs_hints.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs_hints.c deleted file mode 100644 index 0fe0e832f4c..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs_hints.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. - */ - -#include "ad_xfs.h" -#include "adio_extern.h" - -static unsigned xfs_direct_read_chunk_size; -static unsigned xfs_direct_write_chunk_size; - -void ADIOI_XFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code) -{ - char *value, * c; - int flag; - static char xfs_initialized = 0; - - if (fd->info == MPI_INFO_NULL) 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; - - if (!xfs_initialized) { - xfs_initialized = 1; - c = getenv("MPIO_DIRECT_READ_CHUNK_SIZE"); - if (c) { - int io; - io = atoi(c); - if (io <= 0) { - fprintf(stderr, -"MPI: Ignoring an invalid setting for MPIO_DIRECT_READ_CHUNK_SIZE.\n" -" It must be set to a positive integer value.\n"); - } else { - xfs_direct_read_chunk_size = io; - } - } else { - xfs_direct_read_chunk_size = 0; - } - - c = getenv("MPIO_DIRECT_WRITE_CHUNK_SIZE"); - if (c) { - int io; - io = atoi(c); - if (io <= 0) { - fprintf(stderr, -"MPI: Ignoring an invalid setting for MPIO_DIRECT_WRITE_CHUNK_SIZE.\n" -" It must be set to a positive integer value.\n"); - } else { - xfs_direct_write_chunk_size = io; - } - } else { - xfs_direct_write_chunk_size = 0; - } - } - - if (!fd->hints->initialized) { - fd->hints->fs_hints.xfs.read_chunk_sz = - xfs_direct_read_chunk_size; - fd->hints->fs_hints.xfs.write_chunk_sz = - xfs_direct_write_chunk_size; - } - - /* has user specified values for keys "direct_read" and "direct write"? */ - if (users_info != MPI_INFO_NULL) { - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - - ADIOI_Info_get(users_info, "direct_read", MPI_MAX_INFO_VAL, - value, &flag); - if (flag && !strcmp(value, "true")) { - ADIOI_Info_set(fd->info, "direct_read", "true"); - fd->direct_read = 1; - } - - ADIOI_Info_get(users_info, "direct_write", MPI_MAX_INFO_VAL, - value, &flag); - if (flag && !strcmp(value, "true")) { - ADIOI_Info_set(fd->info, "direct_write", "true"); - fd->direct_write = 1; - } - - ADIOI_Free(value); - } - - /* set the values for collective I/O and data sieving parameters */ - ADIOI_GEN_SetInfo(fd, users_info, error_code); - - /* Environment variables override MPI_Info hints */ - if (ADIOI_Direct_read) fd->direct_read = 1; - if (ADIOI_Direct_write) fd->direct_write = 1; - - /* environment variables checked in ADIO_Init */ - - *error_code = MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs_open.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs_open.c deleted file mode 100644 index 5c0a9a2b8ae..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs_open.c +++ /dev/null @@ -1,111 +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. - */ - -#define _GNU_SOURCE // for O_DIRECT - -#include "ad_xfs.h" -#include -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifndef HAVE_LSEEK64 -#define lseek64 lseek -#endif - -void ADIOI_XFS_Open(ADIO_File fd, int *error_code) -{ - int perm, amode, amode_direct, factor; - unsigned int old_mask; - struct dioattr st; - static char myname[] = "ADIOI_XFS_OPEN"; - unsigned read_chunk_sz = fd->hints->fs_hints.xfs.read_chunk_sz; - unsigned write_chunk_sz = fd->hints->fs_hints.xfs.write_chunk_sz; - - 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; - - amode_direct = amode | O_DIRECT; - - if (fd->access_mode & ADIO_EXCL) - amode = amode | O_EXCL; - - fd->fd_sys = open(fd->filename, amode, perm); - - fd->fd_direct = open(fd->filename, amode_direct, perm); - if (fd->fd_direct != -1) { - -#if defined(MPISGI) - ioctl(fd->fd_direct, XFS_IOC_DIOINFO, &st); -#else - fcntl(fd->fd_direct, F_DIOINFO, &st); -#endif - - fd->d_mem = st.d_mem; - fd->d_miniosz = st.d_miniosz; - - if (read_chunk_sz == 0) { - fd->hints->fs_hints.xfs.read_chunk_sz = st.d_maxiosz; - } else { - /* - * MPIO_DIRECT_READ_CHUNK_SIZE was set. - * Make read_chunk_sz a multiple of d_miniosz. - */ - factor = read_chunk_sz / fd->d_miniosz; - if (factor == 0 || read_chunk_sz != fd->d_miniosz * factor) { - fd->hints->fs_hints.xfs.read_chunk_sz = - fd->d_miniosz * (factor + 1); - } - } - - if (write_chunk_sz == 0) { - fd->hints->fs_hints.xfs.write_chunk_sz = st.d_maxiosz; - } else { - /* - * MPIO_DIRECT_WRITE_CHUNK_SIZE was set. - * Make write_chunk_sz a multiple of d_miniosz. - */ - factor = write_chunk_sz / fd->d_miniosz; - if (factor == 0 || write_chunk_sz != fd->d_miniosz * factor) { - fd->hints->fs_hints.xfs.write_chunk_sz = - fd->d_miniosz * (factor + 1); - } - } - - if (fd->d_mem > XFS_MEMALIGN) { - FPRINTF(stderr, "MPI: Run-time Direct-IO memory alignment, %d, does not match compile-time value, %d.\n", - fd->d_mem, XFS_MEMALIGN); - FPRINTF(stderr, "MPI: Report this error and rerun with Direct-IO disabled.\n"); - close(fd->fd_direct); - fd->fd_direct = -1; - } - } - - if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND)) - fd->fp_ind = lseek64(fd->fd_sys, 0, SEEK_END); - - fd->fp_sys_posn = -1; /* set it to null because we use pread/pwrite */ - - if ((fd->fd_sys == -1) || (fd->fd_direct == -1)) { - *error_code = ADIOI_Err_create_code(mymame, fd->filename, errno); - } - else *error_code = MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs_read.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs_read.c deleted file mode 100644 index c3c237cc15d..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs_read.c +++ /dev/null @@ -1,152 +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_xfs.h" -#ifdef HAVE_MALLOC_H -#include -#endif - -/* style: allow:free:2 sig:0 */ - -static void ADIOI_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, - ADIO_Offset offset, int *err); - -void ADIOI_XFS_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code) -{ - int diff, size, nbytes; - MPI_Count err=-1, datatype_size, len; - void *newbuf; - static char myname[] = "ADIOI_XFS_READCONTIG"; - - MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * count; - - fd->fp_sys_posn = -1; /* set it to null, since we are using pread */ - - if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind; - - if (!(fd->direct_read)) /* direct I/O not enabled */ - err = pread(fd->fd_sys, buf, len, offset); - else { /* direct I/O enabled */ - - /* (1) if mem_aligned && file_aligned - use direct I/O to read up to correct io_size - use buffered I/O for remaining */ - - if (!(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz)) - ADIOI_XFS_Aligned_Mem_File_Read(fd, buf, len, offset, &err); - - /* (2) if !file_aligned - use buffered I/O to read up to file_aligned - At that point, if still mem_aligned, use (1) - else copy into aligned buf and then use (1) */ - else if (offset % fd->d_miniosz) { - diff = fd->d_miniosz - (offset % fd->d_miniosz); - diff = ADIOI_MIN(diff, len); - nbytes = pread(fd->fd_sys, buf, diff, offset); - - buf = ((char *) buf) + diff; - offset += diff; - size = len - diff; - if (!(((long) buf) % fd->d_mem)) { - ADIOI_XFS_Aligned_Mem_File_Read(fd, buf, size, offset, &err); - nbytes += err; - } - else { - newbuf = (void *) memalign(XFS_MEMALIGN, size); - if (newbuf) { - ADIOI_XFS_Aligned_Mem_File_Read(fd, newbuf, size, offset, &err); - if (err > 0) memcpy(buf, newbuf, err); - nbytes += err; - ADIOI_Free(newbuf); - } - else nbytes += pread(fd->fd_sys, buf, size, offset); - } - err = nbytes; - } - - /* (3) if !mem_aligned && file_aligned - copy into aligned buf, then use (1) */ - else { - newbuf = (void *) memalign(XFS_MEMALIGN, len); - if (newbuf) { - ADIOI_XFS_Aligned_Mem_File_Read(fd, newbuf, len, offset, &err); - if (err > 0) memcpy(buf, newbuf, err); - ADIOI_Free(newbuf); - } - else err = pread(fd->fd_sys, buf, len, offset); - } - } - - 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 - - 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_XFS_Aligned_Mem_File_Read(ADIO_File fd, void *buf, int len, - ADIO_Offset offset, int *err) -{ - int ntimes, rem, newrem, i, size, nbytes; - unsigned read_chunk_sz = fd->hints->fs_hints.xfs.read_chunk_sz; - - /* memory buffer is aligned, offset in file is aligned, - io_size may or may not be of the right size. - use direct I/O to read up to correct io_size, - use buffered I/O for remaining. */ - - if (!(len % fd->d_miniosz) && - (len >= fd->d_miniosz) && (len <= read_chunk_sz)) - *err = pread(fd->fd_direct, buf, len, offset); - else if (len < fd->d_miniosz) - *err = pread(fd->fd_sys, buf, len, offset); - else if (len > read_chunk_sz) { - ntimes = len/(read_chunk_sz); - rem = len - ntimes * read_chunk_sz; - nbytes = 0; - for (i=0; ifd_direct, ((char *)buf) + i * read_chunk_sz, - read_chunk_sz, offset); - offset += read_chunk_sz; - } - if (rem) { - if (!(rem % fd->d_miniosz)) - nbytes += pread(fd->fd_direct, - ((char *)buf) + ntimes * read_chunk_sz, rem, offset); - else { - newrem = rem % fd->d_miniosz; - size = rem - newrem; - if (size) { - nbytes += pread(fd->fd_direct, - ((char *)buf) + ntimes * read_chunk_sz, size, offset); - offset += size; - } - nbytes += pread(fd->fd_sys, - ((char *)buf) + ntimes * read_chunk_sz + size, newrem, offset); - } - } - *err = nbytes; - } - else { - rem = len % fd->d_miniosz; - size = len - rem; - nbytes = pread(fd->fd_direct, buf, size, offset); - nbytes += pread(fd->fd_sys, (char *)buf + size, rem, offset+size); - *err = nbytes; - } -} diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs_resize.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs_resize.c deleted file mode 100644 index 8caf8b48bd7..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs_resize.c +++ /dev/null @@ -1,22 +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_xfs.h" - -void ADIOI_XFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) -{ - int err; - static char myname[] = "ADIOI_XFS_RESIZE"; - - err = ftruncate64(fd->fd_sys, size); - if (err == -1) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, "**io", - "**io %s", strerror(errno)); - } - else *error_code = MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/ad_xfs/ad_xfs_write.c b/3rd-party/romio321/adio/ad_xfs/ad_xfs_write.c deleted file mode 100644 index 9ab82768f76..00000000000 --- a/3rd-party/romio321/adio/ad_xfs/ad_xfs_write.c +++ /dev/null @@ -1,171 +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_xfs.h" - -#ifdef HAVE_MALLOC_H -#include -#endif - -/* style: allow:free:2 sig:0 */ - -static int ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, - ADIO_Offset len, ADIO_Offset offset); - -void ADIOI_XFS_WriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code) -{ - int diff, size; - MPI_Count err=-1, datatype_size; - ssize_t len; - void *newbuf; - static char myname[] = "ADIOI_XFS_WRITECONTIG"; - - MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * count; - - fd->fp_sys_posn = -1; /* set it to null, since we are using pwrite */ - - if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind; - - if (!(fd->direct_write)) { /* direct I/O not enabled */ - err = pwrite(fd->fd_sys, buf, len, offset); - if (err < 0) {goto leaving;} - } else { /* direct I/O enabled */ - - /* (1) if mem_aligned && file_aligned - use direct I/O to write up to correct io_size - use buffered I/O for remaining */ - - if (!(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz)) { - err = ADIOI_XFS_Aligned_Mem_File_Write(fd, buf, len, offset); - if (err < 0) {goto leaving;} - - /* (2) if !file_aligned - use buffered I/O to write up to file_aligned - At that point, if still mem_aligned, use (1) - else copy into aligned buf and then use (1) */ - } else if (offset % fd->d_miniosz) { - diff = fd->d_miniosz - (offset % fd->d_miniosz); - diff = ADIOI_MIN(diff, len); - err = pwrite(fd->fd_sys, buf, diff, offset); - if (err < 0) {goto leaving;} - - buf = ((char *) buf) + diff; - offset += diff; - size = len - diff; - if (!(((long) buf) % fd->d_mem)) { - err = ADIOI_XFS_Aligned_Mem_File_Write(fd, buf, size, offset); - if (err < 0) {goto leaving;} - } - else { - newbuf = (void *) memalign(XFS_MEMALIGN, size); - if (newbuf) { - memcpy(newbuf, buf, size); - err = ADIOI_XFS_Aligned_Mem_File_Write(fd, newbuf, size, offset); - ADIOI_Free(newbuf); - if (err < 0) {goto leaving;} - } else { - err = pwrite(fd->fd_sys, buf, size, offset); - if (err < 0) {goto leaving;} - } - } - } - - /* (3) if !mem_aligned && file_aligned - copy into aligned buf, then use (1) */ - else { - newbuf = (void *) memalign(XFS_MEMALIGN, len); - if (newbuf) { - memcpy(newbuf, buf, len); - err = ADIOI_XFS_Aligned_Mem_File_Write(fd, newbuf, len, offset); - ADIOI_Free(newbuf); - } else { - err = pwrite(fd->fd_sys, buf, len, offset); - } - - if (err < 0) {goto leaving;} - } - } - - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; - -#ifdef HAVE_STATUS_SET_BYTES - if (err != -1) MPIR_Status_set_bytes(status, datatype, len); -#endif -leaving: - 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; -} - - -static int -ADIOI_XFS_Aligned_Mem_File_Write(ADIO_File fd, void *buf, ADIO_Offset len, - ADIO_Offset offset) -{ - unsigned write_chunk_sz = fd->hints->fs_hints.xfs.write_chunk_sz; - ADIO_Offset nbytes, rem, newrem, size; - int ntimes, i; - - /* memory buffer is aligned, offset in file is aligned, - io_size may or may not be of the right size. - use direct I/O to write up to correct io_size, - use buffered I/O for remaining. */ - - if (!(len % fd->d_miniosz) && - (len >= fd->d_miniosz) && (len <= write_chunk_sz)) { - nbytes = pwrite(fd->fd_direct, buf, len, offset); - if (nbytes < 0) {return -1;} - } else if (len < fd->d_miniosz) { - nbytes = pwrite(fd->fd_sys, buf, len, offset); - if (nbytes < 0) {return -1;} - } else if (len > write_chunk_sz) { - ntimes = len/(write_chunk_sz); - rem = len - ntimes * write_chunk_sz; - nbytes = 0; - for (i=0; ifd_direct, ((char *)buf) + i * write_chunk_sz, - write_chunk_sz, offset); - offset += write_chunk_sz; - if (nbytes < 0) {return -1;} - } - if (rem) { - if (!(rem % fd->d_miniosz)) { - nbytes = pwrite(fd->fd_direct, - ((char *)buf) + ntimes * write_chunk_sz, rem, offset); - if (nbytes < 0) {return -1;} - } else { - newrem = rem % fd->d_miniosz; - size = rem - newrem; - if (size) { - nbytes = pwrite(fd->fd_direct, - ((char *)buf) + ntimes * write_chunk_sz, size, offset); - offset += size; - if (nbytes < 0) {return -1;} - } - nbytes = pwrite(fd->fd_sys, - ((char *)buf) + ntimes * write_chunk_sz + size, newrem, offset); - if (nbytes < 0) {return -1;} - } - } - } - else { - rem = len % fd->d_miniosz; - size = len - rem; - nbytes = pwrite(fd->fd_direct, buf, size, offset); - if (nbytes < 0) {return -1;} - nbytes = pwrite(fd->fd_sys, (char *)buf + size, rem, offset+size); - if (nbytes < 0) {return -1;} - } - - return 0; -} diff --git a/3rd-party/romio321/adio/ad_zoidfs/Makefile.mk b/3rd-party/romio321/adio/ad_zoidfs/Makefile.mk deleted file mode 100644 index a26e59c8e0e..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/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_ZOIDFS - -noinst_HEADERS += adio/ad_zoidfs/ad_zoidfs.h adio/ad_zoidfs/ad_zoidfs_common.h - -romio_other_sources += \ - adio/ad_zoidfs/ad_zoidfs.c \ - adio/ad_zoidfs/ad_zoidfs_close.c \ - adio/ad_zoidfs/ad_zoidfs_common.c \ - adio/ad_zoidfs/ad_zoidfs_delete.c \ - adio/ad_zoidfs/ad_zoidfs_fcntl.c \ - adio/ad_zoidfs/ad_zoidfs_flush.c \ - adio/ad_zoidfs/ad_zoidfs_io.c \ - adio/ad_zoidfs/ad_zoidfs_open.c \ - adio/ad_zoidfs/ad_zoidfs_resize.c \ - adio/ad_zoidfs/ad_zoidfs_features.c \ - adio/ad_zoidfs/ad_zoidfs_read_list.c \ - adio/ad_zoidfs/ad_zoidfs_write_list.c - -endif BUILD_AD_ZOIDFS - diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs.c deleted file mode 100644 index 3c9131aeac4..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_zoidfs.h" - -/* adioi.h has the ADIOI_Fns_struct define */ -#include "adioi.h" - -struct ADIOI_Fns_struct ADIO_ZOIDFS_operations = { - ADIOI_ZOIDFS_Open, /* Open */ - ADIOI_SCALEABLE_OpenColl, /* OpenColl */ - ADIOI_ZOIDFS_ReadContig, /* ReadContig */ - ADIOI_ZOIDFS_WriteContig, /* WriteContig */ - ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ - ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ - ADIOI_GEN_SeekIndividual, /* SeekIndividual */ - ADIOI_ZOIDFS_Fcntl, /* Fcntl */ - ADIOI_GEN_SetInfo, /* SetInfo */ - ADIOI_GEN_ReadStrided, /* ReadStrided */ - ADIOI_ZOIDFS_WriteStrided, /* WriteStrided */ - ADIOI_ZOIDFS_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_ZOIDFS_Flush, /* Flush */ - ADIOI_ZOIDFS_Resize, /* Resize */ - ADIOI_ZOIDFS_Delete, /* Delete */ - ADIOI_ZOIDFS_Feature, - ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */ - ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */ -}; - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs.h b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs.h deleted file mode 100644 index d4999b66228..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs.h +++ /dev/null @@ -1,44 +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_ZOIDFS_INCLUDE -#define AD_ZOIDFS_INCLUDE - -#include "adio.h" -#ifdef HAVE_ZOIDFS_H -#include "zoidfs.h" -#endif - - -typedef zoidfs_handle_t ADIOI_ZOIDFS_object; - -void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code); -void ADIOI_ZOIDFS_Close(ADIO_File fd, int *error_code); -void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_ZOIDFS_WriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_ZOIDFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); -void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_ZOIDFS_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_ZOIDFS_Flush(ADIO_File fd, int *error_code); -void ADIOI_ZOIDFS_Delete(char *filename, int *error_code); -void ADIOI_ZOIDFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -void ADIOI_ZOIDFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -int ADIOI_ZOIDFS_Feature(ADIO_File fd, int flag); -#endif diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_close.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_close.c deleted file mode 100644 index 0126783aa37..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_close.c +++ /dev/null @@ -1,25 +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_zoidfs.h" - -void ADIOI_ZOIDFS_Close(ADIO_File fd, int *error_code) -{ - ADIOI_Free(fd->fs_ptr); - fd->fs_ptr = NULL; - - /* At some point or another it was decided that ROMIO would not - * explicitly flush (other than any local cache) on close, because - * there is no way to *avoid* that overhead if you implement it here - * and don't actually want it. - */ - - *error_code = MPI_SUCCESS; -} -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_common.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_common.c deleted file mode 100644 index 018d439aaa2..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_common.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_zoidfs.h" -#include "ad_zoidfs_common.h" -#include -#include - -/* keyval hack to both tell us if we've already initialized zoidfs and also - * close it down when mpi exits */ -int ADIOI_ZOIDFS_Initialized = MPI_KEYVAL_INVALID; - -void ADIOI_ZOIDFS_End(int *error_code) -{ - int ret; - static char myname[] = "ADIOI_ZOIDFS_END"; - - ret = zoidfs_finalize(); - - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0 ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in zoidfs_finalize", 0); - return; - } - /* --END ERROR HANDLING-- */ - - *error_code = MPI_SUCCESS; -} - -int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval, - void *attribute_val, void *extra_state) -{ - int error_code; - ADIOI_ZOIDFS_End(&error_code); - MPI_Keyval_free(&keyval); - return error_code; -} - -void ADIOI_ZOIDFS_Init(int rank, int *error_code ) -{ - int ret; - static char myname[] = "ADIOI_ZOIDFS_INIT"; - - /* do nothing if we've already fired up the zoidfs interface */ - if (ADIOI_ZOIDFS_Initialized != MPI_KEYVAL_INVALID) { - *error_code = MPI_SUCCESS; - return; - } - - ret = zoidfs_init(); - if (ret < 0 ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in zoidfs_init", - 0); - return; - } - - MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_ZOIDFS_End_call, - &ADIOI_ZOIDFS_Initialized, (void *)0); - /* just like romio does, we make a dummy attribute so we - * get cleaned up */ - MPI_Attr_put(MPI_COMM_SELF, ADIOI_ZOIDFS_Initialized, (void *)0); -} - -void ADIOI_ZOIDFS_makeattribs(zoidfs_sattr_t * attribs) -{ - memset(attribs, 0, sizeof(zoidfs_sattr_t)); - - attribs->mask = ZOIDFS_ATTR_MODE; - attribs->mode = 0644; -} - -int ADIOI_ZOIDFS_error_convert(int error) -{ - switch (error) - { - case ZFSERR_PERM: /* ??? */ - case ZFSERR_ACCES: - return MPI_ERR_ACCESS; - case ZFSERR_NOENT: - case ZFSERR_NXIO: /* ??? */ - case ZFSERR_NODEV: /* ??? */ - return MPI_ERR_NO_SUCH_FILE; - case ZFSERR_IO: - return MPI_ERR_IO; - case ZFSERR_EXIST: - return MPI_ERR_FILE_EXISTS; - case ZFSERR_NOTDIR: /* ??? */ - case ZFSERR_ISDIR: /* ??? */ - case ZFSERR_NAMETOOLONG: - return MPI_ERR_BAD_FILE; - case ZFSERR_INVAL: - case ZFSERR_STALE: - return MPI_ERR_FILE; - case ZFSERR_FBIG: /* ??? */ - case ZFSERR_NOSPC: - return MPI_ERR_NO_SPACE; - case ZFSERR_ROFS: - return MPI_ERR_READ_ONLY; - case ZFSERR_NOTIMPL: - return MPI_ERR_UNSUPPORTED_OPERATION; - case ZFSERR_DQUOT: - return MPI_ERR_QUOTA; - /* case ZFSERR_NOTEMPTY: */ - /* case ZFSERR_WFLUSH: */ - /* case ZFSERR_OTHER: */ - case ZFSERR_NOMEM: - return MPI_ERR_INTERN; - default: - return MPI_UNDEFINED; - } -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_common.h b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_common.h deleted file mode 100644 index ba985b49226..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_common.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#ifndef _AD_ZOIDFS_COMMON_H -#define _AD_ZOIDFS_COMMON_H -#include "ad_zoidfs.h" - -/* The ESTALE problem: - * The IO forwarding protocol can respond to any call with ESTALE, which means - * the handle upon which that call operates has expired from the metadata - * cache. We thus wrap any zoidfs routine (expr) in this macro. - * - * ROMIO stores the filename in the ADIOI_File structrue (fd), so we can always - * re-lookup in response to ESTALE */ - -#define NO_STALE(ret, fd, handle_p, expr) \ - do { \ - (ret) = (expr); \ - while ((ret) == ZFSERR_STALE) { \ - /* lookup again */ \ - (ret) = zoidfs_lookup(NULL, NULL, (fd)->filename, \ - (zoidfs_handle_t*)((fd)->fs_ptr), ZOIDFS_NO_OP_HINT); \ - if ((ret) == ZFS_OK) { \ - *((ADIOI_ZOIDFS_object*)handle_p) \ - = *((ADIOI_ZOIDFS_object*)((fd)->fs_ptr)); \ - /* re-execute the expr with new handle */ \ - (ret) = (expr); \ - } \ - } \ - } while (0) - -void ADIOI_ZOIDFS_Init(int rank, int *error_code ); -void ADIOI_ZOIDFS_makeattribs(zoidfs_sattr_t * attribs); -void ADIOI_ZOIDFS_End(int *error_code); -int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval, - void *attribute_val, void *extra_state); -int ADIOI_ZOIDFS_error_convert(int error); - -#endif diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_delete.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_delete.c deleted file mode 100644 index 87193147a56..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_delete.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_zoidfs.h" -#include "adio.h" - -#include "ad_zoidfs_common.h" - -void ADIOI_ZOIDFS_Delete(char *filename, int *error_code) -{ - int ret; - static char myname[] = "ADIOI_ZOIDFS_DELETE"; - - ADIOI_ZOIDFS_Init(0, error_code); - /* --BEGIN ERROR HANDLING-- */ - if (*error_code != MPI_SUCCESS) - { - /* ADIOI_ZOIDFS_INIT handles creating error codes itself */ - return; - } - /* --END ERROR HANDLING-- */ - - ret = zoidfs_remove(NULL, NULL, filename, NULL, ZOIDFS_NO_OP_HINT); - /* --BEGIN ERROR HANDLING-- */ - if (ret != ZFS_OK) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in zoidfs_remove", 0); - return; - } - /* --END ERROR HANDLING-- */ - - *error_code = MPI_SUCCESS; - return; -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_fcntl.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_fcntl.c deleted file mode 100644 index 22c26714d80..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_fcntl.c +++ /dev/null @@ -1,60 +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_zoidfs.h" -#include "adio_extern.h" -#include "ad_zoidfs_common.h" - -void ADIOI_ZOIDFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code) -{ - int ret; - zoidfs_attr_t attr; - ADIOI_ZOIDFS_object *zoidfs_obj_ptr; - static char myname[] = "ADIOI_ZOIDFS_FCNTL"; - - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr; - - switch(flag) { - case ADIO_FCNTL_GET_FSIZE: - attr.mask = ZOIDFS_ATTR_SIZE; - NO_STALE(ret, fd, zoidfs_obj_ptr, - zoidfs_getattr(zoidfs_obj_ptr, &attr, ZOIDFS_NO_OP_HINT)); - if ( !(attr.mask & ZOIDFS_ATTR_SIZE) || (ret != ZFS_OK ) ) { - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in zoidfs_getattr", 0); - /* --END ERROR HANDLING-- */ - } - else { - *error_code = MPI_SUCCESS; - } - fcntl_struct->fsize = attr.size; - return; - - case ADIO_FCNTL_SET_DISKSPACE: - ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code); - break; - - /* --BEGIN ERROR HANDLING-- */ - 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); - /* --END ERROR HANDLING-- */ - } -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_features.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_features.c deleted file mode 100644 index a3f5c1467e4..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_features.c +++ /dev/null @@ -1,22 +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_zoidfs.h" - -int ADIOI_ZOIDFS_Feature(ADIO_File fd, int flag) -{ - switch(flag) { - case ADIO_SCALABLE_OPEN: - return 1; - 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_zoidfs/ad_zoidfs_flush.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_flush.c deleted file mode 100644 index 8ec0b8d5518..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_flush.c +++ /dev/null @@ -1,52 +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_zoidfs.h" -#include "ad_zoidfs_common.h" - -/* we want to be a bit clever here: at scale, if every client sends a - * flush request, it will stress the file system with redundant - * commit requests. Instead, one process should wait for - * everyone to catch up, do the sync, then broadcast the result. - */ - -void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code) -{ - int ret, rank, dummy=0, dummy_in=0; - ADIOI_ZOIDFS_object *zoidfs_obj_ptr; - static char myname[] = "ADIOI_ZOIDFS_FLUSH"; - - *error_code = MPI_SUCCESS; - - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr; - - MPI_Comm_rank(fd->comm, &rank); - - /* collective call to ensure no outstanding write requests. reduce is - * slightly less expensvie than barrier */ - MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, - fd->hints->ranklist[0], fd->comm); - - if (rank == fd->hints->ranklist[0]) { - ret = zoidfs_commit(zoidfs_obj_ptr, ZOIDFS_NO_OP_HINT); - } - MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - - /* --BEGIN ERROR HANDLING-- */ - if (ret != 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in zoidfs_commit", 0); - } - /* --END ERROR HANDLING-- */ -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_io.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_io.c deleted file mode 100644 index 337c92f4101..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_io.c +++ /dev/null @@ -1,96 +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_zoidfs.h" - -#include "ad_zoidfs_common.h" - -#define ZOIDFS_READ 0 -#define ZOIDFS_WRITE 1 - -static void ZOIDFS_IOContig(ADIO_File fd, void * buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int flag, int *error_code) -{ - int ret; - MPI_Count datatype_size; - uint64_t file_len; - size_t mem_len; - ADIOI_ZOIDFS_object *zoidfs_obj_ptr; - uint64_t file_offset = offset; - static char myname[] = "ADIOI_ZOIDFS_IOCONTIG"; - - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr; - - MPI_Type_size_x(datatype, &datatype_size); - file_len = mem_len = datatype_size * count; - - if (file_ptr_type == ADIO_INDIVIDUAL) { - file_offset = fd->fp_ind; - } - - if (flag == ZOIDFS_READ) { - NO_STALE(ret, fd, zoidfs_obj_ptr, - zoidfs_read(zoidfs_obj_ptr, - 1, &buf, &mem_len, - 1, &file_offset, &file_len, ZOIDFS_NO_OP_HINT)); - } else { - NO_STALE(ret, fd, zoidfs_obj_ptr, - zoidfs_write(zoidfs_obj_ptr, - 1, (const void **)&buf, &mem_len, - 1, &file_offset, &file_len, ZOIDFS_NO_OP_HINT)); - } - /* --BEGIN ERROR HANDLING-- */ - if (ret != ZFS_OK ) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in ZOIDFS I/O", 0); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += file_len; - } - fd->fp_sys_posn = file_offset + file_len; - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, file_len); -#endif - - *error_code = MPI_SUCCESS; - -fn_exit: - return; -} - -void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - ZOIDFS_IOContig(fd, buf, count, datatype, file_ptr_type, - offset, status, ZOIDFS_READ, error_code); -} - -void ADIOI_ZOIDFS_WriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - ZOIDFS_IOContig(fd, buf, count, datatype, file_ptr_type, - offset, status, ZOIDFS_WRITE, error_code); -} - - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_open.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_open.c deleted file mode 100644 index 3c22cb54e1f..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_open.c +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2007 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "ad_zoidfs.h" -#include "ad_zoidfs_common.h" - -/* open_status is helpful for bcasting values around */ -struct open_status_s { - int error; - zoidfs_handle_t handle; -}; -typedef struct open_status_s open_status; - -static void fake_an_open(char *fname, int access_mode, - int nr_datafiles, MPI_Offset strip_size, - ADIOI_ZOIDFS_object *zoidfs_ptr, - open_status *o_status) -{ - int ret, created; - zoidfs_sattr_t attribs; - zoidfs_handle_t handle; - - ADIOI_ZOIDFS_makeattribs(&attribs); - - /* zoidfs_create succeeds even if a file already exists, so we can do - * our job with fewer calls than in other cases. However, we need to - * be careful with ADIO_EXCL. - */ - if (access_mode & ADIO_CREATE) { - ret = zoidfs_create(NULL, NULL, - fname, &attribs, &handle, &created, ZOIDFS_NO_OP_HINT); - if ((ret == ZFS_OK) && !created && (access_mode & ADIO_EXCL)) { - /* lookup should not succeed if opened with EXCL */ - o_status->error = ZFSERR_EXIST; - return; - } - } - else { - ret = zoidfs_lookup(NULL, NULL, fname, &handle, ZOIDFS_NO_OP_HINT); - } - - o_status->error = ret; - o_status->handle = handle; - return; -} - - -/* ADIOI_ZOIDFS_Open: - * one process opens (or creates) the file, then broadcasts the result to the - * remaining processors. - * - * ADIO_Open used to perform an optimization when MPI_MODE_CREATE (and before - * that, MPI_MODE_EXCL) was set. Because ZoidFS handles file lookup and - * creation more scalably than traditional file systems, ADIO_Open now skips any - * special handling when CREATE is set. */ -void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code) -{ - int rank; - static char myname[] = "ADIOI_ZOIDFS_OPEN"; - ADIOI_ZOIDFS_object *zoidfs_obj_ptr; - - /* since one process is doing the open, that means one process is also - * doing the error checking. define a struct for both the object reference - * and the error code to broadcast to all the processors */ - - open_status o_status; - MPI_Datatype open_status_type; - MPI_Datatype types[2] = {MPI_INT, MPI_BYTE}; - int lens[2] = {1, sizeof(ADIOI_ZOIDFS_object)}; - MPI_Aint offsets[2]; - - memset(&o_status, 0, sizeof(o_status)); - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *) - ADIOI_Malloc(sizeof(ADIOI_ZOIDFS_object)); - /* --BEGIN ERROR HANDLING-- */ - if (zoidfs_obj_ptr == NULL) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_UNKNOWN, - "Error allocating memory", 0); - return; - } - /* --END ERROR HANDLING-- */ - - MPI_Comm_rank(fd->comm, &rank); - - ADIOI_ZOIDFS_Init(rank, error_code); - if (*error_code != MPI_SUCCESS) - { - /* ADIOI_ZOIDFS_INIT handles creating error codes on its own */ - ADIOI_Free(zoidfs_obj_ptr); - return; - } - - /* one process resolves name and will later bcast to others */ -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_open_a, 0, NULL ); -#endif - if (rank == fd->hints->ranklist[0] && fd->fs_ptr == NULL) { - fake_an_open(fd->filename, fd->access_mode, - fd->hints->striping_factor, - fd->hints->striping_unit, - zoidfs_obj_ptr, &o_status); - /* store credentials and object reference in fd */ - *zoidfs_obj_ptr = o_status.handle; - fd->fs_ptr = zoidfs_obj_ptr; - } -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_open_b, 0, NULL ); -#endif - - /* broadcast status and (possibly valid) object reference */ - MPI_Get_address(&o_status.error, &offsets[0]); - MPI_Get_address(&o_status.handle, &offsets[1]); - - MPI_Type_struct(2, lens, offsets, types, &open_status_type); - MPI_Type_commit(&open_status_type); - - /* Assertion: if we hit this Bcast, then all processes collectively - * called this open. - * - * That's because deferred open never happens with this fs. - */ - MPI_Bcast(MPI_BOTTOM, 1, open_status_type, fd->hints->ranklist[0], - fd->comm); - MPI_Type_free(&open_status_type); - - /* --BEGIN ERROR HANDLING-- */ - if (o_status.error != ZFS_OK) - { - ADIOI_Free(zoidfs_obj_ptr); - fd->fs_ptr = NULL; - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(o_status.error), - "Unknown error", 0); - /* TODO: FIX STRING */ - return; - } - /* --END ERROR HANDLING-- */ - - *zoidfs_obj_ptr = o_status.handle; - fd->fs_ptr = zoidfs_obj_ptr; - - *error_code = MPI_SUCCESS; - return; -} diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_read_list.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_read_list.c deleted file mode 100644 index 3537e63e832..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_read_list.c +++ /dev/null @@ -1,826 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "ad_zoidfs.h" - -#include "ad_zoidfs_common.h" - -/* Copied from ADIOI_PVFS2_OldReadStrided. It would be good to have fewer - * copies of this code... */ -void ADIOI_ZOIDFS_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, 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, filetype_lb, buftype_lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset off, disp, start_off, initial_off; - int flag, st_frd_size, st_n_filetypes; - - size_t mem_list_count, file_list_count; - void ** mem_offsets; - uint64_t *file_offsets; - size_t *mem_lengths; - uint64_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; - ADIOI_ZOIDFS_object * zoidfs_obj_ptr; - int err_flag=0; - MPI_Offset total_bytes_read = 0; - static char myname[] = "ADIOI_ZOIDFS_ReadStrided"; - - /* note: I don't know what zoidfs will do if you pass it a super-long list, - * so let's keep with the PVFS limit for now */ -#define MAX_ARRAY_SIZE 64 - - *error_code = MPI_SUCCESS; /* changed below if error */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - - /* the HDF5 tests showed a bug in this list processing code (see many many - * lines down below). We added a workaround, but common HDF5 file types - * are actually contiguous and do not need the expensive workarond */ - if (!filetype_is_contig) { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - if (flat_file->count == 1 && !buftype_is_contig) - filetype_is_contig = 1; - } - - 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; - - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *)fd->fs_ptr; - - if (!buftype_is_contig && filetype_is_contig) { - -/* noncontiguous in memory, contiguous in file. */ - uint64_t file_offsets; - uint64_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 = (void*)ADIOI_Malloc(mem_list_count*sizeof(void*)); - mem_lengths = (size_t*)ADIOI_Malloc(mem_list_count*sizeof(size_t)); - - /* TODO: CHECK RESULTS OF MEMORY ALLOCATION */ - - 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] = - 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; - } -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); -#endif - NO_STALE(err_flag, fd, zoidfs_obj_ptr, - zoidfs_read(zoidfs_obj_ptr, - mem_list_count, - mem_offsets, mem_lengths, - 1, &file_offsets, &file_lengths, ZOIDFS_NO_OP_HINT)); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != ZFS_OK) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(err_flag), - "Error in zoidfs_read", 0); - goto error_state; - } - total_bytes_read += file_lengths; - /* --END ERROR HANDLING-- */ - - /* in the case of error or the last read list call, - * leave here */ - if (err_flag || b_blks_read == total_blks_to_read) break; - - file_offsets += file_lengths; - file_lengths = 0; - } - } /* for (i=0; icount; i++) */ - j++; - } /* while (b_blks_read < total_blks_to_read) */ - ADIOI_Free(mem_offsets); - ADIOI_Free(mem_lengths); - - if (file_ptr_type == ADIO_INDIVIDUAL) - fd->fp_ind += total_bytes_read; - - 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; - initial_off = offset; - - - /* 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 = 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. */ - - /* only one memory off-len pair, so no array here */ - size_t mem_lengths; - size_t mem_offsets; - - i = 0; - j = st_index; - n_filetypes = st_n_filetypes; - - mem_list_count = 1; - - /* determine how many blocks in file to read */ - f_data_read = ADIOI_MIN(st_frd_size, bufsize); - total_blks_to_read = 1; - if (j < (flat_file->count-1)) j++; - else { - j = 0; - n_filetypes++; - } - 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 = (size_t)buf; - mem_lengths = 0; - - /* if at least one full readlist, allocate file arrays - at max array size and don't free until very end */ - if (n_read_lists) { - file_offsets = (int64_t*)ADIOI_Malloc(MAX_ARRAY_SIZE* - sizeof(int64_t)); - file_lengths = (uint64_t*)ADIOI_Malloc(MAX_ARRAY_SIZE* - sizeof(uint64_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 = (uint64_t*)ADIOI_Malloc(extra_blks* - sizeof(uint64_t)); - } - - /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ - for (i=0; iindices[j]; - file_lengths[k] = flat_file->blocklens[j]; - mem_lengths += file_lengths[k]; - } - if (j<(flat_file->count - 1)) j++; - else { - j = 0; - n_filetypes++; - } - } /* for (k=0; kindices[j]; - if (k == (extra_blks - 1)) { - file_lengths[k] = bufsize - mem_lengths - - mem_offsets + (size_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; kblocklens[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] ) ) || - ((mem_list_count == 1) && - (new_buffer_read < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && - (new_file_read < flat_buf->blocklens[0]) ) || - ( (mem_list_count == MAX_ARRAY_SIZE) && - (new_buffer_read < flat_file->blocklens[0])) ) - { - - ADIOI_Delete_flattened(datatype); - ADIOI_GEN_ReadStrided_naive(fd, buf, count, datatype, - file_ptr_type, initial_off, status, error_code); - return; - } - - mem_offsets = (void *)ADIOI_Malloc(max_mem_list*sizeof(void *)); - mem_lengths = (size_t*)ADIOI_Malloc(max_mem_list*sizeof(size_t)); - file_offsets = (uint64_t *)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); - file_lengths = (uint64_t *)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); - - size_read = 0; - n_filetypes = st_n_filetypes; - frd_size = st_frd_size; - brd_size = flat_buf->blocklens[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) + - 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] + - ((ADIO_Offset)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; ifp_ind = file_offsets[file_list_count-1]+ - file_lengths[file_list_count-1]; - } - - ADIOI_Free(file_offsets); - ADIOI_Free(file_lengths); - - if (err_flag == 0) *error_code = MPI_SUCCESS; - -error_state: - 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_zoidfs/ad_zoidfs_resize.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_resize.c deleted file mode 100644 index 60d2fcaba20..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_resize.c +++ /dev/null @@ -1,53 +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_zoidfs.h" -#include "ad_zoidfs_common.h" - -/* as with flush, implement the resize operation in a scalable - * manner. one process does the work, then broadcasts the result to everyone - * else. fortunately, this operation is defined to be collective */ -void ADIOI_ZOIDFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) -{ - int ret, rank; - ADIOI_ZOIDFS_object *zoidfs_obj_ptr; - static char myname[] = "ADIOI_ZOIDFS_RESIZE"; - - *error_code = MPI_SUCCESS; - - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *)fd->fs_ptr; - - MPI_Comm_rank(fd->comm, &rank); - - - /* MPI-IO semantics treat conflicting MPI_File_set_size requests the - * same as conflicting write requests. Thus, a resize from one - * process does not have to be visible to the other processes until a - * syncronization point is reached */ - - if (rank == fd->hints->ranklist[0]) { - NO_STALE(ret, fd, zoidfs_obj_ptr, - zoidfs_resize(zoidfs_obj_ptr, size, ZOIDFS_NO_OP_HINT)); - MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - } else { - MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - } - /* --BEGIN ERROR HANDLING-- */ - if (ret != ZFS_OK) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(ret), - "Error in zoidfs_resize", 0); - return; - } - /* --END ERROR HANDLING-- */ -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_write_list.c b/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_write_list.c deleted file mode 100644 index 44376316a64..00000000000 --- a/3rd-party/romio321/adio/ad_zoidfs/ad_zoidfs_write_list.c +++ /dev/null @@ -1,857 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "ad_zoidfs.h" - -#include "ad_zoidfs_common.h" - -/* Copied from ADIOI_PVFS2_OldWriteStrided. It would be good to have fewer - * copies of this code... */ -void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - /* as with all the other WriteStrided functions, offset is in units of - * etype relative to the filetype */ - - /* Since zoidfs does not support file locking, can't do buffered writes - as on Unix */ - - ADIOI_Flatlist_node *flat_buf, *flat_file; - int i, j, k, bwr_size, fwr_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, filetype_lb, buftype_lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset off, disp, start_off, initial_off; - int flag, st_fwr_size, st_n_filetypes; - int err_flag=0; - - size_t mem_list_count, file_list_count; - const void ** mem_offsets; - uint64_t *file_offsets; - size_t *mem_lengths; - uint64_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; - ADIOI_ZOIDFS_object *zoidfs_obj_ptr; - MPI_Offset total_bytes_written=0; - static char myname[] = "ADIOI_ZOIDFS_WRITESTRIDED"; - - /* note: I don't know what zoidfs will do if you pass it a super-long list, - * so let's keep with the PVFS limit for now */ -#define MAX_ARRAY_SIZE 64 - - /* --BEGIN ERROR HANDLING-- */ - if (fd->atomicity) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "Atomic noncontiguous writes are not supported by ZOIDFS", 0); - return; - } - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - - /* the HDF5 tests showed a bug in this list processing code (see many many - * lines down below). We added a workaround, but common HDF5 file types - * are actually contiguous and do not need the expensive workarond */ - if (!filetype_is_contig) { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - if (flat_file->count == 1 && !buftype_is_contig) - filetype_is_contig = 1; - } - - 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; - - zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr; - - if (!buftype_is_contig && filetype_is_contig) { - -/* noncontiguous in memory, contiguous in file. */ - uint64_t file_offsets; - uint64_t file_lengths; - - flat_buf = ADIOI_Flatten_and_find(datatype); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + etype_size * offset; - } - else off = fd->fp_ind; - - 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 = (void*)ADIOI_Malloc(mem_list_count*sizeof(void*)); - mem_lengths = (size_t*)ADIOI_Malloc(mem_list_count*sizeof(size_t)); - - 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] = - 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 write 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 write list call fills max arrays */ - if (!mem_list_count) mem_list_count = MAX_ARRAY_SIZE; - } -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - NO_STALE(err_flag, fd, zoidfs_obj_ptr, - zoidfs_write(zoidfs_obj_ptr, - mem_list_count, - mem_offsets, mem_lengths, - 1, &file_offsets, &file_lengths, ZOIDFS_NO_OP_HINT)); - - /* --BEGIN ERROR HANDLING-- */ - if (err_flag != ZFS_OK) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(err_flag), - "Error in zoidfs_write", 0); - break; - } -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - total_bytes_written += file_lengths; - - /* in the case of error or the last write list call, - * leave here */ - /* --BEGIN ERROR HANDLING-- */ - if (err_flag) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - ADIOI_ZOIDFS_error_convert(err_flag), - "Error in zoidfs_write", 0); - break; - } - /* --END ERROR HANDLING-- */ - 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 += total_bytes_written; - - if (!err_flag) *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; - initial_off = offset; - - /* 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. */ - - /* only one memory off-len pair, so no array */ - size_t mem_lengths; - size_t mem_offsets; - - i = 0; - j = st_index; - off = offset; - n_filetypes = st_n_filetypes; - - mem_list_count = 1; - - /* determine how many blocks in file to write */ - f_data_wrote = ADIOI_MIN(st_fwr_size, bufsize); - total_blks_to_write = 1; - if (j < (flat_file->count -1)) j++; - else { - j = 0; - n_filetypes++; - } - 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 = (size_t)buf; - mem_lengths = 0; - - /* if at least one full writelist, allocate file arrays - at max array size and don't free until very end */ - if (n_write_lists) { - file_offsets = (int64_t*)ADIOI_Malloc(MAX_ARRAY_SIZE* - sizeof(int64_t)); - file_lengths = (uint64_t*)ADIOI_Malloc(MAX_ARRAY_SIZE* - sizeof(uint64_t)); - } - /* if there's no full writelist allocate file arrays according - to needed size (extra_blks) */ - else { - file_offsets = (int64_t*)ADIOI_Malloc(extra_blks* - sizeof(int64_t)); - file_lengths = (uint64_t*)ADIOI_Malloc(extra_blks* - sizeof(uint64_t)); - } - - /* for file arrays that are of MAX_ARRAY_SIZE, build arrays */ - for (i=0; iindices[j]; - file_lengths[k] = flat_file->blocklens[j]; - mem_lengths += file_lengths[k]; - } - if (j<(flat_file->count - 1)) j++; - else { - j = 0; - n_filetypes++; - } - } /* for (k=0; kindices[j]; - /* XXX: double-check these casts */ - if (k == (extra_blks - 1)) { - file_lengths[k] = bufsize - - mem_lengths - mem_offsets + (size_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; kblocklens[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 written and data to be - written in the next immediate write 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; iblocklens[0] ) ) || - ((mem_list_count == 1) && - (new_buffer_write < flat_buf->blocklens[0]) ) || - ((file_list_count == MAX_ARRAY_SIZE) && - (new_file_write < flat_buf->blocklens[0]) ) || - ( (mem_list_count == MAX_ARRAY_SIZE) && - (new_buffer_write < flat_file->blocklens[0])) ) - { - ADIOI_Delete_flattened(datatype); - ADIOI_GEN_WriteStrided_naive(fd, buf, count, datatype, - file_ptr_type, initial_off, status, error_code); - return; - } - - - mem_offsets = (void *)ADIOI_Malloc(max_mem_list*sizeof(void *)); - mem_lengths = (size_t*)ADIOI_Malloc(max_mem_list*sizeof(size_t)); - file_offsets = (uint64_t *)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); - file_lengths = (uint64_t*)ADIOI_Malloc(max_file_list*sizeof(uint64_t)); - - size_wrote = 0; - n_filetypes = st_n_filetypes; - fwr_size = st_fwr_size; - bwr_size = flat_buf->blocklens[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_fwr_size and new_bwr_size */ - - while (size_wrote < bufsize) { - k = start_k; - new_buffer_write = 0; - mem_list_count = 0; - while ((mem_list_count < MAX_ARRAY_SIZE) && - (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 written and data to be - written in the next immediate write 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)) */ - - /* fills the allocated writelist arrays */ - k = start_k; - j = start_j; - for (i=0; icount) + - flat_buf->indices[k]; - - if(!i) { - mem_lengths[0] = bwr_size; - mem_offsets[0] += flat_buf->blocklens[k] - bwr_size; - } - else { - if (i == (mem_list_count - 1)) { - mem_lengths[i] = end_bwr_size; - if (flat_buf->blocklens[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--; - } - } - else { - mem_lengths[i] = flat_buf->blocklens[k]; - } - } - buf_count++; - k = (k + 1)%flat_buf->count; - } /* for (i=0; iindices[j] + - ((ADIO_Offset)n_filetypes) * filetype_extent; - if (!i) { - file_lengths[0] = fwr_size; - file_offsets[0] += flat_file->blocklens[j] - fwr_size; - } - else { - if (i == (file_list_count - 1)) { - file_lengths[i] = end_fwr_size; - if (flat_file->blocklens[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--; - } - } - else file_lengths[i] = flat_file->blocklens[j]; - } - if (j < flat_file->count - 1) j++; - else { - j = 0; - n_filetypes++; - } - } /* for (i=0; ifp_ind = file_offsets[file_list_count-1]+ - file_lengths[file_list_count-1]; - } - ADIOI_Free(file_offsets); - ADIOI_Free(file_lengths); - - *error_code = MPI_SUCCESS; - -error_state: - 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/common/Makefile.mk b/3rd-party/romio321/adio/common/Makefile.mk deleted file mode 100644 index 80194efe483..00000000000 --- a/3rd-party/romio321/adio/common/Makefile.mk +++ /dev/null @@ -1,76 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -romio_other_sources += \ - adio/common/ad_aggregate.c \ - adio/common/ad_aggregate_new.c \ - adio/common/ad_close.c \ - adio/common/ad_coll_build_req_new.c \ - adio/common/ad_coll_exch_new.c \ - adio/common/ad_darray.c \ - adio/common/ad_delete.c \ - adio/common/ad_done.c \ - adio/common/ad_done_fake.c \ - adio/common/ad_end.c \ - adio/common/ad_fcntl.c \ - adio/common/ad_features.c \ - adio/common/ad_flush.c \ - adio/common/ad_fstype.c \ - adio/common/ad_get_sh_fp.c \ - adio/common/ad_hints.c \ - adio/common/ad_init.c \ - adio/common/ad_io_coll.c \ - adio/common/ad_iopen.c \ - adio/common/ad_iread.c \ - adio/common/ad_iread_coll.c \ - adio/common/ad_iread_fake.c \ - adio/common/ad_iwrite.c \ - adio/common/ad_iwrite_coll.c \ - adio/common/ad_iwrite_fake.c \ - adio/common/ad_open.c \ - adio/common/ad_opencoll.c \ - adio/common/ad_opencoll_failsafe.c \ - adio/common/ad_opencoll_scalable.c \ - adio/common/ad_prealloc.c \ - adio/common/ad_read.c \ - adio/common/ad_read_coll.c \ - adio/common/ad_read_str.c \ - adio/common/ad_read_str_naive.c \ - adio/common/ad_resize.c \ - adio/common/ad_seek.c \ - adio/common/ad_set_sh_fp.c \ - adio/common/ad_set_view.c \ - adio/common/ad_subarray.c \ - adio/common/ad_wait.c \ - adio/common/ad_wait_fake.c \ - adio/common/ad_write.c \ - adio/common/ad_write_coll.c \ - adio/common/ad_write_nolock.c \ - adio/common/ad_write_str.c \ - adio/common/ad_write_str_naive.c \ - adio/common/adi_close.c \ - adio/common/byte_offset.c \ - adio/common/cb_config_list.c \ - adio/common/eof_offset.c \ - adio/common/error.c \ - adio/common/flatten.c \ - adio/common/get_fp_posn.c \ - adio/common/greq_fns.c \ - adio/common/heap-sort.c \ - adio/common/iscontig.c \ - adio/common/lock.c \ - adio/common/malloc.c \ - adio/common/shfp_fname.c \ - adio/common/status_setb.c \ - adio/common/strfns.c \ - adio/common/system_hints.c \ - adio/common/hint_fns.c \ - adio/common/ad_threaded_io.c \ - adio/common/p2p_aggregation.c \ - adio/common/onesided_aggregation.c \ - adio/common/utils.c - diff --git a/3rd-party/romio321/adio/common/ad_aggregate.c b/3rd-party/romio321/adio/common/ad_aggregate.c deleted file mode 100644 index 77c69bdad66..00000000000 --- a/3rd-party/romio321/adio/common/ad_aggregate.c +++ /dev/null @@ -1,653 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 1997-2001 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" - -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -#undef AGG_DEBUG - -/* 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 - */ - -/* 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. - */ -int ADIOI_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; - - ADIOI_UNREFERENCED_ARG(fd_start); - - /* get an index into our array of aggregators */ - 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++; - } - - /* 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); - } - - /* 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) { - /* 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]; - - return rank; -} - -void ADIOI_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset - *end_offsets, int nprocs, int nprocs_for_coll, - ADIO_Offset *min_st_offset_ptr, - ADIO_Offset **fd_start_ptr, ADIO_Offset - **fd_end_ptr, int min_fd_size, - ADIO_Offset *fd_size_ptr, - int striping_unit) -{ -/* 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. */ - - ADIO_Offset min_st_offset, max_end_offset, *fd_start, *fd_end, fd_size; - int i; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5004, 0, NULL); -#endif - -#ifdef AGG_DEBUG - FPRINTF(stderr, "ADIOI_Calc_file_domains: %d aggregator(s)\n", - nprocs_for_coll); -#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; i 0) { - ADIO_Offset end_off; - int rem_front, rem_back; - - /* align fd_end[0] to the nearest file lock boundary */ - fd_start[0] = min_st_offset; - end_off = fd_start[0] + fd_size; - rem_front = end_off % striping_unit; - rem_back = striping_unit - rem_front; - if (rem_front < rem_back) - end_off -= rem_front; - else - end_off += rem_back; - fd_end[0] = end_off - 1; - - /* align fd_end[i] to the nearest file lock boundary */ - for (i=1; i max_end_offset) - fd_start[i] = fd_end[i] = -1; - if (fd_end[i] > max_end_offset) - fd_end[i] = max_end_offset; - } - - *fd_size_ptr = fd_size; - *min_st_offset_ptr = min_st_offset; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5005, 0, NULL); -#endif -} - - -/* ADIOI_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_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) -/* Possibly reconsider if buf_idx's are ok as int's, or should they be aints/offsets? - They are used as memory buffer indices so it seems like the 2G limit is in effect */ -{ - int *count_my_req_per_proc, count_my_req_procs, *buf_idx; - int i, l, proc; - ADIO_Offset fd_len, rem_len, curr_idx, off; - ADIOI_Access *my_req; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5024, 0, NULL); -#endif - - *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)); -/* 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 to -1 */ - for (i=0; i < nprocs; i++) buf_idx[i] = -1; - - /* 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]; - fd_len = len_list[i]; - /* note: we set fd_len to be the total size of the access. then - * ADIOI_Calc_aggregator() will modify the value to return the - * amount that was available from the file domain that holds the - * first part of the access. - */ - proc = ADIOI_Calc_aggregator(fd, off, min_st_offset, &fd_len, fd_size, - fd_start, fd_end); - count_my_req_per_proc[proc]++; - - /* figure out how much data is remaining in the access (i.e. wasn't - * part of the file domain that had the starting byte); we'll take - * care of this data (if there is any) in the while loop below. - */ - rem_len = len_list[i] - fd_len; - - while (rem_len != 0) { - off += fd_len; /* point to first remaining byte */ - fd_len = rem_len; /* save remaining size, pass to calc */ - proc = ADIOI_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) { - 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]); - } - FPRINTF(stdout, "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 -} - - - -void ADIOI_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) -{ -/* 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, j; - MPI_Request *requests; - MPI_Status *statuses; - ADIOI_Access *others_req; - -/* first find out how much to send/recv and from/to whom */ -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5026, 0, NULL); -#endif - count_others_req_per_proc = (int *) ADIOI_Malloc(nprocs*sizeof(int)); - - MPI_Alltoall(count_my_req_per_proc, 1, MPI_INT, - count_others_req_per_proc, 1, MPI_INT, fd->comm); - - *others_req_ptr = (ADIOI_Access *) - ADIOI_Malloc(nprocs*sizeof(ADIOI_Access)); - others_req = *others_req_ptr; - - count_others_req_procs = 0; - for (i=0; icomm, &requests[j]); - j++; - MPI_Irecv(others_req[i].lens, others_req[i].count, - ADIO_OFFSET, i, i+myrank+1, fd->comm, &requests[j]); - j++; - } - } - - for (i=0; i < nprocs; i++) { - if (my_req[i].count) { - MPI_Isend(my_req[i].offsets, my_req[i].count, - ADIO_OFFSET, i, i+myrank, fd->comm, &requests[j]); - j++; - MPI_Isend(my_req[i].lens, my_req[i].count, - ADIO_OFFSET, i, i+myrank+1, fd->comm, &requests[j]); - j++; - } - } - - if (j) { - statuses = (MPI_Status *) ADIOI_Malloc(j * sizeof(MPI_Status)); - MPI_Waitall(j, requests, statuses); - ADIOI_Free(statuses); - } - - ADIOI_Free(requests); - ADIOI_Free(count_others_req_per_proc); - - *count_others_req_procs_ptr = count_others_req_procs; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5027, 0, NULL); -#endif -} - - -/* Nonblocking version of ADIOI_Calc_others_req(). - It consists of three functions - ADIOI_Icalc_others_req(), - ADIOI_Icalc_others_req_main(), and ADIOI_Icalc_others_req_fini(). */ -void ADIOI_Icalc_others_req(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Icalc_others_req_vars *vars = nbc_req->cor_vars; - - /* count_others_req_per_proc[i] indicates how many separate contiguous - requests of proc. i lie in this process's file domain. */ - - /* first find out how much to send/recv and from/to whom */ -#ifdef AGGREGATION_PROFILE - MPE_Log_event(5026, 0, NULL); -#endif - vars->count_others_req_per_proc = - (int *)ADIOI_Malloc(vars->nprocs * sizeof(int)); - - *error_code = MPI_Ialltoall(vars->count_my_req_per_proc, 1, MPI_INT, - vars->count_others_req_per_proc, 1, MPI_INT, vars->fd->comm, - &vars->req1); - - if (nbc_req->rdwr == ADIOI_READ) { - nbc_req->data.rd.state = ADIOI_IRC_STATE_ICALC_OTHERS_REQ; - } else { - ADIOI_Assert(nbc_req->rdwr == ADIOI_WRITE); - nbc_req->data.wr.state = ADIOI_IWC_STATE_ICALC_OTHERS_REQ; - } -} - -void ADIOI_Icalc_others_req_main(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Icalc_others_req_vars *vars = nbc_req->cor_vars; - ADIO_File fd = vars->fd; - int count_my_req_procs = vars->count_my_req_procs; - ADIOI_Access *my_req = vars->my_req; - int nprocs = vars->nprocs; - int myrank = vars->myrank; - ADIOI_Access **others_req_ptr = vars->others_req_ptr; - - /* determine what requests of other processes lie in this process's - file domain */ - - /* count_others_req_procs = number of processes whose requests lie in - this process's file domain (including this process itself) - count_others_req_per_proc[i] indicates how many separate contiguous - requests of proc. i lie in this process's file domain. */ - - int *count_others_req_per_proc = vars->count_others_req_per_proc; - int count_others_req_procs; - int i, j; - ADIOI_Access *others_req; - - *others_req_ptr = (ADIOI_Access *)ADIOI_Malloc(nprocs*sizeof(ADIOI_Access)); - others_req = *others_req_ptr; - - count_others_req_procs = 0; - for (i = 0; i < nprocs; i++) { - if (count_others_req_per_proc[i]) { - others_req[i].count = count_others_req_per_proc[i]; - others_req[i].offsets = (ADIO_Offset *) - ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(ADIO_Offset)); - others_req[i].lens = - ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(ADIO_Offset)); - others_req[i].mem_ptrs = (MPI_Aint *) - ADIOI_Malloc(count_others_req_per_proc[i]*sizeof(MPI_Aint)); - count_others_req_procs++; - } - else others_req[i].count = 0; - } - vars->count_others_req_procs = count_others_req_procs; - - /* now send the calculated offsets and lengths to respective processes */ - - vars->req2 = (MPI_Request *) - ADIOI_Malloc(1+2*(count_my_req_procs+count_others_req_procs) - *sizeof(MPI_Request)); - /* +1 to avoid a 0-size malloc */ - - j = 0; - for (i = 0; i < nprocs; i++) { - if (others_req[i].count) { - MPI_Irecv(others_req[i].offsets, others_req[i].count, - ADIO_OFFSET, i, i+myrank, fd->comm, &vars->req2[j]); - j++; - MPI_Irecv(others_req[i].lens, others_req[i].count, - ADIO_OFFSET, i, i+myrank+1, fd->comm, &vars->req2[j]); - j++; - } - } - - for (i=0; i < nprocs; i++) { - if (my_req[i].count) { - MPI_Isend(my_req[i].offsets, my_req[i].count, - ADIO_OFFSET, i, i+myrank, fd->comm, &vars->req2[j]); - j++; - MPI_Isend(my_req[i].lens, my_req[i].count, - ADIO_OFFSET, i, i+myrank+1, fd->comm, &vars->req2[j]); - j++; - } - } - - /* keep the number of requests */ - vars->num_req2 = j; - - if (nbc_req->rdwr == ADIOI_READ) { - nbc_req->data.rd.state = ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN; - } else { - ADIOI_Assert(nbc_req->rdwr == ADIOI_WRITE); - nbc_req->data.wr.state = ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN; - } -} - -void ADIOI_Icalc_others_req_fini(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Icalc_others_req_vars *vars = nbc_req->cor_vars; - void (*next_fn)(ADIOI_NBC_Request *, int *); - - ADIOI_Free(vars->req2); - ADIOI_Free(vars->count_others_req_per_proc); - - *vars->count_others_req_procs_ptr = vars->count_others_req_procs; -#ifdef AGGREGATION_PROFILE - MPE_Log_event(5027, 0, NULL); -#endif - /* end of the calculation */ - - next_fn = vars->next_fn; - - /* free the struct for parameters and variables */ - ADIOI_Free(vars); - nbc_req->cor_vars = NULL; - - /* move to the next function */ - next_fn(nbc_req, error_code); -} - diff --git a/3rd-party/romio321/adio/common/ad_aggregate_new.c b/3rd-party/romio321/adio/common/ad_aggregate_new.c deleted file mode 100644 index aca60b27023..00000000000 --- a/3rd-party/romio321/adio/common/ad_aggregate_new.c +++ /dev/null @@ -1,284 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif -#include -/* #define DEBUG */ - -void ADIOI_Calc_file_realms_user_size (ADIO_File fd, int fr_size, - int nprocs_for_coll, - ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types); -void ADIOI_Calc_file_realms_aar (ADIO_File fd, int nprocs_for_coll, - int pfr_enabled, - ADIO_Offset min_st_offset, - ADIO_Offset max_end_offset, - ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types); -void ADIOI_Calc_file_realms_fsize (ADIO_File fd, - int nprocs_for_coll, - ADIO_Offset max_end_offset, - ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types); -void ADIOI_Create_fr_simpletype (int size, int nprocs_for_coll, - MPI_Datatype *simpletype); -static void align_fr (int fr_size, ADIO_Offset fr_off, int alignment, - int *aligned_fr_size, ADIO_Offset *aligned_fr_off); -void ADIOI_Verify_fr (int nprocs_for_coll, ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types); - -void ADIOI_Calc_file_realms (ADIO_File fd, ADIO_Offset min_st_offset, - ADIO_Offset max_end_offset) -{ - int nprocs_for_coll; - int file_realm_calc_type; - - MPI_Datatype *file_realm_types = NULL; - ADIO_Offset *file_realm_st_offs = NULL; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5004, 0, NULL); -#endif -#ifdef DEBUG - printf ("ADIOI_Calc_file_realms\n"); -#endif - - nprocs_for_coll = fd->hints->cb_nodes; - file_realm_calc_type = fd->hints->cb_fr_type; - - /* If PFRs are disabled we know these pointers are not allocated */ - if (fd->hints->cb_pfr != ADIOI_HINT_ENABLE) { - fd->file_realm_st_offs = NULL; - fd->file_realm_types = NULL; - } - - if (nprocs_for_coll == 1) { - /* if there's only one aggregator, we can reset the file - * realms every single time */ - if (fd->file_realm_st_offs == NULL) - { - file_realm_st_offs = (ADIO_Offset *) - ADIOI_Malloc (sizeof(ADIO_Offset)); - file_realm_types = (MPI_Datatype *) - ADIOI_Malloc (sizeof(MPI_Datatype)); - } - else - { - file_realm_st_offs = fd->file_realm_st_offs; - file_realm_types = fd->file_realm_types; - } - *file_realm_st_offs = min_st_offset; - MPI_Type_contiguous ((max_end_offset - min_st_offset + 1), MPI_BYTE, - file_realm_types); - MPI_Type_commit (file_realm_types); - ADIOI_Add_contig_flattened (*file_realm_types); - } - else if (fd->file_realm_st_offs == NULL) { - file_realm_st_offs = (ADIO_Offset *) - ADIOI_Malloc (nprocs_for_coll * sizeof(ADIO_Offset)); - file_realm_types = (MPI_Datatype *) - ADIOI_Malloc (nprocs_for_coll * sizeof(MPI_Datatype)); - - if (file_realm_calc_type == ADIOI_FR_AAR) { - ADIOI_Calc_file_realms_aar (fd, nprocs_for_coll, - fd->hints->cb_pfr, - min_st_offset, max_end_offset, - file_realm_st_offs, file_realm_types); - /* flatten file realm datatype for future use - only one - * because all are the same*/ - ADIOI_Flatten_datatype (file_realm_types[0]); - } - else if (file_realm_calc_type == ADIOI_FR_FSZ) { - ADIOI_Calc_file_realms_fsize (fd, nprocs_for_coll, max_end_offset, - file_realm_st_offs, - file_realm_types); - /* flatten file realm datatype for future use - only one - * because all are the same*/ - ADIOI_Flatten_datatype (file_realm_types[0]); - } - else if (file_realm_calc_type == ADIOI_FR_USR_REALMS) { - /* copy user provided realm datatypes and realm offsets in - * hints to file descriptor. may also want to verify that - * the provided file realms are covering (for pfr at - * least) and non-overlapping */ - } - else if (file_realm_calc_type > 0) { - ADIOI_Calc_file_realms_user_size (fd, file_realm_calc_type, - nprocs_for_coll, - file_realm_st_offs, - file_realm_types); - /* flatten file realm datatype for future use - only one - * because all are the same */ - ADIOI_Flatten_datatype (file_realm_types[0]); - } - } - fd->file_realm_st_offs = file_realm_st_offs; - fd->file_realm_types = file_realm_types; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5005, 0, NULL); -#endif -} - -void ADIOI_Calc_file_realms_user_size (ADIO_File fd, int fr_size, - int nprocs_for_coll, - ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types) -{ - int i; - int aligned_fr_size; - ADIO_Offset aligned_fr_off; - MPI_Datatype simpletype; - - align_fr(fr_size, 0, fd->hints->cb_fr_alignment, &aligned_fr_size, - &aligned_fr_off); - fr_size = aligned_fr_size; - ADIOI_Create_fr_simpletype (fr_size, nprocs_for_coll, &simpletype); - - if (fd->hints->cb_pfr == ADIOI_HINT_ENABLE) - file_realm_st_offs[0] = 0; - else - file_realm_st_offs[0] = aligned_fr_off; - file_realm_types[0] = simpletype; -#ifdef DEBUG - printf ("file_realm[0] = (%lld, %d)\n", file_realm_st_offs[0], - fr_size); -#endif - - for (i=1; i < nprocs_for_coll; i++) - { - file_realm_st_offs[i] = file_realm_st_offs[i-1] + fr_size; - file_realm_types[i] = simpletype; -#ifdef DEBUG - printf ("file_realm[%d] = (%lld, %d)\n", i, file_realm_st_offs[i], - aligned_fr_size); -#endif - } -} - -/* takes an extra romio_cb_pfr param to decide whether file realms - * should start at byte 0 of the file*/ -void ADIOI_Calc_file_realms_aar (ADIO_File fd, int nprocs_for_coll, int cb_pfr, - ADIO_Offset min_st_offset, - ADIO_Offset max_end_offset, - ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types) -{ - int fr_size, aligned_fr_size, i; - MPI_Datatype simpletype; - ADIO_Offset aligned_start_off; - char value[9]; - - fr_size = (max_end_offset - min_st_offset + nprocs_for_coll) / - nprocs_for_coll; - align_fr(fr_size, min_st_offset, fd->hints->cb_fr_alignment, - &aligned_fr_size, &aligned_start_off); - fr_size = aligned_fr_size; - ADIOI_Create_fr_simpletype (fr_size, nprocs_for_coll, &simpletype); - if (cb_pfr == ADIOI_HINT_ENABLE) - file_realm_st_offs[0] = 0; - else - file_realm_st_offs[0] = aligned_start_off; - file_realm_types[0] = simpletype; - -#ifdef DEBUG - printf ("file_realm[0] = (%lld, %d)\n", file_realm_st_offs[0], - fr_size); -#endif - for (i=1; i < nprocs_for_coll; i++) - { - file_realm_st_offs[i] = file_realm_st_offs[i-1] + fr_size; - file_realm_types[i] = simpletype; -#ifdef DEBUG - printf ("file_realm[%d] = (%lld, %d)\n", i, file_realm_st_offs[i], - fr_size); -#endif - } - if (fd->hints->cb_pfr == ADIOI_HINT_ENABLE) { - sprintf (value, "%d", fr_size); - ADIOI_Info_set (fd->info, "romio_cb_fr_type", value); - } -} - -void ADIOI_Calc_file_realms_fsize (ADIO_File fd, int nprocs_for_coll, - ADIO_Offset max_end_offset, - ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types) -{ - int fr_size, aligned_fr_size, error_code, i; - int fsize; - ADIO_Offset aligned_fr_off; - ADIO_Fcntl_t fcntl_struct; - MPI_Datatype simpletype; - - ADIO_Fcntl (fd, ADIO_FCNTL_GET_FSIZE, &fcntl_struct, &error_code); - - /* use impending file size since a write call may lengthen the file */ - fsize = ADIOI_MAX (fcntl_struct.fsize, max_end_offset+1); - fr_size = (fsize + nprocs_for_coll - 1) / nprocs_for_coll; - align_fr(fr_size, 0, fd->hints->cb_fr_alignment, - &aligned_fr_size, &aligned_fr_off); - ADIOI_Create_fr_simpletype (fr_size, nprocs_for_coll, &simpletype); - - for (i=0; i < nprocs_for_coll; i++) - { - file_realm_st_offs[i] = fr_size * i; - file_realm_types[i] = simpletype; - } -} - -/* creates a datatype with an empty trailing edge */ -void ADIOI_Create_fr_simpletype (int size, int nprocs_for_coll, - MPI_Datatype *simpletype) -{ - int count=1, blocklens[1]; - MPI_Aint indices[1]; - MPI_Datatype old_types[1]; - MPI_Datatype inttype; - - blocklens[0] = size; - indices[0] = 0; - old_types[0] = MPI_BYTE; - - MPI_Type_create_struct (count, blocklens, indices, old_types, &inttype); - MPI_Type_create_resized (inttype, 0, size*nprocs_for_coll, simpletype); - MPI_Type_free (&inttype); - - MPI_Type_commit (simpletype); -} - -/* Verify that file realms are covering (PFRs) and non-overlapping */ -void ADIOI_Verify_fr (int nprocs_for_coll, ADIO_Offset *file_realm_st_offs, - MPI_Datatype *file_realm_types) -{ -} - -int ADIOI_Agg_idx (int rank, ADIO_File fd) { - int i, cb_nodes, *ranklist; - cb_nodes = fd->hints->cb_nodes; - ranklist = fd->hints->ranklist; - - for (i=0; i -#endif - -void ADIO_Close(ADIO_File fd, int *error_code) -{ - int i, j, k, combiner, myrank, err, is_contig; - static char myname[] = "ADIO_CLOSE"; - - if (fd->async_count) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, "**io", - "**io %s", strerror(errno)); - return; - } - - /* because of deferred open, this warants a bit of explaining. First, if - * we've done aggregation, - * then close the file. Then, if any process left has done independent - * i/o, close the file. Otherwise, we'll skip the fs-specific close and - * just say everything is a-ok. - * - * XXX: is it ok for those processes with a "real" communicator and those - * with "MPI_COMM_SELF" to both call ADIOI_xxx_Close at the same time ? - * everyone who ever opened the file will close it. Is order important? Is - * timing important? - */ - if (fd->hints->deferred_open && fd->is_agg) { - (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); - } else { - if(fd->is_open) { - (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); - } else { - *error_code = MPI_SUCCESS; - } - - } - - if (fd->access_mode & ADIO_DELETE_ON_CLOSE) { - /* if we are doing aggregation and deferred open, then it's possible - * that rank 0 does not have access to the file. make sure only an - * aggregator deletes the file.*/ - MPI_Comm_rank(fd->comm, &myrank); - if (myrank == fd->hints->ranklist[0]) { - ADIO_Delete(fd->filename, &err); - } - MPI_Barrier(fd->comm); - } - - if (fd->fortran_handle != -1) { - ADIOI_Ftable[fd->fortran_handle] = MPI_FILE_NULL; - } - - if (fd->hints) ADIOI_Free(fd->hints->ranklist); - if (fd->hints && fd->hints->cb_config_list) ADIOI_Free(fd->hints->cb_config_list); - - /* This BlueGene platform-specific free must be done in the common code - * because the malloc's for these hint data structures are done at the - * scope of ADIO_Open within the SetInfo call (ADIOI_GPFS_SetInfo which - * calls ADIOI_BG_gen_agg_ranklist). They cannot be done in the - * ADIOI_GPFS_Close because of the file creation case where the - * ADIOI_GPFS_Close and re-open via ADIOI_GPFS_Open are done which results - * in a double-free - ADIOI_GPFS_Open does not redo the SetInfo... */ -#ifdef BGQPLATFORM - if (fd->hints && fd->hints->fs_hints.bg.bridgelist) ADIOI_Free(fd->hints->fs_hints.bg.bridgelist); - if (fd->hints && fd->hints->fs_hints.bg.bridgelistnum) ADIOI_Free(fd->hints->fs_hints.bg.bridgelistnum); -#endif - - /* Persistent File Realms */ - if (fd->hints->cb_pfr == ADIOI_HINT_ENABLE) { - /* AAR, FSIZE, and User provided uniform File realms */ - if (1) { - ADIOI_Delete_flattened (fd->file_realm_types[0]); - MPI_Type_free (&fd->file_realm_types[0]); - } - else { - for (i=0; ihints->cb_nodes; i++) { - ADIOI_Datatype_iscontig(fd->file_realm_types[i], &is_contig); - if (!is_contig) - ADIOI_Delete_flattened(fd->file_realm_types[i]); - MPI_Type_free (&fd->file_realm_types[i]); - } - } - ADIOI_Free(fd->file_realm_st_offs); - ADIOI_Free(fd->file_realm_types); - } - ADIOI_Free(fd->hints); - - - - MPI_Comm_free(&(fd->comm)); - ADIOI_Free(fd->filename); - - MPI_Type_get_envelope(fd->etype, &i, &j, &k, &combiner); - if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->etype)); - - ADIOI_Datatype_iscontig(fd->filetype, &is_contig); - if (!is_contig) ADIOI_Delete_flattened(fd->filetype); - - MPI_Type_get_envelope(fd->filetype, &i, &j, &k, &combiner); - if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->filetype)); - - MPI_Info_free(&(fd->info)); - - ADIOI_Free(fd->io_buf); - ADIOI_OneSidedCleanup(fd); - - /* memory for fd is freed in MPI_File_close */ -} diff --git a/3rd-party/romio321/adio/common/ad_coll_build_req_new.c b/3rd-party/romio321/adio/common/ad_coll_build_req_new.c deleted file mode 100644 index a15d61cc329..00000000000 --- a/3rd-party/romio321/adio/common/ad_coll_build_req_new.c +++ /dev/null @@ -1,2084 +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 -#include "adio.h" -#include "adio_extern.h" -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif -#include "heap-sort.h" - -/* -#define DEBUG1 -#define DEBUG2 -#define DEBUG3 -*/ -/* #define DEBUG_HEAP */ - -#define DTYPE_SKIP - -#ifdef DEBUG3 -static char *off_type_name[MAX_OFF_TYPE] = {"TEMP_OFFSETS", - "REAL_OFFSETS"}; -#endif - -/* Simple function to return the size of the view_state. */ -static inline ADIO_Offset view_state_get_cur_sz(view_state *tmp_view_state_p, - int op_type) -{ - flatten_state *tmp_state_p = NULL; - switch(op_type) - { - case TEMP_OFF: - tmp_state_p = &(tmp_view_state_p->tmp_state); - break; - case REAL_OFF: - tmp_state_p = &(tmp_view_state_p->cur_state); - break; - default: - fprintf(stderr, "op_type invalid\n"); - } - return tmp_state_p->cur_sz; -} - -/* Simple function to return the len of the next piece of the view_state. */ -static inline ADIO_Offset view_state_get_next_len(view_state *tmp_view_state_p, - int op_type) -{ - flatten_state *tmp_state_p = NULL; - switch(op_type) - { - case TEMP_OFF: - tmp_state_p = &(tmp_view_state_p->tmp_state); - break; - case REAL_OFF: - tmp_state_p = &(tmp_view_state_p->cur_state); - break; - default: - fprintf(stderr, "op_type invalid\n"); - } - return (ADIO_Offset) - tmp_view_state_p->flat_type_p->blocklens[tmp_state_p->idx] - - tmp_state_p->cur_reg_off; -} - -/* Add up to a region of a file view and no larger than a max size. - * The view_state is always consistent with the abs_off and where the - * index and cur_reg_off point to. The regions should be coalesced if - * possible later on. */ -static inline int view_state_add_region( - ADIO_Offset max_sz, - view_state *tmp_view_state_p, - ADIO_Offset *st_reg_p, - ADIO_Offset *tmp_reg_sz_p, - int op_type) -{ - ADIOI_Flatlist_node *tmp_flat_type_p = NULL; - flatten_state *tmp_state_p = NULL; - int64_t data_sz = 0; - -#ifdef AGGREGATION_PROFILE - /* MPE_Log_event (5020, 0, NULL); */ -#endif - - switch(op_type) - { - case TEMP_OFF: - tmp_state_p = &(tmp_view_state_p->tmp_state); - break; - case REAL_OFF: - tmp_state_p = &(tmp_view_state_p->cur_state); - break; - default: - fprintf(stderr, "op_type invalid\n"); - } - - tmp_flat_type_p = tmp_view_state_p->flat_type_p; - - *st_reg_p = tmp_state_p->abs_off; - - /* Should be looking at some data (or it's a zero len blocklens - * (i.e. placeholder). */ - assert(tmp_state_p->cur_reg_off != - tmp_flat_type_p->blocklens[tmp_state_p->idx]); - /* Shouldn't have been called if the view_state is done. */ - assert(tmp_state_p->cur_sz != tmp_view_state_p->sz); - - /* Make sure we are not in a non-zero region in the flat_type */ - assert(tmp_flat_type_p->blocklens[tmp_state_p->idx] != 0); - -#ifdef DEBUG3 - fprintf(stderr, "view_state:(blocklens[%Ld]=%d,cur_reg_off=%Ld," - "max_sz=%Ld)\n", tmp_state_p->idx, - tmp_flat_type_p->blocklens[tmp_state_p->idx], - tmp_state_p->cur_reg_off, max_sz); -#endif - - /* Can it add the whole piece? */ - if (tmp_flat_type_p->blocklens[tmp_state_p->idx] - - tmp_state_p->cur_reg_off <= max_sz) - { - data_sz = tmp_flat_type_p->blocklens[tmp_state_p->idx] - - tmp_state_p->cur_reg_off; - - tmp_state_p->cur_sz += data_sz; - - /* Advance the abs_off to the beginning of the next piece */ - if (tmp_flat_type_p->count == 1) - { - assert(tmp_flat_type_p->blocklens[tmp_state_p->idx] != 0); - tmp_state_p->abs_off += data_sz; -#ifdef DEBUG3 - fprintf(stderr, "view_state_add_region: %s contig type " - "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", - off_type_name[op_type], tmp_state_p->abs_off - data_sz, - tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); -#endif - } - else - { - /* Is this the last region in the datatype? */ - if (tmp_state_p->idx == (tmp_flat_type_p->count - 1)) - { - tmp_state_p->abs_off += data_sz - - tmp_flat_type_p->indices[tmp_flat_type_p->count-1] - - tmp_flat_type_p->blocklens[tmp_flat_type_p->count-1] + - tmp_view_state_p->ext; -#ifdef DEBUG3 - fprintf(stderr, "view_state_add_region: %s last region for type " - "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", - off_type_name[op_type], tmp_state_p->abs_off - data_sz, - tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); -#endif - } - else - { - tmp_state_p->abs_off += - tmp_flat_type_p->indices[tmp_state_p->idx + 1] - - (tmp_flat_type_p->indices[tmp_state_p->idx] + - tmp_state_p->cur_reg_off); -#ifdef DEBUG3 - fprintf(stderr, "view_state_add_region: %s inner region type " - "(old abs_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld)\n", - off_type_name[op_type], tmp_state_p->abs_off - - (tmp_flat_type_p->indices[tmp_state_p->idx + 1] - - (tmp_flat_type_p->indices[tmp_state_p->idx] + - tmp_state_p->cur_reg_off)), tmp_state_p->abs_off, - tmp_state_p->cur_sz, data_sz); -#endif - } - /* Increment idx to next non-zero region in the flat_type */ - do { - tmp_state_p->idx = - (tmp_state_p->idx + 1) % tmp_flat_type_p->count; - } while (tmp_flat_type_p->blocklens[tmp_state_p->idx] == 0); - } - tmp_state_p->cur_reg_off = 0; - } - else /* Add part of the piece */ - { - data_sz = max_sz; - tmp_state_p->cur_reg_off += data_sz; - tmp_state_p->abs_off += data_sz; - tmp_state_p->cur_sz += data_sz; -#ifdef DEBUG3 - fprintf(stderr, "view_state_add_region: %s partial region type " - "(cur_reg_off=%Ld,abs_off=%Ld,cur_sz=%Ld,reg size=%Ld\n", - off_type_name[op_type], tmp_state_p->cur_reg_off, - tmp_state_p->abs_off, tmp_state_p->cur_sz, data_sz); -#endif - } - - *tmp_reg_sz_p = data_sz; -#ifdef AGGREGATION_PROFILE - /* MPE_Log_event (5021, 0, NULL); */ -#endif - return 0; -} - -/* Set up the abs_off, idx, and cur_reg_off of a view_state for the - * tmp_state or the cur_state. */ -int ADIOI_init_view_state(int file_ptr_type, - int nprocs, - view_state *view_state_arr, - int op_type) -{ - ADIOI_Flatlist_node *tmp_flat_type_p = NULL; - ADIO_Offset tmp_off_used = 0, st_reg = 0, tmp_reg_sz = 0; - int i; - flatten_state *tmp_state_p = NULL; - view_state *tmp_view_p = NULL; - - for (i = 0; i < nprocs; i++) - { - switch(op_type) - { - case TEMP_OFF: - tmp_state_p = &(view_state_arr[i].tmp_state); - break; - case REAL_OFF: - tmp_state_p = &(view_state_arr[i].cur_state); - break; - default: - fprintf(stderr, "op_type invalid\n"); - } - - tmp_view_p = &(view_state_arr[i]); - tmp_flat_type_p = tmp_view_p->flat_type_p; - - if (file_ptr_type == ADIO_INDIVIDUAL) - tmp_state_p->abs_off = tmp_view_p->fp_ind; - else - tmp_state_p->abs_off = tmp_view_p->disp; - - tmp_off_used = 0; - - /* initialize tmp_state idx */ - while (tmp_flat_type_p->blocklens[tmp_state_p->idx] == 0) - tmp_state_p->idx = (tmp_state_p->idx + 1) % tmp_flat_type_p->count; - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) - tmp_state_p->abs_off += tmp_flat_type_p->indices[tmp_state_p->idx]; - - /* Initialize the abs_off by moving into the datatype - * byte_off bytes. Since we only do this in the beginning, we - * make the assumption that pieces are added whole until the last - * piece which MAY be partial. */ - while (tmp_off_used != tmp_view_p->byte_off) - { - view_state_add_region( - tmp_view_p->byte_off - tmp_off_used, - &(view_state_arr[i]), &st_reg, &tmp_reg_sz, - op_type); - } - - /* Re-initialize the cur_size so that the abs_off was set to - * the proper position while the actual size = 0.*/ - tmp_state_p->cur_sz = 0; -#ifdef DEBUG1 - fprintf(stderr, "init_view_state: %s (idx=%d,byte_off=%Ld," - "abs_off=%Ld,reg_off=%Ld,sz=%Ld)\n", off_type_name[op_type], - i, tmp_view_p->byte_off, tmp_state_p->abs_off, - tmp_state_p->cur_reg_off, tmp_view_p->sz); -#endif - - } - return 0; -} - -/* Return the next file realm offset and length for this datatype state - * within a particular file realm. */ -static inline int get_next_fr_off(ADIO_File fd, - ADIO_Offset off, - ADIO_Offset fr_st_off, - MPI_Datatype *fr_type_p, - ADIO_Offset *fr_next_off_p, - ADIO_Offset *fr_max_len_p) -{ - MPI_Aint fr_extent = -1, lb; - ADIO_Offset tmp_off, off_rem; - ADIOI_Flatlist_node *fr_node_p = ADIOI_Flatlist; - int i = -1, fr_dtype_ct = 0; - - /* Should have already been flattened in calc_file_realms() */ - while (fr_node_p->type != (*fr_type_p)) - fr_node_p = fr_node_p->next; - assert(fr_node_p != NULL); - - /* Did we get to the first region of the file realm? */ - if (off - fr_st_off < 0) - { - *fr_next_off_p = fr_st_off + fr_node_p->indices[0]; - *fr_max_len_p = fr_node_p->blocklens[0]; - return 0; - } - - /* Calculate how many times to loop through the fr_type - * and where the next fr_off is. */ - MPI_Type_get_extent(*fr_type_p, &lb, &fr_extent); - tmp_off = off - fr_st_off; - fr_dtype_ct = tmp_off / fr_extent; - off_rem = tmp_off % fr_extent; - for (i = 0; i < fr_node_p->count; i++) - { - if (off_rem < fr_node_p->indices[i]) - { - *fr_next_off_p = fr_st_off + - (fr_dtype_ct * fr_extent) + fr_node_p->indices[i]; - *fr_max_len_p = fr_node_p->blocklens[i]; - return 0; - } - else if (off_rem < fr_node_p->indices[i] + fr_node_p->blocklens[i]) - { - *fr_next_off_p = off; - *fr_max_len_p = fr_node_p->blocklens[i] - - (off_rem - fr_node_p->indices[i]); - return off; - } - } - - /* Shouldn't get here. */ - fprintf(stderr, "get_next_fr_off: Couldn't find the correct " - "location of the next offset for this file realm.\n"); - return -1; -} - -/* Look in all the view states for the first offset within a given - * file realm. Report the end of a contiguous region within the file - * realm (possibly more than the actual view state may be able to - * process contiguously). */ -static inline int find_next_off(ADIO_File fd, - view_state *view_state_p, - ADIO_Offset fr_st_off, - MPI_Datatype *fr_type_p, - int op_type, - ADIO_Offset *cur_off_p, - ADIO_Offset *cur_reg_max_len_p) -{ - ADIOI_Flatlist_node *tmp_flat_type_p = NULL; - ADIO_Offset tmp_off = -1, fr_next_off = -1, fr_max_len = -1, - tmp_fr_max_len = -1; - int ret = 0; - flatten_state *tmp_state_p = NULL; - ADIO_Offset tmp_st_off = 0, tmp_reg_sz = 0; -#ifdef DTYPE_SKIP - int skip_type_ct; -#endif - -#ifdef AGGREGATION_PROFILE - /* MPE_Log_event (5022, 0, NULL); */ -#endif - - switch(op_type) - { - case TEMP_OFF: - tmp_state_p = &(view_state_p->tmp_state); - break; - case REAL_OFF: - tmp_state_p = &(view_state_p->cur_state); - break; - default: - fprintf(stderr, "op_type invalid\n"); - } - - tmp_flat_type_p = view_state_p->flat_type_p; - - /* Can we use this proc? */ - if (tmp_state_p->cur_sz < view_state_p->sz) { - tmp_st_off = 0; - tmp_reg_sz = 0; - /* If the current region is not within the file realm, advance - * the state until it is and calculate the end of the next file - * realm in fr_max_len. */ - ret = get_next_fr_off(fd, - tmp_state_p->abs_off, - fr_st_off, - fr_type_p, - &fr_next_off, - &fr_max_len); - - while ((tmp_state_p->abs_off < fr_next_off) && - (tmp_state_p->cur_sz != view_state_p->sz)) - { - - /* While this might appear to be erroneous at first, - * view_state_add_region can only add a single piece at a - * time. Therefore, it will never overshoot the beginning - * of the next file realm. When it finally does enter the - * next file realm it will not be able to go beyond its - * first piece. */ - -#ifdef DTYPE_SKIP - if (tmp_flat_type_p->count > 1) { - /* let's see if we can skip whole datatypes */ - skip_type_ct = (fr_next_off - tmp_state_p->abs_off) / - view_state_p->ext; - if (skip_type_ct > 0) { - /* before we go on, let's check if we've actually - * finished up already */ - tmp_state_p->cur_sz += skip_type_ct * - view_state_p->type_sz; - if (tmp_state_p->cur_sz >= view_state_p->sz) { - tmp_state_p->cur_sz = view_state_p->sz; - break; - } - tmp_state_p->abs_off += skip_type_ct * view_state_p->ext; - } - } -#endif - view_state_add_region( - fr_next_off - tmp_state_p->abs_off, - view_state_p, - &tmp_st_off, - &tmp_reg_sz, - op_type); - - ret = get_next_fr_off(fd, - tmp_state_p->abs_off, - fr_st_off, - fr_type_p, - &fr_next_off, - &fr_max_len); - } - - if (tmp_state_p->cur_sz != view_state_p->sz) { - tmp_off = tmp_state_p->abs_off; - /* Calculate how much of the remaining file realm there is from the - * current offset */ - tmp_fr_max_len = fr_next_off + fr_max_len - tmp_off; - } - } - - *cur_off_p = tmp_off; - *cur_reg_max_len_p = tmp_fr_max_len; -#ifdef AGGREGATION_PROFILE - /* MPE_Log_event (5023, 0, NULL); */ -#endif - return ret; -} - -/* Upon completion of a full collective buffer, end of a file realm - * region (data sieving), or the end of all I/O for an aggregator, we - * should return a list of MPI_Datatypes that correspond to client - * communication into a collective buffer, a list of corresponding - * sizes, and an aggregate MPI_Datatype which will be used as a - * filetype in MPI_File_write/read on the aggregator. */ -int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, - view_state *client_file_view_state_arr, - MPI_Datatype *client_comm_dtype_arr, - ADIO_Offset *client_comm_sz_arr, - ADIO_Offset *agg_dtype_offset_p, - MPI_Datatype *agg_dtype_p) -{ - MPI_Aint **client_disp_arr = NULL, *agg_disp_arr = NULL; - int **client_blk_arr = NULL, *agg_blk_arr = NULL; - ADIO_Offset tmp_coll_buf_sz = 0, st_reg = 0, act_reg_sz = 0; - ADIO_Offset cur_off = -1, cur_reg_max_len = -1; - ADIO_Offset ds_fr_end = -1; - ADIO_Offset *fr_st_off_arr = fd->file_realm_st_offs; - MPI_Datatype *fr_type_arr = fd->file_realm_types; - int *client_ol_ct_arr = NULL; - int *client_ol_cur_ct_arr = NULL; - int agg_ol_ct = 0, agg_ol_cur_ct = 0; - int cur_off_proc = -1; - int next_off_idx = -1; - int i = 0, j = 0, all_done = -1; - int agg_idx = fd->my_cb_nodes_index; - heap_t offset_heap; - ADIO_Offset next_off = -1, next_reg_max_len = -1; - - /* Used for coalescing ol pairs next to each other. */ - ADIO_Offset *client_comm_next_off_arr = NULL; - ADIO_Offset agg_next_off = -1; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5016, 0, NULL); -#endif - - memset(client_comm_sz_arr, 0, nprocs*sizeof(ADIO_Offset)); - - if ((client_comm_next_off_arr = (ADIO_Offset *) - ADIOI_Malloc(nprocs*sizeof(ADIO_Offset))) == NULL) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: malloc client_next_off_arr " - "failed\n"); - return -1; - } - - if ((client_ol_ct_arr = (int *) ADIOI_Calloc(nprocs, sizeof(int))) == NULL) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: " - "malloc client_ol_ct_arr failed\n"); - return -1; - } - if ((client_ol_cur_ct_arr = - (int *) ADIOI_Calloc(nprocs, sizeof(int))) == NULL) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: " - "malloc client_ol_cur_ct_arr failed\n"); - return -1; - } - - /* On the first pass see how many offset-length pairs are - * necessary for each client. Then allocate the correct amount of - * offset-length pairs for describing the collective buffer. All - * data is processed in order by the aggregator's file realm. On - * the second pass, set the offset-length pairs to the correct - * values. */ - for (i = 0; i < MAX_OFF_TYPE; i++) - { - memset(client_comm_next_off_arr, -1, nprocs*sizeof(ADIO_Offset)); - tmp_coll_buf_sz = 0; - ds_fr_end = -1; - - /* initialize heap */ - ADIOI_Heap_create(&offset_heap, nprocs); - offset_heap.size = 0; - - for (j=0; j 0)) { - ADIOI_Heap_insert(&offset_heap, cur_off, j, cur_reg_max_len); -#ifdef DEBUG_HEAP - printf ("initial: inserting offset %lld with " - "cur_reg_max_len = %lld for p%d\n", - cur_off, cur_reg_max_len, j); -#endif - } - - } - if (!offset_heap.size) - ADIOI_Heap_insert(&offset_heap, -1, -1, -1); - - while (tmp_coll_buf_sz < fd->hints->cb_buffer_size) - { - /* Find the next process with the next region within the - * file realm and the maximum amount that can be added for - * this particular file realm as a contiguous region. */ - ADIOI_Heap_extract_min(&offset_heap, &cur_off, &cur_off_proc, - &cur_reg_max_len); -#ifdef DEBUG_HEAP - printf ("extracted cur_off %lld from proc %d\n", - cur_off, cur_off_proc); -#endif - - if (cur_off == -1) - break; - -#ifdef DEBUG3 - fprintf(stderr, "ADIOI_Build_agg_reqs: %s proc %d start/add to" - " list (max_reg_fr=%Ld,tmp_coll_buf_sz=%Ld," - "cb_buffer_size=%d)\n", off_type_name[i], cur_off_proc, - cur_reg_max_len, tmp_coll_buf_sz, - fd->hints->cb_buffer_size); -#endif - - /* We process only contiguous file realm regions if we are - * using data sieving. Note that we only do this for - * writes since reads can be data sieved across each other - * without consistency issues. */ - if ((fd->hints->ds_write == ADIOI_HINT_ENABLE || - fd->hints->ds_write == ADIOI_HINT_AUTO) && - rw_type == ADIOI_WRITE && fd->hints->cb_nodes > 1) - { -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_agg_reqs: " - "Warning - Data sieving writes on\n"); -#endif - if (ds_fr_end == -1) - { - ds_fr_end = cur_off + cur_reg_max_len; -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_agg_reqs: " - "cur_off=%Ld, cur_reg_max_len=%Ld\n" - "Data sieving file realm end initialized to %Ld\n", - cur_off, - cur_reg_max_len, - ds_fr_end); -#endif - } - else - { - /* The next off switched file realms, so we will stop - * here. */ - if (ds_fr_end != cur_off + cur_reg_max_len) - { -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_agg_reqs: " - "Data sieving file realm end changed from " - "%Ld to %Ld\n", ds_fr_end, - cur_off + cur_reg_max_len); -#endif - break; - } - } - } - - /* Add up to the end of the file realm or the collective - * buffer. */ - if (cur_reg_max_len > (fd->hints->cb_buffer_size - - tmp_coll_buf_sz)) - cur_reg_max_len = fd->hints->cb_buffer_size - tmp_coll_buf_sz; - - view_state_add_region( - cur_reg_max_len, - &(client_file_view_state_arr[cur_off_proc]), - &st_reg, &act_reg_sz, i); - - switch(i) - { - case TEMP_OFF: - /* Increment the ol list count for each proc and - * the used part of the collective buffer if the - * next region is not adjacent to the previous - * region. */ - if (client_comm_next_off_arr[cur_off_proc] != - tmp_coll_buf_sz) - { - (client_ol_ct_arr[cur_off_proc])++; - } - client_comm_next_off_arr[cur_off_proc] = - tmp_coll_buf_sz + act_reg_sz; - - if (agg_next_off != st_reg) - agg_ol_ct++; - agg_next_off = st_reg + act_reg_sz; - break; - case REAL_OFF: - /* Add this region to the proper client ol list if - * the next region is not adjacent to the previous - * region. */ - next_off_idx = client_ol_cur_ct_arr[cur_off_proc]; - if (client_comm_next_off_arr[cur_off_proc] != - tmp_coll_buf_sz) - { - client_disp_arr[cur_off_proc][next_off_idx] = - tmp_coll_buf_sz; - client_blk_arr[cur_off_proc][next_off_idx] = - act_reg_sz; - (client_ol_cur_ct_arr[cur_off_proc])++; - } - else - { - client_blk_arr[cur_off_proc][next_off_idx - 1] - += act_reg_sz; - } - client_comm_sz_arr[cur_off_proc] += act_reg_sz; - client_comm_next_off_arr[cur_off_proc] = - tmp_coll_buf_sz + act_reg_sz; - - /* Add to the aggregator filetype if the next - * region is not adjacent to the previous - * region. */ - if (agg_next_off != st_reg) - { - /* this will enable initial offsets much further into - * the file than an MPI_Aint */ - if (!agg_ol_cur_ct) - *agg_dtype_offset_p = st_reg; - agg_disp_arr[agg_ol_cur_ct] = st_reg - - (MPI_Aint) *agg_dtype_offset_p; - agg_blk_arr[agg_ol_cur_ct] = act_reg_sz; - agg_ol_cur_ct++; - } - else - { - agg_blk_arr[agg_ol_cur_ct - 1] += act_reg_sz; - } - agg_next_off = st_reg + act_reg_sz; - - break; - default: - fprintf(stderr, "ADIOI_Build_agg_reqs: Impossible type\n"); - } - tmp_coll_buf_sz += act_reg_sz; - - find_next_off(fd, - &client_file_view_state_arr[cur_off_proc], - fr_st_off_arr[agg_idx], - &(fr_type_arr[agg_idx]), - i, - &next_off, - &next_reg_max_len); - - if ((next_off != -1) || (!offset_heap.size)) { - ADIOI_Heap_insert(&offset_heap, next_off, cur_off_proc, - next_reg_max_len); -#ifdef DEBUG_HEAP - printf ("inserting offset %lld for p%d\n", next_off, - cur_off_proc); -#endif - } - } - - if (i == TEMP_OFF) - { - /* Allocate offset-length pairs for creating hindexed - * MPI_Datatypes for both the client and the aggregator. */ - if ((client_disp_arr = (MPI_Aint **) - ADIOI_Malloc(nprocs*sizeof(MPI_Aint *))) == NULL) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: malloc " - "client_disp_arr failed\n"); - return -1; - } - if ((client_blk_arr = (int **) ADIOI_Malloc( - nprocs*sizeof(int *))) == NULL) - { - ADIOI_Free(client_disp_arr); - fprintf(stderr, "ADIOI_Build_agg_reqs: malloc " - "client_blk_arr failed\n"); - return -1; - } - for (j = 0; j < nprocs; j++) - { - if ((client_disp_arr[j] = (MPI_Aint *) ADIOI_Malloc( - client_ol_ct_arr[j]*sizeof(MPI_Aint))) == NULL) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: malloc " - "client_disp_arr[%d] failed\n", j); - return -1; - } - if ((client_blk_arr[j] = (int *) - ADIOI_Malloc(client_ol_ct_arr[j]*sizeof(int))) == NULL) - { - ADIOI_Free(client_disp_arr[j]); - fprintf(stderr, "ADIOI_Build_agg_reqs: malloc " - "client_blk_arr[%d] failed\n", j); - return -1; - } - } - - if (agg_ol_ct > 0) - { - if ((agg_disp_arr = (MPI_Aint *) ADIOI_Malloc( - agg_ol_ct*sizeof(MPI_Aint))) == NULL) - { - fprintf(stderr, - "ADIOI_Build_agg_reqs: malloc disp_arr failed\n"); - return -1; - } - if ((agg_blk_arr = (int *) - ADIOI_Malloc(agg_ol_ct*sizeof(int))) == NULL) - { - ADIOI_Free(agg_disp_arr); - fprintf(stderr, - "ADIOI_Build_agg_reqs: malloc blk_arr failed\n"); - return -1; - } - } - } - ADIOI_Heap_free(&offset_heap); - } - - /* Let the clients know if this aggregator is totally finished - * with all possible client requests. */ - all_done = 1; - for (i = 0; i < nprocs; i++) - { - if ((client_file_view_state_arr[i].cur_state.cur_sz != - client_file_view_state_arr[i].sz) || - client_comm_sz_arr[i] != 0) - { - all_done = 0; - break; - } - } - if (all_done == 1) - { - for (i = 0; i < nprocs; i++) - { - client_comm_sz_arr[i] = -1; - } - } - - /* Quick check to make sure we found all the ol pairs we thought - * we did */ - for (i = 0; i < nprocs; i++) - { - if (client_ol_cur_ct_arr[i] != client_ol_ct_arr[i]) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: ERROR Process %d " - "processed only %d out of %d ol pairs\n", i, - client_ol_cur_ct_arr[i], - client_ol_ct_arr[i]); - return -1; - } - } -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_agg_reqs:(client,ol_pairs,size_req)="); - for (i = 0; i < nprocs; i++) - { - fprintf(stderr, "(%d,%d,%Ld)", i, client_ol_ct_arr[i], - client_comm_sz_arr[i]); - if (i != nprocs - 1) - fprintf(stderr, ","); - } - fprintf(stderr, "\n"); -#endif -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_agg_reqs: Generated %d of %d " - "aggregate offset-length pairs\n", agg_ol_cur_ct, agg_ol_ct); -#endif -#ifdef DEBUG2 - for (i = 0; i < nprocs; i++) - { - if (client_ol_ct_arr[i] > 0) - { - fprintf(stderr, "ADIOI_Build_agg_reqs: p %d (off,len) = ", i); - for (j = 0; j < client_ol_ct_arr[i]; j++) - { - fprintf(stderr, "[%d](%d,%d) ", j, - client_disp_arr[i][j], - client_blk_arr[i][j]); - } - fprintf(stderr, "\n"); - } - } - if (agg_ol_ct) { - fprintf(stderr, "ADIOI_Build_agg_reqs:agg_type(off,len)="); - for (i = 0; i < agg_ol_ct; i++) - { - fprintf(stderr, "[%d](%d,%d)", - i, agg_disp_arr[i], agg_blk_arr[i]); - if (i != agg_ol_ct - 1) - fprintf(stderr, ","); - } - fprintf(stderr, "\n"); - } -#endif - - assert(agg_ol_cur_ct == agg_ol_ct); - - /* Create all the client and aggregate MPI_Datatypes */ - for (i = 0; i < nprocs; i++) - { - if (client_comm_sz_arr[i] > 0) - { - MPI_Type_create_hindexed(client_ol_ct_arr[i], client_blk_arr[i], - client_disp_arr[i], MPI_BYTE, - &(client_comm_dtype_arr[i])); - MPI_Type_commit(&(client_comm_dtype_arr[i])); - } - else - { - client_comm_dtype_arr[i] = MPI_BYTE; - } - ADIOI_Free(client_blk_arr[i]); - ADIOI_Free(client_disp_arr[i]); - } - ADIOI_Free(client_blk_arr); - ADIOI_Free(client_disp_arr); - - if (agg_ol_ct > 0) { - if (agg_ol_ct == 1) - MPI_Type_contiguous (agg_blk_arr[0], MPI_BYTE, agg_dtype_p); - else if (agg_ol_ct > 1) - MPI_Type_create_hindexed(agg_ol_ct, agg_blk_arr, agg_disp_arr, MPI_BYTE, - agg_dtype_p); - - MPI_Type_commit(agg_dtype_p); - - ADIOI_Free(agg_disp_arr); - ADIOI_Free(agg_blk_arr); - } - ADIOI_Free(client_ol_ct_arr); - ADIOI_Free(client_ol_cur_ct_arr); - ADIOI_Free(client_comm_next_off_arr); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5017, 0, NULL); -#endif - return 0; -} - -/* All sizes from all aggregators are gathered on the clients, which - * then call this function, which will generate the comm datatypes for - * each aggregator (agg_comm_dtype_arr) in the upcoming - * MPI_Alltoallw() */ -int ADIOI_Build_client_reqs(ADIO_File fd, - int nprocs, - view_state *my_mem_view_state_arr, - view_state *agg_file_view_state_arr, - ADIO_Offset *agg_comm_sz_arr, - MPI_Datatype *agg_comm_dtype_arr) -{ - MPI_Aint **agg_disp_arr = NULL; - int **agg_blk_arr = NULL; - view_state *tmp_mem_state_p = NULL, *tmp_file_state_p = NULL; - ADIO_Offset total_agg_comm_sz = 0, cur_total_agg_comm_sz = 0; - ADIO_Offset st_reg = 0, act_reg_sz = 0, tmp_reg_sz = 0; - ADIO_Offset cur_off = -1, cur_reg_max_len = -1; - ADIO_Offset tmp_cur_off = -1, tmp_cur_reg_max_len = -1; - ADIO_Offset agg_mem_st_reg = 0, agg_mem_act_reg_sz = 0; - ADIO_Offset *fr_st_off_arr = fd->file_realm_st_offs; - ADIO_Offset *agg_comm_cur_sz_arr = NULL; - MPI_Datatype *fr_type_arr = fd->file_realm_types; - int *agg_ol_ct_arr = NULL; - int *agg_ol_cur_ct_arr = NULL; - int tmp_agg_fr_idx = -1; - int cur_off_proc = -1; - int i = 0, j = 0; - int agg_next_off_idx = -1; - /* Used for coalescing ol pairs next to each other. */ - ADIO_Offset *agg_mem_next_off_arr = NULL; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5018, 0, NULL); -#endif - -#ifdef DEBUG - fprintf(stderr, "ADIOI_Build_client_reqs:(agg,size_req)="); - for (i = 0; i < nprocs; i++) - { - int tmp_agg_idx = ADIOI_Agg_idx(i, fd); - if (tmp_agg_idx >= 0) - { - fprintf(stderr, "(%d,%Ld)", i, agg_comm_sz_arr[i]); - if (i != fd->hints->cb_nodes - 1) - fprintf(stderr, ","); - } - fprintf(stderr, "\n"); - } -#endif - - if ((agg_mem_next_off_arr = (ADIO_Offset *) ADIOI_Malloc( - nprocs*sizeof(ADIO_Offset))) == NULL) - { - fprintf(stderr, "ADIOI_Build_client_reqs: malloc agg_mem_next_off_arr" - "failed\n"); - return -1; - } - - if ((agg_comm_cur_sz_arr = (ADIO_Offset *) - ADIOI_Malloc(nprocs*sizeof(ADIO_Offset))) == NULL) - { - fprintf(stderr, "ADIOI_Build_client_reqs: malloc agg_comm_cur_sz_arr" - " failed\n"); - return -1; - } - if ((agg_ol_ct_arr = (int *) ADIOI_Calloc(nprocs, sizeof(int))) - == NULL) - { - fprintf(stderr, "ADIOI_Build_client_reqs: " - "malloc agg_ol_ct_arr failed\n"); - return -1; - } - if ((agg_ol_cur_ct_arr = (int *) ADIOI_Calloc(nprocs, sizeof(int))) - == NULL) - { - fprintf(stderr, "ADIOI_Build_client_reqs: " - "malloc agg_ol_cur_ct_arr failed\n"); - return -1; - } - - for (i = 0; i < nprocs; i++) - { - if (agg_comm_sz_arr[i] > 0) - total_agg_comm_sz += agg_comm_sz_arr[i]; - } - - /* On the first pass see how many offset-length pairs are - * necessary for each aggregator. Then allocate the correct - * amount of offset-length pairs for handling each aggregator's - * particular data size. On the last pass, we actually create the - * offset-length pairs. */ - for (i = 0; i < MAX_OFF_TYPE; i++) - { - cur_total_agg_comm_sz = 0; - memset(agg_comm_cur_sz_arr, 0, nprocs*sizeof(ADIO_Offset)); - memset(agg_mem_next_off_arr, -1, nprocs*sizeof(ADIO_Offset)); - while (total_agg_comm_sz > cur_total_agg_comm_sz) - { - /* Look for the next aggregator offset among all the - * aggregators and their respective file realms. */ - cur_off = -1; - for (j = 0; j < nprocs; j++) - { - tmp_agg_fr_idx = ADIOI_Agg_idx(j, fd); - assert(tmp_agg_fr_idx < fd->hints->cb_nodes); - - /* If this process is not an aggregator or we have - * finished all the bytes for this aggregator, move - * along. */ - if (tmp_agg_fr_idx < 0 || - agg_comm_cur_sz_arr[j] == agg_comm_sz_arr[j]) - { - continue; - } - - find_next_off(fd, - &(agg_file_view_state_arr[j]), - fr_st_off_arr[tmp_agg_fr_idx], - &(fr_type_arr[tmp_agg_fr_idx]), - i, - &tmp_cur_off, - &tmp_cur_reg_max_len); - if (tmp_cur_off == -1) - continue; - - if ((cur_off == -1) || - (cur_off > tmp_cur_off)) - { - cur_off_proc = j; - cur_off = tmp_cur_off; - cur_reg_max_len = tmp_cur_reg_max_len; - } - } - - assert(cur_off_proc != -1); - - /* Add up to the end of the file realm or as many bytes - * are left for this particular aggregator in the client's - * filetype */ - if (cur_reg_max_len > agg_comm_sz_arr[cur_off_proc] - - agg_comm_cur_sz_arr[cur_off_proc]) - { - cur_reg_max_len = agg_comm_sz_arr[cur_off_proc] - - agg_comm_cur_sz_arr[cur_off_proc]; - } - assert(cur_reg_max_len > 0); - - view_state_add_region( - cur_reg_max_len, - &(agg_file_view_state_arr[cur_off_proc]), - &st_reg, &act_reg_sz, i); - -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_client_reqs: %s File region" - " (proc=%d,off=%Ld,sz=%Ld)\n", - off_type_name[i], cur_off_proc, - cur_off, act_reg_sz); -#endif - - /* Before translating the file regions to memory regions, - * we first must advance to the proper point in the - * mem_view_state for this aggregator to match the - * file_view_state. */ - tmp_file_state_p = &(agg_file_view_state_arr[cur_off_proc]); - tmp_mem_state_p = &(my_mem_view_state_arr[cur_off_proc]); - assert(view_state_get_cur_sz(tmp_file_state_p, i) - act_reg_sz >= - view_state_get_cur_sz(tmp_mem_state_p, i)); - while (view_state_get_cur_sz(tmp_file_state_p, i) - act_reg_sz != - view_state_get_cur_sz(tmp_mem_state_p, i)) - { - ADIO_Offset fill_st_reg = -1, fill_reg_sz = -1; - view_state_add_region( - view_state_get_cur_sz(tmp_file_state_p, i) - act_reg_sz - - view_state_get_cur_sz(tmp_mem_state_p, i), - tmp_mem_state_p, - &fill_st_reg, - &fill_reg_sz, i); - } - - /* Based on how large the act_reg_sz 1. Figure out how - * many memory offset-length pairs are necessary. 2. Set - * the offset-length pairs. */ - tmp_reg_sz = 0; - while (tmp_reg_sz != act_reg_sz) - { - view_state_add_region( - act_reg_sz - tmp_reg_sz, - tmp_mem_state_p, - &agg_mem_st_reg, &agg_mem_act_reg_sz, - i); - tmp_reg_sz += agg_mem_act_reg_sz; - -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_client_reqs: Mem region %s" - "(proc=%d,off=%Ld,sz=%Ld)\n", - off_type_name[i], cur_off_proc, - agg_mem_st_reg, agg_mem_act_reg_sz); -#endif - agg_comm_cur_sz_arr[cur_off_proc] += agg_mem_act_reg_sz; - cur_total_agg_comm_sz += agg_mem_act_reg_sz; - switch(i) - { - case TEMP_OFF: - /* Increment the ol list count a particular - * aggregator if next region is not adjacent - * to the previous region. */ - if (agg_mem_next_off_arr[cur_off_proc] != - agg_mem_st_reg) - { - agg_ol_ct_arr[cur_off_proc]++; - } - agg_mem_next_off_arr[cur_off_proc] = - agg_mem_st_reg + agg_mem_act_reg_sz; - break; - case REAL_OFF: - /* Set the ol list for the memtypes that will - * map to each aggregator, coaslescing if - * possible. */ - agg_next_off_idx = agg_ol_cur_ct_arr[cur_off_proc]; - if (agg_mem_next_off_arr[cur_off_proc] != - agg_mem_st_reg) - { - agg_disp_arr[cur_off_proc][agg_next_off_idx] = - agg_mem_st_reg; - agg_blk_arr[cur_off_proc][agg_next_off_idx] = - agg_mem_act_reg_sz; - (agg_ol_cur_ct_arr[cur_off_proc])++; - } - else - { - agg_blk_arr[cur_off_proc][agg_next_off_idx - 1] - += agg_mem_act_reg_sz; - } - agg_mem_next_off_arr[cur_off_proc] = - agg_mem_st_reg + agg_mem_act_reg_sz; - break; - default: - fprintf(stderr, "ADIOI_Build_client_reqs: " - "Impossible type\n"); - } - } - } - - /* On the first pass, allocate the memory structures for - * creating the MPI_hindexed type. */ - if (i == TEMP_OFF) - { - /* Allocate offset-length pairs for creating hindexed - * MPI_Datatypes for each aggregator */ - if ((agg_disp_arr = (MPI_Aint **) - ADIOI_Malloc(nprocs*sizeof(MPI_Aint *))) == NULL) - { - fprintf(stderr, - "ADIOI_Build_client_reqs: malloc agg_disp_arr failed\n"); - return -1; - } - if ((agg_blk_arr = (int **) ADIOI_Malloc(nprocs*sizeof(int *))) - == NULL) - { - ADIOI_Free(agg_disp_arr); - fprintf(stderr, - "ADIOI_Build_client_reqs: malloc agg_blk_arr failed\n"); - return -1; - } - for (j = 0; j < nprocs; j++) - { - if ((agg_disp_arr[j] = (MPI_Aint *) - ADIOI_Malloc(agg_ol_ct_arr[j]*sizeof(MPI_Aint))) == NULL) - { - fprintf(stderr, "ADIOI_Build_client_reqs: malloc " - "agg_disp_arr[%d] failed\n", j); - return -1; - } - if ((agg_blk_arr[j] = (int *) - ADIOI_Malloc(agg_ol_ct_arr[j]*sizeof(int))) == NULL) - { - ADIOI_Free(agg_disp_arr[j]); - fprintf(stderr, "ADIOI_Build_client_reqs: malloc " - "agg_blk_arr[%d] failed\n", j); - return -1; - } - } - } - } - -#ifdef DEBUG - fprintf(stderr, "ADIOI_Build_client_reqs:(agg,cur_ol_count=ol_count)="); - for (i = 0; i < nprocs; i++) - { - int tmp_agg_idx = ADIOI_Agg_idx(i, fd); - if (tmp_agg_idx >= 0) - { - fprintf(stderr, "(%d,%d=%d)", i, agg_ol_cur_ct_arr[i], - agg_ol_ct_arr[i]); - assert(agg_ol_ct_arr[i] == agg_ol_cur_ct_arr[i]); - if (tmp_agg_idx != fd->hints->cb_nodes - 1) - fprintf(stderr, ","); - } - } - fprintf(stderr, "\n"); -#endif - -#ifdef DEBUG2 - for (i = 0; i < nprocs; i++) - { - if (agg_ol_ct_arr[i] > 0) - { - fprintf(stderr, "ADIOI_Build_client_reqs: p %d (off,len) = ", i); - for (j = 0; j < agg_ol_ct_arr[i]; j++) - { - fprintf(stderr, "[%d](%d,%d) ", j, - agg_disp_arr[i][j], - agg_blk_arr[i][j]); - } - fprintf(stderr, "\n"); - } - } -#endif - - /* Create all the aggregator MPI_Datatypes */ - for (i = 0; i < nprocs; i++) - { - if (agg_comm_sz_arr[i] > 0) - { - MPI_Type_create_hindexed(agg_ol_ct_arr[i], agg_blk_arr[i], - agg_disp_arr[i], MPI_BYTE, - &(agg_comm_dtype_arr[i])); - MPI_Type_commit(&(agg_comm_dtype_arr[i])); - } - else - { - agg_comm_dtype_arr[i] = MPI_BYTE; - } - ADIOI_Free(agg_blk_arr[i]); - ADIOI_Free(agg_disp_arr[i]); - } - ADIOI_Free(agg_blk_arr); - ADIOI_Free(agg_disp_arr); - - ADIOI_Free(agg_mem_next_off_arr); - ADIOI_Free(agg_comm_cur_sz_arr); - ADIOI_Free(agg_ol_ct_arr); - ADIOI_Free(agg_ol_cur_ct_arr); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5019, 0, NULL); -#endif - return 0; -} -/* ADIOI_Build_client_pre_req allows a client to calculate the memtype - * offset-length pairs up (up to a limit - max_pre_req_sz or max - * ol_ct). It basically allows ADIOI_Build_client_req to do less work. - * If it called and there already exist some preprocessed memtype - * offset-length pairs, it will exit immediately if a limit has been - * reached or if will add on the old limites to reach the new - * limits. */ - -int ADIOI_Build_client_pre_req(ADIO_File fd, - int agg_rank, int agg_idx, - view_state *my_mem_view_state_p, - view_state *agg_file_view_state_p, - ADIO_Offset max_pre_req_sz, - int max_ol_ct) -{ - ADIO_Offset act_reg_sz = 0, tmp_reg_sz = 0; - ADIO_Offset cur_off = -1, cur_reg_max_len = -1; - ADIO_Offset agg_mem_st_reg = 0, agg_mem_act_reg_sz = 0; - int agg_ol_ct = 0, agg_ol_cur_ct = 0; - int i, agg_next_off_idx = -1; - - ADIO_Offset cur_sz = 0, max_sz = 0, agg_mem_next_off = -1; - ADIO_Offset fill_st_reg = -1, fill_reg_sz = -1; - ADIO_Offset *fr_st_off_arr = fd->file_realm_st_offs; - MPI_Datatype *fr_type_arr = fd->file_realm_types; - MPI_Aint *tmp_disp_arr = NULL; - int *tmp_blk_arr = NULL, exit_loop = -1; - flatten_state *tmp_mem_state_p = NULL, *tmp_file_state_p = NULL; -#ifdef DTYPE_SKIP - int skip_type_ct; -#endif - if (agg_idx < 0 || agg_idx >= fd->hints->cb_nodes) - { - fprintf(stderr, "ADIOI_Build_client_pre_req: Invalid agg_idx %d\n", - agg_idx); - return -1; - } - - if (agg_file_view_state_p->cur_state.cur_sz == - agg_file_view_state_p->sz || max_pre_req_sz <= 0 || - max_ol_ct <= 0) - { -#ifdef DEBUG1 - fprintf(stderr, - "ADIOI_Build_client_pre_req: Nothing to preprocess\n"); -#endif - return 0; - } - - /* The new limits have already been surpassed by what already - * exists. Otherwise we will use the next restrictions */ - if ((my_mem_view_state_p->pre_sz >= max_pre_req_sz) || - (my_mem_view_state_p->pre_ol_ct >= max_ol_ct)) - { -#ifdef DEBUG1 - fprintf(stderr, - "ADIOI_Build_client_pre_req: Old values surpass new " - "pre_req values\n"); -#endif - return 0; - } - - /* General idea is to first advance the filetype to the file realm - * and then the memtype to the filetype. The memtype is advanced - * further by peeking at the filetype and then the filetype is - * advanced. */ - for (i = 0; i < MAX_OFF_TYPE; i++) - { - switch(i) - { - case TEMP_OFF: - tmp_mem_state_p = &(my_mem_view_state_p->tmp_state); - tmp_file_state_p = &(agg_file_view_state_p->tmp_state); - break; - case REAL_OFF: - tmp_mem_state_p = &(my_mem_view_state_p->cur_state); - tmp_file_state_p = &(agg_file_view_state_p->cur_state); - break; - default: - fprintf(stderr, "ADIOI_Build_client_pre_req: " - "Invalid off type %d\n", i); - } - - if (i == TEMP_OFF && my_mem_view_state_p->pre_sz > 0) - { - cur_sz = my_mem_view_state_p->pre_sz; - agg_ol_ct = my_mem_view_state_p->pre_ol_ct; - /* Save the old arrays */ - tmp_disp_arr = my_mem_view_state_p->pre_disp_arr; - tmp_blk_arr = my_mem_view_state_p->pre_blk_arr; - my_mem_view_state_p->pre_disp_arr = NULL; - my_mem_view_state_p->pre_blk_arr = NULL; - agg_mem_next_off = - tmp_disp_arr[agg_ol_ct - 1] + tmp_blk_arr[agg_ol_ct - 1]; - } - else if (i == REAL_OFF && my_mem_view_state_p->pre_sz > 0) - { - cur_sz = my_mem_view_state_p->pre_sz; - agg_ol_cur_ct = my_mem_view_state_p->pre_ol_ct; - - /* Copy the old data to the new data, freeing the old - * arrays */ - memcpy(my_mem_view_state_p->pre_disp_arr, tmp_disp_arr, - my_mem_view_state_p->pre_ol_ct * sizeof(MPI_Aint)); - memcpy(my_mem_view_state_p->pre_blk_arr, tmp_blk_arr, - my_mem_view_state_p->pre_ol_ct * sizeof(int)); - - ADIOI_Free(tmp_disp_arr); - ADIOI_Free(tmp_blk_arr); - - agg_mem_next_off = - my_mem_view_state_p->pre_disp_arr[agg_ol_cur_ct - 1] + - my_mem_view_state_p->pre_blk_arr[agg_ol_cur_ct - 1]; - } - else - { - cur_sz = 0; - } - - /* Max_pre_req_sz may be larger than the amount of data left - * to preprocess */ - if (max_pre_req_sz - cur_sz > - agg_file_view_state_p->sz - tmp_file_state_p->cur_sz) - { - max_sz = cur_sz + - agg_file_view_state_p->sz - tmp_file_state_p->cur_sz; - } - else - max_sz = max_pre_req_sz; - - assert(cur_sz != max_sz); -#ifdef DEBUG1 - fprintf(stderr, - "ADIOI_Build_client_pre_req: (cur_sz=%Ld,agg_ol_ct=%d," - "agg_mem_next_off=%Ld,max_sz=%Ld,max_ol_ct=%d)\n", - cur_sz, agg_ol_ct, agg_mem_next_off, max_sz, max_ol_ct); -#endif - while (cur_sz < max_sz) - { - find_next_off(fd, agg_file_view_state_p, - fr_st_off_arr[agg_rank], - &(fr_type_arr[agg_rank]), - i, - &cur_off, - &cur_reg_max_len); - - /* find_next_off may show that the file_view_state is done - * even if cur_sz != max_sz since find_next_off may - * advance the file_view_state to the end here and realize - * that it is done. */ - if (cur_off == -1) - break; - - assert(cur_off != -1); - - /* Before translating the file regions to memory regions, - * we first must advance to the proper point in the - * mem_view_state for this aggregator to match the - * file_view_state. */ - while (tmp_file_state_p->cur_sz != tmp_mem_state_p->cur_sz) - { -#ifdef DTYPE_SKIP - if (my_mem_view_state_p->flat_type_p->count > 1) { - /* let's see if we can skip whole memory datatypes */ - skip_type_ct = - (tmp_file_state_p->cur_sz - tmp_mem_state_p->cur_sz) / - my_mem_view_state_p->type_sz; - if (skip_type_ct > 0) { - tmp_mem_state_p->cur_sz += - skip_type_ct * my_mem_view_state_p->type_sz; - tmp_mem_state_p->abs_off += - skip_type_ct * my_mem_view_state_p->ext; - if (tmp_mem_state_p->cur_sz == - tmp_file_state_p->cur_sz) - break; - } - } -#endif - view_state_add_region( - tmp_file_state_p->cur_sz - tmp_mem_state_p->cur_sz, - my_mem_view_state_p, - &fill_st_reg, - &fill_reg_sz, i); - } - - /* Now that the filetype and memtype are advanced to the - * same position, add memtype ol-pairs while we have not - * overstepped the min(end of the current piece in the - * file view, end of the file realm, data left in - * max_sz) */ - - if (cur_reg_max_len > - view_state_get_next_len(agg_file_view_state_p, i)) - cur_reg_max_len = - view_state_get_next_len(agg_file_view_state_p, i); - - if (cur_reg_max_len > max_sz - cur_sz) - cur_reg_max_len = max_sz - cur_sz; - - assert(cur_reg_max_len > 0); - - /* Add memtype ol pairs while we have not passed - * cur_reg_max_len or the max number of ol pairs - * allowed */ - act_reg_sz = 0; - exit_loop = 0; - while ((act_reg_sz < cur_reg_max_len) && - (exit_loop == 0)) - { - view_state_add_region( - cur_reg_max_len - act_reg_sz, - my_mem_view_state_p, - &agg_mem_st_reg, &agg_mem_act_reg_sz, - i); - act_reg_sz += agg_mem_act_reg_sz; - -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_client_pre_req: %s Mem region" - "(proc=%d,off=%Ld,sz=%Ld)\n", - off_type_name[i], agg_rank, agg_mem_st_reg, - agg_mem_act_reg_sz); -#endif - switch(i) - { - case TEMP_OFF: - /* Increment the ol list count if the next - * region is not adjacent to the previous - * region. */ - if (agg_mem_next_off != agg_mem_st_reg) - { - agg_ol_ct++; - if (agg_ol_ct == max_ol_ct) - exit_loop = 1; - } - agg_mem_next_off = - agg_mem_st_reg + agg_mem_act_reg_sz; - break; - case REAL_OFF: - /* Set the ol list for the memtype that - * will map to our aggregator, coaslescing - * if possible. */ - agg_next_off_idx = agg_ol_cur_ct; - if (agg_mem_next_off != agg_mem_st_reg) - { - my_mem_view_state_p-> - pre_disp_arr[agg_next_off_idx] = - agg_mem_st_reg; - my_mem_view_state_p-> - pre_blk_arr[agg_next_off_idx] = - agg_mem_act_reg_sz; - agg_ol_cur_ct++; - if (agg_ol_cur_ct == agg_ol_ct) - exit_loop = 1; - } - else - { - my_mem_view_state_p-> - pre_blk_arr[agg_next_off_idx - 1] - += agg_mem_act_reg_sz; - } - agg_mem_next_off = - agg_mem_st_reg + agg_mem_act_reg_sz; - break; - default: - fprintf(stderr, "ADIOI_Build_client_pre_req: " - "Impossible type\n"); - } - } - - /* Advance the filetype flatten state appropriately to - * match the data advanced in the memtype flatten state. - * Should only take at most a single view_state_add_region - * call since the memtype cannot proceed beyond the end of - * a contig piece in the file type. */ - view_state_add_region(act_reg_sz - tmp_reg_sz, - agg_file_view_state_p, - &fill_st_reg, &fill_reg_sz, i); -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_client_pre_req: %s File region" - " (proc=%d,off=%Ld,sz=%Ld)\n", - off_type_name[i], agg_rank, fill_st_reg, fill_reg_sz); -#endif - if (fill_reg_sz != act_reg_sz) - { - fprintf(stderr, "ADIOI_Build_client_pre_req: " - "view_state_add_region failed to match the memtype\n"); - return -1; - } - - cur_sz += act_reg_sz; - } - - /* On the first pass, allocate the memory structures for - * storing the preprocessed information */ - if (i == TEMP_OFF) - { - if ((my_mem_view_state_p->pre_disp_arr = (MPI_Aint *) - ADIOI_Malloc(agg_ol_ct * sizeof(MPI_Aint))) == NULL) - { - fprintf(stderr, "ADIOI_Build_client_pre_req: malloc " - "pre_disp_arr of size %ld failed\n", - (long int)agg_ol_ct * sizeof(MPI_Aint)); - return -1; - } - if ((my_mem_view_state_p->pre_blk_arr = (int *) - ADIOI_Malloc(agg_ol_ct * sizeof(int))) == NULL) - { - ADIOI_Free(my_mem_view_state_p->pre_disp_arr); - fprintf(stderr, "ADIOI_Build_client_pre_req: malloc " - "agg_blk_arr of size %ld failed\n", - (long int)agg_ol_ct * sizeof(int)); - return -1; - } - } - } - - my_mem_view_state_p->pre_sz = cur_sz; - my_mem_view_state_p->pre_ol_ct = agg_ol_ct; - -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_client_pre_req:(agg=%d,cur_ol_count=%d" - "=ol_count=%d)\n", - agg_rank, my_mem_view_state_p->pre_ol_ct, agg_ol_ct); -#endif - -#ifdef DEBUG2 - if (agg_ol_ct > 0) - { - fprintf(stderr, "ADIOI_Build_client_pre_req: agg=%d,pre_sz=%Ld " - "(off,len) = \n", agg_rank, my_mem_view_state_p->pre_sz); - for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) - { - fprintf(stderr, "[%d](%d,%d) ", i, - my_mem_view_state_p->pre_disp_arr[i], - my_mem_view_state_p->pre_blk_arr[i]); - if (i % 5 == 0 && i != 0) - fprintf(stderr, "\n"); - } - fprintf(stderr, "\n"); - } -#endif - - return 0; -} - -/* process_pre_req() allows ADIOI_Build_client_req to use the pre_req - * information. */ - -static int process_pre_req(ADIO_File fd, - int agg_rank, - int agg_idx, - view_state *my_mem_view_state_p, - view_state *agg_file_view_state_p, - ADIO_Offset agg_comm_sz, - int off_type, - MPI_Aint *agg_disp_arr, - int *agg_blk_arr, - ADIO_Offset *agg_comm_pre_sz_p, - ADIO_Offset *agg_comm_cur_sz_p, - ADIO_Offset *agg_comm_sz_p, - int *agg_ol_cur_ct_p, - int *agg_ol_ct_p, - ADIO_Offset *agg_mem_next_off_p) -{ - int i, has_partial = 0; - MPI_Aint partial_disp = 0; - int partial_len = 0; - ADIO_Offset tmp_agg_comm_pre_sz = 0; - - assert (my_mem_view_state_p->pre_sz > 0); - switch(off_type) - { - case TEMP_OFF: - /* Use only some of the precalculated data */ - if (my_mem_view_state_p->pre_sz > *agg_comm_sz_p) - { - for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) - { - if ((my_mem_view_state_p->pre_blk_arr[i] + - *agg_comm_pre_sz_p) > *agg_comm_sz_p) - { - has_partial = 1; - partial_len = *agg_comm_sz_p - *agg_comm_pre_sz_p; - *agg_comm_pre_sz_p = *agg_comm_sz_p; - i++; - break; - } - else if ((my_mem_view_state_p->pre_blk_arr[i] + - *agg_comm_pre_sz_p) == *agg_comm_sz_p) - { - *agg_comm_pre_sz_p += - my_mem_view_state_p->pre_blk_arr[i]; - i++; - break; - } - else - *agg_comm_pre_sz_p += - my_mem_view_state_p->pre_blk_arr[i]; - } - - if (has_partial == 1) - { - *agg_mem_next_off_p = - my_mem_view_state_p->pre_disp_arr[i - 1] + - partial_len; - } - else - { - *agg_mem_next_off_p = - my_mem_view_state_p->pre_disp_arr[i - 1] + - my_mem_view_state_p->pre_blk_arr[i - 1]; - } - - *agg_comm_cur_sz_p = *agg_comm_pre_sz_p; - *agg_ol_ct_p = i; - - } - else /* Use all the precalculated data */ - { - *agg_comm_pre_sz_p = my_mem_view_state_p->pre_sz; - *agg_comm_cur_sz_p = *agg_comm_pre_sz_p; - *agg_ol_ct_p = my_mem_view_state_p->pre_ol_ct; - *agg_mem_next_off_p = - my_mem_view_state_p->pre_disp_arr[ - my_mem_view_state_p->pre_ol_ct - 1] + - my_mem_view_state_p->pre_blk_arr[ - my_mem_view_state_p->pre_ol_ct - 1]; - } -#ifdef DEBUG1 - fprintf(stderr, "process_pre_req: TEMP_OFF " - "agg_comm_pre_sz=%Ld,agg_comm_cur_sz=%Ld,agg_ol_ct=%d\n", - *agg_comm_pre_sz_p, *agg_comm_cur_sz_p, *agg_ol_ct_p); -#endif - assert(*agg_comm_cur_sz_p <= *agg_comm_sz_p); - break; - case REAL_OFF: - /* Set the ol list for the memtype that will map to our - * aggregator, coaslescing if possible. */ - for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) - { - agg_disp_arr[i] = my_mem_view_state_p->pre_disp_arr[i]; - agg_blk_arr[i] = my_mem_view_state_p->pre_blk_arr[i]; - - if ((my_mem_view_state_p->pre_blk_arr[i] + - tmp_agg_comm_pre_sz) > *agg_comm_pre_sz_p) - { - has_partial = 1; - agg_blk_arr[i] = *agg_comm_pre_sz_p - tmp_agg_comm_pre_sz; - tmp_agg_comm_pre_sz = *agg_comm_pre_sz_p; - partial_disp = my_mem_view_state_p->pre_disp_arr[i] + - agg_blk_arr[i]; - partial_len = my_mem_view_state_p->pre_blk_arr[i] - - agg_blk_arr[i]; - i++; - break; - } - else if ((my_mem_view_state_p->pre_blk_arr[i] + - tmp_agg_comm_pre_sz) == *agg_comm_pre_sz_p) - { - tmp_agg_comm_pre_sz += - my_mem_view_state_p->pre_blk_arr[i]; - i++; - break; - } - else - tmp_agg_comm_pre_sz += - my_mem_view_state_p->pre_blk_arr[i]; - } - *agg_mem_next_off_p = agg_disp_arr[i - 1] + agg_blk_arr[i - 1]; - *agg_ol_cur_ct_p = i; - *agg_comm_cur_sz_p = *agg_comm_pre_sz_p; - - /* Clean up the ol pairs we used */ - if ((i < my_mem_view_state_p->pre_ol_ct) || (has_partial == 1)) - { - int remain_ol_ct = - my_mem_view_state_p->pre_ol_ct - i + has_partial; - MPI_Aint *new_pre_disp_arr = NULL; - int *new_pre_blk_arr = NULL; - - if ((new_pre_disp_arr = (MPI_Aint *) - ADIOI_Malloc(remain_ol_ct * sizeof(MPI_Aint))) == NULL) - { - fprintf(stderr, "process_pre_req: malloc " - "new_pre_disp_arr failed\n"); - return -1; - } - if ((new_pre_blk_arr = (int *) - ADIOI_Malloc(remain_ol_ct * sizeof(int))) == NULL) - { - fprintf(stderr, "process_pre_req: malloc " - "new_pre_blk_arr failed\n"); - return -1; - } - - memcpy(new_pre_disp_arr, - &(my_mem_view_state_p->pre_disp_arr[i - has_partial]), - remain_ol_ct * sizeof(MPI_Aint)); - memcpy(new_pre_blk_arr, - &(my_mem_view_state_p->pre_blk_arr[i - has_partial]), - remain_ol_ct * sizeof(int)); - - /* Set the partial len of the first piece */ - if (has_partial == 1) - { - /* new_pre_disp_arr[remain_ol_ct - 1] = partial_disp; - new_pre_blk_arr[remain_ol_ct - 1] = partial_len; */ - new_pre_disp_arr[0] = partial_disp; - new_pre_blk_arr[0] = partial_len; - } - - ADIOI_Free(my_mem_view_state_p->pre_disp_arr); - ADIOI_Free(my_mem_view_state_p->pre_blk_arr); - - my_mem_view_state_p->pre_disp_arr = new_pre_disp_arr; - my_mem_view_state_p->pre_blk_arr = new_pre_blk_arr; - my_mem_view_state_p->pre_ol_ct = remain_ol_ct; - my_mem_view_state_p->pre_sz -= *agg_comm_pre_sz_p; - } - else /* Used all the precalculated ol pairs */ - { - ADIOI_Free(my_mem_view_state_p->pre_disp_arr); - ADIOI_Free(my_mem_view_state_p->pre_blk_arr); - - my_mem_view_state_p->pre_disp_arr = NULL; - my_mem_view_state_p->pre_blk_arr = NULL; - my_mem_view_state_p->pre_ol_ct = 0; - my_mem_view_state_p->pre_sz = 0; - } -#ifdef DEBUG1 - fprintf(stderr, "process_pre_req: REAL_OFF " - "agg_comm_pre_sz=%Ld,agg_comm_cur_sz=%Ld,agg_ol_ct=%d," - "agg_ol_cur_ct=%d\n", - *agg_comm_pre_sz_p, *agg_comm_cur_sz_p, *agg_ol_ct_p, - *agg_ol_cur_ct_p); -#endif - break; - default: - fprintf(stderr, "process_pre_req: Invalid off_type %d\n", - off_type); - } - return 0; -} - -/* ADIOI_Build_client_req() creates a memory datatype to transfer data - * to/from a particular aggregator. */ - -int ADIOI_Build_client_req(ADIO_File fd, - int agg_rank, - int agg_idx, - view_state *my_mem_view_state_p, - view_state *agg_file_view_state_p, - ADIO_Offset agg_comm_sz, - MPI_Datatype *agg_comm_dtype_p) -{ - MPI_Aint *agg_disp_arr = NULL; - int *agg_blk_arr = NULL; - ADIO_Offset st_reg = 0, act_reg_sz = 0, tmp_reg_sz = 0; - ADIO_Offset cur_off = -1, cur_reg_max_len = -1; - ADIO_Offset agg_mem_st_reg = 0, agg_mem_act_reg_sz = 0; - int agg_ol_ct = 0, agg_ol_cur_ct = 0; - int i = 0, agg_next_off_idx = -1; - ADIO_Offset agg_mem_next_off = 0, agg_comm_cur_sz = 0, agg_comm_pre_sz = 0; - ADIO_Offset *fr_st_off_arr = fd->file_realm_st_offs; - MPI_Datatype *fr_type_arr = fd->file_realm_types; - flatten_state *tmp_mem_state_p = NULL, *tmp_file_state_p = NULL; -#ifdef DTYPE_SKIP - int skip_type_ct; -#endif - - if (agg_idx < 0 || agg_idx >= fd->hints->cb_nodes) - { -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_client_req: agg_rank %d does not map " - "to a valid node in cb_node\n", agg_rank); -#endif - return 0; - } - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5018, 0, NULL); -#endif - -#ifdef DEBUG1 - fprintf(stderr, "ADIOI_Build_client_req:(agg=%d,size_req=%Ld)\n", - agg_idx, agg_comm_sz); -#endif - - /* On the first pass see how many offset-length pairs are - * necessary for each aggregator. Then allocate the correct - * amount of offset-length pairs for handling each aggregator's - * particular data size. On the last pass, we actually create the - * offset-length pairs. */ - for (i = 0; i < MAX_OFF_TYPE; i++) - { - switch(i) - { - case TEMP_OFF: - tmp_mem_state_p = &(my_mem_view_state_p->tmp_state); - tmp_file_state_p = &(agg_file_view_state_p->tmp_state); - break; - case REAL_OFF: - tmp_mem_state_p = &(my_mem_view_state_p->cur_state); - tmp_file_state_p = &(agg_file_view_state_p->cur_state); - break; - default: - fprintf(stderr, "ADIOI_Build_client_pre_req: " - "Invalid off type %d\n", i); - } - - agg_comm_cur_sz = 0; - agg_mem_next_off = -1; - - /* First try to preprocess anything we can */ - if (my_mem_view_state_p->pre_sz > 0) - { - process_pre_req(fd, - agg_rank, - agg_idx, - my_mem_view_state_p, - agg_file_view_state_p, - agg_comm_sz, - i, - agg_disp_arr, - agg_blk_arr, - &agg_comm_pre_sz, - &agg_comm_cur_sz, - &agg_comm_sz, - &agg_ol_cur_ct, - &agg_ol_ct, - &agg_mem_next_off); - } - - while (agg_comm_cur_sz < agg_comm_sz) - { - find_next_off(fd, agg_file_view_state_p, - fr_st_off_arr[agg_idx], - &(fr_type_arr[agg_idx]), - i, - &cur_off, - &cur_reg_max_len); - - assert(cur_off != -1); - - /* Add up to the end of the file realm or as many bytes - * are left for this particular aggregator in the client's - * filetype */ - if (cur_reg_max_len > (agg_comm_sz - agg_comm_cur_sz)) - { - cur_reg_max_len = agg_comm_sz - agg_comm_cur_sz; - } - assert(cur_reg_max_len > 0); - - view_state_add_region( - cur_reg_max_len, - agg_file_view_state_p, - &st_reg, &act_reg_sz, i); - -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_client_req: %s File region" - " (proc=%d,off=%Ld,sz=%Ld)\n", - off_type_name[i], agg_rank, cur_off, act_reg_sz); -#endif - - /* Before translating the file regions to memory regions, - * we first must advance to the proper point in the - * mem_view_state for this aggregator to match the - * file_view_state. */ - - assert(tmp_file_state_p->cur_sz - act_reg_sz >= - tmp_mem_state_p->cur_sz); - - while (tmp_file_state_p->cur_sz - act_reg_sz != - tmp_mem_state_p->cur_sz) - { - ADIO_Offset fill_st_reg = -1, fill_reg_sz = -1; -#ifdef DTYPE_SKIP - if (my_mem_view_state_p->flat_type_p->count > 1) { - /* let's see if we can skip whole memory datatypes */ - skip_type_ct = - (tmp_file_state_p->cur_sz - act_reg_sz - - tmp_mem_state_p->cur_sz) / - my_mem_view_state_p->type_sz; - if (skip_type_ct > 0) { - tmp_mem_state_p->cur_sz += - skip_type_ct * my_mem_view_state_p->type_sz; - tmp_mem_state_p->abs_off += - skip_type_ct * my_mem_view_state_p->ext; - if ((tmp_mem_state_p->cur_sz - act_reg_sz) == - tmp_file_state_p->cur_sz) - break; - } - } -#endif - view_state_add_region( - tmp_file_state_p->cur_sz - - act_reg_sz - tmp_mem_state_p->cur_sz, - my_mem_view_state_p, - &fill_st_reg, - &fill_reg_sz, i); - } - - /* Based on how large the act_reg_sz is, first figure - * out how many memory offset-length pairs are - * necessary and then set the offset-length pairs. */ - tmp_reg_sz = 0; - while (tmp_reg_sz != act_reg_sz) - { - view_state_add_region( - act_reg_sz - tmp_reg_sz, - my_mem_view_state_p, - &agg_mem_st_reg, &agg_mem_act_reg_sz, - i); - tmp_reg_sz += agg_mem_act_reg_sz; - -#ifdef DEBUG2 - fprintf(stderr, "ADIOI_Build_client_req: %s Mem region" - "(off=%Ld,sz=%Ld)\n", - off_type_name[i], agg_mem_st_reg, - agg_mem_act_reg_sz); -#endif - agg_comm_cur_sz += agg_mem_act_reg_sz; - switch(i) - { - case TEMP_OFF: - /* Increment the ol list count if the next - * region is not adjacent to the previous - * region. */ - if (agg_mem_next_off != agg_mem_st_reg) - { - agg_ol_ct++; - } - agg_mem_next_off = - agg_mem_st_reg + agg_mem_act_reg_sz; - break; - case REAL_OFF: - /* Set the ol list for the memtype that - * will map to our aggregator, coaslescing - * if possible. */ - agg_next_off_idx = agg_ol_cur_ct; - if (agg_mem_next_off != agg_mem_st_reg) - { - agg_disp_arr[agg_next_off_idx] = - agg_mem_st_reg; - agg_blk_arr[agg_next_off_idx] = - agg_mem_act_reg_sz; - agg_ol_cur_ct++; - } - else - { - agg_blk_arr[agg_next_off_idx - 1] - += agg_mem_act_reg_sz; - } - agg_mem_next_off = - agg_mem_st_reg + agg_mem_act_reg_sz; - break; - default: - fprintf(stderr, "ADIOI_Build_client_req: " - "Impossible type\n"); - } - } - } - - /* On the first pass, allocate the memory structures for - * creating the MPI_hindexed type. */ - if (i == TEMP_OFF) - { - /* Allocate offset-length pairs for creating hindexed - * MPI_Datatypes for each aggregator */ - if ((agg_disp_arr = (MPI_Aint *) - ADIOI_Malloc(agg_ol_ct * sizeof(MPI_Aint))) == NULL) - { - fprintf(stderr, "ADIOI_Build_client_req: malloc " - "agg_disp_arr of size %ld failed\n", - (long int)agg_ol_ct * sizeof(MPI_Aint)); - return -1; - } - if ((agg_blk_arr = (int *) - ADIOI_Malloc(agg_ol_ct * sizeof(int))) == NULL) - { - ADIOI_Free(agg_disp_arr); - fprintf(stderr, "ADIOI_Build_client_req: malloc " - "agg_blk_arr of size %ld failed\n", - (long int)agg_ol_ct * sizeof(int)); - return -1; - } - } - } - - assert(agg_ol_ct == agg_ol_cur_ct); -#ifdef DEBUG1 - fprintf(stderr, - "ADIOI_Build_client_req:(agg=%d,cur_ol_count=%d=ol_count=%d)\n", - agg_rank, agg_ol_cur_ct, agg_ol_ct); -#endif - -#ifdef DEBUG2 - if (agg_ol_ct > 0) - { - fprintf(stderr, "ADIOI_Build_client_req: p %d (off,len) = ", agg_rank); - for (i = 0; i < agg_ol_ct; i++) - { - fprintf(stderr, "[%d](%d,%d) ", i, - agg_disp_arr[i], agg_blk_arr[i]); - if (i % 5 == 0 && i != 0) - fprintf(stderr, "\n"); - } - fprintf(stderr, "\n"); - } -#endif -#ifdef DEBUG1 - fprintf(stderr, - "ADIOI_Build_client_req:(agg=%d,pre_ol_count=%d)\n", - agg_idx, my_mem_view_state_p->pre_ol_ct); -#endif - -#ifdef DEBUG2 - if (my_mem_view_state_p->pre_sz > 0) - { - fprintf(stderr, "ADIOI_Build_client_req: p %d pre(off,len) = ", - agg_idx); - for (i = 0; i < my_mem_view_state_p->pre_ol_ct; i++) - { - fprintf(stderr, "[%d](%d,%d) ", i, - my_mem_view_state_p->pre_disp_arr[i], - my_mem_view_state_p->pre_blk_arr[i]); - if (i % 5 == 0 && i != 0) - fprintf(stderr, "\n"); - } - fprintf(stderr, "\n"); - } -#endif - - /* Create the aggregator MPI_Datatype */ - if (agg_comm_sz > 0) - { - MPI_Type_create_hindexed(agg_ol_ct, agg_blk_arr, agg_disp_arr, MPI_BYTE, - agg_comm_dtype_p); - MPI_Type_commit(agg_comm_dtype_p); - } - else - { - *agg_comm_dtype_p = MPI_BYTE; - } - - ADIOI_Free(agg_blk_arr); - ADIOI_Free(agg_disp_arr); - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5019, 0, NULL); -#endif - return 0; -} - - diff --git a/3rd-party/romio321/adio/common/ad_coll_exch_new.c b/3rd-party/romio321/adio/common/ad_coll_exch_new.c deleted file mode 100644 index 7013a3a8554..00000000000 --- a/3rd-party/romio321/adio/common/ad_coll_exch_new.c +++ /dev/null @@ -1,506 +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 -#include "adio.h" -#include "adio_extern.h" -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -/* -#define DEBUG -#define DEBUG2 -*/ - -#define COUNT_EXCH 0 -#define BLOCK_LENS 1 -#define INDICES 2 -#define FPIND_DISP_OFF_SZ 3 - - -typedef struct { - int count; - ADIO_Offset fp_ind; - ADIO_Offset disp; - ADIO_Offset byte_off; - ADIO_Offset sz; - ADIO_Offset ext; - ADIO_Offset type_sz; -} amount_and_extra_data_t; - -/* Debugging function to print out an ADIOI_Flatlist_node. */ -void ADIOI_Print_flatlist_node(ADIOI_Flatlist_node *flatlist_node_p) -{ - int i; - if (flatlist_node_p == NULL) - { - fprintf(stderr, "print flatlist node of NULL ptr\n"); - return; - } - fprintf(stderr, "print flatlist node count = %d (idx,blocklen)\n", - (int)flatlist_node_p->count); - for (i = 0; i < flatlist_node_p->count; i++) - { - if (i % 5 == 0 && i != 0) - { - fprintf(stderr, "%d=(%lld,%lld)\n", i, (long long)flatlist_node_p->indices[i], - (long long)flatlist_node_p->blocklens[i]); - } - else - fprintf(stderr, "%d=(%lld,%lld) ", i, (long long)flatlist_node_p->indices[i], - (long long)flatlist_node_p->blocklens[i]); - } - fprintf(stderr, "\n"); -} - -/* Since ADIOI_Flatten_datatype won't add a contig datatype to the - * ADIOI_Flatlist, we can force it to do so with this function. */ -ADIOI_Flatlist_node * ADIOI_Add_contig_flattened(MPI_Datatype contig_type) -{ - MPI_Count contig_type_sz = -1; - ADIOI_Flatlist_node *flat_node_p = ADIOI_Flatlist; - - /* Add contig type to the end of the list if it doesn't already - * exist. */ - while (flat_node_p->next) - { - if (flat_node_p->type == contig_type) - return flat_node_p; - flat_node_p = flat_node_p->next; - } - if (flat_node_p->type == contig_type) - return flat_node_p; - - MPI_Type_size_x(contig_type, &contig_type_sz); - if ((flat_node_p->next = (ADIOI_Flatlist_node *) ADIOI_Malloc - (sizeof(ADIOI_Flatlist_node))) == NULL) - { - fprintf(stderr, "ADIOI_Add_contig_flattened: malloc next failed\n"); - } - flat_node_p = flat_node_p->next; - flat_node_p->type = contig_type; - if ((flat_node_p->blocklens = (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset))) == NULL) - { - fprintf(stderr, "ADIOI_Flatlist_node: malloc blocklens failed\n"); - } - if ((flat_node_p->indices = (ADIO_Offset *) - ADIOI_Malloc(sizeof(ADIO_Offset))) == NULL) - { - fprintf(stderr, "ADIOI_Flatlist_node: malloc indices failed\n"); - } - flat_node_p->blocklens[0] = contig_type_sz; - flat_node_p->indices[0] = 0; - flat_node_p->count = 1; - flat_node_p->next = NULL; - return flat_node_p; -} - -/* ADIOI_Exchange_file_views - Sends all the aggregators the file - * views and file view states of the clients. It fills in the - * client_file_view_state_arr for the aggregators and the - * my_mem_view_state for the client. It also initializes the - * agg_file_view_state for all clients, which is the view for each - * aggregator of a client's filetype. */ -void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, - ADIO_File fd, int count, - MPI_Datatype datatype, ADIO_Offset off, - view_state *my_mem_view_state_arr, - view_state *agg_file_view_state_arr, - view_state *client_file_view_state_arr) -{ - /* Convert my own fileview to an ADIOI_Flattened type and a - * disp. MPI_Alltoall the count of ADIOI_Flatlist nodes. - * MPI_Isend/Irecv the block_lens, indices of ADIOI_Flatlist node - * to/from each of the aggregators with the rest of the file view - * state. */ - - int i = -1, j = -1; - amount_and_extra_data_t *send_count_arr = NULL; - amount_and_extra_data_t *recv_count_arr = NULL; - int send_req_arr_sz = 0; - int recv_req_arr_sz = 0; - MPI_Request *send_req_arr = NULL, *recv_req_arr = NULL; - MPI_Status *statuses = NULL; - ADIO_Offset disp_off_sz_ext_typesz[6]; - MPI_Aint memtype_extent, filetype_extent, lb; - int ret = -1; - - /* parameters for datatypes */ - ADIOI_Flatlist_node *flat_mem_p = NULL, *flat_file_p = NULL; - MPI_Count memtype_sz = -1; - int memtype_is_contig = -1; - ADIO_Offset filetype_sz = -1; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5014, 0, NULL); -#endif - /* The memtype will be freed after the call. The filetype will be - * freed in the close and should have been flattened in the file - * view. */ - MPI_Type_size_x(datatype, &memtype_sz); - MPI_Type_get_extent(datatype, &lb, &memtype_extent); - if (memtype_sz == memtype_extent) { - memtype_is_contig = 1; - flat_mem_p = ADIOI_Add_contig_flattened(datatype); - flat_mem_p->blocklens[0] = memtype_sz*count; - } - else { - flat_mem_p = ADIOI_Flatten_and_find(datatype); - } - - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - MPI_Type_size_x(fd->filetype, &filetype_sz); - if (filetype_extent == filetype_sz) { - flat_file_p = ADIOI_Add_contig_flattened(fd->filetype); - flat_file_p->blocklens[0] = memtype_sz*count; - filetype_extent = memtype_sz*count; - filetype_sz = filetype_extent; - } - else { - flat_file_p = ADIOI_Flatlist; - while (flat_file_p->type != fd->filetype) - flat_file_p = flat_file_p->next; - } - - disp_off_sz_ext_typesz[0] = fd->fp_ind; - disp_off_sz_ext_typesz[1] = fd->disp; - disp_off_sz_ext_typesz[2] = off; - disp_off_sz_ext_typesz[3] = memtype_sz*count; - disp_off_sz_ext_typesz[4] = (ADIO_Offset) filetype_extent; - disp_off_sz_ext_typesz[5] = (ADIO_Offset) filetype_sz; - - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - recv_count_arr = ADIOI_Calloc(nprocs, sizeof(amount_and_extra_data_t)); - send_count_arr = ADIOI_Calloc(nprocs, sizeof(amount_and_extra_data_t)); - } else { - send_count_arr = ADIOI_Calloc(fd->hints->cb_nodes, - sizeof(amount_and_extra_data_t)); - - /* only aggregators receive data */ - if (fd->is_agg) { - recv_count_arr = ADIOI_Calloc(nprocs, - sizeof(amount_and_extra_data_t)); - recv_req_arr = ADIOI_Malloc (nprocs * sizeof(MPI_Request)); - for (i=0; i < nprocs; i++) - MPI_Irecv (&recv_count_arr[i], sizeof(amount_and_extra_data_t), - MPI_BYTE, i, COUNT_EXCH, fd->comm, &recv_req_arr[i]); - } - - /* only send data to aggregators */ - send_req_arr = ADIOI_Calloc (fd->hints->cb_nodes, sizeof(MPI_Request)); - for (i=0; i < fd->hints->cb_nodes; i++) { - send_count_arr[i].count = flat_file_p->count; - send_count_arr[i].fp_ind = disp_off_sz_ext_typesz[0]; - send_count_arr[i].disp = disp_off_sz_ext_typesz[1]; - send_count_arr[i].byte_off = disp_off_sz_ext_typesz[2]; - send_count_arr[i].sz = disp_off_sz_ext_typesz[3]; - send_count_arr[i].ext = disp_off_sz_ext_typesz[4]; - send_count_arr[i].type_sz = disp_off_sz_ext_typesz[5]; - MPI_Isend (&send_count_arr[i], sizeof(amount_and_extra_data_t), - MPI_BYTE, fd->hints->ranklist[i], COUNT_EXCH, fd->comm, - &send_req_arr[i]); - } - } - - - /* Every client has to build mem and file view_states for each aggregator. - * We initialize their values here. and we also initialize - * send_count_arr */ - - if (memtype_is_contig) { - /* if memory is contigous, we now replace memtype_sz and - * memtype_extent with the full access size */ - memtype_sz *= count; - memtype_extent = memtype_sz; - } - - for (i = 0; i < fd->hints->cb_nodes; i++) - { - int tmp_agg_idx = fd->hints->ranklist[i]; - memset(&(my_mem_view_state_arr[tmp_agg_idx]), 0, sizeof(view_state)); - my_mem_view_state_arr[tmp_agg_idx].sz = - disp_off_sz_ext_typesz[3]; - my_mem_view_state_arr[tmp_agg_idx].ext = - (ADIO_Offset) memtype_extent; - my_mem_view_state_arr[tmp_agg_idx].type_sz = - (ADIO_Offset) memtype_sz; - my_mem_view_state_arr[tmp_agg_idx].flat_type_p = flat_mem_p; - ADIOI_init_view_state(file_ptr_type, - 1, - &(my_mem_view_state_arr[tmp_agg_idx]), - TEMP_OFF); - ADIOI_init_view_state(file_ptr_type, - 1, - &(my_mem_view_state_arr[tmp_agg_idx]), - REAL_OFF); - - memset(&(agg_file_view_state_arr[tmp_agg_idx]), 0, sizeof(view_state)); - agg_file_view_state_arr[tmp_agg_idx].fp_ind = - disp_off_sz_ext_typesz[0]; - agg_file_view_state_arr[tmp_agg_idx].disp = - disp_off_sz_ext_typesz[1]; - agg_file_view_state_arr[tmp_agg_idx].byte_off = - disp_off_sz_ext_typesz[2]; - agg_file_view_state_arr[tmp_agg_idx].sz = - disp_off_sz_ext_typesz[3]; - agg_file_view_state_arr[tmp_agg_idx].ext = - disp_off_sz_ext_typesz[4]; - agg_file_view_state_arr[tmp_agg_idx].type_sz = - disp_off_sz_ext_typesz[5]; - agg_file_view_state_arr[tmp_agg_idx].flat_type_p = flat_file_p; - - ADIOI_init_view_state(file_ptr_type, - 1, - &(agg_file_view_state_arr[tmp_agg_idx]), - TEMP_OFF); - ADIOI_init_view_state(file_ptr_type, - 1, - &(agg_file_view_state_arr[tmp_agg_idx]), - REAL_OFF); - - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - send_count_arr[tmp_agg_idx].count = flat_file_p->count; - send_count_arr[tmp_agg_idx].fp_ind = disp_off_sz_ext_typesz[0]; - send_count_arr[tmp_agg_idx].disp = disp_off_sz_ext_typesz[1]; - send_count_arr[tmp_agg_idx].byte_off = disp_off_sz_ext_typesz[2]; - send_count_arr[tmp_agg_idx].sz = disp_off_sz_ext_typesz[3]; - send_count_arr[tmp_agg_idx].ext = disp_off_sz_ext_typesz[4]; - send_count_arr[tmp_agg_idx].type_sz = disp_off_sz_ext_typesz[5]; - } - } - -#ifdef DEBUG2 - fprintf(stderr, "my own flattened memtype: "); - ADIOI_Print_flatlist_node(flat_mem_p); - fprintf(stderr, "my own flattened filetype: "); - ADIOI_Print_flatlist_node(flat_file_p); -#endif - - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - ret = MPI_Alltoall(send_count_arr, sizeof(amount_and_extra_data_t), - MPI_BYTE, - recv_count_arr, sizeof(amount_and_extra_data_t), - MPI_BYTE, fd->comm); - if (ret != MPI_SUCCESS) - { - fprintf(stderr, "ADIOI_Exchange_file_views: MPI_Alltoall failed " - "with error %d", ret); - return; - } - } else { - statuses = (MPI_Status *) ADIOI_Malloc(1 + nprocs * sizeof(MPI_Status)); - if (fd->is_agg) { - MPI_Waitall(nprocs, recv_req_arr, statuses); - ADIOI_Free(recv_req_arr); - } - MPI_Waitall(fd->hints->cb_nodes, send_req_arr, statuses); - ADIOI_Free(statuses); - ADIOI_Free(send_req_arr); - } -#ifdef DEBUG2 - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - fprintf(stderr, "send_count_arr:"); - for (i = 0; i < nprocs; i++) - { - fprintf(stderr, "[%d]=%d ", i, send_count_arr[i].count); - } - fprintf(stderr, "\n"); - fprintf(stderr, "recv_count_arr:"); - for (i = 0; i < nprocs; i++) - { - fprintf(stderr, "[%d]=%d ", i, recv_count_arr[i].count); - } - fprintf(stderr, "\n"); - } else { - fprintf(stderr, "send_count_arr:"); - for (i = 0; i < fd->hints->cb_nodes; i++) - { - fprintf(stderr, "[%d]=%d ", i, send_count_arr[i].count); - } - fprintf(stderr, "\n"); - if (fd->is_agg) { - fprintf(stderr, "recv_count_arr:"); - for (i = 0; i < nprocs; i++) - { - fprintf(stderr, "[%d]=%d ", i, recv_count_arr[i].count); - } - fprintf(stderr, "\n"); - } - } -#endif - - if (fd->hints->cb_alltoall == ADIOI_HINT_DISABLE) { - for (i=0; i < fd->hints->cb_nodes; i++) - if (send_count_arr[i].count > 0) - send_req_arr_sz++; - } - /* Figure out how many counts to send/recv */ - for (i = 0; i < nprocs; i++) - { - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - if (send_count_arr[i].count > 0) - send_req_arr_sz++; - } - /* Only aggregators should recv*/ - if (fd->is_agg) { - if (recv_count_arr[i].count > 0) - { - if ((client_file_view_state_arr[i].flat_type_p = - (ADIOI_Flatlist_node *) ADIOI_Malloc( - sizeof(ADIOI_Flatlist_node))) == NULL) - { - fprintf(stderr, "ADIOI_Exchange_file_views: malloc " - "flat_type_p failed\n"); - } - client_file_view_state_arr[i].flat_type_p->count = - recv_count_arr[i].count; - client_file_view_state_arr[i].flat_type_p->indices = - (ADIO_Offset *) ADIOI_Calloc(recv_count_arr[i].count, - sizeof(ADIO_Offset)); - client_file_view_state_arr[i].flat_type_p->blocklens = - (ADIO_Offset *) ADIOI_Calloc(recv_count_arr[i].count, - sizeof(ADIO_Offset)); - - /* Copy the extra data out of the stuff we Alltoall'd */ - memcpy (&client_file_view_state_arr[i].fp_ind, - &recv_count_arr[i].fp_ind, - 6*sizeof(ADIO_Offset)); - - recv_req_arr_sz++; - } - } - } - - /* Since ADIOI_Calloc may do other things we add the +1 - * to avoid a 0-size malloc */ - send_req_arr = (MPI_Request *) ADIOI_Calloc(2*(send_req_arr_sz)+1, - sizeof(MPI_Request)); - - j = 0; - if (recv_req_arr_sz > 0) { - assert (fd->is_agg); - recv_req_arr = (MPI_Request *) ADIOI_Calloc(2*(recv_req_arr_sz), - sizeof(MPI_Request)); - for (i = 0; i < nprocs; i++) { - if (recv_count_arr[i].count > 0) { - MPI_Irecv(client_file_view_state_arr[i].flat_type_p->indices, - recv_count_arr[i].count, ADIO_OFFSET, i, - INDICES, fd->comm, &recv_req_arr[j]); - j++; - MPI_Irecv(client_file_view_state_arr[i].flat_type_p->blocklens, - recv_count_arr[i].count, ADIO_OFFSET, i, - BLOCK_LENS, fd->comm, &recv_req_arr[j]); - j++; - } - } - } - - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - j = 0; - for (i = 0; i < nprocs; i++) { - if (send_count_arr[i].count > 0) { - MPI_Isend(flat_file_p->indices, - send_count_arr[i].count, ADIO_OFFSET, i, - INDICES, fd->comm, &send_req_arr[j]); - j++; - MPI_Isend(flat_file_p->blocklens, - send_count_arr[i].count, ADIO_OFFSET, i, - BLOCK_LENS, fd->comm, &send_req_arr[j]); - j++; - } - } - } else { - j = 0; - for (i = 0; i < fd->hints->cb_nodes; i++) { - if (send_count_arr[i].count > 0) { - MPI_Isend(flat_file_p->indices, - send_count_arr[i].count, ADIO_OFFSET, - fd->hints->ranklist[i], INDICES, fd->comm, - &send_req_arr[j]); - j++; - MPI_Isend(flat_file_p->blocklens, - send_count_arr[i].count, ADIO_OFFSET, - fd->hints->ranklist[i], BLOCK_LENS, fd->comm, - &send_req_arr[j]); - j++; - } - } - } - - /* Since ADIOI_Malloc may do other things we add the +1 - * to avoid a 0-size malloc */ - statuses = (MPI_Status *) - ADIOI_Malloc(1 + 2 * ADIOI_MAX(send_req_arr_sz,recv_req_arr_sz) - * sizeof(MPI_Status)); - - if (send_req_arr_sz > 0) { - MPI_Waitall(2 * send_req_arr_sz, send_req_arr, statuses); - ADIOI_Free(send_count_arr); - ADIOI_Free(send_req_arr); - } - if (recv_req_arr_sz > 0) { - MPI_Waitall(2 * recv_req_arr_sz, recv_req_arr, statuses); - ADIOI_Free(recv_count_arr); - ADIOI_Free(recv_req_arr); - } - ADIOI_Free(statuses); - - if (fd->is_agg == 1) - { - ADIOI_init_view_state(file_ptr_type, - nprocs, - client_file_view_state_arr, - TEMP_OFF); - ADIOI_init_view_state(file_ptr_type, - nprocs, - client_file_view_state_arr, - REAL_OFF); - } - -#ifdef DEBUG - if (fd->is_agg == 1) - { - ADIOI_Flatlist_node *fr_node_p = ADIOI_Flatlist; - for (i = 0; i < nprocs; i++) - { - fprintf(stderr, "client_file_view_state_arr[%d]=(fp_ind=%Ld," - "disp=%Ld,byte_off=%Ld,sz=%Ld,ext=%Ld\n", i, - client_file_view_state_arr[i].fp_ind, - client_file_view_state_arr[i].disp, - client_file_view_state_arr[i].byte_off, - client_file_view_state_arr[i].sz, - client_file_view_state_arr[i].ext); - } - - while (fr_node_p->type != - fd->file_realm_types[fd->my_cb_nodes_index]) - fr_node_p = fr_node_p->next; - assert(fr_node_p != NULL); - - fprintf(stderr, "my file realm (idx=%d,st_off=%Ld) ", - fd->my_cb_nodes_index, - fd->file_realm_st_offs[fd->my_cb_nodes_index]); - ADIOI_Print_flatlist_node(fr_node_p); - } -#endif - -#ifdef DEBUG2 - if (fd->is_agg == 1) - { - for (i = 0; i < nprocs; i++) - { - fprintf(stderr, "client_file_view_state_arr[%d]: ", i); - ADIOI_Print_flatlist_node( - client_file_view_state_arr[i].flat_type_p); - } - } -#endif -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5015, 0, NULL); -#endif -} diff --git a/3rd-party/romio321/adio/common/ad_darray.c b/3rd-party/romio321/adio/common/ad_darray.c deleted file mode 100644 index 3c9ca36a8e1..00000000000 --- a/3rd-party/romio321/adio/common/ad_darray.c +++ /dev/null @@ -1,291 +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" - -static int MPIOI_Type_block(int *array_of_gsizes, int dim, int ndims, int nprocs, - int rank, int darg, int order, MPI_Aint orig_extent, - MPI_Datatype type_old, MPI_Datatype *type_new, - MPI_Aint *st_offset); -static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nprocs, - int rank, int darg, int order, MPI_Aint orig_extent, - MPI_Datatype type_old, MPI_Datatype *type_new, - MPI_Aint *st_offset); - - -int ADIO_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) -{ - MPI_Datatype type_old, type_new=MPI_DATATYPE_NULL, inttype; - int procs, tmp_rank, i, tmp_size, blklen, *coords; - MPI_Aint *st_offsets, orig_extent, disp, ub, lb; - - MPI_Type_get_extent(oldtype, &lb, &orig_extent); - -/* calculate position in Cartesian grid as MPI would (row-major - ordering) */ - coords = (int *) ADIOI_Malloc(ndims*sizeof(int)); - procs = size; - tmp_rank = rank; - for (i=0; i=0; i--) { - switch(array_of_distribs[i]) { - case MPI_DISTRIBUTE_BLOCK: - MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], - coords[i], array_of_dargs[i], order, - orig_extent, type_old, &type_new, - st_offsets+i); - break; - case MPI_DISTRIBUTE_CYCLIC: - MPIOI_Type_cyclic(array_of_gsizes, i, ndims, - array_of_psizes[i], coords[i], - array_of_dargs[i], order, - orig_extent, type_old, &type_new, - st_offsets+i); - break; - case MPI_DISTRIBUTE_NONE: - /* treat it as a block distribution on 1 process */ - MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], - coords[i], MPI_DISTRIBUTE_DFLT_DARG, order, orig_extent, - type_old, &type_new, st_offsets+i); - break; - } - if (i != ndims-1) MPI_Type_free(&type_old); - type_old = type_new; - } - - /* add displacement and UB */ - disp = st_offsets[ndims-1]; - tmp_size = 1; - for (i=ndims-2; i>=0; i--) { - tmp_size *= array_of_gsizes[i+1]; - disp += (MPI_Aint)tmp_size*st_offsets[i]; - } - } - - disp *= orig_extent; - - ub = orig_extent; - for (i=0; idim; i--) stride *= (MPI_Aint)array_of_gsizes[i]; - MPI_Type_create_hvector(mysize, 1, stride, type_old, type_new); - } - - } - - *st_offset = (MPI_Aint)blksize * (MPI_Aint)rank; - /* in terms of no. of elements of type oldtype in this dimension */ - if (mysize == 0) *st_offset = 0; - - return MPI_SUCCESS; -} - - -/* Returns MPI_SUCCESS on success, an MPI error code on failure. Code above - * needs to call MPIO_Err_return_xxx. - */ -static int MPIOI_Type_cyclic(int *array_of_gsizes, int dim, int ndims, int nprocs, - int rank, int darg, int order, MPI_Aint orig_extent, - MPI_Datatype type_old, MPI_Datatype *type_new, - MPI_Aint *st_offset) -{ -/* nprocs = no. of processes in dimension dim of grid - rank = coordinate of this process in dimension dim */ - int blksize, i, blklens[3], st_index, end_index, local_size, rem, count; - MPI_Aint stride, disps[3]; - MPI_Datatype type_tmp, type_tmp1, types[3]; - - if (darg == MPI_DISTRIBUTE_DFLT_DARG) blksize = 1; - else blksize = darg; - - /* --BEGIN ERROR HANDLING-- */ - if (blksize <= 0) { - return MPI_ERR_ARG; - } - /* --END ERROR HANDLING-- */ - - st_index = rank*blksize; - end_index = array_of_gsizes[dim] - 1; - - if (end_index < st_index) local_size = 0; - else { - local_size = ((end_index - st_index + 1)/(nprocs*blksize))*blksize; - rem = (end_index - st_index + 1) % (nprocs*blksize); - local_size += ADIOI_MIN(rem, blksize); - } - - count = local_size/blksize; - rem = local_size % blksize; - - stride = (MPI_Aint)nprocs*(MPI_Aint)blksize*orig_extent; - if (order == MPI_ORDER_FORTRAN) - for (i=0; idim; i--) stride *= (MPI_Aint)array_of_gsizes[i]; - - MPI_Type_create_hvector(count, blksize, stride, type_old, type_new); - - if (rem) { - /* if the last block is of size less than blksize, include - it separately using MPI_Type_struct */ - - types[0] = *type_new; - types[1] = type_old; - disps[0] = 0; - disps[1] = (MPI_Aint)count*stride; - blklens[0] = 1; - blklens[1] = rem; - - MPI_Type_create_struct(2, blklens, disps, types, &type_tmp); - - MPI_Type_free(type_new); - *type_new = type_tmp; - } - - /* In the first iteration, we need to set the displacement in that - dimension correctly. */ - if ( ((order == MPI_ORDER_FORTRAN) && (dim == 0)) || - ((order == MPI_ORDER_C) && (dim == ndims-1)) ) { - types[0] = *type_new; - disps[0] = (MPI_Aint)rank * (MPI_Aint)blksize * orig_extent; - blklens[0] = 1; - MPI_Type_create_struct(1, blklens, disps, types, &type_tmp1); - MPI_Type_create_resized (type_tmp1, 0, orig_extent * (MPI_Aint)array_of_gsizes[dim], &type_tmp); - MPI_Type_free(&type_tmp1); - MPI_Type_free(type_new); - *type_new = type_tmp; - - *st_offset = 0; /* set it to 0 because it is taken care of in - the struct above */ - } - else { - *st_offset = (MPI_Aint)rank * (MPI_Aint)blksize; - /* st_offset is in terms of no. of elements of type oldtype in - * this dimension */ - } - - if (local_size == 0) *st_offset = 0; - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/common/ad_delete.c b/3rd-party/romio321/adio/common/ad_delete.c deleted file mode 100644 index ae78d7e0a7e..00000000000 --- a/3rd-party/romio321/adio/common/ad_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 "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif - -void ADIOI_GEN_Delete(const char *filename, int *error_code) -{ - int err; - static char myname[] = "ADIOI_GEN_DELETE"; - - err = unlink(filename); - if (err == -1) { - *error_code = ADIOI_Err_create_code(myname, filename, errno); - } - else *error_code = MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/common/ad_done.c b/3rd-party/romio321/adio/common/ad_done.c deleted file mode 100644 index 50764b7bb59..00000000000 --- a/3rd-party/romio321/adio/common/ad_done.c +++ /dev/null @@ -1,52 +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 "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#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 - -/* ADIOI_GEN_IODone - * - * This code handles two distinct cases. If ROMIO_HAVE_WORKING_AIO is not - * defined, then I/O was done as a blocking call earlier. In that case - * we have nothing much to do other than set the bytes transferred and - * free the request. - * - * If ROMIO_HAVE_WORKING_AIO is defined, then we may need to wait for I/O - * to complete. - */ -int ADIOI_GEN_IODone(ADIO_Request *request, ADIO_Status *status, - int *error_code) -{ - return 0; - -} diff --git a/3rd-party/romio321/adio/common/ad_done_fake.c b/3rd-party/romio321/adio/common/ad_done_fake.c deleted file mode 100644 index 59da5755e0b..00000000000 --- a/3rd-party/romio321/adio/common/ad_done_fake.c +++ /dev/null @@ -1,20 +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 "adio.h" - -/* Generic implementation of ReadDone/WriteDone simply sets the - * bytes field in the status structure and frees the request. - * - * Same function is used for both reads and writes. - */ -int ADIOI_FAKE_IODone(ADIO_Request *request, ADIO_Status *status, - int *error_code) -{ - /* should not ever get called now */ - return 1; -} diff --git a/3rd-party/romio321/adio/common/ad_end.c b/3rd-party/romio321/adio/common/ad_end.c deleted file mode 100644 index a4d186f9272..00000000000 --- a/3rd-party/romio321/adio/common/ad_end.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 "adio.h" -#include "adio_extern.h" - -void ADIO_End(int *error_code) -{ - ADIOI_Flatlist_node *curr, *next; - ADIOI_Datarep *datarep, *datarep_next; - -/* FPRINTF(stderr, "reached end\n"); */ - - /* if a default errhandler was set on MPI_FILE_NULL then we need to ensure - * that our reference to that errhandler is released */ -/* Open MPI: The call to PMPI_File_set_errhandler has to be done in romio/src/io_romio_file_open.c - in routine mca_io_romio_file_close() -*/ -#if 0 - PMPI_File_set_errhandler(MPI_FILE_NULL, MPI_ERRORS_RETURN); -#endif - -/* delete the flattened datatype list */ - curr = ADIOI_Flatlist; - while (curr) { - if (curr->blocklens) ADIOI_Free(curr->blocklens); - if (curr->indices) ADIOI_Free(curr->indices); - next = curr->next; - ADIOI_Free(curr); - curr = next; - } - ADIOI_Flatlist = NULL; - -/* free file and info tables used for Fortran interface */ - if (ADIOI_Ftable) ADIOI_Free(ADIOI_Ftable); -#ifndef HAVE_MPI_INFO - if (MPIR_Infotable) ADIOI_Free(MPIR_Infotable); -#endif - - -/* free the memory allocated for a new data representation, if any */ - datarep = ADIOI_Datarep_head; - while (datarep) { - datarep_next = datarep->next; - ADIOI_Free(datarep->name); - ADIOI_Free(datarep); - datarep = datarep_next; - } - - if( ADIOI_syshints != MPI_INFO_NULL) - MPI_Info_free(&ADIOI_syshints); - - MPI_Op_free(&ADIO_same_amode); - - *error_code = MPI_SUCCESS; -} - - - -/* This is the delete callback function associated with - ADIO_Init_keyval when MPI_COMM_SELF is freed */ - -int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void - *extra_state) -{ - int error_code; - - ADIOI_UNREFERENCED_ARG(comm); - ADIOI_UNREFERENCED_ARG(attribute_val); - ADIOI_UNREFERENCED_ARG(extra_state); - - MPI_Comm_free_keyval (&keyval); - - /* The end call will be called after all possible uses of this keyval, even - * if a file was opened with MPI_COMM_SELF. Note, this assumes LIFO - * MPI_COMM_SELF attribute destruction behavior mandated by MPI-2.2. */ - if (ADIOI_cb_config_list_keyval != MPI_KEYVAL_INVALID) - MPI_Comm_free_keyval (&ADIOI_cb_config_list_keyval); - - ADIO_End(&error_code); - return error_code; -} diff --git a/3rd-party/romio321/adio/common/ad_fcntl.c b/3rd-party/romio321/adio/common/ad_fcntl.c deleted file mode 100644 index 62067573dd1..00000000000 --- a/3rd-party/romio321/adio/common/ad_fcntl.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2005 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif - -void ADIOI_GEN_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code) -{ - static char myname[] = "ADIOI_GEN_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 = lseek(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 - 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; - - /* --BEGIN ERROR HANDLING-- */ - default: - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "**flag", "**flag %d", flag); - /* --END ERROR HANDLING-- */ - } -} diff --git a/3rd-party/romio321/adio/common/ad_features.c b/3rd-party/romio321/adio/common/ad_features.c deleted file mode 100644 index 480a42c6fe4..00000000000 --- a/3rd-party/romio321/adio/common/ad_features.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_GEN_Feature(ADIO_File fd, int flag) -{ - switch(flag) { - case ADIO_LOCKS: - case ADIO_SHARED_FP: - case ADIO_ATOMIC_MODE: - case ADIO_DATA_SIEVING_WRITES: - case ADIO_UNLINK_AFTER_CLOSE: - case ADIO_TWO_PHASE: - case ADIO_SCALABLE_RESIZE: - return 1; - break; - case ADIO_SCALABLE_OPEN: - default: - return 0; - break; - } -} diff --git a/3rd-party/romio321/adio/common/ad_flush.c b/3rd-party/romio321/adio/common/ad_flush.c deleted file mode 100644 index 3ace6778bf4..00000000000 --- a/3rd-party/romio321/adio/common/ad_flush.c +++ /dev/null @@ -1,35 +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" - -#ifdef HAVE_UNISTD_H -#include -#endif - -void ADIOI_GEN_Flush(ADIO_File fd, int *error_code) -{ - int err; - static char myname[] = "ADIOI_GEN_FLUSH"; - - /* the deferred-open optimization may mean that a file has not been opened - * on this processor */ - if (fd->is_open > 0) { - err = fsync(fd->fd_sys); - /* --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/common/ad_fstype.c b/3rd-party/romio321/adio/common/ad_fstype.c deleted file mode 100644 index 75fb24fee66..00000000000 --- a/3rd-party/romio321/adio/common/ad_fstype.c +++ /dev/null @@ -1,872 +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. - */ - -/* This file is quickly becoming the single one, outside the ADIO - * implementations, which has "what ADIO components are built in" code in it. - */ - -#include "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifdef HAVE_PVFS_H -#include "pvfs.h" -#endif - -#ifdef HAVE_PVFS2_H -#include "pvfs2.h" -#endif - -#ifdef HAVE_ZOIDFS_H -#include "zoidfs.h" -#endif - -#ifdef HAVE_GPFS_H -#include "gpfs.h" -#endif - -/* Notes on detection process: - * - * There are three more "general" mechanisms that we use for detecting - * file system type: - * - struct statfs's f_type field - * - struct statvfs's f_basetype field - * - struct stat's st_fstype field - * - * Otherwise we'll fall back on some OS-specific approach. - */ - -#ifdef HAVE_STRUCT_STATFS -# ifdef HAVE_SYS_VFS_H -# include -# endif -# ifdef HAVE_SYS_STATVFS_H -# include -# endif -# ifdef HAVE_SYS_PARAM_H -# include -# endif -# ifdef HAVE_SYS_MOUNT_H -# include -# endif - /* On Linux platforms, linux/nfs_fs.h is all messed up and cannot be - * reliably included. - */ -# if defined(ROMIO_NFS) && !defined(NFS_SUPER_MAGIC) -# define NFS_SUPER_MAGIC 0x6969 -# endif - -# if defined(ROMIO_PANFS) && !defined(PAN_KERNEL_FS_CLIENT_SUPER_MAGIC) -# define PAN_KERNEL_FS_CLIENT_SUPER_MAGIC 0xAAD7AAEA -# endif -#endif - -# if defined(ROMIO_XFS) && !defined(XFS_SUPER_MAGIC) -# define XFS_SUPER_MAGIC 0x58465342 -# endif - -#if !defined(PVFS2_SUPER_MAGIC) -#define PVFS2_SUPER_MAGIC (0x20030528) -#endif - -#if defined(ROMIO_GPFS) && !defined(GPFS_SUPER_MAGIC) -# define GPFS_SUPER_MAGIC 0x47504653 -#endif - -#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE -# ifdef HAVE_SYS_STATVFS_H -# include -# endif -# ifdef HAVE_SYS_VFS_H -# include -# endif -# ifdef HAVE_SYS_PARAM_H -# include -# endif -# ifdef HAVE_SYS_MOUNT_H -# include -# endif -#endif - -#ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE -# ifdef HAVE_SYS_TYPES_H -# include -# endif -# ifdef HAVE_SYS_STAT_H -# include -# endif -#endif - -/* ADIO_FileSysType_parentdir is only used if one of these is defined. - By including this test, we avoid warnings about unused static functions - from the compiler */ -#if defined(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE) || \ - defined(HAVE_STRUCT_STATFS) || \ - defined(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE) -#ifndef ROMIO_NTFS -#define ROMIO_NEEDS_ADIOPARENTDIR -static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep); -#endif -#endif -static void ADIO_FileSysType_prefix(const char *filename, int *fstype, - int *error_code); -static void ADIO_FileSysType_fncall(const char *filename, int *fstype, - int *error_code); - -/* - ADIO_FileSysType_parentdir - determines a string pathname for the - parent directory of a given filename. - -Input Parameters: -. filename - pointer to file name character array - -Output Parameters: -. dirnamep - pointer to location in which to store a pointer to a string - - Note that the caller should free the memory located at the pointer returned - after the string is no longer needed. -*/ -#ifdef ROMIO_NEEDS_ADIOPARENTDIR - -/* In a strict ANSI environment, S_ISLNK may not be defined. Fix that - here. We assume that S_ISLNK is *always* defined as a macro. If - that is not universally true, then add a test to the romio - configure that trys to link a program that references S_ISLNK */ -#if !defined(S_ISLNK) -# if defined(S_IFLNK) - /* Check for the link bit */ -# define S_ISLNK(mode) ((mode) & S_IFLNK) -# else - /* no way to check if it is a link, so say false */ -# define S_ISLNK(mode) 0 -# endif -#endif /* !(S_ISLNK) */ - -/* ADIO_FileSysType_parentdir - * - * Returns pointer to string in dirnamep; that string is allocated with - * strdup and must be free()'d. - */ -static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep) -{ - int err; - char *dir = NULL, *slash; - struct stat statbuf; - - err = lstat(filename, &statbuf); - - if (err || (!S_ISLNK(statbuf.st_mode))) { - /* no such file, or file is not a link; these are the "normal" - * cases where we can just return the parent directory. - */ - dir = ADIOI_Strdup(filename); - } - else { - /* filename is a symlink. we've presumably already tried - * to stat it and found it to be missing (dangling link), - * but this code doesn't care if the target is really there - * or not. - */ - ssize_t namelen; - char *linkbuf; - - linkbuf = ADIOI_Malloc(PATH_MAX+1); - namelen = readlink(filename, linkbuf, PATH_MAX+1); - if (namelen == -1) { - /* something strange has happened between the time that - * we determined that this was a link and the time that - * we attempted to read it; punt and use the old name. - */ - dir = ADIOI_Strdup(filename); - } - else { - /* successfully read the link */ - linkbuf[namelen] = '\0'; /* readlink doesn't null terminate */ - dir = ADIOI_Strdup(linkbuf); - } - ADIOI_Free(linkbuf); - } - - slash = strrchr(dir, '/'); - if (!slash) ADIOI_Strncpy(dir, ".", 2); - else { - if (slash == dir) *(dir + 1) = '\0'; - else *slash = '\0'; - } - - *dirnamep = dir; - return; -} -#endif /* ROMIO_NTFS */ - -/* - ADIO_FileSysType_fncall - determines the file system type for a given file - using a system-dependent function call - -Input Parameters: -. filename - pointer to file name character array - -Output Parameters: -. fstype - location in which to store file system type (ADIO_XXX) -. error_code - location in which to store error code - - MPI_SUCCESS is stored in the location pointed to by error_code on success. - - This function is used by MPI_File_open() and MPI_File_delete() to determine - file system type. Most other functions use the type which is stored when the - file is opened. - */ -static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *error_code) -{ -#if defined (ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE) || defined (HAVE_STRUCT_STATFS) || defined (ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE) - int err; -#endif - -#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE - struct statvfs vfsbuf; -#endif -#ifdef HAVE_STRUCT_STATFS - struct statfs fsbuf; -#endif -#ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE - struct stat sbuf; -#endif - static char myname[] = "ADIO_RESOLVEFILETYPE_FNCALL"; - -/* NFS can get stuck and end up returing ESTALE "forever" */ -#define MAX_ESTALE_RETRY 10000 - int retry_cnt; - - *error_code = MPI_SUCCESS; - -#ifdef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE - /* rare: old solaris machines */ - retry_cnt=0; - do { - err = statvfs(filename, &vfsbuf); - } while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY); - - if (err) { - /* ENOENT may be returned in two cases: - * 1) no directory entry for "filename" - * 2) "filename" is a dangling symbolic link - * - * ADIO_FileSysType_parentdir tries to deal with both cases. - */ - if (errno == ENOENT) { - char *dir; - ADIO_FileSysType_parentdir(filename, &dir); - err = statvfs(dir, &vfsbuf); - - ADIOI_Free(dir); - } - else { - *error_code = ADIOI_Err_create_code(myname, filename, errno); - if(*error_code != MPI_SUCCESS) return; - } - } - - /* --BEGIN ERROR HANDLING-- */ - if (err) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - return; - } - /* --END ERROR HANDLING-- */ - - /* FPRINTF(stderr, "%s\n", vfsbuf.f_basetype); */ - if (!strncmp(vfsbuf.f_basetype, "nfs", 3)) { - *fstype = ADIO_NFS; - return; - } - if (!strncmp(vfsbuf.f_basetype, "xfs", 3)) { - *fstype = ADIO_XFS; - return; - } - -# ifdef ROMIO_UFS - /* if UFS support is enabled, default to that */ - *fstype = ADIO_UFS; - return; -# endif - - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - /* --END ERROR HANDLING-- */ -#endif /* STATVFS APPROACH */ - -#if defined(HAVE_STRUCT_STATFS) && defined(HAVE_STATFS) - /* common automagic fs-detection logic for any modern POSX-compliant - * environment */ - retry_cnt = 0; - do { - err = statfs(filename, &fsbuf); - } while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY); - - if (err) { - if(errno == ENOENT) { - char *dir; - ADIO_FileSysType_parentdir(filename, &dir); - err = statfs(dir, &fsbuf); - ADIOI_Free(dir); - } - else { - *error_code = ADIOI_Err_create_code(myname, filename, errno); - if(*error_code != MPI_SUCCESS) return; - } - } - - /* --BEGIN ERROR HANDLING-- */ - if (err) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - return; - } - /* --END ERROR HANDLING-- */ - -# ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME - /* uncommon: maybe only on Darwin ? */ - if ( !strncmp("nfs",fsbuf.f_fstypename,3) ) { - *fstype = ADIO_NFS; - return; - } -# endif - - -#ifdef ROMIO_GPFS - if (fsbuf.f_type == GPFS_SUPER_MAGIC) { - *fstype = ADIO_GPFS; - return; - } -#endif - - /* FPRINTF(stderr, "%d\n", fsbuf.f_type);*/ -# ifdef NFS_SUPER_MAGIC - if (fsbuf.f_type == NFS_SUPER_MAGIC) { - *fstype = ADIO_NFS; - return; - } -# endif - -#ifdef ROMIO_LUSTRE -# ifndef LL_SUPER_MAGIC -# define LL_SUPER_MAGIC 0x0BD00BD0 -# endif - if (fsbuf.f_type == LL_SUPER_MAGIC) { - *fstype = ADIO_LUSTRE; - return; - } -#endif - -# ifdef PAN_KERNEL_FS_CLIENT_SUPER_MAGIC - if (fsbuf.f_type == PAN_KERNEL_FS_CLIENT_SUPER_MAGIC) { - *fstype = ADIO_PANFS; - return; - } -# endif - -# ifdef MOUNT_NFS - if (fsbuf.f_type == MOUNT_NFS) { - *fstype = ADIO_NFS; - return; - } -# endif - -# ifdef MOUNT_PFS - if (fsbuf.f_type == MOUNT_PFS) { - *fstype = ADIO_PFS; - return; - } -# endif - -# ifdef PVFS_SUPER_MAGIC - if (fsbuf.f_type == PVFS_SUPER_MAGIC) { - *fstype = ADIO_PVFS; - return; - } -# endif - -# ifdef PVFS2_SUPER_MAGIC - if (fsbuf.f_type == PVFS2_SUPER_MAGIC) { - *fstype = ADIO_PVFS2; - return; - } -# endif - -# ifdef XFS_SUPER_MAGIC - if (fsbuf.f_type == XFS_SUPER_MAGIC) { - *fstype = ADIO_XFS; - return; - } -# endif - -# ifdef ROMIO_UFS - /* if UFS support is enabled, default to that */ - *fstype = ADIO_UFS; - return; -# endif - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - /* --END ERROR HANDLING-- */ -#endif /* STATFS APPROACH */ - -#ifdef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE - /* rare: maybe old NEC SX or SGI IRIX machines */ - retry_cnt = 0; - do { - err = stat(filename, &sbuf); - } while (err && (errno == ESTALE) && retry_cnt++ < MAX_ESTALE_RETRY); - - if (err) { - if(errno == ENOENT) { - char *dir; - ADIO_FileSysType_parentdir(filename, &dir); - err = stat(dir, &sbuf); - ADIOI_Free(dir); - } - else{ - *error_code = ADIOI_Err_create_code(myname, filename, errno); - if(*error_code != MPI_SUCCESS) return; - } - } - - if (err) { - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - /* --END ERROR HANDLING-- */ - return; - } - else { - if (!strcmp(sbuf.st_fstype, "nfs")) *fstype = ADIO_NFS; - else *fstype = ADIO_SFS; /* assuming SX4 for now */ - } -#endif /* STAT APPROACH */ - -#ifdef ROMIO_NTFS - ADIOI_UNREFERENCED_ARG(filename); - ADIOI_UNREFERENCED_ARG(error_code); - *fstype = ADIO_NTFS; /* only supported FS on Windows */ -#elif defined(ROMIO_NFS) - *fstype = ADIO_NFS; -#elif defined(ROMIO_UFS) - *fstype = ADIO_UFS; -#else - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - /* --END ERROR HANDLING-- */ -#endif -} - -/* all proceeses opening, creating, or deleting a file end up invoking several - * stat system calls (unless a fs prefix is given). Cary out this file system - * detection in a more scalable way by having rank 0 stat the file and broadcast the result (fs type and error code) to the other mpi processes */ - -static void ADIO_FileSysType_fncall_scalable(MPI_Comm comm, const char *filename, int * file_system, int * error_code) -{ - int rank; - int buf[2]; - MPI_Comm_rank(comm, &rank); - - if (rank == 0) { - ADIO_FileSysType_fncall(filename, file_system, error_code); - buf[0] = *file_system; - buf[1] = *error_code; - } - MPI_Bcast(buf, 2, MPI_INT, 0, comm); - *file_system = buf[0]; - *error_code = buf[1]; -} - - - -/* - ADIO_FileSysType_prefix - determines file system type for a file using - a prefix on the file name. upper layer should have already determined - that a prefix is present. - -Input Parameters: -. filename - path to file, including prefix (xxx:) - -Output Parameters: -. fstype - pointer to integer in which to store file system type (ADIO_XXX) -. error_code - pointer to integer in which to store error code - - Returns MPI_SUCCESS in error_code on success. Filename not having a prefix - is considered an error. Except for on Windows systems where the default is NTFS. - - */ -static void ADIO_FileSysType_prefix(const char *filename, int *fstype, int *error_code) -{ - static char myname[] = "ADIO_RESOLVEFILETYPE_PREFIX"; - *error_code = MPI_SUCCESS; - - if (!strncmp(filename, "pfs:", 4) || !strncmp(filename, "PFS:", 4)) { - *fstype = ADIO_PFS; - } - else if (!strncmp(filename, "piofs:", 6) || !strncmp(filename, "PIOFS:", 6)) { - *fstype = ADIO_PIOFS; - } - else if (!strncmp(filename, "ufs:", 4) || !strncmp(filename, "UFS:", 4)) { - *fstype = ADIO_UFS; - } - else if (!strncmp(filename, "nfs:", 4) || !strncmp(filename, "NFS:", 4)) { - *fstype = ADIO_NFS; - } - else if (!strncmp(filename, "panfs:", 6) || !strncmp(filename, "PANFS:", 6)) { - *fstype = ADIO_PANFS; - } - else if (!strncmp(filename, "hfs:", 4) || !strncmp(filename, "HFS:", 4)) { - *fstype = ADIO_HFS; - } - else if (!strncmp(filename, "xfs:", 4) || !strncmp(filename, "XFS:", 4)) { - *fstype = ADIO_XFS; - } - else if (!strncmp(filename, "sfs:", 4) || !strncmp(filename, "SFS:", 4)) { - *fstype = ADIO_SFS; - } - else if (!strncmp(filename, "pvfs:", 5) || !strncmp(filename, "PVFS:", 5)) { - *fstype = ADIO_PVFS; - } - else if (!strncmp(filename, "pvfs2:", 6)||!strncmp(filename, "PVFS2:", 6)) { - *fstype = ADIO_PVFS2; - } - else if (!strncmp(filename, "zoidfs:", 7)|| - !strncmp(filename, "ZOIDFS:", 7)) { - *fstype = ADIO_ZOIDFS; - } - else if (!strncmp(filename, "testfs:", 7) - || !strncmp(filename, "TESTFS:", 7)) - { - *fstype = ADIO_TESTFS; - } - else if (!strncmp(filename, "ftp:", 4) - || !strncmp(filename, "gsiftp:", 7)) - { - *fstype = ADIO_GRIDFTP; - } - else if (!strncmp(filename, "lustre:", 7) - || !strncmp(filename, "LUSTRE:", 7)) - { - *fstype = ADIO_LUSTRE; - } - else if (!strncmp(filename, "gpfs:", 5) || !strncmp(filename, "GPFS:", 5)) { - *fstype = ADIO_GPFS; - } - else { -#ifdef ROMIO_NTFS - *fstype = ADIO_NTFS; -#else - *fstype = 0; - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filename", "**filename %s", filename); - /* --END ERROR HANDLING-- */ -#endif - } -} - -/*@ - ADIO_ResolveFileType - determines file system type and operations from - file name string; this is a collective call - -Input Parameters: -. comm - communicator across which collective open is performed -. filename - name of file (string) - -Output Parameters: -. fstype - (pointer to) int holding file system type -. ops - (address of) pointer to table of valid file operations -. error_code - (pointer to) int holding error code - -Notes: -This code used to be in MPI_File_open(), but it has been moved into here in -order to clean things up. The goal is to separate all this "did we compile -for this fs type" code from the MPI layer and also to introduce the ADIOI_Fns -tables in a reasonable way. -- Rob, 06/06/2001 -@*/ -void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, - ADIOI_Fns **ops, int *error_code) -{ - int myerrcode, file_system, min_code, max_code; - char *tmp; - static char myname[] = "ADIO_RESOLVEFILETYPE"; - char * p; - - file_system = -1; - if (filename == NULL) { - *error_code = ADIOI_Err_create_code(myname, filename, ENOENT); - return; - } - tmp = strchr(filename, ':'); - if (!tmp) { - int have_nfs_enabled=0; - *error_code = MPI_SUCCESS; - /* no prefix; use system-dependent function call to determine type */ - /* Optimization: we can reduce the 'storm of stats' that result from - * thousands of mpi processes determinig file type this way. Let us - * have just one process stat the file and broadcast the result to - * everyone else. - * - Note that we will not catch cases like - * http://www.mcs.anl.gov/web-mail-archive/lists/mpich-discuss/2007/08/msg00042.html - * (edit: now http://lists.mcs.anl.gov/pipermail/mpich-discuss/2007-August/002648.html) - * - * where file systems are not mounted or available on other processes, - * but we'll catch those a few functions later in ADIO_Open - * - Note that if we have NFS enabled, we might have a situation where, - * for example, /home/user/data.out is UFS on one process but NFS on - * others, so we won't perform this optimization if NFS is enabled. - * - Another point: error codes and file system types are broadcast to - * all members of the communicator, so we get to skip the allreduce - * steps*/ - -#ifdef ROMIO_NFS - have_nfs_enabled=1; -#endif - if (!have_nfs_enabled) { - ADIO_FileSysType_fncall_scalable(comm, filename, &file_system, &myerrcode); - if (myerrcode != MPI_SUCCESS) { - *error_code = myerrcode; - return; - } - } else { - ADIO_FileSysType_fncall(filename, &file_system, &myerrcode); - - /* the check for file system type will hang if any process got - * an error in ADIO_FileSysType_fncall. Processes encountering - * an error will return early, before the collective file - * system type check below. This case could happen if a full - * path exists on one node but not on others, and no prefix - * like ufs: was provided. see discussion at - * http://www.mcs.anl.gov/web-mail-archive/lists/mpich-discuss/2007/08/msg00042.html - * (edit: now - * http://lists.mcs.anl.gov/pipermail/mpich-discuss/2007-August/002648.html) - */ - - MPI_Allreduce(&myerrcode, &max_code, 1, MPI_INT, MPI_MAX, comm); - if (max_code != MPI_SUCCESS) { - *error_code = max_code; - return; - } - /* ensure everyone came up with the same file system type */ - MPI_Allreduce(&file_system, &min_code, 1, MPI_INT, - MPI_MIN, comm); - if (min_code == ADIO_NFS) file_system = ADIO_NFS; - } - } - else { - /* prefix specified; just match via prefix and assume everyone got - * the same thing. - * - * perhaps we should have this code go through the allreduce as well? - */ - ADIO_FileSysType_prefix(filename, &file_system, &myerrcode); - if (myerrcode != MPI_SUCCESS) { - *error_code = myerrcode; - return; - } - } - - /* lastly, there may be situations where one cannot override the file - * system detection with a prefix -- maybe the file name is passed to both - * posix and MPI-IO routines, or maybe the file name is hard-coded into an - * application. - * Assumes all processes set the same environment varialble. - * Values: the same prefix you would stick on a file path. e.g. pvfs2: -- - * including the colon! */ - p = getenv("ROMIO_FSTYPE_FORCE"); - if (p != NULL) { - ADIO_FileSysType_prefix(p, &file_system, &myerrcode); - if (myerrcode != MPI_SUCCESS) { - *error_code = myerrcode; - return; - } - } - - /* verify that we support this file system type and set ops pointer */ - if (file_system == ADIO_PFS) { -#ifndef ROMIO_PFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_PFS_operations; -#endif - } - if (file_system == ADIO_PIOFS) { -#ifndef ROMIO_PIOFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_PIOFS_operations; -#endif - } - if (file_system == ADIO_UFS) { -#ifndef ROMIO_UFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_UFS_operations; -#endif - } - if (file_system == ADIO_NFS) { -#ifndef ROMIO_NFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_NFS_operations; -#endif - } - if (file_system == ADIO_PANFS) { -#ifndef ROMIO_PANFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_PANFS_operations; -#endif - } - if (file_system == ADIO_HFS) { -#ifndef ROMIO_HFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_HFS_operations; -#endif - } - if (file_system == ADIO_XFS) { -#ifndef ROMIO_XFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_XFS_operations; -#endif - } - if (file_system == ADIO_SFS) { -#ifndef ROMIO_SFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_SFS_operations; -#endif - } - if (file_system == ADIO_PVFS) { -#ifndef ROMIO_PVFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_PVFS_operations; -#endif - } - if (file_system == ADIO_PVFS2) { -#ifndef ROMIO_PVFS2 - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_PVFS2_operations; -#endif - } - if (file_system == ADIO_NTFS) { -#ifndef ROMIO_NTFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_NTFS_operations; -#endif - } - if (file_system == ADIO_TESTFS) { -#ifndef ROMIO_TESTFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_TESTFS_operations; -#endif - } - - if (file_system == ADIO_GPFS) { -#ifndef ROMIO_GPFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_GPFS_operations; -#endif - } - - if (file_system == ADIO_GRIDFTP) { -#ifndef ROMIO_GRIDFTP - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_GRIDFTP_operations; -#endif - } - if (file_system == ADIO_LUSTRE) { -#ifndef ROMIO_LUSTRE - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_LUSTRE_operations; -#endif - } - if (file_system == ADIO_ZOIDFS) { -#ifndef ROMIO_ZOIDFS - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iofstypeunsupported", 0); - return; -#else - *ops = &ADIO_ZOIDFS_operations; -#endif - } - *error_code = MPI_SUCCESS; - *fstype = file_system; - return; -} -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/common/ad_get_sh_fp.c b/3rd-party/romio321/adio/common/ad_get_sh_fp.c deleted file mode 100644 index 12133277903..00000000000 --- a/3rd-party/romio321/adio/common/ad_get_sh_fp.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 "adio.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); - -void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp, - int *error_code) -{ - ADIO_Status status; - ADIO_Offset new_fp; - MPI_Comm dupcommself; - - /* Set the shared_fp in case this comes from an uninitialized stack variable - The read routines will not read into the address of this variable if the file - size of a shared pointer is 0, and if incr is always zero, this value will remain - uninitialized. Initialize it here to prevent incorrect values - */ - *shared_fp = 0; - -#ifdef ROMIO_NFS - if (fd->file_system == ADIO_NFS) { - ADIOI_NFS_Get_shared_fp(fd, incr, shared_fp, error_code); - return; - } -#endif - - 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)); - ADIO_ReadContig(fd->shared_fp_fd, shared_fp, sizeof(ADIO_Offset), - MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); - /* if the file is empty, the above function may return error - (reading beyond end of file). In that case, shared_fp = 0, - set above, is the correct value. */ - } - else { - ADIOI_WRITE_LOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); - ADIO_ReadContig(fd->shared_fp_fd, shared_fp, sizeof(ADIO_Offset), - MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); - if (*error_code != MPI_SUCCESS) { - ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); - return; - } - } - - if (incr == 0) {goto done;} - - new_fp = *shared_fp + incr; - - ADIO_WriteContig(fd->shared_fp_fd, &new_fp, sizeof(ADIO_Offset), - MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); -done: - ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); -} diff --git a/3rd-party/romio321/adio/common/ad_hints.c b/3rd-party/romio321/adio/common/ad_hints.c deleted file mode 100644 index 6e89e76a3f5..00000000000 --- a/3rd-party/romio321/adio/common/ad_hints.c +++ /dev/null @@ -1,310 +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 "hint_fns.h" - -void ADIOI_GEN_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, nprocs=0, len; - int ok_to_override_cb_nodes=0; - static char myname[] = "ADIOI_GEN_SETINFO"; - - - /* if we've already set up default hints and the user has not asked us to - * process any hints (MPI_INFO_NULL), then we can short-circuit hint - * processing */ - if (fd->hints->initialized && fd->info == MPI_INFO_NULL) { - *error_code = MPI_SUCCESS; - return; - } - - if (fd->info == MPI_INFO_NULL) MPI_Info_create(&(fd->info)); - info = fd->info; - - MPI_Comm_size(fd->comm, &nprocs); - - /* 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)); - if (value == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return; - } - - /* initialize info and hints to default values if they haven't been - * previously initialized - */ - if (!fd->hints->initialized) { - - /* buffer size for collective I/O */ - ADIOI_Info_set(info, "cb_buffer_size", ADIOI_CB_BUFFER_SIZE_DFLT); - fd->hints->cb_buffer_size = atoi(ADIOI_CB_BUFFER_SIZE_DFLT); - - /* default is to let romio automatically decide when to use - * collective buffering - */ - ADIOI_Info_set(info, "romio_cb_read", "automatic"); - fd->hints->cb_read = ADIOI_HINT_AUTO; - ADIOI_Info_set(info, "romio_cb_write", "automatic"); - fd->hints->cb_write = ADIOI_HINT_AUTO; - - fd->hints->cb_config_list = NULL; - - /* number of processes that perform I/O in collective I/O */ - ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", nprocs); - ADIOI_Info_set(info, "cb_nodes", value); - fd->hints->cb_nodes = nprocs; - - /* 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; - - /* 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_IND_RD_BUFFER_SIZE_DFLT); - fd->hints->ind_rd_buffer_size = atoi(ADIOI_IND_RD_BUFFER_SIZE_DFLT); - - /* buffer size for data sieving in independent writes */ - ADIOI_Info_set(info, "ind_wr_buffer_size", ADIOI_IND_WR_BUFFER_SIZE_DFLT); - fd->hints->ind_wr_buffer_size = atoi(ADIOI_IND_WR_BUFFER_SIZE_DFLT); - - /* default is to let romio automatically decide when to use data - * sieving - */ - 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; - - /* ADIO_Open sets up collective buffering arrays. If we are in this - * path from say set_file_view, then we've don't want to adjust the - * array: we'll get a segfault during collective i/o. We only want to - * look at the users cb_nodes if it's open time */ - ok_to_override_cb_nodes = 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); - - /* aligning file realms to certain sizes (e.g. stripe sizes) - * may benefit I/O performance */ - ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_fr_alignment", - &(fd->hints->cb_fr_alignment), myname, error_code); - - /* for collective I/O, try to be smarter about when to do data sieving - * using a specific threshold for the datatype size/extent - * (percentage 0-100%) */ - ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_ds_threshold", - &(fd->hints->cb_ds_threshold), myname, error_code); - - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_cb_alltoall", - &(fd->hints->cb_alltoall), 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; - } - - /* enable/disable persistent file realms for collective I/O */ - /* may want to check for no_indep_rdwr hint as well */ - ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_cb_pfr", - &(fd->hints->cb_pfr), myname, error_code); - - - /* file realm assignment types ADIOI_FR_AAR(0), - ADIOI_FR_FSZ(-1), ADIOI_FR_USR_REALMS(-2), all others specify - a regular fr size in bytes. probably not the best way... */ - ADIOI_Info_check_and_install_int(fd, users_info, "romio_cb_fr_type", - &(fd->hints->cb_fr_type), myname, error_code); - - /* 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); - - if (ok_to_override_cb_nodes) { - /* MPI_File_open path sets up some data structrues that don't - * get resized in the MPI_File_set_view path, so ignore - * cb_nodes in the set_view case */ - ADIOI_Info_check_and_install_int(fd, users_info, "cb_nodes", - &(fd->hints->cb_nodes), myname, error_code); - if ((fd->hints->cb_nodes <= 0) || (fd->hints->cb_nodes > nprocs)) { - /* can't ask for more aggregators than mpi processes, though it - * might be interesting to think what such oversubscription - * might mean... someday */ - ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", nprocs); - ADIOI_Info_set(info, "cb_nodes", value); - fd->hints->cb_nodes = nprocs; - } - } /* if (ok_to_override_cb_nodes) */ - - 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); - - if (fd->hints->cb_config_list == NULL) { - /* only set cb_config_list if it isn't already set. Note that - * since we set it below, this ensures that the cb_config_list hint - * will be set at file open time either by the user or to the - * default */ - /* if it has been set already, we ignore it the second time. - * otherwise we would get an error if someone used the same info - * value with a cb_config_list value in it in a couple of calls, - * which would be irritating. */ - ADIOI_Info_check_and_install_str(fd, users_info, "cb_config_list", - &(fd->hints->cb_config_list), myname, error_code); - - } - ADIOI_Info_check_and_install_int(fd, users_info, "romio_min_fdomain_size", - &(fd->hints->min_fdomain_size), myname, error_code); - - /* Now we use striping unit in common code so we should - process hints for it. */ - ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit", - &(fd->hints->striping_unit), myname, error_code); - } - - /* Begin hint post-processig: some hints take precidence over or conflict - * with others, or aren't supported by some file systems */ - - /* handle cb_config_list default value here; avoids an extra - * free/alloc and insures it is always set - */ - if (fd->hints->cb_config_list == NULL) { - ADIOI_Info_set(info, "cb_config_list", ADIOI_CB_CONFIG_LIST_DFLT); - len = (strlen(ADIOI_CB_CONFIG_LIST_DFLT)+1) * sizeof(char); - fd->hints->cb_config_list = ADIOI_Malloc(len); - if (fd->hints->cb_config_list == NULL) { - ADIOI_Free(value); - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return; - } - ADIOI_Strncpy(fd->hints->cb_config_list, ADIOI_CB_CONFIG_LIST_DFLT, len); - } - /* 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; - } - - 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/common/ad_init.c b/3rd-party/romio321/adio/common/ad_init.c deleted file mode 100644 index 88e75a5251f..00000000000 --- a/3rd-party/romio321/adio/common/ad_init.c +++ /dev/null @@ -1,134 +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" - -ADIOI_Flatlist_node *ADIOI_Flatlist = NULL; -ADIOI_Datarep *ADIOI_Datarep_head = NULL; - /* list of datareps registered by the user */ - -/* for f2c and c2f conversion */ -ADIO_File *ADIOI_Ftable = NULL; -int ADIOI_Ftable_ptr = 0, ADIOI_Ftable_max = 0; -ADIO_Request *ADIOI_Reqtable = NULL; -int ADIOI_Reqtable_ptr = 0, ADIOI_Reqtable_max = 0; -#ifndef HAVE_MPI_INFO -MPI_Info *MPIR_Infotable = NULL; -int MPIR_Infotable_ptr = 0, MPIR_Infotable_max = 0; -#endif - -MPI_Info ADIOI_syshints = MPI_INFO_NULL; - -MPI_Op ADIO_same_amode=MPI_OP_NULL; - -#if defined(ROMIO_XFS) || defined(ROMIO_LUSTRE) -int ADIOI_Direct_read = 0, ADIOI_Direct_write = 0; -#endif - -int ADIO_Init_keyval=MPI_KEYVAL_INVALID; - -MPI_Errhandler ADIOI_DFLT_ERR_HANDLER = MPI_ERRORS_RETURN; - - -static void my_consensus(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype) -{ - int i, *in, *inout; - in = (int*)invec; - inout = (int*)inoutvec; - - for (i=0; i< *len; i++) { - if (in[i] != inout[i]) - inout[i] = ADIO_AMODE_NOMATCH; - } - return; -} - -void ADIO_Init(int *argc, char ***argv, int *error_code) -{ -#if defined(ROMIO_XFS) || defined(ROMIO_LUSTRE) - char *c; -#endif - - ADIOI_UNREFERENCED_ARG(argc); - ADIOI_UNREFERENCED_ARG(argv); - -#ifdef ROMIO_INSIDE_MPICH - MPIR_Ext_init(); -#endif - -/* initialize the linked list containing flattened datatypes */ - ADIOI_Flatlist = (ADIOI_Flatlist_node *) ADIOI_Malloc(sizeof(ADIOI_Flatlist_node)); - ADIOI_Flatlist->type = MPI_DATATYPE_NULL; - ADIOI_Flatlist->next = NULL; - ADIOI_Flatlist->blocklens = NULL; - ADIOI_Flatlist->indices = NULL; - -#if defined(ROMIO_XFS) || defined(ROMIO_LUSTRE) - c = getenv("MPIO_DIRECT_READ"); - if (c && (!strcmp(c, "true") || !strcmp(c, "TRUE"))) - ADIOI_Direct_read = 1; - else ADIOI_Direct_read = 0; - c = getenv("MPIO_DIRECT_WRITE"); - if (c && (!strcmp(c, "true") || !strcmp(c, "TRUE"))) - ADIOI_Direct_write = 1; - else ADIOI_Direct_write = 0; -#endif - - -#ifdef ADIOI_MPE_LOGGING - { - MPE_Log_get_state_eventIDs( &ADIOI_MPE_open_a, &ADIOI_MPE_open_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_read_a, &ADIOI_MPE_read_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_write_a, &ADIOI_MPE_write_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_lseek_a, &ADIOI_MPE_lseek_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_close_a, &ADIOI_MPE_close_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_writelock_a, - &ADIOI_MPE_writelock_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_readlock_a, - &ADIOI_MPE_readlock_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_unlock_a, &ADIOI_MPE_unlock_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_postwrite_a, - &ADIOI_MPE_postwrite_b ); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_openinternal_a, - &ADIOI_MPE_openinternal_b); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_stat_a, &ADIOI_MPE_stat_b); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_iread_a, &ADIOI_MPE_iread_b); - MPE_Log_get_state_eventIDs( &ADIOI_MPE_iwrite_a, &ADIOI_MPE_iwrite_b); - - int comm_world_rank; - MPI_Comm_rank( MPI_COMM_WORLD, &comm_world_rank ); - - if ( comm_world_rank == 0 ) { - MPE_Describe_state( ADIOI_MPE_open_a, ADIOI_MPE_open_b, - "open", "orange" ); - MPE_Describe_state( ADIOI_MPE_read_a, ADIOI_MPE_read_b, - "read", "green" ); - MPE_Describe_state( ADIOI_MPE_write_a, ADIOI_MPE_write_b, - "write", "blue" ); - MPE_Describe_state( ADIOI_MPE_lseek_a, ADIOI_MPE_lseek_b, - "lseek", "red" ); - MPE_Describe_state( ADIOI_MPE_close_a, ADIOI_MPE_close_b, - "close", "grey" ); - MPE_Describe_state( ADIOI_MPE_writelock_a, ADIOI_MPE_writelock_b, - "writelock", "plum" ); - MPE_Describe_state( ADIOI_MPE_readlock_a, ADIOI_MPE_readlock_b, - "readlock", "magenta" ); - MPE_Describe_state( ADIOI_MPE_unlock_a, ADIOI_MPE_unlock_b, - "unlock", "purple" ); - MPE_Describe_state( ADIOI_MPE_postwrite_a, ADIOI_MPE_postwrite_b, - "postwrite", "ivory" ); - MPE_Describe_state( ADIOI_MPE_openinternal_a, ADIOI_MPE_openinternal_b, "open system", "blue"); - MPE_Describe_state( ADIOI_MPE_stat_a, ADIOI_MPE_stat_b, "stat", "purple"); - MPE_Describe_state( ADIOI_MPE_iread_a, ADIOI_MPE_iread_b, "iread", "purple"); - MPE_Describe_state( ADIOI_MPE_iwrite_a, ADIOI_MPE_iwrite_b, "iwrite", "purple"); - } - } -#endif - - *error_code = MPI_SUCCESS; - MPI_Op_create(my_consensus, 1, &ADIO_same_amode); -} diff --git a/3rd-party/romio321/adio/common/ad_io_coll.c b/3rd-party/romio321/adio/common/ad_io_coll.c deleted file mode 100644 index 273c8a551b2..00000000000 --- a/3rd-party/romio321/adio/common/ad_io_coll.c +++ /dev/null @@ -1,1135 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "assert.h" -#include "adio.h" -#include "adio_extern.h" -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -/* #define ALLTOALL */ - -/* #define DEBUG */ -/* #define DEBUG2 */ /* print buffers */ - -#define USE_PRE_REQ - -static void Exch_data_amounts (ADIO_File fd, int nprocs, - ADIO_Offset *client_comm_sz_arr, - ADIO_Offset *agg_comm_sz_arr, - int *client_alltoallw_counts, - int *agg_alltoallw_counts, - int *aggregators_done); -static void post_aggregator_comm (MPI_Comm comm, int rw_type, int nproc, - void *cb_buf, - MPI_Datatype *client_comm_dtype_arr, - ADIO_Offset *client_comm_sz_arr, - MPI_Request **requests, - int *aggregators_client_count_p); - -static void post_client_comm (ADIO_File fd, int rw_type, - int agg_rank, void *buf, - MPI_Datatype agg_comm_dtype, - int agg_alltoallw_count, - MPI_Request *request); - -/* Avery Ching and Kenin Columa's reworked two-phase algorithm. Key features - * - persistent file domains - * - an option to use alltoall instead of point-to-point - */ -void ADIOI_IOStridedColl (ADIO_File fd, void *buf, int count, int rdwr, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - ADIO_Offset min_st_offset=0, max_end_offset=0; - ADIO_Offset st_end_offset[2]; - ADIO_Offset *all_st_end_offsets = NULL; - int filetype_is_contig, buftype_is_contig, is_contig; - ADIO_Offset off; - int interleave_count = 0, i, nprocs, myrank, nprocs_for_coll; - int cb_enable; - ADIO_Offset bufsize; - MPI_Aint extent, lb; -#ifdef DEBUG2 - MPI_Aint bufextent; -#endif - MPI_Count size; - int agg_rank; - - ADIO_Offset agg_disp; /* aggregated file offset */ - MPI_Datatype agg_dtype; /* aggregated file datatype */ - - int aggregators_done = 0; - ADIO_Offset buffered_io_size = 0; - - int *alltoallw_disps; - - int *alltoallw_counts; - int *client_alltoallw_counts; - int *agg_alltoallw_counts; - - char *cb_buf = NULL; - - MPI_Datatype *client_comm_dtype_arr; /* aggregator perspective */ - MPI_Datatype *agg_comm_dtype_arr; /* client perspective */ - ADIO_Offset *client_comm_sz_arr; /* aggregator perspective */ - ADIO_Offset *agg_comm_sz_arr; /* client perspective */ - - /* file views for each client and aggregator */ - view_state *client_file_view_state_arr = NULL; - view_state *agg_file_view_state_arr = NULL; - /* mem views for local process */ - view_state *my_mem_view_state_arr = NULL; - - MPI_Status *agg_comm_statuses = NULL; - MPI_Request *agg_comm_requests = NULL; - MPI_Status *client_comm_statuses = NULL; - MPI_Request *client_comm_requests = NULL; - int aggs_client_count = 0; - int clients_agg_count = 0; - - MPI_Comm_size (fd->comm, &nprocs); - MPI_Comm_rank (fd->comm, &myrank); -#ifdef DEBUG - fprintf (stderr, "p%d: entering ADIOI_IOStridedColl\n", myrank); -#endif -#ifdef AGGREGATION_PROFILE - if (rdwr == ADIOI_READ) - MPE_Log_event (5010, 0, NULL); - else - MPE_Log_event (5012, 0, NULL); -#endif - - /* 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. */ - - nprocs_for_coll = fd->hints->cb_nodes; - - if (rdwr == ADIOI_READ) - cb_enable = fd->hints->cb_read; - else - cb_enable = fd->hints->cb_write; - - /* only check for interleaving if cb_read isn't disabled */ - if (cb_enable != ADIOI_HINT_DISABLE) { - /* find the starting and ending byte of my I/O access */ - ADIOI_Calc_bounds (fd, count, datatype, file_ptr_type, offset, - &st_end_offset[0], &st_end_offset[1]); - - /* allocate an array of start/end pairs */ - all_st_end_offsets = (ADIO_Offset *) - ADIOI_Malloc (2*nprocs*sizeof(ADIO_Offset)); - MPI_Allgather (st_end_offset, 2, ADIO_OFFSET, all_st_end_offsets, 2, - ADIO_OFFSET, fd->comm); - - min_st_offset = all_st_end_offsets[0]; - max_end_offset = all_st_end_offsets[1]; - - for (i=1; ifiletype, &filetype_is_contig); - - if ((cb_enable == ADIOI_HINT_DISABLE - || (!interleave_count && (cb_enable == ADIOI_HINT_AUTO))) - && (fd->hints->cb_pfr != ADIOI_HINT_ENABLE)){ - if (cb_enable != ADIOI_HINT_DISABLE) { - ADIOI_Free (all_st_end_offsets); - } - - if (buftype_is_contig && filetype_is_contig) { - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + (fd->etype_size) * offset; - if (rdwr == ADIOI_READ) - ADIO_ReadContig(fd, buf, count, datatype, - ADIO_EXPLICIT_OFFSET, off, status, - error_code); - else - ADIO_WriteContig(fd, buf, count, datatype, - ADIO_EXPLICIT_OFFSET, off, status, - error_code); - } - else { - if (rdwr == ADIOI_READ) - ADIO_ReadContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, - 0, status, error_code); - else - ADIO_WriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, - 0, status, error_code); - } - } - else { - if (rdwr == ADIOI_READ) - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, status, error_code); - else - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, status, error_code); - } - return; - } - - MPI_Type_get_extent(datatype, &lb, &extent); -#ifdef DEBUG2 - bufextent = extent * count; -#endif - MPI_Type_size_x(datatype, &size); - bufsize = size * (MPI_Count)count; - - /* Calculate file realms */ - if ((fd->hints->cb_pfr != ADIOI_HINT_ENABLE) || - (fd->file_realm_types == NULL)) - ADIOI_Calc_file_realms (fd, min_st_offset, max_end_offset); - - my_mem_view_state_arr = (view_state *) - ADIOI_Calloc (1, nprocs * sizeof(view_state)); - agg_file_view_state_arr = (view_state *) - ADIOI_Calloc (1, nprocs * sizeof(view_state)); - client_comm_sz_arr = (ADIO_Offset *) - ADIOI_Calloc (1, nprocs * sizeof(ADIO_Offset)); - - if (fd->is_agg) { - client_file_view_state_arr = (view_state *) - ADIOI_Calloc (1, nprocs * sizeof(view_state)); - } - else { - client_file_view_state_arr = NULL; - } - - /* Alltoallw doesn't like a null array even if the counts are - * zero. If you do not include this code, it will fail. */ - client_comm_dtype_arr = (MPI_Datatype *) - ADIOI_Calloc (1, nprocs * sizeof(MPI_Datatype)); - if (!fd->is_agg) - for (i = 0; i < nprocs; i++) - client_comm_dtype_arr[i] = MPI_BYTE; - - ADIOI_Exch_file_views (myrank, nprocs, file_ptr_type, fd, count, - datatype, offset, my_mem_view_state_arr, - agg_file_view_state_arr, - client_file_view_state_arr); - - agg_comm_sz_arr = (ADIO_Offset *) - ADIOI_Calloc (1, nprocs * sizeof(ADIO_Offset)); - agg_comm_dtype_arr = (MPI_Datatype *) - ADIOI_Malloc (nprocs * sizeof(MPI_Datatype)); - if (fd->is_agg) { - ADIOI_Build_agg_reqs (fd, rdwr, nprocs, - client_file_view_state_arr, - client_comm_dtype_arr, - client_comm_sz_arr, - &agg_disp, - &agg_dtype); - buffered_io_size = 0; - for (i=0; i 0) - buffered_io_size += client_comm_sz_arr[i]; - } - } -#ifdef USE_PRE_REQ - else - { - /* Example use of ADIOI_Build_client_pre_req. to an - * appropriate section */ - - for (i = 0; i < fd->hints->cb_nodes; i++) - { - agg_rank = fd->hints->ranklist[(i+myrank)%fd->hints->cb_nodes]; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5040, 0, NULL); -#endif - ADIOI_Build_client_pre_req( - fd, agg_rank, (i+myrank)%fd->hints->cb_nodes, - &(my_mem_view_state_arr[agg_rank]), - &(agg_file_view_state_arr[agg_rank]), - 2*1024*1024, - 64*1024); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5041, 0, NULL); -#endif - } - } -#endif - - - if (fd->is_agg) - cb_buf = (char *) ADIOI_Malloc (fd->hints->cb_buffer_size); - alltoallw_disps = (int *) ADIOI_Calloc (nprocs, sizeof(int)); - alltoallw_counts = client_alltoallw_counts = (int *) - ADIOI_Calloc (2*nprocs, sizeof(int)); - agg_alltoallw_counts = &alltoallw_counts[nprocs]; - - if (fd->hints->cb_alltoall == ADIOI_HINT_DISABLE) { - /* aggregators pre-post all Irecv's for incoming data from clients */ - if ((fd->is_agg) && (rdwr == ADIOI_WRITE)) - post_aggregator_comm(fd->comm, rdwr, nprocs, cb_buf, - client_comm_dtype_arr, - client_comm_sz_arr, - &agg_comm_requests, - &aggs_client_count); - } - /* Aggregators send amounts for data requested to clients */ - Exch_data_amounts (fd, nprocs, client_comm_sz_arr, agg_comm_sz_arr, - client_alltoallw_counts, agg_alltoallw_counts, - &aggregators_done); - -#ifdef DEBUG - fprintf (stderr, "client_alltoallw_counts[ "); - for (i=0; ihints->cb_alltoall == ADIOI_HINT_DISABLE) { - /* clients should build datatypes for local memory locations - for data communication with aggregators and post - communication as the datatypes are built */ - - client_comm_requests = (MPI_Request *) - ADIOI_Calloc (fd->hints->cb_nodes, sizeof(MPI_Request)); - - for (i = 0; i < fd->hints->cb_nodes; i++) - { - clients_agg_count = 0; - agg_rank = fd->hints->ranklist[(i+myrank)%fd->hints->cb_nodes]; - if (agg_comm_sz_arr[agg_rank] > 0) { - ADIOI_Build_client_req(fd, agg_rank, - (i+myrank)%fd->hints->cb_nodes, - &(my_mem_view_state_arr[agg_rank]), - &(agg_file_view_state_arr[agg_rank]), - agg_comm_sz_arr[agg_rank], - &(agg_comm_dtype_arr[agg_rank])); - -#ifdef AGGREGATION_PROFILE - if (i == 0) - MPE_Log_event (5038, 0, NULL); -#endif - post_client_comm (fd, rdwr, agg_rank, buf, - agg_comm_dtype_arr[agg_rank], - agg_alltoallw_counts[agg_rank], - &client_comm_requests[clients_agg_count]); - clients_agg_count++; - } - } -#ifdef AGGREGATION_PROFILE - if (!clients_agg_count) - MPE_Log_event(5039, 0, NULL); -#endif - - if (rdwr == ADIOI_READ) { - if (fd->is_agg && buffered_io_size) { - ADIOI_IOFiletype (fd, cb_buf, buffered_io_size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, agg_disp, agg_dtype, - ADIOI_READ, status, error_code); - if (*error_code != MPI_SUCCESS) return; - MPI_Type_free (&agg_dtype); - } - -#ifdef DEBUG - fprintf (stderr, "expecting from [agg](disp,size,cnt)="); - for (i=0; i < nprocs; i++) { - MPI_Type_size_x (agg_comm_dtype_arr[i], &size); - fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], - size, agg_alltoallw_counts[i]); - if (i != nprocs - 1) - fprintf(stderr, ","); - } - fprintf (stderr, "]\n"); - if (fd->is_agg) { - fprintf (stderr, "sending to [client](disp,size,cnt)="); - for (i=0; i < nprocs; i++) { - if (fd->is_agg) - MPI_Type_size_x (client_comm_dtype_arr[i], &size); - else - size = -1; - - fprintf (stderr, "[%d](%d,%d,%d)", i, alltoallw_disps[i], - size, client_alltoallw_counts[i]); - if (i != nprocs - 1) - fprintf(stderr, ","); - } - fprintf (stderr,"\n"); - } - fflush (NULL); -#endif - /* aggregators post all Isends for outgoing data to clients */ - if (fd->is_agg) - post_aggregator_comm(fd->comm, rdwr, nprocs, cb_buf, - client_comm_dtype_arr, - client_comm_sz_arr, - &agg_comm_requests, - &aggs_client_count); - - if (fd->is_agg && aggs_client_count) { - agg_comm_statuses = ADIOI_Malloc(aggs_client_count * - sizeof(MPI_Status)); - MPI_Waitall(aggs_client_count, agg_comm_requests, - agg_comm_statuses); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5033, 0, NULL); -#endif - ADIOI_Free (agg_comm_requests); - ADIOI_Free (agg_comm_statuses); - } - - if (clients_agg_count) { - client_comm_statuses = ADIOI_Malloc(clients_agg_count * - sizeof(MPI_Status)); - MPI_Waitall(clients_agg_count, client_comm_requests, - client_comm_statuses); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5039, 0, NULL); -#endif - ADIOI_Free (client_comm_requests); - ADIOI_Free (client_comm_statuses); - } - -#ifdef DEBUG2 - fprintf (stderr, "buffered_io_size = %lld\n", buffered_io_size); - if (fd->is_agg && buffered_io_size) { - fprintf (stderr, "buf = ["); - for (i=0; iis_agg && buffered_io_size) { - assert (aggs_client_count != 0); - /* make sure we actually have the data to write out */ - agg_comm_statuses = (MPI_Status *) - ADIOI_Malloc (aggs_client_count*sizeof(MPI_Status)); - - MPI_Waitall (aggs_client_count, agg_comm_requests, - agg_comm_statuses); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5033, 0, NULL); -#endif - ADIOI_Free (agg_comm_requests); - ADIOI_Free (agg_comm_statuses); -#ifdef DEBUG2 - fprintf (stderr, "cb_buf = ["); - for (i=0; iis_agg && buffered_io_size) { - ADIOI_IOFiletype (fd, cb_buf, buffered_io_size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, agg_disp, agg_dtype, - ADIOI_READ, status, error_code); - if (*error_code != MPI_SUCCESS) return; - MPI_Type_free (&agg_dtype); - } - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5032, 0, NULL); -#endif - MPI_Alltoallw (cb_buf, client_alltoallw_counts, alltoallw_disps, - client_comm_dtype_arr, - buf, agg_alltoallw_counts , alltoallw_disps, - agg_comm_dtype_arr, - fd->comm); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5033, 0, NULL); -#endif - } - else { /* Write Case */ -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5032, 0, NULL); -#endif - MPI_Alltoallw (buf, agg_alltoallw_counts, alltoallw_disps, - agg_comm_dtype_arr, - cb_buf, client_alltoallw_counts, alltoallw_disps, - client_comm_dtype_arr, - fd->comm); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5033, 0, NULL); -#endif - if (fd->is_agg && buffered_io_size) { - ADIOI_IOFiletype (fd, cb_buf, buffered_io_size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, agg_disp, agg_dtype, - ADIOI_WRITE, status, error_code); - if (*error_code != MPI_SUCCESS) return; - MPI_Type_free (&agg_dtype); - } - } - } - - /* Free (uncommit) datatypes for reuse */ - if (fd->is_agg) { - if (buffered_io_size > 0) { - for (i=0; i 0) - MPI_Type_free (&client_comm_dtype_arr[i]); - } - } - } - for (i=0; i 0) - MPI_Type_free (&agg_comm_dtype_arr[i]); - } - - /* figure out next set up requests */ - if (fd->is_agg) { - ADIOI_Build_agg_reqs (fd, rdwr, nprocs, - client_file_view_state_arr, - client_comm_dtype_arr, - client_comm_sz_arr, - &agg_disp, - &agg_dtype); - buffered_io_size = 0; - for (i=0; i 0) - buffered_io_size += client_comm_sz_arr[i]; - } - } -#ifdef USE_PRE_REQ - else { - /* Example use of ADIOI_Build_client_pre_req. to an - * appropriate section */ - for (i = 0; i < fd->hints->cb_nodes; i++) - { - agg_rank = fd->hints->ranklist[(i+myrank)%fd->hints->cb_nodes]; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5040, 0, NULL); -#endif - ADIOI_Build_client_pre_req( - fd, agg_rank, (i+myrank)%fd->hints->cb_nodes, - &(my_mem_view_state_arr[agg_rank]), - &(agg_file_view_state_arr[agg_rank]), - 2*1024*1024, - 64*1024); -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5041, 0, NULL); -#endif - } - } -#endif - - /* aggregators pre-post all Irecv's for incoming data from - * clients. if nothing is needed, agg_comm_requests is not - * allocated */ - if (fd->hints->cb_alltoall == ADIOI_HINT_DISABLE) { - if ((fd->is_agg) && (rdwr == ADIOI_WRITE)) - post_aggregator_comm(fd->comm, rdwr, nprocs, cb_buf, - client_comm_dtype_arr, - client_comm_sz_arr, - &agg_comm_requests, - &aggs_client_count); - } - - /* Aggregators send amounts for data requested to clients */ - Exch_data_amounts (fd, nprocs, client_comm_sz_arr, agg_comm_sz_arr, - client_alltoallw_counts, agg_alltoallw_counts, - &aggregators_done); - - } - - /* Clean up */ - - if (fd->hints->cb_pfr != ADIOI_HINT_ENABLE) { - /* AAR, FSIZE, and User provided uniform File realms */ - if (1) { - ADIOI_Delete_flattened (fd->file_realm_types[0]); - MPI_Type_free (&fd->file_realm_types[0]); - } - else { - for (i=0; ihints->cb_nodes; i++) { - ADIOI_Datatype_iscontig(fd->file_realm_types[i], &is_contig); - if (!is_contig) - ADIOI_Delete_flattened(fd->file_realm_types[i]); - MPI_Type_free (&fd->file_realm_types[i]); - } - } - ADIOI_Free (fd->file_realm_types); - ADIOI_Free (fd->file_realm_st_offs); - } - - /* This memtype must be deleted from the ADIOI_Flatlist or else it - * will match incorrectly with other datatypes which use this - * pointer. */ - ADIOI_Delete_flattened(datatype); - ADIOI_Delete_flattened(fd->filetype); - - if (fd->is_agg) { - if (buffered_io_size > 0) - MPI_Type_free (&agg_dtype); - for (i=0; iindices); - ADIOI_Free (client_file_view_state_arr[i].flat_type_p->blocklens); - ADIOI_Free (client_file_view_state_arr[i].flat_type_p); - } - ADIOI_Free (client_file_view_state_arr); - ADIOI_Free (cb_buf); - } - for (i = 0; i 0) - MPI_Type_free (&agg_comm_dtype_arr[i]); - - ADIOI_Free (client_comm_sz_arr); - ADIOI_Free (client_comm_dtype_arr); - ADIOI_Free (my_mem_view_state_arr); - ADIOI_Free (agg_file_view_state_arr); - ADIOI_Free (agg_comm_sz_arr); - ADIOI_Free (agg_comm_dtype_arr); - ADIOI_Free (alltoallw_disps); - ADIOI_Free (alltoallw_counts); - ADIOI_Free (all_st_end_offsets); - -#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 during collective I/O. */ -#endif - fd->fp_sys_posn = -1; /* set it to null. */ -#ifdef AGGREGATION_PROFILE - if (rdwr == ADIOI_READ) - MPE_Log_event (5011, 0, NULL); - else - MPE_Log_event (5013, 0, NULL); -#endif -} - - -/* Some of this code is from the old Calc_my_off_len() function. - * It calculates the 1st and last byte accessed */ -void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, - int file_ptr_type, ADIO_Offset offset, - ADIO_Offset *st_offset, ADIO_Offset *end_offset) -{ - MPI_Count filetype_size, buftype_size, etype_size; - int sum; - MPI_Aint filetype_extent, lb; - ADIO_Offset total_io; - int filetype_is_contig; - ADIO_Offset i, remainder; - ADIOI_Flatlist_node *flat_file; - - ADIO_Offset st_byte_off, end_byte_off; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5000, 0, NULL); -#endif - - if (!count) { - /* Max signed positive value for ADIO_Offset - * (arch. dependent?). is there a better way? */ - memset (st_offset, 8, sizeof(ADIO_Offset)); - *st_offset = *st_offset / 2; - *end_offset = -1; - return; - } - - ADIOI_Datatype_iscontig (fd->filetype, &filetype_is_contig); - - MPI_Type_size_x (fd->filetype, &filetype_size); - MPI_Type_get_extent (fd->filetype, &lb, &filetype_extent); - MPI_Type_size_x (fd->etype, &etype_size); - MPI_Type_size_x (buftype, &buftype_size); - - total_io = buftype_size * count; - - if (filetype_is_contig) { - if (file_ptr_type == ADIO_INDIVIDUAL) - st_byte_off = fd->fp_ind; - else - st_byte_off = fd->disp + etype_size * offset; - - end_byte_off = st_byte_off + total_io - 1; - } - else { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - - /* we need to take care of some weirdness since fd->fp_ind - points at an accessible byte in file. the first accessible - byte in the file is not necessarily the first byte, nor is - it necessarily the first off/len pair in the filetype. */ - if (file_ptr_type == ADIO_INDIVIDUAL) { - st_byte_off = fd->fp_ind; - /* find end byte of I/O (may be in middle of an etype) */ - - /* calculate byte starting point of first filetype */ - end_byte_off = (ADIO_Offset) - ((fd->fp_ind - fd->disp - flat_file->indices[0]) / - filetype_extent) * filetype_extent + fd->disp + - flat_file->indices[0]; - /* number of absolute bytes into first filetype */ - remainder = (fd->fp_ind - fd->disp - flat_file->indices[0]) % - filetype_extent; - if (remainder) { - /* find how many file viewable bytes into first filetype */ - sum = 0; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - if ((flat_file->indices[i] - flat_file->indices[0] + - flat_file->blocklens[i]) >= remainder) { - sum -= (flat_file->blocklens[i] - (sum - remainder)); - break; - } - } - total_io += sum; - } - /* byte starting point of last filetype */ - end_byte_off += (total_io - 1) / filetype_size * filetype_extent; - /* number of bytes into last filetype */ - remainder = total_io % filetype_size; - if (!remainder) { - for (i=flat_file->count - 1; i>=0; i--) { - if (flat_file->blocklens[i]) break; - } - assert (i > -1); - end_byte_off += flat_file->indices[i] + - flat_file->blocklens[i] - 1; - end_byte_off -= flat_file->indices[0]; - } - else { - sum = 0; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - if (sum >= remainder) { - end_byte_off += flat_file->indices[i] + - flat_file->blocklens[i] - sum + remainder - 1; - break; - } - } - end_byte_off -= flat_file->indices[0]; - } - } - else { - /* find starting byte of I/O (must be aligned with an etype) */ - /* byte starting point of starting filetype */ - st_byte_off = fd->disp + ((offset * etype_size) / filetype_size) * - filetype_extent; - /* number of file viewable bytes into starting filetype */ - remainder = (etype_size * offset) % filetype_size; - - sum = 0; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - if (sum >= remainder) { - if (sum == remainder) - st_byte_off += flat_file->indices[i+1]; - else - st_byte_off += flat_file->indices[i] + - flat_file->blocklens[i] - sum + remainder; - break; - } - } - - /* find end byte of I/O (may be in middle of an etype) */ - /* byte starting point of last filetype */ - end_byte_off = fd->disp + (offset * etype_size + total_io) / - filetype_size * filetype_extent; - /* number of bytes into last filetype */ - remainder = (offset * etype_size + total_io) % filetype_size; - - if (!remainder) { - /* the last non-zero off/len pair */ - for (i=flat_file->count-1; i>=0; i--) { - if (flat_file->blocklens[i]) break; - } - assert (i >= 0); - /* back up a whole filetype, and put back up to the - * last byte of the last non-zero offlen pair */ - /* end_byte_off = (end_byte_off - filetype_extent) + - flat_file->indices[i] + - flat_file->blocklens[i] - 1; */ - /* equivalent of above commented out equation */ - end_byte_off -= filetype_extent - flat_file->indices[i] - - flat_file->blocklens[i] + 1; - } - else { - sum = 0; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - if (sum >= remainder) { - end_byte_off += flat_file->indices[i] + - flat_file->blocklens[i] - sum + remainder - 1; - break; - } - } - } - } - } - - *st_offset = st_byte_off; - *end_offset = end_byte_off; -#ifdef DEBUG - printf ("st_offset = %lld\nend_offset = %lld\n", - st_byte_off, end_byte_off); -#endif -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5001, 0, NULL); -#endif -} - -/* wrapper function for ADIO_WriteStrided and ADIO_ReadStrided. Used - * by new 2 phase code to pass an arbitrary file type directly to - * WriteStrided call without affecting existing code. For the new 2 - * phase code, we really only need to set a custom_ftype, and we can - * assume that this uses MPI_BYTE for the etype, and disp is 0 */ -void ADIOI_IOFiletype(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Datatype custom_ftype, - int rdwr, ADIO_Status *status, int *error_code) -{ - MPI_Datatype user_filetype; - MPI_Datatype user_etype; - ADIO_Offset user_disp; - int user_ind_wr_buffer_size; - int user_ind_rd_buffer_size; - int f_is_contig, m_is_contig; - int user_ds_read, user_ds_write; - MPI_Aint f_extent, lb; - MPI_Count f_size; - int f_ds_percent; /* size/extent */ - -#ifdef AGGREGATION_PROFILE - if (rdwr == ADIOI_READ) - MPE_Log_event(5006, 0, NULL); - else - MPE_Log_event(5008, 0, NULL); -#endif - MPI_Type_get_extent(custom_ftype, &lb, &f_extent); - MPI_Type_size_x(custom_ftype, &f_size); - f_ds_percent = 100 * f_size / f_extent; - - /* temporarily store file view information */ - user_filetype = fd->filetype; - user_etype = fd->etype; - user_disp = fd->disp; - user_ds_read = fd->hints->ds_read; - user_ds_write = fd->hints->ds_write; - /* temporarily override the independent I/O datasieve buffer size */ - user_ind_wr_buffer_size = fd->hints->ind_wr_buffer_size; - user_ind_rd_buffer_size = fd->hints->ind_rd_buffer_size; - - /* set new values for temporary file view */ - fd->filetype = custom_ftype; - fd->etype = MPI_BYTE; - /* set new values for independent I/O datasieve buffer size */ - fd->hints->ind_wr_buffer_size = fd->hints->cb_buffer_size; - fd->hints->ind_rd_buffer_size = fd->hints->cb_buffer_size; - /* decide whether or not to do datasieving */ -#ifdef DEBUG - printf ("f_ds_percent = %d cb_ds_threshold = %d\n", f_ds_percent, - fd->hints->cb_ds_threshold); -#endif - if (f_ds_percent >= fd->hints->cb_ds_threshold) { - fd->hints->ds_read = ADIOI_HINT_ENABLE; - fd->hints->ds_write = ADIOI_HINT_ENABLE; - } - else { - fd->hints->ds_read = ADIOI_HINT_DISABLE; - fd->hints->ds_write = ADIOI_HINT_DISABLE; - } - - /* flatten the new filetype since the strided calls expect it to - * have been flattened in set file view. in the two phase code, - * the datatype passed down should always be MPI_BYTE, and - * therefore contiguous, but just for completeness sake, we'll - * check the memory datatype anyway */ - ADIOI_Datatype_iscontig(custom_ftype, &f_is_contig); - ADIOI_Datatype_iscontig(datatype, &m_is_contig); - if (!f_is_contig) - ADIOI_Flatten_datatype (custom_ftype); - - /* make appropriate Read/Write calls. Let ROMIO figure out file - * system specific stuff. */ - if (f_is_contig && m_is_contig) { - fd->disp = 0; - if (rdwr == ADIOI_READ) - ADIO_ReadContig(fd, buf, count, datatype, file_ptr_type, offset, - status, error_code); - else - ADIO_WriteContig(fd, buf, count, datatype, file_ptr_type, offset, - status, error_code); - } - else { - fd->disp = offset; - if (rdwr == ADIOI_READ) - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, 0, - status, error_code); - else - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, 0, - status, error_code); - } - - /* Delete flattened temporary filetype */ - if (!f_is_contig) - ADIOI_Delete_flattened (custom_ftype); - - /* restore the user specified file view to cover our tracks */ - fd->filetype = user_filetype; - fd->etype = user_etype; - fd->disp = user_disp; - fd->hints->ds_read = user_ds_read; - fd->hints->ds_write = user_ds_write; - fd->hints->ind_wr_buffer_size = user_ind_wr_buffer_size; - fd->hints->ind_rd_buffer_size = user_ind_rd_buffer_size; -#ifdef AGGREGATION_PROFILE - if (rdwr == ADIOI_READ) - MPE_Log_event (5007, 0, NULL); - else - MPE_Log_event (5009, 0, NULL); -#endif -} - -static void Exch_data_amounts (ADIO_File fd, int nprocs, - ADIO_Offset *client_comm_sz_arr, - ADIO_Offset *agg_comm_sz_arr, - int *client_alltoallw_counts, - int *agg_alltoallw_counts, - int *aggregators_done) -{ - int i; - int recv_idx; - MPI_Request *recv_requests; - MPI_Request *send_requests; - MPI_Status status; - MPI_Status *send_statuses; - /* Aggregators send amounts for data requested to clients */ - if (fd->hints->cb_alltoall != ADIOI_HINT_DISABLE) { - MPI_Alltoall (client_comm_sz_arr, sizeof(ADIO_Offset), MPI_BYTE, - agg_comm_sz_arr, sizeof(ADIO_Offset), MPI_BYTE, - fd->comm); - - if (fd->is_agg) { - for (i=0; i 0) - client_alltoallw_counts[i] = 1; - else - client_alltoallw_counts[i] = 0; - } - *aggregators_done = 0; - for (i=0; i 0) - agg_alltoallw_counts[i] = 1; - else - agg_alltoallw_counts[i] = 0; - } - } else { - /* let's see if we can't reduce some communication as well as - * overlap some communication and work */ - - recv_requests = ADIOI_Malloc (fd->hints->cb_nodes * sizeof(MPI_Request)); - /* post all receives - only receive from aggregators */ - for (i = 0; i < fd->hints->cb_nodes; i++) - MPI_Irecv (&agg_comm_sz_arr[fd->hints->ranklist[i]], - sizeof(ADIO_Offset), MPI_BYTE, fd->hints->ranklist[i], - AMT_TAG, fd->comm, &recv_requests[i]); - - /* Barrier is needed here if we're worried about unexpected - * messages being dropped */ - /* MPI_Barrier (fd->comm); */ - send_requests = NULL; - if (fd->is_agg) { - /* only aggregators send data */ - send_requests = ADIOI_Malloc (nprocs * sizeof(MPI_Request)); - - /* post all sends */ - for (i = 0; i < nprocs; i++) { - MPI_Isend (&client_comm_sz_arr[i], sizeof(ADIO_Offset), - MPI_BYTE, i, AMT_TAG, fd->comm, &send_requests[i]); - - if (client_comm_sz_arr[i] > 0) - client_alltoallw_counts[i] = 1; - else - client_alltoallw_counts[i] = 0; - } - } - - *aggregators_done = 0; - for (i=0; i < fd->hints->cb_nodes; i++) { - MPI_Waitany (fd->hints->cb_nodes, recv_requests, &recv_idx, &status); - if (agg_comm_sz_arr[fd->hints->ranklist[recv_idx]] == -1) - *aggregators_done = *aggregators_done + 1; - else if (agg_comm_sz_arr[fd->hints->ranklist[recv_idx]] > 0) - agg_alltoallw_counts[fd->hints->ranklist[recv_idx]] = 1; - else - agg_alltoallw_counts[fd->hints->ranklist[recv_idx]] = 0; - } - - ADIOI_Free (recv_requests); - if (fd->is_agg) { - /* wait for all sends to complete */ - send_statuses = ADIOI_Malloc (nprocs * sizeof (MPI_Status)); - MPI_Waitall (nprocs, send_requests, send_statuses); - ADIOI_Free (send_requests); - ADIOI_Free (send_statuses); - } - } -} - -static void post_aggregator_comm (MPI_Comm comm, int rw_type, - int nproc, void *cb_buf, - MPI_Datatype *client_comm_dtype_arr, - ADIO_Offset *client_comm_sz_arr, - MPI_Request **requests_p, - int *aggs_client_count_p) -{ - int aggs_client_count = 0; - MPI_Request *requests; - int i; - -#ifdef DEBUG - printf ("posting aggregator communication\n"); -#endif - - for (i=0; i < nproc; i++) - if (client_comm_sz_arr[i] > 0) - aggs_client_count++; -#ifdef DEBUG - printf ("aggregator needs to talk to %d clients\n", - aggs_client_count); -#endif - *aggs_client_count_p = aggs_client_count; - if (aggs_client_count) { - requests = (MPI_Request *) - ADIOI_Malloc (aggs_client_count * sizeof(MPI_Request)); - aggs_client_count = 0; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5032, 0, NULL); -#endif - for (i=0; i < nproc; i++) { - if (client_comm_sz_arr[i] > 0) { - if (rw_type == ADIOI_WRITE) - MPI_Irecv (cb_buf, 1, client_comm_dtype_arr[i], i, - DATA_TAG, comm, - &requests[aggs_client_count]); - else - MPI_Isend (cb_buf, 1, client_comm_dtype_arr[i], i, - DATA_TAG, comm, - &requests[aggs_client_count]); - - aggs_client_count++; - } - } - *requests_p = requests; - } -} - -static void post_client_comm (ADIO_File fd, int rw_type, - int agg_rank, void *buf, - MPI_Datatype agg_comm_dtype, - int agg_alltoallw_count, - MPI_Request *request) -{ - if (agg_alltoallw_count) { - if (rw_type == ADIOI_READ) - MPI_Irecv (buf, 1, agg_comm_dtype, agg_rank, DATA_TAG, fd->comm, - request); - else - MPI_Isend (buf, 1, agg_comm_dtype, agg_rank, DATA_TAG, fd->comm, - request); - } -} - - - diff --git a/3rd-party/romio321/adio/common/ad_iopen.c b/3rd-party/romio321/adio/common/ad_iopen.c deleted file mode 100644 index 5deeaa2cdeb..00000000000 --- a/3rd-party/romio321/adio/common/ad_iopen.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2002 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" - -void ADIO_ImmediateOpen(ADIO_File fd, int *error_code) -{ - MPI_Comm tmp_comm; - tmp_comm = fd->comm; - /* some file systems might try to be clever inside their open routine. - * e.g. Blue Gene does a stat-and-broadcast */ - fd->comm = MPI_COMM_SELF; - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - fd->is_open = 1; - fd->comm = tmp_comm; - -} diff --git a/3rd-party/romio321/adio/common/ad_iread.c b/3rd-party/romio321/adio/common/ad_iread.c deleted file mode 100644 index 74c342ab939..00000000000 --- a/3rd-party/romio321/adio/common/ad_iread.c +++ /dev/null @@ -1,91 +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 "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - -#include "mpiu_greq.h" - -#ifdef ROMIO_HAVE_WORKING_AIO -/* ADIOI_GEN_IreadContig - * - * This code handles two distinct cases. If ROMIO_HAVE_WORKING_AIO is not - * defined, then I/O is performed in a blocking manner. Otherwise we post - * an asynchronous I/O operation using the appropriate aio routines. - * - * In the aio case we rely on ADIOI_GEN_aio(), which is implemented in - * common/ad_iwrite.c. - */ -void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code) -{ - MPI_Count len, typesize; - int aio_errno = 0; - static char myname[] = "ADIOI_GEN_IREADCONTIG"; - - MPI_Type_size_x(datatype, &typesize); - ADIOI_Assert((count * typesize) == ((ADIO_Offset)(unsigned)count * (ADIO_Offset)typesize)); - len = count * typesize; - - if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind; - aio_errno = ADIOI_GEN_aio(fd, buf, len, offset, 0, request); - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; - - fd->fp_sys_posn = -1; - - /* --BEGIN ERROR HANDLING-- */ - if (aio_errno != 0) { - MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code); - return; - } - /* --END ERROR HANDLING-- */ - - *error_code = MPI_SUCCESS; -} -#endif - -/* Generic implementation of IreadStrided calls the blocking ReadStrided - * immediately. - */ -void ADIOI_GEN_IreadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code) -{ - ADIO_Status status; - MPI_Count typesize; - MPI_Offset nbytes=0; - - /* Call the blocking function. It will create an error code - * if necessary. - */ - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - - if (*error_code == MPI_SUCCESS) { - MPI_Type_size_x(datatype, &typesize); - nbytes = (MPI_Offset)count*(MPI_Offset)typesize; - } - MPIO_Completed_request_create(&fd, nbytes, error_code, request); -} diff --git a/3rd-party/romio321/adio/common/ad_iread_coll.c b/3rd-party/romio321/adio/common/ad_iread_coll.c deleted file mode 100644 index 21c21e434f0..00000000000 --- a/3rd-party/romio321/adio/common/ad_iread_coll.c +++ /dev/null @@ -1,1346 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "mpiu_greq.h" -#include "mpioimpl.h" - -#ifdef USE_DBG_LOGGING - #define RDCOLL_DEBUG 1 -#endif -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -#ifdef HAVE_MPI_GREQUEST_EXTENSIONS - -/* ADIOI_GEN_IreadStridedColl */ -struct ADIOI_GEN_IreadStridedColl_vars { - /* requests */ - MPI_Request req_offset[2]; /* ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL */ - MPI_Request req_ind_io; /* ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO */ - - /* parameters */ - ADIO_File fd; - void *buf; - int count; - MPI_Datatype datatype; - int file_ptr_type; - ADIO_Offset offset; - - /* stack variables */ - ADIOI_Access *my_req; - /* array of nprocs structures, one for each other process in - whose file domain this process's request lies */ - - ADIOI_Access *others_req; - /* array of nprocs structures, one for each other process - whose request lies in this process's file domain. */ - - int nprocs; - int nprocs_for_coll; - int myrank; - int contig_access_count; - int interleave_count; - int buftype_is_contig; - int *count_my_req_per_proc; - int count_my_req_procs; - int count_others_req_procs; - ADIO_Offset start_offset; - ADIO_Offset end_offset; - ADIO_Offset orig_fp; - ADIO_Offset fd_size; - ADIO_Offset min_st_offset; - ADIO_Offset *offset_list; - ADIO_Offset *st_offsets; - ADIO_Offset *fd_start; - ADIO_Offset *fd_end; - ADIO_Offset *end_offsets; - ADIO_Offset *len_list; - int *buf_idx; -}; - -/* ADIOI_Iread_and_exch */ -struct ADIOI_Iread_and_exch_vars { - /* requests */ - MPI_Request req1; /* ADIOI_IRC_STATE_IREAD_AND_EXCH */ - MPI_Request req2; /* ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN */ - - /* parameters */ - ADIO_File fd; - void *buf; - MPI_Datatype datatype; - int nprocs; - int myrank; - ADIOI_Access *others_req; - ADIO_Offset *offset_list; - ADIO_Offset *len_list; - int contig_access_count; - ADIO_Offset min_st_offset; - ADIO_Offset fd_size; - ADIO_Offset *fd_start; - ADIO_Offset *fd_end; - int *buf_idx; - - /* stack variables */ - int m; - int ntimes; - int max_ntimes; - int buftype_is_contig; - ADIO_Offset st_loc; - ADIO_Offset end_loc; - ADIO_Offset off; - ADIO_Offset done; - char *read_buf; - int *curr_offlen_ptr; - int *count; - int *send_size; - int *recv_size; - int *partial_send; - int *recd_from_proc; - int *start_pos; - /* Not convinced end_loc-st_loc couldn't be > int, so make these offsets*/ - ADIO_Offset size; - ADIO_Offset real_size; - ADIO_Offset for_curr_iter; - ADIO_Offset for_next_iter; - ADIOI_Flatlist_node *flat_buf; - MPI_Aint buftype_extent; - int coll_bufsize; - - /* next function to be called */ - void (*next_fn)(ADIOI_NBC_Request *, int *); -}; - -/* ADIOI_R_Iexchange_data */ -struct ADIOI_R_Iexchange_data_vars { - /* requests */ - MPI_Request req1; /* ADIOI_IRC_STATE_R_IEXCHANGE_DATA */ - MPI_Request *req2; /* ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV & FILL */ - - /* parameters */ - ADIO_File fd; - void *buf; - ADIOI_Flatlist_node *flat_buf; - ADIO_Offset *offset_list; - ADIO_Offset *len_list; - int *send_size; - int *recv_size; - int *count; - int *start_pos; - int *partial_send; - int *recd_from_proc; - int nprocs; - int myrank; - int buftype_is_contig; - int contig_access_count; - ADIO_Offset min_st_offset; - ADIO_Offset fd_size; - ADIO_Offset *fd_start; - ADIO_Offset *fd_end; - ADIOI_Access *others_req; - int iter; - MPI_Aint buftype_extent; - int *buf_idx; - - /* stack variables */ - int nprocs_recv; - int nprocs_send; - char **recv_buf; - - /* next function to be called */ - void (*next_fn)(ADIOI_NBC_Request *, int *); -}; - - -void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **recv_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, - unsigned *recv_size, - MPI_Request *requests, MPI_Status *statuses, - int *recd_from_proc, int nprocs, - int contig_access_count, - ADIO_Offset min_st_offset, - ADIO_Offset fd_size, ADIO_Offset *fd_start, - ADIO_Offset *fd_end, - MPI_Aint buftype_extent); - -/* prototypes of functions used for nonblocking collective reads only. */ -static void ADIOI_GEN_IreadStridedColl_inter(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IreadStridedColl_indio(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IreadStridedColl_read(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IreadStridedColl_free(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IreadStridedColl_fini(ADIOI_NBC_Request *, int *); - -static void ADIOI_Iread_and_exch(ADIOI_NBC_Request *, int *); -static void ADIOI_Iread_and_exch_l1_begin(ADIOI_NBC_Request *, int *); -static void ADIOI_Iread_and_exch_l1_end(ADIOI_NBC_Request *, int *); -static void ADIOI_Iread_and_exch_reset(ADIOI_NBC_Request *, int *); -static void ADIOI_Iread_and_exch_l2_begin(ADIOI_NBC_Request *, int *); -static void ADIOI_Iread_and_exch_l2_end(ADIOI_NBC_Request *, int *); -static void ADIOI_Iread_and_exch_fini(ADIOI_NBC_Request *, int *); - -static void ADIOI_R_Iexchange_data(ADIOI_NBC_Request *, int *); -static void ADIOI_R_Iexchange_data_recv(ADIOI_NBC_Request *, int *); -static void ADIOI_R_Iexchange_data_fill(ADIOI_NBC_Request *, int *); -static void ADIOI_R_Iexchange_data_fini(ADIOI_NBC_Request *, int *); - -static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; -static int ADIOI_GEN_irc_query_fn(void *extra_state, MPI_Status *status); -static int ADIOI_GEN_irc_free_fn(void *extra_state); -static int ADIOI_GEN_irc_poll_fn(void *extra_state, MPI_Status *status); -static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states, - double timeout, MPI_Status *status); - - -/* Nonblocking version of ADIOI_GEN_ReadStridedColl() */ -void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code) -{ - /* Uses a generalized version of the extended two-phase method described - in "An Extended Two-Phase Method for Accessing Sections of - Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, - Scientific Programming, (5)4:301--317, Winter 1996. - http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ - - ADIOI_NBC_Request *nbc_req = NULL; - ADIOI_GEN_IreadStridedColl_vars *vars = NULL; - int nprocs, myrank; -#ifdef RDCOLL_DEBUG - int i; -#endif - - /* FIXME: need an implementation of ADIOI_IOIstridedColl - if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { - ADIOI_IOIstridedColl(fd, buf, count, ADIOI_READ, datatype, - file_ptr_type, offset, request, error_code); - return; - } - */ - - /* top-level struct keeping the status of function progress */ - nbc_req = (ADIOI_NBC_Request *)ADIOI_Calloc(1, sizeof(ADIOI_NBC_Request)); - nbc_req->rdwr = ADIOI_READ; - - /* create a generalized request */ - if (ADIOI_GEN_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_irc_query_fn, - ADIOI_GEN_irc_free_fn, MPIU_Greq_cancel_fn, - ADIOI_GEN_irc_poll_fn, ADIOI_GEN_irc_wait_fn, - &ADIOI_GEN_greq_class); - } - MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, nbc_req, request); - memcpy(&nbc_req->req, request, sizeof(MPI_Request)); - - /* create a struct for parameters and variables */ - vars = (ADIOI_GEN_IreadStridedColl_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_GEN_IreadStridedColl_vars)); - nbc_req->data.rd.rsc_vars = vars; - - /* save the parameters */ - vars->fd = fd; - vars->buf = buf; - vars->count = count; - vars->datatype = datatype; - vars->file_ptr_type = file_ptr_type; - vars->offset = offset; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - vars->nprocs = nprocs; - vars->myrank = myrank; - - /* number of aggregators, cb_nodes, is stored in the hints */ - vars->nprocs_for_coll = fd->hints->cb_nodes; - vars->orig_fp = fd->fp_ind; - - /* only check for interleaving if cb_read isn't disabled */ - if (fd->hints->cb_read != ADIOI_HINT_DISABLE) { - /* For this process's request, calculate the list of offsets and - lengths in the file and determine the start and end offsets. */ - - /* Note: end_offset points to the last byte-offset that will be accessed. - e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/ - - ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, - &vars->offset_list, &vars->len_list, - &vars->start_offset, &vars->end_offset, - &vars->contig_access_count); - -#ifdef RDCOLL_DEBUG - for (i = 0; i < vars->contig_access_count; i++) { - DBG_FPRINTF(stderr, "rank %d off %lld len %lld\n", - myrank, vars->offset_list[i], vars->len_list[i]); - } -#endif - - /* each process communicates its start and end offsets to other - processes. The result is an array each of start and end offsets - stored in order of process rank. */ - - vars->st_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); - vars->end_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); - - *error_code = MPI_Iallgather(&vars->start_offset, 1, ADIO_OFFSET, - vars->st_offsets, 1, ADIO_OFFSET, - fd->comm, &vars->req_offset[0]); - if (*error_code != MPI_SUCCESS) return; - *error_code = MPI_Iallgather(&vars->end_offset, 1, ADIO_OFFSET, - vars->end_offsets, 1, ADIO_OFFSET, - fd->comm, &vars->req_offset[1]); - - nbc_req->data.rd.state = ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL; - return; - } - - ADIOI_GEN_IreadStridedColl_indio(nbc_req, error_code); -} - -static void ADIOI_GEN_IreadStridedColl_inter(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; - int nprocs = vars->nprocs; - ADIO_Offset *st_offsets = vars->st_offsets; - ADIO_Offset *end_offsets = vars->end_offsets; - int i, interleave_count = 0; - - /* are the accesses of different processes interleaved? */ - for (i = 1; i < nprocs; i++) - if ((st_offsets[i] < end_offsets[i-1]) && - (st_offsets[i] <= end_offsets[i])) - interleave_count++; - /* This is a rudimentary check for interleaving, but should suffice - for the moment. */ - - vars->interleave_count = interleave_count; - - ADIOI_GEN_IreadStridedColl_indio(nbc_req, error_code); -} - -static void ADIOI_GEN_IreadStridedColl_indio(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; - ADIOI_Icalc_others_req_vars *cor_vars = NULL; - ADIO_File fd = vars->fd; - void *buf; - int count, file_ptr_type; - MPI_Datatype datatype = vars->datatype; - ADIO_Offset offset; - int filetype_is_contig; - ADIO_Offset off; - int nprocs; - - ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); - - if (fd->hints->cb_read == ADIOI_HINT_DISABLE - || (!vars->interleave_count && (fd->hints->cb_read == ADIOI_HINT_AUTO))) - { - buf = vars->buf; - count = vars->count; - file_ptr_type = vars->file_ptr_type; - offset = vars->offset; - - /* don't do aggregation */ - if (fd->hints->cb_read != ADIOI_HINT_DISABLE) { - ADIOI_Free(vars->offset_list); - ADIOI_Free(vars->len_list); - ADIOI_Free(vars->st_offsets); - ADIOI_Free(vars->end_offsets); - } - - fd->fp_ind = vars->orig_fp; - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - -#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) - /* NOTE: This is currently a workaround to avoid weird errors, e.g., - * stack fault, occurred on Linux. When the host OS is Linux and - * aio-lite is not used, a blocking ADIO function is used here. - * See https://trac.mpich.org/projects/mpich/ticket/2201. */ - MPI_Status status; - if (vars->buftype_is_contig && filetype_is_contig) { - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + (fd->etype_size) * offset; - ADIO_ReadContig(fd, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, &status, error_code); - } - else ADIO_ReadContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, - 0, &status, error_code); - } - else { - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - } - ADIOI_GEN_IreadStridedColl_fini(nbc_req, error_code); -#else - if (vars->buftype_is_contig && filetype_is_contig) { - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + (fd->etype_size) * offset; - ADIO_IreadContig(fd, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, &vars->req_ind_io, error_code); - } - else ADIO_IreadContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, - 0, &vars->req_ind_io, error_code); - } - else { - ADIO_IreadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &vars->req_ind_io, error_code); - } - - nbc_req->data.rd.state = ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO; -#endif - return; - } - - nprocs = vars->nprocs; - - /* We're going to perform aggregation of I/O. Here we call - * ADIOI_Calc_file_domains() to determine what processes will handle I/O - * to what regions. We pass nprocs_for_coll into this function; it is - * used to determine how many processes will perform I/O, which is also - * the number of regions into which the range of bytes must be divided. - * These regions are called "file domains", or FDs. - * - * When this function returns, fd_start, fd_end, fd_size, and - * min_st_offset will be filled in. fd_start holds the starting byte - * location for each file domain. fd_end holds the ending byte location. - * min_st_offset holds the minimum byte location that will be accessed. - * - * Both fd_start[] and fd_end[] are indexed by an aggregator number; this - * needs to be mapped to an actual rank in the communicator later. - * - */ - ADIOI_Calc_file_domains(vars->st_offsets, vars->end_offsets, nprocs, - vars->nprocs_for_coll, &vars->min_st_offset, - &vars->fd_start, &vars->fd_end, - fd->hints->min_fdomain_size, &vars->fd_size, - fd->hints->striping_unit); - - /* calculate where the portions of the access requests of this process - * are located in terms of the file domains. this could be on the same - * process or on other processes. this function fills in: - * count_my_req_procs - number of processes (including this one) for which - * this process has requests in their file domain - * count_my_req_per_proc - count of requests for each process, indexed - * by rank of the process - * my_req[] - array of data structures describing the requests to be - * performed by each process (including self). indexed by rank. - * buf_idx[] - array of locations into which data can be directly moved; - * this is only valid for contiguous buffer case - */ - ADIOI_Calc_my_req(fd, vars->offset_list, vars->len_list, - vars->contig_access_count, vars->min_st_offset, - vars->fd_start, vars->fd_end, vars->fd_size, - nprocs, &vars->count_my_req_procs, - &vars->count_my_req_per_proc, &vars->my_req, - &vars->buf_idx); - - /* perform a collective communication in order to distribute the - * data calculated above. fills in the following: - * count_others_req_procs - number of processes (including this - * one) which have requests in this process's file domain. - * count_others_req_per_proc[] - number of separate contiguous - * requests from proc i lie in this process's file domain. - */ - - cor_vars = (ADIOI_Icalc_others_req_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_Icalc_others_req_vars)); - nbc_req->cor_vars = cor_vars; - cor_vars->fd = vars->fd; - cor_vars->count_my_req_procs = vars->count_my_req_procs; - cor_vars->count_my_req_per_proc = vars->count_my_req_per_proc; - cor_vars->my_req = vars->my_req; - cor_vars->nprocs = vars->nprocs; - cor_vars->myrank = vars->myrank; - cor_vars->count_others_req_procs_ptr = &vars->count_others_req_procs; - cor_vars->others_req_ptr = &vars->others_req; - cor_vars->next_fn = ADIOI_GEN_IreadStridedColl_read; - - ADIOI_Icalc_others_req(nbc_req, error_code); -} - -static void ADIOI_GEN_IreadStridedColl_read(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; - ADIOI_Iread_and_exch_vars *rae_vars = NULL; - ADIOI_Access *my_req = vars->my_req; - int nprocs = vars->nprocs; - int i; - - /* my_req[] and count_my_req_per_proc aren't needed at this point, so - * let's free the memory - */ - ADIOI_Free(vars->count_my_req_per_proc); - for (i = 0; i < nprocs; i++) { - if (my_req[i].count) { - ADIOI_Free(my_req[i].offsets); - ADIOI_Free(my_req[i].lens); - } - } - ADIOI_Free(my_req); - - /* read data in sizes of no more than ADIOI_Coll_bufsize, - * communicate, and fill user buf. - */ - rae_vars = (ADIOI_Iread_and_exch_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_Iread_and_exch_vars)); - nbc_req->data.rd.rae_vars = rae_vars; - rae_vars->fd = vars->fd; - rae_vars->buf = vars->buf; - rae_vars->datatype = vars->datatype; - rae_vars->nprocs = vars->nprocs; - rae_vars->myrank = vars->myrank; - rae_vars->others_req = vars->others_req; - rae_vars->offset_list = vars->offset_list; - rae_vars->len_list = vars->len_list; - rae_vars->contig_access_count = vars->contig_access_count; - rae_vars->min_st_offset = vars->min_st_offset; - rae_vars->fd_size = vars->fd_size; - rae_vars->fd_start = vars->fd_start; - rae_vars->fd_end = vars->fd_end; - rae_vars->buf_idx = vars->buf_idx; - rae_vars->next_fn = ADIOI_GEN_IreadStridedColl_free; - - ADIOI_Iread_and_exch(nbc_req, error_code); -} - -static void ADIOI_GEN_IreadStridedColl_free(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; - ADIO_File fd = vars->fd; - MPI_Datatype datatype = vars->datatype; - ADIOI_Access *others_req = vars->others_req; - int nprocs = vars->nprocs; - int i; - - if (!vars->buftype_is_contig) ADIOI_Delete_flattened(datatype); - - /* free all memory allocated for collective I/O */ - for (i = 0; i < nprocs; i++) { - if (others_req[i].count) { - ADIOI_Free(others_req[i].offsets); - ADIOI_Free(others_req[i].lens); - ADIOI_Free(others_req[i].mem_ptrs); - } - } - ADIOI_Free(others_req); - - ADIOI_Free(vars->buf_idx); - ADIOI_Free(vars->offset_list); - ADIOI_Free(vars->len_list); - ADIOI_Free(vars->st_offsets); - ADIOI_Free(vars->end_offsets); - ADIOI_Free(vars->fd_start); - ADIOI_Free(vars->fd_end); - - fd->fp_sys_posn = -1; /* set it to null. */ - - ADIOI_GEN_IreadStridedColl_fini(nbc_req, error_code); -} - -static void ADIOI_GEN_IreadStridedColl_fini(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IreadStridedColl_vars *vars = nbc_req->data.rd.rsc_vars; - MPI_Count size; - - /* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually read and placed in buf - during collective I/O. */ - MPI_Type_size_x(vars->datatype, &size); - nbc_req->nbytes = size * vars->count; - - /* free the struct for parameters and variables */ - if (nbc_req->data.rd.rsc_vars) { - ADIOI_Free(nbc_req->data.rd.rsc_vars); - nbc_req->data.rd.rsc_vars = NULL; - } - - /* make the request complete */ - *error_code = MPI_Grequest_complete(nbc_req->req); - nbc_req->data.rd.state = ADIOI_IRC_STATE_COMPLETE; -} - - -static void ADIOI_Iread_and_exch(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - ADIO_File fd = vars->fd; - MPI_Datatype datatype = vars->datatype; - int nprocs = vars->nprocs; - MPI_Aint lb; - ADIOI_Access *others_req = vars->others_req; - - /* Read in sizes of no more than coll_bufsize, an info parameter. - Send data to appropriate processes. - Place recd. data in user buf. - The idea is to reduce the amount of extra memory required for - collective I/O. If all data were read all at once, which is much - easier, it would require temp space more than the size of user_buf, - which is often unacceptable. For example, to read a distributed - array from a file, where each local array is 8Mbytes, requiring - at least another 8Mbytes of temp space is unacceptable. */ - - int i, j; - ADIO_Offset st_loc = -1, end_loc = -1; - int coll_bufsize; - - *error_code = MPI_SUCCESS; /* changed below if error */ - /* only I/O errors are currently reported */ - - /* calculate the number of reads of size coll_bufsize - to be done by each process and the max among all processes. - That gives the no. of communication phases as well. - coll_bufsize is obtained from the hints object. */ - - coll_bufsize = fd->hints->cb_buffer_size; - vars->coll_bufsize = coll_bufsize; - - /* grab some initial values for st_loc and end_loc */ - for (i = 0; i < nprocs; i++) { - if (others_req[i].count) { - st_loc = others_req[i].offsets[0]; - end_loc = others_req[i].offsets[0]; - break; - } - } - - /* now find the real values */ - for (i = 0; i < nprocs; i++) - for (j = 0; j < others_req[i].count; j++) { - st_loc = ADIOI_MIN(st_loc, others_req[i].offsets[j]); - end_loc = ADIOI_MAX(end_loc, (others_req[i].offsets[j] - + others_req[i].lens[j] - 1)); - } - - vars->st_loc = st_loc; - vars->end_loc = end_loc; - - /* calculate ntimes, the number of times this process must perform I/O - * operations in order to complete all the requests it has received. - * the need for multiple I/O operations comes from the restriction that - * we only use coll_bufsize bytes of memory for internal buffering. - */ - if ((st_loc == -1) && (end_loc == -1)) { - /* this process does no I/O. */ - vars->ntimes = 0; - } - else { - /* ntimes=ceiling_div(end_loc - st_loc + 1, coll_bufsize)*/ - vars->ntimes = (int)((end_loc - st_loc + coll_bufsize) / coll_bufsize); - } - - *error_code = MPI_Iallreduce(&vars->ntimes, &vars->max_ntimes, 1, MPI_INT, - MPI_MAX, fd->comm, &vars->req1); - - vars->read_buf = fd->io_buf; /* Allocated at open time */ - - vars->curr_offlen_ptr = (int *)ADIOI_Calloc(nprocs, sizeof(int)); - /* its use is explained below. calloc initializes to 0. */ - - vars->count = (int *)ADIOI_Malloc(nprocs * sizeof(int)); - /* to store count of how many off-len pairs per proc are satisfied - in an iteration. */ - - vars->partial_send = (int *)ADIOI_Calloc(nprocs, sizeof(int)); - /* if only a portion of the last off-len pair is sent to a process - in a particular iteration, the length sent is stored here. - calloc initializes to 0. */ - - vars->send_size = (int *)ADIOI_Malloc(nprocs * sizeof(int)); - /* total size of data to be sent to each proc. in an iteration */ - - vars->recv_size = (int *)ADIOI_Malloc(nprocs * sizeof(int)); - /* total size of data to be recd. from each proc. in an iteration. - Of size nprocs so that I can use MPI_Alltoall later. */ - - vars->recd_from_proc = (int *)ADIOI_Calloc(nprocs, sizeof(int)); - /* amount of data recd. so far from each proc. Used in - ADIOI_Fill_user_buffer. initialized to 0 here. */ - - vars->start_pos = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - /* used to store the starting value of curr_offlen_ptr[i] in - this iteration */ - - ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); - if (!vars->buftype_is_contig) { - vars->flat_buf = ADIOI_Flatten_and_find(datatype); - } - MPI_Type_get_extent(datatype, &lb, &vars->buftype_extent); - - vars->done = 0; - vars->off = st_loc; - vars->for_curr_iter = vars->for_next_iter = 0; - - /* set the state to wait until MPI_Ialltoall finishes. */ - nbc_req->data.rd.state = ADIOI_IRC_STATE_IREAD_AND_EXCH; -} - -static void ADIOI_Iread_and_exch_l1_begin(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - ADIO_File fd; - int nprocs; - ADIOI_Access *others_req; - - int i, j; - ADIO_Offset real_off, req_off; - char *read_buf; - int *curr_offlen_ptr, *count, *send_size; - int *partial_send, *start_pos; - ADIO_Offset size, real_size, for_next_iter; - int req_len, flag; - - ADIOI_R_Iexchange_data_vars *red_vars = NULL; - - /* loop exit condition */ - if (vars->m >= vars->ntimes) { - ADIOI_Iread_and_exch_reset(nbc_req, error_code); - return; - } - - fd = vars->fd; - nprocs = vars->nprocs; - others_req = vars->others_req; - - read_buf = vars->read_buf; - curr_offlen_ptr = vars->curr_offlen_ptr; - count = vars->count; - send_size = vars->send_size; - partial_send = vars->partial_send; - start_pos = vars->start_pos; - - /* read buf of size coll_bufsize (or less) */ - /* go through all others_req and check if any are satisfied - by the current read */ - - /* since MPI guarantees that displacements in filetypes are in - monotonically nondecreasing order, I can maintain a pointer - (curr_offlen_ptr) to - current off-len pair for each process in others_req and scan - further only from there. There is still a problem of filetypes - such as: (1, 2, 3 are not process nos. They are just numbers for - three chunks of data, specified by a filetype.) - - 1 -------!-- - 2 -----!---- - 3 --!----- - - where ! indicates where the current read_size limitation cuts - through the filetype. I resolve this by reading up to !, but - filling the communication buffer only for 1. I copy the portion - left over for 2 into a tmp_buf for use in the next - iteration. i.e., 2 and 3 will be satisfied in the next - iteration. This simplifies filling in the user's buf at the - other end, as only one off-len pair with incomplete data - will be sent. I also don't need to send the individual - offsets and lens along with the data, as the data is being - sent in a particular order. */ - - /* off = start offset in the file for the data actually read in - this iteration - size = size of data read corresponding to off - real_off = off minus whatever data was retained in memory from - previous iteration for cases like 2, 3 illustrated above - real_size = size plus the extra corresponding to real_off - req_off = off in file for a particular contiguous request - minus what was satisfied in previous iteration - req_size = size corresponding to req_off */ - - size = ADIOI_MIN((unsigned)vars->coll_bufsize, - vars->end_loc - vars->st_loc + 1 - vars->done); - real_off = vars->off - vars->for_curr_iter; - real_size = size + vars->for_curr_iter; - - vars->size = size; - vars->real_size = real_size; - - for (i = 0; i < nprocs; i++) count[i] = send_size[i] = 0; - for_next_iter = 0; - - for (i = 0; i < nprocs; i++) { -#ifdef RDCOLL_DEBUG - DBG_FPRINTF(stderr, "rank %d, i %d, others_count %d\n", - vars->myrank, i, others_req[i].count); -#endif - if (others_req[i].count) { - start_pos[i] = curr_offlen_ptr[i]; - for (j = curr_offlen_ptr[i]; j < others_req[i].count; j++) { - if (partial_send[i]) { - /* this request may have been partially - satisfied in the previous iteration. */ - req_off = others_req[i].offsets[j] + partial_send[i]; - req_len = others_req[i].lens[j] - partial_send[i]; - partial_send[i] = 0; - /* modify the off-len pair to reflect this change */ - others_req[i].offsets[j] = req_off; - others_req[i].lens[j] = req_len; - } - else { - req_off = others_req[i].offsets[j]; - req_len = others_req[i].lens[j]; - } - if (req_off < real_off + real_size) { - count[i]++; - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)read_buf) + req_off - real_off) == (ADIO_Offset)(MPIU_Upint)(read_buf + req_off - real_off)); - MPI_Get_address(read_buf + req_off - real_off, - &(others_req[i].mem_ptrs[j])); - ADIOI_Assert((real_off + real_size - req_off) == (int)(real_off + real_size - req_off)); - send_size[i] += (int)(ADIOI_MIN(real_off + real_size - req_off, - (ADIO_Offset)(unsigned)req_len)); - - if (real_off + real_size - req_off < (ADIO_Offset)(unsigned)req_len) { - partial_send[i] = (int)(real_off + real_size - req_off); - if ((j+1 < others_req[i].count) && - (others_req[i].offsets[j+1] < real_off + real_size)) { - /* this is the case illustrated in the - figure above. */ - for_next_iter = ADIOI_MAX(for_next_iter, - real_off + real_size - others_req[i].offsets[j+1]); - /* max because it must cover requests - from different processes */ - } - break; - } - } - else break; - } - curr_offlen_ptr[i] = j; - } - } - vars->for_next_iter = for_next_iter; - - flag = 0; - for (i = 0; i < nprocs; i++) - if (count[i]) flag = 1; - - /* create a struct for ADIOI_R_Iexchange_data() */ - red_vars = (ADIOI_R_Iexchange_data_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_R_Iexchange_data_vars)); - nbc_req->data.rd.red_vars = red_vars; - red_vars->fd = vars->fd; - red_vars->buf = vars->buf; - red_vars->flat_buf = vars->flat_buf; - red_vars->offset_list = vars->offset_list; - red_vars->len_list = vars->len_list; - red_vars->send_size = vars->send_size; - red_vars->recv_size = vars->recv_size; - red_vars->count = vars->count; - red_vars->start_pos = vars->start_pos; - red_vars->partial_send = vars->partial_send; - red_vars->recd_from_proc = vars->recd_from_proc; - red_vars->nprocs = vars->nprocs; - red_vars->myrank = vars->myrank; - red_vars->buftype_is_contig = vars->buftype_is_contig; - red_vars->contig_access_count = vars->contig_access_count; - red_vars->min_st_offset = vars->min_st_offset; - red_vars->fd_size = vars->fd_size; - red_vars->fd_start = vars->fd_start; - red_vars->fd_end = vars->fd_end; - red_vars->others_req = vars->others_req; - red_vars->iter = vars->m; - red_vars->buftype_extent = vars->buftype_extent; - red_vars->buf_idx = vars->buf_idx; - red_vars->next_fn = ADIOI_Iread_and_exch_l1_end; - - if (flag) { - ADIOI_Assert(size == (int)size); -#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) - MPI_Status status; - ADIO_ReadContig(fd, read_buf+vars->for_curr_iter, (int)size, - MPI_BYTE, ADIO_EXPLICIT_OFFSET, vars->off, - &status, error_code); -#else - ADIO_IreadContig(fd, read_buf+vars->for_curr_iter, (int)size, - MPI_BYTE, ADIO_EXPLICIT_OFFSET, vars->off, - &vars->req2, error_code); - - nbc_req->data.rd.state = ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN; - return; -#endif - } - - ADIOI_R_Iexchange_data(nbc_req, error_code); -} - -static void ADIOI_Iread_and_exch_l1_end(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - ADIO_File fd = vars->fd; - ADIO_Offset size = vars->size; - ADIO_Offset real_size = vars->real_size; - ADIO_Offset for_next_iter = vars->for_next_iter; - char *read_buf = vars->read_buf; - char *tmp_buf; - - vars->for_curr_iter = for_next_iter; - - if (for_next_iter) { - tmp_buf = (char *)ADIOI_Malloc(for_next_iter); - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)read_buf)+real_size-for_next_iter) == (ADIO_Offset)(MPIU_Upint)(read_buf+real_size-for_next_iter)); - ADIOI_Assert((for_next_iter+vars->coll_bufsize) == (size_t)(for_next_iter+vars->coll_bufsize)); - memcpy(tmp_buf, read_buf+real_size-for_next_iter, for_next_iter); - ADIOI_Free(fd->io_buf); - fd->io_buf = (char *)ADIOI_Malloc(for_next_iter+vars->coll_bufsize); - memcpy(fd->io_buf, tmp_buf, for_next_iter); - vars->read_buf = fd->io_buf; - ADIOI_Free(tmp_buf); - } - - vars->off += size; - vars->done += size; - - /* increment m and go back to the beginning of m loop */ - vars->m++; - ADIOI_Iread_and_exch_l1_begin(nbc_req, error_code); -} - -static void ADIOI_Iread_and_exch_reset(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - int nprocs = vars->nprocs; - int *count = vars->count; - int *send_size = vars->send_size; - int i; - - for (i = 0; i < nprocs; i++) count[i] = send_size[i] = 0; - - vars->m = vars->ntimes; - ADIOI_Iread_and_exch_l2_begin(nbc_req, error_code); -} - -static void ADIOI_Iread_and_exch_l2_begin(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - ADIOI_R_Iexchange_data_vars *red_vars = NULL; - - /* loop exit condition */ - if (vars->m >= vars->max_ntimes) { - ADIOI_Iread_and_exch_fini(nbc_req, error_code); - return; - } - - /* create a struct for ADIOI_R_Iexchange_data() */ - red_vars = (ADIOI_R_Iexchange_data_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_R_Iexchange_data_vars)); - nbc_req->data.rd.red_vars = red_vars; - red_vars->fd = vars->fd; - red_vars->buf = vars->buf; - red_vars->flat_buf = vars->flat_buf; - red_vars->offset_list = vars->offset_list; - red_vars->len_list = vars->len_list; - red_vars->send_size = vars->send_size; - red_vars->recv_size = vars->recv_size; - red_vars->count = vars->count; - red_vars->start_pos = vars->start_pos; - red_vars->partial_send = vars->partial_send; - red_vars->recd_from_proc = vars->recd_from_proc; - red_vars->nprocs = vars->nprocs; - red_vars->myrank = vars->myrank; - red_vars->buftype_is_contig = vars->buftype_is_contig; - red_vars->contig_access_count = vars->contig_access_count; - red_vars->min_st_offset = vars->min_st_offset; - red_vars->fd_size = vars->fd_size; - red_vars->fd_start = vars->fd_start; - red_vars->fd_end = vars->fd_end; - red_vars->others_req = vars->others_req; - red_vars->iter = vars->m; - red_vars->buftype_extent = vars->buftype_extent; - red_vars->buf_idx = vars->buf_idx; - red_vars->next_fn = ADIOI_Iread_and_exch_l2_end; - - ADIOI_R_Iexchange_data(nbc_req, error_code); -} - -static void ADIOI_Iread_and_exch_l2_end(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - - vars->m++; - ADIOI_Iread_and_exch_l2_begin(nbc_req, error_code); -} - -static void ADIOI_Iread_and_exch_fini(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Iread_and_exch_vars *vars = nbc_req->data.rd.rae_vars; - void (*next_fn)(ADIOI_NBC_Request *, int *); - - ADIOI_Free(vars->curr_offlen_ptr); - ADIOI_Free(vars->count); - ADIOI_Free(vars->partial_send); - ADIOI_Free(vars->send_size); - ADIOI_Free(vars->recv_size); - ADIOI_Free(vars->recd_from_proc); - ADIOI_Free(vars->start_pos); - - next_fn = vars->next_fn; - - /* free the struct for parameters and variables */ - ADIOI_Free(nbc_req->data.rd.rae_vars); - nbc_req->data.rd.rae_vars = NULL; - - /* move to the next function */ - next_fn(nbc_req, error_code); -} - - -static void ADIOI_R_Iexchange_data(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; - - /* exchange send_size info so that each process knows how much to - receive from whom and how much memory to allocate. */ - *error_code = MPI_Ialltoall(vars->send_size, 1, MPI_INT, vars->recv_size, 1, - MPI_INT, vars->fd->comm, &vars->req1); - - nbc_req->data.rd.state = ADIOI_IRC_STATE_R_IEXCHANGE_DATA; -} - -static void ADIOI_R_Iexchange_data_recv(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; - ADIO_File fd = vars->fd; - int *send_size = vars->send_size; - int *recv_size = vars->recv_size; - int *count = vars->count; - int *start_pos = vars->start_pos; - int *partial_send = vars->partial_send; - int nprocs = vars->nprocs; - int myrank = vars->myrank; - ADIOI_Access *others_req = vars->others_req; - int iter = vars->iter; - int *buf_idx = vars->buf_idx; - - int i, j, k = 0, tmp = 0, nprocs_recv, nprocs_send; - char **recv_buf = NULL; - MPI_Datatype send_type; - - nprocs_recv = 0; - for (i = 0; i < nprocs; i++) if (recv_size[i]) nprocs_recv++; - vars->nprocs_recv = nprocs_recv; - - nprocs_send = 0; - for (i = 0; i < nprocs; i++) if (send_size[i]) nprocs_send++; - vars->nprocs_send = nprocs_send; - - vars->req2 = (MPI_Request *) - ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); - /* +1 to avoid a 0-size malloc */ - - /* post recvs. if buftype_is_contig, data can be directly recd. into - user buf at location given by buf_idx. else use recv_buf. */ - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5032, 0, NULL); -#endif - - if (vars->buftype_is_contig) { - j = 0; - for (i = 0; i < nprocs; i++) - if (recv_size[i]) { - MPI_Irecv(((char *)vars->buf) + buf_idx[i], recv_size[i], - MPI_BYTE, i, myrank+i+100*iter, fd->comm, - vars->req2 + j); - j++; - buf_idx[i] += recv_size[i]; - } - } - else { - /* allocate memory for recv_buf and post receives */ - recv_buf = (char **) ADIOI_Malloc(nprocs * sizeof(char*)); - vars->recv_buf = recv_buf; - for (i = 0; i < nprocs; i++) - if (recv_size[i]) recv_buf[i] = (char *)ADIOI_Malloc(recv_size[i]); - - j = 0; - for (i = 0; i < nprocs; i++) - if (recv_size[i]) { - MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, - myrank+i+100*iter, fd->comm, - vars->req2 + j); - j++; -#ifdef RDCOLL_DEBUG - DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", - myrank, recv_size[i], myrank+i+100*iter); -#endif - } - } - - /* create derived datatypes and send data */ - - j = 0; - for (i = 0; i < nprocs; i++) { - if (send_size[i]) { - /* take care if the last off-len pair is a partial send */ - if (partial_send[i]) { - k = start_pos[i] + count[i] - 1; - tmp = others_req[i].lens[k]; - others_req[i].lens[k] = partial_send[i]; - } - ADIOI_Type_create_hindexed_x(count[i], - &(others_req[i].lens[start_pos[i]]), - &(others_req[i].mem_ptrs[start_pos[i]]), - MPI_BYTE, &send_type); - /* absolute displacement; use MPI_BOTTOM in send */ - MPI_Type_commit(&send_type); - MPI_Isend(MPI_BOTTOM, 1, send_type, i, myrank+i+100*iter, - fd->comm, vars->req2 + nprocs_recv + j); - MPI_Type_free(&send_type); - if (partial_send[i]) others_req[i].lens[k] = tmp; - j++; - } - } - - /* wait on the receives */ - if (nprocs_recv) { - nbc_req->data.rd.state = ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV; - return; - } - - ADIOI_R_Iexchange_data_fill(nbc_req, error_code); -} - -static void ADIOI_R_Iexchange_data_fill(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; - - if (vars->nprocs_recv) { - /* if noncontiguous, to the copies from the recv buffers */ - if (!vars->buftype_is_contig) - ADIOI_Fill_user_buffer(vars->fd, vars->buf, vars->flat_buf, - vars->recv_buf, vars->offset_list, vars->len_list, - (unsigned*)vars->recv_size, - vars->req2, NULL, vars->recd_from_proc, - vars->nprocs, vars->contig_access_count, - vars->min_st_offset, vars->fd_size, vars->fd_start, - vars->fd_end, vars->buftype_extent); - } - - nbc_req->data.rd.state = ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL; -} - -static void ADIOI_R_Iexchange_data_fini(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_R_Iexchange_data_vars *vars = nbc_req->data.rd.red_vars; - void (*next_fn)(ADIOI_NBC_Request *, int *); - int i; - - ADIOI_Free(vars->req2); - - if (!vars->buftype_is_contig) { - for (i = 0; i < vars->nprocs; i++) - if (vars->recv_size[i]) ADIOI_Free(vars->recv_buf[i]); - ADIOI_Free(vars->recv_buf); - } -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5033, 0, NULL); -#endif - - next_fn = vars->next_fn; - - /* free the structure for parameters and variables */ - ADIOI_Free(vars); - nbc_req->data.rd.red_vars = NULL; - - /* move to the next function */ - next_fn(nbc_req, error_code); -} - - -static int ADIOI_GEN_irc_query_fn(void *extra_state, MPI_Status *status) -{ - ADIOI_NBC_Request *nbc_req; - - nbc_req = (ADIOI_NBC_Request *)extra_state; - - MPI_Status_set_elements_x(status, MPI_BYTE, nbc_req->nbytes); - - /* can never cancel so always true */ - MPI_Status_set_cancelled(status, 0); - - /* choose not to return a value for this */ - status->MPI_SOURCE = MPI_UNDEFINED; - /* tag has no meaning for this generalized request */ - status->MPI_TAG = MPI_UNDEFINED; - - /* this generalized request never fails */ - return MPI_SUCCESS; -} - -static int ADIOI_GEN_irc_free_fn(void *extra_state) -{ - ADIOI_NBC_Request *nbc_req; - - nbc_req = (ADIOI_NBC_Request *)extra_state; - ADIOI_Free(nbc_req); - - return MPI_SUCCESS; -} - -static int ADIOI_GEN_irc_poll_fn(void *extra_state, MPI_Status *status) -{ - ADIOI_NBC_Request *nbc_req; - ADIOI_GEN_IreadStridedColl_vars *rsc_vars = NULL; - ADIOI_Icalc_others_req_vars *cor_vars = NULL; - ADIOI_Iread_and_exch_vars *rae_vars = NULL; - ADIOI_R_Iexchange_data_vars *red_vars = NULL; - int errcode = MPI_SUCCESS; - int flag; - - nbc_req = (ADIOI_NBC_Request *)extra_state; - - switch (nbc_req->data.rd.state) { - case ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL: - rsc_vars = nbc_req->data.rd.rsc_vars; - errcode = MPI_Testall(2, rsc_vars->req_offset, &flag, - MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_GEN_IreadStridedColl_inter(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO: - rsc_vars = nbc_req->data.rd.rsc_vars; - errcode = MPI_Test(&rsc_vars->req_ind_io, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - /* call the last function */ - ADIOI_GEN_IreadStridedColl_fini(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_ICALC_OTHERS_REQ: - cor_vars = nbc_req->cor_vars; - errcode = MPI_Test(&cor_vars->req1, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_Icalc_others_req_main(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN: - cor_vars = nbc_req->cor_vars; - if (cor_vars->num_req2) { - errcode = MPI_Testall(cor_vars->num_req2, cor_vars->req2, - &flag, MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_Icalc_others_req_fini(nbc_req, &errcode); - } - } else { - ADIOI_Icalc_others_req_fini(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_IREAD_AND_EXCH: - rae_vars = nbc_req->data.rd.rae_vars; - errcode = MPI_Test(&rae_vars->req1, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - rae_vars->m = 0; - ADIOI_Iread_and_exch_l1_begin(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN: - rae_vars = nbc_req->data.rd.rae_vars; - errcode = MPI_Test(&rae_vars->req2, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_R_Iexchange_data(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_R_IEXCHANGE_DATA: - red_vars = nbc_req->data.rd.red_vars; - errcode = MPI_Test(&red_vars->req1, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_R_Iexchange_data_recv(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV: - red_vars = nbc_req->data.rd.red_vars; - errcode = MPI_Testall(red_vars->nprocs_recv, red_vars->req2, &flag, - MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_R_Iexchange_data_fill(nbc_req, &errcode); - } - break; - - case ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL: - red_vars = nbc_req->data.rd.red_vars; - errcode = MPI_Testall(red_vars->nprocs_send, - red_vars->req2 + red_vars->nprocs_recv, - &flag, MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_R_Iexchange_data_fini(nbc_req, &errcode); - } - break; - - default: - break; - } - - /* --BEGIN ERROR HANDLING-- */ - if (errcode != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_irc_poll_fn", __LINE__, - MPI_ERR_IO, "**mpi_grequest_complete", - 0); - } - /* --END ERROR HANDLING-- */ - - return errcode; -} - -/* wait for multiple requests to complete */ -static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states, - double timeout, MPI_Status *status) -{ - int i, errcode = MPI_SUCCESS; - double starttime; - ADIOI_NBC_Request **nbc_reqlist; - - nbc_reqlist = (ADIOI_NBC_Request **)array_of_states; - - starttime = MPI_Wtime(); - for (i = 0; i < count ; i++) { - while (nbc_reqlist[i]->data.rd.state != ADIOI_IRC_STATE_COMPLETE) { - errcode = ADIOI_GEN_irc_poll_fn(nbc_reqlist[i], MPI_STATUS_IGNORE); - /* --BEGIN ERROR HANDLING-- */ - if (errcode != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_irc_wait_fn", - __LINE__, MPI_ERR_IO, - "**mpi_grequest_complete", 0); - } - /* --END ERROR HANDLING-- */ - - if ((timeout > 0) && (timeout < (MPI_Wtime() - starttime))) - goto fn_exit; - - /* If the progress engine is blocked, we have to yield for another - * thread to be able to unblock the progress engine. */ - MPIR_Ext_cs_yield(); - } - } - - fn_exit: - return errcode; -} - -#endif /* HAVE_MPI_GREQUEST_EXTENSIONS */ diff --git a/3rd-party/romio321/adio/common/ad_iread_coll.pdf b/3rd-party/romio321/adio/common/ad_iread_coll.pdf deleted file mode 100644 index 2c646fb5a5a..00000000000 Binary files a/3rd-party/romio321/adio/common/ad_iread_coll.pdf and /dev/null differ diff --git a/3rd-party/romio321/adio/common/ad_iread_fake.c b/3rd-party/romio321/adio/common/ad_iread_fake.c deleted file mode 100644 index b5cbd1da271..00000000000 --- a/3rd-party/romio321/adio/common/ad_iread_fake.c +++ /dev/null @@ -1,61 +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 "adio.h" -#include "mpiu_greq.h" - -/* Generic implementation of IreadContig calls the blocking ReadContig - * immediately. - */ -void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code) -{ - ADIO_Status status; - MPI_Count typesize; - MPI_Offset len; - - MPI_Type_size_x(datatype, &typesize); - len = (MPI_Offset)count * (MPI_Offset)typesize; - - /* Call the blocking function. It will create an error code - * if necessary. - */ - ADIOI_Assert(len == (int) len); /* the count is an int parm */ - ADIO_ReadContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset, - &status, error_code); - if (*error_code != MPI_SUCCESS) { - len=0; - } - MPIO_Completed_request_create(&fd, len, error_code, request); -} - - -/* Generic implementation of IreadStrided calls the blocking ReadStrided - * immediately. - */ -void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code) -{ - ADIO_Status status; - MPI_Count typesize; - MPI_Offset nbytes=0; - - /* Call the blocking function. It will create an error code - * if necessary. - */ - ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - if (*error_code == MPI_SUCCESS) { - MPI_Type_size_x(datatype, &typesize); - nbytes = (MPI_Offset)count*(MPI_Offset)typesize; - } - MPIO_Completed_request_create(&fd, nbytes, error_code, request); -} diff --git a/3rd-party/romio321/adio/common/ad_iwrite.c b/3rd-party/romio321/adio/common/ad_iwrite.c deleted file mode 100644 index e72af5fe224..00000000000 --- a/3rd-party/romio321/adio/common/ad_iwrite.c +++ /dev/null @@ -1,344 +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 "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif -#include - -#include "../../mpi-io/mpioimpl.h" -#include "../../mpi-io/mpioprof.h" -#include "mpiu_greq.h" -/* 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 - -#ifdef ROMIO_HAVE_WORKING_AIO - -static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; - -/* ADIOI_GEN_IwriteContig - * - * This code handles only the case where ROMIO_HAVE_WORKING_AIO is - * defined. We post an asynchronous I/O operations using the appropriate aio - * routines. Otherwise, the ADIOI_Fns_struct will point to the FAKE - * version. - */ -void ADIOI_GEN_IwriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code) -{ - MPI_Count len, typesize; - int aio_errno = 0; - static char myname[] = "ADIOI_GEN_IWRITECONTIG"; - - MPI_Type_size_x(datatype, &typesize); - len = count * typesize; - ADIOI_Assert(len == (int)((ADIO_Offset)count * (ADIO_Offset)typesize)); /* the count is an int parm */ - - if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind; - /* Cast away the const'ness of 'buf' as ADIOI_GEN_aio is used for - * both read and write calls */ - aio_errno = ADIOI_GEN_aio(fd, (char *) buf, len, offset, 1, request); - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len; - - fd->fp_sys_posn = -1; - - /* --BEGIN ERROR HANDLING-- */ - if (aio_errno != 0) { - MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code); - return; - } - /* --END ERROR HANDLING-- */ - - *error_code = MPI_SUCCESS; -} -/* This function is for implementation convenience. - * 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. - */ -int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, - int wr, MPI_Request *request) -{ - int err=-1, fd_sys; - - int error_code; - struct aiocb *aiocbp=NULL; - ADIOI_AIO_Request *aio_req=NULL; - MPI_Status status; -#if defined(ROMIO_XFS) - unsigned maxiosz = wr ? fd->hints->fs_hints.xfs.write_chunk_sz : - fd->hints->fs_hints.xfs.read_chunk_sz; -#endif /* ROMIO_XFS */ - - fd_sys = fd->fd_sys; - -#if defined(ROMIO_XFS) - /* Use Direct I/O if desired and properly aligned */ - if (fd->fns == &ADIO_XFS_operations && - ((wr && fd->direct_write) || (!wr && fd->direct_read)) && - !(((long) buf) % fd->d_mem) && !(offset % fd->d_miniosz) && - !(len % fd->d_miniosz) && (len >= fd->d_miniosz) && - (len <= maxiosz)) { - fd_sys = fd->fd_direct; - } -#endif /* ROMIO_XFS */ - - 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 - -#ifndef ROMIO_HAVE_AIO_CALLS_NEED_FILEDES -#ifndef HAVE_STRUCT_AIOCB_AIO_FILDES -#error 'No fildes set for aio structure' -#endif - 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 - - if (err == -1) { - if (errno == EAGAIN || errno == ENOSYS) { - /* exceeded the max. no. of outstanding requests. - or, aio routines are not actually implemented - treat this as a blocking request and return. */ - if (wr) - ADIO_WriteContig(fd, buf, len, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, offset, &status, &error_code); - else - ADIO_ReadContig(fd, buf, len, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, offset, &status, &error_code); - - MPIO_Completed_request_create(&fd, len, &error_code, request); - if (aiocbp != NULL) ADIOI_Free(aiocbp); - if (aio_req != NULL) ADIOI_Free(aio_req); - return 0; - } else { - ADIOI_Free(aio_req); - ADIOI_Free(aiocbp); - return errno; - } - } - aio_req->aiocbp = aiocbp; - if (ADIOI_GEN_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_aio_query_fn, - ADIOI_GEN_aio_free_fn, MPIU_Greq_cancel_fn, - ADIOI_GEN_aio_poll_fn, ADIOI_GEN_aio_wait_fn, - &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 - - -/* Generic implementation of IwriteStrided calls the blocking WriteStrided - * immediately. - */ -void ADIOI_GEN_IwriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code) -{ - ADIO_Status status; - MPI_Count typesize; - MPI_Offset nbytes=0; - - /* Call the blocking function. It will create an error code - * if necessary. - */ - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - - if (*error_code == MPI_SUCCESS) { - MPI_Type_size_x(datatype, &typesize); - nbytes = (MPI_Offset)count * (MPI_Offset)typesize; - } - MPIO_Completed_request_create(&fd, nbytes, error_code, request); -} - -#ifdef ROMIO_HAVE_WORKING_AIO -/* generic POSIX aio completion test routine */ -int ADIOI_GEN_aio_poll_fn(void *extra_state, MPI_Status *status) -{ - ADIOI_AIO_Request *aio_req; - int errcode=MPI_SUCCESS; - - aio_req = (ADIOI_AIO_Request *)extra_state; - - /* aio_error returns an ERRNO value */ - errno = aio_error(aio_req->aiocbp); - if (errno == EINPROGRESS) { - /* TODO: need to diddle with status somehow */ - } - else if (errno == ECANCELED) { - /* TODO: unsure how to handle this */ - } else if (errno == 0) { - ssize_t n = aio_return(aio_req->aiocbp); - aio_req->nbytes = n; - errcode = MPI_Grequest_complete(aio_req->req); - /* --BEGIN ERROR HANDLING-- */ - if (errcode != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_aio_poll_fn", __LINE__, - MPI_ERR_IO, "**mpi_grequest_complete", - 0); - } - /* --END ERROR HANDLING-- */ - } - return errcode; -} - -/* wait for multiple requests to complete */ -int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states, - double timeout, MPI_Status *status) -{ - const struct aiocb **cblist; - int err, errcode=MPI_SUCCESS; - int nr_complete=0; - double starttime; - struct timespec aio_timer; - struct timespec *aio_timer_p = NULL; - - ADIOI_AIO_Request **aio_reqlist; - int i; - - aio_reqlist = (ADIOI_AIO_Request **)array_of_states; - - cblist = (const struct aiocb**) ADIOI_Calloc(count, sizeof(struct aiocb*)); - - starttime = MPI_Wtime(); - if (timeout >0) { - aio_timer.tv_sec = (time_t)timeout; - aio_timer.tv_nsec = timeout - aio_timer.tv_sec; - aio_timer_p = &aio_timer; - } - for (i=0; i< count; i++) - { - cblist[i] = aio_reqlist[i]->aiocbp; - } - - while(nr_complete < count) { - do { - err = aio_suspend(cblist, count, aio_timer_p); - } while (err < 0 && errno == EINTR); - if (err == 0) - { /* run through the list of requests, and mark all the completed - ones as done */ - for (i=0; i< count; i++) - { - /* aio_error returns an ERRNO value */ - if (aio_reqlist[i]->aiocbp == NULL) - continue; - errno = aio_error(aio_reqlist[i]->aiocbp); - if (errno == 0) { - ssize_t n = aio_return(aio_reqlist[i]->aiocbp); - aio_reqlist[i]->nbytes = n; - errcode = MPI_Grequest_complete(aio_reqlist[i]->req); - if (errcode != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_aio_wait_fn", - __LINE__, MPI_ERR_IO, - "**mpi_grequest_complete", 0); - } - ADIOI_Free(aio_reqlist[i]->aiocbp); - aio_reqlist[i]->aiocbp = NULL; - cblist[i] = NULL; - nr_complete++; - } - /* TODO: need to handle error conditions somehow*/ - } - } /* TODO: also need to handle errors here */ - if ( (timeout > 0) && (timeout < (MPI_Wtime() - starttime) )) - break; - } - - if (cblist != NULL) ADIOI_Free(cblist); - return errcode; -} - -int ADIOI_GEN_aio_free_fn(void *extra_state) -{ - ADIOI_AIO_Request *aio_req; - aio_req = (ADIOI_AIO_Request*)extra_state; - - if (aio_req->aiocbp != NULL) - ADIOI_Free(aio_req->aiocbp); - ADIOI_Free(aio_req); - - return MPI_SUCCESS; -} -#endif /* working AIO */ - -int ADIOI_GEN_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_x(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; -} -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/common/ad_iwrite_coll.c b/3rd-party/romio321/adio/common/ad_iwrite_coll.c deleted file mode 100644 index d3167fe2039..00000000000 --- a/3rd-party/romio321/adio/common/ad_iwrite_coll.c +++ /dev/null @@ -1,1571 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#include "mpiu_greq.h" -#include "mpioimpl.h" - -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -#ifdef HAVE_MPI_GREQUEST_EXTENSIONS - -/* ADIOI_GEN_IwriteStridedColl */ -struct ADIOI_GEN_IwriteStridedColl_vars { - /* requests */ - MPI_Request req_offset[2]; /* ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL */ - MPI_Request req_ind_io; /* ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO */ - MPI_Request req_err; /* ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST */ - - /* parameters */ - ADIO_File fd; - const void *buf; - int count; - MPI_Datatype datatype; - int file_ptr_type; - ADIO_Offset offset; - - /* stack variables */ - ADIOI_Access *my_req; - /* array of nprocs access structures, one for each other process in - whose file domain this process's request lies */ - - ADIOI_Access *others_req; - /* array of nprocs access structures, one for each other process - whose request lies in this process's file domain. */ - - int nprocs; - int nprocs_for_coll; - int myrank; - int contig_access_count; - int interleave_count; - int buftype_is_contig; - int *count_my_req_per_proc; - int count_my_req_procs; - int count_others_req_procs; - ADIO_Offset start_offset; - ADIO_Offset end_offset; - ADIO_Offset orig_fp; - ADIO_Offset fd_size; - ADIO_Offset min_st_offset; - ADIO_Offset *offset_list; - ADIO_Offset *st_offsets; - ADIO_Offset *fd_start; - ADIO_Offset *fd_end; - ADIO_Offset *end_offsets; - int *buf_idx; - ADIO_Offset *len_list; - int old_error; - int tmp_error; - int error_code; -}; - -/* ADIOI_Iexch_and_write */ -struct ADIOI_Iexch_and_write_vars { - /* requests */ - MPI_Request req1; /* ADIOI_IWC_STATE_IEXCH_AND_WRITE */ - MPI_Request req3; /* ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY */ - - /* parameters */ - ADIO_File fd; - void *buf; - MPI_Datatype datatype; - int nprocs; - int myrank; - ADIOI_Access *others_req; - ADIO_Offset *offset_list; - ADIO_Offset *len_list; - int contig_access_count; - ADIO_Offset min_st_offset; - ADIO_Offset fd_size; - ADIO_Offset *fd_start; - ADIO_Offset *fd_end; - int *buf_idx; - - /* stack variables */ - /* Not convinced end_loc-st_loc couldn't be > int, so make these offsets*/ - ADIO_Offset size; - int hole; - int m; - int ntimes; - int max_ntimes; - int buftype_is_contig; - ADIO_Offset st_loc; - ADIO_Offset end_loc; - ADIO_Offset off; - ADIO_Offset done; - char *write_buf; - int *curr_offlen_ptr; - int *count; - int *send_size; - int *recv_size; - int *partial_recv; - int *sent_to_proc; - int *start_pos; - int *send_buf_idx; - int *curr_to_proc; - int *done_to_proc; - ADIOI_Flatlist_node *flat_buf; - MPI_Aint buftype_extent; - int coll_bufsize; - - /* next function to be called */ - void (*next_fn)(ADIOI_NBC_Request *, int *); -}; - -/* ADIOI_W_Iexchange_data */ -struct ADIOI_W_Iexchange_data_vars { - /* requests */ - MPI_Request req1; /* ADIOI_IWC_STATE_W_IEXCHANGE_DATA */ - MPI_Request req2; /* ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE */ - MPI_Request *req3; /* ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND */ - - /* parameters */ - ADIO_File fd; - void *buf; - char *write_buf; - ADIOI_Flatlist_node *flat_buf; - ADIO_Offset *offset_list; - ADIO_Offset *len_list; - int *send_size; - int *recv_size; - ADIO_Offset off; - int size; - int *count; - int *start_pos; - int *partial_recv; - int *sent_to_proc; - int nprocs; - int myrank; - int buftype_is_contig; - int contig_access_count; - ADIO_Offset min_st_offset; - ADIO_Offset fd_size; - ADIO_Offset *fd_start; - ADIO_Offset *fd_end; - ADIOI_Access *others_req; - int *send_buf_idx; - int *curr_to_proc; - int *done_to_proc; - int *hole; - int iter; - MPI_Aint buftype_extent; - int *buf_idx; - - /* stack variables */ - int nprocs_recv; - int nprocs_send; - int err; - char **send_buf; - MPI_Request *requests; - MPI_Request *send_req; - MPI_Datatype *recv_types; - int sum; - ADIO_Offset *srt_off; - - /* next function to be called */ - void (*next_fn)(ADIOI_NBC_Request *, int *); -}; - - -void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, - int contig_access_count, ADIO_Offset - min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int iter, - MPI_Aint buftype_extent); -void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, - ADIO_Offset *srt_off, int *srt_len, int *start_pos, - int nprocs, int nprocs_recv, int total_elements); - - -/* prototypes of functions used for nonblocking collective writes only. */ -static void ADIOI_GEN_IwriteStridedColl_inter(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IwriteStridedColl_indio(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IwriteStridedColl_exch(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IwriteStridedColl_bcast(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IwriteStridedColl_free(ADIOI_NBC_Request *, int *); -static void ADIOI_GEN_IwriteStridedColl_fini(ADIOI_NBC_Request *, int *); - -static void ADIOI_Iexch_and_write(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_l1_begin(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_l1_body(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_l1_end(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_reset(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_l2_begin(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_l2_end(ADIOI_NBC_Request *, int *); -static void ADIOI_Iexch_and_write_fini(ADIOI_NBC_Request *, int *); - -static void ADIOI_W_Iexchange_data(ADIOI_NBC_Request *, int *); -static void ADIOI_W_Iexchange_data_hole(ADIOI_NBC_Request *, int *); -static void ADIOI_W_Iexchange_data_send(ADIOI_NBC_Request *, int *); -static void ADIOI_W_Iexchange_data_wait(ADIOI_NBC_Request *, int *); -static void ADIOI_W_Iexchange_data_fini(ADIOI_NBC_Request *, int *); - -static MPIX_Grequest_class ADIOI_GEN_greq_class = 0; -static int ADIOI_GEN_iwc_query_fn(void *extra_state, MPI_Status *status); -static int ADIOI_GEN_iwc_free_fn(void *extra_state); -static int ADIOI_GEN_iwc_poll_fn(void *extra_state, MPI_Status *status); -static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states, - double timeout, MPI_Status *status); - - -/* Non-blocking version of ADIOI_GEN_WriteStridedColl() */ -void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code) -{ - /* Uses a generalized version of the extended two-phase method described - in "An Extended Two-Phase Method for Accessing Sections of - Out-of-Core Arrays", Rajeev Thakur and Alok Choudhary, - Scientific Programming, (5)4:301--317, Winter 1996. - http://www.mcs.anl.gov/home/thakur/ext2ph.ps */ - - ADIOI_NBC_Request *nbc_req = NULL; - ADIOI_GEN_IwriteStridedColl_vars *vars = NULL; - int nprocs, myrank; - -#if 0 - /* FIXME: need an implementation of ADIOI_IOIstridedColl */ - if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { - /* Cast away const'ness as the below function is used for read - * and write */ - ADIOI_IOIstridedColl(fd, (char *) buf, count, ADIOI_WRITE, datatype, - file_ptr_type, offset, request, error_code); - return; - } -#endif - - /* top-level struct keeping the status of function progress */ - nbc_req = (ADIOI_NBC_Request *)ADIOI_Calloc(1, sizeof(ADIOI_NBC_Request)); - nbc_req->rdwr = ADIOI_WRITE; - - /* create a generalized request */ - if (ADIOI_GEN_greq_class == 0) { - MPIX_Grequest_class_create(ADIOI_GEN_iwc_query_fn, - ADIOI_GEN_iwc_free_fn, MPIU_Greq_cancel_fn, - ADIOI_GEN_iwc_poll_fn, ADIOI_GEN_iwc_wait_fn, - &ADIOI_GEN_greq_class); - } - MPIX_Grequest_class_allocate(ADIOI_GEN_greq_class, nbc_req, request); - memcpy(&nbc_req->req, request, sizeof(MPI_Request)); - - /* create a struct for parameters and variables */ - vars = (ADIOI_GEN_IwriteStridedColl_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_GEN_IwriteStridedColl_vars)); - nbc_req->data.wr.wsc_vars = vars; - - /* save the parameters */ - vars->fd = fd; - vars->buf = buf; - vars->count = count; - vars->datatype = datatype; - vars->file_ptr_type = file_ptr_type; - vars->offset = offset; - - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - vars->nprocs = nprocs; - vars->myrank = myrank; - - /* the number of processes that actually perform I/O, nprocs_for_coll, - * is stored in the hints off the ADIO_File structure - */ - vars->nprocs_for_coll = fd->hints->cb_nodes; - vars->orig_fp = fd->fp_ind; - - /* only check for interleaving if cb_write isn't disabled */ - if (fd->hints->cb_write != ADIOI_HINT_DISABLE) { - /* For this process's request, calculate the list of offsets and - lengths in the file and determine the start and end offsets. */ - - /* Note: end_offset points to the last byte-offset that will be accessed. - e.g., if start_offset=0 and 100 bytes to be read, end_offset=99*/ - - ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset, - &vars->offset_list, &vars->len_list, - &vars->start_offset, &vars->end_offset, - &vars->contig_access_count); - - /* each process communicates its start and end offsets to other - processes. The result is an array each of start and end offsets - stored in order of process rank. */ - - vars->st_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); - vars->end_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset)); - - *error_code = MPI_Iallgather(&vars->start_offset, 1, ADIO_OFFSET, - vars->st_offsets, 1, ADIO_OFFSET, - fd->comm, &vars->req_offset[0]); - if (*error_code != MPI_SUCCESS) return; - *error_code = MPI_Iallgather(&vars->end_offset, 1, ADIO_OFFSET, - vars->end_offsets, 1, ADIO_OFFSET, - fd->comm, &vars->req_offset[1]); - - nbc_req->data.wr.state = ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL; - return; - } - - ADIOI_GEN_IwriteStridedColl_indio(nbc_req, error_code); -} - -static void ADIOI_GEN_IwriteStridedColl_inter(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; - int nprocs = vars->nprocs; - ADIO_Offset *st_offsets = vars->st_offsets; - ADIO_Offset *end_offsets = vars->end_offsets; - int i, interleave_count = 0; - - /* are the accesses of different processes interleaved? */ - for (i = 1; i < nprocs; i++) - if ((st_offsets[i] < end_offsets[i-1]) && - (st_offsets[i] <= end_offsets[i])) - interleave_count++; - /* This is a rudimentary check for interleaving, but should suffice - for the moment. */ - - vars->interleave_count = interleave_count; - - ADIOI_GEN_IwriteStridedColl_indio(nbc_req, error_code); -} - -static void ADIOI_GEN_IwriteStridedColl_indio(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; - ADIOI_Icalc_others_req_vars *cor_vars = NULL; - ADIO_File fd = vars->fd; - const void *buf; - int count, file_ptr_type; - MPI_Datatype datatype = vars->datatype; - ADIO_Offset offset; - int filetype_is_contig; - ADIO_Offset off; - int nprocs; - - ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); - - if (fd->hints->cb_write == ADIOI_HINT_DISABLE || - (!vars->interleave_count && (fd->hints->cb_write == ADIOI_HINT_AUTO))) - { - buf = vars->buf; - count = vars->count; - file_ptr_type = vars->file_ptr_type; - offset = vars->offset; - - /* use independent accesses */ - if (fd->hints->cb_write != ADIOI_HINT_DISABLE) { - ADIOI_Free(vars->offset_list); - ADIOI_Free(vars->len_list); - ADIOI_Free(vars->st_offsets); - ADIOI_Free(vars->end_offsets); - } - - fd->fp_ind = vars->orig_fp; - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - -#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) - /* NOTE: This is currently a workaround to avoid weird errors, e.g., - * stack fault, occurred on Linux. When the host OS is Linux and - * aio-lite is not used, a blocking ADIO function is used here. - * See https://trac.mpich.org/projects/mpich/ticket/2201. */ - MPI_Status status; - if (vars->buftype_is_contig && filetype_is_contig) { - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset; - ADIO_WriteContig(fd, buf, count, datatype, - ADIO_EXPLICIT_OFFSET, - off, &status, error_code); - } - else ADIO_WriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, - 0, &status, error_code); - } - else { - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - } - ADIOI_GEN_IwriteStridedColl_fini(nbc_req, error_code); -#else - if (vars->buftype_is_contig && filetype_is_contig) { - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = fd->disp + (ADIO_Offset)(fd->etype_size) * offset; - ADIO_IwriteContig(fd, buf, count, datatype, - ADIO_EXPLICIT_OFFSET, - off, &vars->req_ind_io, error_code); - } - else ADIO_IwriteContig(fd, buf, count, datatype, ADIO_INDIVIDUAL, - 0, &vars->req_ind_io, error_code); - } - else { - ADIO_IwriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &vars->req_ind_io, error_code); - } - - nbc_req->data.wr.state = ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO; -#endif - return; - } - - nprocs = vars->nprocs; - - /* Divide the I/O workload among "nprocs_for_coll" processes. This is - done by (logically) dividing the file into file domains (FDs); each - process may directly access only its own file domain. */ - - ADIOI_Calc_file_domains(vars->st_offsets, vars->end_offsets, nprocs, - vars->nprocs_for_coll, &vars->min_st_offset, - &vars->fd_start, &vars->fd_end, - fd->hints->min_fdomain_size, &vars->fd_size, - fd->hints->striping_unit); - - /* calculate what portions of the access requests of this process are - located in what file domains */ - - ADIOI_Calc_my_req(fd, vars->offset_list, vars->len_list, - vars->contig_access_count, vars->min_st_offset, - vars->fd_start, vars->fd_end, vars->fd_size, - nprocs, &vars->count_my_req_procs, - &vars->count_my_req_per_proc, &vars->my_req, - &vars->buf_idx); - - /* based on everyone's my_req, calculate what requests of other - processes lie in this process's file domain. - count_others_req_procs = number of processes whose requests lie in - this process's file domain (including this process itself) - count_others_req_per_proc[i] indicates how many separate contiguous - requests of proc. i lie in this process's file domain. */ - - cor_vars = (ADIOI_Icalc_others_req_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_Icalc_others_req_vars)); - nbc_req->cor_vars = cor_vars; - cor_vars->fd = vars->fd; - cor_vars->count_my_req_procs = vars->count_my_req_procs; - cor_vars->count_my_req_per_proc = vars->count_my_req_per_proc; - cor_vars->my_req = vars->my_req; - cor_vars->nprocs = vars->nprocs; - cor_vars->myrank = vars->myrank; - cor_vars->count_others_req_procs_ptr = &vars->count_others_req_procs; - cor_vars->others_req_ptr = &vars->others_req; - cor_vars->next_fn = ADIOI_GEN_IwriteStridedColl_exch; - - ADIOI_Icalc_others_req(nbc_req, error_code); -} - -static void ADIOI_GEN_IwriteStridedColl_exch(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; - ADIOI_Iexch_and_write_vars *eaw_vars = NULL; - ADIOI_Access *my_req = vars->my_req; - int nprocs = vars->nprocs; - int i; - - ADIOI_Free(vars->count_my_req_per_proc); - for (i = 0; i < nprocs; i++) { - if (my_req[i].count) { - ADIOI_Free(my_req[i].offsets); - ADIOI_Free(my_req[i].lens); - } - } - ADIOI_Free(my_req); - - /* exchange data and write in sizes of no more than coll_bufsize. */ - /* Cast away const'ness for the below function */ - eaw_vars = (ADIOI_Iexch_and_write_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_Iexch_and_write_vars)); - nbc_req->data.wr.eaw_vars = eaw_vars; - eaw_vars->fd = vars->fd; - eaw_vars->buf = (char *)vars->buf; - eaw_vars->datatype = vars->datatype; - eaw_vars->nprocs = vars->nprocs; - eaw_vars->myrank = vars->myrank; - eaw_vars->others_req = vars->others_req; - eaw_vars->offset_list = vars->offset_list; - eaw_vars->len_list = vars->len_list; - eaw_vars->contig_access_count = vars->contig_access_count; - eaw_vars->min_st_offset = vars->min_st_offset; - eaw_vars->fd_size = vars->fd_size; - eaw_vars->fd_start = vars->fd_start; - eaw_vars->fd_end = vars->fd_end; - eaw_vars->buf_idx = vars->buf_idx; - eaw_vars->next_fn = ADIOI_GEN_IwriteStridedColl_bcast; - - ADIOI_Iexch_and_write(nbc_req, error_code); -} - -static void ADIOI_GEN_IwriteStridedColl_bcast(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; - ADIO_File fd = vars->fd; - - /* If this collective write is followed by an independent write, - * it's possible to have those subsequent writes on other processes - * race ahead and sneak in before the read-modify-write completes. - * We carry out a collective communication at the end here so no one - * can start independent i/o before collective I/O completes. - * - * need to do some gymnastics with the error codes so that if something - * went wrong, all processes report error, but if a process has a more - * specific error code, we can still have that process report the - * additional information */ - - vars->old_error = *error_code; - if (*error_code != MPI_SUCCESS) *error_code = MPI_ERR_IO; - - /* optimization: if only one process performing i/o, we can perform - * a less-expensive Bcast */ -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_postwrite_a, 0, NULL ); -#endif - vars->error_code = *error_code; - if (fd->hints->cb_nodes == 1) { - *error_code = MPI_Ibcast(&vars->error_code, 1, MPI_INT, - fd->hints->ranklist[0], fd->comm, - &vars->req_err); - } else { - vars->tmp_error = *error_code; - *error_code = MPI_Iallreduce(&vars->tmp_error, &vars->error_code, 1, - MPI_INT, MPI_MAX, fd->comm, - &vars->req_err); - } - - nbc_req->data.wr.state = ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST; -} - -static void ADIOI_GEN_IwriteStridedColl_free(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; - ADIO_File fd = vars->fd; - MPI_Datatype datatype = vars->datatype; - ADIOI_Access *others_req = vars->others_req; - int nprocs = vars->nprocs; - int old_error = vars->old_error; - int i; - -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_postwrite_b, 0, NULL ); -#endif -#ifdef AGGREGATION_PROFILE - MPE_Log_event(5012, 0, NULL); -#endif - - if ( (old_error != MPI_SUCCESS) && (old_error != MPI_ERR_IO) ) - *error_code = old_error; - - - if (!vars->buftype_is_contig) ADIOI_Delete_flattened(datatype); - - /* free all memory allocated for collective I/O */ - for (i = 0; i < nprocs; i++) { - if (others_req[i].count) { - ADIOI_Free(others_req[i].offsets); - ADIOI_Free(others_req[i].lens); - ADIOI_Free(others_req[i].mem_ptrs); - } - } - ADIOI_Free(others_req); - - ADIOI_Free(vars->buf_idx); - ADIOI_Free(vars->offset_list); - ADIOI_Free(vars->len_list); - ADIOI_Free(vars->st_offsets); - ADIOI_Free(vars->end_offsets); - ADIOI_Free(vars->fd_start); - ADIOI_Free(vars->fd_end); - - fd->fp_sys_posn = -1; /* set it to null. */ -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5013, 0, NULL); -#endif - - ADIOI_GEN_IwriteStridedColl_fini(nbc_req, error_code); -} - -static void ADIOI_GEN_IwriteStridedColl_fini(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_GEN_IwriteStridedColl_vars *vars = nbc_req->data.wr.wsc_vars; - MPI_Count size; - - /* This is a temporary way of filling in status. The right way is to - keep track of how much data was actually written during collective I/O. */ - MPI_Type_size_x(vars->datatype, &size); - nbc_req->nbytes = size * vars->count; - - /* free the struct for parameters and variables */ - if (nbc_req->data.wr.wsc_vars) { - ADIOI_Free(nbc_req->data.wr.wsc_vars); - nbc_req->data.wr.wsc_vars = NULL; - } - - /* make the request complete */ - *error_code = MPI_Grequest_complete(nbc_req->req); - nbc_req->data.wr.state = ADIOI_IWC_STATE_COMPLETE; -} - - -static void ADIOI_Iexch_and_write(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - ADIO_File fd = vars->fd; - MPI_Datatype datatype = vars->datatype; - int nprocs = vars->nprocs; - ADIOI_Access *others_req = vars->others_req; - MPI_Aint lb; - - /* Send data to appropriate processes and write in sizes of no more - than coll_bufsize. - The idea is to reduce the amount of extra memory required for - collective I/O. If all data were written all at once, which is much - easier, it would require temp space more than the size of user_buf, - which is often unacceptable. For example, to write a distributed - array to a file, where each local array is 8Mbytes, requiring - at least another 8Mbytes of temp space is unacceptable. */ - - int i, j; - ADIO_Offset st_loc = -1, end_loc = -1; - int info_flag, coll_bufsize; - char *value; - - *error_code = MPI_SUCCESS; /* changed below if error */ - /* only I/O errors are currently reported */ - - /* calculate the number of writes of size coll_bufsize - to be done by each process and the max among all processes. - That gives the no. of communication phases as well. */ - - value = (char *)ADIOI_Malloc((MPI_MAX_INFO_VAL+1) * sizeof(char)); - ADIOI_Info_get(fd->info, "cb_buffer_size", MPI_MAX_INFO_VAL, value, - &info_flag); - coll_bufsize = atoi(value); - vars->coll_bufsize = coll_bufsize; - ADIOI_Free(value); - - for (i = 0; i < nprocs; i++) { - if (others_req[i].count) { - st_loc = others_req[i].offsets[0]; - end_loc = others_req[i].offsets[0]; - break; - } - } - - for (i = 0; i < nprocs; i++) - for (j = 0; j < others_req[i].count; j++) { - st_loc = ADIOI_MIN(st_loc, others_req[i].offsets[j]); - end_loc = ADIOI_MAX(end_loc, (others_req[i].offsets[j] - + others_req[i].lens[j] - 1)); - } - - vars->st_loc = st_loc; - vars->end_loc = end_loc; - - /* ntimes=ceiling_div(end_loc - st_loc + 1, coll_bufsize)*/ - - vars->ntimes = (int)((end_loc - st_loc + coll_bufsize) / coll_bufsize); - - if ((st_loc==-1) && (end_loc==-1)) { - vars->ntimes = 0; /* this process does no writing. */ - } - - *error_code = MPI_Iallreduce(&vars->ntimes, &vars->max_ntimes, 1, MPI_INT, - MPI_MAX, fd->comm, &vars->req1); - - vars->write_buf = fd->io_buf; - - vars->curr_offlen_ptr = (int *)ADIOI_Calloc(nprocs, sizeof(int)); - /* its use is explained below. calloc initializes to 0. */ - - vars->count = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - /* to store count of how many off-len pairs per proc are satisfied - in an iteration. */ - - vars->partial_recv = (int *)ADIOI_Calloc(nprocs, sizeof(int)); - /* if only a portion of the last off-len pair is recd. from a process - in a particular iteration, the length recd. is stored here. - calloc initializes to 0. */ - - vars->send_size = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - /* total size of data to be sent to each proc. in an iteration. - Of size nprocs so that I can use MPI_Alltoall later. */ - - vars->recv_size = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - /* total size of data to be recd. from each proc. in an iteration.*/ - - vars->sent_to_proc = (int *)ADIOI_Calloc(nprocs, sizeof(int)); - /* amount of data sent to each proc so far. Used in - ADIOI_Fill_send_buffer. initialized to 0 here. */ - - vars->send_buf_idx = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - vars->curr_to_proc = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - vars->done_to_proc = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - /* Above three are used in ADIOI_Fill_send_buffer*/ - - vars->start_pos = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - /* used to store the starting value of curr_offlen_ptr[i] in - this iteration */ - - ADIOI_Datatype_iscontig(datatype, &vars->buftype_is_contig); - if (!vars->buftype_is_contig) { - vars->flat_buf = ADIOI_Flatten_and_find(datatype); - } - MPI_Type_get_extent(datatype, &lb, &vars->buftype_extent); - - - /* I need to check if there are any outstanding nonblocking writes to - the file, which could potentially interfere with the writes taking - place in this collective write call. Since this is not likely to be - common, let me do the simplest thing possible here: Each process - completes all pending nonblocking operations before completing. */ - - /*ADIOI_Complete_async(error_code); - if (*error_code != MPI_SUCCESS) return; - MPI_Barrier(fd->comm); - */ - - vars->done = 0; - vars->off = st_loc; - - /* set the state to wait until MPI_Ialltoall finishes. */ - nbc_req->data.wr.state = ADIOI_IWC_STATE_IEXCH_AND_WRITE; -} - -static void ADIOI_Iexch_and_write_l1_begin(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - int nprocs; - ADIOI_Access *others_req; - - int i, j; - ADIO_Offset off, req_off; - char *write_buf; - int *curr_offlen_ptr, *count, req_len, *recv_size; - int *partial_recv, *start_pos; - ADIO_Offset size; - static char myname[] = "ADIOI_IEXCH_AND_WRITE_L1_BEGIN"; - - ADIOI_W_Iexchange_data_vars *wed_vars = NULL; - - /* loop exit condition */ - if (vars->m >= vars->ntimes) { - ADIOI_Iexch_and_write_reset(nbc_req, error_code); - return; - } - - nprocs = vars->nprocs; - others_req = vars->others_req; - - off = vars->off; - write_buf = vars->write_buf; - curr_offlen_ptr = vars->curr_offlen_ptr; - count = vars->count; - recv_size = vars->recv_size; - partial_recv = vars->partial_recv; - start_pos = vars->start_pos; - - /* go through all others_req and check which will be satisfied - by the current write */ - - /* Note that MPI guarantees that displacements in filetypes are in - monotonically nondecreasing order and that, for writes, the - filetypes cannot specify overlapping regions in the file. This - simplifies implementation a bit compared to reads. */ - - /* off = start offset in the file for the data to be written in - this iteration - size = size of data written (bytes) corresponding to off - req_off = off in file for a particular contiguous request - minus what was satisfied in previous iteration - req_size = size corresponding to req_off */ - - /* first calculate what should be communicated */ - - for (i = 0; i < nprocs; i++) count[i] = recv_size[i] = 0; - - size = ADIOI_MIN((unsigned)vars->coll_bufsize, - vars->end_loc - vars->st_loc + 1 - vars->done); - vars->size = size; - - for (i = 0; i < nprocs; i++) { - if (others_req[i].count) { - start_pos[i] = curr_offlen_ptr[i]; - for (j = curr_offlen_ptr[i]; j < others_req[i].count; j++) { - if (partial_recv[i]) { - /* this request may have been partially - satisfied in the previous iteration. */ - req_off = others_req[i].offsets[j] + - partial_recv[i]; - req_len = others_req[i].lens[j] - - partial_recv[i]; - partial_recv[i] = 0; - /* modify the off-len pair to reflect this change */ - others_req[i].offsets[j] = req_off; - others_req[i].lens[j] = req_len; - } - else { - req_off = others_req[i].offsets[j]; - req_len = others_req[i].lens[j]; - } - if (req_off < off + size) { - count[i]++; - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIU_Upint)(write_buf+req_off-off)); - MPI_Get_address(write_buf + req_off - off, - &(others_req[i].mem_ptrs[j])); - ADIOI_Assert((off + size - req_off) == (int)(off + size - req_off)); - recv_size[i] += (int)(ADIOI_MIN(off + size - req_off, - (unsigned)req_len)); - - if (off+size-req_off < (unsigned)req_len) - { - partial_recv[i] = (int)(off + size - req_off); - - /* --BEGIN ERROR HANDLING-- */ - if ((j+1 < others_req[i].count) && - (others_req[i].offsets[j+1] < off+size)) - { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_ARG, - "Filetype specifies overlapping write regions (which is illegal according to the MPI-2 specification)", 0); - /* allow to continue since additional - * communication might have to occur - */ - } - /* --END ERROR HANDLING-- */ - break; - } - } - else break; - } - curr_offlen_ptr[i] = j; - } - } - - /* create a struct for ADIOI_W_Iexchange_data() */ - wed_vars = (ADIOI_W_Iexchange_data_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_W_Iexchange_data_vars)); - nbc_req->data.wr.wed_vars = wed_vars; - - wed_vars->fd = vars->fd; - wed_vars->buf = vars->buf; - wed_vars->write_buf = vars->write_buf; - wed_vars->flat_buf = vars->flat_buf; - wed_vars->offset_list = vars->offset_list; - wed_vars->len_list = vars->len_list; - wed_vars->send_size = vars->send_size; - wed_vars->recv_size = vars->recv_size; - wed_vars->off = vars->off; - wed_vars->size = vars->size; - wed_vars->count = vars->count; - wed_vars->start_pos = vars->start_pos; - wed_vars->partial_recv = vars->partial_recv; - wed_vars->sent_to_proc = vars->sent_to_proc; - wed_vars->nprocs = vars->nprocs; - wed_vars->myrank = vars->myrank; - wed_vars->buftype_is_contig = vars->buftype_is_contig; - wed_vars->contig_access_count = vars->contig_access_count; - wed_vars->min_st_offset = vars->min_st_offset; - wed_vars->fd_size = vars->fd_size; - wed_vars->fd_start = vars->fd_start; - wed_vars->fd_end = vars->fd_end; - wed_vars->others_req = vars->others_req; - wed_vars->send_buf_idx = vars->send_buf_idx; - wed_vars->curr_to_proc = vars->curr_to_proc; - wed_vars->done_to_proc = vars->done_to_proc; - wed_vars->hole = &vars->hole; - wed_vars->iter = vars->m; - wed_vars->buftype_extent = vars->buftype_extent; - wed_vars->buf_idx = vars->buf_idx; - wed_vars->next_fn = ADIOI_Iexch_and_write_l1_body; - - ADIOI_W_Iexchange_data(nbc_req, error_code); -} - -static void ADIOI_Iexch_and_write_l1_body(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - ADIO_File fd = vars->fd; - int nprocs = vars->nprocs; - ADIO_Offset size = vars->size; - char *write_buf = vars->write_buf; - int *count = vars->count; - int flag, i; - - flag = 0; - for (i = 0; i < nprocs; i++) - if (count[i]) flag = 1; - - if (flag) { - ADIOI_Assert(size == (int)size); -#if defined(ROMIO_RUN_ON_LINUX) && !defined(HAVE_AIO_LITE_H) - MPI_Status status; - ADIO_WriteContig(fd, write_buf, (int)size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, vars->off, &status, - error_code); -#else - ADIO_IwriteContig(fd, write_buf, (int)size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, vars->off, &vars->req3, - error_code); - - nbc_req->data.wr.state = ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY; - return; -#endif - } - - ADIOI_Iexch_and_write_l1_end(nbc_req, error_code); -} - -static void ADIOI_Iexch_and_write_l1_end(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - ADIO_Offset size = vars->size; - - vars->off += size; - vars->done += size; - - /* increment m and go back to the beginning of m loop */ - vars->m++; - ADIOI_Iexch_and_write_l1_begin(nbc_req, error_code); -} - -static void ADIOI_Iexch_and_write_reset(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - int nprocs = vars->nprocs; - int *count = vars->count; - int *recv_size = vars->recv_size; - int i; - - for (i = 0; i < nprocs; i++) count[i] = recv_size[i] = 0; - - vars->m = vars->ntimes; - ADIOI_Iexch_and_write_l2_begin(nbc_req, error_code); -} - -static void ADIOI_Iexch_and_write_l2_begin(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - ADIO_Offset size = vars->size; - ADIOI_W_Iexchange_data_vars *wed_vars = NULL; - - /* loop exit condition */ - if (vars->m >= vars->max_ntimes) { - ADIOI_Iexch_and_write_fini(nbc_req, error_code); - return; - } - - ADIOI_Assert(size == (int)size); - - /* create a struct for ADIOI_W_Iexchange_data() */ - wed_vars = (ADIOI_W_Iexchange_data_vars *)ADIOI_Calloc( - 1, sizeof(ADIOI_W_Iexchange_data_vars)); - nbc_req->data.wr.wed_vars = wed_vars; - - wed_vars->fd = vars->fd; - wed_vars->buf = vars->buf; - wed_vars->write_buf = vars->write_buf; - wed_vars->flat_buf = vars->flat_buf; - wed_vars->offset_list = vars->offset_list; - wed_vars->len_list = vars->len_list; - wed_vars->send_size = vars->send_size; - wed_vars->recv_size = vars->recv_size; - wed_vars->off = vars->off; - wed_vars->size = (int)vars->size; - wed_vars->count = vars->count; - wed_vars->start_pos = vars->start_pos; - wed_vars->partial_recv = vars->partial_recv; - wed_vars->sent_to_proc = vars->sent_to_proc; - wed_vars->nprocs = vars->nprocs; - wed_vars->myrank = vars->myrank; - wed_vars->buftype_is_contig = vars->buftype_is_contig; - wed_vars->contig_access_count = vars->contig_access_count; - wed_vars->min_st_offset = vars->min_st_offset; - wed_vars->fd_size = vars->fd_size; - wed_vars->fd_start = vars->fd_start; - wed_vars->fd_end = vars->fd_end; - wed_vars->others_req = vars->others_req; - wed_vars->send_buf_idx = vars->send_buf_idx; - wed_vars->curr_to_proc = vars->curr_to_proc; - wed_vars->done_to_proc = vars->done_to_proc; - wed_vars->hole = &vars->hole; - wed_vars->iter = vars->m; - wed_vars->buftype_extent = vars->buftype_extent; - wed_vars->buf_idx = vars->buf_idx; - wed_vars->next_fn = ADIOI_Iexch_and_write_l2_end; - - /* nothing to recv, but check for send. */ - ADIOI_W_Iexchange_data(nbc_req, error_code); -} - -static void ADIOI_Iexch_and_write_l2_end(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - - vars->m++; - ADIOI_Iexch_and_write_l2_begin(nbc_req, error_code); -} - -static void ADIOI_Iexch_and_write_fini(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_Iexch_and_write_vars *vars = nbc_req->data.wr.eaw_vars; - void (*next_fn)(ADIOI_NBC_Request *, int *); - - ADIOI_Free(vars->curr_offlen_ptr); - ADIOI_Free(vars->count); - ADIOI_Free(vars->partial_recv); - ADIOI_Free(vars->send_size); - ADIOI_Free(vars->recv_size); - ADIOI_Free(vars->sent_to_proc); - ADIOI_Free(vars->start_pos); - ADIOI_Free(vars->send_buf_idx); - ADIOI_Free(vars->curr_to_proc); - ADIOI_Free(vars->done_to_proc); - - next_fn = vars->next_fn; - - /* free the struct for parameters and variables */ - ADIOI_Free(nbc_req->data.wr.eaw_vars); - nbc_req->data.wr.eaw_vars = NULL; - - /* move to the next function */ - next_fn(nbc_req, error_code); -} - - -static void ADIOI_W_Iexchange_data(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; - - /* exchange recv_size info so that each process knows how much to - send to whom. */ - - *error_code = MPI_Ialltoall(vars->recv_size, 1, MPI_INT, vars->send_size, 1, - MPI_INT, vars->fd->comm, &vars->req1); - - nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA; -} - -static void ADIOI_W_Iexchange_data_hole(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; - ADIO_File fd = vars->fd; - int *recv_size = vars->recv_size; - ADIO_Offset off = vars->off; - int size = vars->size; - int *count = vars->count; - int *start_pos = vars->start_pos; - int *partial_recv = vars->partial_recv; - int nprocs = vars->nprocs; - ADIOI_Access *others_req = vars->others_req; - int *hole = vars->hole; - - int i, j, k, *tmp_len, nprocs_recv; - MPI_Datatype *recv_types; - int *srt_len = NULL, sum; - ADIO_Offset *srt_off = NULL; - - /* create derived datatypes for recv */ - - nprocs_recv = 0; - for (i = 0; i < nprocs; i++) if (recv_size[i]) nprocs_recv++; - vars->nprocs_recv = nprocs_recv; - - recv_types = (MPI_Datatype *) - ADIOI_Malloc((nprocs_recv+1)*sizeof(MPI_Datatype)); - vars->recv_types = recv_types; - /* +1 to avoid a 0-size malloc */ - - tmp_len = (int *)ADIOI_Malloc(nprocs*sizeof(int)); - j = 0; - for (i = 0; i < nprocs; i++) { - if (recv_size[i]) { - /* take care if the last off-len pair is a partial recv */ - if (partial_recv[i]) { - k = start_pos[i] + count[i] - 1; - tmp_len[i] = others_req[i].lens[k]; - others_req[i].lens[k] = partial_recv[i]; - } - ADIOI_Type_create_hindexed_x(count[i], - &(others_req[i].lens[start_pos[i]]), - &(others_req[i].mem_ptrs[start_pos[i]]), - MPI_BYTE, recv_types+j); - /* absolute displacements; use MPI_BOTTOM in recv */ - MPI_Type_commit(recv_types+j); - j++; - } - } - - /* To avoid a read-modify-write, check if there are holes in the - data to be written. For this, merge the (sorted) offset lists - others_req using a heap-merge. */ - - sum = 0; - for (i = 0; i < nprocs; i++) sum += count[i]; - /* valgrind-detcted optimization: if there is no work on this process we do - * not need to search for holes */ - if (sum) { - srt_off = (ADIO_Offset *)ADIOI_Malloc(sum*sizeof(ADIO_Offset)); - srt_len = (int *)ADIOI_Malloc(sum*sizeof(int)); - - ADIOI_Heap_merge(others_req, count, srt_off, srt_len, start_pos, - nprocs, nprocs_recv, sum); - } - - /* for partial recvs, restore original lengths */ - for (i = 0; i < nprocs; i++) - if (partial_recv[i]) { - k = start_pos[i] + count[i] - 1; - others_req[i].lens[k] = tmp_len[i]; - } - ADIOI_Free(tmp_len); - - /* check if there are any holes. If yes, must do read-modify-write. - * holes can be in three places. 'middle' is what you'd expect: the - * processes are operating on noncontigous data. But holes can also show - * up at the beginning or end of the file domain (see John Bent ROMIO REQ - * #835). Missing these holes would result in us writing more data than - * recieved by everyone else. */ - - *hole = 0; - if (sum) { - if (off != srt_off[0]) /* hole at the front */ - *hole = 1; - else { /* coalesce the sorted offset-length pairs */ - for (i = 1; i < sum; i++) { - if (srt_off[i] <= srt_off[0] + srt_len[0]) { - /* ok to cast: operating on cb_buffer_size chunks */ - int new_len = (int)srt_off[i] + srt_len[i] - (int)srt_off[0]; - if (new_len > srt_len[0]) srt_len[0] = new_len; - } - else - break; - } - if (i < sum || size != srt_len[0]) /* hole in middle or end */ - *hole = 1; - } - - ADIOI_Free(srt_off); - ADIOI_Free(srt_len); - } - - if (nprocs_recv) { - if (*hole) { - ADIO_IreadContig(fd, vars->write_buf, size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, off, &vars->req2, - &vars->err); - nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE; - return; - } - } - - ADIOI_W_Iexchange_data_send(nbc_req, error_code); -} - -static void ADIOI_W_Iexchange_data_send(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; - ADIO_File fd = vars->fd; - void *buf = vars->buf; - int *send_size = vars->send_size; - int *recv_size = vars->recv_size; - int nprocs = vars->nprocs; - int myrank = vars->myrank; - int iter = vars->iter; - int *buf_idx = vars->buf_idx; - - int nprocs_recv = vars->nprocs_recv; - MPI_Datatype *recv_types = vars->recv_types; - - int i, j; - int nprocs_send; - char **send_buf = NULL; - - nprocs_send = 0; - for (i = 0; i < nprocs; i++) if (send_size[i]) nprocs_send++; - vars->nprocs_send = nprocs_send; - - if (fd->atomicity) { - /* bug fix from Wei-keng Liao and Kenin Coloma */ - vars->requests = (MPI_Request *) - ADIOI_Malloc((nprocs_send+1)*sizeof(MPI_Request)); - vars->send_req = vars->requests; - } - else { - vars->requests = (MPI_Request *) - ADIOI_Malloc((nprocs_send+nprocs_recv+1)*sizeof(MPI_Request)); - /* +1 to avoid a 0-size malloc */ - - /* post receives */ - j = 0; - for (i = 0; i < nprocs; i++) { - if (recv_size[i]) { - MPI_Irecv(MPI_BOTTOM, 1, recv_types[j], i, myrank+i+100*iter, - fd->comm, vars->requests+j); - j++; - } - } - vars->send_req = vars->requests + nprocs_recv; - } - - /* post sends. if buftype_is_contig, data can be directly sent from - user buf at location given by buf_idx. else use send_buf. */ - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5032, 0, NULL); -#endif - if (vars->buftype_is_contig) { - j = 0; - for (i = 0; i < nprocs; i++) - if (send_size[i]) { - MPI_Isend(((char *) buf) + buf_idx[i], send_size[i], - MPI_BYTE, i, myrank+i+100*iter, fd->comm, - vars->send_req+j); - j++; - buf_idx[i] += send_size[i]; - } - } - else if (nprocs_send) { - /* buftype is not contig */ - send_buf = (char **)ADIOI_Malloc(nprocs*sizeof(char*)); - vars->send_buf = send_buf; - for (i = 0; i < nprocs; i++) - if (send_size[i]) - send_buf[i] = (char *)ADIOI_Malloc(send_size[i]); - - ADIOI_Fill_send_buffer(fd, buf, vars->flat_buf, send_buf, - vars->offset_list, vars->len_list, send_size, - vars->send_req, - vars->sent_to_proc, nprocs, myrank, - vars->contig_access_count, - vars->min_st_offset, vars->fd_size, - vars->fd_start, vars->fd_end, - vars->send_buf_idx, vars->curr_to_proc, - vars->done_to_proc, iter, - vars->buftype_extent); - /* the send is done in ADIOI_Fill_send_buffer */ - } - - if (fd->atomicity) { - vars->req3 = (MPI_Request *) - ADIOI_Malloc((nprocs_recv+1)*sizeof(MPI_Request)); - /* +1 to avoid a 0-size malloc */ - - /* bug fix from Wei-keng Liao and Kenin Coloma */ - j = 0; - for (i = 0; i < nprocs; i++) { - if (recv_size[i]) { - MPI_Irecv(MPI_BOTTOM, 1, recv_types[j], i, myrank+i+100*iter, - fd->comm, vars->req3+j); - j++; - } - } - - nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND; - return; - } - - ADIOI_W_Iexchange_data_wait(nbc_req, error_code); -} - -static void ADIOI_W_Iexchange_data_wait(ADIOI_NBC_Request *nbc_req, - int *error_code) -{ - ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; - ADIO_File fd = vars->fd; - int nprocs_send = vars->nprocs_send; - int nprocs_recv = vars->nprocs_recv; - MPI_Datatype *recv_types = vars->recv_types; - int i; - - for (i = 0; i < nprocs_recv; i++) MPI_Type_free(recv_types+i); - ADIOI_Free(recv_types); - - i= 0; - if (fd->atomicity) { - /* bug fix from Wei-keng Liao and Kenin Coloma */ - MPI_Testall(nprocs_send, vars->send_req, &i, MPI_STATUSES_IGNORE); - } - else { - MPI_Testall(nprocs_send+nprocs_recv, vars->requests, &i, - MPI_STATUSES_IGNORE); - } - - if (i) { - ADIOI_W_Iexchange_data_fini(nbc_req, error_code); - } else { - nbc_req->data.wr.state = ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT; - } -} - -static void ADIOI_W_Iexchange_data_fini(ADIOI_NBC_Request *nbc_req, int *error_code) -{ - ADIOI_W_Iexchange_data_vars *vars = nbc_req->data.wr.wed_vars; - void (*next_fn)(ADIOI_NBC_Request *, int *); - ADIO_File fd = vars->fd; - int *send_size = vars->send_size; - int nprocs = vars->nprocs; - char **send_buf = vars->send_buf; - int i; - - if (fd->atomicity) ADIOI_Free(vars->req3); - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5033, 0, NULL); -#endif - ADIOI_Free(vars->requests); - if (!vars->buftype_is_contig && vars->nprocs_send) { - for (i = 0; i < nprocs; i++) - if (send_size[i]) ADIOI_Free(send_buf[i]); - ADIOI_Free(send_buf); - } - - next_fn = vars->next_fn; - - /* free the structure for parameters and variables */ - ADIOI_Free(vars); - nbc_req->data.wr.wed_vars = NULL; - - /* move to the next function */ - next_fn(nbc_req, error_code); -} - - -static int ADIOI_GEN_iwc_query_fn(void *extra_state, MPI_Status *status) -{ - ADIOI_NBC_Request *nbc_req; - - nbc_req = (ADIOI_NBC_Request *)extra_state; - - MPI_Status_set_elements_x(status, MPI_BYTE, nbc_req->nbytes); - - /* can never cancel so always true */ - MPI_Status_set_cancelled(status, 0); - - /* choose not to return a value for this */ - status->MPI_SOURCE = MPI_UNDEFINED; - /* tag has no meaning for this generalized request */ - status->MPI_TAG = MPI_UNDEFINED; - - /* this generalized request never fails */ - return MPI_SUCCESS; -} - -static int ADIOI_GEN_iwc_free_fn(void *extra_state) -{ - ADIOI_NBC_Request *nbc_req; - - nbc_req = (ADIOI_NBC_Request *)extra_state; - ADIOI_Free(nbc_req); - - return MPI_SUCCESS; -} - -static int ADIOI_GEN_iwc_poll_fn(void *extra_state, MPI_Status *status) -{ - ADIOI_NBC_Request *nbc_req; - ADIOI_GEN_IwriteStridedColl_vars *wsc_vars = NULL; - ADIOI_Icalc_others_req_vars *cor_vars = NULL; - ADIOI_Iexch_and_write_vars *eaw_vars = NULL; - ADIOI_W_Iexchange_data_vars *wed_vars = NULL; - int errcode = MPI_SUCCESS; - int flag; - - nbc_req = (ADIOI_NBC_Request *)extra_state; - - switch (nbc_req->data.wr.state) { - case ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL: - wsc_vars = nbc_req->data.wr.wsc_vars; - errcode = MPI_Testall(2, wsc_vars->req_offset, &flag, - MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_GEN_IwriteStridedColl_inter(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO: - wsc_vars = nbc_req->data.wr.wsc_vars; - errcode = MPI_Test(&wsc_vars->req_ind_io, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - /* call the last function */ - ADIOI_GEN_IwriteStridedColl_fini(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST: - wsc_vars = nbc_req->data.wr.wsc_vars; - errcode = MPI_Test(&wsc_vars->req_err, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - errcode = wsc_vars->error_code; - ADIOI_GEN_IwriteStridedColl_free(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_ICALC_OTHERS_REQ: - cor_vars = nbc_req->cor_vars; - errcode = MPI_Test(&cor_vars->req1, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_Icalc_others_req_main(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN: - cor_vars = nbc_req->cor_vars; - if (cor_vars->num_req2) { - errcode = MPI_Testall(cor_vars->num_req2, cor_vars->req2, - &flag, MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_Icalc_others_req_fini(nbc_req, &errcode); - } - } else { - ADIOI_Icalc_others_req_fini(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_IEXCH_AND_WRITE: - eaw_vars = nbc_req->data.wr.eaw_vars; - errcode = MPI_Test(&eaw_vars->req1, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - eaw_vars->m = 0; - ADIOI_Iexch_and_write_l1_begin(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY: - eaw_vars = nbc_req->data.wr.eaw_vars; - errcode = MPI_Test(&eaw_vars->req3, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_Iexch_and_write_l1_end(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_W_IEXCHANGE_DATA: - wed_vars = nbc_req->data.wr.wed_vars; - errcode = MPI_Test(&wed_vars->req1, &flag, MPI_STATUS_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_W_Iexchange_data_hole(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE: - wed_vars = nbc_req->data.wr.wed_vars; - errcode = MPI_Test(&wed_vars->req2, &flag, MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - /* --BEGIN ERROR HANDLING-- */ - if (wed_vars->err != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(wed_vars->err, - MPIR_ERR_RECOVERABLE, - "ADIOI_W_EXCHANGE_DATA", - __LINE__, MPI_ERR_IO, - "**ioRMWrdwr", 0); - break;; - } - /* --END ERROR HANDLING-- */ - ADIOI_W_Iexchange_data_send(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND: - wed_vars = nbc_req->data.wr.wed_vars; - errcode = MPI_Testall(wed_vars->nprocs_recv, wed_vars->req3, - &flag, MPI_STATUSES_IGNORE); - if (errcode == MPI_SUCCESS && flag) { - ADIOI_W_Iexchange_data_wait(nbc_req, &errcode); - } - break; - - case ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT: - wed_vars = nbc_req->data.wr.wed_vars; - if (wed_vars->fd->atomicity) { - /* bug fix from Wei-keng Liao and Kenin Coloma */ - errcode = MPI_Testall(wed_vars->nprocs_send, wed_vars->send_req, - &flag, MPI_STATUSES_IGNORE); - } else { - errcode = MPI_Testall(wed_vars->nprocs_send + - wed_vars->nprocs_recv, - wed_vars->requests, - &flag, MPI_STATUSES_IGNORE); - } - if (errcode == MPI_SUCCESS && flag) { - ADIOI_W_Iexchange_data_fini(nbc_req, &errcode); - } - break; - - default: - break; - } - - /* --BEGIN ERROR HANDLING-- */ - if (errcode != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_iwc_poll_fn", __LINE__, - MPI_ERR_IO, "**mpi_grequest_complete", - 0); - } - /* --END ERROR HANDLING-- */ - - return errcode; -} - -/* wait for multiple requests to complete */ -static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states, - double timeout, MPI_Status *status) -{ - int i, errcode = MPI_SUCCESS; - double starttime; - ADIOI_NBC_Request **nbc_reqlist; - - nbc_reqlist = (ADIOI_NBC_Request **)array_of_states; - - starttime = MPI_Wtime(); - for (i = 0; i < count ; i++) { - while (nbc_reqlist[i]->data.wr.state != ADIOI_IWC_STATE_COMPLETE) { - errcode = ADIOI_GEN_iwc_poll_fn(nbc_reqlist[i], MPI_STATUS_IGNORE); - /* --BEGIN ERROR HANDLING-- */ - if (errcode != MPI_SUCCESS) { - errcode = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - "ADIOI_GEN_iwc_wait_fn", - __LINE__, MPI_ERR_IO, - "**mpi_grequest_complete", 0); - } - /* --END ERROR HANDLING-- */ - - if ((timeout > 0) && (timeout < (MPI_Wtime() - starttime))) - goto fn_exit; - - /* If the progress engine is blocked, we have to yield for another - * thread to be able to unblock the progress engine. */ - MPIR_Ext_cs_yield(); - } - } - - fn_exit: - return errcode; -} - -#endif /* HAVE_MPI_GREQUEST_EXTENSIONS */ diff --git a/3rd-party/romio321/adio/common/ad_iwrite_coll.pdf b/3rd-party/romio321/adio/common/ad_iwrite_coll.pdf deleted file mode 100644 index 8efe138a1e3..00000000000 Binary files a/3rd-party/romio321/adio/common/ad_iwrite_coll.pdf and /dev/null differ diff --git a/3rd-party/romio321/adio/common/ad_iwrite_fake.c b/3rd-party/romio321/adio/common/ad_iwrite_fake.c deleted file mode 100644 index 6210942e663..00000000000 --- a/3rd-party/romio321/adio/common/ad_iwrite_fake.c +++ /dev/null @@ -1,65 +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 "adio.h" - -#include "mpiu_greq.h" - -/* Generic implementation of IwriteContig calls the blocking WriteContig - * immediately. - */ -void ADIOI_FAKE_IwriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code) -{ - ADIO_Status status; - MPI_Offset len; - MPI_Count typesize; - MPI_Offset nbytes=0; - - MPI_Type_size_x(datatype, &typesize); - len = (MPI_Offset)count * (MPI_Offset)typesize; - - /* Call the blocking function. It will create an error code - * if necessary. - */ - ADIOI_Assert(len == (int) len); /* the count is an int parm */ - ADIO_WriteContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset, - &status, error_code); - if (*error_code == MPI_SUCCESS) { - MPI_Type_size_x(datatype, &typesize); - nbytes = (MPI_Offset)count*(MPI_Offset)typesize; - } - MPIO_Completed_request_create(&fd, nbytes, error_code, request); - -} - - -/* Generic implementation of IwriteStrided calls the blocking WriteStrided - * immediately. - */ -void ADIOI_FAKE_IwriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code) -{ - ADIO_Status status; - MPI_Count typesize; - MPI_Offset nbytes=0; - - /* Call the blocking function. It will create an error code - * if necessary. - */ - ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, - offset, &status, error_code); - if (*error_code == MPI_SUCCESS) { - MPI_Type_size_x(datatype, &typesize); - nbytes = (MPI_Offset)count * (MPI_Offset)typesize; - } - MPIO_Completed_request_create(&fd, nbytes, error_code, request); -} diff --git a/3rd-party/romio321/adio/common/ad_open.c b/3rd-party/romio321/adio/common/ad_open.c deleted file mode 100644 index ced256d3494..00000000000 --- a/3rd-party/romio321/adio/common/ad_open.c +++ /dev/null @@ -1,337 +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 "adio_cb_config_list.h" - -#include "mpio.h" -static int is_aggregator(int rank, ADIO_File fd); -static int uses_generic_read(ADIO_File fd); -static int uses_generic_write(ADIO_File fd); -static int build_cb_config_list(ADIO_File fd, - MPI_Comm orig_comm, MPI_Comm comm, - int rank, int procs, int *error_code); - -MPI_File ADIO_Open(MPI_Comm orig_comm, - MPI_Comm comm, const char *filename, int file_system, - ADIOI_Fns *ops, - int access_mode, ADIO_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, - MPI_Info info, int perm, int *error_code) -{ - MPI_File mpi_fh; - ADIO_File fd; - int err, rank, procs; - static char myname[] = "ADIO_OPEN"; - int max_error_code; - MPI_Info dupinfo; - int syshints_processed, can_skip; - char *p; - - *error_code = MPI_SUCCESS; - - /* obtain MPI_File handle */ - mpi_fh = MPIO_File_create(sizeof(struct ADIOI_FileD)); - if (mpi_fh == MPI_FILE_NULL) { - fd = MPI_FILE_NULL; - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - goto fn_exit; - - } - fd = MPIO_File_resolve(mpi_fh); - - fd->cookie = ADIOI_FILE_COOKIE; - fd->fp_ind = disp; - fd->fp_sys_posn = 0; - fd->comm = comm; /* dup'ed in MPI_File_open */ - fd->filename = ADIOI_Strdup(filename); - fd->file_system = file_system; - fd->fs_ptr = NULL; - - fd->fns = ops; - - fd->disp = disp; - fd->split_coll_count = 0; - fd->shared_fp_fd = ADIO_FILE_NULL; - fd->atomicity = 0; - fd->etype = etype; /* MPI_BYTE by default */ - fd->filetype = filetype; /* MPI_BYTE by default */ - fd->etype_size = 1; /* default etype is MPI_BYTE */ - - fd->file_realm_st_offs = NULL; - fd->file_realm_types = NULL; - - fd->perm = perm; - - fd->async_count = 0; - - fd->fortran_handle = -1; - - fd->err_handler = ADIOI_DFLT_ERR_HANDLER; - - fd->io_buf_window = MPI_WIN_NULL; - fd->io_buf_put_amounts_window = MPI_WIN_NULL; - - MPI_Comm_rank(comm, &rank); - MPI_Comm_size(comm, &procs); -/* create and initialize info object */ - fd->hints = (ADIOI_Hints *)ADIOI_Calloc(1, sizeof(struct ADIOI_Hints_struct)); - if (fd->hints == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - goto fn_exit; - } - fd->hints->cb_config_list = NULL; - fd->hints->ranklist = NULL; - fd->hints->initialized = 0; - fd->info = MPI_INFO_NULL; - - /* move system-wide hint processing *back* into open, but this time the - * hintfile reader will do a scalable read-and-broadcast. The global - * ADIOI_syshints will get initialized at first open. subsequent open - * calls will just use result from first open. - * - * We have two goals here: - * 1: avoid processing the hintfile multiple times - * 2: have all processes participate in hintfile processing (so we can read-and-broadcast) - * - * a code might do an "initialize from 0", so we can only skip hint - * processing once everyone has particpiated in hint processing */ - if (ADIOI_syshints == MPI_INFO_NULL) - syshints_processed = 0; - else - syshints_processed = 1; - - MPI_Allreduce(&syshints_processed, &can_skip, 1, MPI_INT, MPI_MIN, fd->comm); - if (!can_skip) { - if (ADIOI_syshints == MPI_INFO_NULL) - MPI_Info_create(&ADIOI_syshints); - ADIOI_process_system_hints(fd, ADIOI_syshints); - } - - ADIOI_incorporate_system_hints(info, ADIOI_syshints, &dupinfo); - ADIO_SetInfo(fd, dupinfo, &err); - if (dupinfo != MPI_INFO_NULL) { - *error_code = MPI_Info_free(&dupinfo); - if (*error_code != MPI_SUCCESS) - goto fn_exit; - } - ADIOI_Info_set(fd->info, "romio_filesystem_type", fd->fns->fsname); - - /* Instead of repeatedly allocating this buffer in collective read/write, - * allocating up-front might make memory management on small platforms - * (e.g. Blue Gene) more efficent */ - - fd->io_buf = ADIOI_Malloc(fd->hints->cb_buffer_size); - /* deferred open: - * we can only do this optimization if 'fd->hints->deferred_open' is set - * (which means the user hinted 'no_indep_rw' and collective buffering). - * Furthermore, we only do this if our collective read/write routines use - * our generic function, and not an fs-specific routine (we can defer opens - * only if we use our aggreagation code). */ - if (fd->hints->deferred_open && - !(uses_generic_read(fd) \ - && uses_generic_write(fd))) { - fd->hints->deferred_open = 0; - } - if (ADIO_Feature(fd, ADIO_SCALABLE_OPEN)) - /* disable deferred open on these fs so that scalable broadcast - * will always use the propper communicator */ - fd->hints->deferred_open = 0; - - - /* on BlueGene, the cb_config_list is built when hints are processed. No - * one else does that right now */ - if (fd->hints->ranklist == NULL) { - build_cb_config_list(fd, orig_comm, comm, rank, procs, error_code); - if (*error_code != MPI_SUCCESS) - goto fn_exit; - } - fd->is_open = 0; - fd->my_cb_nodes_index = -2; - fd->is_agg = is_aggregator(rank, fd); - /* deferred open used to split the communicator to create an "aggregator - * communicator", but we only used it as a way to indicate that deferred - * open happened. fd->is_open and fd->is_agg are sufficient */ - - /* actual opens start here */ - /* generic open: one process opens to create the file, all others open */ - /* nfs open: everybody opens or else you'll end up with "file not found" - * due to stupid nfs consistency semantics */ - /* scalable open: one process opens and broadcasts results to everyone */ - - ADIOI_OpenColl(fd, rank, access_mode, error_code); - - /* deferred open consideration: if an independent process lied about - * "no_indep_rw" and opens the file later (example: HDF5 uses independent - * i/o for metadata), that deferred open will use the access_mode provided - * by the user. CREATE|EXCL only makes sense here -- exclusive access in - * the deferred open case is going to fail and surprise the user. Turn off - * the excl amode bit. Save user's ammode for MPI_FILE_GET_AMODE */ - fd->orig_access_mode = access_mode; - if (fd->access_mode & ADIO_EXCL) fd->access_mode ^= ADIO_EXCL; - - - /* for debugging, it can be helpful to see the hints selected. Some file - * systes set up the hints in the open call (e.g. lustre) */ - p = getenv("ROMIO_PRINT_HINTS"); - if (rank == 0 && p != NULL ) { - ADIOI_Info_print_keyvals(fd->info); - } - - fn_exit: - MPI_Allreduce(error_code, &max_error_code, 1, MPI_INT, MPI_MAX, comm); - if (max_error_code != MPI_SUCCESS) { - - /* If the file was successfully opened, close it */ - if (*error_code == MPI_SUCCESS) { - - /* in the deferred open case, only those who have actually - opened the file should close it */ - if (fd->hints->deferred_open) { - if (fd->is_agg) { - (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); - } - } - else { - (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); - } - } - ADIOI_Free(fd->filename); - ADIOI_Free(fd->hints->ranklist); - if ( fd->hints->cb_config_list != NULL ) ADIOI_Free(fd->hints->cb_config_list); - ADIOI_Free(fd->hints); - if (fd->info != MPI_INFO_NULL) MPI_Info_free(&(fd->info)); - ADIOI_Free(fd->io_buf); - ADIOI_Free(fd); - fd = ADIO_FILE_NULL; - if (*error_code == MPI_SUCCESS) - { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_IO, - "**oremote_fail", 0); - } - } - - return fd; -} - -/* a simple linear search. possible enancement: add a my_cb_nodes_index member - * ( index into cb_nodes, else -1 if not aggregator ) for faster lookups - * - * fd->hints->cb_nodes is the number of aggregators - * fd->hints->ranklist[] is an array of the ranks of aggregators - * - * might want to move this to adio/common/cb_config_list.c - */ -int is_aggregator(int rank, ADIO_File fd ) { - int i; - - if (fd->my_cb_nodes_index == -2) { - for (i=0; i< fd->hints->cb_nodes; i++ ) { - if ( rank == fd->hints->ranklist[i] ) { - fd->my_cb_nodes_index = i; - return 1; - } - } - fd->my_cb_nodes_index = -1; - } - else if (fd->my_cb_nodes_index != -1) - return 1; - - return 0; -} - -/* - * If file system implements some version of two-phase -- doesn't have to be - * generic -- we can still carry out the defered open optimization - */ -static int uses_generic_read(ADIO_File fd) -{ - if (ADIO_Feature(fd, ADIO_TWO_PHASE)) - return 1; - return 0; -} - -static int uses_generic_write(ADIO_File fd) -{ - if (ADIO_Feature(fd, ADIO_TWO_PHASE)) - return 1; - return 0; -} - -static int build_cb_config_list(ADIO_File fd, - MPI_Comm orig_comm, MPI_Comm comm, - int rank, int procs, int *error_code) -{ - ADIO_cb_name_array array; - int *tmp_ranklist; - int rank_ct; - char *value; - static char myname[] = "ADIO_OPEN cb_config_list"; - - /* gather the processor name array if we don't already have it */ - /* this has to be done early in ADIO_Open so that we can cache the name - * array in both the dup'd communicator (in case we want it later) and the - * original communicator */ - ADIOI_cb_gather_name_array(orig_comm, comm, &array); - -/* parse the cb_config_list and create a rank map on rank 0 */ - if (rank == 0) { - tmp_ranklist = (int *) ADIOI_Malloc(sizeof(int) * procs); - if (tmp_ranklist == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return 0; - } - - rank_ct = ADIOI_cb_config_list_parse(fd->hints->cb_config_list, - array, tmp_ranklist, - fd->hints->cb_nodes); - - /* store the ranklist using the minimum amount of memory */ - if (rank_ct > 0) { - fd->hints->ranklist = (int *) ADIOI_Malloc(sizeof(int) * rank_ct); - memcpy(fd->hints->ranklist, tmp_ranklist, sizeof(int) * rank_ct); - } - ADIOI_Free(tmp_ranklist); - fd->hints->cb_nodes = rank_ct; - /* TEMPORARY -- REMOVE WHEN NO LONGER UPDATING INFO FOR FS-INDEP. */ - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", rank_ct); - ADIOI_Info_set(fd->info, "cb_nodes", value); - ADIOI_Free(value); - } - - ADIOI_cb_bcast_rank_map(fd); - if (fd->hints->cb_nodes <= 0) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**ioagnomatch", 0); - fd = ADIO_FILE_NULL; - } - return 0; -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/common/ad_opencoll.c b/3rd-party/romio321/adio/common/ad_opencoll.c deleted file mode 100644 index 467a322a340..00000000000 --- a/3rd-party/romio321/adio/common/ad_opencoll.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2007 UChicago/Argonne LLC - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" - -/* Generic version of a "collective open". Assumes a "real" underlying - * file system (meaning no wonky consistency semantics like NFS). - * - * optimization: by having just one process create a file, close it, - * then have all N processes open it, we can possibly avoid contention - * for write locks on a directory for some file systems. - * - * Happy side-effect: exclusive create (error if file already exists) - * just falls out - * - * Note: this is not a "scalable open" (c.f. "The impact of file systems - * on MPI-IO scalability"). - */ - -void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, - int access_mode, int *error_code) -{ - int orig_amode_excl, orig_amode_wronly; - MPI_Comm tmp_comm; - - orig_amode_excl = access_mode; - - if (access_mode & ADIO_CREATE ){ - if(rank == fd->hints->ranklist[0]) { - /* remove delete_on_close flag if set */ - if (access_mode & ADIO_DELETE_ON_CLOSE) - fd->access_mode = access_mode ^ ADIO_DELETE_ON_CLOSE; - else - fd->access_mode = access_mode; - - tmp_comm = fd->comm; - fd->comm = MPI_COMM_SELF; - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - fd->comm = tmp_comm; - MPI_Bcast(error_code, 1, MPI_INT, \ - fd->hints->ranklist[0], fd->comm); - /* if no error, close the file and reopen normally below */ - if (*error_code == MPI_SUCCESS) - (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); - - fd->access_mode = access_mode; /* back to original */ - } - else MPI_Bcast(error_code, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - - if (*error_code != MPI_SUCCESS) { - return; - } - else { - /* turn off CREAT (and EXCL if set) for real multi-processor open */ - access_mode ^= ADIO_CREATE; - if (access_mode & ADIO_EXCL) - access_mode ^= ADIO_EXCL; - } - } - fd->blksize = 1024*1024*4; /* this large default value should be good for - most file systems. any ROMIO driver is free - to stat the file and find an optimial value */ - - /* if we are doing deferred open, non-aggregators should return now */ - if (fd->hints->deferred_open ) { - if (!(fd->is_agg)) { - /* we might have turned off EXCL for the aggregators. - * restore access_mode that non-aggregators get the right - * value from get_amode */ - fd->access_mode = orig_amode_excl; - /* In file-system specific open, a driver might collect some - * information via stat(). Deferred open means not every process - * participates in fs-specific open, but they all participate in - * this open call. Broadcast a bit of information in case - * lower-level file system driver (e.g. 'bluegene') collected it - * (not all do)*/ - MPI_Bcast(&(fd->blksize), 1, MPI_LONG, fd->hints->ranklist[0], fd->comm); - *error_code = MPI_SUCCESS; - ADIOI_Assert(fd->blksize > 0); - return; - } - } - -/* For writing with data sieving, a read-modify-write is needed. If - the file is opened for write_only, the read will fail. Therefore, - if write_only, open the file as read_write, but record it as write_only - in fd, so that get_amode returns the right answer. */ - - /* observation from David Knaak: file systems that do not support data - * sieving do not need to change the mode */ - - orig_amode_wronly = access_mode; - if ( (access_mode & ADIO_WRONLY) && - ADIO_Feature(fd, ADIO_DATA_SIEVING_WRITES) ) { - access_mode = access_mode ^ ADIO_WRONLY; - access_mode = access_mode | ADIO_RDWR; - } - fd->access_mode = access_mode; - - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - - /* if error, may be it was due to the change in amode above. - therefore, reopen with access mode provided by the user.*/ - fd->access_mode = orig_amode_wronly; - if (*error_code != MPI_SUCCESS) - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - - /* if we turned off EXCL earlier, then we should turn it back on */ - if (fd->access_mode != orig_amode_excl) fd->access_mode = orig_amode_excl; - - /* broadcast a bit of information (blocksize for now) to all proceses in - * communicator, not just those who participated in open */ - MPI_Bcast(&(fd->blksize), 1, MPI_LONG, fd->hints->ranklist[0], fd->comm); - /* file domain code will get terribly confused in a hard-to-debug way if - * gpfs blocksize not sensible */ - ADIOI_Assert( fd->blksize > 0); - /* for deferred open: this process has opened the file (because if we are - * not an aggregaor and we are doing deferred open, we returned earlier)*/ - fd->is_open = 1; - -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/common/ad_opencoll_failsafe.c b/3rd-party/romio321/adio/common/ad_opencoll_failsafe.c deleted file mode 100644 index 962f191c1f9..00000000000 --- a/3rd-party/romio321/adio/common/ad_opencoll_failsafe.c +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2007 UChicago/Argonne LLC - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" - - -/* this "collective" open is useful for frankly broken file systems such - * as NFS where a create from one client might not be immediately - * visible on another */ - -void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, - int access_mode, int *error_code) -{ - MPI_Comm tmp_comm; - int orig_amode_excl, orig_amode_wronly; - - orig_amode_excl = access_mode; - if ((access_mode & ADIO_CREATE) && (access_mode & ADIO_EXCL)) { - /* the open should fail if the file exists. Only *1* process - * should check this. Otherwise, if all processes try to check - * and the file does not exist, one process will create the file - * and others who reach later will return error. */ - if(rank == fd->hints->ranklist[0]) { - fd->access_mode = access_mode; - - /* if the lower-level file system tries to communicate, COMM_SELF - * will ensure it doesn't get stuck waiting for non-existant - * participants */ - tmp_comm = fd->comm; - fd->comm = MPI_COMM_SELF; - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - MPI_Bcast(error_code, 1, MPI_INT, \ - fd->hints->ranklist[0], tmp_comm); - /* if no error, close the file and reopen normally below */ - if (*error_code == MPI_SUCCESS) - (*(fd->fns->ADIOI_xxx_Close))(fd, error_code); - /* and put it all back the way we found it for subsequent code */ - fd->comm = tmp_comm; - } - else MPI_Bcast(error_code, 1, MPI_INT, - fd->hints->ranklist[0], fd->comm); - if (*error_code != MPI_SUCCESS) { - return; - } - else { - /* turn off EXCL for real open */ - access_mode = access_mode ^ ADIO_EXCL; - } - } - /* if we are doing deferred open, non-aggregators should return now */ - if (fd->hints->deferred_open && !(fd->is_agg)) { - /* we might have turned off EXCL for the aggregators. - * restore access_mode that non-aggregators get the right - * value from get_amode */ - fd->access_mode = orig_amode_excl; - *error_code = MPI_SUCCESS; - return; - } - -/* For writing with data sieving, a read-modify-write is needed. If - the file is opened for write_only, the read will fail. Therefore, - if write_only, open the file as read_write, but record it as write_only - in fd, so that get_amode returns the right answer. */ - - orig_amode_wronly = access_mode; - if (access_mode & ADIO_WRONLY) { - access_mode = access_mode ^ ADIO_WRONLY; - access_mode = access_mode | ADIO_RDWR; - } - fd->access_mode = access_mode; - - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - - /* if error, may be it was due to the change in amode above. - therefore, reopen with access mode provided by the user.*/ - fd->access_mode = orig_amode_wronly; - if (*error_code != MPI_SUCCESS) - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - - if(*error_code != MPI_SUCCESS) return; - /* if we turned off EXCL earlier, then we should turn it back on */ - if (fd->access_mode != orig_amode_excl) fd->access_mode = orig_amode_excl; - - /* for deferred open: this process has opened the file (because if we are - * not an aggregaor and we are doing deferred open, we returned earlier)*/ - fd->is_open = 1; -} - - - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/common/ad_opencoll_scalable.c b/3rd-party/romio321/adio/common/ad_opencoll_scalable.c deleted file mode 100644 index 1c472017f53..00000000000 --- a/3rd-party/romio321/adio/common/ad_opencoll_scalable.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2007 UChicago/Argonne LLC - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" - -/* - * Scalable open: for file systems capable of having one process - * create/open a file and broadcast the result to everyone else. - * - Does not need one process to create the file - * - Does not need special handling for CREATE|EXCL - */ -void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, - int access_mode, int *error_code) -{ - int orig_amode_wronly; - - /* if we are doing deferred open, non-aggregators should return now */ - if (fd->hints->deferred_open && !(fd->is_agg)) { - *error_code = MPI_SUCCESS; - return; - } - - /* For writing with data sieving, a read-modify-write is needed. If - the file is opened for write_only, the read will fail. Therefore, - if write_only, open the file as read_write, but record it as - write_only in fd, so that get_amode returns the right answer. */ - - orig_amode_wronly = access_mode; - if (access_mode & ADIO_WRONLY) { - access_mode = access_mode ^ ADIO_WRONLY; - access_mode = access_mode | ADIO_RDWR; - } - fd->access_mode = access_mode; - - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - - /* if error, may be it was due to the change in amode above. - therefore, reopen with access mode provided by the user.*/ - fd->access_mode = orig_amode_wronly; - if (*error_code != MPI_SUCCESS) - (*(fd->fns->ADIOI_xxx_Open))(fd, error_code); - - /* for deferred open: this process has opened the file (because if we are - * not an aggregaor and we are doing deferred open, we returned earlier)*/ - fd->is_open = 1; - -} - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/common/ad_prealloc.c b/3rd-party/romio321/adio/common/ad_prealloc.c deleted file mode 100644 index 9462f775aa6..00000000000 --- a/3rd-party/romio321/adio/common/ad_prealloc.c +++ /dev/null @@ -1,91 +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 "adio.h" -#include "adio_extern.h" - -/* this used to be implemented in every file system as an fcntl, but the code - * is identical for all file systems without a real "preallocate" system call. - * This naive approach will get the job done, but not in a terribly efficient - * manner. - */ -void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code) -{ - ADIO_Offset curr_fsize, alloc_size, size, len, done, ntimes; - ADIO_Status status; - int i; - char *buf; - ADIO_Fcntl_t *fcntl_struct; - static char myname[] = "ADIOI_GEN_PREALLOC"; - - /* will be called by one process only */ - /* On file systems with no preallocation function, we have to - explicitly write - to allocate space. Since there could be holes in the file, - we need to read up to the current file size, write it back, - and then write beyond that depending on how much - preallocation is needed. - read/write in sizes of no more than ADIOI_PREALLOC_BUFSZ */ - - /*curr_fsize = fd->fp_ind; */ - fcntl_struct = (ADIO_Fcntl_t *) ADIOI_Malloc(sizeof(ADIO_Fcntl_t)); - ADIO_Fcntl(fd, ADIO_FCNTL_GET_FSIZE, fcntl_struct, error_code); - - curr_fsize = fcntl_struct->fsize; /* don't rely on fd->fp_ind: might be - working on a pre-existing file */ - alloc_size = diskspace; - - size = ADIOI_MIN(curr_fsize, alloc_size); - - ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ; - buf = (char *) ADIOI_Malloc(ADIOI_PREALLOC_BUFSZ); - done = 0; - - for (i=0; i curr_fsize) { - memset(buf, 0, ADIOI_PREALLOC_BUFSZ); - size = alloc_size - curr_fsize; - ntimes = (size + ADIOI_PREALLOC_BUFSZ - 1)/ADIOI_PREALLOC_BUFSZ; - for (i=0; i - -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif -#ifdef ROMIO_GPFS -# include "adio/ad_gpfs/ad_gpfs_tuning.h" -#endif - -#ifdef HAVE_LIMITS_H -#include -#endif - -void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - ssize_t err = -1; - MPI_Count datatype_size; - ADIO_Offset len, bytes_xfered=0; - size_t rd_count; - static char myname[] = "ADIOI_GEN_READCONTIG"; -#ifdef ROMIO_GPFS - double io_time=0; -#endif - char *p; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5034, 0, NULL); -#endif - MPI_Type_size_x(datatype, &datatype_size); - len = datatype_size * (ADIO_Offset)count; - -#ifdef ROMIO_GPFS - io_time = MPI_Wtime(); - if (gpfsmpio_timing) { - gpfsmpio_prof_cr[ GPFSMPIO_CIO_DATA_SIZE ] += len; - } -#endif - - if (file_ptr_type == ADIO_INDIVIDUAL) { - offset = fd->fp_ind; - } - - p=buf; - while (bytes_xfered < len) { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_a, 0, NULL ); -#endif - rd_count = len - bytes_xfered; - /* stupid FreeBSD and Darwin do not like a count larger than a signed - int, even though size_t is eight bytes... */ - if (rd_count > INT_MAX) - rd_count = INT_MAX; -#ifdef ROMIO_GPFS - if (gpfsmpio_devnullio) - err = pread(fd->null_fd, p, rd_count, offset+bytes_xfered); - else -#endif - err = pread(fd->fd_sys, p, rd_count, offset+bytes_xfered); - /* --BEGIN ERROR HANDLING-- */ - if (err == -1) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_IO, "**io", - "**io %s", strerror(errno)); - fd->fp_sys_posn = -1; - return; - } - /* --END ERROR HANDLING-- */ - if (err == 0) { - /* end of file */ - break; - } - -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_read_b, 0, NULL ); -#endif - bytes_xfered += err; - p += err; - } -#ifdef ROMIO_GPFS - if (gpfsmpio_timing) gpfsmpio_prof_cr[ GPFSMPIO_CIO_T_POSI_RW ] += (MPI_Wtime() - io_time); -#endif - fd->fp_sys_posn = offset + bytes_xfered; - - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += bytes_xfered; - } - -#ifdef HAVE_STATUS_SET_BYTES - /* what if we only read half a datatype? */ - /* bytes_xfered could be larger than int */ - if (err != -1) MPIR_Status_set_bytes(status, datatype, bytes_xfered); -#endif - - *error_code = MPI_SUCCESS; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5035, 0, NULL); -#endif -#ifdef ROMIO_GPFS - if (gpfsmpio_timing) gpfsmpio_prof_cr[ GPFSMPIO_CIO_T_MPIO_RW ] += (MPI_Wtime() - io_time); -#endif -} diff --git a/3rd-party/romio321/adio/common/ad_read_coll.c b/3rd-party/romio321/adio/common/ad_read_coll.c deleted file mode 100644 index eaf99e6c2dc..00000000000 --- a/3rd-party/romio321/adio/common/ad_read_coll.c +++ /dev/null @@ -1,1063 +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" - -#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); -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); - - -void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code) -{ -/* 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 *len_list = NULL; - int *buf_idx = NULL; - -#ifdef HAVE_STATUS_SET_BYTES - MPI_Count bufsize, size; -#endif - - if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { - ADIOI_IOStridedColl (fd, buf, count, ADIOI_READ, datatype, - file_ptr_type, offset, status, error_code); - return; - } - - - 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; - - /* 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); - -#ifdef RDCOLL_DEBUG - for (i=0; icomm); - MPI_Allgather(&end_offset, 1, ADIO_OFFSET, end_offsets, 1, - ADIO_OFFSET, fd->comm); - - /* 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 + (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; - } - - /* We're going to perform aggregation of I/O. Here we call - * ADIOI_Calc_file_domains() to determine what processes will handle I/O - * to what regions. We pass nprocs_for_coll into this function; it is - * used to determine how many processes will perform I/O, which is also - * the number of regions into which the range of bytes must be divided. - * These regions are called "file domains", or FDs. - * - * When this function returns, fd_start, fd_end, fd_size, and - * min_st_offset will be filled in. fd_start holds the starting byte - * location for each file domain. fd_end holds the ending byte location. - * min_st_offset holds the minimum byte location that will be accessed. - * - * Both fd_start[] and fd_end[] are indexed by an aggregator number; this - * needs to be mapped to an actual rank in the communicator later. - * - */ - ADIOI_Calc_file_domains(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); - - /* calculate where the portions of the access requests of this process - * are located in terms of the file domains. this could be on the same - * process or on other processes. this function fills in: - * count_my_req_procs - number of processes (including this one) for which - * this process has requests in their file domain - * count_my_req_per_proc - count of requests for each process, indexed - * by rank of the process - * my_req[] - array of data structures describing the requests to be - * performed by each process (including self). indexed by rank. - * buf_idx[] - array of locations into which data can be directly moved; - * this is only valid for contiguous buffer case - */ - ADIOI_Calc_my_req(fd, 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); - - /* 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. - */ - ADIOI_Calc_others_req(fd, count_my_req_procs, - count_my_req_per_proc, my_req, - nprocs, myrank, &count_others_req_procs, - &others_req); - - /* my_req[] and count_my_req_per_proc aren't needed at this point, so - * let's free the memory - */ - ADIOI_Free(count_my_req_per_proc); - for (i=0; ifp_sys_posn = -1; /* set it to null. */ -} - -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) -{ - MPI_Count filetype_size, etype_size; - MPI_Count buftype_size; - int i, j, k; - ADIO_Offset i_offset; - ADIO_Offset frd_size=0, old_frd_size=0; - int st_index=0; - ADIO_Offset n_filetypes, etype_in_filetype; - ADIO_Offset abs_off_in_filetype=0; - ADIO_Offset bufsize; - ADIO_Offset sum, n_etypes_in_filetype, size_in_filetype; - int contig_access_count, filetype_is_contig; - ADIO_Offset *len_list; - MPI_Aint filetype_extent, filetype_lb; - ADIOI_Flatlist_node *flat_file; - ADIO_Offset *offset_list, off, end_offset=0, disp; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5028, 0, NULL); -#endif - -/* For this process's request, calculate the list of offsets and - lengths in the file and determine the start and end offsets. */ - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - - MPI_Type_size_x(fd->filetype, &filetype_size); - MPI_Type_get_extent(fd->filetype, &filetype_lb, &filetype_extent); - MPI_Type_size_x(datatype, &buftype_size); - etype_size = fd->etype_size; - - if ( ! filetype_size ) { - *contig_access_count_ptr = 0; - *offset_list_ptr = (ADIO_Offset *) ADIOI_Malloc(2*sizeof(ADIO_Offset)); - *len_list_ptr = (ADIO_Offset *) ADIOI_Malloc(2*sizeof(ADIO_Offset)); - /* 2 is for consistency. everywhere I malloc one more than needed */ - - offset_list = *offset_list_ptr; - len_list = *len_list_ptr; - offset_list[0] = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : - fd->disp + (ADIO_Offset)etype_size * offset; - len_list[0] = 0; - *start_offset_ptr = offset_list[0]; - *end_offset_ptr = offset_list[0] + len_list[0] - 1; - - return; - } - - if (filetype_is_contig) { - *contig_access_count_ptr = 1; - *offset_list_ptr = (ADIO_Offset *) ADIOI_Malloc(2*sizeof(ADIO_Offset)); - *len_list_ptr = (ADIO_Offset *) ADIOI_Malloc(2*sizeof(ADIO_Offset)); - /* 2 is for consistency. everywhere I malloc one more than needed */ - - offset_list = *offset_list_ptr; - len_list = *len_list_ptr; - offset_list[0] = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : - fd->disp + (ADIO_Offset)etype_size * offset; - len_list[0] = (ADIO_Offset)bufcount * (ADIO_Offset)buftype_size; - *start_offset_ptr = offset_list[0]; - *end_offset_ptr = offset_list[0] + len_list[0] - 1; - - /* update file pointer */ - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = *end_offset_ptr + 1; - } - - else { - - /* First calculate what size of offset_list and len_list to allocate */ - - /* filetype already flattened in ADIO_Open or ADIO_Fcntl */ - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - disp = fd->disp; - -#ifdef RDCOLL_DEBUG - { - int ii; - DBG_FPRINTF(stderr, "flattened %3lld : ", flat_file->count ); - for (ii=0; iicount; ii++) { - DBG_FPRINTF(stderr, "%16lld:%-16lld", flat_file->indices[ii], flat_file->blocklens[ii] ); - } - DBG_FPRINTF(stderr, "\n" ); - } -#endif - 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 = offset / n_etypes_in_filetype; - etype_in_filetype = offset % n_etypes_in_filetype; - size_in_filetype = etype_in_filetype * etype_size; - - sum = 0; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - 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 + n_filetypes* (ADIO_Offset)filetype_extent + - abs_off_in_filetype; - } - - /* calculate how much space to allocate for offset_list, len_list */ - - old_frd_size = frd_size; - contig_access_count = i_offset = 0; - j = st_index; - bufsize = (ADIO_Offset)buftype_size * (ADIO_Offset)bufcount; - frd_size = ADIOI_MIN(frd_size, bufsize); - while (i_offset < bufsize) { - if (frd_size) contig_access_count++; - i_offset += frd_size; - j = (j + 1) % flat_file->count; - frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); - } - - /* allocate space for offset_list and len_list */ - - *offset_list_ptr = (ADIO_Offset *) - ADIOI_Malloc((contig_access_count+1)*sizeof(ADIO_Offset)); - *len_list_ptr = (ADIO_Offset *) ADIOI_Malloc((contig_access_count+1)*sizeof(ADIO_Offset)); - /* +1 to avoid a 0-size malloc */ - - offset_list = *offset_list_ptr; - len_list = *len_list_ptr; - - /* find start offset, end offset, and fill in offset_list and len_list */ - - *start_offset_ptr = offset; /* calculated above */ - - i_offset = k = 0; - j = st_index; - off = offset; - frd_size = ADIOI_MIN(old_frd_size, bufsize); - while (i_offset < bufsize) { - if (frd_size) { - offset_list[k] = off; - len_list[k] = frd_size; - k++; - } - i_offset += frd_size; - end_offset = off + frd_size - 1; - - /* 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*/ - - if (off + frd_size < disp + flat_file->indices[j] + - flat_file->blocklens[j] + - n_filetypes* (ADIO_Offset)filetype_extent) - { - off += frd_size; - /* did not reach end of contiguous block in filetype. - * no more I/O needed. off is incremented by frd_size. - */ - } - 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; - /* hit end of flattened filetype; start at beginning - * again */ - } - off = disp + flat_file->indices[j] + - n_filetypes* (ADIO_Offset)filetype_extent; - frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); - } - } - - /* update file pointer */ - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - - *contig_access_count_ptr = contig_access_count; - *end_offset_ptr = end_offset; - } -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5029, 0, NULL); -#endif -} - -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, lb; - int coll_bufsize; - - *error_code = MPI_SUCCESS; /* changed below if error */ - /* only I/O errors are currently reported */ - -/* calculate the number of reads of size coll_bufsize - to be done by each process and the max among all processes. - That gives the no. of communication phases as well. - coll_bufsize is obtained from the hints object. */ - - coll_bufsize = fd->hints->cb_buffer_size; - - /* 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; /* Allocated at open time */ - - 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, &lb, &buftype_extent); - - done = 0; - off = st_loc; - for_curr_iter = for_next_iter = 0; - - MPI_Comm_rank(fd->comm, &rank); - - 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)((MPIU_Upint)buf + user_buf_idx)); \ - ADIOI_Assert((ADIO_Size) 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 \ -} - -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 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); -} diff --git a/3rd-party/romio321/adio/common/ad_read_str.c b/3rd-party/romio321/adio/common/ad_read_str.c deleted file mode 100644 index fbb4bbe3c1e..00000000000 --- a/3rd-party/romio321/adio/common/ad_read_str.c +++ /dev/null @@ -1,403 +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" - -#define ADIOI_BUFFERED_READ \ -{ \ - if (req_off >= readbuf_off + readbuf_len) { \ - readbuf_off = req_off; \ - readbuf_len = (unsigned) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1));\ - ADIO_ReadContig(fd, readbuf, readbuf_len, MPI_BYTE, \ - ADIO_EXPLICIT_OFFSET, readbuf_off, &status1, error_code); \ - if (*error_code != MPI_SUCCESS) return; \ - } \ - while (req_len > readbuf_off + readbuf_len - req_off) { \ - ADIOI_Assert((readbuf_off + readbuf_len - req_off) == (int) (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 = (unsigned) (partial_read + ADIOI_MIN(max_bufsize, \ - end_offset-readbuf_off+1)); \ - ADIO_ReadContig(fd, readbuf+partial_read, readbuf_len-partial_read, \ - MPI_BYTE, ADIO_EXPLICIT_OFFSET, readbuf_off+partial_read, \ - &status1, error_code); \ - if (*error_code != MPI_SUCCESS) return; \ - } \ - ADIOI_Assert((ADIO_Size) req_len == (size_t)req_len); \ - memcpy((char *)buf + userbuf_off, readbuf+req_off-readbuf_off, req_len); \ -} - - -void ADIOI_GEN_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; - ADIO_Offset i_offset, new_brd_size, brd_size, size; - int i, j, k, st_index=0; - MPI_Count num, bufsize; - int n_etypes_in_filetype; - ADIO_Offset n_filetypes, etype_in_filetype, st_n_filetypes, size_in_filetype; - ADIO_Offset abs_off_in_filetype=0, new_frd_size, frd_size=0, st_frd_size; - MPI_Count filetype_size, etype_size, buftype_size, partial_read; - MPI_Aint filetype_extent, buftype_extent, lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset userbuf_off, req_len, sum; - ADIO_Offset off, req_off, disp, end_offset=0, readbuf_off, start_off; - char *readbuf, *tmp_buf, *value; - int info_flag; - unsigned max_bufsize, readbuf_len; - ADIO_Status status1; - - if (fd->hints->ds_read == ADIOI_HINT_DISABLE) { - /* if user has disabled data sieving on reads, use naive - * approach instead. - */ - ADIOI_GEN_ReadStrided_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, &lb, &filetype_extent); - MPI_Type_size_x(datatype, &buftype_size); - MPI_Type_get_extent(datatype, &lb, &buftype_extent); - etype_size = fd->etype_size; - - ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(MPI_Count)buftype_size * (ADIO_Offset)count)); - 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 + (ADIO_Offset)etype_size * offset; - - start_off = off; - end_offset = off + bufsize - 1; - readbuf_off = off; - readbuf = (char *) ADIOI_Malloc(max_bufsize); - readbuf_len = (unsigned) (ADIOI_MIN(max_bufsize, end_offset-readbuf_off+1)); - -/* if atomicity is true, lock (exclusive) the region to be accessed */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - - ADIO_ReadContig(fd, readbuf, readbuf_len, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, readbuf_off, &status1, error_code); - if (*error_code != MPI_SUCCESS) return; - - for (j=0; jcount; i++) { - userbuf_off = (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]; - req_off = off; - req_len = flat_buf->blocklens[i]; - ADIOI_BUFFERED_READ - off += flat_buf->blocklens[i]; - } - } - - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - 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); - } - - 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 = offset / n_etypes_in_filetype; - etype_in_filetype = offset % n_etypes_in_filetype; - size_in_filetype = etype_in_filetype * etype_size; - - sum = 0; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - 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) { - /* a count of bytes can overflow. operate on original type instead */ - ADIO_ReadContig(fd, buf, count, datatype, 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_offset = 0; - j = st_index; - off = offset; - frd_size = ADIOI_MIN(st_frd_size, bufsize); - while (i_offset < bufsize) { - i_offset += 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] + n_filetypes*(ADIO_Offset)filetype_extent; - frd_size = ADIOI_MIN(flat_file->blocklens[j], bufsize-i_offset); - } - -/* if atomicity is true, lock (exclusive) the region to be accessed */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - - readbuf_off = 0; - readbuf_len = 0; - readbuf = (char *) ADIOI_Malloc(max_bufsize); - - 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; - frd_size = ADIOI_MIN(st_frd_size, bufsize); - while (i_offset < bufsize) { - if (frd_size) { - /* TYPE_UB and TYPE_LB can result in - frd_size = 0. save system call in such cases */ - /* 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_offset; - ADIOI_BUFFERED_READ - } - i_offset += frd_size; - - if (off + frd_size < disp + flat_file->indices[j] + - flat_file->blocklens[j] + n_filetypes*(ADIO_Offset)filetype_extent) - off += frd_size; - /* did not reach end of contiguous block in filetype. - no more I/O needed. off is incremented by frd_size. */ - 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; - frd_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; - 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_offset; - 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] + - n_filetypes*(ADIO_Offset)filetype_extent; - - new_frd_size = flat_file->blocklens[j]; - if (size != brd_size) { - i_offset += 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_offset = ((ADIO_Offset)buftype_extent*(ADIO_Offset)(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; - } - } - ADIOI_Assert(((ADIO_Offset)num + size) == (unsigned)(num + size)); - num += size; - frd_size = new_frd_size; - brd_size = new_brd_size; - } - } - - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - - ADIOI_Free(readbuf); /* malloced in the buffered_read macro */ - } - - 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/common/ad_read_str_naive.c b/3rd-party/romio321/adio/common/ad_read_str_naive.c deleted file mode 100644 index a65eede9558..00000000000 --- a/3rd-party/romio321/adio/common/ad_read_str_naive.c +++ /dev/null @@ -1,380 +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 "adio.h" -#include "adio_extern.h" - -void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, - MPI_Datatype buftype, 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 size, brd_size, frd_size=0, req_len, sum; - int b_index; - int n_etypes_in_filetype; - ADIO_Offset n_filetypes, etype_in_filetype; - ADIO_Offset abs_off_in_filetype=0; - MPI_Count bufsize, filetype_size, buftype_size, size_in_filetype; - ADIO_Offset etype_size; - MPI_Aint filetype_extent, buftype_extent, lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset userbuf_off; - ADIO_Offset off, req_off, disp, end_offset=0, start_off; - ADIO_Status status1; - - *error_code = MPI_SUCCESS; /* changed below if error */ - - ADIOI_Datatype_iscontig(buftype, &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, buftype, 0); -#endif - *error_code = MPI_SUCCESS; - return; - } - - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - MPI_Type_size_x(buftype, &buftype_size); - MPI_Type_get_extent(buftype, &lb, &buftype_extent); - etype_size = fd->etype_size; - - ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)buftype_size * (ADIO_Offset)count)); - bufsize = buftype_size * count; - - /* contiguous in buftype and filetype is handled elsewhere */ - - if (!buftype_is_contig && filetype_is_contig) { - int b_count; - /* noncontiguous in memory, contiguous in file. */ - - flat_buf = ADIOI_Flatten_and_find(buftype); - - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : - fd->disp + etype_size * offset; - - start_off = off; - end_offset = off + bufsize - 1; - - /* if atomicity is true, lock (exclusive) the region to be accessed */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - /* for each region in the buffer, grab the data and put it in - * place - */ - for (b_count=0; b_count < count; b_count++) { - for (b_index=0; b_index < flat_buf->count; b_index++) { - userbuf_off = (ADIO_Offset)b_count*(ADIO_Offset)buftype_extent + - flat_buf->indices[b_index]; - req_off = off; - req_len = flat_buf->blocklens[b_index]; - - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); - ADIOI_Assert(req_len == (int) req_len); - ADIO_ReadContig(fd, - (char *) buf + userbuf_off, - req_len, - MPI_BYTE, - ADIO_EXPLICIT_OFFSET, - req_off, - &status1, - error_code); - if (*error_code != MPI_SUCCESS) return; - - /* off is (potentially) used to save the final offset later */ - off += flat_buf->blocklens[b_index]; - } - } - - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - - } - - else { /* noncontiguous in file */ - int f_index, st_index = 0; - ADIO_Offset st_n_filetypes; - ADIO_Offset st_frd_size; - int flag; - - /* First we're going to calculate a set of values for use in all - * the noncontiguous in file cases: - * start_off - starting byte position of data in file - * end_offset - last byte offset to be acessed in the file - * st_n_filetypes - how far into the file we start in terms of - * whole filetypes - * st_index - index of block in first filetype that we will be - * starting in (?) - * st_frd_size - size of the data in the first filetype block - * that we will read (accounts for being part-way - * into reading this block of the filetype - * - */ - - /* 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) { - start_off = fd->fp_ind; /* in bytes */ - n_filetypes = -1; - flag = 0; - while (!flag) { - n_filetypes++; - for (f_index=0; f_index < flat_file->count; f_index++) { - if (disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + - flat_file->blocklens[f_index] >= start_off) - { - /* this block contains our starting position */ - - st_index = f_index; - frd_size = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + - flat_file->blocklens[f_index] - start_off; - flag = 1; - break; - } - } - } - } - else { - n_etypes_in_filetype = filetype_size/etype_size; - n_filetypes = offset / n_etypes_in_filetype; - etype_in_filetype = (int) (offset % n_etypes_in_filetype); - size_in_filetype = (unsigned)etype_in_filetype * (unsigned)etype_size; - - sum = 0; - for (f_index=0; f_index < flat_file->count; f_index++) { - sum += flat_file->blocklens[f_index]; - if (sum > size_in_filetype) { - st_index = f_index; - frd_size = sum - size_in_filetype; - abs_off_in_filetype = flat_file->indices[f_index] + - size_in_filetype - - (sum - flat_file->blocklens[f_index]); - break; - } - } - - /* abs. offset in bytes in the file */ - start_off = disp + n_filetypes*(ADIO_Offset)filetype_extent + - abs_off_in_filetype; - } - - st_frd_size = frd_size; - st_n_filetypes = n_filetypes; - - /* start_off, st_n_filetypes, st_index, and st_frd_size are - * all calculated at this point - */ - - /* Calculate end_offset, the last byte-offset that will be accessed. - * e.g., if start_off=0 and 100 bytes to be read, end_offset=99 - */ - userbuf_off = 0; - f_index = st_index; - off = start_off; - frd_size = ADIOI_MIN(st_frd_size, bufsize); - while (userbuf_off < bufsize) { - userbuf_off += frd_size; - end_offset = off + frd_size - 1; - - if (f_index < (flat_file->count - 1)) f_index++; - else { - f_index = 0; - n_filetypes++; - } - - off = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent; - frd_size = ADIOI_MIN(flat_file->blocklens[f_index], - bufsize-(unsigned)userbuf_off); - } - - /* End of calculations. At this point the following values have - * been calculated and are ready for use: - * - start_off - * - end_offset - * - st_n_filetypes - * - st_index - * - st_frd_size - */ - - /* if atomicity is true, lock (exclusive) the region to be accessed */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - if (buftype_is_contig && !filetype_is_contig) { - /* contiguous in memory, noncontiguous in file. should be the - * most common case. - */ - - userbuf_off = 0; - f_index = st_index; - off = start_off; - n_filetypes = st_n_filetypes; - frd_size = ADIOI_MIN(st_frd_size, bufsize); - - /* while there is still space in the buffer, read more data */ - while (userbuf_off < bufsize) { - if (frd_size) { - /* TYPE_UB and TYPE_LB can result in - frd_size = 0. save system call in such cases */ - req_off = off; - req_len = frd_size; - - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); - ADIOI_Assert(req_len == (int) req_len); - ADIO_ReadContig(fd, - (char *) buf + userbuf_off, - req_len, - MPI_BYTE, - ADIO_EXPLICIT_OFFSET, - req_off, - &status1, - error_code); - if (*error_code != MPI_SUCCESS) return; - } - userbuf_off += frd_size; - - if (off + frd_size < disp + flat_file->indices[f_index] + - flat_file->blocklens[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent) - { - /* important that this value be correct, as it is - * used to set the offset in the fd near the end of - * this function. - */ - off += frd_size; - } - /* did not reach end of contiguous block in filetype. - * no more I/O needed. off is incremented by frd_size. - */ - else { - if (f_index < (flat_file->count - 1)) f_index++; - else { - f_index = 0; - n_filetypes++; - } - off = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent; - frd_size = ADIOI_MIN(flat_file->blocklens[f_index], - bufsize-(unsigned)userbuf_off); - } - } - } - else { - ADIO_Offset i_offset, tmp_bufsize = 0; - /* noncontiguous in memory as well as in file */ - - flat_buf = ADIOI_Flatten_and_find(buftype); - - b_index = buf_count = 0; - i_offset = flat_buf->indices[0]; - f_index = st_index; - off = start_off; - n_filetypes = st_n_filetypes; - frd_size = st_frd_size; - brd_size = flat_buf->blocklens[0]; - - /* while we haven't read size * count bytes, keep going */ - while (tmp_bufsize < bufsize) { - ADIO_Offset new_brd_size = brd_size, new_frd_size = frd_size; - - size = ADIOI_MIN(frd_size, brd_size); - if (size) { - req_off = off; - req_len = size; - userbuf_off = i_offset; - - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); - ADIOI_Assert(req_len == (int) req_len); - ADIO_ReadContig(fd, - (char *) buf + userbuf_off, - req_len, - MPI_BYTE, - ADIO_EXPLICIT_OFFSET, - req_off, - &status1, - error_code); - if (*error_code != MPI_SUCCESS) return; - } - - if (size == frd_size) { - /* reached end of contiguous block in file */ - if (f_index < (flat_file->count - 1)) f_index++; - else { - f_index = 0; - n_filetypes++; - } - - off = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent; - - new_frd_size = flat_file->blocklens[f_index]; - if (size != brd_size) { - i_offset += size; - new_brd_size -= size; - } - } - - if (size == brd_size) { - /* reached end of contiguous block in memory */ - - b_index = (b_index + 1)%flat_buf->count; - buf_count++; - i_offset = buftype_extent*(buf_count/flat_buf->count) + - flat_buf->indices[b_index]; - new_brd_size = flat_buf->blocklens[b_index]; - if (size != frd_size) { - off += size; - new_frd_size -= size; - } - } - tmp_bufsize += size; - frd_size = new_frd_size; - brd_size = new_brd_size; - } - } - - /* unlock the file region if we locked it */ - if ((fd->atomicity) && (fd->file_system != ADIO_PIOFS) && - (fd->file_system != ADIO_PVFS) && (fd->file_system != ADIO_PVFS2)) - { - ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - } /* end of (else noncontiguous in file) */ - - fd->fp_sys_posn = -1; /* mark it as invalid. */ - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, buftype, bufsize); - /* This is a temporary way of filling in status. The right way is to - * keep track of how much data was actually read and placed in buf - */ -#endif - - if (!buftype_is_contig) ADIOI_Delete_flattened(buftype); -} diff --git a/3rd-party/romio321/adio/common/ad_resize.c b/3rd-party/romio321/adio/common/ad_resize.c deleted file mode 100644 index a6be2c17608..00000000000 --- a/3rd-party/romio321/adio/common/ad_resize.c +++ /dev/null @@ -1,38 +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 "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif - -void ADIOI_GEN_Resize(ADIO_File fd, ADIO_Offset size, int *error_code) -{ - int err, rank; - static char myname[] = "ADIOI_GEN_RESIZE"; - - MPI_Comm_rank(fd->comm, &rank); - - /* first aggregator performs ftruncate() */ - if (rank == fd->hints->ranklist[0]) { - ADIOI_Assert(size == (off_t) size); - err = ftruncate(fd->fd_sys, (off_t)size); - } - - /* bcast return value */ - MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); - - /* --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/common/ad_seek.c b/3rd-party/romio321/adio/common/ad_seek.c deleted file mode 100644 index 2d6f75fd54e..00000000000 --- a/3rd-party/romio321/adio/common/ad_seek.c +++ /dev/null @@ -1,86 +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" - -#ifdef HAVE_UNISTD_H -#include -#endif - -ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, - int whence, int *error_code) -{ -/* implemented for whence=SEEK_SET only. SEEK_CUR and SEEK_END must - be converted to the equivalent with SEEK_SET before calling this - routine. */ -/* offset is in units of etype relative to the filetype */ - - ADIO_Offset off; - ADIOI_Flatlist_node *flat_file; - - int i; - ADIO_Offset n_etypes_in_filetype, n_filetypes, etype_in_filetype; - ADIO_Offset abs_off_in_filetype=0; - ADIO_Offset size_in_filetype, sum; - MPI_Count filetype_size, etype_size; - int filetype_is_contig; - MPI_Aint filetype_extent, lb; - - ADIOI_UNREFERENCED_ARG(whence); - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - etype_size = fd->etype_size; - - if (filetype_is_contig) off = fd->disp + etype_size * offset; - else { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - MPI_Type_size_x(fd->filetype, &filetype_size); - if ( ! filetype_size ) { - /* Since offset relative to the filetype size, we can't - do compute the offset when that result is zero. - Return zero for the offset for now */ - *error_code = MPI_SUCCESS; - return 0; - } - - 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; icount; i++) { - sum += flat_file->blocklens[i]; - if (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 */ - off = fd->disp + n_filetypes * filetype_extent + - abs_off_in_filetype; - } - -/* - * we used to call lseek here and update both fp_ind and fp_sys_posn, but now - * we don't seek and only update fp_ind (ROMIO's idea of where we are in the - * file). We leave the system file descriptor and fp_sys_posn alone. - * The fs-specifc ReadContig and WriteContig will seek to the correct place in - * the file before reading/writing if the 'offset' parameter doesn't match - * fp_sys_posn - */ - fd->fp_ind = off; - - *error_code = MPI_SUCCESS; - - return off; -} diff --git a/3rd-party/romio321/adio/common/ad_set_sh_fp.c b/3rd-party/romio321/adio/common/ad_set_sh_fp.c deleted file mode 100644 index c55f2efe5a9..00000000000 --- a/3rd-party/romio321/adio/common/ad_set_sh_fp.c +++ /dev/null @@ -1,45 +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" - -/* set the shared file pointer to "offset" etypes relative to the current - view */ - -void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code); - -void ADIO_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code) -{ - ADIO_Status status; - MPI_Comm dupcommself; - -#ifdef ROMIO_NFS - if (fd->file_system == ADIO_NFS) { - ADIOI_NFS_Set_shared_fp(fd, offset, error_code); - return; - } -#endif - - 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)); - ADIO_WriteContig(fd->shared_fp_fd, &offset, sizeof(ADIO_Offset), - MPI_BYTE, ADIO_EXPLICIT_OFFSET, 0, &status, error_code); - ADIOI_UNLOCK(fd->shared_fp_fd, 0, SEEK_SET, sizeof(ADIO_Offset)); -} - diff --git a/3rd-party/romio321/adio/common/ad_set_view.c b/3rd-party/romio321/adio/common/ad_set_view.c deleted file mode 100644 index 18becf269a9..00000000000 --- a/3rd-party/romio321/adio/common/ad_set_view.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 "adio.h" -#include "adio_extern.h" - -/* this used to be implemented in every file system as an fcntl. It makes - * deferred open easier if we know ADIO_Fcntl will always need a file to really - * be open. set_view doesn't modify anything related to the open files. - */ -void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, MPI_Info info, int *error_code) -{ - int combiner, i, j, k, err, filetype_is_contig; - MPI_Datatype copy_etype, copy_filetype; - ADIOI_Flatlist_node *flat_file; - /* free copies of old etypes and filetypes and delete flattened - version of filetype if necessary */ - - MPI_Type_get_envelope(fd->etype, &i, &j, &k, &combiner); - if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->etype)); - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - if (!filetype_is_contig) ADIOI_Delete_flattened(fd->filetype); - - MPI_Type_get_envelope(fd->filetype, &i, &j, &k, &combiner); - if (combiner != MPI_COMBINER_NAMED) MPI_Type_free(&(fd->filetype)); - - /* set new info */ - ADIO_SetInfo(fd, info, &err); - - /* set new etypes and filetypes */ - - ADIOI_Type_get_envelope(etype, &i, &j, &k, &combiner); - if (combiner == MPI_COMBINER_NAMED) fd->etype = etype; - else { - MPI_Type_contiguous(1, etype, ©_etype); - MPI_Type_commit(©_etype); - fd->etype = copy_etype; - } - ADIOI_Type_get_envelope(filetype, &i, &j, &k, &combiner); - if (combiner == MPI_COMBINER_NAMED) - fd->filetype = filetype; - else { - MPI_Type_contiguous(1, filetype, ©_filetype); - MPI_Type_commit(©_filetype); - fd->filetype = copy_filetype; - ADIOI_Flatten_datatype(fd->filetype); - /* this function will not flatten the filetype if it turns out - to be all contiguous. */ - } - - MPI_Type_size_x(fd->etype, &(fd->etype_size)); - fd->disp = disp; - - /* reset MPI-IO file pointer to point to the first byte that can - be accessed in this view. */ - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - if (filetype_is_contig) fd->fp_ind = disp; - else { - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) - flat_file = flat_file->next; - for (i=0; icount; i++) { - if (flat_file->blocklens[i]) { - fd->fp_ind = disp + flat_file->indices[i]; - break; - } - } - } - *error_code = MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/common/ad_subarray.c b/3rd-party/romio321/adio/common/ad_subarray.c deleted file mode 100644 index c6eb9450ce6..00000000000 --- a/3rd-party/romio321/adio/common/ad_subarray.c +++ /dev/null @@ -1,96 +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" - -int ADIO_Type_create_subarray(int ndims, - int *array_of_sizes, - int *array_of_subsizes, - int *array_of_starts, - int order, - MPI_Datatype oldtype, - MPI_Datatype *newtype) -{ - MPI_Aint extent, disp, size, lb, ub; - int i, blklen; - MPI_Datatype tmp1, tmp2, inttype; - - MPI_Type_get_extent(oldtype, &lb, &extent); - - if (order == MPI_ORDER_FORTRAN) { - /* dimension 0 changes fastest */ - if (ndims == 1) { - MPI_Type_contiguous(array_of_subsizes[0], oldtype, &tmp1); - } - else { - MPI_Type_vector(array_of_subsizes[1], - array_of_subsizes[0], - array_of_sizes[0], oldtype, &tmp1); - - size = (MPI_Aint)array_of_sizes[0]*extent; - for (i=2; i=0; i--) { - size *= (MPI_Aint)array_of_sizes[i+1]; - MPI_Type_create_hvector(array_of_subsizes[i], 1, size, tmp1, &tmp2); - MPI_Type_free(&tmp1); - tmp1 = tmp2; - } - } - - /* add displacement and UB */ - disp = array_of_starts[ndims-1]; - size = 1; - for (i=ndims-2; i>=0; i--) { - size *= (MPI_Aint)array_of_sizes[i+1]; - disp += size*(MPI_Aint)array_of_starts[i]; - } - } - - disp *= extent; - - ub = extent; - for (i=0; i -/* Function for running in another thread for doing the file reading while the - * main thread is doing data aggregation - useful only when multiple rounds are - * needed due to file size relative to the read buffer size and number of - * aggregators */ - -void *ADIOI_IO_Thread_Func(void *vptr_args) { - ADIOI_IO_ThreadFuncData *args = (ADIOI_IO_ThreadFuncData*)vptr_args; - - ADIOI_Assert(args->size == (int)(args->size)); - - if (args->io_kind == ADIOI_READ) { - ADIO_ReadContig(args->fd, args->buf, args->size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, args->offset, - args->status, &(args->error_code)); - } else { - ADIO_WriteContig(args->fd, args->buf, args->size, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, args->offset, - args->status, &(args->error_code)); - } - pthread_exit(&(args->error_code)); - return NULL; -} diff --git a/3rd-party/romio321/adio/common/ad_wait.c b/3rd-party/romio321/adio/common/ad_wait.c deleted file mode 100644 index 2112ee8fb66..00000000000 --- a/3rd-party/romio321/adio/common/ad_wait.c +++ /dev/null @@ -1,47 +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 "adio.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - -/* 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 - -/* ADIOI_GEN_IOComplete - * - * This code handles two distinct cases. If ROMIO_HAVE_WORKING_AIO is - * not defined, then I/O was performed by a blocking call already. In - * that case all we need to do is optionally set the bytes in the - * status structure and free the request. - * - * If ROMIO_HAVE_WORKING_AIO is defined, then we may need to wait for I/O - * to complete. - */ -void ADIOI_GEN_IOComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code) -{ - return; - -} diff --git a/3rd-party/romio321/adio/common/ad_wait_fake.c b/3rd-party/romio321/adio/common/ad_wait_fake.c deleted file mode 100644 index 16947baa1fb..00000000000 --- a/3rd-party/romio321/adio/common/ad_wait_fake.c +++ /dev/null @@ -1,20 +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 "adio.h" - -/* Generic implementation of ReadComplete/WriteComplete simply sets the - * bytes field in the status structure and frees the request. - * - * Same function is used for both reads and writes. - */ -void ADIOI_FAKE_IOComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code) -{ - *error_code = MPI_SUCCESS; - return; -} diff --git a/3rd-party/romio321/adio/common/ad_write.c b/3rd-party/romio321/adio/common/ad_write.c deleted file mode 100644 index d1c24ac45ed..00000000000 --- a/3rd-party/romio321/adio/common/ad_write.c +++ /dev/null @@ -1,114 +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 "adio.h" -#include - -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -#ifdef ROMIO_GPFS -#include "adio/ad_gpfs/ad_gpfs_tuning.h" -#endif - -#ifdef HAVE_LIMITS_H -#include -#endif - - -void ADIOI_GEN_WriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code) -{ - ssize_t err = -1; - MPI_Count datatype_size; - ADIO_Offset len, bytes_xfered=0; - size_t wr_count; - static char myname[] = "ADIOI_GEN_WRITECONTIG"; -#ifdef ROMIO_GPFS - double io_time=0; -#endif - char * p; - -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5036, 0, NULL); -#endif - - MPI_Type_size_x(datatype, &datatype_size); - len = (ADIO_Offset)datatype_size * (ADIO_Offset)count; - -#ifdef ROMIO_GPFS - io_time = MPI_Wtime(); - if (gpfsmpio_timing) { - gpfsmpio_prof_cw[ GPFSMPIO_CIO_DATA_SIZE ] += len; - } -#endif - - if (file_ptr_type == ADIO_INDIVIDUAL) { - offset = fd->fp_ind; - } - - p = (char *)buf; - while (bytes_xfered < len) { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - wr_count = len - bytes_xfered; - /* Frustrating! FreeBSD and OS X do not like a count larger than 2^31 */ - if (wr_count > INT_MAX) - wr_count = INT_MAX; - -#ifdef ROMIO_GPFS - if (gpfsmpio_devnullio) - err = pwrite(fd->null_fd, p, wr_count, offset+bytes_xfered); - else -#endif - err = pwrite(fd->fd_sys, p, wr_count, offset+bytes_xfered); - /* --BEGIN ERROR HANDLING-- */ - if (err == -1) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_IO, "**io", - "**io %s", strerror(errno)); - fd->fp_sys_posn = -1; - return; - } - /* --END ERROR HANDLING-- */ -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_b, 0, NULL ); -#endif - bytes_xfered += err; - p += err; - } - -#ifdef ROMIO_GPFS - if (gpfsmpio_timing) gpfsmpio_prof_cw[ GPFSMPIO_CIO_T_POSI_RW ] += (MPI_Wtime() - io_time); -#endif - fd->fp_sys_posn = offset + bytes_xfered; - - if (file_ptr_type == ADIO_INDIVIDUAL) { - fd->fp_ind += bytes_xfered; - } - -#ifdef ROMIO_GPFS - if (gpfsmpio_timing) gpfsmpio_prof_cw[ GPFSMPIO_CIO_T_MPIO_RW ] += (MPI_Wtime() - io_time); -#endif - -#ifdef HAVE_STATUS_SET_BYTES - /* bytes_xfered could be larger than int */ - if (err != -1 && status) MPIR_Status_set_bytes(status, datatype, bytes_xfered); -#endif - - *error_code = MPI_SUCCESS; -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5037, 0, NULL); -#endif -} diff --git a/3rd-party/romio321/adio/common/ad_write_coll.c b/3rd-party/romio321/adio/common/ad_write_coll.c deleted file mode 100644 index 6a2e09771bf..00000000000 --- a/3rd-party/romio321/adio/common/ad_write_coll.c +++ /dev/null @@ -1,1086 +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" - -#ifdef AGGREGATION_PROFILE -#include "mpe.h" -#endif - -/* prototypes of functions used for collective writes only. */ -static void ADIOI_Exch_and_write(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_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf, - ADIOI_Flatlist_node *flat_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - 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); -void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, - int contig_access_count, ADIO_Offset - min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int iter, - MPI_Aint buftype_extent); -void ADIOI_Heap_merge(ADIOI_Access *others_req, int *count, - ADIO_Offset *srt_off, int *srt_len, int *start_pos, - int nprocs, int nprocs_recv, int total_elements); - - -void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code) -{ -/* 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; - int *buf_idx = NULL; - ADIO_Offset *len_list = NULL; - int old_error, tmp_error; - - if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) { - /* Cast away const'ness as the below function is used for read - * and write */ - ADIOI_IOStridedColl (fd, (char *) buf, count, ADIOI_WRITE, datatype, - file_ptr_type, offset, status, error_code); - return; - } - - 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; - - /* 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); - - /* 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; 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; - } - -/* Divide the I/O workload among "nprocs_for_coll" processes. This is - done by (logically) dividing the file into file domains (FDs); each - process may directly access only its own file domain. */ - - ADIOI_Calc_file_domains(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); - - -/* calculate what portions of the access requests of this process are - located in what file domains */ - - 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); - -/* 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. */ - - 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); - for (i=0; i < nprocs; i++) { - if (my_req[i].count) { - ADIOI_Free(my_req[i].offsets); - ADIOI_Free(my_req[i].lens); - } - } - ADIOI_Free(my_req); - -/* exchange data and write in sizes of no more than coll_bufsize. */ - /* Cast away const'ness for the below function */ - ADIOI_Exch_and_write(fd, (char *) 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); - - /* 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 -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5012, 0, NULL); -#endif - - if ( (old_error != MPI_SUCCESS) && (old_error != MPI_ERR_IO) ) - *error_code = old_error; - - - if (!buftype_is_contig) ADIOI_Delete_flattened(datatype); - -/* free all memory allocated for collective I/O */ - - for (i=0; ifp_sys_posn = -1; /* set it to null. */ -#ifdef AGGREGATION_PROFILE - MPE_Log_event (5013, 0, NULL); -#endif -} - - - -/* 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, 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; - 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, lb; - int info_flag, coll_bufsize; - char *value; - static char myname[] = "ADIOI_EXCH_AND_WRITE"; - - *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); - - - 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. */ - } - - MPI_Allreduce(&ntimes, &max_ntimes, 1, MPI_INT, MPI_MAX, - fd->comm); - - write_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_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, &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; - - 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 */ - - 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]; jcomm); - - /* 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) { - 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-- */ - } - } - - 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((ADIO_Size) 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 \ -} - - - - - -void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node - *flat_buf, char **send_buf, ADIO_Offset - *offset_list, ADIO_Offset *len_list, int *send_size, - MPI_Request *requests, int *sent_to_proc, - int nprocs, int myrank, - int contig_access_count, - ADIO_Offset min_st_offset, ADIO_Offset fd_size, - ADIO_Offset *fd_start, ADIO_Offset *fd_end, - int *send_buf_idx, int *curr_to_proc, - int *done_to_proc, int iter, - MPI_Aint buftype_extent) -{ -/* 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)); - /* ok to cast: bounded by cb buffer size */ - curr_to_proc[p] = done_to_proc[p] + (int)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]; -} - - - -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; - for(;;) { - 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; i - - -/* #define IO_DEBUG 1 */ -void ADIOI_NOLOCK_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) -{ -/* borrowed from old-school PVFS (v1) code. A driver for file systems that - * cannot or do not support client-side buffering - * Does not do data sieving optimization - * Does contain write-combining optimization for noncontig in memory, contig in - * file - */ - -/* offset is in units of etype relative to the filetype. */ - - ADIOI_Flatlist_node *flat_buf, *flat_file; - int j, k, st_index=0; - off_t err_lseek=-1; - ssize_t err=-1; - ADIO_Offset fwr_size=0, bwr_size, new_bwr_size, new_fwr_size, i_offset, num; - ADIO_Offset bufsize, n_etypes_in_filetype; - ADIO_Offset n_filetypes, etype_in_filetype, size, sum; - ADIO_Offset abs_off_in_filetype=0, size_in_filetype; - MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, indx, lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset off, disp; - int flag, err_flag=0; - static char myname[] = "ADIOI_NOLOCK_WRITESTRIDED"; -#ifdef IO_DEBUG - int rank,nprocs; -#endif - - /* --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 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; - } - -#ifdef IO_DEBUG - MPI_Comm_rank(fd->comm, &rank); - MPI_Comm_size(fd->comm, &nprocs); -#endif - - 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; - - ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count)); - 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; - lseek(fd->fd_sys, off, SEEK_SET); - } - else off = lseek(fd->fd_sys, fd->fp_ind, SEEK_SET); - - /* 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 IO_DEBUG - printf("[%d/%d] nc mem c file (0) writing loc = %Ld sz = %Ld\n", - rank, nprocs, off, - fd->hints->ind_wr_buffer_size-combine_buf_remain); -#endif -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - err = 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 IO_DEBUG - printf("[%d/%d] nc mem c file (1) writing loc = %Ld sz = %d\n", - rank, nprocs, off, - flat_buf->blocklens[i]); -#endif - ADIOI_Assert(flat_buf->blocklens[i] == (unsigned)flat_buf->blocklens[i]); - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]) == (ADIO_Offset)((MPIU_Upint)buf + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i])); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - err = write(fd->fd_sys, - ((char *) buf) + (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i], - (unsigned)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 IO_DEBUG - printf("[%d/%d] nc mem c file (2) writing loc = %Ld sz = %Ld\n", - rank, nprocs, off, - fd->hints->ind_wr_buffer_size-combine_buf_remain); -#endif -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - err = 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) { - int i; - n_filetypes++; - for (i=0; icount; i++) { - if (disp + flat_file->indices[i] + - n_filetypes*(ADIO_Offset)filetype_extent + flat_file->blocklens[i] - >= offset) { - st_index = i; - fwr_size = disp + flat_file->indices[i] + - n_filetypes*(ADIO_Offset)filetype_extent - + flat_file->blocklens[i] - offset; - flag = 1; - break; - } - } - } - } - else { - int i; - 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; 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 + n_filetypes*(ADIO_Offset)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_offset = 0; - j = st_index; - off = offset; - fwr_size = ADIOI_MIN(fwr_size, bufsize); - while (i_offset < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event(ADIOI_MPE_lseek_a, 0, NULL); -#endif -#ifdef IO_DEBUG - printf("[%d/%d] c mem nc file writing loc = %Ld sz = %d\n", - rank, nprocs, off, fwr_size); -#endif - err_lseek = lseek(fd->fd_sys, off, SEEK_SET); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event(ADIOI_MPE_lseek_b, 0, NULL); -#endif - if (err_lseek == -1) err_flag = 1; -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event(ADIOI_MPE_write_a, 0, NULL); -#endif - err = write(fd->fd_sys, ((char *) buf) + i_offset, fwr_size); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event(ADIOI_MPE_write_b, 0, NULL); -#endif - if (err == -1) err_flag = 1; - } - 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 { - if (j < (flat_file->count - 1)) j++; - else { - j = 0; - n_filetypes++; - } - 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; - 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 IO_DEBUG - printf("[%d/%d] nc mem nc file writing loc = %Ld sz = %d\n", - rank, nprocs, off, size); -#endif -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_lseek_a, 0, NULL ); -#endif - lseek(fd->fd_sys, off, SEEK_SET); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_lseek_b, 0, NULL ); -#endif - if (err == -1) err_flag = 1; -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_write_a, 0, NULL ); -#endif - ADIOI_Assert((ADIO_Size) size == (size_t) size); - ADIOI_Assert(off == (off_t) off); - err = 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] + - n_filetypes*(ADIO_Offset)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); -} diff --git a/3rd-party/romio321/adio/common/ad_write_str.c b/3rd-party/romio321/adio/common/ad_write_str.c deleted file mode 100644 index 83f2420ddc9..00000000000 --- a/3rd-party/romio321/adio/common/ad_write_str.c +++ /dev/null @@ -1,486 +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" - -#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); \ - goto fn_exit; \ - } \ - } \ - writebuf_off = req_off; \ - writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\ - 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); \ - goto fn_exit; \ - } \ - } \ - 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); \ - goto fn_exit; \ - } \ - req_len -= write_sz; \ - userbuf_off += write_sz; \ - writebuf_off += writebuf_len; \ - writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\ - 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); \ - goto fn_exit; \ - } \ - 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); \ - goto fn_exit; \ - } \ - writebuf_off = req_off; \ - writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize,end_offset-writebuf_off+1));\ - } \ - 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); \ - goto fn_exit; \ - } \ - req_len -= write_sz; \ - userbuf_off += write_sz; \ - writebuf_off += writebuf_len; \ - writebuf_len = (unsigned) (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);\ - } \ -} -void ADIOI_GEN_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; - ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes; - ADIO_Offset n_etypes_in_filetype, abs_off_in_filetype=0; - MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, lb; - 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; - unsigned writebuf_len, max_bufsize, write_sz; - MPI_Aint bufsize; - ADIO_Status status1; - ADIO_Offset new_bwr_size, new_fwr_size, st_fwr_size, fwr_size=0, bwr_size, req_len; - static char myname[] = "ADIOI_GEN_WriteStrided"; - - if (fd->hints->ds_write == ADIOI_HINT_DISABLE) { - /* if user has disabled data sieving on reads, 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, &lb, &filetype_extent); - MPI_Type_size_x(datatype, &buftype_size); - MPI_Type_get_extent(datatype, &lb, &buftype_extent); - etype_size = fd->etype_size; - - ADIOI_Assert((buftype_size * count) == ((MPI_Count)buftype_size * (ADIO_Offset)count)); - bufsize = buftype_size * count; - -/* get max_bufsize from the info object. */ - - max_bufsize = fd->hints->ind_wr_buffer_size; - - 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 = off + bufsize - 1; - writebuf_off = off; - writebuf = (char *) ADIOI_Malloc(max_bufsize); - writebuf_len = (unsigned) (ADIOI_MIN(max_bufsize, end_offset-writebuf_off+1)); - -/* if atomicity is true, lock the region to be accessed */ - if (fd->atomicity) - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - - for (j=0; jcount; i++) { - userbuf_off = (ADIO_Offset)j*(ADIO_Offset)buftype_extent + flat_buf->indices[i]; - 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, end_offset-start_off+1); - - if (*error_code != MPI_SUCCESS) goto fn_exit; - - 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; 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) { - /* though MPI api has an integer 'count' parameter, derived - * datatypes might describe more bytes than can fit into an integer. - * if we've made it this far, we can pass a count of original - * datatypes, instead of a count of bytes (which might overflow) - * Other WriteContig calls in this path are operating on data - * sieving buffer */ - ADIO_WriteContig(fd, buf, count, datatype, 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 - goto fn_exit; - } - - /* 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(max_bufsize); - memset(writebuf, -1, max_bufsize); - - 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) goto fn_exit; - } - 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; - } - - fd->fp_sys_posn = -1; /* set it to null. */ - -#ifdef HAVE_STATUS_SET_BYTES - /* datatypes returning negagive values, probably related to tt 1893 */ - MPIR_Status_set_bytes(status, datatype, bufsize); -/* This is a temporary way of filling in status. The right way is to - 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); -} - diff --git a/3rd-party/romio321/adio/common/ad_write_str_naive.c b/3rd-party/romio321/adio/common/ad_write_str_naive.c deleted file mode 100644 index 4ab4920bc16..00000000000 --- a/3rd-party/romio321/adio/common/ad_write_str_naive.c +++ /dev/null @@ -1,379 +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 "adio.h" -#include "adio_extern.h" - -void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count, - MPI_Datatype buftype, 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; - /* bwr == buffer write; fwr == file write */ - ADIO_Offset bwr_size, fwr_size=0, sum, size_in_filetype; - int b_index; - MPI_Count bufsize; - ADIO_Offset n_etypes_in_filetype; - ADIO_Offset size, n_filetypes, etype_in_filetype; - ADIO_Offset abs_off_in_filetype=0, req_len; - MPI_Count filetype_size, etype_size, buftype_size; - MPI_Aint filetype_extent, buftype_extent, lb; - int buf_count, buftype_is_contig, filetype_is_contig; - ADIO_Offset userbuf_off; - ADIO_Offset off, req_off, disp, end_offset=0, start_off; - ADIO_Status status1; - - *error_code = MPI_SUCCESS; /* changed below if error */ - - ADIOI_Datatype_iscontig(buftype, &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, buftype, 0); -#endif - *error_code = MPI_SUCCESS; - return; - } - - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - MPI_Type_size_x(buftype, &buftype_size); - MPI_Type_get_extent(buftype, &lb, &buftype_extent); - etype_size = fd->etype_size; - - ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count)); - bufsize = buftype_size * count; - - /* contiguous in buftype and filetype is handled elsewhere */ - - if (!buftype_is_contig && filetype_is_contig) { - int b_count; - /* noncontiguous in memory, contiguous in file. */ - - flat_buf = ADIOI_Flatten_and_find(buftype); - - off = (file_ptr_type == ADIO_INDIVIDUAL) ? fd->fp_ind : - fd->disp + (ADIO_Offset)etype_size * offset; - - start_off = off; - end_offset = off + bufsize - 1; - - /* if atomicity is true, lock (exclusive) the region to be accessed */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - /* for each region in the buffer, grab the data and put it in - * place - */ - for (b_count=0; b_count < count; b_count++) { - for (b_index=0; b_index < flat_buf->count; b_index++) { - userbuf_off = (ADIO_Offset)b_count*(ADIO_Offset)buftype_extent + - flat_buf->indices[b_index]; - req_off = off; - req_len = flat_buf->blocklens[b_index]; - - ADIOI_Assert(req_len == (int) req_len); - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); - ADIO_WriteContig(fd, - (char *) buf + userbuf_off, - (int)req_len, - MPI_BYTE, - ADIO_EXPLICIT_OFFSET, - req_off, - &status1, - error_code); - if (*error_code != MPI_SUCCESS) return; - - /* off is (potentially) used to save the final offset later */ - off += flat_buf->blocklens[b_index]; - } - } - - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - - } - - else { /* noncontiguous in file */ - int f_index, st_index = 0; - ADIO_Offset st_fwr_size, st_n_filetypes; - int flag; - - /* First we're going to calculate a set of values for use in all - * the noncontiguous in file cases: - * start_off - starting byte position of data in file - * end_offset - last byte offset to be acessed in the file - * st_n_filetypes - how far into the file we start in terms of - * whole filetypes - * st_index - index of block in first filetype that we will be - * starting in (?) - * st_fwr_size - size of the data in the first filetype block - * that we will write (accounts for being part-way - * into writing this block of the filetype - * - */ - - /* 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) { - start_off = fd->fp_ind; /* in bytes */ - n_filetypes = -1; - flag = 0; - while (!flag) { - n_filetypes++; - for (f_index=0; f_index < flat_file->count; f_index++) { - if (disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + - flat_file->blocklens[f_index] >= start_off) - { - /* this block contains our starting position */ - - st_index = f_index; - fwr_size = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent + - flat_file->blocklens[f_index] - start_off; - flag = 1; - break; - } - } - } - } - 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 (f_index=0; f_index < flat_file->count; f_index++) { - sum += flat_file->blocklens[f_index]; - if (sum > size_in_filetype) { - st_index = f_index; - fwr_size = sum - size_in_filetype; - abs_off_in_filetype = flat_file->indices[f_index] + - size_in_filetype - - (sum - flat_file->blocklens[f_index]); - break; - } - } - - /* abs. offset in bytes in the file */ - start_off = disp + n_filetypes*(ADIO_Offset)filetype_extent + - abs_off_in_filetype; - } - - st_fwr_size = fwr_size; - st_n_filetypes = n_filetypes; - - /* start_off, st_n_filetypes, st_index, and st_fwr_size are - * all calculated at this point - */ - - /* Calculate end_offset, the last byte-offset that will be accessed. - * e.g., if start_off=0 and 100 bytes to be written, end_offset=99 - */ - userbuf_off = 0; - f_index = st_index; - off = start_off; - fwr_size = ADIOI_MIN(st_fwr_size, bufsize); - while (userbuf_off < bufsize) { - userbuf_off += fwr_size; - end_offset = off + fwr_size - 1; - - if (f_index < (flat_file->count - 1)) f_index++; - else { - f_index = 0; - n_filetypes++; - } - - off = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent; - fwr_size = ADIOI_MIN(flat_file->blocklens[f_index], - bufsize-(unsigned)userbuf_off); - } - - /* End of calculations. At this point the following values have - * been calculated and are ready for use: - * - start_off - * - end_offset - * - st_n_filetypes - * - st_index - * - st_fwr_size - */ - - /* if atomicity is true, lock (exclusive) the region to be accessed */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_WRITE_LOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - if (buftype_is_contig && !filetype_is_contig) { - /* contiguous in memory, noncontiguous in file. should be the - * most common case. - */ - - userbuf_off = 0; - f_index = st_index; - off = start_off; - n_filetypes = st_n_filetypes; - fwr_size = ADIOI_MIN(st_fwr_size, bufsize); - - /* while there is still space in the buffer, write more data */ - while (userbuf_off < bufsize) { - if (fwr_size) { - /* TYPE_UB and TYPE_LB can result in - fwr_size = 0. save system call in such cases */ - req_off = off; - req_len = fwr_size; - - ADIOI_Assert(req_len == (int) req_len); - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); - ADIO_WriteContig(fd, - (char *) buf + userbuf_off, - (int)req_len, - MPI_BYTE, - ADIO_EXPLICIT_OFFSET, - req_off, - &status1, - error_code); - if (*error_code != MPI_SUCCESS) return; - } - userbuf_off += fwr_size; - - if (off + fwr_size < disp + flat_file->indices[f_index] + - flat_file->blocklens[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent) - { - /* important that this value be correct, as it is - * used to set the offset in the fd near the end of - * this function. - */ - 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 (f_index < (flat_file->count - 1)) f_index++; - else { - f_index = 0; - n_filetypes++; - } - off = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent; - fwr_size = ADIOI_MIN(flat_file->blocklens[f_index], - bufsize-(unsigned)userbuf_off); - } - } - } - else { - ADIO_Offset i_offset, tmp_bufsize = 0; - /* noncontiguous in memory as well as in file */ - - flat_buf = ADIOI_Flatten_and_find(buftype); - - b_index = buf_count = 0; - i_offset = flat_buf->indices[0]; - f_index = st_index; - off = start_off; - n_filetypes = st_n_filetypes; - fwr_size = st_fwr_size; - bwr_size = flat_buf->blocklens[0]; - - /* while we haven't read size * count bytes, keep going */ - while (tmp_bufsize < bufsize) { - ADIO_Offset new_bwr_size = bwr_size, new_fwr_size = fwr_size; - - size = ADIOI_MIN(fwr_size, bwr_size); - if (size) { - req_off = off; - req_len = size; - userbuf_off = i_offset; - - ADIOI_Assert(req_len == (int) req_len); - ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)buf) + userbuf_off) == (ADIO_Offset)(MPIU_Upint)((MPIU_Upint)buf + userbuf_off)); - ADIO_WriteContig(fd, - (char *) buf + userbuf_off, - (int)req_len, - MPI_BYTE, - ADIO_EXPLICIT_OFFSET, - req_off, - &status1, - error_code); - if (*error_code != MPI_SUCCESS) return; - } - - if (size == fwr_size) { - /* reached end of contiguous block in file */ - if (f_index < (flat_file->count - 1)) f_index++; - else { - f_index = 0; - n_filetypes++; - } - - off = disp + flat_file->indices[f_index] + - n_filetypes*(ADIO_Offset)filetype_extent; - - new_fwr_size = flat_file->blocklens[f_index]; - if (size != bwr_size) { - i_offset += size; - new_bwr_size -= size; - } - } - - if (size == bwr_size) { - /* reached end of contiguous block in memory */ - - b_index = (b_index + 1)%flat_buf->count; - buf_count++; - i_offset = (ADIO_Offset)buftype_extent*(ADIO_Offset)(buf_count/flat_buf->count) + - flat_buf->indices[b_index]; - new_bwr_size = flat_buf->blocklens[b_index]; - if (size != fwr_size) { - off += size; - new_fwr_size -= size; - } - } - tmp_bufsize += size; - fwr_size = new_fwr_size; - bwr_size = new_bwr_size; - } - } - - /* unlock the file region if we locked it */ - if ((fd->atomicity) && ADIO_Feature(fd, ADIO_LOCKS)) - { - ADIOI_UNLOCK(fd, start_off, SEEK_SET, end_offset-start_off+1); - } - - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; - } /* end of (else noncontiguous in file) */ - - fd->fp_sys_posn = -1; /* mark it as invalid. */ - -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, buftype, bufsize); - /* This is a temporary way of filling in status. The right way is to - * keep track of how much data was actually written and placed in buf - */ -#endif - - if (!buftype_is_contig) ADIOI_Delete_flattened(buftype); -} diff --git a/3rd-party/romio321/adio/common/adi_close.c b/3rd-party/romio321/adio/common/adi_close.c deleted file mode 100644 index cdc18737850..00000000000 --- a/3rd-party/romio321/adio/common/adi_close.c +++ /dev/null @@ -1,45 +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" - -#ifdef HAVE_UNISTD_H -#include -#endif - - - -void ADIOI_GEN_Close(ADIO_File fd, int *error_code) -{ - int err, derr=0; - static char myname[] = "ADIOI_GEN_CLOSE"; - -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_close_a, 0, NULL ); -#endif - err = close(fd->fd_sys); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_close_b, 0, NULL ); -#endif - if (fd->fd_direct >= 0) { -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_close_a, 0, NULL ); -#endif - derr = close(fd->fd_direct); -#ifdef ADIOI_MPE_LOGGING - MPE_Log_event( ADIOI_MPE_close_b, 0, NULL ); -#endif - } - - fd->fd_sys = -1; - fd->fd_direct = -1; - - if (err == -1 || derr == -1) { - *error_code = ADIOI_Err_create_code(myname, fd->filename, errno); - } - else *error_code = MPI_SUCCESS; -} diff --git a/3rd-party/romio321/adio/common/async_list.c b/3rd-party/romio321/adio/common/async_list.c deleted file mode 100644 index 239dbe587ba..00000000000 --- a/3rd-party/romio321/adio/common/async_list.c +++ /dev/null @@ -1,170 +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" - -ADIOI_Async_node *ADIOI_Malloc_async_node(void) -{ -/* returns a pointer to a new node that can be added to ADIOI_Async_list. - To reduce the number of system calls, mallocs NUM nodes at a time - and maintains list of available nodes. Supplies a node from this - list if available, else mallocs a new set of NUM and provides one - from that set. Is NUM=100 a good number? */ - -#define NUM 100 - - ADIOI_Async_node *curr, *ptr; - int i; - - if (!ADIOI_Async_avail_head) { - ADIOI_Async_avail_head = (ADIOI_Async_node *) - ADIOI_Malloc(NUM*sizeof(ADIOI_Async_node)); - curr = ADIOI_Async_avail_head; - for (i=1; inext = ADIOI_Async_avail_head+i; - curr = curr->next; - } - curr->next = NULL; - ADIOI_Async_avail_tail = curr; - - /* keep track of malloced area that needs to be freed later */ - if (!ADIOI_Malloc_async_tail) { - ADIOI_Malloc_async_tail = (ADIOI_Malloc_async *) - ADIOI_Malloc(sizeof(ADIOI_Malloc_async)); - ADIOI_Malloc_async_head = ADIOI_Malloc_async_tail; - ADIOI_Malloc_async_head->ptr = ADIOI_Async_avail_head; - ADIOI_Malloc_async_head->next = NULL; - } - else { - ADIOI_Malloc_async_tail->next = (ADIOI_Malloc_async *) - ADIOI_Malloc(sizeof(ADIOI_Malloc_async)); - ADIOI_Malloc_async_tail = ADIOI_Malloc_async_tail->next; - ADIOI_Malloc_async_tail->ptr = ADIOI_Async_avail_head; - ADIOI_Malloc_async_tail->next = NULL; - } - } - - ptr = ADIOI_Async_avail_head; - ADIOI_Async_avail_head = ADIOI_Async_avail_head->next; - if (!ADIOI_Async_avail_head) ADIOI_Async_avail_tail = NULL; - - return ptr; -} - - -void ADIOI_Free_async_node(ADIOI_Async_node *node) -{ -/* moves this node to available pool. does not actually free it. */ - - if (!ADIOI_Async_avail_tail) - ADIOI_Async_avail_head = ADIOI_Async_avail_tail = node; - else { - ADIOI_Async_avail_tail->next = node; - ADIOI_Async_avail_tail = node; - } - node->next = NULL; -} - - -void ADIOI_Add_req_to_list(ADIO_Request *request) -{ -/* add request to list of outstanding requests */ - - ADIOI_Async_node *curr; - - if (!ADIOI_Async_list_head) { - ADIOI_Async_list_head = ADIOI_Malloc_async_node(); - ADIOI_Async_list_head->request = request; - ADIOI_Async_list_head->prev = ADIOI_Async_list_head->next = NULL; - ADIOI_Async_list_tail = ADIOI_Async_list_head; - (*request)->ptr_in_async_list = ADIOI_Async_list_head; - } - else { - curr = ADIOI_Async_list_tail; - curr->next = ADIOI_Malloc_async_node(); - ADIOI_Async_list_tail = curr->next; - ADIOI_Async_list_tail->request = request; - ADIOI_Async_list_tail->prev = curr; - ADIOI_Async_list_tail->next = NULL; - (*request)->ptr_in_async_list = ADIOI_Async_list_tail; - } -} - -/* Sets error_code to MPI_SUCCESS on success, creates an error code on - * failure. - */ -void ADIOI_Complete_async(int *error_code) -{ -/* complete all outstanding async I/O operations so that new ones can be - initiated. Remove them all from async_list. */ - - ADIO_Status status; - ADIO_Request *request; - ADIOI_Async_node *tmp; - static char myname[] = "ADIOI_Complete_async"; - - *error_code = MPI_SUCCESS; - - while (ADIOI_Async_list_head) { - request = ADIOI_Async_list_head->request; - (*request)->queued = -1; /* ugly internal hack that prevents - ADIOI_xxxComplete from freeing the request object. - This is required, because the user will call MPI_Wait - later, which would require status to be filled. */ - switch ((*request)->optype) { - case ADIOI_READ: -/* (*((*request)->fd->fns->ADIOI_xxx_ReadComplete))(request, - &status,error_code);*/ - ADIO_ReadComplete(request, &status, error_code); - break; - case ADIOI_WRITE: -/* (*((*request)->fd->fns->ADIOI_xxx_WriteComplete))(request, - &status, error_code);*/ - ADIO_WriteComplete(request, &status, error_code); - break; - default: - /* --BEGIN ERROR HANDLING-- */ - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_INTERN, - "Unknown request optype", 0); - return; - /* --END ERROR HANDLING-- */ - } - (*request)->queued = 0; /* dequeued, but request object not - freed */ - - tmp = ADIOI_Async_list_head; - ADIOI_Async_list_head = ADIOI_Async_list_head->next; - ADIOI_Free_async_node(tmp); - } - ADIOI_Async_list_tail = NULL; -} - - -void ADIOI_Del_req_from_list(ADIO_Request *request) -{ -/* Delete a request that has already been completed from the async - list and move it to the list of available nodes. Typically called - from within an ADIO_Test/ADIO_Wait. */ - - ADIOI_Async_node *curr, *prev, *next; - - curr = (*request)->ptr_in_async_list; - prev = curr->prev; - - if (prev) prev->next = curr->next; - else ADIOI_Async_list_head = curr->next; - - next = curr->next; - if (next) next->prev = prev; - else ADIOI_Async_list_tail = prev; - - ADIOI_Free_async_node(curr); -} diff --git a/3rd-party/romio321/adio/common/byte_offset.c b/3rd-party/romio321/adio/common/byte_offset.c deleted file mode 100644 index 7c3d1fe1c7d..00000000000 --- a/3rd-party/romio321/adio/common/byte_offset.c +++ /dev/null @@ -1,52 +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" - -/* Returns the absolute byte position in the file corresponding to - "offset" etypes relative to the current view. */ - -void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp) -{ - ADIOI_Flatlist_node *flat_file; - int i; - ADIO_Offset n_filetypes, etype_in_filetype, sum, abs_off_in_filetype=0, size_in_filetype; - MPI_Count n_etypes_in_filetype, filetype_size, etype_size; - int filetype_is_contig; - MPI_Aint filetype_extent, lb; - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - etype_size = fd->etype_size; - - if (filetype_is_contig) *disp = fd->disp + etype_size * offset; - else { -/* filetype already flattened in ADIO_Open */ - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - - MPI_Type_size_x(fd->filetype, &filetype_size); - 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; icount; i++) { - sum += flat_file->blocklens[i]; - if (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 */ - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - *disp = fd->disp + n_filetypes * ADIOI_AINT_CAST_TO_OFFSET filetype_extent + abs_off_in_filetype; - } -} diff --git a/3rd-party/romio321/adio/common/cb_config_list.c b/3rd-party/romio321/adio/common/cb_config_list.c deleted file mode 100644 index 1fd827d7d2b..00000000000 --- a/3rd-party/romio321/adio/common/cb_config_list.c +++ /dev/null @@ -1,756 +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. - */ - -/* cb_config_list.c - * - * The important, externally used functions from this file are: - * ADIOI_cb_bcast_rank_map() - * ADIOI_cb_gather_name_array() - * ADIOI_cb_config_list_parse() - * ADIOI_cb_copy_name_array() - * ADIOI_cb_delete_name_array() - * - * Prototypes for these are in adio/include/adio_cb_config_list.h - */ - -#include "adio.h" -#include "mpi.h" -#include "adio_cb_config_list.h" -#include -#include -#include - -/* token types */ -#define AGG_WILDCARD 1 -#define AGG_STRING 2 -#define AGG_COMMA 3 -#define AGG_COLON 4 -#define AGG_ERROR -1 -#define AGG_EOS 0 - -#undef CB_CONFIG_LIST_DEBUG - -/* a couple of globals keep things simple */ -int ADIOI_cb_config_list_keyval = MPI_KEYVAL_INVALID; -static char *yylval; -static char *token_ptr; - -/* internal stuff */ -static int get_max_procs(int cb_nodes); -static int match_procs(char *name, int max_per_proc, char *procnames[], - char used_procnames[], - int nr_procnames, int ranks[], int nr_ranks, - int *nr_ranks_allocated); -static int match_this_proc(char *name, int cur_proc, int max_matches, - char *procnames[], char used_procnames[], - int nr_procnames, int ranks[], - int nr_ranks, int nr_ranks_allocated); -static int find_name(char *name, char *procnames[], char used_procnames[], - int nr_procnames, int start_ind); -static int cb_config_list_lex(void); - - -/* ADIOI_cb_bcast_rank_map() - broadcast the rank array - * - * Parameters: - * fd - ADIO_File for which update is occurring. cb_nodes and ranklist - * parameters must be up-to-date on rank 0 of the fd->comm. - * - * should probably be a void fn. - */ -int ADIOI_cb_bcast_rank_map(ADIO_File fd) -{ - int my_rank; - char *value; - int error_code = MPI_SUCCESS; - static char myname[] = "ADIOI_cb_bcast_rank_map"; - char *p; - int i; - - MPI_Bcast(&(fd->hints->cb_nodes), 1, MPI_INT, 0, fd->comm); - if (fd->hints->cb_nodes > 0) { - MPI_Comm_rank(fd->comm, &my_rank); - if (my_rank != 0) { - fd->hints->ranklist = ADIOI_Malloc(fd->hints->cb_nodes*sizeof(int)); - if (fd->hints->ranklist == NULL) { - error_code = MPIO_Err_create_code(error_code, - MPIR_ERR_RECOVERABLE, - myname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return error_code; - } - } - MPI_Bcast(fd->hints->ranklist, fd->hints->cb_nodes, MPI_INT, 0, - fd->comm); - } - /* TEMPORARY -- REMOVE WHEN NO LONGER UPDATING INFO FOR - * FS-INDEP. */ - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - ADIOI_Snprintf(value, MPI_MAX_INFO_VAL+1, "%d", fd->hints->cb_nodes); - ADIOI_Info_set(fd->info, "cb_nodes", value); - p = value; - /* the (by MPI rank) list of aggregators can be larger than - * MPI_MAX_INFO_VAL, so we will simply truncate when we reach capacity. I - * wasn't clever enough to figure out how to rewind and put '...' at the - * end in the truncate case */ - for (i=0; i< fd->hints->cb_nodes; i++) { - int incr, remain = (MPI_MAX_INFO_VAL) - (p-value); - incr = ADIOI_Snprintf(p, remain, "%d ", fd->hints->ranklist[i]); - if (incr >= remain) break; - p += incr; - } - ADIOI_Info_set(fd->info, "romio_aggregator_list", value); - ADIOI_Free(value); - - return 0; -} - -/* ADIOI_cb_gather_name_array() - gather a list of processor names from all processes - * in a communicator and store them on rank 0. - * - * This is a collective call on the communicator(s) passed in. - * - * Obtains a rank-ordered list of processor names from the processes in - * "dupcomm". - * - * Returns 0 on success, -1 on failure. - * - * NOTE: Needs some work to cleanly handle out of memory cases! - */ -int ADIOI_cb_gather_name_array(MPI_Comm comm, - MPI_Comm dupcomm, - ADIO_cb_name_array *arrayp) -{ - char my_procname[MPI_MAX_PROCESSOR_NAME], **procname = 0; - int *procname_len = NULL, my_procname_len, *disp = NULL, i; - int commsize, commrank, found; - ADIO_cb_name_array array = NULL; - int alloc_size; - - if (ADIOI_cb_config_list_keyval == MPI_KEYVAL_INVALID) { - /* cleaned up by ADIOI_End_call */ - MPI_Comm_create_keyval((MPI_Comm_copy_attr_function *) ADIOI_cb_copy_name_array, - (MPI_Comm_delete_attr_function *) ADIOI_cb_delete_name_array, - &ADIOI_cb_config_list_keyval, NULL); - } - else { - MPI_Comm_get_attr(comm, ADIOI_cb_config_list_keyval, (void *) &array, &found); - if (found) { - ADIOI_Assert(array != NULL); - *arrayp = array; - return 0; - } - } - - MPI_Comm_size(dupcomm, &commsize); - MPI_Comm_rank(dupcomm, &commrank); - - MPI_Get_processor_name(my_procname, &my_procname_len); - - /* allocate space for everything */ - array = (ADIO_cb_name_array) ADIOI_Malloc(sizeof(*array)); - if (array == NULL) { - return -1; - } - array->refct = 2; /* we're going to associate this with two comms */ - - if (commrank == 0) { - /* process 0 keeps the real list */ - array->namect = commsize; - - array->names = (char **) ADIOI_Malloc(sizeof(char *) * commsize); - if (array->names == NULL) { - return -1; - } - procname = array->names; /* simpler to read */ - - procname_len = (int *) ADIOI_Malloc(commsize * sizeof(int)); - if (procname_len == NULL) { - return -1; - } - } - else { - /* everyone else just keeps an empty list as a placeholder */ - array->namect = 0; - array->names = NULL; - } - /* gather lengths first */ - MPI_Gather(&my_procname_len, 1, MPI_INT, - procname_len, 1, MPI_INT, 0, dupcomm); - - if (commrank == 0) { -#ifdef CB_CONFIG_LIST_DEBUG - for (i=0; i < commsize; i++) { - FPRINTF(stderr, "len[%d] = %d\n", i, procname_len[i]); - } -#endif - - alloc_size = 0; - for (i=0; i < commsize; i++) { - /* add one to the lengths because we need to count the - * terminator, and we are going to use this list of lengths - * again in the gatherv. - */ - alloc_size += ++procname_len[i]; - } - - procname[0] = ADIOI_Malloc(alloc_size); - if (procname[0] == NULL) { - ADIOI_Free(array); - return -1; - } - - for (i=1; i < commsize; i++) { - procname[i] = procname[i-1] + procname_len[i-1]; - } - - /* create our list of displacements for the gatherv. we're going - * to do everything relative to the start of the region allocated - * for procname[0] - */ - disp = ADIOI_Malloc(commsize * sizeof(int)); - disp[0] = 0; - for (i=1; i < commsize; i++) { - disp[i] = (int) (procname[i] - procname[0]); - } - - } - - /* now gather strings */ - if (commrank == 0) { - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, - procname[0], procname_len, disp, MPI_CHAR, - 0, dupcomm); - } - else { - /* if we didn't do this, we would need to allocate procname[] - * on all processes...which seems a little silly. - */ - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, - NULL, NULL, NULL, MPI_CHAR, 0, dupcomm); - } - - if (commrank == 0) { - /* no longer need the displacements or lengths */ - ADIOI_Free(disp); - ADIOI_Free(procname_len); - -#ifdef CB_CONFIG_LIST_DEBUG - for (i=0; i < commsize; i++) { - FPRINTF(stderr, "name[%d] = %s\n", i, procname[i]); - } -#endif - } - - /* store the attribute; we want to store SOMETHING on all processes - * so that they can all tell if we have gone through this procedure - * or not for the given communicator. - * - * specifically we put it on both the original comm, so we can find - * it next time an open is performed on this same comm, and on the - * dupcomm, so we can use it in I/O operations. - */ - MPI_Comm_set_attr (comm, ADIOI_cb_config_list_keyval, array); - MPI_Comm_set_attr (dupcomm, ADIOI_cb_config_list_keyval, array); - *arrayp = array; - return 0; -} - - -/* ADIOI_cb_config_list_parse() - parse the cb_config_list and build the - * ranklist - * - * Parameters: - * (pretty self explanatory) - * - * Returns number of ranks allocated in parsing, -1 on error. - */ -int ADIOI_cb_config_list_parse(char *config_list, - ADIO_cb_name_array array, - int ranklist[], - int cb_nodes) -{ - int token, max_procs, cur_rank = 0, nr_procnames; - char *cur_procname, *cur_procname_p, **procnames; - char *used_procnames; - - nr_procnames = array->namect; - procnames = array->names; - - /* nothing big goes on the stack */ - /* we use info val here and for yylval because we know the string - * cannot be any bigger than this. - */ - cur_procname = ADIOI_Malloc((MPI_MAX_INFO_VAL+1) * sizeof(char)); - if (cur_procname == NULL) { - return -1; - } - - yylval = ADIOI_Malloc((MPI_MAX_INFO_VAL+1) * sizeof(char)); - if (yylval == NULL) { - ADIOI_Free(cur_procname); - return -1; - } - - token_ptr = config_list; - - /* right away let's make sure cb_nodes isn't too big */ - if (cb_nodes > nr_procnames) cb_nodes = nr_procnames; - - /* used_procnames is used as a mask so that we don't have to destroy - * our procnames array - */ - used_procnames = ADIOI_Malloc(array->namect * sizeof(char)); - if (used_procnames == NULL) { - ADIOI_Free(cur_procname); - ADIOI_Free(yylval); - yylval = NULL; - return -1; - } - memset(used_procnames, 0, array->namect); - - /* optimization for "*:*"; arguably this could be done before we - * build the list of processor names...but that would make things - * messy. - */ - if (strcmp(config_list, "*:*") == 0) { - for (cur_rank = 0; cur_rank < cb_nodes; cur_rank++) { - ranklist[cur_rank] = cur_rank; - } - ADIOI_Free(cur_procname); - ADIOI_Free(yylval); - yylval = NULL; - ADIOI_Free(used_procnames); - return cb_nodes; - } - - while (cur_rank < cb_nodes) { - token = cb_config_list_lex(); - - if (token == AGG_EOS) { - ADIOI_Free(cur_procname); - ADIOI_Free(yylval); - yylval = NULL; - ADIOI_Free(used_procnames); - return cur_rank; - } - - if (token != AGG_WILDCARD && token != AGG_STRING) { - /* maybe ignore and try to keep going? */ - FPRINTF(stderr, "error parsing config list\n"); - ADIOI_Free(cur_procname); - ADIOI_Free(yylval); - yylval = NULL; - ADIOI_Free(used_procnames); - return cur_rank; - } - - if (token == AGG_WILDCARD) { - cur_procname_p = NULL; - } - else { - /* AGG_STRING is the only remaining case */ - /* save procname (for now) */ - ADIOI_Strncpy(cur_procname, yylval, MPI_MAX_INFO_VAL+1); - cur_procname_p = cur_procname; - } - - /* after we have saved the current procname, we can grab max_procs */ - max_procs = get_max_procs(cb_nodes); - -#ifdef CB_CONFIG_LIST_DEBUG - if (token == AGG_WILDCARD) { - FPRINTF(stderr, "looking for *:%d\n", max_procs); - } - else { - FPRINTF(stderr, "looking for %s:%d\n", cur_procname, max_procs); - } -#endif - - /* do the matching for this piece of the cb_config_list */ - match_procs(cur_procname_p, max_procs, procnames, used_procnames, - nr_procnames, ranklist, cb_nodes, &cur_rank); - } - ADIOI_Free(cur_procname); - ADIOI_Free(yylval); - yylval = NULL; - ADIOI_Free(used_procnames); - return cur_rank; -} - -/* ADIOI_cb_copy_name_array() - attribute copy routine - */ -int ADIOI_cb_copy_name_array(MPI_Comm comm, - int keyval, - void *extra, - void *attr_in, - void **attr_out, - int *flag) -{ - ADIO_cb_name_array array; - - ADIOI_UNREFERENCED_ARG(comm); - ADIOI_UNREFERENCED_ARG(keyval); - ADIOI_UNREFERENCED_ARG(extra); - - array = (ADIO_cb_name_array) attr_in; - if (array != NULL) array->refct++; - - *attr_out = attr_in; - *flag = 1; /* make a copy in the new communicator */ - - return MPI_SUCCESS; -} - -/* ADIOI_cb_delete_name_array() - attribute destructor - */ -int ADIOI_cb_delete_name_array(MPI_Comm comm, - int keyval, - void *attr_val, - void *extra) -{ - ADIO_cb_name_array array; - - ADIOI_UNREFERENCED_ARG(comm); - ADIOI_UNREFERENCED_ARG(extra); - - array = (ADIO_cb_name_array) attr_val; - ADIOI_Assert(array != NULL); - array->refct--; - - if (array->refct <= 0) { - /* time to free the structures (names, array of ptrs to names, struct) - */ - if (array->namect) { - /* Note that array->names[i], where i > 0, - * are just pointers into the allocated region array->names[0] - */ - ADIOI_Free(array->names[0]); - } - if (array->names != NULL) ADIOI_Free(array->names); - ADIOI_Free(array); - } - return MPI_SUCCESS; -} - -/* match_procs() - given a name (or NULL for wildcard) and a max. number - * of aggregator processes (per processor name), this - * matches in the procnames[] array and puts appropriate - * ranks in the ranks array. - * - * Parameters: - * name - processor name (or NULL for wildcard) - * max_per_proc - maximum # of processes to use for aggregation from a - * single processor - * procnames - array of processor names - * nr_procnames - length of procnames array - * ranks - array of process ranks - * nr_ranks - length of process ranks array (also max. # of aggregators) - * nr_ranks_allocated - # of array entries which have been filled in, - * which is also the index to the first empty entry - * - * Returns number of matches. - */ -static int match_procs(char *name, - int max_per_proc, - char *procnames[], - char used_procnames[], - int nr_procnames, - int ranks[], - int nr_ranks, - int *nr_ranks_allocated) -{ - int wildcard_proc, cur_proc, old_nr_allocated, ret; - - /* save this so we can report on progress */ - old_nr_allocated = *nr_ranks_allocated; - - if (name == NULL) { - /* wildcard case */ - - /* optimize for *:0 case */ - if (max_per_proc == 0) { - /* loop through procnames and mark them all as used */ - for (cur_proc = 0; cur_proc < nr_procnames; cur_proc++) { - used_procnames[cur_proc] = 1; - } - return 0; - } - - /* the plan here is to start at the beginning of the procnames - * array looking for processor names to apply the wildcard to. - * - * we set wildcard_proc to 0 here but do the search inside the - * while loop so that we aren't starting our search from the - * beginning of the procnames array each time. - */ - wildcard_proc = 0; - - while (nr_ranks - *nr_ranks_allocated > 0) { - /* find a name */ - while ((wildcard_proc < nr_procnames) && - (used_procnames[wildcard_proc] != 0)) - { - wildcard_proc++; - } - - if (wildcard_proc == nr_procnames) { - /* we have used up the entire procnames list */ - return *nr_ranks_allocated - old_nr_allocated; - } - -#ifdef CB_CONFIG_LIST_DEBUG - FPRINTF(stderr, "performing wildcard match (*:%d) starting with %s (%d)\n", - max_per_proc, procnames[wildcard_proc], wildcard_proc); -#endif - - cur_proc = wildcard_proc; - -#ifdef CB_CONFIG_LIST_DEBUG - FPRINTF(stderr, " assigning name %s (%d) to rank %d in mapping\n", - procnames[cur_proc], cur_proc, *nr_ranks_allocated); -#endif - - /* alloc max_per_proc from this host; cur_proc points to - * the first one. We want to save this name for use in - * our while loop. - */ - ranks[*nr_ranks_allocated] = cur_proc; - *nr_ranks_allocated = *nr_ranks_allocated + 1; - cur_proc++; - - /* so, to accomplish this we use the match_this_proc() to - * alloc max_per_proc-1. we increment cur_proc so that the - * procnames[] entry doesn't get trashed. then AFTER the call - * we clean up the first instance of the name. - */ - ret = match_this_proc(procnames[wildcard_proc], cur_proc, - max_per_proc-1, procnames, used_procnames, - nr_procnames, - ranks, nr_ranks, *nr_ranks_allocated); - if (ret > 0) *nr_ranks_allocated = *nr_ranks_allocated + ret; - - /* clean up and point wildcard_proc to the next entry, since - * we know that this one is NULL now. - */ - used_procnames[wildcard_proc] = 1; - wildcard_proc++; - } - } - else { - /* specific host was specified; this one is easy */ -#ifdef CB_CONFIG_LIST_DEBUG - FPRINTF(stderr, "performing name match (%s:%d)\n", name, max_per_proc); -#endif - - ret = match_this_proc(name, 0, max_per_proc, procnames, used_procnames, - nr_procnames, ranks, nr_ranks, - *nr_ranks_allocated); - if (ret > 0) *nr_ranks_allocated = *nr_ranks_allocated + ret; - } - return *nr_ranks_allocated - old_nr_allocated; -} - -/* match_this_proc() - find each instance of processor name "name" in - * the "procnames" array, starting with index "cur_proc" - * and add the first "max_matches" into the "ranks" - * array. remove all instances of "name" from - * "procnames". - * - * Parameters: - * name - processor name to match - * cur_proc - index into procnames[] at which to start matching - * procnames - array of processor names - * used_procnames - array of values indicating if a given procname has - * been allocated or removed already - * nr_procnames - length of procnames array - * ranks - array of processor ranks - * nr_ranks - length of ranks array - * nr_ranks_allocated - number of ranks already filled in, or the next - * entry to fill in (equivalent) - * - * Returns number of ranks filled in (allocated). - */ -static int match_this_proc(char *name, - int cur_proc, - int max_matches, - char *procnames[], - char used_procnames[], - int nr_procnames, - int ranks[], - int nr_ranks, - int nr_ranks_allocated) -{ - int ranks_remaining, nr_to_alloc, old_nr_allocated; - - old_nr_allocated = nr_ranks_allocated; - - /* calculate how many ranks we want to allocate */ - ranks_remaining = nr_ranks - nr_ranks_allocated; - nr_to_alloc = (max_matches < ranks_remaining) ? - max_matches : ranks_remaining; - - while (nr_to_alloc > 0) { - cur_proc = find_name(name, procnames, used_procnames, nr_procnames, - cur_proc); - if (cur_proc < 0) { - /* didn't find it */ - return nr_ranks_allocated - old_nr_allocated; - } - - /* need bounds checking on ranks */ -#ifdef CB_CONFIG_LIST_DEBUG - FPRINTF(stderr, " assigning name %s (%d) to rank %d in mapping\n", - procnames[cur_proc], cur_proc, nr_ranks_allocated); -#endif - - ranks[nr_ranks_allocated] = cur_proc; - nr_ranks_allocated++; - used_procnames[cur_proc] = 1; - - cur_proc++; - nr_to_alloc--; - } - - /* take all other instances of this host out of the list */ - while (cur_proc >= 0) { - cur_proc = find_name(name, procnames, used_procnames, nr_procnames, - cur_proc); - if (cur_proc >= 0) { -#ifdef CB_CONFIG_LIST_DEBUG - FPRINTF(stderr, " taking name %s (%d) out of procnames\n", - procnames[cur_proc], cur_proc); -#endif - used_procnames[cur_proc] = 1; - cur_proc++; - } - } - return nr_ranks_allocated - old_nr_allocated; -} - - -/* find_name() - finds the first entry in procnames[] which matches name, - * starting at index start_ind - * - * Returns an index [0..nr_procnames-1] on success, -1 if not found. - */ -static int find_name(char *name, - char *procnames[], - char used_procnames[], - int nr_procnames, - int start_ind) -{ - int i; - - for (i=start_ind; i < nr_procnames; i++) { - if (!used_procnames[i] && !strcmp(name, procnames[i])) break; - } - - if (i < nr_procnames) return i; - else return -1; -} - -/* get_max_procs() - grab the maximum number of processes to use out of - * the cb_config_list string - * - * Parameters: - * cb_nodes - cb_nodes value. this is returned when a "*" is encountered - * as the max_procs value. - * - * Returns # of processes, or -1 on error. - */ -static int get_max_procs(int cb_nodes) -{ - int token, max_procs = -1; - char *errptr; - - token = cb_config_list_lex(); - - switch(token) { - case AGG_EOS: - case AGG_COMMA: - return 1; - case AGG_COLON: - token = cb_config_list_lex(); - if (token != AGG_WILDCARD && token != AGG_STRING) return -1; - if (token == AGG_WILDCARD) max_procs = cb_nodes; - else if (token == AGG_STRING) { - max_procs = (int)strtol(yylval, &errptr, 10); - if (*errptr != '\0') { - /* some garbage value; default to 1 */ - max_procs = 1; - } - } - /* strip off next comma (if there is one) */ - token = cb_config_list_lex(); - if (token != AGG_COMMA && token != AGG_EOS) return -1; - - /* return max_procs */ - if (max_procs < 0) return -1; - else return max_procs; - } - return -1; -} - - -/* cb_config_list_lex() - lexical analyzer for cb_config_list language - * - * Returns a token of types defined at top of this file. - */ -#if defined(BGQPLATFORM) -/* On BlueGene, the ',' character shows up in get_processor_name, so we have to - * use a different delimiter */ -#define COLON ':' -#define COMMA ';' -#define DELIMS ":;" -#else -/* these tokens work for every other platform */ -#define COLON ':' -#define COMMA ',' -#define DELIMS ":," -#endif - -static int cb_config_list_lex(void) -{ - int slen; - - if (*token_ptr == '\0') return AGG_EOS; - - slen = (int)strcspn(token_ptr, DELIMS); - - if (*token_ptr == COLON) { - token_ptr++; - return AGG_COLON; - } - if (*token_ptr == COMMA) { - token_ptr++; - return AGG_COMMA; - } - - if (*token_ptr == '*') { - /* make sure that we don't have characters after the '*' */ - if (slen == 1) { - token_ptr++; - return AGG_WILDCARD; - } - else return AGG_ERROR; - } - - /* last case: some kind of string. for now we copy the string. */ - - /* it would be a good idea to look at the string and make sure that - * it doesn't have any illegal characters in it. in particular we - * should ensure that no one tries to use wildcards with strings - * (e.g. "ccn*"). - */ - ADIOI_Strncpy(yylval, token_ptr, slen); - yylval[slen] = '\0'; - token_ptr += slen; - return AGG_STRING; -} diff --git a/3rd-party/romio321/adio/common/eof_offset.c b/3rd-party/romio321/adio/common/eof_offset.c deleted file mode 100644 index ea3c51f6eab..00000000000 --- a/3rd-party/romio321/adio/common/eof_offset.c +++ /dev/null @@ -1,78 +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" - -/* return the current end of file in etype units relative to the - current view */ - -void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset) -{ - MPI_Count filetype_size; - int error_code, filetype_is_contig; - ADIO_Offset fsize, disp, sum=0, size_in_file, n_filetypes, rem, etype_size; - int flag, i; - ADIO_Fcntl_t *fcntl_struct; - MPI_Aint filetype_extent, lb; - ADIOI_Flatlist_node *flat_file; - - /* find the eof in bytes */ - fcntl_struct = (ADIO_Fcntl_t *) ADIOI_Malloc(sizeof(ADIO_Fcntl_t)); - ADIO_Fcntl(fd, ADIO_FCNTL_GET_FSIZE, fcntl_struct, &error_code); - fsize = fcntl_struct->fsize; - ADIOI_Free(fcntl_struct); - - /* Find the offset in etype units corresponding to eof. - The eof could lie in a hole in the current view, or in the - middle of an etype. In that case the offset will be the offset - corresponding to the start of the next etype in the current view.*/ - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - etype_size = fd->etype_size; - - if (filetype_is_contig) - *eof_offset = (fsize - fd->disp + etype_size - 1)/etype_size; - /* ceiling division in case fsize is not a multiple of etype_size;*/ - else { - /* filetype already flattened in ADIO_Open */ - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) - flat_file = flat_file->next; - - MPI_Type_size_x(fd->filetype, &filetype_size); - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - - disp = fd->disp; - n_filetypes = -1; - flag = 0; - while (!flag) { - sum = 0; - n_filetypes++; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - if (disp + flat_file->indices[i] + - n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + - flat_file->blocklens[i] >= fsize) { - if (disp + flat_file->indices[i] + - n_filetypes * ADIOI_AINT_CAST_TO_OFFSET filetype_extent >= fsize) - sum -= flat_file->blocklens[i]; - else { - rem = (disp + flat_file->indices[i] + - n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent - + flat_file->blocklens[i] - fsize); - sum -= rem; - } - flag = 1; - break; - } - } - } - size_in_file = n_filetypes*(ADIO_Offset)filetype_size + sum; - *eof_offset = (size_in_file+etype_size-1)/etype_size; /* ceiling division */ - } -} diff --git a/3rd-party/romio321/adio/common/error.c b/3rd-party/romio321/adio/common/error.c deleted file mode 100644 index 20e211d9fc1..00000000000 --- a/3rd-party/romio321/adio/common/error.c +++ /dev/null @@ -1,127 +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" - -/* NOTE: THIS FUNCTION IS DEPRECATED AND ONLY EXISTS HERE BECAUSE - * SOME DEPRECATED ADIO IMPLEMENTATIONS STILL CALL IT (SFS, HFS, PIOFS). - */ -int ADIOI_Error(ADIO_File fd, int error_code, char *string) -{ - char buf[MPI_MAX_ERROR_STRING]; - int myrank, result_len; - MPI_Errhandler err_handler; - - if (fd == ADIO_FILE_NULL) err_handler = ADIOI_DFLT_ERR_HANDLER; - else err_handler = fd->err_handler; - - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - if (err_handler == MPI_ERRORS_ARE_FATAL) { - MPI_Error_string(error_code, buf, &result_len); - FPRINTF(stderr, "[%d] - %s : %s\n", myrank, string, buf); - MPI_Abort(MPI_COMM_WORLD, 1); - } - else if (err_handler != MPI_ERRORS_RETURN) { - /* MPI_File_call_errorhandler(fd, error_code); */ - - FPRINTF(stderr, "Only MPI_ERRORS_RETURN and MPI_ERRORS_ARE_FATAL are currently supported as error handlers for files\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - return error_code; -} -/* Check for special error codes for those MPI error - classes that relate to particular problems. - Returns an MPI error code corresponding to "my_errno", for function "myname" - * and the given file, "filename". */ -int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno) -{ - int error_code = MPI_SUCCESS; - if(!my_errno) return MPI_SUCCESS; - - /* --BEGIN ERROR HANDLING-- */ - switch(my_errno) { - case EACCES: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_ACCESS, - "**fileaccess", - "**fileaccess %s", - filename ); - break; - case ENAMETOOLONG: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_BAD_FILE, - "**filenamelong", - "**filenamelong %s %d", - filename, - strlen(filename)); - break; - case ENOENT: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_NO_SUCH_FILE, - "**filenoexist", - "**filenoexist %s", - filename); - break; - case EISDIR: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_BAD_FILE, - "**filenamedir", - "**filenamedir %s", - filename); - break; - case EROFS: - /* Read only file or file system and write access requested */ - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_READ_ONLY, - "**ioneedrd", 0 ); - break; - case EEXIST: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_FILE_EXISTS, - "**fileexist", 0); - break; - case ENOTDIR: - case ELOOP: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_BAD_FILE, - "**filenamedir", - "**filenamedir %s", - filename); - break; - case ENOSPC: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_NO_SPACE, - "**filenospace", 0); - break; - case EDQUOT: - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_QUOTA, - "**filequota", 0); - break; - default: - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, "**io", - "**io %s", strerror(my_errno)); - break; - } - /* --END ERROR HANDLING-- */ - - return error_code; -} diff --git a/3rd-party/romio321/adio/common/flatten.c b/3rd-party/romio321/adio/common/flatten.c deleted file mode 100644 index b468ec2f0f4..00000000000 --- a/3rd-party/romio321/adio/common/flatten.c +++ /dev/null @@ -1,1293 +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" -/* #ifdef MPISGI -#include "mpisgi2.h" -#endif */ - -#ifdef USE_DBG_LOGGING - #define FLATTEN_DEBUG 1 -#endif - -struct adio_short_int { - short elem_s; - int elem_i; -}; - -struct adio_double_int { - double elem_d; - int elem_i; -}; - -struct adio_long_int { - long elem_l; - int elem_i; -}; - -struct adio_long_double_int { - long double elem_ld; - int elem_i; -}; - -int ADIOI_Type_get_envelope (MPI_Datatype datatype, int *num_integers, - int *num_addresses, int *num_datatypes, int *combiner) -{ - int rc, is_contig; - - ADIOI_Datatype_iscontig(datatype, &is_contig); - - rc = MPI_Type_get_envelope (datatype, num_integers, num_addresses, num_datatypes, combiner); - if (MPI_SUCCESS != rc || MPI_COMBINER_NAMED != *combiner || is_contig) { - return rc; - } - - if (MPI_SHORT_INT == datatype || MPI_DOUBLE_INT == datatype || MPI_LONG_DOUBLE_INT == datatype || - MPI_LONG_INT == datatype) { - *num_integers = 2; - *num_addresses = 2; - *num_datatypes = 2; - *combiner = MPI_COMBINER_STRUCT; - } - - return rc; -} - -int ADIOI_Type_get_contents (MPI_Datatype datatype, int max_integers, - int max_addresses, int max_datatypes, int array_of_integers[], - MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]) -{ - int dontcare, combiner; - int rc; - - rc = MPI_Type_get_envelope (datatype, &dontcare, &dontcare, &dontcare, &combiner); - if (MPI_SUCCESS != rc) { - return rc; - } - - if (MPI_COMBINER_NAMED != combiner) { - return MPI_Type_get_contents (datatype, max_integers, max_addresses, max_datatypes, - array_of_integers, array_of_addresses, array_of_datatypes); - } - - array_of_integers[0] = 1; - array_of_integers[1] = 1; - array_of_addresses[0] = 0; - array_of_datatypes[1] = MPI_INT; - - if (MPI_SHORT_INT == datatype) { - array_of_datatypes[0] = MPI_SHORT; - array_of_addresses[1] = offsetof (struct adio_short_int, elem_i); - } else if (MPI_DOUBLE_INT == datatype) { - array_of_datatypes[0] = MPI_DOUBLE; - array_of_addresses[1] = offsetof (struct adio_double_int, elem_i); - } else if (MPI_LONG_DOUBLE_INT == datatype) { - array_of_datatypes[0] = MPI_LONG_DOUBLE; - array_of_addresses[1] = offsetof (struct adio_long_double_int, elem_i); - } else if (MPI_LONG_INT == datatype) { - array_of_datatypes[0] = MPI_LONG; - array_of_addresses[1] = offsetof (struct adio_long_int, elem_i); - } else { - rc = MPI_ERR_TYPE; - } - - return rc; -} - -void ADIOI_Optimize_flattened(ADIOI_Flatlist_node *flat_type); -/* flatten datatype and add it to Flatlist */ -void ADIOI_Flatten_datatype(MPI_Datatype datatype) -{ -#ifdef HAVE_MPIR_TYPE_FLATTEN - MPI_Aint flatten_idx; -#endif - MPI_Count curr_index=0; - int is_contig; - ADIOI_Flatlist_node *flat, *prev=0; - - /* check if necessary to flatten. */ - - /* is it entirely contiguous? */ - ADIOI_Datatype_iscontig(datatype, &is_contig); - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: is_contig %#X\n",is_contig); - #endif - if (is_contig) return; - - /* has it already been flattened? */ - flat = ADIOI_Flatlist; - while (flat) { - if (flat->type == datatype) { - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: found datatype %#X\n", datatype); - #endif - return; - } - else { - prev = flat; - flat = flat->next; - } - } - - /* flatten and add to the list */ - flat = prev; - flat->next = (ADIOI_Flatlist_node *)ADIOI_Malloc(sizeof(ADIOI_Flatlist_node)); - flat = flat->next; - - flat->type = datatype; - flat->next = NULL; - flat->blocklens = NULL; - flat->indices = NULL; - flat->lb_idx = flat->ub_idx = -1; - - flat->count = ADIOI_Count_contiguous_blocks(datatype, &curr_index); -#ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %llX, cur_idx = %#llX\n",flat->count,curr_index); -#endif -/* DBG_FPRINTF(stderr, "%d\n", flat->count);*/ - - if (flat->count) { - flat->blocklens = (ADIO_Offset *) ADIOI_Malloc(flat->count * sizeof(ADIO_Offset)); - flat->indices = (ADIO_Offset *) ADIOI_Malloc(flat->count * sizeof(ADIO_Offset)); - } - - curr_index = 0; -#ifdef HAVE_MPIR_TYPE_FLATTEN - flatten_idx = (MPI_Aint) flat->count; - MPIR_Type_flatten(datatype, flat->indices, flat->blocklens, &flatten_idx); - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: MPIR_Type_flatten\n"); - #endif -#else - ADIOI_Flatten(datatype, flat, 0, &curr_index); - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: ADIOI_Flatten\n"); - #endif - - ADIOI_Optimize_flattened(flat); -#endif -/* debug */ -#ifdef FLATTEN_DEBUG - { - int i; - for (i=0; icount; i++) - DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: i %#X, blocklens %#llX, indices %#llX\n", - i, - flat->blocklens[i], - flat->indices[i] - ); - } -#endif -} - -/* ADIOI_Flatten() - * - * Assumption: input datatype is not a basic!!!! - */ -void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat, - ADIO_Offset st_offset, MPI_Count *curr_index) -{ - int k, m, n, is_hindexed_block=0; - int lb_updated=0; - int combiner, old_combiner, old_is_contig; - int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes; - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset top_count; - MPI_Count i, j, old_size, prev_index, basic_num, num, nonzeroth; - MPI_Aint old_extent, lb;/* Assume extents are non-negative */ - int *ints; - MPI_Aint *adds; /* Make no assumptions about +/- sign on these */ - MPI_Datatype *types; - ADIOI_Type_get_envelope(datatype, &nints, &nadds, &ntypes, &combiner); - if (combiner == MPI_COMBINER_NAMED) { - return; /* can't do anything else: calling get_contents on a builtin - type is an error */ - } - ints = (int *) ADIOI_Malloc((nints+1)*sizeof(int)); - adds = (MPI_Aint *) ADIOI_Malloc((nadds+1)*sizeof(MPI_Aint)); - types = (MPI_Datatype *) ADIOI_Malloc((ntypes+1)*sizeof(MPI_Datatype)); - ADIOI_Type_get_contents(datatype, nints, nadds, ntypes, ints, adds, types); - - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index); - DBG_FPRINTF(stderr,"ADIOI_Flatten:: nints %#X, nadds %#X, ntypes %#X\n",nints, nadds, ntypes); - for(i=0; i< nints; ++i) - { - DBG_FPRINTF(stderr,"ADIOI_Flatten:: ints[%lld]=%#X\n",i,ints[i]); - } - for(i=0; i< nadds; ++i) - { - DBG_FPRINTF(stderr,"ADIOI_Flatten:: adds[%lld]="MPI_AINT_FMT_HEX_SPEC"\n",i,adds[i]); - } - for(i=0; i< ntypes; ++i) - { - DBG_FPRINTF(stderr,"ADIOI_Flatten:: types[%lld]=%#llX\n",i,(unsigned long long)(unsigned long)types[i]); - } - #endif - /* Chapter 4, page 83: when processing datatypes, note this item from the - * standard: - Most datatype constructors have replication count or block length - arguments. Allowed values are non-negative integers. If the value is - zero, no elements are generated in the type map and there is no effect - on datatype bounds or extent. */ - - switch (combiner) { -#ifdef MPIIMPL_HAVE_MPI_COMBINER_DUP - case MPI_COMBINER_DUP: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DUP\n"); - #endif - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - ADIOI_Flatten(types[0], flat, st_offset, curr_index); - break; -#endif -#ifdef MPIIMPL_HAVE_MPI_COMBINER_SUBARRAY - case MPI_COMBINER_SUBARRAY: - { - int dims = ints[0]; - MPI_Datatype stype; - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_SUBARRAY\n"); - #endif - - ADIO_Type_create_subarray(dims, - &ints[1], /* sizes */ - &ints[dims+1], /* subsizes */ - &ints[2*dims+1], /* starts */ - ints[3*dims+1], /* order */ - types[0], /* type */ - &stype); - ADIOI_Flatten(stype, flat, st_offset, curr_index); - MPI_Type_free(&stype); - } - break; -#endif -#ifdef MPIIMPL_HAVE_MPI_COMBINER_DARRAY - case MPI_COMBINER_DARRAY: - { - int dims = ints[2]; - MPI_Datatype dtype; - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY\n"); - #endif - - ADIO_Type_create_darray(ints[0], /* size */ - ints[1], /* rank */ - dims, - &ints[3], /* gsizes */ - &ints[dims+3], /* distribs */ - &ints[2*dims+3], /* dargs */ - &ints[3*dims+3], /* psizes */ - ints[4*dims+3], /* order */ - types[0], - &dtype); - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n", - 0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index); - #endif - ADIOI_Flatten(dtype, flat, st_offset, curr_index); - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY >ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n", - 0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index); - #endif - MPI_Type_free(&dtype); - } - break; -#endif - case MPI_COMBINER_CONTIGUOUS: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_CONTIGUOUS\n"); - #endif - top_count = ints[0]; - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - - prev_index = *curr_index; - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - ADIOI_Flatten(types[0], flat, st_offset, curr_index); - - if (prev_index == *curr_index) { -/* simplest case, made up of basic or contiguous types */ - j = *curr_index; - flat->indices[j] = st_offset; - MPI_Type_size_x(types[0], &old_size); - flat->blocklens[j] = top_count * old_size; - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]); - #endif - (*curr_index)++; - } - else { -/* made up of noncontiguous derived types */ - j = *curr_index; - num = *curr_index - prev_index; - -/* The noncontiguous types have to be replicated count times */ - MPI_Type_get_extent(types[0], &lb, &old_extent); - for (m=1; mindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[j] = flat->blocklens[j-num]; - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: derived flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]); - #endif - j++; - } - } - *curr_index = j; - } - break; - - case MPI_COMBINER_VECTOR: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_VECTOR\n"); - #endif - top_count = ints[0]; - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - - prev_index = *curr_index; - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - ADIOI_Flatten(types[0], flat, st_offset, curr_index); - - if (prev_index == *curr_index) { -/* simplest case, vector of basic or contiguous types */ - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1], stride = ints[2]; - j = *curr_index; - flat->indices[j] = st_offset; - MPI_Type_size_x(types[0], &old_size); - flat->blocklens[j] = blocklength * old_size; - for (i=j+1; iindices[i] = flat->indices[i-1] + stride * old_size; - flat->blocklens[i] = flat->blocklens[j]; - } - *curr_index = i; - } - else { -/* vector of noncontiguous derived types */ - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1], stride = ints[2]; - - j = *curr_index; - num = *curr_index - prev_index; - -/* The noncontiguous types have to be replicated blocklen times - and then strided. Replicate the first one. */ - MPI_Type_get_extent(types[0], &lb, &old_extent); - for (m=1; mindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[j] = flat->blocklens[j-num]; - j++; - } - } - *curr_index = j; - -/* Now repeat with strides. */ - num = *curr_index - prev_index; - for (i=1; iindices[j] = flat->indices[j-num] + stride * ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[j] = flat->blocklens[j-num]; - j++; - } - } - *curr_index = j; - } - break; - - case MPI_COMBINER_HVECTOR: - case MPI_COMBINER_HVECTOR_INTEGER: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_HVECTOR_INTEGER\n"); - #endif - top_count = ints[0]; - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - - prev_index = *curr_index; - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - ADIOI_Flatten(types[0], flat, st_offset, curr_index); - - if (prev_index == *curr_index) { -/* simplest case, vector of basic or contiguous types */ - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1]; - j = *curr_index; - flat->indices[j] = st_offset; - MPI_Type_size_x(types[0], &old_size); - flat->blocklens[j] = blocklength * old_size; - for (i=j+1; iindices[i] = flat->indices[i-1] + adds[0]; - flat->blocklens[i] = flat->blocklens[j]; - } - *curr_index = i; - } - else { -/* vector of noncontiguous derived types */ - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1]; - - j = *curr_index; - num = *curr_index - prev_index; - -/* The noncontiguous types have to be replicated blocklen times - and then strided. Replicate the first one. */ - MPI_Type_get_extent(types[0], &lb, &old_extent); - for (m=1; mindices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[j] = flat->blocklens[j-num]; - j++; - } - } - *curr_index = j; - -/* Now repeat with strides. */ - num = *curr_index - prev_index; - for (i=1; iindices[j] = flat->indices[j-num] + adds[0]; - flat->blocklens[j] = flat->blocklens[j-num]; - j++; - } - } - *curr_index = j; - } - break; - - case MPI_COMBINER_INDEXED: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_INDEXED\n"); - #endif - top_count = ints[0]; - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - MPI_Type_get_extent(types[0], &lb, &old_extent); - - prev_index = *curr_index; - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - { - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset stride = ints[top_count+1]; - ADIOI_Flatten(types[0], flat, - st_offset+stride* ADIOI_AINT_CAST_TO_OFFSET old_extent, curr_index); - } - - if (prev_index == *curr_index) { -/* simplest case, indexed type made up of basic or contiguous types */ - j = *curr_index; - for (i=j, nonzeroth=i; i2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1+i-j], stride = ints[top_count+1+i-j]; - if (blocklength > 0) { - flat->indices[nonzeroth] = - st_offset + stride* ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[nonzeroth] = - blocklength* ADIOI_AINT_CAST_TO_OFFSET old_extent; - nonzeroth++; - } else { - flat->count--; /* don't count/consider any zero-length blocklens */ - } - } - *curr_index = i; - } - else { -/* indexed type made up of noncontiguous derived types */ - - j = *curr_index; - num = *curr_index - prev_index; - basic_num = num; - -/* The noncontiguous types have to be replicated blocklens[i] times - and then strided. Replicate the first one. */ - for (m=1; mblocklens[j-num] > 0) { - flat->indices[nonzeroth] = - flat->indices[nonzeroth-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[nonzeroth] = - flat->blocklens[nonzeroth-num]; - j++; - nonzeroth++; - } else { - flat->count --; - } - } - } - *curr_index = j; - -/* Now repeat with strides. */ - for (i=1; i2G integer arithmetic problems */ - ADIO_Offset stride = ints[top_count+1+i]-ints[top_count+i]; - if (flat->blocklens[j-num] > 0 ) { - flat->indices[nonzeroth] = - flat->indices[j-num] + stride* ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[nonzeroth] = flat->blocklens[j-num]; - j++; - nonzeroth++; - } else { - flat->count--; - } - } - *curr_index = j; - for (m=1; mblocklens[j-basic_num] > 0) { - flat->indices[nonzeroth] = - flat->indices[j-basic_num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[nonzeroth] = flat->blocklens[j-basic_num]; - j++; - nonzeroth++; - } else { - flat->count --; - } - } - } - *curr_index = j; - } - } - break; - -#if defined HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK && HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK - case MPI_COMBINER_HINDEXED_BLOCK: - is_hindexed_block=1; - /* deliberate fall-through */ -#endif - case MPI_COMBINER_INDEXED_BLOCK: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_INDEXED_BLOCK\n"); - #endif - top_count = ints[0]; - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - MPI_Type_get_extent(types[0], &lb, &old_extent); - - prev_index = *curr_index; - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - { - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset stride = ints[1+1]; - if (is_hindexed_block) { - ADIOI_Flatten(types[0], flat, - st_offset+adds[0], curr_index); - } else { - ADIOI_Flatten(types[0], flat, - st_offset+stride* ADIOI_AINT_CAST_TO_OFFSET old_extent, curr_index); - } - } - - if (prev_index == *curr_index) { -/* simplest case, indexed type made up of basic or contiguous types */ - j = *curr_index; - for (i=j; i2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1]; - if (is_hindexed_block) { - flat->indices[i] = st_offset + adds[i-j]; - } else { - ADIO_Offset stride = ints[1+1+i-j]; - flat->indices[i] = st_offset + - stride* ADIOI_AINT_CAST_TO_OFFSET old_extent; - } - flat->blocklens[i] = blocklength* ADIOI_AINT_CAST_TO_OFFSET old_extent; - } - *curr_index = i; - } - else { -/* vector of noncontiguous derived types */ - - j = *curr_index; - num = *curr_index - prev_index; - -/* The noncontiguous types have to be replicated blocklens[i] times - and then strided. Replicate the first one. */ - for (m=1; mindices[j] = flat->indices[j-num] + - ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[j] = flat->blocklens[j-num]; - j++; - } - } - *curr_index = j; - -/* Now repeat with strides. */ - num = *curr_index - prev_index; - for (i=1; iindices[j] = flat->indices[j-num] + - adds[i] - adds[i-1]; - } else { - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset stride = ints[2+i]-ints[1+i]; - flat->indices[j] = flat->indices[j-num] + - stride* ADIOI_AINT_CAST_TO_OFFSET old_extent; - } - flat->blocklens[j] = flat->blocklens[j-num]; - j++; - } - } - *curr_index = j; - } - break; - - case MPI_COMBINER_HINDEXED: - case MPI_COMBINER_HINDEXED_INTEGER: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_HINDEXED_INTEGER\n"); - #endif - top_count = ints[0]; - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - - prev_index = *curr_index; - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) - { - ADIOI_Flatten(types[0], flat, st_offset+adds[0], curr_index); - } - - if (prev_index == *curr_index) { -/* simplest case, indexed type made up of basic or contiguous types */ - j = *curr_index; - MPI_Type_size_x(types[0], &old_size); - for (i=j, nonzeroth=j; i 0) { - /* By using ADIO_Offset we preserve +/- sign and - avoid >2G integer arithmetic problems */ - ADIO_Offset blocklength = ints[1+i-j]; - flat->indices[nonzeroth] = st_offset + adds[i-j]; - flat->blocklens[nonzeroth] = blocklength*old_size; - nonzeroth++; - } else { - flat->count--; - } - } - *curr_index = i; - } - else { -/* indexed type made up of noncontiguous derived types */ - - j = *curr_index; - num = *curr_index - prev_index; - basic_num = num; - -/* The noncontiguous types have to be replicated blocklens[i] times - and then strided. Replicate the first one. */ - MPI_Type_get_extent(types[0], &lb, &old_extent); - for (m=1; mblocklens[j-num] > 0) { - flat->indices[nonzeroth] = - flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[nonzeroth] = flat->blocklens[j-num]; - j++; - nonzeroth++; - } else { - flat->count--; - } - } - } - *curr_index = j; - -/* Now repeat with strides. */ - for (i=1; iblocklens[j-num] > 0) { - flat->indices[nonzeroth] = - flat->indices[j-num] + adds[i] - adds[i-1]; - flat->blocklens[nonzeroth] = flat->blocklens[j-num]; - j++; - nonzeroth++; - } else { - flat->count--; - } - } - *curr_index = j; - for (m=1; mblocklens[j-basic_num] >0) { - flat->indices[nonzeroth] = - flat->indices[j-basic_num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[nonzeroth] = flat->blocklens[j-basic_num]; - j++; - nonzeroth++; - } - } - } - *curr_index = j; - } - } - break; - - case MPI_COMBINER_STRUCT: - case MPI_COMBINER_STRUCT_INTEGER: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_STRUCT_INTEGER\n"); - #endif - top_count = ints[0]; - for (n=0; n2G integer arithmetic problems */ - if (ints[1+n] > 0) { - ADIO_Offset blocklength = ints[1+n]; - j = *curr_index; - flat->indices[j] = st_offset + adds[n]; - MPI_Type_size_x(types[n], &old_size); - flat->blocklens[j] = blocklength * old_size; -#ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]); -#endif - (*curr_index)++; - } - } - else { -/* current type made up of noncontiguous derived types */ - - j = *curr_index; - num = *curr_index - prev_index; - -/* The current type has to be replicated blocklens[n] times */ - MPI_Type_get_extent(types[n], &lb, &old_extent); - for (m=1; mindices[j] = - flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent; - flat->blocklens[j] = flat->blocklens[j-num]; -#ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple old_extent "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",old_extent,j, flat->indices[j], j, flat->blocklens[j]); -#endif - j++; - } - } - *curr_index = j; - } - } - break; - - case MPI_COMBINER_RESIZED: - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_RESIZED\n"); - #endif - - /* This is done similar to a type_struct with an lb, datatype, ub */ - - /* handle the Lb */ - j = *curr_index; - /* when we process resized types, we (recursively) process the lower - * bound, the type being resized, then the upper bound. In the - * resized-of-resized case, we might find ourselves updating the upper - * bound based on the inner type, but the lower bound based on the - * upper type. check both lb and ub to prevent mixing updates */ - if (flat->lb_idx == -1 && flat->ub_idx == -1) { - flat->indices[j] = st_offset + adds[0]; - /* this zero-length blocklens[] element, unlike eleswhere in the - * flattening code, is correct and is used to indicate a lower bound - * marker */ - flat->blocklens[j] = 0; - flat->lb_idx = *curr_index; - lb_updated=1; - - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]); - #endif - - (*curr_index)++; - } else { - /* skipped over this chunk because something else higher-up in the - * type construction set this for us already */ - flat->count--; - st_offset -= adds[0]; - } - - /* handle the datatype */ - - ADIOI_Type_get_envelope(types[0], &old_nints, &old_nadds, - &old_ntypes, &old_combiner); - ADIOI_Datatype_iscontig(types[0], &old_is_contig); - - if ((old_combiner != MPI_COMBINER_NAMED) && (!old_is_contig)) { - ADIOI_Flatten(types[0], flat, st_offset+adds[0], curr_index); - } - else { - /* current type is basic or contiguous */ - j = *curr_index; - flat->indices[j] = st_offset; - MPI_Type_size_x(types[0], &old_size); - flat->blocklens[j] = old_size; - - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]); - #endif - - (*curr_index)++; - } - - /* take care of the extent as a UB */ - /* see note above about mixing updates for why we check lb and ub */ - if ((flat->lb_idx == -1 && flat->ub_idx == -1) || lb_updated) { - j = *curr_index; - flat->indices[j] = st_offset + adds[0] + adds[1]; - /* again, zero-element ok: an upper-bound marker explicitly set by the - * constructor of this resized type */ - flat->blocklens[j] = 0; - flat->ub_idx = *curr_index; - } else { - /* skipped over this chunk because something else higher-up in the - * type construction set this for us already */ - flat->count--; - (*curr_index)--; - } - - #ifdef FLATTEN_DEBUG - DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]); - #endif - - (*curr_index)++; - - break; - - default: - /* TODO: FIXME (requires changing prototypes to return errors...) */ - DBG_FPRINTF(stderr, "Error: Unsupported datatype passed to ADIOI_Flatten\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - -#ifndef MPISGI -/* There is a bug in SGI's impl. of MPI_Type_get_contents. It doesn't - return new datatypes. Therefore no need to free. */ - for (i=0; icount - 1); i++) { - if ((flat_type->indices[i] + flat_type->blocklens[i] != - flat_type->indices[i + 1])) - opt_blocks++; - } - - /* if we can't reduce the number of blocks, quit now */ - if (opt_blocks == flat_type->count) return; - - opt_blocklens = (ADIO_Offset *) ADIOI_Malloc(opt_blocks * sizeof(ADIO_Offset)); - opt_indices = (ADIO_Offset *)ADIOI_Malloc(opt_blocks*sizeof(ADIO_Offset)); - - /* fill in new blocklists */ - opt_blocklens[0] = flat_type->blocklens[0]; - opt_indices[0] = flat_type->indices[0]; - j = 0; - for (i=0; i < (flat_type->count - 1); i++) { - if ((flat_type->indices[i] + flat_type->blocklens[i] == - flat_type->indices[i + 1])) - opt_blocklens[j] += flat_type->blocklens[i + 1]; - else { - j++; - opt_indices[j] = flat_type->indices[i + 1]; - opt_blocklens[j] = flat_type->blocklens[i + 1]; - } - } - flat_type->count = opt_blocks; - ADIOI_Free(flat_type->blocklens); - ADIOI_Free(flat_type->indices); - flat_type->blocklens = opt_blocklens; - flat_type->indices = opt_indices; - return; -} - -void ADIOI_Delete_flattened(MPI_Datatype datatype) -{ - ADIOI_Flatlist_node *flat, *prev; - - prev = flat = ADIOI_Flatlist; - while (flat && (flat->type != datatype)) { - prev = flat; - flat = flat->next; - } - if (flat) { - prev->next = flat->next; - if (flat->blocklens) ADIOI_Free(flat->blocklens); - if (flat->indices) ADIOI_Free(flat->indices); - ADIOI_Free(flat); - } -} - -ADIOI_Flatlist_node * ADIOI_Flatten_and_find(MPI_Datatype datatype) -{ - ADIOI_Flatlist_node *node; - ADIOI_Flatten_datatype(datatype); - node = ADIOI_Flatlist; - while (node->type != datatype) node = node->next; - return node; -} diff --git a/3rd-party/romio321/adio/common/get_fp_posn.c b/3rd-party/romio321/adio/common/get_fp_posn.c deleted file mode 100644 index f2e025d00f8..00000000000 --- a/3rd-party/romio321/adio/common/get_fp_posn.c +++ /dev/null @@ -1,60 +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 "adioi.h" - -/* returns the current position of the individual file pointer - in etype units relative to the current view. */ - -void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset) -{ - ADIOI_Flatlist_node *flat_file; - int i, flag; - MPI_Count filetype_size, etype_size; - int filetype_is_contig; - MPI_Aint filetype_extent, lb; - ADIO_Offset disp, byte_offset, sum=0, size_in_file, n_filetypes, frd_size; - - ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig); - etype_size = fd->etype_size; - - if (filetype_is_contig) *offset = (fd->fp_ind - fd->disp)/etype_size; - else { -/* filetype already flattened in ADIO_Open */ - flat_file = ADIOI_Flatlist; - while (flat_file->type != fd->filetype) flat_file = flat_file->next; - - MPI_Type_size_x(fd->filetype, &filetype_size); - MPI_Type_get_extent(fd->filetype, &lb, &filetype_extent); - - disp = fd->disp; - byte_offset = fd->fp_ind; - n_filetypes = -1; - flag = 0; - while (!flag) { - sum = 0; - n_filetypes++; - for (i=0; icount; i++) { - sum += flat_file->blocklens[i]; - if (disp + flat_file->indices[i] + - n_filetypes* ADIOI_AINT_CAST_TO_OFFSET filetype_extent + flat_file->blocklens[i] - >= byte_offset) { - frd_size = disp + flat_file->indices[i] + - n_filetypes * ADIOI_AINT_CAST_TO_OFFSET filetype_extent - + flat_file->blocklens[i] - byte_offset; - sum -= frd_size; - flag = 1; - break; - } - } - } - size_in_file = n_filetypes * (ADIO_Offset)filetype_size + sum; - *offset = size_in_file/etype_size; - } -} diff --git a/3rd-party/romio321/adio/common/greq_fns.c b/3rd-party/romio321/adio/common/greq_fns.c deleted file mode 100644 index aff8ff77e5d..00000000000 --- a/3rd-party/romio321/adio/common/greq_fns.c +++ /dev/null @@ -1,31 +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 "adio.h" -#include "mpiu_greq.h" - -/* In cases where nonblocking operation will carry out blocking version, - * instantiate and complete a generalized request */ - -void MPIO_Completed_request_create(MPI_File *fh, MPI_Offset bytes, - int *error_code, MPI_Request *request) -{ - MPI_Status *status; - status = (MPI_Status *)ADIOI_Malloc(sizeof(MPI_Status)); - - status->MPI_ERROR = *error_code; -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, MPI_BYTE, bytes); -#endif - /* --BEGIN ERROR HANDLING-- */ - if (*error_code != MPI_SUCCESS) - *error_code = MPIO_Err_return_file(*fh, *error_code); - /* --END ERROR HANDLING-- */ - MPI_Grequest_start(MPIU_Greq_query_fn, MPIU_Greq_free_fn, - MPIU_Greq_cancel_fn, status, request); - MPI_Grequest_complete(*request); -} diff --git a/3rd-party/romio321/adio/common/heap-sort.c b/3rd-party/romio321/adio/common/heap-sort.c deleted file mode 100644 index c398e41aeea..00000000000 --- a/3rd-party/romio321/adio/common/heap-sort.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "heap-sort.h" -#include -#include -#include -#include - -#define NOEXP2 - -static void heapify(heap_t *heap, int i); - -/* From Introduction To Algorithms by Cormen, Leiserson, and Rivest */ - -static inline int parent(int i) { - return (i/2); -} - -static inline int left(int i) { - return (2*i); -} - -static inline int right(int i) { - return (2*i + 1); -} - -int ADIOI_Heap_create(heap_t *heap, int size) { - heap->size = size; - heap->nodes = (heap_node_t *) ADIOI_Calloc (size, sizeof(heap_node_t)); - if (heap->nodes == NULL) - return 1; - else - return 0; -} - -void ADIOI_Heap_free(heap_t *heap) { - ADIOI_Free(heap->nodes); -} - -/* should suppress unused warnings on GCC */ -static void build_heap(heap_t *heap) ATTRIBUTE((unused, used)); - -static void build_heap(heap_t *heap) -{ - int i; - for (i=(heap->size/2-1); i >= 0; i--) - heapify(heap, i); -} - -static void heapify(heap_t *heap, int i) { - int l, r, smallest; - heap_node_t *nodes; - heap_node_t tmp_node; - - nodes = heap->nodes; - - l = left(i); - r = right(i); - - if ((l <= heap->size) && (nodes[l].offset < nodes[i].offset)) - smallest = l; - else - smallest = i; - - if ((r <= heap->size) && (nodes[r].offset < nodes[smallest].offset)) - smallest = r; - - if (smallest != i) { - tmp_node = nodes[i]; - nodes[i] = nodes[smallest]; - nodes[smallest] = tmp_node; - heapify(heap, smallest); - } -} - -void ADIOI_Heap_insert(heap_t *heap, ADIO_Offset offset, int proc, - ADIO_Offset reg_max_len) { - heap_node_t *nodes; - int i; - nodes = heap->nodes; - i = ++heap->size - 1; - while ((i > 0) && (nodes[parent(i)].offset > offset)) { - nodes[i] = nodes[parent(i)]; - i = parent(i); - } - nodes[i].offset = offset; - nodes[i].proc = proc; - nodes[i].reg_max_len = reg_max_len; -} - -void ADIOI_Heap_extract_min(heap_t *heap, ADIO_Offset* offset, int *proc, - ADIO_Offset *reg_max_len) { - heap_node_t *nodes; - nodes = heap->nodes; - - assert (heap->size > 0); - *offset = nodes[0].offset; - *proc = nodes[0].proc; - *reg_max_len = nodes[0].reg_max_len; - nodes[0] = nodes[heap->size-1]; - heap->size--; - heapify(heap, 0); -} - -/* should suppress unused warnings on GCC */ -static void print_heap(heap_t *heap) ATTRIBUTE((unused, used)); - -static void print_heap(heap_t *heap) -{ -#ifndef NOEXP2 - int i; - double level = 0; - int next_level_idx = 1; - - printf ("heap->size = %d\n", heap->size); - printf ("offsets:\n"); - for (i=0; i < heap->size; i++) { - printf ("%lld ", heap->nodes[i].offset); - - if ((i+1) == next_level_idx) { - printf ("\n"); - next_level_idx += (int) exp2(level+1); - level++; - } - } - printf ("\n"); -#endif -} diff --git a/3rd-party/romio321/adio/common/hint_fns.c b/3rd-party/romio321/adio/common/hint_fns.c deleted file mode 100644 index 284e4a96272..00000000000 --- a/3rd-party/romio321/adio/common/hint_fns.c +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2013 UChicago/Argonne, LLC - * See COPYRIGHT notice in top-level directory. - */ - -#include "adio.h" -#include "hint_fns.h" - - -int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *key, - int *local_cache, char *funcname, int *error_code) -{ - int intval, tmp_val, flag, ret=0; - char *value; - - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - if (value == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - funcname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return -1; - } - - ADIOI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag); - if (flag) { - intval = atoi(value); - tmp_val = intval; - - MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - /* --BEGIN ERROR HANDLING-- */ - if (tmp_val != intval) { - MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname, - key, - error_code); - ret = -1; - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - ADIOI_Info_set(fd->info, key, value); - /* some file systems do not cache hints in the fd struct */ - if (local_cache != NULL) *local_cache = intval; - } -fn_exit: - ADIOI_Free(value); - return ret; -} - -int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char *key, - int *local_cache, char *funcname, int *error_code) -{ - int tmp_val, flag, ret=0; - char *value; - - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - if (value == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - funcname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return -1; - } - - ADIOI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag); - if (flag) { - if (!strcmp(value, "enable") || !strcmp(value, "ENABLE")) { - ADIOI_Info_set(fd->info, key, value); - *local_cache = ADIOI_HINT_ENABLE; - } - else if (!strcmp(value, "disable") || !strcmp(value, "DISABLE")) { - ADIOI_Info_set(fd->info, key, value); - *local_cache = ADIOI_HINT_DISABLE; - } - else if (!strcmp(value, "automatic") || !strcmp(value, "AUTOMATIC")) - { - ADIOI_Info_set(fd->info, key, value); - *local_cache = ADIOI_HINT_AUTO; - } - - tmp_val = *local_cache; - - MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - /* --BEGIN ERROR HANDLING-- */ - if (tmp_val != *local_cache) { - MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname, - key, - error_code); - ret = -1; - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - } -fn_exit: - ADIOI_Free(value); - return ret; -} -int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *key, - int *local_cache, char *funcname, int *error_code) -{ - int flag, tmp_val, ret=0; - char *value; - - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - if (value == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - funcname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return -1; - } - - ADIOI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag); - if (flag) { - if (!strcmp(value, "true") || !strcmp(value, "TRUE")) { - ADIOI_Info_set(fd->info, key, value); - *local_cache = 1; - } - else if (!strcmp(value, "false") || !strcmp(value, "FALSE")) { - ADIOI_Info_set(fd->info, key, value); - *local_cache = 0; - } - tmp_val = *local_cache; - - MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm); - /* --BEGIN ERROR HANDLING-- */ - if (tmp_val != *local_cache) { - MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname, - key, - error_code); - ret = -1; - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - } -fn_exit: - ADIOI_Free(value); - return ret; -} -int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key, - char **local_cache, char *funcname, int *error_code) -{ - int flag, ret=0; - size_t len; - char *value; - - value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char)); - if (value == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - funcname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - return -1; - } - - ADIOI_Info_get(info, key, MPI_MAX_INFO_VAL, - value, &flag); - if (flag) { - ADIOI_Info_set(fd->info, "cb_config_list", value); - len = (strlen(value)+1) * sizeof(char); - *local_cache = ADIOI_Malloc(len); - if (*local_cache == NULL) { - *error_code = MPIO_Err_create_code(*error_code, - MPIR_ERR_RECOVERABLE, - funcname, - __LINE__, - MPI_ERR_OTHER, - "**nomem2",0); - ret = -1; - goto fn_exit; - } - ADIOI_Strncpy(*local_cache, value, len); - } - /* if it has been set already, we ignore it the second time. - * otherwise we would get an error if someone used the same - * info value with a cb_config_list value in it in a couple - * of calls, which would be irritating. */ -fn_exit: - ADIOI_Free(value); - return ret; -} diff --git a/3rd-party/romio321/adio/common/iscontig.c b/3rd-party/romio321/adio/common/iscontig.c deleted file mode 100644 index 3c8aa712f4e..00000000000 --- a/3rd-party/romio321/adio/common/iscontig.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 "adio.h" -/* #ifdef MPISGI -#include "mpisgi2.h" -#endif */ - -#if defined(MPICH) -/* MPICH also provides this routine */ -void MPIR_Datatype_iscontig(MPI_Datatype datatype, int *flag); - -void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) -{ - MPIR_Datatype_iscontig(datatype, flag); - - /* if the datatype is reported as contigous, check if the true_lb is - * non-zero, and if so, mark the datatype as noncontiguous */ - if (*flag) { - MPI_Aint true_extent, true_lb; - - MPI_Type_get_true_extent(datatype, &true_lb, &true_extent); - - if (true_lb > 0) - *flag = 0; - } -} - -#elif (defined(MPIHP) && defined(HAVE_MPI_INFO)) -/* i.e. HPMPI 1.4 only */ - -int hpmp_dtiscontig(MPI_Datatype datatype); - -void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) -{ - *flag = hpmp_dtiscontig(datatype); -} - -#elif (defined(MPISGI) && !defined(NO_MPI_SGI_type_is_contig)) - -int MPI_SGI_type_is_contig(MPI_Datatype datatype); - -void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) -{ - MPI_Aint displacement; - MPI_Type_lb(datatype, &distplacement); - - /* SGI's MPI_SGI_type_is_contig() returns true for indexed - * datatypes with holes at the beginning, which causes - * problems with ROMIO's use of this function. - */ - *flag = MPI_SGI_type_is_contig(datatype) && (displacement == 0); -} - -#elif defined(OMPI_BUILDING) && OMPI_BUILDING - -/* void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) is defined - * and implemented in OpenMPI itself */ - -#else - -void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag) -{ - int nints, nadds, ntypes, combiner; - int *ints, ni, na, nt, cb; - MPI_Aint *adds; - MPI_Datatype *types; - - MPI_Type_get_envelope(datatype, &nints, &nadds, &ntypes, &combiner); - - switch (combiner) { - case MPI_COMBINER_NAMED: - *flag = 1; - break; - case MPI_COMBINER_CONTIGUOUS: - ints = (int *) ADIOI_Malloc((nints+1)*sizeof(int)); - adds = (MPI_Aint *) ADIOI_Malloc((nadds+1)*sizeof(MPI_Aint)); - types = (MPI_Datatype *) ADIOI_Malloc((ntypes+1)*sizeof(MPI_Datatype)); - MPI_Type_get_contents(datatype, nints, nadds, ntypes, ints, - adds, types); - ADIOI_Datatype_iscontig(types[0], flag); - -#ifndef MPISGI -/* There is a bug in SGI's impl. of MPI_Type_get_contents. It doesn't - return new datatypes. Therefore no need to free. */ - MPI_Type_get_envelope(types[0], &ni, &na, &nt, &cb); - if (cb != MPI_COMBINER_NAMED) MPI_Type_free(types); -#endif - - ADIOI_Free(ints); - ADIOI_Free(adds); - ADIOI_Free(types); - break; - default: - *flag = 0; - break; - } - - /* This function needs more work. It should check for contiguity - in other cases as well.*/ -} -#endif diff --git a/3rd-party/romio321/adio/common/lock.c b/3rd-party/romio321/adio/common/lock.c deleted file mode 100644 index 2590d77433a..00000000000 --- a/3rd-party/romio321/adio/common/lock.c +++ /dev/null @@ -1,225 +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" - -#ifdef ROMIO_NTFS -/* This assumes that lock will always remain in the common directory and - * that the ntfs directory will always be called ad_ntfs. */ -#include "..\ad_ntfs\ad_ntfs.h" -int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, - ADIO_Offset len) -{ - static char myname[] = "ADIOI_Set_lock"; - int ret_val, error_code = MPI_SUCCESS; - OVERLAPPED Overlapped; - DWORD dwFlags; - - ADIOI_UNREFERENCED_ARG(whence); - - if (len == 0) return MPI_SUCCESS; - - dwFlags = type; - - Overlapped.hEvent = /*0;*/CreateEvent(NULL, TRUE, FALSE, NULL); -#ifdef HAVE_INT64 - Overlapped.Offset = ( (DWORD) ( offset & (__int64) 0xFFFFFFFF ) ); - Overlapped.OffsetHigh = ( (DWORD) ( (offset >> 32) & (__int64) 0xFFFFFFFF ) ); - - if (cmd == ADIOI_LOCK_CMD) - { - /*printf("locking %d\n", (int)fd);fflush(stdout);*/ - ret_val = LockFileEx(fd, dwFlags, 0, - ( (DWORD) ( len & (__int64) 0xFFFFFFFF ) ), - ( (DWORD) ( (len >> 32) & (__int64) 0xFFFFFFFF ) ), - &Overlapped); - } - else - { - /*printf("unlocking %d\n", (int)fd);fflush(stdout);*/ - ret_val = UnlockFileEx(fd, 0, - ( (DWORD) ( len & (__int64) 0xFFFFFFFF ) ), - ( (DWORD) ( (len >> 32) & (__int64) 0xFFFFFFFF ) ), - &Overlapped); - } -#else - Overlapped.Offset = offset; - Overlapped.OffsetHigh = 0; - - if (cmd == ADIOI_LOCK_CMD) - { - /*printf("locking %d\n", (int)fd);fflush(stdout);*/ - ret_val = LockFileEx(fd, dwFlags, 0, len, 0, &Overlapped); - } - else - { - /*printf("unlocking %d\n", (int)fd);fflush(stdout);*/ - ret_val = UnlockFileEx(fd, 0, len, 0, &Overlapped); - } -#endif - - if (!ret_val) - { - char errMsg[ADIOI_NTFS_ERR_MSG_MAX]; - /* - FPRINTF(stderr, "File locking failed in ADIOI_Set_lock.\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - */ - ret_val = GetLastError(); - if (ret_val == ERROR_IO_PENDING) - { - DWORD dummy; - ret_val = GetOverlappedResult(fd, &Overlapped, &dummy, TRUE); - if (ret_val) - { - CloseHandle(Overlapped.hEvent); - return MPI_SUCCESS; - } - ret_val = GetLastError(); - } - ADIOI_NTFS_Strerror(ret_val, 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(Overlapped.hEvent); - - return error_code; -} -#else -int ADIOI_Set_lock(FDTYPE fd, int cmd, int type, ADIO_Offset offset, int whence, - ADIO_Offset len) -{ - int err, error_code, err_count = 0, sav_errno; - struct flock lock; - - if (len == 0) return MPI_SUCCESS; - - - /* Depending on the compiler flags and options, struct flock - may not be defined with types that are the same size as - ADIO_Offsets. */ -/* FIXME: This is a temporary hack until we use flock64 where - available. It also doesn't fix the broken Solaris header sys/types.h - header file, which declars off_t as a UNION ! Configure tests to - see if the off64_t is a union if large file support is requested; - if so, it does not select large file support. -*/ -#ifdef NEEDS_INT_CAST_WITH_FLOCK - lock.l_type = type; - lock.l_start = (int)offset; - lock.l_whence = whence; - lock.l_len = (int)len; -#else - lock.l_type = type; - lock.l_whence = whence; - lock.l_start = offset; - lock.l_len = len; -#endif - - sav_errno = errno; /* save previous errno in case we recover from retryable errors */ - errno = 0; - do { - err = fcntl(fd, cmd, &lock); -#ifdef USE_DBG_LOGGING -/* if (MPIU_DBG_SELECTED(ROMIO,TERSE)) */ - { - if (err && ((errno == EINTR) || (errno == EINPROGRESS))) - { - if((err_count < 5) || (err_count > 9995)) - { - fprintf(stderr, "File locking failed in ADIOI_Set_lock(fd %#X,cmd %s/%#X,type %s/%#X,whence %#X) with return value %#X and errno %#X. Retry (%d).\n", - fd, - ((cmd == F_GETLK )? "F_GETLK" : - ((cmd == F_SETLK )? "F_SETLK" : - ((cmd == F_SETLKW )? "F_SETLKW" : "UNEXPECTED"))), - cmd, - ((type == F_RDLCK )? "F_RDLCK" : - ((type == F_WRLCK )? "F_WRLCK" : - ((type == F_UNLCK )? "F_UNLOCK" : "UNEXPECTED"))), - type, - whence, err, errno, err_count); - perror("ADIOI_Set_lock:"); - fprintf(stderr,"ADIOI_Set_lock:offset %#llx, length %#llx\n",(unsigned long long)offset, (unsigned long long)len); - } - } - } -#endif - } while (err && ((errno == EINTR) || ((errno == EINPROGRESS) && (++err_count < 10000)))); - - if (err && (errno != EBADF)) { - /* FIXME: This should use the error message system, - especially for MPICH */ - FPRINTF(stderr, "This requires fcntl(2) to be implemented. As of 8/25/2011 it is not. Generic MPICH Message: File locking failed in ADIOI_Set_lock(fd %X,cmd %s/%X,type %s/%X,whence %X) with return value %X and errno %X.\n" - "- If the file system is NFS, you need to use NFS version 3, ensure that the lockd daemon is running on all the machines, and mount the directory with the 'noac' option (no attribute caching).\n" - "- If the file system is LUSTRE, ensure that the directory is mounted with the 'flock' option.\n", - fd, - ((cmd == F_GETLK )? "F_GETLK" : - ((cmd == F_SETLK )? "F_SETLK" : - ((cmd == F_SETLKW )? "F_SETLKW" : "UNEXPECTED"))), - cmd, - ((type == F_RDLCK )? "F_RDLCK" : - ((type == F_WRLCK )? "F_WRLCK" : - ((type == F_UNLCK )? "F_UNLOCK" : "UNEXPECTED"))), - type, - whence, err, errno); - perror("ADIOI_Set_lock:"); - FPRINTF(stderr,"ADIOI_Set_lock:offset %llu, length %llu\n",(unsigned long long)offset, (unsigned long long)len); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if(!err) /* report fcntl failure errno's (EBADF), otherwise */ - errno = sav_errno; /* restore previous errno in case we recovered from retryable errors */ - - error_code = (err == 0) ? MPI_SUCCESS : MPI_ERR_UNKNOWN; - return error_code; -} -#endif - -#if (defined(ROMIO_HFS) || defined(ROMIO_XFS)) -int ADIOI_Set_lock64(FDTYPE fd, int cmd, int type, ADIO_Offset offset, - int whence, - ADIO_Offset len) -{ - int err, error_code; - struct flock64 lock; - - if (len == 0) return MPI_SUCCESS; - - lock.l_type = type; - lock.l_start = offset; - lock.l_whence = whence; - lock.l_len = len; - - do { - err = fcntl(fd, cmd, &lock); - } while (err && (errno == EINTR)); - - if (err && (errno != EBADF)) { - FPRINTF(stderr, "File locking failed in ADIOI_Set_lock64(fd %X,cmd %s/%X,type %s/%X,whence %X) with return value %X and errno %X.\n" - "If the file system is NFS, you need to use NFS version 3, ensure that the lockd daemon is running on all the machines, and mount the directory with the 'noac' option (no attribute caching).\n", - fd, - ((cmd == F_GETLK )? "F_GETLK" : - ((cmd == F_SETLK )? "F_SETLK" : - ((cmd == F_SETLKW )? "F_SETLKW" : - ((cmd == F_GETLK64 )? "F_GETLK64" : - ((cmd == F_SETLK64 )? "F_SETLK64" : - ((cmd == F_SETLKW64)? "F_SETLKW64" : "UNEXPECTED")))))), - cmd, - ((type == F_RDLCK )? "F_RDLCK" : - ((type == F_WRLCK )? "F_WRLCK" : - ((type == F_UNLCK )? "F_UNLOCK" : "UNEXPECTED"))), - type, - whence, err, errno); - perror("ADIOI_Set_lock64:"); - FPRINTF(stderr,"ADIOI_Set_lock:offset %llu, length %llu\n",(unsigned long long)offset, (unsigned long long)len); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - error_code = (err == 0) ? MPI_SUCCESS : MPI_ERR_UNKNOWN; - return error_code; -} -#endif diff --git a/3rd-party/romio321/adio/common/malloc.c b/3rd-party/romio321/adio/common/malloc.c deleted file mode 100644 index 73c5a707050..00000000000 --- a/3rd-party/romio321/adio/common/malloc.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. - */ - -/* These are routines for allocating and deallocating memory. - They should be called as ADIOI_Malloc(size) and - ADIOI_Free(ptr). In adio.h, they are macro-replaced to - ADIOI_Malloc(size,__LINE__,__FILE__) and - ADIOI_Free(ptr,__LINE__,__FILE__). - - Later on, add some tracing and error checking, similar to - MPID_trmalloc. */ - -#include "adio.h" -#include "mpi.h" -#include -#include -#include "mpipr.h" - -#ifdef HAVE_MALLOC_H -#include -#endif - -/* for the style checker */ -/* style: allow:malloc:1 sig:0 */ -/* style: allow:free:1 sig:0 */ -/* style: allow:calloc:1 sig:0 */ -/* style: allow:realloc:1 sig:0 */ - -#define FPRINTF fprintf - -void *ADIOI_Malloc_fn(size_t size, int lineno, const char *fname); -void *ADIOI_Calloc_fn(size_t nelem, size_t elsize, int lineno, const char *fname); -void *ADIOI_Realloc_fn(void *ptr, size_t size, int lineno, const char *fname); -void ADIOI_Free_fn(void *ptr, int lineno, const char *fname); - -void *ADIOI_Malloc_fn(size_t size, int lineno, const char *fname) -{ - void *new; - -#ifdef ROMIO_XFS - new = (void *) memalign(XFS_MEMALIGN, size); -#else -#ifdef HAVE_MPIU_FUNCS - new = (void *) MPIU_trmalloc(size, lineno, fname); -#else - new = (void *) malloc(size); -#endif -#endif - if (!new && size) { - FPRINTF(stderr, "Out of memory in file %s, line %d\n", fname, lineno); - MPI_Abort(MPI_COMM_WORLD, 1); - } - DBG_FPRINTF(stderr, "ADIOI_Malloc %s:<%d> %p (%#zX)\n", fname, lineno, new, size); - return new; -} - - -void *ADIOI_Calloc_fn(size_t nelem, size_t elsize, int lineno, const char *fname) -{ - void *new; - -#ifdef HAVE_MPIU_FUNCS - new = (void *) MPIU_trcalloc(nelem, elsize, lineno, fname); -#else - new = (void *) calloc(nelem, elsize); -#endif - if (!new && nelem) { - FPRINTF(stderr, "Out of memory in file %s, line %d\n", fname, lineno); - MPI_Abort(MPI_COMM_WORLD, 1); - } - DBG_FPRINTF(stderr, "ADIOI_Calloc %s:<%d> %p\n", fname, lineno, new); - return new; -} - - -void *ADIOI_Realloc_fn(void *ptr, size_t size, int lineno, const char *fname) -{ - void *new; - -#ifdef HAVE_MPIU_FUNCS - new = (void *) MPIU_trrealloc(ptr, size, lineno, fname); -#else - new = (void *) realloc(ptr, size); -#endif - if (!new && size) { - FPRINTF(stderr, "realloc failed in file %s, line %d\n", fname, lineno); - MPI_Abort(MPI_COMM_WORLD, 1); - } - DBG_FPRINTF(stderr, "ADIOI_Realloc %s:<%d> %p\n", fname, lineno, new); - return new; -} - - -void ADIOI_Free_fn(void *ptr, int lineno, const char *fname) -{ - DBG_FPRINTF(stderr, "ADIOI_Free %s:<%d> %p\n", fname, lineno, ptr); - if (!ptr) { - FPRINTF(stderr, "Attempt to free null pointer in file %s, line %d\n", fname, lineno); - MPI_Abort(MPI_COMM_WORLD, 1); - } - -#ifdef HAVE_MPIU_FUNCS - MPIU_trfree(ptr, lineno, fname); -#else - free(ptr); -#endif -} - - diff --git a/3rd-party/romio321/adio/common/onesided_aggregation.c b/3rd-party/romio321/adio/common/onesided_aggregation.c deleted file mode 100644 index 71a5b7bee6e..00000000000 --- a/3rd-party/romio321/adio/common/onesided_aggregation.c +++ /dev/null @@ -1,2174 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2015 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "adio.h" -#include "adio_extern.h" -#ifdef ROMIO_GPFS -/* right now this is GPFS only but TODO: extend this to all file systems */ -#include "../ad_gpfs/ad_gpfs_tuning.h" -#else -int gpfsmpio_onesided_no_rmw = 0; -int gpfsmpio_write_aggmethod = 0; -int gpfsmpio_read_aggmethod = 0; -int gpfsmpio_onesided_always_rmw = 0; -#endif - -#include - -// #define onesidedtrace 1 - - -/* This data structure holds the number of extents, the index into the flattened buffer and the remnant length - * beyond the flattened buffer index corresponding to the base buffer offset for non-contiguous source data - * for the range to be written coresponding to the round and target agg. - */ -typedef struct NonContigSourceBufOffset { - int dataTypeExtent; - int flatBufIndice; - ADIO_Offset indiceOffset; -} NonContigSourceBufOffset; - -/* This data structure holds the access state of the source buffer for target - * file domains within aggregators corresponding to the target data blocks. It - * is designed to be initialized with a starting point for a given file domain - * with an aggregator, after which the data access for data written to a given - * file domain from this compute is linear and uninterupted, and this serves as - * a key optimization for feeding the target aggs. For contigous source data - * the starting point is a single-value offset, for non-contiguous data it is - * the number of extents, the index into the flattened buffer and the remnant - * length beyond the flattened buffer index. The validity of the usage of this - * structure relies on the requirement that only 1 aggregator can write to a - * given file domain. */ -typedef struct FDSourceBufferState { - - ADIO_Offset indiceOffset; - MPI_Aint bufTypeExtent; - int dataTypeExtent; - int flatBufIndice; - - ADIO_Offset sourceBufferOffset; - -} FDSourceBufferState; - - -static int ADIOI_OneSidedSetup(ADIO_File fd, int procs) { - int ret = MPI_SUCCESS; - - ret = MPI_Win_create(fd->io_buf,fd->hints->cb_buffer_size,1, - MPI_INFO_NULL,fd->comm, &fd->io_buf_window); - if (ret != MPI_SUCCESS) goto fn_exit; - fd->io_buf_put_amounts = (int *) ADIOI_Malloc(procs*sizeof(int)); - ret =MPI_Win_create(fd->io_buf_put_amounts,procs*sizeof(int),sizeof(int), - MPI_INFO_NULL,fd->comm, &fd->io_buf_put_amounts_window); -fn_exit: - return ret; -} - -int ADIOI_OneSidedCleanup(ADIO_File fd) -{ - int ret = MPI_SUCCESS; - if (fd->io_buf_window != MPI_WIN_NULL) - ret = MPI_Win_free(&fd->io_buf_window); - if (fd->io_buf_put_amounts_window != MPI_WIN_NULL) - ret = MPI_Win_free(&fd->io_buf_put_amounts_window); - if (fd->io_buf_put_amounts != NULL) - ADIOI_Free(fd->io_buf_put_amounts); - - return ret; -} - -/* This funtion packs a contigous buffer of data from the non-contgious source - * buffer for a specified chunk of data and advances the FDSourceBufferState - * machinery, so subsequent calls with the FDSourceBufferState will return the - * next linear chunk. - * Parameters: - * in: sourceDataBuffer - pointer to source data buffer. - * in: flatBuf - pointer to flattened source data buffer - * in: targetNumBytes - number of bytes to return and advance. - * in: packing - whether data is being packed from the source buffer to the - * packed buffer (1) or unpacked from the packed buffer to the source - * buffer (0) - * in/out: currentFDSourceBufferState - pointer to FDSourceBufferState structure, current - * data used as starting point, will be updated with - * the new state after targetNumBytes advance. - * out: packedDataBufer - pointer to the output packed data buffer. If the - * value is NULL then no data will be written. - * - */ -inline static void nonContigSourceDataBufferAdvance(char *sourceDataBuffer, - ADIOI_Flatlist_node *flatBuf, int targetNumBytes, int packing, - FDSourceBufferState *currentFDSourceBufferState, char *packedDataBufer) -{ - // make currentDataTypeExtent and bufTypeExtent ADIO_Offset since they are - // used in offset calculations - ADIO_Offset currentIndiceOffset = currentFDSourceBufferState->indiceOffset; - ADIO_Offset bufTypeExtent = (ADIO_Offset)currentFDSourceBufferState->bufTypeExtent; - ADIO_Offset currentDataTypeExtent = - (ADIO_Offset)currentFDSourceBufferState->dataTypeExtent; - int currentFlatBufIndice = currentFDSourceBufferState->flatBufIndice; - - int targetSendDataIndex = 0; - -#ifdef onesidedtrace - printf("nonContigSourceDataBufferAdvance: currentFlatBufIndice is %d currentDataTypeExtent is %ld currentIndiceOffset is %ld\n",currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset); -#endif - - int remainingBytesToLoad = targetNumBytes; - while (remainingBytesToLoad > 0) { - if ((flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset) >= remainingBytesToLoad) { // we can get the rest of our data from this indice - ADIO_Offset physicalSourceBufferOffset = (currentDataTypeExtent * bufTypeExtent) + flatBuf->indices[currentFlatBufIndice] + currentIndiceOffset; - -#ifdef onesidedtrace - printf("loading remainingBytesToLoad %d from src buffer offset %ld to targetSendDataIndex %d\n",remainingBytesToLoad,physicalSourceBufferOffset,targetSendDataIndex); -#endif - - if (packedDataBufer != NULL) { - if (packing) - memcpy(&(packedDataBufer[targetSendDataIndex]),&(sourceDataBuffer[physicalSourceBufferOffset]),remainingBytesToLoad); - else - memcpy(&(sourceDataBuffer[physicalSourceBufferOffset]),&(packedDataBufer[targetSendDataIndex]),remainingBytesToLoad); - } - - targetSendDataIndex += remainingBytesToLoad; - currentIndiceOffset += (ADIO_Offset)remainingBytesToLoad; - if (currentIndiceOffset >= flatBuf->blocklens[currentFlatBufIndice]) { - currentIndiceOffset = (ADIO_Offset)0; - currentFlatBufIndice++; - if (currentFlatBufIndice == flatBuf->count) { - currentFlatBufIndice = 0; - currentDataTypeExtent++; - } - } - remainingBytesToLoad = 0; - - } - else { // we can only get part of our data from this indice - int amountDataToLoad = (flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset); - ADIO_Offset physicalSourceBufferOffset = (currentDataTypeExtent * bufTypeExtent) + flatBuf->indices[currentFlatBufIndice] + currentIndiceOffset; - -#ifdef onesidedtrace - printf("loading amountDataToLoad %d from src buffer offset %ld to targetSendDataIndex %d\n",amountDataToLoad,physicalSourceBufferOffset,targetSendDataIndex); -#endif - if (packedDataBufer != NULL) { - if (packing) - memcpy(&(packedDataBufer[targetSendDataIndex]),&(sourceDataBuffer[physicalSourceBufferOffset]),amountDataToLoad); - else - memcpy(&(sourceDataBuffer[physicalSourceBufferOffset]),&(packedDataBufer[targetSendDataIndex]),amountDataToLoad); - } - - targetSendDataIndex += amountDataToLoad; - currentIndiceOffset = (ADIO_Offset)0; - currentFlatBufIndice++; - if (currentFlatBufIndice == flatBuf->count) { - currentFlatBufIndice = 0; - currentDataTypeExtent++; - } - remainingBytesToLoad -= amountDataToLoad; - } - } // while - - /* update machinery with new flatbuf position - */ - currentFDSourceBufferState->indiceOffset = currentIndiceOffset; - currentFDSourceBufferState->dataTypeExtent = (int) currentDataTypeExtent; - currentFDSourceBufferState->flatBufIndice = currentFlatBufIndice; -#ifdef onesidedtrace - printf("source buf advanced to currentFlatBufIndice %d currentDataTypeExtent %ld currentIndiceOffset %ld\n",currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset); -#endif -} - - -void ADIOI_OneSidedWriteAggregation(ADIO_File fd, - ADIO_Offset *offset_list, - ADIO_Offset *len_list, - int contig_access_count, - const void *buf, - MPI_Datatype datatype, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offsets, - int numNonZeroDataOffsets, - ADIO_Offset *fd_start, - ADIO_Offset* fd_end, - int *hole_found) - -{ - int i,j; /* generic iterators */ - -#ifdef onesidedtrace - if (buf == NULL) { - printf("ADIOI_OneSidedWriteAggregation - buf is NULL contig_access_count is %d\n",contig_access_count); - for (i=0;i 0) - lenListOverZero = 1; - - - *error_code = MPI_SUCCESS; /* initialize to success */ - -#ifdef ROMIO_GPFS - double startTimeBase,endTimeBase; - startTimeBase = MPI_Wtime(); -#endif - - MPI_Status status; - pthread_t io_thread; - void *thread_ret; - ADIOI_IO_ThreadFuncData io_thread_args; - - int nprocs,myrank; - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); -#ifdef onesidedtrace -printf("ADIOI_OneSidedWriteAggregation started on rank %d\n",myrank); -#endif - - - if (fd->io_buf_window == MPI_WIN_NULL || - fd->io_buf_put_amounts_window == MPI_WIN_NULL) - { - ADIOI_OneSidedSetup(fd, nprocs); - } - - /* This flag denotes whether the source datatype is contiguous, which is referenced throughout the algorithm - * and defines how the source buffer offsets and data chunks are determined. If the value is 1 (true - contiguous data) - * things are profoundly simpler in that the source buffer offset for a given target offset simply linearly increases - * by the chunk sizes being written. If the value is 0 (non-contiguous) then these values are based on calculations - * from the flattened source datatype. - */ - int bufTypeIsContig; - - MPI_Aint bufTypeExtent, lb; - ADIOI_Flatlist_node *flatBuf=NULL; - ADIOI_Datatype_iscontig(datatype, &bufTypeIsContig); - - if (!bufTypeIsContig) { - /* Flatten the non-contiguous source datatype and set the extent. */ - flatBuf = ADIOI_Flatten_and_find(datatype); - MPI_Type_get_extent(datatype, &lb, &bufTypeExtent); -#ifdef onesidedtrace - printf("flatBuf->count is %d bufTypeExtent is %d\n", flatBuf->count,bufTypeExtent); - for (i=0;icount;i++) - printf("flatBuf->blocklens[%d] is %d flatBuf->indices[%d] is %ld\n",i,flatBuf->blocklens[i],i,flatBuf->indices[i]); -#endif - } - - int naggs = fd->hints->cb_nodes; - - /* Track the state of the source buffer for feeding the target data blocks. - * For GPFS the number of file domains per agg is always 1 so we just need 1 agg - * dimension to track the data, in the case of lustre we will need 2 dimensions - * agg and file domain since aggs write to multiple file domains in the case of lustre. - * This structure will be modified as the data is written to reflect the current state - * of the offset. - */ - -#ifdef onesidedtrace - printf("sizeof(FDSourceBufferState) is %d - make sure is 32 for 32-byte memalign optimal\n",sizeof(FDSourceBufferState)); -#endif - FDSourceBufferState *currentFDSourceBufferState; - - currentFDSourceBufferState = (FDSourceBufferState *) ADIOI_Malloc(naggs * sizeof(FDSourceBufferState)); - for (i=0;ihints->ranklist */ - int iAmUsedAgg = 0; /* whether or not this rank is used as an aggregator. */ - - /* Make coll_bufsize an ADIO_Offset since it is used in calculations with offsets. - */ - ADIO_Offset coll_bufsize = (ADIO_Offset)(fd->hints->cb_buffer_size); -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio == 1) { - /* split buffer in half for a kind of double buffering with the threads*/ - coll_bufsize = (ADIO_Offset)(fd->hints->cb_buffer_size/2); - } -#endif - - /* This logic defines values that are used later to determine what offsets define the portion - * of the file domain the agg is writing this round. - */ - int greatestFileDomainAggRank = -1,smallestFileDomainAggRank = -1; - ADIO_Offset greatestFileDomainOffset = 0; - ADIO_Offset smallestFileDomainOffset = lastFileOffset; - for (j=0;j greatestFileDomainOffset) { - greatestFileDomainOffset = fd_end[j]; - greatestFileDomainAggRank = j; - } - if (fd_start[j] < smallestFileDomainOffset) { - smallestFileDomainOffset = fd_start[j]; - smallestFileDomainAggRank = j; - } - if (fd->hints->ranklist[j] == myrank) { - myAggRank = j; - if (fd_end[j] > fd_start[j]) { - iAmUsedAgg = 1; - } - } - } - -#ifdef onesidedtrace - printf("contig_access_count is %d lastFileOffset is %ld firstFileOffset is %ld\n",contig_access_count,lastFileOffset,firstFileOffset); - for (j=0;j numberOfRounds) - numberOfRounds = currentNumberOfRounds; - } - - /* Data structures to track what data this compute needs to send to whom. - * For lustre they will all need another dimension for the file domain. - */ - int *targetAggsForMyData = (int *)ADIOI_Malloc(naggs * sizeof(int)); - ADIO_Offset *targetAggsForMyDataFDStart = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - ADIO_Offset *targetAggsForMyDataFDEnd = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - int numTargetAggs = 0; - - /* This data structure holds the beginning offset and len list index for the range to be written - * coresponding to the round and target agg. Initialize to -1 to denote being unset. - */ - int **targetAggsForMyDataFirstOffLenIndex = (int **)ADIOI_Malloc(numberOfRounds * sizeof(int *)); - for (i=0;ihints->ranklist[%d]is %d fd_start is %ld fd_end is %ld\n",i,fd->hints->ranklist[i],fd_start[i],fd_end[i]); - for (j=0;j 0) && (buf != NULL) && lenListOverZero) { - int blockIter; - for (blockIter=0;blockIter0) { - if (bufTypeIsContig) { - currentSourceBufferOffset += len_list[blockIter-1]; - } - else { - - /* Non-contiguous source datatype, count up the extents and indices to this point - * in the blocks for use in computing the source starting buffer offset for target aggs - * and file domains. - */ - ADIO_Offset sourceBlockTotal = 0; - int lastIndiceUsed = currentFlatBufIndice; - int numNonContigSourceChunks = 0; - - while (sourceBlockTotal < len_list[blockIter-1]) { - numNonContigSourceChunks++; - sourceBlockTotal += (flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset); - lastIndiceUsed = currentFlatBufIndice; - currentFlatBufIndice++; - if (currentFlatBufIndice == flatBuf->count) { - currentFlatBufIndice = 0; - currentDataTypeExtent++; - } - currentIndiceOffset = (ADIO_Offset)0; - } - if (sourceBlockTotal > len_list[blockIter-1]) { - currentFlatBufIndice--; - if (currentFlatBufIndice < 0 ) { - currentDataTypeExtent--; - currentFlatBufIndice = flatBuf->count-1; - } - currentIndiceOffset = len_list[blockIter-1] - (sourceBlockTotal - flatBuf->blocklens[lastIndiceUsed]); - // ADIOI_Assert((currentIndiceOffset >= 0) && (currentIndiceOffset < flatBuf->blocklens[currentFlatBufIndice])); - } - else - currentIndiceOffset = (ADIO_Offset)0; - maxNumContigOperations += (numNonContigSourceChunks+2); - if (numNonContigSourceChunks > maxNumNonContigSourceChunks) - maxNumNonContigSourceChunks = numNonContigSourceChunks; - -#ifdef onesidedtrace - printf("blockiter %d currentFlatBufIndice is now %d currentDataTypeExtent is now %d currentIndiceOffset is now %ld maxNumContigOperations is now %d\n",blockIter,currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset,maxNumContigOperations); -#endif - } // !bufTypeIsContig - } // blockIter > 0 - - /* For the last iteration we need to include these maxNumContigOperations and maxNumNonContigSourceChunks - * for non-contig case even though we did not need to compute the next starting offset. - */ - if ((blockIter == (contig_access_count-1)) && (!bufTypeIsContig)) { - ADIO_Offset sourceBlockTotal = 0; - int tmpCurrentFlatBufIndice = currentFlatBufIndice; - int lastNumNonContigSourceChunks = 0; - while (sourceBlockTotal < len_list[blockIter]) { - lastNumNonContigSourceChunks++; - sourceBlockTotal += flatBuf->blocklens[tmpCurrentFlatBufIndice]; - tmpCurrentFlatBufIndice++; - if (tmpCurrentFlatBufIndice == flatBuf->count) { - tmpCurrentFlatBufIndice = 0; - } - } - maxNumContigOperations += (lastNumNonContigSourceChunks+2); - if (lastNumNonContigSourceChunks > maxNumNonContigSourceChunks) - maxNumNonContigSourceChunks = lastNumNonContigSourceChunks; - - } - - ADIO_Offset blockStart = offset_list[blockIter], blockEnd = offset_list[blockIter]+len_list[blockIter]-(ADIO_Offset)1; - - /* Find the starting target agg for this block - normally it will be the current agg so guard the expensive - * while loop with a cheap if-check which for large numbers of small blocks will usually be false. - */ - if (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) { - while (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) - currentAggRankListIndex++; - }; - -#ifdef onesidedtrace - printf("currentAggRankListIndex is %d blockStart %ld blockEnd %ld fd_start[currentAggRankListIndex] %ld fd_end[currentAggRankListIndex] %ld\n",currentAggRankListIndex,blockStart,blockEnd,fd_start[currentAggRankListIndex],fd_end[currentAggRankListIndex]); -#endif - - /* Determine if this is a new target agg. - */ - if (blockIter>0) { - if ((offset_list[blockIter-1]+len_list[blockIter-1]-(ADIO_Offset)1) < fd_start[currentAggRankListIndex]) { - numTargetAggs++; - } - } - - /* Determine which round to start writing - data is written coll_bufsize per round from the aggregator - * so if our starting offset in the file domain is multiple coll_bufsize that will correspond to the round. - */ - if ((blockStart - fd_start[currentAggRankListIndex]) >= coll_bufsize) { - ADIO_Offset currentRoundBlockStart = fd_start[currentAggRankListIndex]; - int startingRound = 0; - while (blockStart > (currentRoundBlockStart + coll_bufsize - (ADIO_Offset)1)) { - currentRoundBlockStart+=coll_bufsize; - startingRound++; - } - targetAggsForMyDataCurrentRoundIter[numTargetAggs] = startingRound; - } - - /* Initialize the data structures if this is the first offset in the round/target agg. - */ - if (targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] == -1) { - targetAggsForMyData[numTargetAggs] = fd->hints->ranklist[currentAggRankListIndex]; - targetAggsForMyDataFDStart[numTargetAggs] = fd_start[currentAggRankListIndex]; - /* Round up file domain to the first actual offset used if this is the first file domain. - */ - if (currentAggRankListIndex == smallestFileDomainAggRank) { - if (targetAggsForMyDataFDStart[numTargetAggs] < firstFileOffset) - targetAggsForMyDataFDStart[numTargetAggs] = firstFileOffset; - } - targetAggsForMyDataFDEnd[numTargetAggs] = fd_end[currentAggRankListIndex]; - /* Round down file domain to the last actual offset used if this is the last file domain. - */ - if (currentAggRankListIndex == greatestFileDomainAggRank) { - if (targetAggsForMyDataFDEnd[numTargetAggs] > lastFileOffset) - targetAggsForMyDataFDEnd[numTargetAggs] = lastFileOffset; - } - targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; - /* Set the source buffer state starting point for data access for this - agg and file domain. */ - - if (bufTypeIsContig) { - if (currentFDSourceBufferState[numTargetAggs].sourceBufferOffset == -1) { - - currentFDSourceBufferState[numTargetAggs].sourceBufferOffset = currentSourceBufferOffset; -#ifdef onesidedtrace - printf("For agg %d sourceBufferOffset initialized to %ld\n",currentAggRankListIndex,currentSourceBufferOffset); -#endif - } - } - else { - if (currentFDSourceBufferState[numTargetAggs].indiceOffset == -1) { - currentFDSourceBufferState[numTargetAggs].indiceOffset = currentIndiceOffset; - currentFDSourceBufferState[numTargetAggs].bufTypeExtent = bufTypeExtent; - currentFDSourceBufferState[numTargetAggs].dataTypeExtent = currentDataTypeExtent; - currentFDSourceBufferState[numTargetAggs].flatBufIndice = currentFlatBufIndice; -#ifdef onesidedtrace - printf("For agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld\n",numTargetAggs,currentDataTypeExtent,currentFlatBufIndice,currentIndiceOffset); -#endif - } - } - - intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + ((ADIO_Offset)(targetAggsForMyDataCurrentRoundIter[numTargetAggs]+1) * coll_bufsize); - -#ifdef onesidedtrace - printf("Initial settings numTargetAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld currentSourceBufferOffset set to %ld intraRoundCollBufsizeOffset set to %ld\n",numTargetAggs,blockIter,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter],currentSourceBufferOffset,intraRoundCollBufsizeOffset); -#endif - } - - /* Replace the last offset block iter with this one. - */ - targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; - - /* If this blocks extends into the next file domain advance to the next target aggs and source buffer states. - */ - if (blockEnd > fd_end[currentAggRankListIndex]) { -#ifdef onesidedtrace - printf("block extends past current fd, blockEnd %ld >= fd_end[currentAggRankListIndex] %ld total block size is %ld blockStart was %ld\n",blockEnd,fd_end[currentAggRankListIndex], len_list[blockIter],blockStart); -#endif - ADIO_Offset amountToAdvanceSBOffsetForFD = 0; - int additionalFDCounter = 0; - - while (blockEnd >= fd_end[currentAggRankListIndex]) { - ADIO_Offset thisAggBlockEnd = fd_end[currentAggRankListIndex]; - if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { - while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { - targetAggsForMyDataCurrentRoundIter[numTargetAggs]++; - intraRoundCollBufsizeOffset += coll_bufsize; - targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; - targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; -#ifdef onesidedtrace - printf("targetAggsForMyDataCurrentRoundI%d] is now %d intraRoundCollBufsizeOffset is now %ld\n",numTargetAggs,targetAggsForMyDataCurrentRoundIter[numTargetAggs],intraRoundCollBufsizeOffset); -#endif - } // while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) - } // if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) - - int prevAggRankListIndex = currentAggRankListIndex; - currentAggRankListIndex++; - - /* Skip over unused aggs. - */ - if (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) { - while (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) - currentAggRankListIndex++; - - } // (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) - - /* Start new target agg. - */ - if (blockEnd >= fd_start[currentAggRankListIndex]) { - numTargetAggs++; - targetAggsForMyData[numTargetAggs] = fd->hints->ranklist[currentAggRankListIndex]; - targetAggsForMyDataFDStart[numTargetAggs] = fd_start[currentAggRankListIndex]; - /* Round up file domain to the first actual offset used if this is the first file domain. - */ - if (currentAggRankListIndex == smallestFileDomainAggRank) { - if (targetAggsForMyDataFDStart[numTargetAggs] < firstFileOffset) - targetAggsForMyDataFDStart[numTargetAggs] = firstFileOffset; - } - targetAggsForMyDataFDEnd[numTargetAggs] = fd_end[currentAggRankListIndex]; - /* Round down file domain to the last actual offset used if this is the last file domain. - */ - if (currentAggRankListIndex == greatestFileDomainAggRank) { - if (targetAggsForMyDataFDEnd[numTargetAggs] > lastFileOffset) - targetAggsForMyDataFDEnd[numTargetAggs] = lastFileOffset; - } - targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; - /* For the first additonal file domain the source buffer offset - * will be incremented relative to the state of this first main - * loop but for subsequent full file domains the offset will be - * incremented by the size - * of the file domain. - */ - if (additionalFDCounter == 0) - amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex] - - blockStart) + (ADIO_Offset)1; - else - amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex] - -fd_start[prevAggRankListIndex]) +(ADIO_Offset)1; - - if (bufTypeIsContig) { - ADIOI_Assert(numTargetAggs > 0); - if (currentFDSourceBufferState[numTargetAggs].sourceBufferOffset == -1) { - if (additionalFDCounter == 0) { // first file domain, still use the current data counter - currentFDSourceBufferState[numTargetAggs].sourceBufferOffset = - currentSourceBufferOffset+amountToAdvanceSBOffsetForFD; - } - else { // 2nd file domain, advance full file domain from last source buffer state - currentFDSourceBufferState[numTargetAggs].sourceBufferOffset = - currentFDSourceBufferState[numTargetAggs-1].sourceBufferOffset+amountToAdvanceSBOffsetForFD; - } - -#ifdef onesidedtrace - printf("Crossed into new FD - for agg %d sourceBufferOffset initialized to %ld amountToAdvanceSBOffsetForFD is %ld\n",numTargetAggs,currentFDSourceBufferState[numTargetAggs].sourceBufferOffset,amountToAdvanceSBOffsetForFD); -#endif - } - } - else if (currentFDSourceBufferState[numTargetAggs].indiceOffset == -1) { - // non-contiguos source buffer - ADIOI_Assert(numTargetAggs > 0); - - /* Initialize the source buffer state appropriately and then - * advance it with the - * nonContigSourceDataBufferAdvance function. - */ - if (additionalFDCounter == 0) { - // first file domain, still use the current data counter - currentFDSourceBufferState[numTargetAggs].indiceOffset = - currentIndiceOffset; - currentFDSourceBufferState[numTargetAggs].bufTypeExtent = bufTypeExtent; - currentFDSourceBufferState[numTargetAggs].dataTypeExtent = - currentDataTypeExtent; - currentFDSourceBufferState[numTargetAggs].flatBufIndice = - currentFlatBufIndice; - } - else { - // 2nd file domain, advance full file domain from last source buffer state - currentFDSourceBufferState[numTargetAggs].indiceOffset = - currentFDSourceBufferState[numTargetAggs-1].indiceOffset; - currentFDSourceBufferState[numTargetAggs].bufTypeExtent = - currentFDSourceBufferState[numTargetAggs-1].bufTypeExtent; - currentFDSourceBufferState[numTargetAggs].dataTypeExtent = - currentFDSourceBufferState[numTargetAggs-1].dataTypeExtent; - currentFDSourceBufferState[numTargetAggs].flatBufIndice = - currentFDSourceBufferState[numTargetAggs-1].flatBufIndice; - } - nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, - (int)amountToAdvanceSBOffsetForFD, 1, - ¤tFDSourceBufferState[numTargetAggs], NULL); -#ifdef onesidedtrace - printf("Crossed into new FD - for agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld amountToAdvanceSBOffsetForFD is %d\n",numTargetAggs,currentFDSourceBufferState[numTargetAggs].dataTypeExtent,currentFDSourceBufferState[numTargetAggs].flatBufIndice,currentFDSourceBufferState[numTargetAggs].indiceOffset,amountToAdvanceSBOffsetForFD); -#endif - } - additionalFDCounter++; - -#ifdef onesidedtrace - printf("block extended beyond fd init settings numTargetAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld\n",numTargetAggs,i,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter]); -#endif - intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + coll_bufsize; - targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; - } // if (blockEnd >= fd_start[currentAggRankListIndex]) - } // while (blockEnd >= fd_end[currentAggRankListIndex]) - } // if (blockEnd > fd_end[currentAggRankListIndex]) - - /* If we are still in the same file domain / target agg but have gone - * past the coll_bufsize and need to advance to the next round - - * initialize tracking data appropriately. - */ - if (blockEnd >= intraRoundCollBufsizeOffset) { - ADIO_Offset currentBlockEnd = blockEnd; - while (currentBlockEnd >= intraRoundCollBufsizeOffset) { - targetAggsForMyDataCurrentRoundIter[numTargetAggs]++; - intraRoundCollBufsizeOffset += coll_bufsize; - targetAggsForMyDataFirstOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; - targetAggsForMyDataLastOffLenIndex[targetAggsForMyDataCurrentRoundIter[numTargetAggs]][numTargetAggs] = blockIter; -#ifdef onesidedtrace - printf("smaller than fd currentBlockEnd is now %ld intraRoundCollBufsizeOffset is now %ld targetAggsForMyDataCurrentRoundIter[%d] is now %d\n",currentBlockEnd, intraRoundCollBufsizeOffset, numTargetAggs,targetAggsForMyDataCurrentRoundIter[numTargetAggs]); -#endif - } // while (currentBlockEnd >= intraRoundCollBufsizeOffset) - } // if (blockEnd >= intraRoundCollBufsizeOffset) - - /* Need to advance numTargetAggs if this is the last target offset to - * include this one. - */ - if (blockIter == (contig_access_count-1)) - numTargetAggs++; - } - -#ifdef onesidedtrace - printf("numTargetAggs is %d\n",numTargetAggs); - for (i=0;i 0) && (buf != NULL) && lenListOverZero) - - ADIOI_Free(targetAggsForMyDataCurrentRoundIter); - - int currentWriteBuf = 0; - int useIOBuffer = 0; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio && (numberOfRounds>1)) { - useIOBuffer = 1; - io_thread = pthread_self(); - } -#endif - - /* use the write buffer allocated in the file_open */ - char *write_buf0 = fd->io_buf; - char *write_buf1 = fd->io_buf + coll_bufsize; - - /* start off pointing to the first buffer. If we use the 2nd buffer (threaded - * case) we'll swap later */ - char *write_buf = write_buf0; - MPI_Win write_buf_window = fd->io_buf_window; - - int *write_buf_put_amounts = fd->io_buf_put_amounts; - if(!gpfsmpio_onesided_no_rmw) { - *hole_found = 0; - for (i=0;i lastFileOffset) - currentRoundFDEnd = lastFileOffset; - } -#ifdef onesidedtrace -printf("iAmUsedAgg - currentRoundFDStart initialized to %ld currentRoundFDEnd to %ld\n",currentRoundFDStart,currentRoundFDEnd); -#endif - if (gpfsmpio_onesided_always_rmw) { // read in the first buffer - ADIO_Offset tmpCurrentRoundFDEnd = 0; - if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { - if (myAggRank == greatestFileDomainAggRank) { - if (fd_end[myAggRank] > lastFileOffset) - tmpCurrentRoundFDEnd = lastFileOffset; - else - tmpCurrentRoundFDEnd = fd_end[myAggRank]; - } - else - tmpCurrentRoundFDEnd = fd_end[myAggRank]; - } - else - tmpCurrentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; -#ifdef onesidedtrace -printf("gpfsmpio_onesided_always_rmw - first buffer pre-read for file offsets %ld to %ld total is %d\n",currentRoundFDStart,tmpCurrentRoundFDEnd,(int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1); -#endif - ADIO_ReadContig(fd, write_buf, (int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1, - MPI_BYTE, ADIO_EXPLICIT_OFFSET,currentRoundFDStart, &status, error_code); - - } - } - if (gpfsmpio_onesided_always_rmw) // wait until the first buffer is read - MPI_Barrier(fd->comm); - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_SETUP] += (endTimeBase-startTimeBase); - startTimeBase = MPI_Wtime(); -#endif - - /* This is the second main loop of the algorithm, actually nested loop of target aggs within rounds. There are 2 flavors of this. - * For gpfsmpio_write_aggmethod of 1 each nested iteration for the target - * agg does an mpi_put on a contiguous chunk using a primative datatype - * determined using the data structures from the first main loop. For - * gpfsmpio_write_aggmethod of 2 each nested iteration for the target agg - * builds up data to use in created a derived data type for 1 mpi_put that is done for the target agg for each round. - * To support lustre there will need to be an additional layer of nesting - * for the multiple file domains within target aggs. - */ - int roundIter; - - for (roundIter=0;roundIter 0) && (buf != NULL) && lenListOverZero) { - - - int aggIter; - for (aggIter=0;aggIter targetAggsForMyDataFDEnd[aggIter]) - currentRoundFDEndForMyTargetAgg = targetAggsForMyDataFDEnd[aggIter]; - - ADIO_Offset offsetStart = offset_list[offsetIter], offsetEnd = (offset_list[offsetIter]+len_list[offsetIter]-(ADIO_Offset)1); - -#ifdef onesidedtrace - printf("roundIter %d target iter %d targetAggsForMyData is %d offset_list[%d] is %ld len_list[%d] is %ld targetAggsForMyDataFDStart is %ld targetAggsForMyDataFDEnd is %ld currentRoundFDStartForMyTargetAgg is %ld currentRoundFDEndForMyTargetAgg is %ld targetAggsForMyDataFirstOffLenIndex is %ld\n", - roundIter,aggIter,targetAggsForMyData[aggIter],offsetIter,offset_list[offsetIter],offsetIter,len_list[offsetIter], - targetAggsForMyDataFDStart[aggIter],targetAggsForMyDataFDEnd[aggIter], - currentRoundFDStartForMyTargetAgg,currentRoundFDEndForMyTargetAgg, targetAggsForMyDataFirstOffLenIndex[roundIter][aggIter]); -#endif - - /* Determine the amount of data and exact source buffer offsets to use. - */ - int bufferAmountToSend = 0; - - if ((offsetStart >= currentRoundFDStartForMyTargetAgg) && (offsetStart <= currentRoundFDEndForMyTargetAgg)) { - if (offsetEnd > currentRoundFDEndForMyTargetAgg) - bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - offsetStart) +1; - else - bufferAmountToSend = (offsetEnd - offsetStart) +1; - } - else if ((offsetEnd >= currentRoundFDStartForMyTargetAgg) && (offsetEnd <= currentRoundFDEndForMyTargetAgg)) { - if (offsetEnd > currentRoundFDEndForMyTargetAgg) - bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - currentRoundFDStartForMyTargetAgg) +1; - else - bufferAmountToSend = (offsetEnd - currentRoundFDStartForMyTargetAgg) +1; - if (offsetStart < currentRoundFDStartForMyTargetAgg) { - offsetStart = currentRoundFDStartForMyTargetAgg; - } - } - else if ((offsetStart <= currentRoundFDStartForMyTargetAgg) && (offsetEnd >= currentRoundFDEndForMyTargetAgg)) { - bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - currentRoundFDStartForMyTargetAgg) +1; - offsetStart = currentRoundFDStartForMyTargetAgg; - } - - numBytesPutThisAggRound += bufferAmountToSend; -#ifdef onesidedtrace - printf("bufferAmountToSend is %d\n",bufferAmountToSend); -#endif - if (bufferAmountToSend > 0) { /* we have data to send this round */ - if (gpfsmpio_write_aggmethod == 2) { - /* Only allocate these arrays if we are using method 2 and only do it once for this round/target agg. - */ - if (!allocatedDerivedTypeArrays) { - targetAggBlockLengths = (int *)ADIOI_Malloc(maxNumContigOperations * sizeof(int)); - targetAggDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); - sourceBufferDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); - targetAggDataTypes = (MPI_Datatype *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Datatype)); - if (!bufTypeIsContig) { - int k; - for (k=targetAggsForMyDataFirstOffLenIndex[roundIter][aggIter];k<=targetAggsForMyDataLastOffLenIndex[roundIter][aggIter];k++) - amountOfDataWrittenThisRoundAgg += len_list[k]; - -#ifdef onesidedtrace - printf("derivedTypePackedSourceBuffer mallocing %ld\n",amountOfDataWrittenThisRoundAgg); -#endif - if (amountOfDataWrittenThisRoundAgg > 0) - derivedTypePackedSourceBuffer = (char *)ADIOI_Malloc(amountOfDataWrittenThisRoundAgg * sizeof(char)); - else - derivedTypePackedSourceBuffer = NULL; - } - allocatedDerivedTypeArrays = 1; - } - } - - /* Determine the offset into the target window. - */ - MPI_Aint targetDisplacementToUseThisRound = (MPI_Aint) (offsetStart - currentRoundFDStartForMyTargetAgg); - - /* If using the thread writer select the appropriate side of the split window. - */ - if (useIOBuffer && (write_buf == write_buf1)) { - targetDisplacementToUseThisRound += (MPI_Aint) coll_bufsize; - } - - /* For gpfsmpio_write_aggmethod of 1 do the mpi_put using the primitive MPI_BYTE type for each contiguous - * chunk in the target, of source data is non-contiguous then pack the data first. - */ - - if (gpfsmpio_write_aggmethod == 1) { - MPI_Win_lock(MPI_LOCK_SHARED, targetAggsForMyData[aggIter], 0, write_buf_window); - if (bufTypeIsContig) { - MPI_Put(((char*)buf) + currentFDSourceBufferState[aggIter].sourceBufferOffset,bufferAmountToSend, MPI_BYTE,targetAggsForMyData[aggIter],targetDisplacementToUseThisRound, bufferAmountToSend,MPI_BYTE,write_buf_window); - currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToSend; - } - else { - char *putSourceData = (char *) ADIOI_Malloc(bufferAmountToSend*sizeof(char)); - nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, bufferAmountToSend, 1, ¤tFDSourceBufferState[aggIter], putSourceData); - MPI_Put(putSourceData,bufferAmountToSend, MPI_BYTE,targetAggsForMyData[aggIter],targetDisplacementToUseThisRound, bufferAmountToSend,MPI_BYTE,write_buf_window); - ADIOI_Free(putSourceData); - } - MPI_Win_unlock(targetAggsForMyData[aggIter], write_buf_window); - } - - /* For gpfsmpio_write_aggmethod of 2 populate the data structures for this round/agg for this offset iter - * to be used subsequently when building the derived type for 1 mpi_put for all the data for this - * round/agg. - */ - else if (gpfsmpio_write_aggmethod == 2) { - - if (bufTypeIsContig) { - targetAggBlockLengths[targetAggContigAccessCount]= bufferAmountToSend; - targetAggDataTypes[targetAggContigAccessCount] = MPI_BYTE; - targetAggDisplacements[targetAggContigAccessCount] = targetDisplacementToUseThisRound; - sourceBufferDisplacements[targetAggContigAccessCount] = (MPI_Aint)currentFDSourceBufferState[aggIter].sourceBufferOffset; - currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToSend; - targetAggContigAccessCount++; - } - else { - nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, bufferAmountToSend, 1, ¤tFDSourceBufferState[aggIter], &derivedTypePackedSourceBuffer[derivedTypePackedSourceBufferOffset]); - targetAggBlockLengths[targetAggContigAccessCount]= bufferAmountToSend; - targetAggDataTypes[targetAggContigAccessCount] = MPI_BYTE; - targetAggDisplacements[targetAggContigAccessCount] = targetDisplacementToUseThisRound; - sourceBufferDisplacements[targetAggContigAccessCount] = (MPI_Aint)derivedTypePackedSourceBufferOffset; - targetAggContigAccessCount++; - derivedTypePackedSourceBufferOffset += (ADIO_Offset)bufferAmountToSend; - } - } -#ifdef onesidedtrace - printf("roundIter %d bufferAmountToSend is %d offsetStart is %ld currentRoundFDStartForMyTargetAgg is %ld targetDisplacementToUseThisRound is %ld targetAggsForMyDataFDStart[aggIter] is %ld\n",roundIter, bufferAmountToSend, offsetStart,currentRoundFDStartForMyTargetAgg,targetDisplacementToUseThisRound,targetAggsForMyDataFDStart[aggIter]); -#endif - - } // bufferAmountToSend > 0 - } // contig list - - /* For gpfsmpio_write_aggmethod of 2 now build the derived type using the data from this round/agg and do 1 single mpi_put. - */ - if (gpfsmpio_write_aggmethod == 2) { - - MPI_Datatype sourceBufferDerivedDataType, targetBufferDerivedDataType; - MPI_Type_create_struct(targetAggContigAccessCount, targetAggBlockLengths, sourceBufferDisplacements, targetAggDataTypes, &sourceBufferDerivedDataType); - MPI_Type_commit(&sourceBufferDerivedDataType); - MPI_Type_create_struct(targetAggContigAccessCount, targetAggBlockLengths, targetAggDisplacements, targetAggDataTypes, &targetBufferDerivedDataType); - MPI_Type_commit(&targetBufferDerivedDataType); - -#ifdef onesidedtrace - printf("mpi_put of derived type to agg %d targetAggContigAccessCount is %d\n",targetAggsForMyData[aggIter],targetAggContigAccessCount); -#endif - if (targetAggContigAccessCount > 0) { - MPI_Win_lock(MPI_LOCK_SHARED, targetAggsForMyData[aggIter], 0, write_buf_window); - if (bufTypeIsContig) { - MPI_Put(((char*)buf),1, sourceBufferDerivedDataType,targetAggsForMyData[aggIter],0, 1,targetBufferDerivedDataType,write_buf_window); - } - else { - MPI_Put(derivedTypePackedSourceBuffer,1, sourceBufferDerivedDataType,targetAggsForMyData[aggIter],0, 1,targetBufferDerivedDataType,write_buf_window); - } - - - MPI_Win_unlock(targetAggsForMyData[aggIter], write_buf_window); - } - - if (allocatedDerivedTypeArrays) { - ADIOI_Free(targetAggBlockLengths); - ADIOI_Free(targetAggDisplacements); - ADIOI_Free(targetAggDataTypes); - ADIOI_Free(sourceBufferDisplacements); - if (!bufTypeIsContig) - if (derivedTypePackedSourceBuffer != NULL) - ADIOI_Free(derivedTypePackedSourceBuffer); - } - if (targetAggContigAccessCount > 0) { - MPI_Type_free(&sourceBufferDerivedDataType); - MPI_Type_free(&targetBufferDerivedDataType); - } - } - if (!gpfsmpio_onesided_no_rmw) { - MPI_Win_lock(MPI_LOCK_SHARED, targetAggsForMyData[aggIter], 0, fd->io_buf_put_amounts_window); - MPI_Put(&numBytesPutThisAggRound,1, MPI_INT,targetAggsForMyData[aggIter],myrank, 1,MPI_INT,fd->io_buf_put_amounts_window); - MPI_Win_unlock(targetAggsForMyData[aggIter], fd->io_buf_put_amounts_window); - } - } // baseoffset != -1 - } // target aggs - } /// contig_access_count > 0 - -#ifdef onesidedtrace -printf("first barrier roundIter %d\n",roundIter); -#endif - MPI_Barrier(fd->comm); - - if (iAmUsedAgg) { - /* Determine what offsets define the portion of the file domain the agg is writing this round. - */ - if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { - if (myAggRank == greatestFileDomainAggRank) { - if (fd_end[myAggRank] > lastFileOffset) - currentRoundFDEnd = lastFileOffset; - else - currentRoundFDEnd = fd_end[myAggRank]; - } - else - currentRoundFDEnd = fd_end[myAggRank]; - } - else - currentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; - -#ifdef onesidedtrace - printf("used agg about to writecontig - currentRoundFDStart is %ld currentRoundFDEnd is %ld within file domeain %ld to %ld\n",currentRoundFDStart,currentRoundFDEnd,fd_start[myAggRank],fd_end[myAggRank]); -#endif - - int doWriteContig = 1; - if (!gpfsmpio_onesided_no_rmw) { - int numBytesPutIntoBuf = 0; - for (i=0;i lastFileOffset) - tmpCurrentRoundFDEnd = lastFileOffset; - else - tmpCurrentRoundFDEnd = fd_end[myAggRank]; - } - else - tmpCurrentRoundFDEnd = fd_end[myAggRank]; - } - else - tmpCurrentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; -#ifdef onesidedtrace -printf("gpfsmpio_onesided_always_rmw - round %d buffer pre-read for file offsets %ld to %ld total is %d\n",roundIter, currentRoundFDStart,tmpCurrentRoundFDEnd,(int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1); -#endif - ADIO_ReadContig(fd, write_buf, (int)(tmpCurrentRoundFDEnd - currentRoundFDStart)+1, - MPI_BYTE, ADIO_EXPLICIT_OFFSET,currentRoundFDStart, &status, error_code); - - } - } - - if (roundIter<(numberOfRounds-1)) { -#ifdef onesidedtrace -printf("second barrier roundIter %d\n",roundIter); -#endif - MPI_Barrier(fd->comm); - } - - } /* for-loop roundIter */ - - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH] += (endTimeBase-startTimeBase); -#endif - - if (useIOBuffer) { /* thread writer cleanup */ - - if ( !pthread_equal(io_thread, pthread_self()) ) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - } - - } - -#ifdef onesidedtrace -printf("freeing datastructures\n"); -#endif - ADIOI_Free(targetAggsForMyData); - ADIOI_Free(targetAggsForMyDataFDStart); - ADIOI_Free(targetAggsForMyDataFDEnd); - - for (i=0;i 0) - lenListOverZero = 1; - - *error_code = MPI_SUCCESS; /* initialize to success */ - -#ifdef ROMIO_GPFS - double startTimeBase,endTimeBase; - startTimeBase = MPI_Wtime(); -#endif - - MPI_Status status; - pthread_t io_thread; - void *thread_ret; - ADIOI_IO_ThreadFuncData io_thread_args; - - int nprocs,myrank; - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - -#ifdef onesidedtrace -printf("ADIOI_OneSidedReadAggregation started on rank %d\n",myrank); -#endif - - if (fd->io_buf_window == MPI_WIN_NULL || - fd->io_buf_put_amounts_window == MPI_WIN_NULL) - { - ADIOI_OneSidedSetup(fd, nprocs); - } - /* This flag denotes whether the source datatype is contiguus, which is referenced throughout the algorithm - * and defines how the source buffer offsets and data chunks are determined. If the value is 1 (true - contiguous data) - * things are profoundly simpler in that the source buffer offset for a given source offset simply linearly increases - * by the chunk sizes being read. If the value is 0 (non-contiguous) then these values are based on calculations - * from the flattened source datatype. - */ - int bufTypeIsContig; - - MPI_Aint bufTypeExtent, lb; - ADIOI_Flatlist_node *flatBuf=NULL; - ADIOI_Datatype_iscontig(datatype, &bufTypeIsContig); - - if (!bufTypeIsContig) { - /* Flatten the non-contiguous source datatype. - */ - flatBuf = ADIOI_Flatten_and_find(datatype); - MPI_Type_get_extent(datatype, &lb, &bufTypeExtent); -#ifdef onesidedtrace - printf("flatBuf->count is %d bufTypeExtent is %d\n", flatBuf->count,bufTypeExtent); - for (i=0;icount;i++) - printf("flatBuf->blocklens[%d] is %d flatBuf->indices[%d] is %ld\n",i,flatBuf->blocklens[i],i,flatBuf->indices[i]); -#endif - } -#ifdef onesidedtrace - printf("ADIOI_OneSidedReadAggregation bufTypeIsContig is %d contig_access_count is %d\n",bufTypeIsContig,contig_access_count); -#endif - - int naggs = fd->hints->cb_nodes; - - /* Track the state of the source buffer for feeding the target data blocks. - * For GPFS the number of file domains per agg is always 1 so we just need 1 agg - * dimension to track the data, in the case of lustre we will need 2 dimensions - * agg and file domain since aggs write to multiple file domains in the - * case of lustre. - * This structure will be modified as the data is written to reflect the - * current state of the offset. - */ - -#ifdef onesidedtrace - printf("sizeof(FDSourceBufferState) is %d - make sure is 32 for 32-byte memalign optimal\n",sizeof(FDSourceBufferState)); -#endif - FDSourceBufferState *currentFDSourceBufferState; - - currentFDSourceBufferState = (FDSourceBufferState *) ADIOI_Malloc(naggs * sizeof(FDSourceBufferState)); - for (i=0;ihints->ranklist */ - int iAmUsedAgg = 0; /* whether or not this rank is used as an aggregator. */ - - int coll_bufsize = fd->hints->cb_buffer_size; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio == 1) { - /* split buffer in half for a kind of double buffering with the threads*/ - coll_bufsize = fd->hints->cb_buffer_size/2; - } -#endif - - /* This logic defines values that are used later to determine what offsets define the portion - * of the file domain the agg is reading this round. - */ - int greatestFileDomainAggRank = -1,smallestFileDomainAggRank = -1; - ADIO_Offset greatestFileDomainOffset = 0; - ADIO_Offset smallestFileDomainOffset = lastFileOffset; - for (j=0;j greatestFileDomainOffset) { - greatestFileDomainOffset = fd_end[j]; - greatestFileDomainAggRank = j; - } - if (fd_start[j] < smallestFileDomainOffset) { - smallestFileDomainOffset = fd_start[j]; - smallestFileDomainAggRank = j; - } - if (fd->hints->ranklist[j] == myrank) { - myAggRank = j; - if (fd_end[j] > fd_start[j]) { - iAmUsedAgg = 1; - } - } - } - -#ifdef onesidedtrace - printf("contig_access_count is %d lastFileOffset is %ld firstFileOffset is %ld\n",contig_access_count,lastFileOffset,firstFileOffset); - for (j=0;j numberOfRounds) - numberOfRounds = currentNumberOfRounds; - } - - /* Data structures to track what data this compute needs to receive from whom. - * For lustre they will all need another dimension for the file domain. - */ int *sourceAggsForMyData = (int *)ADIOI_Malloc(naggs * sizeof(int)); - ADIO_Offset *sourceAggsForMyDataFDStart = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - ADIO_Offset *sourceAggsForMyDataFDEnd = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - int numSourceAggs = 0; - - /* This data structure holds the beginning offset and len list index for the range to be read - * coresponding to the round and source agg. Initialize to -1 to denote being unset. - */ - int **sourceAggsForMyDataFirstOffLenIndex = (int **)ADIOI_Malloc(numberOfRounds * sizeof(int *)); - for (i=0;ihints->ranklist[%d]is %d fd_start is %ld fd_end is %ld\n",i,fd->hints->ranklist[i],fd_start[i],fd_end[i]); - for (j=0;j 0) && (buf != NULL) && lenListOverZero) { - int blockIter; - for (blockIter=0;blockIter0) { - if (bufTypeIsContig) { - currentRecvBufferOffset += len_list[blockIter-1]; - } - else { - /* Non-contiguous source datatype, count up the extents and indices to this point - * in the blocks. - */ - ADIO_Offset sourceBlockTotal = 0; - int lastIndiceUsed = currentFlatBufIndice; - int numNonContigSourceChunks = 0; - while (sourceBlockTotal < len_list[blockIter-1]) { - numNonContigSourceChunks++; - sourceBlockTotal += (flatBuf->blocklens[currentFlatBufIndice] - currentIndiceOffset); - lastIndiceUsed = currentFlatBufIndice; - currentFlatBufIndice++; - if (currentFlatBufIndice == flatBuf->count) { - currentFlatBufIndice = 0; - currentDataTypeExtent++; - } - currentIndiceOffset = (ADIO_Offset)0; - } - if (sourceBlockTotal > len_list[blockIter-1]) { - currentFlatBufIndice--; - if (currentFlatBufIndice < 0 ) { - currentDataTypeExtent--; - currentFlatBufIndice = flatBuf->count-1; - } - currentIndiceOffset = len_list[blockIter-1] - (sourceBlockTotal - flatBuf->blocklens[lastIndiceUsed]); - // ADIOI_Assert((currentIndiceOffset >= 0) && (currentIndiceOffset < flatBuf->blocklens[currentFlatBufIndice])); - } - else - currentIndiceOffset = 0; - maxNumContigOperations += (numNonContigSourceChunks+2); - if (numNonContigSourceChunks > maxNumNonContigSourceChunks) - maxNumNonContigSourceChunks = numNonContigSourceChunks; - -#ifdef onesidedtrace - printf("block iter %d currentFlatBufIndice is now %d currentDataTypeExtent is now %d currentIndiceOffset is now %ld maxNumContigOperations is now %d\n",blockIter,currentFlatBufIndice,currentDataTypeExtent,currentIndiceOffset,maxNumContigOperations); -#endif - } // !bufTypeIsContig - } // blockIter > 0 - - /* For the last iteration we need to include these maxNumContigOperations and maxNumNonContigSourceChunks - * for non-contig case even though we did not need to compute the next starting offset. - */ - if ((blockIter == (contig_access_count-1)) && (!bufTypeIsContig)) { - ADIO_Offset sourceBlockTotal = 0; - int tmpCurrentFlatBufIndice = currentFlatBufIndice; - int lastNumNonContigSourceChunks = 0; - while (sourceBlockTotal < len_list[blockIter]) { - lastNumNonContigSourceChunks++; - sourceBlockTotal += flatBuf->blocklens[tmpCurrentFlatBufIndice]; - tmpCurrentFlatBufIndice++; - if (tmpCurrentFlatBufIndice == flatBuf->count) { - tmpCurrentFlatBufIndice = 0; - } - } - maxNumContigOperations += (lastNumNonContigSourceChunks+2); - if (lastNumNonContigSourceChunks > maxNumNonContigSourceChunks) - maxNumNonContigSourceChunks = lastNumNonContigSourceChunks; - - } - - ADIO_Offset blockStart = offset_list[blockIter], blockEnd = offset_list[blockIter]+len_list[blockIter]-(ADIO_Offset)1; - - /* Find the starting source agg for this block - normally it will be the current agg so guard the expensive - * while loop with a cheap if-check which for large numbers of small blocks will usually be false. - */ - if (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) { - while (!((blockStart >= fd_start[currentAggRankListIndex]) && (blockStart <= fd_end[currentAggRankListIndex]))) - currentAggRankListIndex++; - }; - - /* Determine if this is a new source agg. - */ - if (blockIter>0) { - if ((offset_list[blockIter-1]+len_list[blockIter-1]-(ADIO_Offset)1) < fd_start[currentAggRankListIndex]) - numSourceAggs++; - } - - /* Determine which round to start reading. - */ - if ((blockStart - fd_start[currentAggRankListIndex]) >= coll_bufsize) { - ADIO_Offset currentRoundBlockStart = fd_start[currentAggRankListIndex]; - int startingRound = 0; - while (blockStart > (currentRoundBlockStart + coll_bufsize - (ADIO_Offset)1)) { - currentRoundBlockStart+=coll_bufsize; - startingRound++; - } - sourceAggsForMyDataCurrentRoundIter[numSourceAggs] = startingRound; - } - - /* Initialize the data structures if this is the first offset in the round/source agg. - */ - if (sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] == -1) { - sourceAggsForMyData[numSourceAggs] = fd->hints->ranklist[currentAggRankListIndex]; - sourceAggsForMyDataFDStart[numSourceAggs] = fd_start[currentAggRankListIndex]; - /* Round up file domain to the first actual offset used if this is the first file domain. - */ - if (currentAggRankListIndex == smallestFileDomainAggRank) { - if (sourceAggsForMyDataFDStart[numSourceAggs] < firstFileOffset) - sourceAggsForMyDataFDStart[numSourceAggs] = firstFileOffset; - } - sourceAggsForMyDataFDEnd[numSourceAggs] = fd_end[currentAggRankListIndex]; - /* Round down file domain to the last actual offset used if this is the last file domain. - */ - if (currentAggRankListIndex == greatestFileDomainAggRank) { - if (sourceAggsForMyDataFDEnd[numSourceAggs] > lastFileOffset) - sourceAggsForMyDataFDEnd[numSourceAggs] = lastFileOffset; - } - sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; - - /* Set the source buffer state starting point for data access for this agg and file domain. - */ - if (bufTypeIsContig) { - if (currentFDSourceBufferState[numSourceAggs].sourceBufferOffset == -1) { - - currentFDSourceBufferState[numSourceAggs].sourceBufferOffset = currentRecvBufferOffset; -#ifdef onesidedtrace - printf("For agg %d sourceBufferOffset initialized to %ld\n",currentAggRankListIndex,currentRecvBufferOffset); -#endif - } - } - else { - if (currentFDSourceBufferState[numSourceAggs].indiceOffset == -1) { - currentFDSourceBufferState[numSourceAggs].indiceOffset = currentIndiceOffset; - currentFDSourceBufferState[numSourceAggs].bufTypeExtent = bufTypeExtent; - currentFDSourceBufferState[numSourceAggs].dataTypeExtent = currentDataTypeExtent; - currentFDSourceBufferState[numSourceAggs].flatBufIndice = currentFlatBufIndice; -#ifdef onesidedtrace - printf("For agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld\n",numSourceAggs,currentDataTypeExtent,currentFlatBufIndice,currentIndiceOffset); -#endif - } - } - intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + ((ADIO_Offset)(sourceAggsForMyDataCurrentRoundIter[numSourceAggs]+1) * coll_bufsize); -#ifdef onesidedtrace - printf("init settings numSourceAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld currentRecvBufferOffset set to %ld intraRoundCollBufsizeOffset set to %ld\n",numSourceAggs,blockIter,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter],currentRecvBufferOffset,intraRoundCollBufsizeOffset); -#endif - - } - - /* Replace the last offset block iter with this one. - */ - sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; - - /* If this blocks extends into the next file domain advance to the next source aggs and source buffer states. - */ - if (blockEnd > fd_end[currentAggRankListIndex]) { -#ifdef onesidedtrace - printf("block extends past current fd, blockEnd %ld >= fd_end[currentAggRankListIndex] %ld total block size is %ld blockStart was %ld\n",blockEnd,fd_end[currentAggRankListIndex], len_list[blockIter],blockStart); -#endif - ADIO_Offset amountToAdvanceSBOffsetForFD = 0; - int additionalFDCounter = 0; - while (blockEnd >= fd_end[currentAggRankListIndex]) { - ADIO_Offset thisAggBlockEnd = fd_end[currentAggRankListIndex]; - if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { - while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) { - sourceAggsForMyDataCurrentRoundIter[numSourceAggs]++; - intraRoundCollBufsizeOffset += coll_bufsize; - sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; - sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; -#ifdef onesidedtrace - printf("sourceAggsForMyDataCurrentRoundI%d] is now %d intraRoundCollBufsizeOffset is now %ld\n",numSourceAggs,sourceAggsForMyDataCurrentRoundIter[numSourceAggs],intraRoundCollBufsizeOffset); -#endif - } // while (thisAggBlockEnd >= intraRoundCollBufsizeOffset) - } // if (thisAggBlockEnd >= intraRoundCollBufsizeOffset) - - int prevAggRankListIndex = currentAggRankListIndex; - currentAggRankListIndex++; - - /* Skip over unused aggs. - */ - if (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) { - while (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) - currentAggRankListIndex++; - - } // (fd_start[currentAggRankListIndex] > fd_end[currentAggRankListIndex]) - - /* Start new source agg. - */ - if (blockEnd >= fd_start[currentAggRankListIndex]) { - numSourceAggs++; - sourceAggsForMyData[numSourceAggs] = fd->hints->ranklist[currentAggRankListIndex]; - sourceAggsForMyDataFDStart[numSourceAggs] = fd_start[currentAggRankListIndex]; - /* Round up file domain to the first actual offset used if this is the first file domain. - */ - if (currentAggRankListIndex == smallestFileDomainAggRank) { - if (sourceAggsForMyDataFDStart[numSourceAggs] < firstFileOffset) - sourceAggsForMyDataFDStart[numSourceAggs] = firstFileOffset; - } - sourceAggsForMyDataFDEnd[numSourceAggs] = fd_end[currentAggRankListIndex]; - /* Round down file domain to the last actual offset used if this is the last file domain. - */ - if (currentAggRankListIndex == greatestFileDomainAggRank) { - if (sourceAggsForMyDataFDEnd[numSourceAggs] > lastFileOffset) - sourceAggsForMyDataFDEnd[numSourceAggs] = lastFileOffset; - } - sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; - - - /* For the first additonal file domain the source buffer offset - * will be incremented relative to the state of this first main - * loop but for subsequent full file domains the offset will be - * incremented by the size of the file domain. - */ - if (additionalFDCounter == 0) - amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex] - blockStart) + (ADIO_Offset)1; - else - amountToAdvanceSBOffsetForFD = (fd_end[prevAggRankListIndex]-fd_start[prevAggRankListIndex]) +(ADIO_Offset)1; - - if (bufTypeIsContig) { - ADIOI_Assert(numSourceAggs > 0); - if (currentFDSourceBufferState[numSourceAggs].sourceBufferOffset == -1) { - if (additionalFDCounter == 0) { // first file domain, still use the current data counter - currentFDSourceBufferState[numSourceAggs].sourceBufferOffset = currentRecvBufferOffset+amountToAdvanceSBOffsetForFD; - } - else { // 2nd file domain, advance full file domain from last source buffer state - currentFDSourceBufferState[numSourceAggs].sourceBufferOffset = currentFDSourceBufferState[numSourceAggs-1].sourceBufferOffset+amountToAdvanceSBOffsetForFD; - } - -#ifdef onesidedtrace - printf("Crossed into new FD - for agg %d sourceBufferOffset initialized to %ld amountToAdvanceSBOffsetForFD is %ld\n",numSourceAggs,currentFDSourceBufferState[numSourceAggs].sourceBufferOffset,amountToAdvanceSBOffsetForFD); -#endif - } - } - else if (currentFDSourceBufferState[numSourceAggs].indiceOffset == -1) { - // non-contiguos source buffer - ADIOI_Assert(numSourceAggs > 0); - - /* Initialize the source buffer state appropriately and then - * advance it with the nonContigSourceDataBufferAdvance function. - */ - if (additionalFDCounter == 0) { - // first file domain, still use the current data counter - currentFDSourceBufferState[numSourceAggs].indiceOffset = currentIndiceOffset; - currentFDSourceBufferState[numSourceAggs].bufTypeExtent = bufTypeExtent; - currentFDSourceBufferState[numSourceAggs].dataTypeExtent = currentDataTypeExtent; - currentFDSourceBufferState[numSourceAggs].flatBufIndice = currentFlatBufIndice; - } - else { - // 2nd file domain, advance full file domain from last source - // buffer state - currentFDSourceBufferState[numSourceAggs].indiceOffset = currentFDSourceBufferState[numSourceAggs-1].indiceOffset; - currentFDSourceBufferState[numSourceAggs].bufTypeExtent = currentFDSourceBufferState[numSourceAggs-1].bufTypeExtent; - currentFDSourceBufferState[numSourceAggs].dataTypeExtent = currentFDSourceBufferState[numSourceAggs-1].dataTypeExtent; - currentFDSourceBufferState[numSourceAggs].flatBufIndice = currentFDSourceBufferState[numSourceAggs-1].flatBufIndice; - } - nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, (int)amountToAdvanceSBOffsetForFD, 0, ¤tFDSourceBufferState[numSourceAggs], NULL); -#ifdef onesidedtrace - printf("Crossed into new FD - for agg %d dataTypeExtent initialized to %d flatBufIndice to %d indiceOffset to %ld amountToAdvanceSBOffsetForFD is %d\n",numSourceAggs,currentFDSourceBufferState[numSourceAggs].dataTypeExtent,currentFDSourceBufferState[numSourceAggs].flatBufIndice,currentFDSourceBufferState[numSourceAggs].indiceOffset,amountToAdvanceSBOffsetForFD); -#endif - } - - additionalFDCounter++; - - -#ifdef onesidedtrace - printf("block extended beyond fd init settings numSourceAggs %d offset_list[%d] with value %ld past fd border %ld with len %ld\n",numSourceAggs,i,offset_list[blockIter],fd_start[currentAggRankListIndex],len_list[blockIter]); -#endif - intraRoundCollBufsizeOffset = fd_start[currentAggRankListIndex] + coll_bufsize; - sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; - } // if (blockEnd >= fd_start[currentAggRankListIndex]) - } // while (blockEnd >= fd_end[currentAggRankListIndex]) - } // if (blockEnd > fd_end[currentAggRankListIndex]) - - /* If we are still in the same file domain / source agg but have gone past the coll_bufsize and need - * to advance to the next round handle this situation. - */ - if (blockEnd >= intraRoundCollBufsizeOffset) { - ADIO_Offset currentBlockEnd = blockEnd; - while (currentBlockEnd >= intraRoundCollBufsizeOffset) { - sourceAggsForMyDataCurrentRoundIter[numSourceAggs]++; - intraRoundCollBufsizeOffset += coll_bufsize; - sourceAggsForMyDataFirstOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; - sourceAggsForMyDataLastOffLenIndex[sourceAggsForMyDataCurrentRoundIter[numSourceAggs]][numSourceAggs] = blockIter; -#ifdef onesidedtrace - printf("block less than fd currentBlockEnd is now %ld intraRoundCollBufsizeOffset is now %ld sourceAggsForMyDataCurrentRoundIter[%d] is now %d\n",currentBlockEnd, intraRoundCollBufsizeOffset, numSourceAggs,sourceAggsForMyDataCurrentRoundIter[numSourceAggs]); -#endif - } // while (currentBlockEnd >= intraRoundCollBufsizeOffset) - } // if (blockEnd >= intraRoundCollBufsizeOffset) - - /* Need to advance numSourceAggs if this is the last source offset to - * include this one. - */ - if (blockIter == (contig_access_count-1)) - numSourceAggs++; - } - -#ifdef onesidedtrace - printf("numSourceAggs is %d\n",numSourceAggs); - for (i=0;i 0) && (buf != NULL) && lenListOverZero) - - ADIOI_Free(sourceAggsForMyDataCurrentRoundIter); - - /* use the two-phase buffer allocated in the file_open - no app should ever - * be both reading and reading at the same time */ - char *read_buf0 = fd->io_buf; - char *read_buf1 = fd->io_buf + coll_bufsize; - /* if threaded i/o selected, we'll do a kind of double buffering */ - char *read_buf = read_buf0; - - int currentReadBuf = 0; - int useIOBuffer = 0; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio && (numberOfRounds>1)) { - useIOBuffer = 1; - io_thread = pthread_self(); - } -#endif - - MPI_Win read_buf_window = fd->io_buf_window; - - ADIO_Offset currentRoundFDStart = 0, nextRoundFDStart = 0; - ADIO_Offset currentRoundFDEnd = 0, nextRoundFDEnd = 0; - - if (iAmUsedAgg) { - currentRoundFDStart = fd_start[myAggRank]; - nextRoundFDStart = fd_start[myAggRank]; - if (myAggRank == smallestFileDomainAggRank) { - if (currentRoundFDStart < firstFileOffset) - currentRoundFDStart = firstFileOffset; - if (nextRoundFDStart < firstFileOffset) - nextRoundFDStart = firstFileOffset; - } - else if (myAggRank == greatestFileDomainAggRank) { - if (currentRoundFDEnd > lastFileOffset) - currentRoundFDEnd = lastFileOffset; - if (nextRoundFDEnd > lastFileOffset) - nextRoundFDEnd = lastFileOffset; - } -#ifdef onesidedtrace -printf("iAmUsedAgg - currentRoundFDStart initialized " - "to %ld currentRoundFDEnd to %ld\n", - currentRoundFDStart,currentRoundFDEnd); -#endif - - - } - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_SETUP] += (endTimeBase-startTimeBase); - startTimeBase = MPI_Wtime(); -#endif - - - /* This is the second main loop of the algorithm, actually nested loop of target aggs within rounds. There are 2 flavors of this. - * For gpfsmpio_read_aggmethod of 1 each nested iteration for the source agg does an mpi_put on a contiguous chunk using a primative datatype - * determined using the data structures from the first main loop. For gpfsmpio_read_aggmethod of 2 each nested iteration for the source agg - * builds up data to use in created a derived data type for 1 mpi_put that is done for the target agg for each round. - * To support lustre there will need to be an additional layer of nesting for the multiple file domains - * within target aggs. - */ - int roundIter; - for (roundIter=0;roundIter 0) && (buf != NULL) && lenListOverZero) - { - /* determine what offsets define the portion of the file domain the agg is reading this round */ - if (iAmUsedAgg) { - - currentRoundFDStart = nextRoundFDStart; - - if (!useIOBuffer || (roundIter == 0)) { - int amountDataToReadThisRound; - if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { - currentRoundFDEnd = fd_end[myAggRank]; - amountDataToReadThisRound = ((currentRoundFDEnd-currentRoundFDStart)+1); - } - else { - currentRoundFDEnd = currentRoundFDStart + coll_bufsize - (ADIO_Offset)1; - amountDataToReadThisRound = coll_bufsize; - } - - /* read currentRoundFDEnd bytes */ - ADIO_ReadContig(fd, read_buf,amountDataToReadThisRound, - MPI_BYTE, ADIO_EXPLICIT_OFFSET, currentRoundFDStart, - &status, error_code); - currentReadBuf = 1; - - } - if (useIOBuffer) { /* use the thread reader for the next round */ - /* switch back and forth between the read buffers so that the data aggregation code is diseminating 1 buffer while the thread is reading into the other */ - - if (roundIter > 0) - currentRoundFDEnd = nextRoundFDEnd; - - if (roundIter < (numberOfRounds-1)) { - nextRoundFDStart += coll_bufsize; - int amountDataToReadNextRound; - if ((fd_end[myAggRank] - nextRoundFDStart) < coll_bufsize) { - nextRoundFDEnd = fd_end[myAggRank]; - amountDataToReadNextRound = ((nextRoundFDEnd-nextRoundFDStart)+1); - } - else { - nextRoundFDEnd = nextRoundFDStart + coll_bufsize - (ADIO_Offset)1; - amountDataToReadNextRound = coll_bufsize; - } - - if(!pthread_equal(io_thread, pthread_self())) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - if (*error_code != MPI_SUCCESS) return; - io_thread = pthread_self(); - - } - io_thread_args.fd = fd; - /* do a little pointer shuffling: background I/O works from one - * buffer while two-phase machinery fills up another */ - - if (currentReadBuf == 0) { - io_thread_args.buf = read_buf0; - currentReadBuf = 1; - read_buf = read_buf1; - } - else { - io_thread_args.buf = read_buf1; - currentReadBuf = 0; - read_buf = read_buf0; - } - io_thread_args.io_kind = ADIOI_READ; - io_thread_args.size = amountDataToReadNextRound; - io_thread_args.offset = nextRoundFDStart; - io_thread_args.status = &status; - io_thread_args.error_code = *error_code; - if ( (pthread_create(&io_thread, NULL, - ADIOI_IO_Thread_Func, &(io_thread_args))) != 0) - io_thread = pthread_self(); - - } - else { /* last round */ - - if(!pthread_equal(io_thread, pthread_self())) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - if (*error_code != MPI_SUCCESS) return; - io_thread = pthread_self(); - - } - if (currentReadBuf == 0) { - read_buf = read_buf0; - } - else { - read_buf = read_buf1; - } - - } - } /* useIOBuffer */ - } /* IAmUsedAgg */ - else if (useIOBuffer) { - if (roundIter < (numberOfRounds-1)) { - if (currentReadBuf == 0) { - currentReadBuf = 1; - read_buf = read_buf1; - } - else { - currentReadBuf = 0; - read_buf = read_buf0; - } - } - else { - if (currentReadBuf == 0) { - read_buf = read_buf0; - } - else { - read_buf = read_buf1; - } - } - - } - // wait until the read buffers are full before we start pulling from the source procs - MPI_Barrier(fd->comm); - - int aggIter; - for (aggIter=0;aggIter sourceAggsForMyDataFDEnd[aggIter]) - currentRoundFDEndForMySourceAgg = sourceAggsForMyDataFDEnd[aggIter]; - - ADIO_Offset offsetStart = offset_list[offsetIter], offsetEnd = (offset_list[offsetIter]+len_list[offsetIter]-(ADIO_Offset)1); - - /* Determine the amount of data and exact source buffer offsets to use. - */ - int bufferAmountToRecv = 0; - - if ((offsetStart >= currentRoundFDStartForMySourceAgg) && (offsetStart <= currentRoundFDEndForMySourceAgg)) { - if (offsetEnd > currentRoundFDEndForMySourceAgg) - bufferAmountToRecv = (currentRoundFDEndForMySourceAgg - offsetStart) +1; - else - bufferAmountToRecv = (offsetEnd - offsetStart) +1; - } - else if ((offsetEnd >= currentRoundFDStartForMySourceAgg) && (offsetEnd <= currentRoundFDEndForMySourceAgg)) { - if (offsetEnd > currentRoundFDEndForMySourceAgg) - bufferAmountToRecv = (currentRoundFDEndForMySourceAgg - currentRoundFDStartForMySourceAgg) +1; - else - bufferAmountToRecv = (offsetEnd - currentRoundFDStartForMySourceAgg) +1; - if (offsetStart < currentRoundFDStartForMySourceAgg) { - offsetStart = currentRoundFDStartForMySourceAgg; - } - } - else if ((offsetStart <= currentRoundFDStartForMySourceAgg) && (offsetEnd >= currentRoundFDEndForMySourceAgg)) { - bufferAmountToRecv = (currentRoundFDEndForMySourceAgg - currentRoundFDStartForMySourceAgg) +1; - offsetStart = currentRoundFDStartForMySourceAgg; - } - - if (bufferAmountToRecv > 0) { /* we have data to recv this round */ - if (gpfsmpio_read_aggmethod == 2) { - /* Only allocate these arrays if we are using method 2 and only do it once for this round/source agg. - */ - if (!allocatedDerivedTypeArrays) { - sourceAggBlockLengths = (int *)ADIOI_Malloc(maxNumContigOperations * sizeof(int)); - sourceAggDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); - recvBufferDisplacements = (MPI_Aint *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Aint)); - sourceAggDataTypes = (MPI_Datatype *)ADIOI_Malloc(maxNumContigOperations * sizeof(MPI_Datatype)); - if (!bufTypeIsContig) { - int k; - for (k=sourceAggsForMyDataFirstOffLenIndex[roundIter][aggIter];k<=sourceAggsForMyDataLastOffLenIndex[roundIter][aggIter];k++) - amountOfDataReadThisRoundAgg += len_list[k]; - -#ifdef onesidedtrace - printf("derivedTypePackedSourceBuffer mallocing %ld\n",amountOfDataReadThisRoundAgg); -#endif - if (amountOfDataReadThisRoundAgg > 0) - derivedTypePackedSourceBuffer = (char *)ADIOI_Malloc(amountOfDataReadThisRoundAgg * sizeof(char)); - else - derivedTypePackedSourceBuffer = NULL; - } - allocatedDerivedTypeArrays = 1; - } - } - - /* Determine the offset into the source window. - */ - MPI_Aint sourceDisplacementToUseThisRound = (MPI_Aint) (offsetStart - currentRoundFDStartForMySourceAgg); - - /* If using the thread reader select the appropriate side of the split window. - */ - if (useIOBuffer && (read_buf == read_buf1)) { - sourceDisplacementToUseThisRound += (MPI_Aint)coll_bufsize; - } - - /* For gpfsmpio_read_aggmethod of 1 do the mpi_get using the primitive MPI_BYTE type from each - * contiguous chunk from the target, if the source is non-contiguous then unpack the data after - * the MPI_Win_unlock is done to make sure the data has arrived first. - */ - if (gpfsmpio_read_aggmethod == 1) { - MPI_Win_lock(MPI_LOCK_SHARED, sourceAggsForMyData[aggIter], 0, read_buf_window); - char *getSourceData = NULL; - if (bufTypeIsContig) { - MPI_Get(((char*)buf) + currentFDSourceBufferState[aggIter].sourceBufferOffset,bufferAmountToRecv, MPI_BYTE,sourceAggsForMyData[aggIter],sourceDisplacementToUseThisRound, bufferAmountToRecv,MPI_BYTE,read_buf_window); - currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToRecv; - - } - else { - getSourceData = (char *) ADIOI_Malloc(bufferAmountToRecv*sizeof(char)); - MPI_Get(getSourceData,bufferAmountToRecv, MPI_BYTE,sourceAggsForMyData[aggIter],sourceDisplacementToUseThisRound, bufferAmountToRecv,MPI_BYTE,read_buf_window); - - } - MPI_Win_unlock(sourceAggsForMyData[aggIter], read_buf_window); - if (!bufTypeIsContig) { - nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, bufferAmountToRecv, 0, ¤tFDSourceBufferState[aggIter], getSourceData); - ADIOI_Free(getSourceData); - } - } - - /* For gpfsmpio_read_aggmethod of 2 populate the data structures for this round/agg for this offset iter - * to be used subsequently when building the derived type for 1 mpi_put for all the data for this - * round/agg. - */ - else if (gpfsmpio_read_aggmethod == 2) { - if (bufTypeIsContig) { - sourceAggBlockLengths[sourceAggContigAccessCount]= bufferAmountToRecv; - sourceAggDataTypes[sourceAggContigAccessCount] = MPI_BYTE; - sourceAggDisplacements[sourceAggContigAccessCount] = sourceDisplacementToUseThisRound; - recvBufferDisplacements[sourceAggContigAccessCount] = (MPI_Aint)currentFDSourceBufferState[aggIter].sourceBufferOffset; - currentFDSourceBufferState[aggIter].sourceBufferOffset += (ADIO_Offset)bufferAmountToRecv; - sourceAggContigAccessCount++; - } - else { - sourceAggBlockLengths[sourceAggContigAccessCount]= bufferAmountToRecv; - sourceAggDataTypes[sourceAggContigAccessCount] = MPI_BYTE; - sourceAggDisplacements[sourceAggContigAccessCount] = sourceDisplacementToUseThisRound; - recvBufferDisplacements[sourceAggContigAccessCount] = (MPI_Aint)derivedTypePackedSourceBufferOffset; - derivedTypePackedSourceBufferOffset += (ADIO_Offset)bufferAmountToRecv; - sourceAggContigAccessCount++; - } - } - } // bufferAmountToRecv > 0 - } // contig list - - /* For gpfsmpio_read_aggmethod of 2 now build the derived type using the data from this round/agg and do 1 single mpi_put. - */ - if (gpfsmpio_read_aggmethod == 2) { - MPI_Datatype recvBufferDerivedDataType, sourceBufferDerivedDataType; - - MPI_Type_create_struct(sourceAggContigAccessCount, sourceAggBlockLengths, recvBufferDisplacements, sourceAggDataTypes, &recvBufferDerivedDataType); - MPI_Type_commit(&recvBufferDerivedDataType); - MPI_Type_create_struct(sourceAggContigAccessCount, sourceAggBlockLengths, sourceAggDisplacements, sourceAggDataTypes, &sourceBufferDerivedDataType); - MPI_Type_commit(&sourceBufferDerivedDataType); - - if (sourceAggContigAccessCount > 0) { - - MPI_Win_lock(MPI_LOCK_SHARED, sourceAggsForMyData[aggIter], 0, read_buf_window); - if (bufTypeIsContig) { - MPI_Get(((char*)buf),1, recvBufferDerivedDataType,sourceAggsForMyData[aggIter],0, 1,sourceBufferDerivedDataType,read_buf_window); - } - else { - MPI_Get(derivedTypePackedSourceBuffer,1, recvBufferDerivedDataType,sourceAggsForMyData[aggIter],0, 1,sourceBufferDerivedDataType,read_buf_window); - } - - MPI_Win_unlock(sourceAggsForMyData[aggIter], read_buf_window); - if (!bufTypeIsContig) { - nonContigSourceDataBufferAdvance(((char*)buf), flatBuf, derivedTypePackedSourceBufferOffset, 0, ¤tFDSourceBufferState[aggIter], derivedTypePackedSourceBuffer); - } - } - - if (allocatedDerivedTypeArrays) { - ADIOI_Free(sourceAggBlockLengths); - ADIOI_Free(sourceAggDisplacements); - ADIOI_Free(sourceAggDataTypes); - ADIOI_Free(recvBufferDisplacements); - if (!bufTypeIsContig) - if (derivedTypePackedSourceBuffer != NULL) - ADIOI_Free(derivedTypePackedSourceBuffer); - } - if (sourceAggContigAccessCount > 0) { - MPI_Type_free(&recvBufferDerivedDataType); - MPI_Type_free(&sourceBufferDerivedDataType); - } - } - } // baseoffset != -1 - } // source aggs - } // contig_access_count > 0 - /* the source procs recv the requested data to the aggs */ - - MPI_Barrier(fd->comm); - - nextRoundFDStart = currentRoundFDStart + coll_bufsize; - - } /* for-loop roundIter */ - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH] += (endTimeBase-startTimeBase); -#endif - - if (useIOBuffer) { /* thread readr cleanup */ - - if ( !pthread_equal(io_thread, pthread_self()) ) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - } - - } - - ADIOI_Free(sourceAggsForMyData); - ADIOI_Free(sourceAggsForMyDataFDStart); - ADIOI_Free(sourceAggsForMyDataFDEnd); - - for (i=0;i - -/* #define p2pcontigtrace 1 */ - -void ADIOI_P2PContigWriteAggregation(ADIO_File fd, - const void *buf, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offsets, - ADIO_Offset *fd_start, - ADIO_Offset* fd_end) -{ - - *error_code = MPI_SUCCESS; /* initialize to success */ - -#ifdef ROMIO_GPFS - double startTimeBase,endTimeBase; -#endif - - MPI_Status status; - pthread_t io_thread; - void *thread_ret; - ADIOI_IO_ThreadFuncData io_thread_args; - - int nprocs,myrank; - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - - ADIO_Offset myOffsetStart = st_offsets[myrank], myOffsetEnd = end_offsets[myrank]; - - int myAggRank = -1; /* if I am an aggregor this is my index into fd->hints->ranklist */ - int iAmUsedAgg = 0; - -#ifdef ROMIO_GPFS - startTimeBase = MPI_Wtime(); -#endif - - int naggs = fd->hints->cb_nodes; - int coll_bufsize = fd->hints->cb_buffer_size; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio == 1) { - /* split buffer in half for a kind of double buffering with the threads*/ - coll_bufsize = fd->hints->cb_buffer_size/2; - } -#endif - - int j; - for (j=0;jhints->ranklist[j] == myrank) { - myAggRank = j; - if (fd_end[j] > fd_start[j]) { - iAmUsedAgg = 1; - } - } - } - - /* Determine how much data and to whom I need to send. For source proc - * targets, also determine the target file domain offsets locally to - * reduce communication overhead */ - int *targetAggsForMyData = (int *)ADIOI_Malloc(naggs * sizeof(int)); - ADIO_Offset *targetAggsForMyDataFDStart = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - ADIO_Offset *targetAggsForMyDataFDEnd = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - int numTargetAggs = 0; - int i; - for (i=0;i= fd_start[i]) && (myOffsetStart <= fd_end[i])) || ((myOffsetEnd >= fd_start[i]) && (myOffsetEnd <= fd_end[i]))) { - targetAggsForMyData[numTargetAggs] = fd->hints->ranklist[i]; - targetAggsForMyDataFDStart[numTargetAggs] = fd_start[i]; - targetAggsForMyDataFDEnd[numTargetAggs] = fd_end[i]; - numTargetAggs++; - } - } - - /* these 3 arrays track info on the procs that feed an aggregtor */ - int *sourceProcsForMyData=NULL; - int *remainingDataAmountToGetPerProc=NULL; - ADIO_Offset *remainingDataOffsetToGetPerProc=NULL; - - int numSourceProcs = 0; - - if (iAmUsedAgg) { /* for the used aggregators figure out how much data I - need from what procs */ - - /* count numSourceProcs so we know how large to make the arrays */ - for (i=0;i= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) || ((end_offsets[i] >= fd_start[myAggRank]) && (end_offsets[i] <= fd_end[myAggRank]))) - numSourceProcs++; - - sourceProcsForMyData = (int *)ADIOI_Malloc(numSourceProcs * sizeof(int)); - remainingDataAmountToGetPerProc = (int *)ADIOI_Malloc(numSourceProcs * sizeof(int)); - remainingDataOffsetToGetPerProc = (ADIO_Offset *)ADIOI_Malloc(numSourceProcs * sizeof(ADIO_Offset)); - - /* everybody has the st_offsets and end_offsets for all ranks so if I am a - * used aggregator go thru them and figure out which ranks have data that - * falls into my file domain assigned to me */ - numSourceProcs = 0; - for (i=0;i= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) || ((end_offsets[i] >= fd_start[myAggRank]) && (end_offsets[i] <= fd_end[myAggRank]))) { - sourceProcsForMyData[numSourceProcs] = i; - if ( ((st_offsets[i] >= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) && ((end_offsets[i] >= fd_start[myAggRank]) && (end_offsets[i] <= fd_end[myAggRank]))) { - remainingDataAmountToGetPerProc[numSourceProcs] = (end_offsets[i] - st_offsets[i])+1; - remainingDataOffsetToGetPerProc[numSourceProcs] = st_offsets[i]; - } - else if ((st_offsets[i] >= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) {/* starts in this fd and goes past it */ - remainingDataAmountToGetPerProc[numSourceProcs] = (fd_end[myAggRank] - st_offsets[i]) +1; - remainingDataOffsetToGetPerProc[numSourceProcs] = st_offsets[i]; - } - else { /* starts in fd before this and ends in it */ - remainingDataAmountToGetPerProc[numSourceProcs] = (end_offsets[i] - fd_start[myAggRank]) +1; - remainingDataOffsetToGetPerProc[numSourceProcs] = fd_start[myAggRank]; - } -#ifdef p2pcontigtrace - printf("getting %ld bytes from source proc %d in fd rank %d with borders %ld to %ld\n",remainingDataAmountToGetPerProc[numSourceProcs],i,fd->hints->ranklist[myAggRank],fd_start[myAggRank],fd_end[myAggRank]); -#endif - numSourceProcs++; - } - } - } - - int *amountOfDataReqestedByTargetAgg = (int *)ADIOI_Malloc(naggs * sizeof(int)); - for (i=0;iio_buf; - char *write_buf1 = fd->io_buf + coll_bufsize; - - /* start off pointing to the first buffer. If we use the 2nd buffer (threaded - * case) we'll swap later */ - char *write_buf = write_buf0; - - /* compute number of rounds */ - ADIO_Offset numberOfRounds = (ADIO_Offset)((((ADIO_Offset)(end_offsets[nprocs-1]-st_offsets[0]))/((ADIO_Offset)((ADIO_Offset)coll_bufsize*(ADIO_Offset)naggs)))) + 1; - - int currentWriteBuf = 0; - int useIOBuffer = 0; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio && (numberOfRounds>1)) { - useIOBuffer = 1; - io_thread = pthread_self(); - } -#endif - - ADIO_Offset currentRoundFDStart = 0; - ADIO_Offset currentRoundFDEnd = 0; - - if (iAmUsedAgg) { - currentRoundFDStart = fd_start[myAggRank]; - } - - int *dataSizeGottenThisRoundPerProc = (int *)ADIOI_Malloc(numSourceProcs * sizeof(int)); - int *mpiRequestMapPerProc = (int *)ADIOI_Malloc(numSourceProcs * sizeof(int)); - int *targetAggIndexesForMyDataThisRound = (int *)ADIOI_Malloc(numTargetAggs * sizeof(int)); - int *sendBufferOffsetsThisRound = (int *)ADIOI_Malloc(numTargetAggs * sizeof(int)); - int *bufferAmountsToSendThisRound = (int *)ADIOI_Malloc(numTargetAggs * sizeof(int)); - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_MYREQ] += (endTimeBase-startTimeBase); - startTimeBase = MPI_Wtime(); -#endif - - /* each iteration of this loop writes a coll_bufsize portion of the file - * domain */ - int roundIter; - for (roundIter=0;roundIter= targetAggsForMyDataFDStart[i]) && (myOffsetStart <= targetAggsForMyDataFDEnd[i])) || - ((myOffsetEnd >= targetAggsForMyDataFDStart[i]) && (myOffsetEnd <= targetAggsForMyDataFDEnd[i]))) { - /* we know that we need to send data to this target agg at some point, now need to figure out how much this round */ - - /* here are the offsets currently being collected by the aggregator during this round */ - ADIO_Offset currentRoundFDStartForMyTargetAgg = (ADIO_Offset)((ADIO_Offset)targetAggsForMyDataFDStart[i] + (ADIO_Offset)((ADIO_Offset)roundIter*(ADIO_Offset)coll_bufsize)); - ADIO_Offset currentRoundFDEndForMyTargetAgg = (ADIO_Offset)((ADIO_Offset)targetAggsForMyDataFDStart[i] + (ADIO_Offset)((ADIO_Offset)(roundIter+1)*(ADIO_Offset)coll_bufsize) - (ADIO_Offset)1); - if (currentRoundFDEndForMyTargetAgg > targetAggsForMyDataFDEnd[i]) - currentRoundFDEndForMyTargetAgg = targetAggsForMyDataFDEnd[i]; - -#ifdef p2pcontigtrace - printf("roundIter %d target iter %d targetAggsForMyData is %d myOffsetStart is %ld myOffsetEnd is %ld targetAggsForMyDataFDStart is %ld targetAggsForMyDataFDEnd is %ld currentRoundFDStartForMyTargetAgg is %ld currentRoundFDEndForMyTargetAgg is %ld\n", - roundIter,i,targetAggsForMyData[i],myOffsetStart,myOffsetEnd, - targetAggsForMyDataFDStart[i],targetAggsForMyDataFDEnd[i], - currentRoundFDStartForMyTargetAgg,currentRoundFDEndForMyTargetAgg); -#endif - - /* send the portion of my data that is within - * currentRoundFDStartForMyTargetAgg to - * currentRoundFDEndForMyTargetAgg */ - /* find the offset into the send buffer and the amount - * of data to send */ - int sendBufferOffset = 0; - int bufferAmountToSend = 0; - - if ((myOffsetStart >= currentRoundFDStartForMyTargetAgg) && (myOffsetStart <= currentRoundFDEndForMyTargetAgg)) { - if (myOffsetEnd > currentRoundFDEndForMyTargetAgg) - bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - myOffsetStart) +1; - else - bufferAmountToSend = (myOffsetEnd - myOffsetStart) +1; - } - else if ((myOffsetEnd >= currentRoundFDStartForMyTargetAgg) && (myOffsetEnd <= currentRoundFDEndForMyTargetAgg)) { - sendBufferOffset = (int) (currentRoundFDStartForMyTargetAgg - myOffsetStart); - if (myOffsetEnd > currentRoundFDEndForMyTargetAgg) - bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - currentRoundFDStartForMyTargetAgg) +1; - else - bufferAmountToSend = (myOffsetEnd - currentRoundFDStartForMyTargetAgg) +1; - } - else if ((myOffsetStart <= currentRoundFDStartForMyTargetAgg) && (myOffsetEnd >= currentRoundFDEndForMyTargetAgg)) { - sendBufferOffset = (int) (currentRoundFDStartForMyTargetAgg - myOffsetStart); - bufferAmountToSend = (currentRoundFDEndForMyTargetAgg - currentRoundFDStartForMyTargetAgg) +1; - } - - if (bufferAmountToSend > 0) { /* we have data to send this round */ - targetAggIndexesForMyDataThisRound[numTargetAggsThisRound] = i; - sendBufferOffsetsThisRound[numTargetAggsThisRound] = sendBufferOffset; - bufferAmountsToSendThisRound[numTargetAggsThisRound] = bufferAmountToSend; -#ifdef p2pcontigtrace - printf("bufferAmountToSend is %d sendBufferOffset is %d\n",bufferAmountToSend,sendBufferOffset); -#endif - /* only need to be pinged by the agg for rounds after the first one - for the first one just - * send the data without being pinged */ - if (roundIter > 0) - MPI_Irecv(&amountOfDataReqestedByTargetAgg[numTargetAggsThisRound],1, - MPI_INT,targetAggsForMyData[i],0, - fd->comm,&mpiSizeToSendRequest[numTargetAggsThisRound]); - numTargetAggsThisRound++; - - } - } - } - - /* determine what offsets define the portion of the file domain the agg is writing this round */ - if (iAmUsedAgg) { - if ((fd_end[myAggRank] - currentRoundFDStart) < coll_bufsize) { - currentRoundFDEnd = fd_end[myAggRank]; - } - else - currentRoundFDEnd = currentRoundFDStart + coll_bufsize - 1; -#ifdef p2pcontigtrace - printf("currentRoundFDStart is %ld currentRoundFDEnd is %ld within file domeain %ld to %ld\n",currentRoundFDStart,currentRoundFDEnd,fd_start[myAggRank],fd_end[myAggRank]); -#endif - } - - int irecv,isend; - int numSourceProcsSentData = 0; - - /* the aggs send the amount of data they need to their source procs */ - for (i=0;i= currentRoundFDStart) && (remainingDataOffsetToGetPerProc[i] <= currentRoundFDEnd)) { - if ((remainingDataOffsetToGetPerProc[i] + remainingDataAmountToGetPerProc[i]) <= currentRoundFDEnd) - dataSizeGottenThisRoundPerProc[i] = remainingDataAmountToGetPerProc[i]; - else - dataSizeGottenThisRoundPerProc[i] = (currentRoundFDEnd - remainingDataOffsetToGetPerProc[i]) +1; - } - else if (((remainingDataOffsetToGetPerProc[i]+remainingDataAmountToGetPerProc[i]) >= currentRoundFDStart) && ((remainingDataOffsetToGetPerProc[i]+remainingDataAmountToGetPerProc[i]) <= currentRoundFDEnd)) { - if ((remainingDataOffsetToGetPerProc[i]) >= currentRoundFDStart) - dataSizeGottenThisRoundPerProc[i] = remainingDataAmountToGetPerProc[i]; - else - dataSizeGottenThisRoundPerProc[i] = (remainingDataOffsetToGetPerProc[i]-currentRoundFDStart) +1; - } - else - dataSizeGottenThisRoundPerProc[i] = 0; - -#ifdef p2pcontigtrace - printf("dataSizeGottenThisRoundPerProc[%d] set to %d - remainingDataOffsetToGetPerProc is %d remainingDataAmountToGetPerProc is %d currentRoundFDStart is %d currentRoundFDEnd is %d\n",i,dataSizeGottenThisRoundPerProc[i],remainingDataOffsetToGetPerProc[i],remainingDataAmountToGetPerProc[i],currentRoundFDStart,currentRoundFDEnd); -#endif - if (dataSizeGottenThisRoundPerProc[i] > 0) { - if (roundIter > 0) { - MPI_Isend(&dataSizeGottenThisRoundPerProc[i],1,MPI_INT, - sourceProcsForMyData[i],0,fd->comm, - &mpiSendDataSizeRequest[numSourceProcsSentData]); - numSourceProcsSentData++; - } - } - } - - int numDataSendToWaitFor = 0; - /* the source procs send the requested data to the aggs */ - for (i = 0; i < numTargetAggsThisRound; i++) { - - /* the source procs aren't pinged by the target aggs on the first round */ - if (roundIter > 0) { - - MPI_Waitany(numTargetAggsThisRound,mpiSizeToSendRequest, - &irecv,&mpiWaitAnyStatusFromTargetAggs); - -#ifdef p2pcontigtrace - printf("irecv is %d amountOfDataReqestedByTargetAgg is %d bufferAmountsToSendThisRound is %d sendBufferOffsetsThisRound is %d targetAggsForMyData is %d\n",irecv,amountOfDataReqestedByTargetAgg[irecv], bufferAmountsToSendThisRound[irecv], sendBufferOffsetsThisRound[irecv],targetAggsForMyData[targetAggIndexesForMyDataThisRound[irecv]]); -#endif - ADIOI_Assert(amountOfDataReqestedByTargetAgg[irecv] == bufferAmountsToSendThisRound[irecv]); - MPI_Isend(&((char*)buf)[sendBufferOffsetsThisRound[irecv]], - bufferAmountsToSendThisRound[irecv],MPI_BYTE, - targetAggsForMyData[targetAggIndexesForMyDataThisRound[irecv]], - 0,fd->comm,&mpiSendDataToTargetAggRequest[irecv]); - - } - else { -#ifdef p2pcontigtrace - printf("i is %d bufferAmountsToSendThisRound is %d sendBufferOffsetsThisRound is %d targetAggsForMyData is %d\n",i, bufferAmountsToSendThisRound[i], sendBufferOffsetsThisRound[i],targetAggsForMyData[targetAggIndexesForMyDataThisRound[i]]); -#endif - MPI_Isend(&((char*)buf)[sendBufferOffsetsThisRound[i]],bufferAmountsToSendThisRound[i],MPI_BYTE, - targetAggsForMyData[targetAggIndexesForMyDataThisRound[i]],0,fd->comm,&mpiSendDataToTargetAggRequest[i]); - } - numDataSendToWaitFor++; - } - -#ifdef ROMIO_GPFS - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH_SETUP] += (endTimeBase-startTimeBase); - startTimeBase = MPI_Wtime(); -#endif - - /* the aggs receive the data from the source procs */ - int numDataRecvToWaitFor = 0; - for (i=0;i 0 count data */ - if (dataSizeGottenThisRoundPerProc[i] > 0) { -#ifdef p2pcontigtrace - printf("receiving data from rank %d dataSizeGottenThisRoundPerProc is %d currentWBOffset is %d\n",sourceProcsForMyData[i],dataSizeGottenThisRoundPerProc[i],currentWBOffset); -#endif - MPI_Irecv(&((char*)write_buf)[currentWBOffset],dataSizeGottenThisRoundPerProc[i], - MPI_BYTE,sourceProcsForMyData[i],0, - fd->comm,&mpiRecvDataRequest[numDataRecvToWaitFor]); - mpiRequestMapPerProc[numDataRecvToWaitFor] = i; - numDataRecvToWaitFor++; - } - -#ifdef p2pcontigtrace - printf("MPI_Irecv from rank %d\n",targetAggsForMyData[i]); -#endif - } - - int totalDataReceivedThisRound = 0; - for (i = 0; i < numDataRecvToWaitFor; i++) { - MPI_Waitany(numDataRecvToWaitFor,mpiRecvDataRequest, - &irecv,&mpiWaitAnyStatusFromSourceProcs); - totalDataReceivedThisRound += - dataSizeGottenThisRoundPerProc[mpiRequestMapPerProc[irecv]]; - totalAmountDataReceived += - dataSizeGottenThisRoundPerProc[mpiRequestMapPerProc[irecv]]; - -#ifdef p2pcontigtrace - printf("numDataRecvToWaitFor is %d was sent %d bytes data for %d remaining bytes from rank %d irecv index %d\n",numDataRecvToWaitFor,dataSizeGottenThisRoundPerProc[mpiRequestMapPerProc[irecv]],remainingDataAmountToGetPerProc[mpiRequestMapPerProc[irecv]],sourceProcsForMyData[mpiRequestMapPerProc[irecv]],irecv); -#endif - remainingDataAmountToGetPerProc[mpiRequestMapPerProc[irecv]] -= - dataSizeGottenThisRoundPerProc[mpiRequestMapPerProc[irecv]]; - remainingDataOffsetToGetPerProc[mpiRequestMapPerProc[irecv]] += - dataSizeGottenThisRoundPerProc[mpiRequestMapPerProc[irecv]]; - - } - - /* clean up the MPI_Request object for the MPI_Isend which told the - * source procs how much data to send */ - for (i=0;i 0) { - -#ifdef p2pcontigtrace - printf("totalDataReceivedThisRound is %d\n",totalDataReceivedThisRound); -#endif - if (!useIOBuffer) { - - ADIO_WriteContig(fd, write_buf, (int)totalDataReceivedThisRound, - MPI_BYTE, ADIO_EXPLICIT_OFFSET, - currentRoundFDStart, &status, error_code); - } else { /* use the thread writer */ - - if(!pthread_equal(io_thread, pthread_self())) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - if (*error_code != MPI_SUCCESS) return; - io_thread = pthread_self(); - - } - io_thread_args.fd = fd; - /* do a little pointer shuffling: background I/O works from one - * buffer while two-phase machinery fills up another */ - - if (currentWriteBuf == 0) { - io_thread_args.buf = write_buf0; - currentWriteBuf = 1; - write_buf = write_buf1; - } - else { - io_thread_args.buf = write_buf1; - currentWriteBuf = 0; - write_buf = write_buf0; - } - io_thread_args.io_kind = ADIOI_WRITE; - io_thread_args.size = totalDataReceivedThisRound; - io_thread_args.offset = currentRoundFDStart; - io_thread_args.status = &status; - io_thread_args.error_code = *error_code; - if ( (pthread_create(&io_thread, NULL, - ADIOI_IO_Thread_Func, &(io_thread_args))) != 0) - io_thread = pthread_self(); - - } - - } /* numDataRecvToWaitFor > 0 */ - - if (iAmUsedAgg) - currentRoundFDStart += coll_bufsize; - for (i = 0; i < numDataSendToWaitFor; i++) { - MPI_Wait(&mpiSendDataToTargetAggRequest[i], - &mpiIsendStatusForData); - } - - } /* for-loop roundIter */ - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_DEXCH] += (endTimeBase-startTimeBase); -#endif - - if (useIOBuffer) { /* thread writer cleanup */ - - if ( !pthread_equal(io_thread, pthread_self()) ) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - } - - } - - - - if (iAmUsedAgg) { - ADIOI_Free(sourceProcsForMyData); - ADIOI_Free(remainingDataAmountToGetPerProc); - ADIOI_Free(remainingDataOffsetToGetPerProc); - } - - ADIOI_Free(targetAggsForMyData); - ADIOI_Free(targetAggsForMyDataFDStart); - ADIOI_Free(targetAggsForMyDataFDEnd); - ADIOI_Free(targetAggIndexesForMyDataThisRound); - ADIOI_Free(sendBufferOffsetsThisRound); - ADIOI_Free(bufferAmountsToSendThisRound); - ADIOI_Free(amountOfDataReqestedByTargetAgg); - ADIOI_Free(mpiSizeToSendRequest); - ADIOI_Free(mpiRecvDataRequest); - ADIOI_Free(mpiSendDataSizeRequest); - ADIOI_Free(mpiSendDataToTargetAggRequest); - ADIOI_Free(dataSizeGottenThisRoundPerProc); - ADIOI_Free(mpiRequestMapPerProc); - - /* TODO: still need a barrier here? */ - MPI_Barrier(fd->comm); - return; -} - -void ADIOI_P2PContigReadAggregation(ADIO_File fd, - const void *buf, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offsets, - ADIO_Offset *fd_start, - ADIO_Offset* fd_end) -{ - - *error_code = MPI_SUCCESS; /* initialize to success */ - -#ifdef ROMIO_GPFS - double startTimeBase,endTimeBase; -#endif - - MPI_Status status; - pthread_t io_thread; - void *thread_ret; - ADIOI_IO_ThreadFuncData io_thread_args; - -#ifdef ROMIO_GPFS - startTimeBase = MPI_Wtime(); -#endif - - int nprocs,myrank; - MPI_Comm_size(fd->comm, &nprocs); - MPI_Comm_rank(fd->comm, &myrank); - - ADIO_Offset myOffsetStart = st_offsets[myrank], myOffsetEnd = end_offsets[myrank]; - - int myAggRank = -1; /* if I am an aggregor this is my index into fd->hints->ranklist */ - int iAmUsedAgg = 0; - - int naggs = fd->hints->cb_nodes; - int coll_bufsize = fd->hints->cb_buffer_size; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio == 1) - /* share buffer between working threads */ - coll_bufsize = coll_bufsize/2; -#endif - - int j; - for (j=0;jhints->ranklist[j] == myrank) { - myAggRank = j; - if (fd_end[j] > fd_start[j]) { - iAmUsedAgg = 1; - } - } - } - - /* for my offset range determine how much data and from whom I need to get - * it. For source ag targets, also determine the source file domain - * offsets locally to reduce communication overhead */ - int *sourceAggsForMyData = (int *)ADIOI_Malloc(naggs * sizeof(int)); - ADIO_Offset *sourceAggsForMyDataFDStart = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - ADIO_Offset *sourceAggsForMyDataFDEnd = (ADIO_Offset *)ADIOI_Malloc(naggs * sizeof(ADIO_Offset)); - int numSourceAggs = 0; - int i; - for (i=0;i= fd_start[i]) && (myOffsetStart <= fd_end[i])) || - ((myOffsetEnd >= fd_start[i]) && (myOffsetEnd <= fd_end[i]))) { - sourceAggsForMyData[numSourceAggs] = fd->hints->ranklist[i]; - sourceAggsForMyDataFDStart[numSourceAggs] = fd_start[i]; - sourceAggsForMyDataFDEnd[numSourceAggs] = fd_end[i]; - numSourceAggs++; - } - } - - /* these 3 arrays track info on the procs that are fed from an aggregtor - - * to sacrifice some performance at setup to save on memory instead of - * using max size of nprocs for the arrays could determine exact size first - * and then allocate that size */ - int *targetProcsForMyData=NULL; - int *remainingDataAmountToSendPerProc=NULL; - ADIO_Offset *remainingDataOffsetToSendPerProc=NULL; - - int numTargetProcs = 0; - - if (iAmUsedAgg) { - /* for the used aggregators figure out how much data I need from what procs */ - - /* count numTargetProcs so we know how large to make the arrays */ - for (i=0;i= fd_start[myAggRank]) && - (st_offsets[i] <= fd_end[myAggRank])) || - ((end_offsets[i] >= fd_start[myAggRank]) && - (end_offsets[i] <= fd_end[myAggRank])) ) - numTargetProcs++; - - targetProcsForMyData = - (int *)ADIOI_Malloc(numTargetProcs * sizeof(int)); - remainingDataAmountToSendPerProc = - (int *)ADIOI_Malloc(numTargetProcs * sizeof(int)); - remainingDataOffsetToSendPerProc = - (ADIO_Offset *)ADIOI_Malloc(numTargetProcs * sizeof(ADIO_Offset)); - - /* everybody has the st_offsets and end_offsets for all ranks so if I am a - * used aggregator go thru them and figure out which ranks have data that - * falls into my file domain assigned to me */ - numTargetProcs = 0; - for (i=0;i= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) || ((end_offsets[i] >= fd_start[myAggRank]) && (end_offsets[i] <= fd_end[myAggRank]))) { - targetProcsForMyData[numTargetProcs] = i; - if ( ((st_offsets[i] >= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) && ((end_offsets[i] >= fd_start[myAggRank]) && (end_offsets[i] <= fd_end[myAggRank]))) { - remainingDataAmountToSendPerProc[numTargetProcs] = (end_offsets[i] - st_offsets[i])+1; - remainingDataOffsetToSendPerProc[numTargetProcs] = st_offsets[i]; - } - else if ((st_offsets[i] >= fd_start[myAggRank]) && (st_offsets[i] <= fd_end[myAggRank])) {/* starts in this fd and goes past it */ - remainingDataAmountToSendPerProc[numTargetProcs] = (fd_end[myAggRank] - st_offsets[i]) +1; - remainingDataOffsetToSendPerProc[numTargetProcs] = st_offsets[i]; - } - else { /* starts in fd before this and ends in it */ - remainingDataAmountToSendPerProc[numTargetProcs] = (end_offsets[i] - fd_start[myAggRank]) +1; - remainingDataOffsetToSendPerProc[numTargetProcs] = fd_start[myAggRank]; - } - numTargetProcs++; - } - } - } - - - MPI_Request *mpiRecvDataFromSourceAggsRequest = (MPI_Request *) ADIOI_Malloc(numSourceAggs * sizeof(MPI_Request)); - MPI_Request *mpiSendDataToTargetProcRequest = (MPI_Request *) ADIOI_Malloc(numTargetProcs * sizeof(MPI_Request)); - MPI_Status mpiWaitAnyStatusFromSourceProcs,mpiIsendStatusForData; - - /* use the two-phase buffer allocated in the file_open - no app should ever - * be both reading and writing at the same time */ - char *read_buf0 = fd->io_buf; - char *read_buf1 = fd->io_buf + coll_bufsize; - /* if threaded i/o selected, we'll do a kind of double buffering */ - char *read_buf = read_buf0; - - /* compute number of rounds */ - ADIO_Offset numberOfRounds = (ADIO_Offset)((((ADIO_Offset)(end_offsets[nprocs-1]-st_offsets[0]))/((ADIO_Offset)((ADIO_Offset)coll_bufsize*(ADIO_Offset)naggs)))) + 1; - - ADIO_Offset currentRoundFDStart = 0, nextRoundFDStart = 0; - ADIO_Offset currentRoundFDEnd = 0, nextRoundFDEnd = 0; - - if (iAmUsedAgg) { - currentRoundFDStart = fd_start[myAggRank]; - nextRoundFDStart = fd_start[myAggRank]; - } - - int *dataSizeSentThisRoundPerProc = (int *)ADIOI_Malloc(numTargetProcs * sizeof(int)); - int *sourceAggIndexesForMyDataThisRound = (int *)ADIOI_Malloc(numSourceAggs * sizeof(int)); - int *recvBufferOffsetsThisRound = (int *)ADIOI_Malloc(numSourceAggs * sizeof(int)); - int *bufferAmountsToGetThisRound = (int *)ADIOI_Malloc(numSourceAggs * sizeof(int)); - *error_code = MPI_SUCCESS; - - int currentReadBuf = 0; - int useIOBuffer = 0; -#ifdef ROMIO_GPFS - if (gpfsmpio_pthreadio && (numberOfRounds>1)) { - useIOBuffer = 1; - io_thread = pthread_self(); - } -#endif - -#ifdef ROMIO_GPFS - endTimeBase = MPI_Wtime(); - gpfsmpio_prof_cw[GPFSMPIO_CIO_T_MYREQ] += (endTimeBase-startTimeBase); -#endif - - - /* each iteration of this loop reads a coll_bufsize portion of the file domain */ - int roundIter; - for (roundIter=0;roundIter 0) - currentRoundFDEnd = nextRoundFDEnd; - - if (roundIter < (numberOfRounds-1)) { - nextRoundFDStart += coll_bufsize; - int amountDataToReadNextRound; - if ((fd_end[myAggRank] - nextRoundFDStart) < coll_bufsize) { - nextRoundFDEnd = fd_end[myAggRank]; - amountDataToReadNextRound = ((nextRoundFDEnd-nextRoundFDStart)+1); - } - else { - nextRoundFDEnd = nextRoundFDStart + coll_bufsize - 1; - amountDataToReadNextRound = coll_bufsize; - } - - if(!pthread_equal(io_thread, pthread_self())) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - if (*error_code != MPI_SUCCESS) return; - io_thread = pthread_self(); - - } - io_thread_args.fd = fd; - /* do a little pointer shuffling: background I/O works from one - * buffer while two-phase machinery fills up another */ - - if (currentReadBuf == 0) { - io_thread_args.buf = read_buf0; - currentReadBuf = 1; - read_buf = read_buf1; - } - else { - io_thread_args.buf = read_buf1; - currentReadBuf = 0; - read_buf = read_buf0; - } - io_thread_args.io_kind = ADIOI_READ; - io_thread_args.size = amountDataToReadNextRound; - io_thread_args.offset = nextRoundFDStart; - io_thread_args.status = &status; - io_thread_args.error_code = *error_code; - if ( (pthread_create(&io_thread, NULL, - ADIOI_IO_Thread_Func, &(io_thread_args))) != 0) - io_thread = pthread_self(); - - } - else { /* last round */ - - if(!pthread_equal(io_thread, pthread_self())) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - if (*error_code != MPI_SUCCESS) return; - io_thread = pthread_self(); - - } - if (currentReadBuf == 0) { - read_buf = read_buf1; - } - else { - read_buf = read_buf0; - } - - } - } /* useIOBuffer */ - } /* IAmUsedAgg */ - - /* determine what source aggs I need to get data from this round and - * recv only from them */ - int numSourceAggsThisRound = 0; - for (i=0;i= sourceAggsForMyDataFDStart[i]) && (myOffsetStart <= sourceAggsForMyDataFDEnd[i])) - || ((myOffsetEnd >= sourceAggsForMyDataFDStart[i]) && (myOffsetEnd <= sourceAggsForMyDataFDEnd[i])) ) { - /* we know that we need to get data from this source agg at - * some point, now need to figure out how much this round */ - - /* here are the offsets currently being sent by the aggregator - * during this round */ - ADIO_Offset currentRoundFDStartForMySourceAgg = - (ADIO_Offset)((ADIO_Offset)sourceAggsForMyDataFDStart[i] + - (ADIO_Offset)((ADIO_Offset)roundIter*(ADIO_Offset)coll_bufsize)); - ADIO_Offset currentRoundFDEndForMySourceAgg = - (ADIO_Offset)((ADIO_Offset)sourceAggsForMyDataFDStart[i] + - (ADIO_Offset)((ADIO_Offset)(roundIter+1)*(ADIO_Offset)coll_bufsize) - (ADIO_Offset)1); - if (currentRoundFDEndForMySourceAgg > sourceAggsForMyDataFDEnd[i]) - currentRoundFDEndForMySourceAgg = sourceAggsForMyDataFDEnd[i]; - -#ifdef p2pcontigtrace - printf("roundIter %d source iter %d sourceAggsForMyData is %d myOffsetStart is %ld myOffsetEnd is %ld sourceAggsForMyDataFDStart is %ld sourceAggsForMyDataFDEnd is %ld currentRoundFDStartForMySourceAgg is %ld currentRoundFDEndForMySourceAgg is %ld\n",roundIter,i,sourceAggsForMyData[i],myOffsetStart,myOffsetEnd,sourceAggsForMyDataFDStart[i],sourceAggsForMyDataFDEnd[i],currentRoundFDStartForMySourceAgg,currentRoundFDEndForMySourceAgg); -#endif - - /* get the portion of my data that is within currentRoundFDStartForMySourceAgg to currentRoundFDEndForMySourceAgg */ - /* find the offset into the recv buffer and the amount of data to get */ - int recvBufferOffset = 0; - int bufferAmountToGet = 0; - - if ((myOffsetStart >= currentRoundFDStartForMySourceAgg) && (myOffsetStart <= currentRoundFDEndForMySourceAgg)) { - if (myOffsetEnd > currentRoundFDEndForMySourceAgg) - bufferAmountToGet = (currentRoundFDEndForMySourceAgg - myOffsetStart) +1; - else - bufferAmountToGet = (myOffsetEnd - myOffsetStart) +1; - } - else if ((myOffsetEnd >= currentRoundFDStartForMySourceAgg) && (myOffsetEnd <= currentRoundFDEndForMySourceAgg)) { - recvBufferOffset = (int) (currentRoundFDStartForMySourceAgg - myOffsetStart); - if (myOffsetEnd > currentRoundFDEndForMySourceAgg) - bufferAmountToGet = (currentRoundFDEndForMySourceAgg - currentRoundFDStartForMySourceAgg) +1; - else - bufferAmountToGet = (myOffsetEnd - currentRoundFDStartForMySourceAgg) +1; - } - else if ((myOffsetStart <= currentRoundFDStartForMySourceAgg) && (myOffsetEnd >= currentRoundFDEndForMySourceAgg)) { - recvBufferOffset = (int) (currentRoundFDStartForMySourceAgg - myOffsetStart); - bufferAmountToGet = (currentRoundFDEndForMySourceAgg - currentRoundFDStartForMySourceAgg) +1; - } - - - if (bufferAmountToGet > 0) { /* we have data to get this round */ - sourceAggIndexesForMyDataThisRound[numSourceAggsThisRound] = i; - recvBufferOffsetsThisRound[numSourceAggsThisRound] = recvBufferOffset; - bufferAmountsToGetThisRound[numSourceAggsThisRound] = bufferAmountToGet; -#ifdef p2pcontigtrace - printf("bufferAmountToGet is %d recvBufferOffset is %d\n",bufferAmountToGet,recvBufferOffset); -#endif - numSourceAggsThisRound++; - } - } - } - - /* the aggs determine the amount of data they will be sending to their - * source procs */ - for (i=0;i= currentRoundFDStart) && - (remainingDataOffsetToSendPerProc[i] <= currentRoundFDEnd)) { - if ((remainingDataOffsetToSendPerProc[i] + - remainingDataAmountToSendPerProc[i]) <= currentRoundFDEnd) - dataSizeSentThisRoundPerProc[i] = remainingDataAmountToSendPerProc[i]; - else - dataSizeSentThisRoundPerProc[i] = - (currentRoundFDEnd - remainingDataOffsetToSendPerProc[i]) +1; - } - else if (((remainingDataOffsetToSendPerProc[i]+ - remainingDataAmountToSendPerProc[i]) >= - currentRoundFDStart) && - ((remainingDataOffsetToSendPerProc[i]+ - remainingDataAmountToSendPerProc[i]) <= currentRoundFDEnd)) { - if ((remainingDataOffsetToSendPerProc[i]) >= currentRoundFDStart) - dataSizeSentThisRoundPerProc[i] = remainingDataAmountToSendPerProc[i]; - else - dataSizeSentThisRoundPerProc[i] = - (remainingDataOffsetToSendPerProc[i]-currentRoundFDStart) +1; - } - else - dataSizeSentThisRoundPerProc[i] = 0; - - } - - /* the target procs get the data from the source aggs */ - for (i = 0; i < numSourceAggsThisRound; i++) { - MPI_Irecv(&((char*)buf)[recvBufferOffsetsThisRound[i]], - bufferAmountsToGetThisRound[i],MPI_BYTE, - sourceAggsForMyData[sourceAggIndexesForMyDataThisRound[i]],0,fd->comm, - &mpiRecvDataFromSourceAggsRequest[i]); - } - - /* the source aggs send the data to the target procs */ - int numTargetProcsSentThisRound = 0; - for (i=0;i 0 count data */ - if (dataSizeSentThisRoundPerProc[i] > 0) { - MPI_Isend(&((char*)read_buf)[currentWBOffset], - dataSizeSentThisRoundPerProc[i], - MPI_BYTE,targetProcsForMyData[i],0, - fd->comm,&mpiSendDataToTargetProcRequest[numTargetProcsSentThisRound]); - numTargetProcsSentThisRound++; - remainingDataAmountToSendPerProc[i] -= dataSizeSentThisRoundPerProc[i]; - remainingDataOffsetToSendPerProc[i] += dataSizeSentThisRoundPerProc[i]; - } - } - - /* wait for the target procs to get their data */ - for (i = 0; i < numSourceAggsThisRound; i++) { - MPI_Waitany(numSourceAggsThisRound,mpiRecvDataFromSourceAggsRequest, - &irecv,&mpiWaitAnyStatusFromSourceProcs); - } - - nextRoundFDStart = currentRoundFDStart + coll_bufsize; - - /* clean up the MPI_Isend MPI_Requests */ - for (i=0;icomm); /* need to sync up the source aggs which did the isend with the target procs which did the irecvs to give the target procs time to get the data before overwriting with next round readcontig */ - - } /* for-loop roundIter */ - - if (useIOBuffer) { /* thread reader cleanup */ - - if ( !pthread_equal(io_thread, pthread_self()) ) { - pthread_join(io_thread, &thread_ret); - *error_code = *(int *)thread_ret; - } - } - - if (iAmUsedAgg) { - ADIOI_Free(targetProcsForMyData); - ADIOI_Free(remainingDataAmountToSendPerProc); - ADIOI_Free(remainingDataOffsetToSendPerProc); - } - - ADIOI_Free(sourceAggsForMyData); - ADIOI_Free(sourceAggsForMyDataFDStart); - ADIOI_Free(sourceAggsForMyDataFDEnd); - - ADIOI_Free(mpiRecvDataFromSourceAggsRequest); - ADIOI_Free(mpiSendDataToTargetProcRequest); - ADIOI_Free(dataSizeSentThisRoundPerProc); - ADIOI_Free(sourceAggIndexesForMyDataThisRound); - ADIOI_Free(recvBufferOffsetsThisRound); - ADIOI_Free(bufferAmountsToGetThisRound); - - /* TODO: is Barrier here needed? */ - MPI_Barrier(fd->comm); - - return; - -} diff --git a/3rd-party/romio321/adio/common/req_malloc.c b/3rd-party/romio321/adio/common/req_malloc.c deleted file mode 100644 index 61018e1a684..00000000000 --- a/3rd-party/romio321/adio/common/req_malloc.c +++ /dev/null @@ -1,83 +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" - -struct ADIOI_RequestD *ADIOI_Malloc_request(void) -{ -/* returns a pointer to a new request object. - To reduce the number of system calls, mallocs NUM requests at a time - and maintains list of available requests. Supplies an object from this - list if available, else mallocs a new set of NUM and provides one - from that set. Is NUM=100 a good number? */ - -#define NUM 100 - - ADIOI_Req_node *curr, *ptr; - int i; - - if (!ADIOI_Req_avail_head) { - ADIOI_Req_avail_head = (ADIOI_Req_node *) - ADIOI_Malloc(NUM*sizeof(ADIOI_Req_node)); - if (ADIOI_Req_avail_head == NULL) - { - /* FIXME: Insert error here */ - return NULL; - } - curr = ADIOI_Req_avail_head; - for (i=1; inext = ADIOI_Req_avail_head+i; - curr = curr->next; - } - curr->next = NULL; - ADIOI_Req_avail_tail = curr; - - /* keep track of malloced area that needs to be freed later */ - if (!ADIOI_Malloc_req_tail) { - ADIOI_Malloc_req_tail = (ADIOI_Malloc_req *) - ADIOI_Malloc(sizeof(ADIOI_Malloc_req)); - ADIOI_Malloc_req_head = ADIOI_Malloc_req_tail; - ADIOI_Malloc_req_head->ptr = ADIOI_Req_avail_head; - ADIOI_Malloc_req_head->next = NULL; - } - else { - ADIOI_Malloc_req_tail->next = (ADIOI_Malloc_req *) - ADIOI_Malloc(sizeof(ADIOI_Malloc_req)); - ADIOI_Malloc_req_tail = ADIOI_Malloc_req_tail->next; - ADIOI_Malloc_req_tail->ptr = ADIOI_Req_avail_head; - ADIOI_Malloc_req_tail->next = NULL; - } - } - - ptr = ADIOI_Req_avail_head; - ADIOI_Req_avail_head = ADIOI_Req_avail_head->next; - if (!ADIOI_Req_avail_head) ADIOI_Req_avail_tail = NULL; - - (ptr->reqd).cookie = ADIOI_REQ_COOKIE; - return &(ptr->reqd); -} - - -void ADIOI_Free_request(ADIOI_Req_node *node) -{ -/* This function could be called as ADIOI_Free_request(ADIO_Request request), - because request would be a pointer to the first element of ADIOI_Req_node.*/ - -/* moves this node to available pool. does not actually free it. */ - - (node->reqd).cookie = 0; - - if (!ADIOI_Req_avail_tail) - ADIOI_Req_avail_head = ADIOI_Req_avail_tail = node; - else { - ADIOI_Req_avail_tail->next = node; - ADIOI_Req_avail_tail = node; - } - node->next = NULL; -} - diff --git a/3rd-party/romio321/adio/common/shfp_fname.c b/3rd-party/romio321/adio/common/shfp_fname.c deleted file mode 100644 index dfa5bafc2cf..00000000000 --- a/3rd-party/romio321/adio/common/shfp_fname.c +++ /dev/null @@ -1,102 +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" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_TIME_H -#include -#endif -/* The following function selects the name of the file to be used to - store the shared file pointer. The shared-file-pointer file is a - hidden file in the same directory as the real file being accessed. - If the real file is /tmp/thakur/testfile, the shared-file-pointer - file will be /tmp/thakur/.testfile.shfp.yyy.xxxx, where yyy - is rank 0's process id and xxxx is a random number. If the - underlying file system supports shared file pointers - (PVFS does not, for example), the file name is always - constructed. This file is created only if the shared - file pointer functions are used and is deleted when the real - file is closed. */ - -void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code) -{ - int i; - int len; - char *slash, *ptr, tmp[128]; - int pid = 0; - - fd->shared_fp_fname = (char *) ADIOI_Malloc(PATH_MAX); - - if (!rank) { - srand(time(NULL)); - i = rand(); - pid = (int)getpid(); - - if (ADIOI_Strncpy(fd->shared_fp_fname, fd->filename, PATH_MAX)) { - *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname", - fd->filename, ENAMETOOLONG); - return; - } - -#ifdef ROMIO_NTFS - slash = strrchr(fd->filename, '\\'); -#else - slash = strrchr(fd->filename, '/'); -#endif - if (!slash) { - if (ADIOI_Strncpy(fd->shared_fp_fname, ".", 2)) { - *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname", - fd->filename, ENAMETOOLONG); - return; - } - if (ADIOI_Strncpy(fd->shared_fp_fname + 1, fd->filename, PATH_MAX-1)) { - *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname", - fd->filename, ENAMETOOLONG); - return; - } - } - else { - ptr = slash; -#ifdef ROMIO_NTFS - slash = strrchr(fd->shared_fp_fname, '\\'); -#else - slash = strrchr(fd->shared_fp_fname, '/'); -#endif - if (ADIOI_Strncpy(slash + 1, ".", 2)) { - *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname", - fd->filename, ENAMETOOLONG); - return; - } - /* ok to cast: file names bounded by PATH_MAX and NAME_MAX */ - len = (int) (PATH_MAX - (slash+2 - fd->shared_fp_fname)); - if (ADIOI_Strncpy(slash + 2, ptr + 1, len)) { - *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname", - ptr + 1, ENAMETOOLONG); - return; - } - } - - ADIOI_Snprintf(tmp, 128, ".shfp.%d.%d", pid, i); - /* ADIOI_Strnapp will return non-zero if truncated. That's ok */ - ADIOI_Strnapp(fd->shared_fp_fname, tmp, PATH_MAX); - - len = (int)strlen(fd->shared_fp_fname); - MPI_Bcast(&len, 1, MPI_INT, 0, fd->comm); - MPI_Bcast(fd->shared_fp_fname, len+1, MPI_CHAR, 0, fd->comm); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, fd->comm); - MPI_Bcast(fd->shared_fp_fname, len+1, MPI_CHAR, 0, fd->comm); - } -} diff --git a/3rd-party/romio321/adio/common/status_setb.c b/3rd-party/romio321/adio/common/status_setb.c deleted file mode 100644 index ec1e4ff7f69..00000000000 --- a/3rd-party/romio321/adio/common/status_setb.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 "adio.h" -#include "mpi.h" - -#if defined(MPICH2) || (defined(MPICH) && (MPICH_NAME >= 3)) -/* Not quite correct, but much closer for MPI2 */ -/* TODO: still needs to handle partial datatypes and situations where the mpi - * implementation fills status with something other than bytes (globus2 might - * do this) */ -int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, - MPI_Count nbytes) -{ - ADIOI_UNREFERENCED_ARG(datatype); - /* it's ok that ROMIO stores number-of-bytes in status, not - * count-of-copies, as long as MPI_GET_COUNT knows what to do */ - if (status != MPI_STATUS_IGNORE) - MPI_Status_set_elements_x(status, MPI_BYTE, nbytes); - return MPI_SUCCESS; -} -#elif defined(MPILAM) || defined(MPISGI) -int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, - MPI_Count nbytes) -{ - /* Bogusness to silence compiler warnings */ - if (datatype == MPI_DATATYPE_NULL); - - if (status != MPI_STATUS_IGNORE) - status->st_length = nbytes; - return MPI_SUCCESS; -} -#endif diff --git a/3rd-party/romio321/adio/common/strfns.c b/3rd-party/romio321/adio/common/strfns.c deleted file mode 100644 index 65e5ac24e74..00000000000 --- a/3rd-party/romio321/adio/common/strfns.c +++ /dev/null @@ -1,315 +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" - -/* style: allow:sprintf:3 sig:0 */ - -/* - * Below are the "safe" versions of the various string and printf - * operations. They are directly taken from MPICH, with MPIU replaced by ADIOI. - */ - -/* - * ADIOI_Strncpy - Copy at most n character. Stop once a null is reached. - * - * This is different from strncpy, which null pads so that exactly - * n characters are copied. The strncpy behavior is correct for many - * applications because it guarantees that the string has no uninitialized - * data. - * - * If n characters are copied without reaching a null, return an error. - * Otherwise, return 0. - * - */ -/*@ ADIOI_Strncpy - Copy a string with a maximum length - -Input Parameters: -+ instr - String to copy -- maxlen - Maximum total length of 'outstr' - -Output Parameters: -. outstr - String to copy into - - Notes: - This routine is the routine that you wish 'strncpy' was. In copying - 'instr' to 'outstr', it stops when either the end of 'outstr' (the - null character) is seen or the maximum length 'maxlen' is reached. - Unlike 'strncpy', it does not add enough nulls to 'outstr' after - copying 'instr' in order to move precisely 'maxlen' characters. - Thus, this routine may be used anywhere 'strcpy' is used, without any - performance cost related to large values of 'maxlen'. - - Module: - Utility - @*/ -int ADIOI_Strncpy( char *dest, const char *src, size_t n ) -{ - char * restrict d_ptr = dest; - const char * restrict s_ptr = src; - register int i; - - i = (int)n; - while (*s_ptr && i-- > 0) { - *d_ptr++ = *s_ptr++; - } - - if (i > 0) { - *d_ptr = 0; - return 0; - } - else - /* We may want to force an error message here, at least in the - debugging version */ - return 1; -} - -/* Append src to dest, but only allow dest to contain n characters (including - any null, which is always added to the end of the line */ -/*@ ADIOI_Strnapp - Append to a string with a maximum length - -Input Parameters: -+ instr - String to copy -- maxlen - Maximum total length of 'outstr' - -Output Parameters: -. outstr - String to copy into - - Notes: - This routine is similar to 'strncat' except that the 'maxlen' argument - is the maximum total length of 'outstr', rather than the maximum - number of characters to move from 'instr'. Thus, this routine is - easier to use when the declared size of 'instr' is known. - - Module: - Utility - @*/ -int ADIOI_Strnapp( char *dest, const char *src, size_t n ) -{ - char * restrict d_ptr = dest; - const char * restrict s_ptr = src; - register int i; - - /* Get to the end of dest */ - i = (int)n; - while (i-- > 0 && *d_ptr) d_ptr++; - if (i <= 0) return 1; - - /* Append. d_ptr points at first null and i is remaining space. */ - while (*s_ptr && i-- > 0) { - *d_ptr++ = *s_ptr++; - } - - /* We allow i >= (not just >) here because the first while decrements - i by one more than there are characters, leaving room for the null */ - if (i >= 0) { - *d_ptr = 0; - return 0; - } - else { - /* Force the null at the end */ - *--d_ptr = 0; - - /* We may want to force an error message here, at least in the - debugging version */ - return 1; - } -} - -/*@ - ADIOI_Strdup - Duplicate a string - - Synopsis: -.vb - char *ADIOI_Strdup( const char *str ) -.ve - -Input Parameters: -. str - null-terminated string to duplicate - - Return value: - A pointer to a copy of the string, including the terminating null. A - null pointer is returned on error, such as out-of-memory. - - Notes: - Like 'ADIOI_Malloc' and 'ADIOI_Free', this will often be implemented as a - macro but may use 'ADIOI_trstrdup' to provide a tracing version. - - Module: - Utility - @*/ -char *ADIOI_Strdup( const char *str ) -{ - char *p = ADIOI_Malloc( strlen(str) + 1 ); - char *in_p = (char *)str; - char *save_p; - - save_p = p; - if (p) { - while (*in_p) { - *p++ = *in_p++; - } - *p = '\0'; - } - return save_p; -} - - -/* - * We need an snprintf replacement for systems without one - */ -#ifndef HAVE_SNPRINTF -#include -/* FIXME: Really need a check for varargs.h vs stdarg.h */ -#include -/* - * This is an approximate form which is suitable for most uses within - * the MPICH code - */ -int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) -{ - int n; - const char *p; - char *out_str = str; - va_list list; - - va_start(list, format); - - p = format; - while (*p && size > 0) { - char *nf; - - nf = strchr(p, '%'); - if (!nf) { - /* No more format characters */ - while (size-- > 0 && *p) { - *out_str++ = *p++; - } - } - else { - int nc; - int width = -1; - - /* Copy until nf */ - while (p < nf && size-- > 0) { - *out_str++ = *p++; - } - /* p now points at nf */ - /* Handle the format character */ - nc = nf[1]; - if (isdigit(nc)) { - /* Get the field width */ - /* FIXME : Assumes ASCII */ - width = nc - '0'; - p = nf + 2; - while (*p && isdigit(*p)) { - width = 10 * width + (*p++ - '0'); - } - /* When there is no longer a digit, get the format - character */ - nc = *p++; - } - else { - /* Skip over the format string */ - p += 2; - } - - switch (nc) { - case '%': - *out_str++ = '%'; - size--; - break; - - case 'd': - { - int val; - char tmp[20]; - char *t = tmp; - /* Get the argument, of integer type */ - val = va_arg( list, int ); - sprintf( tmp, "%d", val ); - if (width > 0) { - int tmplen = strlen(tmp); - /* If a width was specified, pad with spaces on the - left (on the right if %-3d given; not implemented yet */ - while (size-- > 0 && width-- > tmplen) - *out_str++ = ' '; - } - while (size-- > 0 && *t) { - *out_str++ = *t++; - } - } - break; - - case 'x': - { - int val; - char tmp[20]; - char *t = tmp; - /* Get the argument, of integer type */ - val = va_arg( list, int ); - sprintf( tmp, "%x", val ); - if (width > 0) { - int tmplen = strlen(tmp); - /* If a width was specified, pad with spaces on the - left (on the right if %-3d given; not implemented yet */ - while (size-- > 0 && width-- > tmplen) - *out_str++ = ' '; - } - while (size-- > 0 && *t) { - *out_str++ = *t++; - } - } - break; - - case 'p': - { - void *val; - char tmp[20]; - char *t = tmp; - val = va_arg( list, void * ); - sprintf( tmp, "%p", val ); - if (width > 0) { - int tmplen = strlen(tmp); - /* If a width was specified, pad with spaces on the - left (on the right if %-3d given; not implemented yet */ - while (size-- > 0 && width-- > tmplen) - *out_str++ = ' '; - } - while (size-- > 0 && *t) { - *out_str++ = *t++; - } - } - break; - - case 's': - { - char *s_arg; - /* Get the argument, of pointer to char type */ - s_arg = va_arg( list, char * ); - while (size-- > 0 && s_arg && *s_arg) { - *out_str++ = *s_arg++; - } - } - break; - - default: - /* Error, unknown case */ - return -1; - break; - } - } - } - - va_end(list); - - if (size-- > 0) *out_str++ = '\0'; - - n = (int)(out_str - str); - return n; -} -#endif diff --git a/3rd-party/romio321/adio/common/system_hints.c b/3rd-party/romio321/adio/common/system_hints.c deleted file mode 100644 index 1b049b1ff5b..00000000000 --- a/3rd-party/romio321/adio/common/system_hints.c +++ /dev/null @@ -1,202 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * Copyright (C) 2007 UChicago/Argonne LLC. - * See COPYRIGHT notice in top-level directory. - */ - -#include - -#include - -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_IO_H -#include -#endif - -/*#define SYSHINT_DEBUG 1 */ - -#define ROMIO_HINT_DEFAULT_CFG "/etc/romio-hints" -#define ROMIO_HINT_ENV_VAR "ROMIO_HINTS" - -/* debug function: a routine I want in the library to make my life easier when - * using a source debugger. Now optionally used in ADIO_Open. */ -void ADIOI_Info_print_keyvals(MPI_Info info) -{ - int i, nkeys, flag; - char key[MPI_MAX_INFO_KEY+1]; - char value[MPI_MAX_INFO_VAL+1]; - - if (info == MPI_INFO_NULL) - return; - - MPI_Info_get_nkeys(info, &nkeys); - - for (i=0; i \n". - * A # in collumn zero is a comment and the line will be ignored. Do our best - * to ignore badly formed lines too. - * - * The caller provides an 'info' object. Each key-value pair found by the - * parser will get added to the info object. any keys already set will be left - * alone on the assumption that the caller knows best. - * - * because MPI-IO hints are optional, we can get away with limited error - * reporting. - * - * for better scalability, the config file will be read on one processor and - * broadcast to all others */ -static int file_to_info_all(int fd, MPI_Info info, int rank, MPI_Comm comm) -{ - char *buffer, *token, *key, *val, *garbage; - char *pos1=NULL, *pos2=NULL; - int flag; - ssize_t ret; - int valuelen; - - /* assumption: config files will be small */ -#define HINTFILE_MAX_SIZE 1024*4 - buffer = (char *)ADIOI_Calloc(HINTFILE_MAX_SIZE, sizeof (char)); - - if (rank == 0) { - ret = read(fd, buffer, HINTFILE_MAX_SIZE); - /* any error: bad/nonexistent fd, no perms, anything: set up a null - * buffer and the subsequent string parsing will quit immediately */ - if (ret == -1) - buffer[0] = '\0'; - } - MPI_Bcast(buffer, HINTFILE_MAX_SIZE, MPI_BYTE, 0, comm); - - token = strtok_r(buffer, "\n", &pos1); - if (token == NULL) - goto fn_exit; - do { - if ( (key = strtok_r(token, " \t", &pos2)) == NULL) - /* malformed line: found no items */ - continue; - if (token[0] == '#') - /* ignore '#'-delimited comments */ - continue; - if ( (val = strtok_r(NULL, " \t", &pos2)) == NULL) - /* malformed line: found key without value */ - continue; - if ( (garbage = strtok_r(NULL, " \t", &pos2)) != NULL) - /* malformed line: more than two items */ - continue; - -#ifdef SYSHINT_DEBUG - printf("found: key=%s val=%s\n", key, val); -#endif - /* don't actually care what the value is. only want to know if key - * exists: we leave it alone if so*/ - ADIOI_Info_get_valuelen(info, key, &valuelen, &flag); - if (flag == 1) continue; - ADIOI_Info_set(info, key, val); - } while ((token = strtok_r(NULL, "\n", &pos1)) != NULL); - -fn_exit: - ADIOI_Free(buffer); - return 0; -} - -void ADIOI_process_system_hints(ADIO_File fd, MPI_Info info) -{ - int hintfd=-1, rank; - - MPI_Comm_rank(fd->comm, &rank); - if (rank == 0) { - hintfd = find_file(); - } - /* hintfd only significant on rank 0. -1 (on rank 0) means no hintfile found */ - file_to_info_all(hintfd, info, rank, fd->comm); - - if (hintfd != -1) - close(hintfd); -} - -/* given 'info', incorporate any hints in 'sysinfo' that are not already set - * into 'new_info'. Caller must free 'new_info' later. */ -void ADIOI_incorporate_system_hints(MPI_Info info, - MPI_Info sysinfo, - MPI_Info *new_info) -{ - int i, nkeys_sysinfo, nkeys_info=0, flag=0; /* must initialize flag to 0 */ - int valuelen; - - char val[MPI_MAX_INFO_VAL+1], key[MPI_MAX_INFO_KEY+1]; - - if (sysinfo == MPI_INFO_NULL) - nkeys_sysinfo = 0; - else - MPI_Info_get_nkeys(sysinfo, &nkeys_sysinfo); - - /* short-circuit: return immediately if no hints to process */ - if (info == MPI_INFO_NULL && nkeys_sysinfo == 0) { - *new_info = MPI_INFO_NULL; - return; - } - - if (info == MPI_INFO_NULL) - MPI_Info_create(new_info); - else { - /* tiny optimization: if 'info' has no keys, we can skip the check if a - * hint is set: no keys means nothing has been set, and there's nothing - * we might step on */ - MPI_Info_get_nkeys(info, &nkeys_info); - MPI_Info_dup(info, new_info); - } - - for (i=0; i -#include - - -/* utility function for creating large contiguous types: algorithim from BigMPI - * https://github.com/jeffhammond/BigMPI */ - -static int type_create_contiguous_x(MPI_Count count, - MPI_Datatype oldtype, MPI_Datatype *newtype) -{ - /* to make 'count' fit MPI-3 type processing routines (which take integer - * counts), we construct a type consisting of N INT_MAX chunks followed by - * a remainder. e.g for a count of 4000000000 bytes you would end up with - * one 2147483647-byte chunk followed immediately by a 1852516353-byte - * chunk */ - MPI_Datatype chunks, remainder; - MPI_Aint lb, extent, disps[2]; - int blocklens[2]; - MPI_Datatype types[2]; - - /* truly stupendously large counts will overflow an integer with this math, - * but that is a problem for a few decades from now. Sorry, few decades - * from now! */ - ADIOI_Assert(count/INT_MAX == (int)(count/INT_MAX)); - int c = (int)(count/INT_MAX); /* OK to cast until 'count' is 256 bits */ - int r = count%INT_MAX; - - MPI_Type_vector(c, INT_MAX, INT_MAX, oldtype, &chunks); - MPI_Type_contiguous(r, oldtype, &remainder); - - MPI_Type_get_extent(oldtype, &lb, &extent); - - blocklens[0] = 1; blocklens[1] = 1; - disps[0] = 0; disps[1] = c*extent*INT_MAX; - types[0] = chunks; types[1] = remainder; - - MPI_Type_create_struct(2, blocklens, disps, types, newtype); - - MPI_Type_free(&chunks); - MPI_Type_free(&remainder); - - return MPI_SUCCESS; -} -/* like MPI_Type_create_hindexed, except array_of_lengths can be a larger datatype. - * - * Hindexed provides 'count' pairs of (displacement, length), but what if - * length is longer than an integer? We will create 'count' types, using - * contig if length is small enough, or something more complex if not */ - -int ADIOI_Type_create_hindexed_x(int count, - const MPI_Count array_of_blocklengths[], - const MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) -{ - int i, ret; - MPI_Datatype *types; - int *blocklens; - int is_big=0; - - types = ADIOI_Malloc(count*sizeof(MPI_Datatype)); - blocklens = ADIOI_Malloc(count*sizeof(int)); - - /* squashing two loops into one. - * - Look in the array_of_blocklengths for any large values - * - convert MPI_Count items (if they are not too big) into int-sized items - * after this loop we will know if we can use MPI_type_hindexed or if we - * need a more complicated BigMPI-style struct-of-chunks. - * - * Why not use the struct-of-chunks in all cases? HDF5 reported a bug, - * which I have not yet precicesly nailed down, but appears to have - * something to do with struct-of-chunks when the chunks are small */ - - for(i=0; i INT_MAX) { - blocklens[i] = 1; - is_big=1; - type_create_contiguous_x(array_of_blocklengths[i], oldtype, &(types[i])); - } else { - /* OK to cast: checked for "bigness" above */ - blocklens[i] = (int)array_of_blocklengths[i]; - MPI_Type_contiguous(blocklens[i], oldtype, &(types[i])); - } - } - - if (is_big) { - ret = MPI_Type_create_struct(count, blocklens, array_of_displacements, - types, newtype); - } else { - ret = MPI_Type_create_hindexed(count, blocklens, - array_of_displacements, oldtype, newtype); - } - for (i=0; i< count; i++) - MPI_Type_free(&(types[i])); - ADIOI_Free(types); - ADIOI_Free(blocklens); - - return ret; -} - -/* some systems do not have pread/pwrite, or requrie XOPEN_SOURCE set higher - * than we would like. see #1973 */ -#if (HAVE_DECL_PWRITE == 0) - -#include -#include - -ssize_t pread(int fd, void *buf, size_t count, off_t offset); -ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); - -ssize_t pread(int fd, void *buf, size_t count, off_t offset) { - off_t lseek_ret; - off_t old_offset; - ssize_t read_ret; - - old_offset = lseek(fd, 0, SEEK_CUR); - lseek_ret = lseek(fd, offset, SEEK_SET); - if (lseek_ret == -1) - return lseek_ret; - read_ret = read(fd, buf, count); - if (read_ret < 0) - return read_ret; - /* man page says "file offset is not changed" */ - if ( (lseek_ret = lseek(fd, old_offset, SEEK_SET)) < 0) - return lseek_ret; - - return read_ret; -} - -ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) { - off_t lseek_ret; - off_t old_offset; - ssize_t write_ret; - - old_offset = lseek(fd, 0, SEEK_CUR); - lseek_ret = lseek(fd, offset, SEEK_SET); - if (lseek_ret == -1) - return lseek_ret; - write_ret = write(fd, buf, count); - if (write_ret < 0) - return write_ret; - /* man page says "file offset is not changed" */ - if ( (lseek_ret = lseek(fd, old_offset, SEEK_SET)) < 0) - return lseek_ret; - - return write_ret; -} -#endif - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/adio/include/BaseIOErrMsgs.msg b/3rd-party/romio321/adio/include/BaseIOErrMsgs.msg deleted file mode 100644 index 0ca0526619a..00000000000 --- a/3rd-party/romio321/adio/include/BaseIOErrMsgs.msg +++ /dev/null @@ -1,51 +0,0 @@ -$set 12 MPI_ERR_ARG -12 65 "Invalid offset argument" -12 67 "Null datarep argument" -12 69 "Invalid count argument" -12 71 "Invalid size argument" -12 73 "Invalid whence argument" -12 75 "flag argument must be the same on all processes" -12 77 "Invalid displacement argument" -12 79 "Invalid etype argument" -12 81 "Invalid filetype argument" -12 83 "size argument must be the same on all processes" -12 85 "offset points to a negative location in the file" -12 87 "whence argument must be the same on all processes" -12 89 "offset argument must be the same on all processes" -$set 21 MPI_ERR_AMODE -21 1 "Invalid amode" -21 3 "Exactly one of MPI_MODE_RDONLY, MPI_MODE_WRONLY, or MPI_MODE_RDWR must be specified" -21 5 "Cannot use MPI_MODE_CREATE or MPI_MODE_EXCL with MPI_MODE_RDONLY" -21 7 "Cannot specify MPI_MODE_SEQUENTIAL with MPI_MODE_RDWR" -$set 27 MPI_ERR_FILE -27 1 "Invalid file handle" -27 3 "Null file handle" -27 5 "Corrupted file handle" -$set 32 MPI_ERR_IO -32 1 "I/O Error" -32 2 "%s" 1 -32 3 "Only an integral number of etypes can be accessed" -32 5 "Can't determine the file-system type. Check the filename/path you provided and try again. Otherwise, prefix the filename with a string to indicate the type of file system (piofs:, pfs:, nfs:, ufs:, hfs:, xfs:, sfs:, pvfs:, pvfs2:, ftp:, gsiftp:)" -32 7 "ROMIO has not been configured to use the PFS file system" -32 9 "ROMIO has not been configured to use the PIOFS file system" -32 11 "ROMIO has not been configured to use the UFS file system" -32 13 "ROMIO has not been configured to use the NFS file system" -32 15 "ROMIO has not been configured to use the HFS file system" -32 17 "ROMIO has not been configured to use the XFS file system" -32 19 "ROMIO has not been configured to use the SFS file system" -32 21 "ROMIO has not been configured to use the PVFS file system" -32 23 "Only one active split collective I/O operation allowed per file handle" -32 25 "No previous split collective begin" -32 27 "There are outstanding nonblocking I/O operations on this file" -32 29 "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." -32 31 "To preallocate disk space, ROMIO needs to read the file and write it back, but is unable to read the file. Please give the file read permission and open it with MPI_MODE_RDWR." -32 33 "Filetype must be constructed out of one or more etypes" -$set 43 MPI_ERR_UNSUPPORTED_DATAREP -43 1 "Unsupported data representation" -43 3 "Only native data representation currently supported" -$set 44 MPI_ERR_UNSUPPORTED_OPERATION -44 1 "Unsupported operation" -44 3 "Shared file pointer not supported on PIOFS and PVFS" -44 5 "Cannot use this function when file is opened with amode MPI_MODE_SEQUENTIAL" -44 7 "Cannot read from a file opened with amode MPI_MODE_WRONLY" -44 9 "MPI_MODE_SEQUENTIAL not supported on PIOFS and PVFS" diff --git a/3rd-party/romio321/adio/include/adio.h b/3rd-party/romio321/adio/include/adio.h deleted file mode 100644 index fedd8f58f55..00000000000 --- a/3rd-party/romio321/adio/include/adio.h +++ /dev/null @@ -1,474 +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. - */ - -/* main include file for ADIO. - contains general definitions, declarations, and macros independent - of the underlying file system */ - -/* Functions and datataypes that are "internal" to the ADIO implementation - prefixed ADIOI_. Functions and datatypes that are part of the - "externally visible" (documented) ADIO interface are prefixed ADIO_. - - An implementation of MPI-IO, or any other high-level interface, should - not need to use any of the ADIOI_ functions/datatypes. - Only someone implementing ADIO on a new file system, or modifying - an existing ADIO implementation, would need to use the ADIOI_ - functions/datatypes. */ - -#ifndef ADIO_INCLUDE -#define ADIO_INCLUDE - -#ifdef SPPUX -#define _POSIX_SOURCE -#endif - -#ifdef USE_FORT_STDCALL -#define FORT_CALL __stdcall -#elif defined (USE_FORT_CDECL) -#define FORT_CALL __cdecl -#else -#define FORT_CALL -#endif - -#ifdef USE_FORT_MIXED_STR_LEN -#define FORT_MIXED_LEN_DECL , int -#define FORT_END_LEN_DECL -#define FORT_MIXED_LEN(a) , int a -#define FORT_END_LEN(a) -#else -#define FORT_MIXED_LEN_DECL -#define FORT_END_LEN_DECL , int -#define FORT_MIXED_LEN(a) -#define FORT_END_LEN(a) , int a -#endif - -#ifdef HAVE_FORTRAN_API -# ifdef FORTRAN_EXPORTS -# define FORTRAN_API __declspec(dllexport) -# else -# define FORTRAN_API __declspec(dllimport) -# endif -#else -# define FORTRAN_API -#endif - -/* Use this macro for each parameter to a function that is not referenced in the body of the function */ -#ifdef HAVE_WINDOWS_H -#define ADIOI_UNREFERENCED_ARG(a) a -#else -#define ADIOI_UNREFERENCED_ARG(a) -#endif - -/* Include romioconf.h if we haven't already (some include files may - need to include romioconf before some system includes) */ -#ifndef ROMIOCONF_H_INCLUDED -#include "romioconf.h" -#define ROMIOCONF_H_INCLUDED -#endif - -#include "mpi.h" -#include "mpio.h" -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#include -#include -#include -#ifdef SPPUX -#include -#endif - -#ifdef ROMIO_NTFS -#include -#include -#define FDTYPE HANDLE -#else -#define FDTYPE int -#endif - -#ifdef MPI_OFFSET_IS_INT - typedef int ADIO_Offset; - typedef unsigned ADIO_Size; -# define ADIO_OFFSET MPI_INT -#elif defined(HAVE_LONG_LONG_64) - typedef long long ADIO_Offset; - typedef unsigned long long ADIO_Size; -# ifdef HAVE_MPI_LONG_LONG_INT -# define ADIO_OFFSET MPI_LONG_LONG_INT -# else -# define ADIO_OFFSET MPI_DOUBLE -# endif -#elif defined(HAVE_INT64) - typedef __int64 ADIO_Offset; - typedef unsigned __int64 ADIO_Size; -# define ADIO_OFFSET MPI_DOUBLE -#else - typedef long ADIO_Offset; - typedef unsigned long ADIO_Size; -# define ADIO_OFFSET MPI_LONG -#endif - -#define ADIO_Status MPI_Status - -#ifndef MPIO_INCLUDE -# ifdef NEEDS_MPI_FINT - typedef int MPI_Fint; -# endif -#endif - -#if (!defined(HAVE_MPI_INFO) && !defined(MPIO_INCLUDE)) - typedef struct MPIR_Info *MPI_Info; -# define MPI_INFO_NULL 0 -# define MPI_MAX_INFO_VAL 1024 - -int MPI_Info_create(MPI_Info *info); -int MPI_Info_set(MPI_Info info, char *key, char *value); -int MPI_Info_delete(MPI_Info info, char *key); -int MPI_Info_get(MPI_Info info, char *key, int valuelen, - char *value, int *flag); -int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag); -int MPI_Info_get_nkeys(MPI_Info info, int *nkeys); -int MPI_Info_get_nthkey(MPI_Info info, int n, char *key); -int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo); -int MPI_Info_free(MPI_Info *info); - -#ifdef MPI_Info_f2c -#undef MPI_Info_f2c -#endif -#ifdef MPI_Info_c2f -#undef MPI_Info_c2f -#endif -/* above needed for some versions of mpi.h in MPICH!! */ -MPI_Fint MPI_Info_c2f(MPI_Info info); -MPI_Info MPI_Info_f2c(MPI_Fint info); - -int PMPI_Info_create(MPI_Info *info); -int PMPI_Info_set(MPI_Info info, char *key, char *value); -int PMPI_Info_delete(MPI_Info info, char *key); -int PMPI_Info_get(MPI_Info info, char *key, int valuelen, - char *value, int *flag); -int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag); -int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys); -int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key); -int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo); -int PMPI_Info_free(MPI_Info *info); - -MPI_Fint PMPI_Info_c2f(MPI_Info info); -MPI_Info PMPI_Info_f2c(MPI_Fint info); - -#endif - -/* style: allow:strdup:1 sig:0 */ - -#if defined(HAVE_STRDUP) && defined(NEEDS_STRDUP_DECL) && !defined(strdup) -char *strdup(const char *s); -# endif -#if defined(HAVE_READLINK) && defined(NEEDS_READLINK_DECL) && !defined(readlink) -ssize_t readlink(const char *path, char *buf, size_t bufsiz); -# endif -#if defined(HAVE_LSTAT) && defined(NEEDS_LSTAT_DECL) && !defined(lstat) -int lstat(const char *file_name, struct stat *buf); -# endif -#if defined(HAVE_FSYNC) && defined(NEEDS_FSYNC_DECL) && !defined(fsync) -int fsync(int fd); -# endif -#if defined(HAVE_FTRUNCATE) && defined(NEEDS_FTRUNCATE_DECL) && !defined(ftruncate) -int ftruncate(int fd, off_t length); -# endif - - -typedef struct ADIOI_Fns_struct ADIOI_Fns; -typedef struct ADIOI_Hints_struct ADIOI_Hints; - -typedef struct ADIOI_FileD { - int cookie; /* for error checking */ - FDTYPE fd_sys; /* system file descriptor */ - FDTYPE null_fd; /* the null-device file descriptor: debug only (obviously)*/ - int fd_direct; /* On XFS, this is used for direct I/O; - fd_sys is used for buffered I/O */ - int direct_read; /* flag; 1 means use direct read */ - int direct_write; /* flag; 1 means use direct write */ - /* direct I/O attributes */ - unsigned d_mem; /* data buffer memory alignment */ - unsigned d_miniosz; /* min xfer size, xfer size multiple, - and file seek offset alignment */ - long blksize; /* some optimizations benefit from knowing - underlying block size */ - ADIO_Offset fp_ind; /* individual file pointer in MPI-IO (in bytes)*/ - ADIO_Offset fp_sys_posn; /* current location of the system file-pointer - in bytes */ - ADIOI_Fns *fns; /* struct of I/O functions to use */ - MPI_Comm comm; /* communicator indicating who called open */ - int is_open; /* deferred open: 0: not open yet 1: is open */ - int is_agg; /* bool: if I am an aggregator */ - char *filename; - int file_system; /* type of file system */ - int access_mode; /* Access mode (sequential, append, etc.), - possibly modified to deal with - data sieving or deferred open*/ - int orig_access_mode; /* Access mode provided by user: unmodified */ - ADIO_Offset disp; /* reqd. for MPI-IO */ - MPI_Datatype etype; /* reqd. for MPI-IO */ - MPI_Datatype filetype; /* reqd. for MPI-IO */ - MPI_Count etype_size; /* in bytes */ - ADIOI_Hints *hints; /* structure containing fs-indep. info values */ - MPI_Info info; - - /* The following support the split collective operations */ - int split_coll_count; /* count of outstanding split coll. ops. */ - MPI_Status split_status; /* status used for split collectives */ - MPI_Datatype split_datatype; /* datatype used for split collectives */ - - /* The following support the shared file operations */ - char *shared_fp_fname; /* name of file containing shared file pointer */ - struct ADIOI_FileD *shared_fp_fd; /* file handle of file - containing shared fp */ - int async_count; /* count of outstanding nonblocking operations */ - int perm; - int atomicity; /* true=atomic, false=nonatomic */ - int fortran_handle; /* handle for Fortran interface if needed */ - MPI_Errhandler err_handler; - void *fs_ptr; /* file-system specific information */ - - /* Two phase collective I/O support */ - ADIO_Offset *file_realm_st_offs; /* file realm starting offsets */ - MPI_Datatype *file_realm_types; /* file realm datatypes */ - int my_cb_nodes_index; /* my index into cb_config_list. -1 if N/A */ - char *io_buf; /* two-phase buffer allocated out of i/o path */ - MPI_Win io_buf_window; /* Window over the io_buf to support one-sided aggregation */ - int *io_buf_put_amounts; /* array tracking the amount of data mpi_put into the io_buf - during the same round of one-sided write aggregation */ - MPI_Win io_buf_put_amounts_window; /* Window over the io_buf_put_amounts */ - /* External32 */ - int is_external32; /* bool: 0 means native view */ - -} ADIOI_FileD; - -typedef struct ADIOI_FileD *ADIO_File; - -typedef MPI_Request ADIO_Request; - -/* fcntl structure */ -typedef struct { - ADIO_Offset disp; - MPI_Datatype etype; - MPI_Datatype filetype; - MPI_Info info; - int atomicity; - ADIO_Offset fsize; /* for get_fsize only */ - ADIO_Offset diskspace; /* for file preallocation */ -} ADIO_Fcntl_t; /* should contain more stuff */ - - -/* access modes */ -#define ADIO_CREATE 1 -#define ADIO_RDONLY 2 -#define ADIO_WRONLY 4 -#define ADIO_RDWR 8 -#define ADIO_DELETE_ON_CLOSE 16 -#define ADIO_UNIQUE_OPEN 32 -#define ADIO_EXCL 64 -#define ADIO_APPEND 128 -#define ADIO_SEQUENTIAL 256 - -#define ADIO_AMODE_NOMATCH ~(ADIO_CREATE|ADIO_RDONLY|ADIO_WRONLY|ADIO_RDWR|ADIO_DELETE_ON_CLOSE|ADIO_UNIQUE_OPEN|ADIO_EXCL|ADIO_APPEND|ADIO_SEQUENTIAL) - -/* file-pointer types */ -#define ADIO_EXPLICIT_OFFSET 100 -#define ADIO_INDIVIDUAL 101 -#define ADIO_SHARED 102 - -#define ADIO_REQUEST_NULL ((ADIO_Request) 0) -#define ADIO_FILE_NULL ((ADIO_File) 0) - -/* file systems */ -#define ADIO_NFS 150 -#define ADIO_PIOFS 151 /* IBM */ -#define ADIO_UFS 152 /* Unix file system */ -#define ADIO_PFS 153 /* Intel */ -#define ADIO_XFS 154 /* SGI */ -#define ADIO_HFS 155 /* HP/Convex */ -#define ADIO_SFS 156 /* NEC */ -#define ADIO_PVFS 157 /* PVFS for Linux Clusters from Clemson Univ. */ -#define ADIO_NTFS 158 /* NTFS for Windows NT */ -#define ADIO_TESTFS 159 /* fake file system for testing */ -#define ADIO_PVFS2 160 /* PVFS2: 2nd generation PVFS */ -#define ADIO_PANFS 161 /* Panasas FS */ -#define ADIO_GRIDFTP 162 /* Globus GridFTP */ -#define ADIO_LUSTRE 163 /* Lustre */ -/* #define ADIO_BGL 164 */ /* IBM BGL */ -/* #define ADIO_BGLOCKLESS 165 */ /* IBM BGL (lock-free) */ -#define ADIO_ZOIDFS 167 /* ZoidFS: the I/O forwarding fs */ -/* #define ADIO_BG 168 */ -#define ADIO_GPFS 168 - -#define ADIO_SEEK_SET SEEK_SET -#define ADIO_SEEK_CUR SEEK_CUR -#define ADIO_SEEK_END SEEK_END - -#define ADIO_FCNTL_SET_ATOMICITY 180 -#define ADIO_FCNTL_SET_DISKSPACE 188 -#define ADIO_FCNTL_GET_FSIZE 200 - -/* file system feature tests */ -#define ADIO_LOCKS 300 /* file system supports fcntl()-style locking */ -#define ADIO_SHARED_FP 301 /* file system supports shared file pointers */ -#define ADIO_ATOMIC_MODE 302 /* file system supports atomic mode */ -#define ADIO_DATA_SIEVING_WRITES 303 /* file system supports data sieving for writes */ -#define ADIO_SCALABLE_OPEN 304 /* one process can open the file and - broadcast result to all other - processors */ -#define ADIO_UNLINK_AFTER_CLOSE 305 /* supports posix semantic of keeping a - deleted file around until all - processors have closed it */ -#define ADIO_TWO_PHASE 306 /* file system implements some version of - two-phase collective buffering with - aggregation */ -#define ADIO_SCALABLE_RESIZE 307 /* file system supports resizing from one - processor (nfs, e.g. does not) */ - -/* for default file permissions */ -#define ADIO_PERM_NULL -1 - -#define ADIOI_FILE_COOKIE 2487376 -#define ADIOI_REQ_COOKIE 3493740 - -/* ADIO function prototypes */ -/* all these may not be necessary, as many of them are macro replaced to - function pointers that point to the appropriate functions for each - different file system (in adioi.h), but anyway... */ - -void ADIO_Init(int *argc, char ***argv, int *error_code); -void ADIO_End(int *error_code); -MPI_File ADIO_Open(MPI_Comm orig_comm, MPI_Comm comm, const char *filename, - int file_system, ADIOI_Fns *ops, - int access_mode, ADIO_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, - MPI_Info info, int perm, int *error_code); -void ADIOI_OpenColl(ADIO_File fd, int rank, int acces_mode, int *error_code); -void ADIO_ImmediateOpen(ADIO_File fd, int *error_code); -void ADIO_Close(ADIO_File fd, int *error_code); -void ADIO_ReadContig(ADIO_File fd, void *buf, int count, MPI_Datatype datatype, - int file_ptr_type, ADIO_Offset offset, - ADIO_Status *status, int *error_code); -void ADIO_WriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, int *bytes_written, int - *error_code); -void ADIO_IwriteContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIO_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -int ADIO_ReadDone(ADIO_Request *request, ADIO_Status *status, - int *error_code); -int ADIO_WriteDone(ADIO_Request *request, ADIO_Status *status, - int *error_code); -int ADIO_ReadIcomplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); -int ADIO_WriteIcomplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIO_ReadComplete(ADIO_Request *request, ADIO_Status *status, int - *error_code); -void ADIO_WriteComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIO_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int - *error_code); -void ADIO_ReadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIO_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 ADIO_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 ADIO_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 ADIO_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 ADIO_IwriteStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIO_IreadStridedColl(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIO_IwriteStridedColl(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -ADIO_Offset ADIO_SeekIndividual(ADIO_File fd, ADIO_Offset offset, - int whence, int *error_code); -void ADIO_Delete(char *filename, int *error_code); -void ADIO_Flush(ADIO_File fd, int *error_code); -void ADIO_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -void ADIO_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype, - ADIOI_Fns **ops, int *error_code); -void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp, - int *error_code); -void ADIO_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code); -void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, MPI_Info info, int *error_code); -int ADIO_Feature(ADIO_File fd, int flag); - -/* functions to help deal with the array datatypes */ -int ADIO_Type_create_subarray(int ndims, - int *array_of_sizes, - int *array_of_subsizes, - int *array_of_starts, - int order, - MPI_Datatype oldtype, - MPI_Datatype *newtype); -int ADIO_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype); - -/* MPI_File management functions (in mpio_file.c) */ -MPI_File MPIO_File_create(int size); -ADIO_File MPIO_File_resolve(MPI_File mpi_fh); -void MPIO_File_free(MPI_File *mpi_fh); -MPI_File MPIO_File_f2c(MPI_Fint fh); -MPI_Fint MPIO_File_c2f(MPI_File fh); -int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[], - int line, int error_class, const char generic_msg[], - const char specific_msg[], ... ); -int MPIO_Err_return_file(MPI_File mpi_fh, int error_code); -int MPIO_Err_return_comm(MPI_Comm mpi_comm, int error_code); - -/* request managment helper functions */ -void MPIO_Completed_request_create(MPI_File *fh, MPI_Offset nbytes, - int * error_code, MPI_Request *request); - -#include "adioi.h" -#include "adioi_fs_proto.h" -#include "mpio_error.h" -#include "mpipr.h" - -/* these two defines don't appear to be in any other header file */ -#define MPIR_ERR_FATAL 1 -#define MPIR_ERR_RECOVERABLE 0 - -#endif diff --git a/3rd-party/romio321/adio/include/adio_cb_config_list.h b/3rd-party/romio321/adio/include/adio_cb_config_list.h deleted file mode 100644 index ab2c5b501f7..00000000000 --- a/3rd-party/romio321/adio/include/adio_cb_config_list.h +++ /dev/null @@ -1,27 +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. - */ - -/* I have no idea what the "D" stands for; it's how things are done in adio.h - */ -struct ADIO_cb_name_arrayD { - int refct; - int namect; - char **names; -}; - -typedef struct ADIO_cb_name_arrayD *ADIO_cb_name_array; - -int ADIOI_cb_gather_name_array(MPI_Comm comm, MPI_Comm dupcomm, - ADIO_cb_name_array *arrayp); -int ADIOI_cb_copy_name_array(MPI_Comm comm, int keyval, void *extra, - void *attr_in, - void **attr_out, int *flag); -int ADIOI_cb_delete_name_array(MPI_Comm comm, int keyval, void *attr_val, - void *extra); -int ADIOI_cb_config_list_parse(char *config_list, ADIO_cb_name_array array, - int ranklist[], int cb_nodes); -int ADIOI_cb_bcast_rank_map(ADIO_File fd); diff --git a/3rd-party/romio321/adio/include/adio_extern.h b/3rd-party/romio321/adio/include/adio_extern.h deleted file mode 100644 index 9a7f2e59b04..00000000000 --- a/3rd-party/romio321/adio/include/adio_extern.h +++ /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. - */ - -extern ADIOI_Flatlist_node *ADIOI_Flatlist; - -extern ADIOI_Datarep *ADIOI_Datarep_head; - -/* for f2c and c2f conversion */ -extern ADIO_File *ADIOI_Ftable; -extern int ADIOI_Ftable_ptr, ADIOI_Ftable_max; -extern ADIO_Request *ADIOI_Reqtable; -extern int ADIOI_Reqtable_ptr, ADIOI_Reqtable_max; -#ifndef HAVE_MPI_INFO -extern MPI_Info *MPIR_Infotable; -extern int MPIR_Infotable_ptr, MPIR_Infotable_max; -#endif -#if defined(ROMIO_XFS) || defined(ROMIO_LUSTRE) -extern int ADIOI_Direct_read, ADIOI_Direct_write; -#endif - -extern MPI_Errhandler ADIOI_DFLT_ERR_HANDLER; - -extern MPI_Info ADIOI_syshints; - -extern MPI_Op ADIO_same_amode; - -extern int ADIOI_cb_config_list_keyval; diff --git a/3rd-party/romio321/adio/include/adioi.h b/3rd-party/romio321/adio/include/adioi.h deleted file mode 100644 index 5656f10bae7..00000000000 --- a/3rd-party/romio321/adio/include/adioi.h +++ /dev/null @@ -1,1104 +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 general definitions, declarations, and macros internal to - the ADIO implementation, though independent of the underlying file - system. This file is included in adio.h */ - -/* Functions and datataypes that are "internal" to the ADIO implementation - prefixed ADIOI_. Functions and datatypes that are part of the - "externally visible" (documented) ADIO interface are prefixed ADIO_. - - An implementation of MPI-IO, or any other high-level interface, should - not need to use any of the ADIOI_ functions/datatypes. - Only someone implementing ADIO on a new file system, or modifying - an existing ADIO implementation, would need to use the ADIOI_ - functions/datatypes. */ - - -#ifndef ADIOI_INCLUDE -#define ADIOI_INCLUDE -/* used to keep track of hint/info values. - * Note that there are a lot of int-sized values in here...they are - * used as int-sized entities other places as well. This would be a - * problem on 32-bit systems using > 2GB files in some cases... - */ -struct ADIOI_Hints_struct { - int initialized; - int striping_factor; - int striping_unit; - int cb_read; - int cb_write; - int cb_nodes; - int cb_buffer_size; - int cb_pfr; - int cb_fr_type; - int cb_fr_alignment; - int cb_ds_threshold; - int cb_alltoall; - int ds_read; - int ds_write; - int no_indep_rw; - int ind_rd_buffer_size; - int ind_wr_buffer_size; - int deferred_open; - int min_fdomain_size; - char *cb_config_list; - int *ranklist; - union { - struct { - int listio_read; - int listio_write; - } pvfs; - struct { - int debugmask; - int posix_read; - int posix_write; - int listio_read; - int listio_write; - int dtype_read; - int dtype_write; - } pvfs2; - struct { - int start_iodevice; - int co_ratio; - int coll_threshold; - int ds_in_coll; - } lustre; - struct { - unsigned read_chunk_sz; /* chunk size for direct reads */ - unsigned write_chunk_sz; /* chunk size for direct writes */ - } xfs; - struct { - int *bridgelist; /* list of all bride ranks */ - int *bridgelistnum; /* each entry here is the number of aggregators - associated with the bridge rank of the same - index in bridgelist */ - int numbridges; /* total number of bridges */ - } bg; - } fs_hints; - -}; - -typedef struct ADIOI_Datarep { - char *name; - void *state; - MPI_Datarep_extent_function *extent_fn; - MPI_Datarep_conversion_function *read_conv_fn; - MPI_Datarep_conversion_function *write_conv_fn; - struct ADIOI_Datarep *next; /* pointer to next datarep */ -} ADIOI_Datarep; - -/* Values for use with cb_read, cb_write, ds_read, and ds_write - * and some fs-specific hints - (IBM xlc, Compaq Tru64 compilers object to a comma after the last item) - (that's just wrong) - */ -enum { - ADIOI_HINT_AUTO = 0, - ADIOI_HINT_ENABLE = 1, - ADIOI_HINT_DISABLE = 2 -}; - -/* flattened datatypes. Each datatype is stored as a node of a - globally accessible linked list. Once attribute caching on a - datatype is available (in MPI-2), that should be used instead. */ - -typedef struct ADIOI_Fl_node { - MPI_Datatype type; - MPI_Count count; /* no. of contiguous blocks */ - ADIO_Offset *blocklens; /* array of contiguous block lengths (bytes)*/ - ADIO_Offset *indices; /* array of byte offsets of each block */ - /* the type processing code in ROMIO loops through the flattened - * representation to tile file views. so, we cannot simply indicate a - * lower bound and upper bound with entries here -- those are instead - * indicated by offset-length pairs with zero length. In order to deal - * with repeatedly resetting the LB and UB though (as in resized of - * resized, or struct of resized, perhaps?), indicate where in the - * tuple-stream the lb and ub parts are kept - * (-1 indicates "not explicitly set") */ - ADIO_Offset lb_idx; - ADIO_Offset ub_idx; - struct ADIOI_Fl_node *next; /* pointer to next node */ -} ADIOI_Flatlist_node; - -#ifdef ROMIO_PVFS2 -#include -#endif -typedef struct ADIOI_AIO_req_str { - /* very wierd: if this MPI_Request is a pointer, some C++ compilers - * will clobber it when the MPICH C++ bindings are used */ - MPI_Request req; - MPI_Offset nbytes; - /* should probably make this a union */ -#ifdef ROMIO_HAVE_WORKING_AIO - struct aiocb *aiocbp; -#endif -#ifdef ROMIO_PVFS2 - PVFS_sys_op_id op_id; - PVFS_sysresp_io resp_io; - PVFS_Request file_req; - PVFS_Request mem_req; -#endif -#ifdef ROMIO_NTFS - /* Ptr to Overlapped struct */ - LPOVERLAPPED lpOvl; - /* Ptr to file handle */ - HANDLE fd; -#endif -} ADIOI_AIO_Request; - -struct ADIOI_Fns_struct { - void (*ADIOI_xxx_Open) (ADIO_File fd, int *error_code); - void (*ADIOI_xxx_OpenColl) (ADIO_File fd, int rank, - int access_mode, int *error_code); - void (*ADIOI_xxx_ReadContig) (ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code); - void (*ADIOI_xxx_WriteContig) (ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code); - void (*ADIOI_xxx_ReadStridedColl) (ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code); - void (*ADIOI_xxx_WriteStridedColl) (ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int *error_code); - ADIO_Offset (*ADIOI_xxx_SeekIndividual) (ADIO_File fd, ADIO_Offset offset, - int whence, int *error_code); - void (*ADIOI_xxx_Fcntl) (ADIO_File fd, int flag, - ADIO_Fcntl_t *fcntl_struct, int *error_code); - void (*ADIOI_xxx_SetInfo) (ADIO_File fd, MPI_Info users_info, - int *error_code); - void (*ADIOI_xxx_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_xxx_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_xxx_Close) (ADIO_File fd, int *error_code); - void (*ADIOI_xxx_IreadContig) (ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code); - void (*ADIOI_xxx_IwriteContig) (ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code); - int (*ADIOI_xxx_ReadDone) (ADIO_Request *request, ADIO_Status *status, - int *error_code); - int (*ADIOI_xxx_WriteDone) (ADIO_Request *request, ADIO_Status *status, - int *error_code); - void (*ADIOI_xxx_ReadComplete) (ADIO_Request *request, ADIO_Status *status, - int *error_code); - void (*ADIOI_xxx_WriteComplete) (ADIO_Request *request, ADIO_Status *status, - int *error_code); - void (*ADIOI_xxx_IreadStrided) (ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code); - void (*ADIOI_xxx_IwriteStrided) (ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code); - void (*ADIOI_xxx_Flush) (ADIO_File fd, int *error_code); - void (*ADIOI_xxx_Resize) (ADIO_File fd, ADIO_Offset size, int *error_code); - void (*ADIOI_xxx_Delete) (const char *filename, int *error_code); - int (*ADIOI_xxx_Feature) (ADIO_File fd, int flag); - const char *fsname; - void (*ADIOI_xxx_IreadStridedColl) (ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code); - void (*ADIOI_xxx_IwriteStridedColl) (ADIO_File fd, const void *buf, - int count, MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int *error_code); -}; - -/* optypes for ADIO_RequestD */ -#define ADIOI_READ 26 -#define ADIOI_WRITE 27 - -#define ADIOI_MIN(a, b) ((a) < (b) ? (a) : (b)) -#define ADIOI_MAX(a, b) ((a) > (b) ? (a) : (b)) -/* thanks stackoverflow: - * http://stackoverflow.com/questions/3982348/implement-generic-swap-macro-in-c */ -#define ADIOI_SWAP(x, y, T) do { T temp##x##y = x; x = y; y = temp##x##y; } while (0); - -#define ADIOI_PREALLOC_BUFSZ 16777216 /* buffer size used to - preallocate disk space */ - - -/* default values for some hints */ - /* buffer size for collective I/O = 16 MB */ -#define ADIOI_CB_BUFFER_SIZE_DFLT "16777216" - /* buffer size for data sieving in independent reads = 4MB */ -#define ADIOI_IND_RD_BUFFER_SIZE_DFLT "4194304" - /* buffer size for data sieving in independent writes = 512KB. default is - smaller than for reads, because write requires read-modify-write - with file locking. If buffer size is large there is more contention - for locks. */ -#define ADIOI_IND_WR_BUFFER_SIZE_DFLT "524288" - /* use one process per processor name by default */ -#define ADIOI_CB_CONFIG_LIST_DFLT "*:1" - - -/* some of the ADIO functions are macro-replaced */ - -#define ADIOI_OpenColl(fd, rank, access_mode, error_code) \ - (*(fd->fns->ADIOI_xxx_OpenColl))(fd, rank, access_mode, error_code) - -#define ADIO_ReadContig(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ - (*(fd->fns->ADIOI_xxx_ReadContig))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) - -#define ADIO_WriteContig(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ - (*(fd->fns->ADIOI_xxx_WriteContig))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) - -#define ADIO_SeekIndividual(fd,offset,whence,error_code) \ - (*(fd->fns->ADIOI_xxx_SeekIndividual))(fd,offset,whence,error_code) - -#define ADIO_Fcntl(fd,flag,fcntl_struct,error_code) \ - (*(fd->fns->ADIOI_xxx_Fcntl))(fd,flag,fcntl_struct,error_code) - -#define ADIO_IreadContig(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ - (*(fd->fns->ADIOI_xxx_IreadContig))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) - -#define ADIO_IwriteContig(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ - (*(fd->fns->ADIOI_xxx_IwriteContig))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) - -/* in these routines a pointer to request is passed */ -#define ADIO_ReadDone(request,status,error_code) \ - (*((*(request))->fd->fns->ADIOI_xxx_ReadDone))(request,status,error_code) - -#define ADIO_WriteDone(request,status,error_code) \ - (*((*(request))->fd->fns->ADIOI_xxx_WriteDone))(request,status,error_code) - -#define ADIO_ReadIcomplete(request,status,error_code) \ - (*((*(request))->fd->fns->ADIOI_xxx_ReadIcomplete))(request,status,error_code) - -#define ADIO_WriteIcomplete(request,status,error_code) \ - (*((*(request))->fd->fns->ADIOI_xxx_WriteIcomplete))(request,status,error_code) - -#define ADIO_ReadComplete(request,status,error_code) \ - (*((*(request))->fd->fns->ADIOI_xxx_ReadComplete))(request,status,error_code) - -#define ADIO_WriteComplete(request,status,error_code) \ - (*((*(request))->fd->fns->ADIOI_xxx_WriteComplete))(request,status,error_code) - -#define ADIO_ReadStrided(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ - (*(fd->fns->ADIOI_xxx_ReadStrided))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) - -#define ADIO_WriteStrided(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ - (*(fd->fns->ADIOI_xxx_WriteStrided))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) - -#define ADIO_ReadStridedColl(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ - (*(fd->fns->ADIOI_xxx_ReadStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) - -#define ADIO_WriteStridedColl(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) \ - (*(fd->fns->ADIOI_xxx_WriteStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,status,error_code) - -#define ADIO_IreadStrided(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ - (*(fd->fns->ADIOI_xxx_IreadStrided))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) - -#define ADIO_IwriteStrided(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ - (*(fd->fns->ADIOI_xxx_IwriteStrided))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) - -#define ADIO_IreadStridedColl(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ - (*(fd->fns->ADIOI_xxx_IreadStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) - -#define ADIO_IwriteStridedColl(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \ - (*(fd->fns->ADIOI_xxx_IwriteStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) - -#define ADIO_Flush(fd,error_code) (*(fd->fns->ADIOI_xxx_Flush))(fd,error_code) - -#define ADIO_Resize(fd,size,error_code) \ - (*(fd->fns->ADIOI_xxx_Resize))(fd,size,error_code) - -#define ADIO_Delete(filename,error_code) \ - (*(fd->fns->ADIOI_xxx_Delete))(filename,error_code) - -#define ADIO_SetInfo(fd, users_info, error_code) \ - (*(fd->fns->ADIOI_xxx_SetInfo))(fd, users_info, error_code) - -#define ADIO_Feature(fd, flag) \ - (*(fd->fns->ADIOI_xxx_Feature))(fd, flag) - - -/* structure for storing access info of this process's request - from the file domain of other processes, and vice-versa. used - as array of structures indexed by process number. */ -typedef struct { - ADIO_Offset *offsets; /* array of offsets */ - ADIO_Offset *lens; /* array of lengths */ - MPI_Aint *mem_ptrs; /* array of pointers. used in the read/write - phase to indicate where the data - is stored in memory */ - int count; /* size of above arrays */ -} ADIOI_Access; - -/* structure for storing generic offset/length pairs. used to describe - file realms among other things */ -typedef struct { - ADIO_Offset *offsets; /* array of offsets */ - ADIO_Offset *lens; /* array of lengths */ - int count; /* size of above arrays */ -} ADIOI_Offlen; - -/* prototypes for ADIO internal functions */ - - -int ADIOI_Type_get_envelope (MPI_Datatype datatype, int *num_integers, - int *num_addresses, int *num_datatypes, int *combiner); -int ADIOI_Type_get_contents (MPI_Datatype datatype, int max_integers, - int max_addresses, int max_datatypes, int array_of_integers[], - MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); -void ADIOI_SetFunctions(ADIO_File fd); -void ADIOI_Flatten_datatype(MPI_Datatype type); -void ADIOI_Flatten(MPI_Datatype type, ADIOI_Flatlist_node *flat, - ADIO_Offset st_offset, MPI_Count *curr_index); -void ADIOI_Delete_flattened(MPI_Datatype datatype); -ADIOI_Flatlist_node * ADIOI_Flatten_and_find(MPI_Datatype); -MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype type, MPI_Count *curr_index); -void ADIOI_Complete_async(int *error_code); -void *ADIOI_Malloc_fn(size_t size, int lineno, const char *fname); -void *ADIOI_Calloc_fn(size_t nelem, size_t elsize, int lineno, const char *fname); -void *ADIOI_Realloc_fn(void *ptr, size_t size, int lineno, const char *fname); -void ADIOI_Free_fn(void *ptr, int lineno, const char *fname); -void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag); -void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset); -void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset); -void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, - ADIO_Offset *disp); -void ADIOI_process_system_hints(ADIO_File fd, MPI_Info info); -void ADIOI_incorporate_system_hints(MPI_Info info, MPI_Info sysinfo, - MPI_Info *new_info); -void ADIOI_Info_print_keyvals(MPI_Info info); - - -void ADIOI_GEN_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, - int *error_code); -void ADIOI_GEN_Flush(ADIO_File fd, int *error_code); -void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, - int access_mode, int *error_code); -void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, - int access_mode, int *error_code); -void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, - int access_mode, int *error_code); -void ADIOI_GEN_Delete(const char *filename, int *error_code); -void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, - int *error_code); -int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, - int wr, MPI_Request *request); -void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIOI_GEN_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_GEN_IwriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIOI_GEN_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_GEN_IreadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -void ADIOI_GEN_IwriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, int - *error_code); -int ADIOI_GEN_IODone(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIOI_GEN_IOComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); -int ADIOI_GEN_aio_poll_fn(void *extra_state, ADIO_Status *status); -int ADIOI_GEN_aio_wait_fn(int count, void **array_of_states, double timeout, - ADIO_Status *status); -int ADIOI_GEN_aio_query_fn(void *extra_state, ADIO_Status *status); -int ADIOI_GEN_aio_free_fn(void *extra_state); -int ADIOI_GEN_Feature(ADIO_File fd, int feature); - -void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count, - MPI_Datatype buftype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_GEN_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_GEN_WriteStrided_naive(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_NOLOCK_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_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -#ifdef HAVE_MPI_GREQUEST_EXTENSIONS -void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code); -#else -#define ADIOI_GEN_IreadStridedColl NULL -#endif -void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -#ifdef HAVE_MPI_GREQUEST_EXTENSIONS -void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Request *request, - int *error_code); -#else -#define ADIOI_GEN_IwriteStridedColl NULL -#endif -void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype - datatype, int file_ptr_type, ADIO_Offset - 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_Calc_file_domains(ADIO_Offset *st_offsets, ADIO_Offset - *end_offsets, int nprocs, int nprocs_for_coll, - ADIO_Offset *min_st_offset_ptr, - ADIO_Offset **fd_start_ptr, ADIO_Offset - **fd_end_ptr, int min_fd_size, - ADIO_Offset *fd_size_ptr, - int striping_unit); -int ADIOI_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); -void ADIOI_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); -void ADIOI_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); - - -/* Nonblocking Collective I/O internals */ -typedef enum { - ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL, - ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO, - ADIOI_IRC_STATE_ICALC_OTHERS_REQ, - ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN, - ADIOI_IRC_STATE_IREAD_AND_EXCH, - ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN, - ADIOI_IRC_STATE_R_IEXCHANGE_DATA, - ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV, - ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL, - ADIOI_IRC_STATE_COMPLETE -} ADIOI_IRC_State; - -typedef enum { - ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL, - ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO, - ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST, - ADIOI_IWC_STATE_ICALC_OTHERS_REQ, - ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN, - ADIOI_IWC_STATE_IEXCH_AND_WRITE, - ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY, - ADIOI_IWC_STATE_W_IEXCHANGE_DATA, - ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE, - ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND, - ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT, - ADIOI_IWC_STATE_COMPLETE -} ADIOI_IWC_State; - -typedef struct ADIOI_NBC_Request ADIOI_NBC_Request; - -typedef struct ADIOI_GEN_IreadStridedColl_vars ADIOI_GEN_IreadStridedColl_vars; -typedef struct ADIOI_Iread_and_exch_vars ADIOI_Iread_and_exch_vars; -typedef struct ADIOI_R_Iexchange_data_vars ADIOI_R_Iexchange_data_vars; - -typedef struct ADIOI_GEN_IwriteStridedColl_vars ADIOI_GEN_IwriteStridedColl_vars; -typedef struct ADIOI_Iexch_and_write_vars ADIOI_Iexch_and_write_vars; -typedef struct ADIOI_W_Iexchange_data_vars ADIOI_W_Iexchange_data_vars; - -typedef struct ADIOI_Icalc_others_req_vars { - /* requests */ - MPI_Request req1; - MPI_Request *req2; - int num_req2; - - /* parameters */ - ADIO_File fd; - int count_my_req_procs; - int *count_my_req_per_proc; - ADIOI_Access *my_req; - int nprocs; - int myrank; - int *count_others_req_procs_ptr; - ADIOI_Access **others_req_ptr; - - /* stack variables */ - int *count_others_req_per_proc; - int count_others_req_procs; - ADIOI_Access *others_req; - - /* next function to be called */ - void (*next_fn)(ADIOI_NBC_Request *, int *); -} ADIOI_Icalc_others_req_vars; - -struct ADIOI_NBC_Request { - int rdwr; /* ADIOI_READ or ADIOI_WRITE */ - MPI_Request req; /* MPIX_Grequest */ - MPI_Count nbytes; /* data read or written */ - - union { - struct { - ADIOI_IRC_State state; /* progress state */ - ADIOI_GEN_IreadStridedColl_vars *rsc_vars; - ADIOI_Iread_and_exch_vars *rae_vars; - ADIOI_R_Iexchange_data_vars *red_vars; - } rd; - struct { - ADIOI_IWC_State state; /* progress state */ - ADIOI_GEN_IwriteStridedColl_vars *wsc_vars; - ADIOI_Iexch_and_write_vars *eaw_vars; - ADIOI_W_Iexchange_data_vars *wed_vars; - } wr; - } data; - ADIOI_Icalc_others_req_vars *cor_vars; -}; - -void ADIOI_Icalc_others_req(ADIOI_NBC_Request *nbc_req, int *error_code); -void ADIOI_Icalc_others_req_main(ADIOI_NBC_Request *nbc_req, int *error_code); -void ADIOI_Icalc_others_req_fini(ADIOI_NBC_Request *nbc_req, int *error_code); - - -/* KC && AC - New Collective I/O internals*/ - -#define TEMP_OFF 0 -#define REAL_OFF 1 -#define MAX_OFF_TYPE 2 - -/* Communication Tags */ -#define DATA_TAG 30 -#define AMT_TAG 31 - -/* cb_fr_type user size is non-zero */ -#define ADIOI_FR_AAR 0 -#define ADIOI_FR_FSZ -1 -#define ADIOI_FR_USR_REALMS -2 - -typedef struct flatten_state -{ - ADIO_Offset abs_off; - ADIO_Offset cur_sz; - ADIO_Offset idx; - ADIO_Offset cur_reg_off; -} flatten_state; - -typedef struct view_state -{ - ADIO_Offset fp_ind; /* file view params*/ - ADIO_Offset disp; /* file view params*/ - ADIO_Offset byte_off; - ADIO_Offset sz; - ADIO_Offset ext; /* preserved extent from MPI_Type_extent */ - ADIO_Offset type_sz; - - /* Current state */ - flatten_state cur_state; - /* Scratch state for counting up ol pairs */ - flatten_state tmp_state; - - /* Preprocessed data amount and ol pairs */ - ADIO_Offset pre_sz; - int pre_ol_ct; - MPI_Aint *pre_disp_arr; - int *pre_blk_arr; - - ADIOI_Flatlist_node *flat_type_p; -} view_state; - -void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype, - int file_ptr_type, ADIO_Offset offset, - ADIO_Offset *st_offset, ADIO_Offset *end_offset); -int ADIOI_Agg_idx (int rank, ADIO_File fd); -void ADIOI_Calc_file_realms (ADIO_File fd, ADIO_Offset min_st_offset, - ADIO_Offset max_end_offset); -void ADIOI_IOFiletype(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, MPI_Datatype custom_ftype, - int rdwr, ADIO_Status *status, int - *error_code); -void ADIOI_IOStridedColl(ADIO_File fd, void *buf, int count, int rdwr, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Status *status, int - *error_code); -void ADIOI_Print_flatlist_node(ADIOI_Flatlist_node *flatlist_node_p); -ADIOI_Flatlist_node * ADIOI_Add_contig_flattened(MPI_Datatype contig_type); -void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type, - ADIO_File fd, int count, - MPI_Datatype datatype, ADIO_Offset off, - view_state *my_mem_view_state_arr, - view_state *agg_file_view_state_arr, - view_state *client_file_view_state_arr); -int ADIOI_init_view_state(int file_ptr_type, - int nprocs, - view_state *view_state_arr, - int op_type); -int ADIOI_Build_agg_reqs(ADIO_File fd, int rw_type, int nprocs, - view_state *client_file_view_state_arr, - MPI_Datatype *client_comm_dtype_arr, - ADIO_Offset *client_comm_sz_arr, - ADIO_Offset *agg_dtype_offset_p, - MPI_Datatype *agg_dtype_p); -int ADIOI_Build_client_reqs(ADIO_File fd, - int nprocs, - view_state *my_mem_view_state_arr, - view_state *agg_file_view_state_arr, - ADIO_Offset *agg_comm_sz_arr, - MPI_Datatype *agg_comm_dtype_arr); -int ADIOI_Build_client_pre_req(ADIO_File fd, - int agg_rank, - int agg_idx, - view_state *my_mem_view_state_p, - view_state *agg_file_view_state_p, - ADIO_Offset max_pre_req_sz, - int max_ol_ct); -int ADIOI_Build_client_req(ADIO_File fd, - int agg_rank, - int agg_idx, - view_state *my_mem_view_state_p, - view_state *agg_file_view_state_p, - ADIO_Offset agg_comm_sz, - MPI_Datatype *agg_comm_dtype_p); - -void ADIOI_P2PContigWriteAggregation(ADIO_File fd, - const void *buf, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offset, - ADIO_Offset *fd_start, - ADIO_Offset *fd_end); - -void ADIOI_P2PContigReadAggregation(ADIO_File fd, - const void *buf, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offset, - ADIO_Offset *fd_start, - ADIO_Offset *fd_end); - -int ADIOI_OneSidedCleanup(ADIO_File fd); -void ADIOI_OneSidedWriteAggregation(ADIO_File fd, - ADIO_Offset *offset_list, - ADIO_Offset *len_list, - int contig_access_count, - const void *buf, - MPI_Datatype datatype, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offsets, - int numNonZeroDataOffsets, - ADIO_Offset *fd_start, - ADIO_Offset* fd_end, - int *hole_found); -void ADIOI_OneSidedReadAggregation(ADIO_File fd, - ADIO_Offset *offset_list, - ADIO_Offset *len_list, - int contig_access_count, - const void *buf, - MPI_Datatype datatype, - int *error_code, - ADIO_Offset *st_offsets, - ADIO_Offset *end_offsets, - int numNonZeroDataOffsets, - ADIO_Offset *fd_start, - ADIO_Offset* fd_end); -ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset, - int whence, int *error_code); -void ADIOI_GEN_Resize(ADIO_File fd, ADIO_Offset size, int *error_code); -void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code); -void ADIOI_GEN_Close(ADIO_File fd, int *error_code); -void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code); -void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset size, int *error_code); -int ADIOI_Error(ADIO_File fd, int error_code, char *string); -int MPIR_Err_setmsg( int, int, const char *, const char *, const char *, ... ); -int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state); -int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, MPI_Count nbytes); -int ADIOI_Uses_generic_read(ADIO_File fd); -int ADIOI_Uses_generic_write(ADIO_File fd); -int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno); -int ADIOI_Type_create_hindexed_x(int count, - const MPI_Count array_of_blocklengths[], - const MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype); - - -int ADIOI_FAKE_IODone(ADIO_Request *request, ADIO_Status *status, - int *error_code); -void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIOI_FAKE_IwriteContig(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIOI_FAKE_IwriteStrided(ADIO_File fd, const void *buf, int count, - MPI_Datatype datatype, int file_ptr_type, - ADIO_Offset offset, ADIO_Request *request, - int *error_code); -void ADIOI_FAKE_IOComplete(ADIO_Request *request, ADIO_Status *status, - int *error_code); - - -/* File I/O common functionality */ -int MPIOI_File_read(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status); -int MPIOI_File_write(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status); -int MPIOI_File_read_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status); -int MPIOI_File_write_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status); -int MPIOI_File_read_all_begin(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname); -int MPIOI_File_write_all_begin(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname); -int MPIOI_File_read_all_end(MPI_File fh, - void *buf, - char *myname, - MPI_Status *status); -int MPIOI_File_write_all_end(MPI_File fh, - const void *buf, - char *myname, - MPI_Status *status); -int MPIOI_File_iwrite(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request); -int MPIOI_File_iread(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request); -int MPIOI_File_iwrite_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request); -int MPIOI_File_iread_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request); - - - -/* Unix-style file locking */ - -#if (defined(ROMIO_HFS) || defined(ROMIO_XFS)) - -# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ - do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ - ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_WRLCK, offset, whence, len);\ - else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len); } while (0) - -# define ADIOI_READ_LOCK(fd, offset, whence, len) \ - do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ - ADIOI_Set_lock64((fd)->fd_sys, F_SETLKW64, F_RDLCK, offset, whence, len);\ - else ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len); }while (0) - -# define ADIOI_UNLOCK(fd, offset, whence, len) \ - do {if (((fd)->file_system == ADIO_XFS) || ((fd)->file_system == ADIO_HFS)) \ - ADIOI_Set_lock64((fd)->fd_sys, F_SETLK64, F_UNLCK, offset, whence, len); \ - else ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len); }while (0) - -#elif (defined(ROMIO_NTFS)) - -#define ADIOI_LOCK_CMD 0 -#define ADIOI_UNLOCK_CMD 1 - -# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ - ADIOI_Set_lock((fd)->fd_sys, ADIOI_LOCK_CMD, LOCKFILE_EXCLUSIVE_LOCK, offset, whence, len) -# define ADIOI_READ_LOCK(fd, offset, whence, len) \ - ADIOI_Set_lock((fd)->fd_sys, ADIOI_LOCK_CMD, 0, offset, whence, len) -# define ADIOI_UNLOCK(fd, offset, whence, len) \ - ADIOI_Set_lock((fd)->fd_sys, ADIOI_UNLOCK_CMD, LOCKFILE_FAIL_IMMEDIATELY, offset, whence, len) - -#else - -#ifdef ADIOI_MPE_LOGGING -# define ADIOI_WRITE_LOCK(fd, offset, whence, len) do { \ - MPE_Log_event( ADIOI_MPE_writelock_a, 0, NULL ); \ - ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len); \ - MPE_Log_event( ADIOI_MPE_writelock_b, 0, NULL ); } while( 0 ) -# define ADIOI_READ_LOCK(fd, offset, whence, len) \ - MPE_Log_event( ADIOI_MPE_readlock_a, 0, NULL ); do { \ - ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len); \ - MPE_Log_event( ADIOI_MPE_readlock_b, 0, NULL ); } while( 0 ) -# define ADIOI_UNLOCK(fd, offset, whence, len) do { \ - MPE_Log_event( ADIOI_MPE_unlock_a, 0, NULL ); \ - ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len); \ - MPE_Log_event( ADIOI_MPE_unlock_b, 0, NULL ); } while( 0 ) -#else -# define ADIOI_WRITE_LOCK(fd, offset, whence, len) \ - ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_WRLCK, offset, whence, len) -# define ADIOI_READ_LOCK(fd, offset, whence, len) \ - ADIOI_Set_lock((fd)->fd_sys, F_SETLKW, F_RDLCK, offset, whence, len) -# define ADIOI_UNLOCK(fd, offset, whence, len) \ - ADIOI_Set_lock((fd)->fd_sys, F_SETLK, F_UNLCK, offset, whence, len) -#endif - -#endif - -int ADIOI_Set_lock(FDTYPE fd_sys, int cmd, int type, ADIO_Offset offset, int whence, ADIO_Offset len); -int ADIOI_Set_lock64(FDTYPE fd_sys, int cmd, int type, ADIO_Offset offset, int whence, ADIO_Offset len); - -#define ADIOI_Malloc(a) ADIOI_Malloc_fn(a,__LINE__,__FILE__) -#define ADIOI_Calloc(a,b) ADIOI_Calloc_fn(a,b,__LINE__,__FILE__) -#define ADIOI_Realloc(a,b) ADIOI_Realloc_fn(a,b,__LINE__,__FILE__) -#define ADIOI_Free(a) ADIOI_Free_fn(a,__LINE__,__FILE__) - -int ADIOI_Strncpy( char *outstr, const char *instr, size_t maxlen ); -int ADIOI_Strnapp( char *, const char *, size_t ); -char *ADIOI_Strdup( const char * ); - -/* the current MPI standard is not const-correct, and modern compilers warn - * about the following sort of code: - * - * MPI_Info_set(info, "key", "val"); - * - * reminding us that "key" and "val" are const. We use the following macros to - * cast away the const and suppress the warning. */ -#define ADIOI_Info_set(info_,key_str_,val_) \ - MPI_Info_set((info_),((char*)key_str_),(char*)(val_)) -#define ADIOI_Info_get(info_,key_str_,val_len_,val_,flag_) \ - MPI_Info_get((info_),((char*)key_str_),(val_len_),(val_),(flag_)) -#define ADIOI_Info_get_valuelen(info_,key_str_,val_len_,flag_) \ - MPI_Info_get_valuelen((info_),((char*)key_str_),(val_len_),(flag_)) -#define ADIOI_Info_delete(info_,key_str_) \ - MPI_Info_delete((info_),((char*)key_str_)) - - -/* Provide a fallback snprintf for systems that do not have one */ -/* Define attribute as empty if it has no definition */ -#ifndef ATTRIBUTE -#ifdef HAVE_GCC_ATTRIBUTE -#define ATTRIBUTE(a) __attribute__(a) -#else -#define ATTRIBUTE(a) -#endif -#endif - -/* style: allow:snprintf:1 sig:0 */ - -#ifdef HAVE_SNPRINTF -#define ADIOI_Snprintf snprintf -/* Sometimes systems don't provide prototypes for snprintf */ -#ifdef NEEDS_SNPRINTF_DECL -extern int snprintf( char *, size_t, const char *, ... ) ATTRIBUTE((format(printf,3,4))); -#endif -#else -int ADIOI_Snprintf( char *str, size_t size, const char *format, ... ) - ATTRIBUTE((format(printf,3,4))); -#endif /* HAVE_SNPRINTF */ - -#define FPRINTF fprintf - -#ifndef HAVE_STRERROR -# ifdef HAVE_SYSERRLIST - extern char *sys_errlist[]; -# define strerror(n) sys_errlist[n] -# else -# define PRINT_ERR_MSG -# endif -#endif - -#include "adioi_error.h" - -/* MPE logging variables */ - -#ifdef ADIOI_MPE_LOGGING -#include "mpe.h" - -int ADIOI_MPE_open_a; -int ADIOI_MPE_open_b; -int ADIOI_MPE_read_a; -int ADIOI_MPE_read_b; -int ADIOI_MPE_write_a; -int ADIOI_MPE_write_b; -int ADIOI_MPE_lseek_a; -int ADIOI_MPE_lseek_b; -int ADIOI_MPE_close_a; -int ADIOI_MPE_close_b; -int ADIOI_MPE_writelock_a; -int ADIOI_MPE_writelock_b; -int ADIOI_MPE_readlock_a; -int ADIOI_MPE_readlock_b; -int ADIOI_MPE_unlock_a; -int ADIOI_MPE_unlock_b; -int ADIOI_MPE_postwrite_a; -int ADIOI_MPE_postwrite_b; -int ADIOI_MPE_openinternal_a; -int ADIOI_MPE_openinternal_b; -int ADIOI_MPE_stat_a; -int ADIOI_MPE_stat_b; -int ADIOI_MPE_iread_a; -int ADIOI_MPE_iread_b; -int ADIOI_MPE_iwrite_a; -int ADIOI_MPE_iwrite_b; -#endif - -#ifdef ROMIO_INSIDE_MPICH -/* Assert that this MPI_Aint value can be cast to a ptr value without problem.*/ -/* Basic idea is the value should be unchanged after casting - (no loss of (meaningful) high order bytes in 8 byte MPI_Aint - to (possible) 4 byte ptr cast) */ -/* Should work even on 64bit or old 32bit configs */ - /* Use MPIU_Ensure_Aint_fits_in_pointer from mpiutil.h and - MPIU_AINT_CAST_TO_VOID_PTR from configure (mpi.h) */ - #include "glue_romio.h" - - #define ADIOI_AINT_CAST_TO_VOID_PTR (void*)(MPIU_Pint) - /* The next two casts are only used when you don't want sign extension - when casting a (possible 4 byte) aint to a (8 byte) long long or offset */ - #define ADIOI_AINT_CAST_TO_LONG_LONG (long long) - #define ADIOI_AINT_CAST_TO_OFFSET ADIOI_AINT_CAST_TO_LONG_LONG - - #define ADIOI_ENSURE_AINT_FITS_IN_PTR(aint_value) MPIR_Ext_ensure_Aint_fits_in_pointer(aint_value) - #define ADIOI_Assert MPIR_Ext_assert -#else - #include - #define ADIOI_AINT_CAST_TO_VOID_PTR (void*) - #define ADIOI_AINT_CAST_TO_LONG_LONG (long long) - #define ADIOI_AINT_CAST_TO_OFFSET ADIOI_AINT_CAST_TO_LONG_LONG - #define ADIOI_ENSURE_AINT_FITS_IN_PTR(aint_value) - #define ADIOI_Assert assert - #define MPIU_Upint unsigned long - #define MPID_THREADPRIV_DECL -#endif - -#ifdef USE_DBG_LOGGING /*todo fix dependency on mpich?*/ -/* DBGT_FPRINTF terse level printing */ -#define DBGT_FPRINTF if (MPIR_Ext_dbg_romio_verbose_enabled) fprintf(stderr,"%s:%d:",__FILE__,__LINE__); \ -if (MPIR_Ext_dbg_romio_terse_enabled) fprintf -/* DBG_FPRINTF default (typical level) printing */ -#define DBG_FPRINTF if (MPIR_Ext_dbg_romio_verbose_enabled) fprintf(stderr,"%s:%d:",__FILE__,__LINE__); \ -if (MPIR_Ext_dbg_romio_typical_enabled) fprintf -/* DBGV_FPRINTF verbose level printing */ -#define DBGV_FPRINTF if (MPIR_Ext_dbg_romio_verbose_enabled) fprintf(stderr,"%s:%d:",__FILE__,__LINE__); \ - if (MPIR_Ext_dbg_romio_verbose_enabled) fprintf -#else /* compile it out */ -#define DBGT_FPRINTF if (0) fprintf -#define DBG_FPRINTF if (0) fprintf -#define DBGV_FPRINTF if (0) fprintf -#endif - -/* declarations for threaded I/O */ -/* i/o thread data structure (bgmpio_pthreadwc) */ -typedef struct wcThreadFuncData { - ADIO_File fd; - int io_kind; - char *buf; - int size; - ADIO_Offset offset; - ADIO_Status *status; - int error_code; -} ADIOI_IO_ThreadFuncData; - -void *ADIOI_IO_Thread_Func(void *vptr_args); - - -#ifdef HAVE_LIMITS_H -#include -#endif - -#ifndef PATH_MAX -#define PATH_MAX 65535 -#endif - -#if (HAVE_DECL_PWRITE == 0) -#include -#include -ssize_t pread(int fd, void *buf, size_t count, off_t offset); -ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); - -#endif - -#endif /* ADIOI_INCLUDE */ diff --git a/3rd-party/romio321/adio/include/adioi_errmsg.h b/3rd-party/romio321/adio/include/adioi_errmsg.h deleted file mode 100644 index b1cdb4577a2..00000000000 --- a/3rd-party/romio321/adio/include/adioi_errmsg.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -MPI_ERR_FILE - MPIR_ERR_FILE_NULL "Null file handle" - MPIR_ERR_FILE_CORRUPT "Corrupted file handle" - -MPI_ERR_AMODE - 3 "Exactly one of MPI_MODE_RDONLY, MPI_MODE_WRONLY, or MPI_MODE_RDWR must be specified" - 5 "Cannot use MPI_MODE_CREATE or MPI_MODE_EXCL with MPI_MODE_RDONLY" - 7 "Cannot specify MPI_MODE_SEQUENTIAL with MPI_MODE_RDWR" - -MPI_ERR_ARG - MPIR_ERR_OFFSET_ARG "Invalid offset argument" - MPIR_ERR_DATAREP_ARG "Null datarep argument" - MPIR_ERR_COUNT_ARG "Invalid count argument" - MPIR_ERR_SIZE_ARG "Invalid size argument" - MPIR_ERR_WHENCE_ARG "Invalid whence argument" - MPIR_ERR_FLAG_ARG "flag argument must be the same on all processes" - MPIR_ERR_DISP_ARG "Invalid displacement argument" - MPIR_ERR_ETYPE_ARG "Invalid etype argument" - MPIR_ERR_FILETYPE_ARG "Invalid filetype argument" - MPIR_ERR_SIZE_ARG_NOT_SAME "size argument must be the same on all processes" - MPIR_ERR_OFFSET_ARG_NEG "offset points to a negative location in the file" - MPIR_ERR_WHENCE_ARG_NOT_SAME "whence argument must be the same on all processes" - MPIR_ERR_OFFSET_ARG_NOT_SAME "offset argument must be the same on all processes" - -MPI_ERR_TYPE - MPIR_ERR_TYPE_NULL (null datatype. from MPICH) - -MPI_ERR_UNSUPPORTED_OPERATION - MPIR_ERR_NO_SHARED_FP "Shared file pointer not supported on PIOFS and PVFS" - MPIR_ERR_AMODE_SEQ "Cannot use this function when file is opened with amode MPI_MODE_SEQUENTIAL" - MPIR_ERR_MODE_WRONLY "Cannot read from a file opened with amode MPI_MODE_WRONLY" - MPIR_ERR_NO_MODE_SEQ "MPI_MODE_SEQUENTIAL not supported on PIOFS and PVFS" - -MPI_ERR_REQUEST - MPIR_ERR_REQUEST_NULL (null request. from MPICH) - -MPI_ERR_IO - MPIR_ERR_ETYPE_FRACTIONAL "Only an integral number of etypes can be accessed" - MPIR_ERR_NO_FSTYPE "Can't determine the file-system type. Check the filename/path you provided and try again. Otherwise, prefix the filename with a string to indicate the type of file sytem (piofs:, pfs:, nfs:, ufs:, hfs:, xfs:, sfs:, pvfs:, panfs: ftp: gsiftp:)" - MPIR_ERR_NO_PFS "ROMIO has not been configured to use the PFS file system" - MPIR_ERR_NO_PIOFS "ROMIO has not been configured to use the PIOFS file system" - MPIR_ERR_NO_UFS "ROMIO has not been configured to use the UFS file system" - MPIR_ERR_NO_NFS "ROMIO has not been configured to use the NFS file system" - MPIR_ERR_NO_HFS "ROMIO has not been configured to use the HFS file system" - MPIR_ERR_NO_XFS "ROMIO has not been configured to use the XFS file system" - MPIR_ERR_NO_SFS "ROMIO has not been configured to use the SFS file system" - MPIR_ERR_NO_PVFS "ROMIO has not been configured to use the PVFS file system" - MPIR_ERR_NO_PANFS "ROMIO has not been configured to use the PANFS file system" - MPIR_ERR_MULTIPLE_SPLIT_COLL "Only one active split collective I/O operation allowed per file handle" - MPIR_ERR_NO_SPLIT_COLL "No previous split collective begin" - MPIR_ERR_ASYNC_OUTSTANDING "There are outstanding nonblocking I/O operations on this file" - MPIR_ADIO_ERROR "I/O Error" strerror(errno) - MPIR_READ_PERM "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." - MPIR_PREALLOC_PERM "To preallocate disk space, ROMIO needs to read the file and write it back, but is unable to read the file. Please give the file read permission and open it with MPI_MODE_RDWR." - MPIR_ERR_FILETYPE "Filetype must be constructed out of one or more etypes" - MPIR_ERR_NO_TESTFS "ROMIO has not been configured to use the TESTFS file system" - MPIR_ERR_DEFERRED "independent IO attempted even though no_indep_rw hint given" - MPIR_ERR_NO_BGL "ROMIO has not been configured to use the BGL file system" - -MPI_ERR_COMM - MPIR_ERR_COMM_NULL (null communicator. from MPICH) -MPIR_ERR_COMM_INTER (no intercommunicator. (from MPICH) - -MPI_ERR_UNSUPPORTED_DATAREP - MPIR_ERR_NOT_NATIVE_DATAREP "Only native data representation currently supported" - - diff --git a/3rd-party/romio321/adio/include/adioi_error.h b/3rd-party/romio321/adio/include/adioi_error.h deleted file mode 100644 index 300a0638615..00000000000 --- a/3rd-party/romio321/adio/include/adioi_error.h +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include /* for strerror() */ - -/* MPIO_CHECK_XXX macros are used to clean up error checking and - * handling in many of the romio/mpi-io/ source files. - */ -#define MPIO_CHECK_FILE_HANDLE(fh, myname, error_code) \ -if ((fh <= (ADIO_File) 0) || \ - ((fh)->cookie != ADIOI_FILE_COOKIE)) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_FILE, \ - "**iobadfh", 0); \ - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);\ - goto fn_exit; \ -} - -/* TODO could add more glue code to help check for handle validity, or perhaps - * do some sort of always-safe attribute/info call to check for handle validity */ -#define MPIO_CHECK_COMM(comm_, myname_, error_code_) \ - do { \ - if ((comm_) == MPI_COMM_NULL) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - (myname_), __LINE__, \ - MPI_ERR_COMM, \ - "**commnull", 0); \ - error_code_ = MPIO_Err_return_file(MPI_FILE_NULL, (error_code_)); \ - goto fn_exit; \ - } \ - } while (0) - -#define MPIO_CHECK_COUNT(fh, count, myname, error_code) \ -if (count < 0) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_COUNT, \ - "**iobadcount", 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -#define MPIO_CHECK_COUNT_SIZE(fh, count, datatype_size, myname, error_code) \ -if (count*datatype_size != (ADIO_Offset)(unsigned)count*(ADIO_Offset)datatype_size) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_ARG, \ - "**iobadcount", 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -#define MPIO_CHECK_DATATYPE(fh, datatype, myname, error_code) \ - do { \ - if (datatype == MPI_DATATYPE_NULL) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_TYPE, \ - "**dtypenull", 0); \ - } \ - else { \ - MPIO_DATATYPE_ISCOMMITTED(datatype, error_code); \ - } \ - if (error_code != MPI_SUCCESS) { \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ - } \ - } while (0) - -#define MPIO_CHECK_READABLE(fh, myname, error_code) \ -if (fh->access_mode & ADIO_WRONLY) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_ACCESS, \ - "**iowronly", 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -#define MPIO_CHECK_WRITABLE(fh, myname, error_code) \ -if (fh->access_mode & ADIO_RDONLY) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_READ_ONLY, \ - "**iordonly", \ - 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -#define MPIO_CHECK_NOT_SEQUENTIAL_MODE(fh, myname, error_code) \ -if (fh->access_mode & ADIO_SEQUENTIAL) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_UNSUPPORTED_OPERATION, \ - "**ioamodeseq", 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -#define MPIO_CHECK_INTEGRAL_ETYPE(fh, count, dtype_size, myname, error_code) \ -if ((count*dtype_size) % fh->etype_size != 0) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, MPI_ERR_IO, \ - "**ioetype", 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -#define MPIO_CHECK_FS_SUPPORTS_SHARED(fh, myname, error_code) \ -if (!ADIO_Feature(fh, ADIO_SHARED_FP)) \ -{ \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_UNSUPPORTED_OPERATION, \ - "**iosharedunsupported", 0); \ - error_code = MPIO_Err_return_file(fh, error_code); \ - goto fn_exit; \ -} - -/* MPIO_ERR_CREATE_CODE_XXX macros are used to clean up creation of - * error codes for common cases in romio/adio/ - */ -#define MPIO_ERR_CREATE_CODE_ERRNO(myname, myerrno, error_code_p) \ -*(error_code_p) = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_IO, \ - "System call I/O error", \ - "Syscall error from %s: %s", \ - myname, \ - strerror(myerrno)); - -#define MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname, key, error_code_p) \ -*(error_code_p) = MPIO_Err_create_code(MPI_SUCCESS, \ - MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, \ - MPI_ERR_NOT_SAME, \ - "Value for info key not same across processes", \ - "Value for info key %s not same across processes",\ - key); - - -/* TODO: handle the independent io case more gracefully */ -#define ADIOI_TEST_DEFERRED(fh, myname, error_code)\ - if(! (fh)->is_open ) {\ - ADIO_ImmediateOpen((fh), (error_code)); } - -/* Check MPI_Info object by calling MPI_Info_dup, if the info object is valid -then the dup operation will succeed */ -/* a collective check for error makes this macro collective */ -#define MPIO_CHECK_INFO_ALL(info, error_code, comm) { \ - MPI_Info dupinfo; \ - int tmp_err = MPI_SUCCESS; \ - if (info == MPI_INFO_NULL) { \ - dupinfo = MPI_INFO_NULL; \ - error_code = MPI_SUCCESS; \ - } else { \ - error_code = MPI_Info_dup(info, &dupinfo); \ - } \ - MPI_Allreduce(&error_code, &tmp_err, 1, MPI_INT, MPI_MAX, comm); \ - if(tmp_err != MPI_SUCCESS) { \ - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, \ - myname, __LINE__, MPI_ERR_OTHER, "**info", 0); \ - goto fn_fail; \ - } \ - if (dupinfo != MPI_INFO_NULL) { \ - MPI_Info_free(&dupinfo); \ - } \ -} diff --git a/3rd-party/romio321/adio/include/adioi_fs_proto.h b/3rd-party/romio321/adio/include/adioi_fs_proto.h deleted file mode 100644 index e3af9170821..00000000000 --- a/3rd-party/romio321/adio/include/adioi_fs_proto.h +++ /dev/null @@ -1,92 +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 ADIO_PROTO -#define ADIO_PROTO - -#ifdef ROMIO_NFS -extern struct ADIOI_Fns_struct ADIO_NFS_operations; -/* prototypes are in adio/ad_nfs/ad_nfs.h */ -#endif - -#ifdef ROMIO_PANFS -extern struct ADIOI_Fns_struct ADIO_PANFS_operations; -/* prototypes are in adio/ad_panfs/ad_panfs.h */ -#endif - -#ifdef ROMIO_PFS -extern struct ADIOI_Fns_struct ADIO_PFS_operations; -/* prototypes are in adio/ad_pfs/ad_pfs.h */ -#endif - -#ifdef ROMIO_PIOFS -extern struct ADIOI_Fns_struct ADIO_PIOFS_operations; -/* prototypes are in adio/ad_piofs/ad_piofs.h */ -#endif - -#ifdef ROMIO_UFS -extern struct ADIOI_Fns_struct ADIO_UFS_operations; -/* prototypes are in adio/ad_ufs/ad_ufs.h */ -#endif - -#ifdef ROMIO_HFS -extern struct ADIOI_Fns_struct ADIO_HFS_operations; -/* prototypes are in adio/ad_hfs/ad_hfs.h */ -#endif - -#ifdef ROMIO_XFS -extern struct ADIOI_Fns_struct ADIO_XFS_operations; -/* prototypes are in adio/ad_xfs/ad_xfs.h */ -#endif - -#ifdef ROMIO_SFS -extern struct ADIOI_Fns_struct ADIO_SFS_operations; -/* prototypes are in adio/ad_sfs/ad_sfs.h */ -#endif - -#ifdef ROMIO_LUSTRE -extern struct ADIOI_Fns_struct ADIO_LUSTRE_operations; -/* prototypes are in adio/ad_lustre/ad_lustre.h */ -#endif - -#ifdef ROMIO_NTFS -extern struct ADIOI_Fns_struct ADIO_NTFS_operations; -/* prototypes are in adio/ad_ntfs/ad_ntfs.h */ -#endif - -#ifdef ROMIO_PVFS -extern struct ADIOI_Fns_struct ADIO_PVFS_operations; -/* prototypes are in adio/ad_pvfs/ad_pvfs.h */ -#endif - -#ifdef ROMIO_PVFS2 -extern struct ADIOI_Fns_struct ADIO_PVFS2_operations; -/* prototypes are in adio/ad_pvfs2/ad_pvfs2.h */ -#endif - -#ifdef ROMIO_TESTFS -extern struct ADIOI_Fns_struct ADIO_TESTFS_operations; -/* prototypes are in adio/ad_testfs/ad_testfs.h */ -#endif - -#ifdef ROMIO_GPFS -extern struct ADIOI_Fns_struct ADIO_GPFS_operations; -/* prototypes are in adio/ad_gpfs/ad_gpfs.h */ -#endif - -#ifdef ROMIO_GRIDFTP -/* prototypes are in adio/ad_gridftp/ad_gridftp.h */ -extern struct ADIOI_Fns_struct ADIO_GRIDFTP_operations; -#endif - -#ifdef ROMIO_ZOIDFS -/* prototypes are in adio/ad_zoidfs/ad_zoidfs.h */ -extern struct ADIOI_Fns_struct ADIO_ZOIDFS_operations; -#endif - -#endif diff --git a/3rd-party/romio321/adio/include/heap-sort.h b/3rd-party/romio321/adio/include/heap-sort.h deleted file mode 100644 index 903a1e80606..00000000000 --- a/3rd-party/romio321/adio/include/heap-sort.h +++ /dev/null @@ -1,22 +0,0 @@ -#include "adio.h" - -typedef struct { - ADIO_Offset offset; - int proc; - ADIO_Offset reg_max_len; -} heap_node_t; - -typedef struct { - heap_node_t *nodes; - int size; -} heap_t; - -/*static inline int parent(heap_t *heap, int i); -static inline int left(heap_t *heap, int i); -static inline int right(heap_t *heap, int i); */ -void ADIOI_Heap_free(heap_t *heap); -int ADIOI_Heap_create(heap_t *heap, int size); -void ADIOI_Heap_insert(heap_t *heap, ADIO_Offset offset, int proc, - ADIO_Offset reg_max_len); -void ADIOI_Heap_extract_min(heap_t *heap, ADIO_Offset* key, int *proc, - ADIO_Offset *reg_max_len); diff --git a/3rd-party/romio321/adio/include/hint_fns.h b/3rd-party/romio321/adio/include/hint_fns.h deleted file mode 100644 index 7c20177deb9..00000000000 --- a/3rd-party/romio321/adio/include/hint_fns.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * (C) 2013 UChicago/Argonne LLC - * See COPYRIGHT in top-level directory. - */ - -#ifndef _HINT_FNS_H -#define _HINT_FNS_H - -int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *key, - int *local_cache, char *funcname, int *error_code); - -int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char *key, - int *local_cache, char *funcname, int *error_code); - -int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *key, - int *local_cache, char *funcname, int *error_code); - -int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key, - char **local_cache, char *funcname, int *error_code); - -#endif diff --git a/3rd-party/romio321/adio/include/mpio_error.h b/3rd-party/romio321/adio/include/mpio_error.h deleted file mode 100644 index f9d22b17219..00000000000 --- a/3rd-party/romio321/adio/include/mpio_error.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -/* MPI_ERR_FILE */ -#define MPIR_ERR_FILE_NULL 3 -#define MPIR_ERR_FILE_CORRUPT 5 - -/* MPI_ERR_AMODE */ -/* kind values set directly to 3,5,7 in mpi-io/open.c */ - -/* MPI_ERR_ARG */ -#define MPIR_ERR_OFFSET_ARG 65 -#define MPIR_ERR_DATAREP_ARG 67 -#define MPIR_ERR_COUNT_ARG 69 -#define MPIR_ERR_SIZE_ARG 71 -#define MPIR_ERR_WHENCE_ARG 73 -#define MPIR_ERR_FLAG_ARG 75 -#define MPIR_ERR_DISP_ARG 77 -#define MPIR_ERR_ETYPE_ARG 79 -#define MPIR_ERR_FILETYPE_ARG 81 -#define MPIR_ERR_SIZE_ARG_NOT_SAME 83 -#define MPIR_ERR_OFFSET_ARG_NEG 85 -#define MPIR_ERR_WHENCE_ARG_NOT_SAME 87 -#define MPIR_ERR_OFFSET_ARG_NOT_SAME 89 - -/* MPI_ERR_TYPE */ -#ifndef MPIR_ERR_TYPE_NULL -#define MPIR_ERR_TYPE_NULL 5 -#endif - -/* MPI_ERR_UNSUPPORTED_OPERATION */ -#define MPIR_ERR_NO_SHARED_FP 3 -#define MPIR_ERR_AMODE_SEQ 5 -#define MPIR_ERR_MODE_WRONLY 7 -#define MPIR_ERR_NO_MODE_SEQ 9 - -/* MPI_ERR_REQUEST */ -#ifndef MPIR_ERR_REQUEST_NULL -#define MPIR_ERR_REQUEST_NULL 3 -#endif - -/* MPI_ERR_IO */ -#define MPIR_ADIO_ERROR 1 /* used for strerror(errno) */ -#define MPIR_ERR_ETYPE_FRACTIONAL 3 -#define MPIR_ERR_NO_FSTYPE 5 -#define MPIR_ERR_NO_PFS 7 -#define MPIR_ERR_NO_PIOFS 9 -#define MPIR_ERR_NO_UFS 11 -#define MPIR_ERR_NO_NFS 13 -#define MPIR_ERR_NO_HFS 15 -#define MPIR_ERR_NO_XFS 17 -#define MPIR_ERR_NO_SFS 19 -#define MPIR_ERR_NO_PVFS 21 -#define MPIR_ERR_NO_PANFS 22 -#define MPIR_ERR_MULTIPLE_SPLIT_COLL 23 -#define MPIR_ERR_NO_SPLIT_COLL 25 -#define MPIR_ERR_ASYNC_OUTSTANDING 27 -#define MPIR_READ_PERM 29 -#define MPIR_PREALLOC_PERM 31 -#define MPIR_ERR_FILETYPE 33 -#define MPIR_ERR_NO_NTFS 35 -#define MPIR_ERR_NO_TESTFS 36 -#define MPIR_ERR_NO_LUSTRE 37 -#define MPIR_ERR_NO_BGL 38 - -/* MPI_ERR_COMM */ -#ifndef MPIR_ERR_COMM_NULL -#define MPIR_ERR_COMM_NULL 3 -#define MPIR_ERR_COMM_INTER 5 -#endif - -/* MPI_ERR_UNSUPPORTED_DATAREP */ -#define MPIR_ERR_NOT_NATIVE_DATAREP 3 - diff --git a/3rd-party/romio321/adio/include/mpipr.h b/3rd-party/romio321/adio/include/mpipr.h deleted file mode 100644 index 8b86c4cfe13..00000000000 --- a/3rd-party/romio321/adio/include/mpipr.h +++ /dev/null @@ -1,383 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -/* This file replaces all MPI function names with their PMPI equivalents. - PMPI versions are used by default so that the user can profile - application code without interference from MPI functions used by - MPI-IO. */ - -#ifndef USE_MPI_VERSIONS - -#undef MPI_Abort -#define MPI_Abort PMPI_Abort -#undef MPI_Allgather -#define MPI_Allgather PMPI_Allgather -#undef MPI_Allgatherv -#define MPI_Allgatherv PMPI_Allgatherv -#undef MPI_Allreduce -#define MPI_Allreduce PMPI_Allreduce -#undef MPI_Alltoall -#define MPI_Alltoall PMPI_Alltoall -#undef MPI_Alltoallv -#define MPI_Alltoallv PMPI_Alltoallv -#undef MPI_Alltoallw -#define MPI_Alltoallw PMPI_Alltoallw -#undef MPI_Attr_delete -#define MPI_Attr_delete PMPI_Attr_delete -#undef MPI_Attr_get -#define MPI_Attr_get PMPI_Attr_get -#undef MPI_Barrier -#define MPI_Barrier PMPI_Barrier -#undef MPI_Bcast -#define MPI_Bcast PMPI_Bcast -#undef MPI_Bsend -#define MPI_Bsend PMPI_Bsend -#undef MPI_Bsend_init -#define MPI_Bsend_init PMPI_Bsend_init -#undef MPI_Buffer_attach -#define MPI_Buffer_attach PMPI_Buffer_attach -#undef MPI_Buffer_detach -#define MPI_Buffer_detach PMPI_Buffer_detach -#undef MPI_Cancel -#define MPI_Cancel PMPI_Cancel -#undef MPI_Cart_coords -#define MPI_Cart_coords PMPI_Cart_coords -#undef MPI_Cart_create -#define MPI_Cart_create PMPI_Cart_create -#undef MPI_Cart_get -#define MPI_Cart_get PMPI_Cart_get -#undef MPI_Cart_map -#define MPI_Cart_map PMPI_Cart_map -#undef MPI_Cart_rank -#define MPI_Cart_rank PMPI_Cart_rank -#undef MPI_Cart_shift -#define MPI_Cart_shift PMPI_Cart_shift -#undef MPI_Cart_sub -#define MPI_Cart_sub PMPI_Cart_sub -#undef MPI_Cartdim_get -#define MPI_Cartdim_get PMPI_Cartdim_get -#undef MPI_Comm_call_errhandler -#define MPI_Comm_call_errhandler PMPI_Comm_call_errhandler -#undef MPI_Comm_compare -#define MPI_Comm_compare PMPI_Comm_compare -#undef MPI_Comm_create -#define MPI_Comm_create PMPI_Comm_create -#undef MPI_Comm_create_keyval -#define MPI_Comm_create_keyval PMPI_Comm_create_keyval -#undef MPI_Comm_dup -#define MPI_Comm_dup PMPI_Comm_dup -#undef MPI_Comm_free -#define MPI_Comm_free PMPI_Comm_free -#undef MPI_Comm_free_keyval -#define MPI_Comm_free_keyval PMPI_Comm_free_keyval -#undef MPI_Comm_group -#define MPI_Comm_group PMPI_Comm_group -#undef MPI_Comm_rank -#define MPI_Comm_rank PMPI_Comm_rank -#undef MPI_Comm_remote_group -#define MPI_Comm_remote_group PMPI_Comm_remote_group -#undef MPI_Comm_remote_size -#define MPI_Comm_remote_size PMPI_Comm_remote_size -#undef MPI_Comm_set_attr -#define MPI_Comm_set_attr PMPI_Comm_set_attr -#undef MPI_Comm_size -#define MPI_Comm_size PMPI_Comm_size -#undef MPI_Comm_split -#define MPI_Comm_split PMPI_Comm_split -#undef MPI_Comm_test_inter -#define MPI_Comm_test_inter PMPI_Comm_test_inter -#undef MPI_Dims_create -#define MPI_Dims_create PMPI_Dims_create -#undef MPI_Errhandler_create -#define MPI_Errhandler_create PMPI_Errhandler_create -#undef MPI_Errhandler_free -#define MPI_Errhandler_free PMPI_Errhandler_free -#undef MPI_Errhandler_get -#define MPI_Errhandler_get PMPI_Errhandler_get -#undef MPI_Errhandler_set -#define MPI_Errhandler_set PMPI_Errhandler_set -#undef MPI_Error_class -#define MPI_Error_class PMPI_Error_class -#undef MPI_Error_string -#define MPI_Error_string PMPI_Error_string -#undef MPI_Finalize -#define MPI_Finalize PMPI_Finalize -#undef MPI_Gather -#define MPI_Gather PMPI_Gather -#undef MPI_Gatherv -#define MPI_Gatherv PMPI_Gatherv -#undef MPI_Get_address -#define MPI_Get_address PMPI_Get_address -#undef MPI_Get_count -#define MPI_Get_count PMPI_Get_count -#undef MPI_Get_elements -#define MPI_Get_elements PMPI_Get_elements -#undef MPI_Get_processor_name -#define MPI_Get_processor_name PMPI_Get_processor_name -#undef MPI_Get_version -#define MPI_Get_version PMPI_Get_version -#undef MPI_Graph_create -#define MPI_Graph_create PMPI_Graph_create -#undef MPI_Graph_get -#define MPI_Graph_get PMPI_Graph_get -#undef MPI_Graph_map -#define MPI_Graph_map PMPI_Graph_map -#undef MPI_Graph_neighbors -#define MPI_Graph_neighbors PMPI_Graph_neighbors -#undef MPI_Graph_neighbors_count -#define MPI_Graph_neighbors_count PMPI_Graph_neighbors_count -#undef MPI_Graphdims_get -#define MPI_Graphdims_get PMPI_Graphdims_get -#undef MPI_Group_compare -#define MPI_Group_compare PMPI_Group_compare -#undef MPI_Group_difference -#define MPI_Group_difference PMPI_Group_difference -#undef MPI_Group_excl -#define MPI_Group_excl PMPI_Group_excl -#undef MPI_Group_free -#define MPI_Group_free PMPI_Group_free -#undef MPI_Group_incl -#define MPI_Group_incl PMPI_Group_incl -#undef MPI_Group_intersection -#define MPI_Group_intersection PMPI_Group_intersection -#undef MPI_Group_range_excl -#define MPI_Group_range_excl PMPI_Group_range_excl -#undef MPI_Group_range_incl -#define MPI_Group_range_incl PMPI_Group_range_incl -#undef MPI_Group_rank -#define MPI_Group_rank PMPI_Group_rank -#undef MPI_Group_size -#define MPI_Group_size PMPI_Group_size -#undef MPI_Group_translate_ranks -#define MPI_Group_translate_ranks PMPI_Group_translate_ranks -#undef MPI_Group_union -#define MPI_Group_union PMPI_Group_union -#undef MPI_Ibsend -#define MPI_Ibsend PMPI_Ibsend -#undef MPI_Init -#define MPI_Init PMPI_Init -#undef MPI_Initialized -#define MPI_Initialized PMPI_Initialized -#undef MPI_Intercomm_create -#define MPI_Intercomm_create PMPI_Intercomm_create -#undef MPI_Intercomm_merge -#define MPI_Intercomm_merge PMPI_Intercomm_merge -#undef MPI_Iprobe -#define MPI_Iprobe PMPI_Iprobe -#undef MPI_Irecv -#define MPI_Irecv PMPI_Irecv -#undef MPI_Irsend -#define MPI_Irsend PMPI_Irsend -#undef MPI_Isend -#define MPI_Isend PMPI_Isend -#undef MPI_Issend -#define MPI_Issend PMPI_Issend -#undef MPI_Name_get -#define MPI_Name_get PMPI_Name_get -#undef MPI_Name_put -#define MPI_Name_put PMPI_Name_put -#undef MPI_Op_create -#define MPI_Op_create PMPI_Op_create -#undef MPI_Op_free -#define MPI_Op_free PMPI_Op_free -#undef MPI_Pack -#define MPI_Pack PMPI_Pack -#undef MPI_Pack_size -#define MPI_Pack_size PMPI_Pack_size -#undef MPI_Pcontrol -#define MPI_Pcontrol PMPI_Pcontrol -#undef MPI_Probe -#define MPI_Probe PMPI_Probe -#undef MPI_Recv -#define MPI_Recv PMPI_Recv -#undef MPI_Recv_init -#define MPI_Recv_init PMPI_Recv_init -#undef MPI_Reduce -#define MPI_Reduce PMPI_Reduce -#undef MPI_Reduce_scatter -#define MPI_Reduce_scatter PMPI_Reduce_scatter -#undef MPI_Request_c2f -#define MPI_Request_c2f PMPI_Request_c2f -#undef MPI_Request_free -#define MPI_Request_free PMPI_Request_free -#undef MPI_Rsend -#define MPI_Rsend PMPI_Rsend -#undef MPI_Rsend_init -#define MPI_Rsend_init PMPI_Rsend_init -#undef MPI_Scan -#define MPI_Scan PMPI_Scan -#undef MPI_Scatter -#define MPI_Scatter PMPI_Scatter -#undef MPI_Scatterv -#define MPI_Scatterv PMPI_Scatterv -#undef MPI_Send -#define MPI_Send PMPI_Send -#undef MPI_Send_init -#define MPI_Send_init PMPI_Send_init -#undef MPI_Sendrecv -#define MPI_Sendrecv PMPI_Sendrecv -#undef MPI_Sendrecv_replace -#define MPI_Sendrecv_replace PMPI_Sendrecv_replace -#undef MPI_Ssend -#define MPI_Ssend PMPI_Ssend -#undef MPI_Ssend_init -#define MPI_Ssend_init PMPI_Ssend_init -#undef MPI_Start -#define MPI_Start PMPI_Start -#undef MPI_Startall -#define MPI_Startall PMPI_Startall -#undef MPI_Test -#define MPI_Test PMPI_Test -#undef MPI_Test_cancelled -#define MPI_Test_cancelled PMPI_Test_cancelled -#undef MPI_Testall -#define MPI_Testall PMPI_Testall -#undef MPI_Testany -#define MPI_Testany PMPI_Testany -#undef MPI_Testsome -#define MPI_Testsome PMPI_Testsome -#undef MPI_Topo_status -#define MPI_Topo_status PMPI_Topo_status -#undef MPI_Topo_test -#define MPI_Topo_test PMPI_Topo_test -#undef MPI_Type_commit -#define MPI_Type_commit PMPI_Type_commit -#undef MPI_Type_contiguous -#define MPI_Type_contiguous PMPI_Type_contiguous -#undef MPI_Type_count -#define MPI_Type_count PMPI_Type_count -#undef MPI_Type_create_struct -#define MPI_Type_create_struct PMPI_Type_create_struct -#undef MPI_Type_create_resized -#define MPI_Type_create_resized PMPI_Type_create_resized -/* #define MPI_Type_create_darray PMPI_Type_create_darray */ -#undef MPI_Type_create_indexed_block -#define MPI_Type_create_indexed_block PMPI_Type_create_indexed_block -#undef MPI_Type_create_hindexed -#define MPI_Type_create_hindexed PMPI_Type_create_hindexed -#undef MPI_Type_create_hindexed_block -#define MPI_Type_create_hindexed_block PMPI_Type_create_hindexed_block -#undef MPI_Type_create_hvector -#define MPI_Type_create_hvector PMPI_Type_create_hvector -/* #define MPI_Type_create_subarray PMPI_Type_create_subarray */ -#undef MPI_Type_get_extent -#define MPI_Type_get_extent PMPI_Type_get_extent -#undef MPI_Type_free -#define MPI_Type_free PMPI_Type_free -#undef MPI_Type_get_contents -#define MPI_Type_get_contents PMPI_Type_get_contents -#undef MPI_Type_get_envelope -#define MPI_Type_get_envelope PMPI_Type_get_envelope -#undef MPI_Type_get_true_extent -#define MPI_Type_get_true_extent PMPI_Type_get_true_extent -#undef MPI_Type_indexed -#define MPI_Type_indexed PMPI_Type_indexed -#undef MPI_Type_size -#define MPI_Type_size PMPI_Type_size -#undef MPI_Type_vector -#define MPI_Type_vector PMPI_Type_vector -#undef MPI_Unpack -#define MPI_Unpack PMPI_Unpack -#undef MPI_Wait -#define MPI_Wait PMPI_Wait -#undef MPI_Waitall -#define MPI_Waitall PMPI_Waitall -#undef MPI_Waitany -#define MPI_Waitany PMPI_Waitany -#undef MPI_Waitsome -#define MPI_Waitsome PMPI_Waitsome -#undef MPI_Wtick -#define MPI_Wtick PMPI_Wtick -#undef MPI_Wtime -#define MPI_Wtime PMPI_Wtime - -/* commented out because these could be macros themselves, as in MPICH -#undef MPI_Type_c2f -#define MPI_Type_c2f PMPI_Type_c2f -#undef MPI_Type_f2c -#define MPI_Type_f2c PMPI_Type_f2c -#undef MPI_Comm_c2f -#define MPI_Comm_c2f PMPI_Comm_c2f -#undef MPI_Comm_f2c -#define MPI_Comm_f2c PMPI_Comm_f2c -#undef MPI_Group_c2f -#define MPI_Group_c2f PMPI_Group_c2f -#undef MPI_Group_f2c -#define MPI_Group_f2c PMPI_Group_f2c -#undef MPI_Op_c2f -#define MPI_Op_c2f PMPI_Op_c2f -#undef MPI_Op_f2c -#define MPI_Op_f2c PMPI_Op_f2c -#undef MPI_Request_c2f -#define MPI_Request_c2f PMPI_Request_c2f -#undef MPI_Request_f2c -#define MPI_Request_f2c PMPI_Request_f2c -#undef MPI_Win_c2f -#define MPI_Win_c2f PMPI_Win_c2f -#undef MPI_Win_f2c -#define MPI_Win_f2c PMPI_Win_f2c -*/ -#undef MPI_Status_c2f -#define MPI_Status_c2f PMPI_Status_c2f -#undef MPI_Status_f2c -#define MPI_Status_f2c PMPI_Status_f2c - -#undef MPI_Status_set_elements -#define MPI_Status_set_elements PMPI_Status_set_elements - -#ifndef HAVE_MPI_INFO_SRC /* everywhere except in info source directory */ -#undef MPI_Info_create -#define MPI_Info_create PMPI_Info_create -#undef MPI_Info_set -#define MPI_Info_set PMPI_Info_set -#undef MPI_Info_delete -#define MPI_Info_delete PMPI_Info_delete -#undef MPI_Info_get -#define MPI_Info_get PMPI_Info_get -#undef MPI_Info_get_valuelen -#define MPI_Info_get_valuelen PMPI_Info_get_valuelen -#undef MPI_Info_get_nkeys -#define MPI_Info_get_nkeys PMPI_Info_get_nkeys -#undef MPI_Info_get_nthkey -#define MPI_Info_get_nthkey PMPI_Info_get_nthkey -#undef MPI_Info_dup -#define MPI_Info_dup PMPI_Info_dup -#undef MPI_Info_free -#define MPI_Info_free PMPI_Info_free -/* #undef MPI_Info_c2f -#define MPI_Info_c2f PMPI_Info_c2f -#undef MPI_Info_f2c -#define MPI_Info_f2c PMPI_Info_f2c -*/ -#endif -#undef MPI_Grequest_start -#define MPI_Grequest_start PMPI_Grequest_start -#undef MPI_Grequest_complete -#define MPI_Grequest_complete PMPI_Grequest_complete -#undef MPI_Status_set_cancelled -#define MPI_Status_set_cancelled PMPI_Status_set_cancelled - -#undef MPIX_Grequest_class_create -#define MPIX_Grequest_class_create PMPIX_Grequest_class_create -#undef MPIX_Grequest_class_allocate -#define MPIX_Grequest_class_allocate PMPIX_Grequest_class_allocate - -#ifdef MPIO_FORTRAN_SRC /* only in MPI-IO Fortran source directory */ -#undef MPI_File_c2f -#define MPI_File_c2f PMPI_File_c2f -#undef MPI_File_f2c -#define MPI_File_f2c PMPI_File_f2c -#endif - -#undef MPI_Type_get_attr -#define MPI_Type_get_attr PMPI_Type_get_attr -#undef MPI_Type_set_attr -#define MPI_Type_set_attr PMPI_Type_set_attr -#undef MPI_Comm_set_attr -#define MPI_Comm_set_attr PMPI_Comm_set_attr -#undef MPI_Type_create_keyval -#define MPI_Type_create_keyval PMPI_Type_create_keyval - -#endif diff --git a/3rd-party/romio321/adio/include/mpiu_external32.h b/3rd-party/romio321/adio/include/mpiu_external32.h deleted file mode 100644 index 43023737741..00000000000 --- a/3rd-party/romio321/adio/include/mpiu_external32.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * (C) 2012 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#ifndef _MPIU_EXTERNAL32_H_ -#define _MPIU_EXTERNAL32_H_ - -int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datatype, - int count, void *filebuf); -int MPIU_read_external32_conversion_fn(void *userbuf, MPI_Datatype datatype, - int count, void *filebuf); -int MPIU_datatype_full_size(MPI_Datatype datatype, MPI_Aint *size); - -/* given a buffer, count, and datatype, return an apropriately sized and - * * external32-formatted buffer, suitable for handing off to a subsequent write - * * routine */ -int MPIU_external32_buffer_setup(const void * buf, int count, MPI_Datatype type, void **newbuf); - -#endif diff --git a/3rd-party/romio321/adio/include/mpiu_greq.h b/3rd-party/romio321/adio/include/mpiu_greq.h deleted file mode 100644 index e3fce1c41d8..00000000000 --- a/3rd-party/romio321/adio/include/mpiu_greq.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * (C) 2003 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#ifndef _MPIU_GREQUEST_H -#define _MPIU_GREQUEST_H - -int MPIU_Greq_query_fn(void *extra_state, MPI_Status *status); -int MPIU_Greq_free_fn(void *extra_state); -int MPIU_Greq_cancel_fn(void *extra_state, int complete); - -#endif diff --git a/3rd-party/romio321/adio/include/nopackage.h b/3rd-party/romio321/adio/include/nopackage.h deleted file mode 100644 index 184e4b4ac84..00000000000 --- a/3rd-party/romio321/adio/include/nopackage.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * (C) 2011 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -/* See comments in MPICH's configure.ac for an explanation of what this file is - * and why it exists. */ - -/* intentionally omitting any #ifndef guard, repeated inclusion is intentional */ -#undef PACKAGE -#undef PACKAGE_BUGREPORT -#undef PACKAGE_NAME -#undef PACKAGE_STRING -#undef PACKAGE_TARNAME -#undef PACKAGE_URL -#undef PACKAGE_VERSION - diff --git a/3rd-party/romio321/adio/include/romioconf-undefs.h b/3rd-party/romio321/adio/include/romioconf-undefs.h deleted file mode 100644 index 5c21607a4ee..00000000000 --- a/3rd-party/romio321/adio/include/romioconf-undefs.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef ROMIO_CONF_UNDEFS_H -#define ROMIO_CONF_UNDEFS_H - -/* Need to add some undefs here so that we don't conflict with the - * main ompi_config.h. Arrgh. Stupid autoconf not giving us the option - * to not define these macros... grumble... - */ -#if defined(PACKAGE_BUGREPORT) -#undef PACKAGE_BUGREPORT -#endif -#if defined(PACKAGE_NAME) -#undef PACKAGE_NAME -#endif -#if defined(PACKAGE_STRING) -#undef PACKAGE_STRING -#endif -#if defined(PACKAGE_TARNAME) -#undef PACKAGE_TARNAME -#endif -#if defined(PACKAGE_VERSION) -#undef PACKAGE_VERSION -#endif -#if defined(PACKAGE_URL) -#undef PACKAGE_URL -#endif - -#endif /* ROMIOCONF_UNDEFS_H */ diff --git a/3rd-party/romio321/autogen.sh b/3rd-party/romio321/autogen.sh deleted file mode 100755 index dcc84c738a7..00000000000 --- a/3rd-party/romio321/autogen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -${AUTORECONF:-autoreconf} ${autoreconf_args:-"-vif"} -I confdb diff --git a/3rd-party/romio321/confdb/aclocal_am.m4 b/3rd-party/romio321/confdb/aclocal_am.m4 deleted file mode 100644 index 4d3b0de2257..00000000000 --- a/3rd-party/romio321/confdb/aclocal_am.m4 +++ /dev/null @@ -1,6 +0,0 @@ -dnl AM_IGNORE is an extension that tells (a patched) automake not to -dnl include the specified AC_SUBST variable in the Makefile.in that -dnl automake generates. We don't use AC_DEFUN, since aclocal will -dnl then complain that AM_IGNORE is a duplicate (if you are using the -dnl patched automake/aclocal). -m4_ifdef([AM_IGNORE],[],[m4_define([AM_IGNORE],[])]) diff --git a/3rd-party/romio321/confdb/aclocal_atomic.m4 b/3rd-party/romio321/confdb/aclocal_atomic.m4 deleted file mode 100644 index 4e96cfbf366..00000000000 --- a/3rd-party/romio321/confdb/aclocal_atomic.m4 +++ /dev/null @@ -1,227 +0,0 @@ -dnl /*D PAC_C_MEMATOMIC - Try and determine how to implement memory-atomic -dnl operations with the selected C compiler -dnl -dnl Synopsis: -dnl PAC_C_MEMATOMIC -dnl -dnl Notes: -dnl Defines names of the following form -dnl + HAVE_GCC_ASM_AND_X86_{MFENCE,LFENCE,SFENCE} - gcc __asm__ will issue -dnl mfence, lfence, or sfence -dnl . HAVE___ASM_AND_X86_{MFENCE,LFENCE,SFENCE} - __asm _emit will issue -dnl mfence, lfence, or sfence -dnl . HAVE_ASM_AND_X86_{MFENCE,LFENCE,SFENCE} - asm("...") will issue -dnl mfence, lfence, or sfence -dnl . HAVE__INTERLOCKEDEXCHANGE - _InterlockedExchange intrinsic is available -dnl (IA64) -dnl . HAVE_GCC_ASM_SPARC_MEMBAR - gcc __asm__ will issue SPARC architecture -dnl memory barrier instruction -dnl . HAVE_SOLARIS_ASM_SPARC_MEMBAR - Solaris asm() will issue SPARC -dnl architecture memory barrier instruction -dnl . HAVE_GCC_ASM_SPARC_STBAR - gcc __asm__ will issue stbar -dnl - HAVE_SOLARIS_ASM_SPARC_STBAR - Solaris __asm() will issue stbar -dnl -dnl D*/ -AC_DEFUN([PAC_C_MEMATOMIC],[ -AC_CACHE_CHECK([for x86 mfence instruction using __asm__], - pac_cv_have_gcc_asm_and_x86_mfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xf0" ::: "memory" ); - exit(0); -} -], -pac_cv_have_gcc_asm_and_x86_mfence=yes,pac_cv_have_gcc_asm_and_x86_mfence=no)]) - -if test "$pac_cv_have_gcc_asm_and_x86_mfence" = "yes" ; then - AC_DEFINE(HAVE_GCC_ASM_AND_X86_MFENCE, 1, [Define if using gcc on a x86 system with the mfence instruction]) -fi - -AC_CACHE_CHECK([for x86 sfence instruction using __asm__], - pac_cv_have_gcc_asm_and_x86_sfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xf8" ::: "memory" ); - exit(0); -} -], -pac_cv_have_gcc_asm_and_x86_sfence=yes,pac_cv_have_gcc_asm_and_x86_sfence=no)]) - -if test "$pac_cv_have_gcc_asm_and_x86_sfence" = "yes" ; then - AC_DEFINE(HAVE_GCC_ASM_AND_X86_SFENCE, 1, [Define if using gcc on a x86 system with the sfence instruction]) -fi - -AC_CACHE_CHECK([for x86 lfence instruction using __asm__], - pac_cv_have_gcc_asm_and_x86_lfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xe8" ::: "memory" ); - exit(0); -} -], -pac_cv_have_gcc_asm_and_x86_lfence=yes,pac_cv_have_gcc_asm_and_x86_lfence=no)]) - -if test "$pac_cv_have_gcc_asm_and_x86_lfence" = "yes" ; then - AC_DEFINE(HAVE_GCC_ASM_AND_X86_LFENCE, 1, [Define if using gcc on a x86 system with the lfence instruction]) -fi - -dnl Some compilers, like icc, may want __asm _emit -AC_CACHE_CHECK([for x86 mfence instruction using __asm], - pac_cv_have___asm_and_x86_mfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - __asm _emit 0x0f __asm _emit 0xae __asm _emit 0xf0 ; - exit(0); -} -], -pac_cv_have___asm_and_x86_mfence=yes,pac_cv_have___asm_and_x86_mfence=no)]) - -if test "$pac_cv_have___asm_and_x86_mfence" = "yes" ; then - AC_DEFINE(HAVE___ASM_AND_X86_MFENCE, 1, [Define if using __asm on a x86 system with the mfence instruction]) -fi - -AC_CACHE_CHECK([for x86 sfence instruction using __asm], - pac_cv_have___asm_and_x86_sfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - __asm sfence ; - exit(0); -} -], -pac_cv_have___asm_and_x86_sfence=yes,pac_cv_have___asm_and_x86_sfence=no)]) - -if test "$pac_cv_have___asm_and_x86_sfence" = "yes" ; then - AC_DEFINE(HAVE___ASM_AND_X86_SFENCE, 1, [Define if using __asm on a x86 system with the sfence instruction]) -fi - -AC_CACHE_CHECK([for x86 lfence instruction using __asm], - pac_cv_have___asm_and_x86_lfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - __asm _emit 0x0f __asm _emit 0xae __asm _emit 0xe8 ; - exit(0); -} -], -pac_cv_have___asm_and_x86_lfence=yes,pac_cv_have___asm_and_x86_lfence=no)]) - -if test "$lac_cv_have___asm_and_x86_lfence" = "yes" ; then - AC_DEFINE(HAVE___ASM_AND_X86_LFENCE, 1, [Define if using __asm on a x86 system with the lfence instruction]) -fi - -dnl -dnl Some compilers, such as pgcc, may require additional arguments. -dnl pgcc may need -Masmkeyword flag. We may want to try this with and -dnl without adding -Masmkeyword to CFLAGS - -AC_CACHE_CHECK([for x86 mfence instruction using asm()], - pac_cv_have_asm_and_x86_mfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - asm("_emit 0x0f __asm _emit 0xae __asm _emit 0xf0"); - exit(0); -} -], -pac_cv_have_asm_and_x86_mfence=yes,pac_cv_have_asm_and_x86_mfence=no)]) - -if test "$pac_cv_have_asm_and_x86_mfence" = "yes" ; then - AC_DEFINE(HAVE_ASM_AND_X86_MFENCE, 1, [Define if using asm() on a x86 system with the mfence instruction]) -fi - -AC_CACHE_CHECK([for x86 sfence instruction using asm()], - pac_cv_have_asm_and_x86_sfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - asm("sfence"); - exit(0); -} -], -pac_cv_have_asm_and_x86_sfence=yes,pac_cv_have_asm_and_x86_sfence=no)]) - -if test "$pac_cv_have_asm_and_x86_sfence" = "yes" ; then - AC_DEFINE(HAVE_ASM_AND_X86_SFENCE, 1, [Define if using asm() on a x86 system with the sfence instruction]) -fi - -AC_CACHE_CHECK([for x86 lfence instruction using asm()], - pac_cv_have_asm_and_x86_lfence,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - asm("_emit 0x0f __asm _emit 0xae __asm _emit 0xe8"); - exit(0); -} -], -pac_cv_have_asm_and_x86_lfence=yes,pac_cv_have_asm_and_x86_lfence=no)]) - -if test "$pac_cv_have_asm_and_x86_lfence" = "yes" ; then - AC_DEFINE(HAVE_ASM_AND_X86_LFENCE, 1, [Define if using asm() on a x86 system with the lfence instruction]) -fi - -AC_CACHE_CHECK([for _InterlockedExchange intrinsic], - pac_cv_have__InterlockedExchange,[ -AC_TRY_RUN([ -int main(int argc, char **argv) -{ - unsigned long lock, *lock_ptr; - lock_ptr = &lock; - _InterlockedExchange(lock_ptr, 1); - exit(0); -} -], -pac_cv_have__InterlockedExchange=yes,pac_cv_have__InterlockedExchange=no)]) - -if test "$pac_cv_have__InterlockedExchange" = "yes" ; then - AC_DEFINE(HAVE__INTERLOCKEDEXCHANGE, 1, [Define if _InterlockedExchange intrinsic is available]) -fi - -AC_CACHE_CHECK([for SPARC membar instruction with gcc], - pac_cv_gcc_sparc_membar,[ -AC_TRY_RUN([ -int main(int argc, char **argv){ - __asm__ __volatile__ ( "membar #StoreLoad | #StoreStore" : : : "memory" ); - exit(0); -}],pac_cv_gcc_sparc_membar=yes,pac_cv_gcc_sparc_membar=no)]) -if test "$pac_cv_gcc_sparc_membar" = yes ; then - AC_DEFINE(HAVE_GCC_ASM_SPARC_MEMBAR,1,[Define if gcc asm membar supported]) -fi - -AC_CACHE_CHECK([for SPARC membar instruction with Solaris C], - pac_cv_solaris_sparc_membar,[ -AC_TRY_RUN([ -int main(int argc, char **argv){ - __asm ( "membar #StoreLoad | #StoreStore"); - exit(0); -}],pac_cv_solaris_sparc_membar=yes,pac_cv_solaris_sparc_membar=no)]) -if test "$pac_cv_solaris_sparc_membar" = yes ; then - AC_DEFINE(HAVE_SOLARIS_ASM_SPARC_MEMBAR,1,[Define if solaris asm membar supported]) -fi - -AC_CACHE_CHECK([for SPARC stbar instruction with gcc], - pac_cv_gcc_sparc_stbar,[ -AC_TRY_RUN([ -int main(int argc, char **argv){ - __asm__ __volatile__ ( "stbar" : : : "memory" ); - exit(0); -}],pac_cv_gcc_sparc_stbar=yes,pac_cv_gcc_sparc_stbar=no)]) -if test "$pac_cv_gcc_sparc_stbar" = yes ; then - AC_DEFINE(HAVE_GCC_ASM_SPARC_STBAR,1,[Define if gcc asm stbar supported]) -fi - -AC_CACHE_CHECK([for SPARC stbar instruction with Solaris C], - pac_cv_solaris_sparc_stbar,[ -AC_TRY_RUN([ -int main(int argc, char **argv){ - __asm ( "stbar" ); - exit(0); -}],pac_cv_solaris_sparc_stbar=yes,pac_cv_solaris_sparc_stbar=no)]) -if test "$pac_cv_solaris_sparc_stbar" = yes ; then - AC_DEFINE(HAVE_SOLARIS_ASM_SPARC_STBAR,1,[Define if solaris asm stbar supported]) -fi -]) \ No newline at end of file diff --git a/3rd-party/romio321/confdb/aclocal_attr_alias.m4 b/3rd-party/romio321/confdb/aclocal_attr_alias.m4 deleted file mode 100644 index 32f016546dc..00000000000 --- a/3rd-party/romio321/confdb/aclocal_attr_alias.m4 +++ /dev/null @@ -1,504 +0,0 @@ -dnl -dnl Check for BSD or POSIZ style global symbol lister, nm. -dnl If found, pac_path_NM_G contains the absolute athname of nm + options -dnl pac_path_NM_G_type will be either POSIX or BSD. NM_G will be -dnl pac_path_NM_G without the absolute path. Preference is BSD style. -dnl -dnl The test checks if nm accepts the known options and also if nm produces -dnl the expected BSD or POSIX output format. -dnl -AC_DEFUN([PAC_PATH_NM_G],[ -AC_MSG_CHECKING([for BSD/POSIX style global symbol lister]) -AC_LANG_PUSH(C) -AC_PATH_PROGS_FEATURE_CHECK(NM_G, nm, [ - # Check if nm accepts -g and BSD or POSIX compatible flag. - # Use the `sed 1q' to avoid HP-UX's unknown option message: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # - # AIX's sed does not accept \+, 1) instead of doing 's|a\+||', do 's|aa*||' - # or 2) instead of 's|A \+B|AB|g', do 's|A *B|AB|g' - - # Check if nm accepts -g - case `${ac_path_NM_G} -g /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - ac_path_NM_G="${ac_path_NM_G} -g" - # Check if nm accepts -B - case `${ac_path_NM_G} -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([int iglobal;]) - ],[ - changequote(,) - case `${ac_path_NM_G} -B conftest.$OBJEXT | sed -e 's|[0-9][0-9]* *[A-Z] *iglobal|XXXX|g'` in - *XXXX*) - pac_path_NM_G="${ac_path_NM_G} -B" - pac_path_NM_G_type="BSD" - ;; - esac - changequote([,]) - ]) - ;; - *) - # Check if nm accepts -P - case `${ac_path_NM_G} -P /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([int iglobal;]) - ],[ - changequote(,) - case `${ac_path_NM_G} -P conftest.$OBJEXT | sed -e 's|iglobal *[A-Z] *[0-9][0-9]*|XXXX|g'` in - *XXXX*) - pac_path_NM_G="${ac_path_NM_G} -P" - pac_path_NM_G_type="POSIX" - ;; - esac - changequote([,]) - ]) - ;; - esac # Endof case `${ac_path_NM_G} -P - ;; - esac # Endof case `${ac_path_NM_G} -B - ;; - esac # Endof case `${ac_path_NM_G} -g - if test "X$pac_path_NM_G" != "X" ; then - AC_MSG_RESULT([$pac_path_NM_G_type style,$pac_path_NM_G]) - NM_G="`echo $pac_path_NM_G | sed -e 's|^.*nm |nm |g'`" - else - AC_MSG_RESULT(no) - fi - ac_cv_path_NM_G=${ac_path_NM_G} - ac_path_NM_G_found=: -], [AC_MSG_RESULT(no)], -[$PATH$PATH_SEPARATOR/usr/ccs/bin/elf$PATH_SEPARATOR/usr/ccs/bin$PATH_SEPARATOR/usr/ucb$PATH_SEPARATOR/bin]) -AC_LANG_POP(C) -]) dnl Endof AC_DEFUN([PAC_PATH_NM_G] -dnl -dnl PAC_C_MULTI_ATTR_ALIAS() -dnl -dnl The checks if multiple __attribute__((alias)) is available -dnl If the multiple __attribute((alias)) support is found, -dnl pac_c_multi_attr_alias=yes is set. -dnl -dnl The default is to do a runtime test. When cross_compiling=yes, -dnl pac_path_NM_G will be used to determine the test result. -dnl If CFLAGS(or CPPFLAGS) contains ATTR_ALIAS_DEBUG, the runtime will print -dnl out addresses of struct(s) for debugging purpose. -dnl -dnl -AC_DEFUN([PAC_C_MULTI_ATTR_ALIAS],[ -AC_REQUIRE([PAC_PATH_NM_G]) -AC_LANG_PUSH(C) -AC_CHECK_HEADERS([stdio.h]) -AC_MSG_CHECKING([for multiple __attribute__((alias)) support]) - -#Compile the "other" __attribute__ object file. -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif - -struct mpif_cmblk_t_ { int imember; }; -typedef struct mpif_cmblk_t_ mpif_cmblk_t; - -/* NOT initialize these structure so it appears in BSS or as COMMON symbols */ -mpif_cmblk_t mpifcmb; -mpif_cmblk_t MPIFCMB; - -/* - Do the test in this file instead in the file - where __attribute__((alias)) is used. - This is needed for pgcc since pgcc seems to - define aliased symbols if they are in the same file. -*/ -/* - We can't do the following comparision in one test: - - ilogical = (( &mpifcmb == ptr && &MPIFCMB == ptr ) ? TRUE : FALSE) ; - - because some compiler, like gcc 4.4.2's -O* optimizes the code - such that the ilogical expression is FALSE. The likely reason is that - mpifcmb and MPIFCMB are defined in the same scope in which C optimizer - may have treated them as different objects (with different addresses), - &mpifcmb != &MPIFCMB, before actually running the test and hence the - illogical expression is assumed to be always FALSE. The solution taken - here is to prevent the optimizer the opportunity to equate &mpifcmb and - &MPIFCMB (in same scope), e.g. using 2 separate tests and combine the - test results in a different scope. -*/ -int same_addrs1( void *ptr ); -int same_addrs1( void *ptr ) -{ -#if defined(ATTR_ALIAS_DEBUG) - printf( "others: addr(mpifcmb)=%p, addr(input ptr)=%p\n", &mpifcmb, ptr ); -#endif - return ( &mpifcmb == ptr ? 1 : 0 ); -} - -int same_addrs2( void *ptr ); -int same_addrs2( void *ptr ) -{ -#if defined(ATTR_ALIAS_DEBUG) - printf( "others: addr(MPIFCMB)=%p, addr(input ptr)=%p\n", &MPIFCMB, ptr ); -#endif - return ( &MPIFCMB == ptr ? 1 : 0 ); -} - - ]) -],[ - rm -f pac_conftest_other.$OBJEXT - PAC_RUNLOG([cp conftest.$OBJEXT pac_conftest_other.$OBJEXT]) - test -s pac_conftest_other.$OBJEXT && pac_c_attr_alias_other=yes -dnl cp conftest.$ac_ext pac_conftest_other.$ac_ext -dnl echo -dnl echo "pac_conftest_other.$OBJEXT" -dnl nm -P -g pac_conftest_other.$OBJEXT | grep -i "mpifcmb" -],[ - pac_c_attr_alias_other=no -]) dnl Endof AC_COMPILE_IFELSE - -pac_c_attr_alias_main=no -if test "$pac_c_attr_alias_other" = "yes" ; then - -# Push LIBS for later restoration. - PAC_PUSH_FLAG([LIBS]) - LIBS="pac_conftest_other.$OBJEXT $LIBS" - -# Link the "other" __attribute__ object file. - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif - -struct mpif_cmblk_t_ { int imember; }; -typedef struct mpif_cmblk_t_ mpif_cmblk_t; - -mpif_cmblk_t mpifcmbr = {0}; -extern mpif_cmblk_t MPIFCMB __attribute__ ((alias("mpifcmbr"))); -extern mpif_cmblk_t mpifcmb __attribute__ ((alias("mpifcmbr"))); - -extern int same_addrs1( void *ptr ); -extern int same_addrs2( void *ptr ); - - ],[ - int iaddr = 0; -#if defined(ATTR_ALIAS_DEBUG) - printf( "main: addr(mpifcmbr) = %p\n", &mpifcmbr ); - printf( "main: addr(mpifcmb) = %p\n", &mpifcmb ); - printf( "main: addr(MPIFCMB) = %p\n", &MPIFCMB ); -#endif - iaddr = same_addrs1( &mpifcmbr ) && same_addrs2( &mpifcmbr ); - FILE *file = fopen( "pac_conftestval", "w" ); - if (!file) return 1; - fprintf( file, "%d\n", iaddr ); - ]) - ],[ - rm -f pac_conftest_main$EXEEXT - PAC_RUNLOG([cp conftest$EXEEXT pac_conftest_main$EXEEXT]) - test -x pac_conftest_main$EXEEXT && pac_c_attr_alias_main=yes -dnl cp conftest.$ac_ext pac_conftest_main.$ac_ext -dnl echo -dnl echo "pac_conftest_main$EXEEXT" -dnl nm -P -g pac_conftest_main$EXEEXT | grep -i "mpifcmb" - ],[ - pac_c_attr_alias_main=no -dnl cp conftest.$ac_ext pac_conftest_main.$ac_ext - ]) dnl Endof AC_LINK_IFELSE - -# Restore the previously pushed LIBS - PAC_POP_FLAG([LIBS]) - rm -f pac_conftest_other.$OBJEXT -fi dnl Endof if test "$pac_c_attr_alias_other" = "yes" - -if test "$pac_c_attr_alias_main" = "yes" ; then - if test "$cross_compiling" = "yes" ; then - changequote(,) - # echo "PAC CROSS-COMPILING" dnl - # POSIX NM = nm -P format dnl - if test "$pac_path_NM_G_type" = "POSIX" ; then - addrs=`${pac_path_NM_G} ./pac_conftest_main$EXEEXT | grep -i mpifcmb | sed -e 's% *[a-zA-Z][a-zA-Z]* *[a-zA-Z] *\([0-9abcdef][0-9abcdef]*\).*%\1%g'` - fi - - # BSD NM = nm -B format dnl - if test "$pac_path_NM_G_type" = "BSD" ; then - addrs=`${pac_path_NM_G} -g ./pac_conftest_main$EXEEXT | grep -i mpifcmb | sed -e "s% *\([0-9abcdef][0-9abcdef]*\) *[a-zA-Z] *[a-zA-Z][a-zA-A]*.*%\1%g"` - fi - changequote([,]) - - cmp_addr="" - diff_addrs=no - for addr in ${addrs} ; do - if test "X${cmp_addr}" != "X" ; then - if test "${cmp_addr}" != "${addr}" ; then - diff_addrs=yes - break - fi - else - cmp_addr=${addr} - fi - done - - if test "$diff_addrs" != "yes" ; then - dnl echo "Same addresses. Multiple aliases support" - AC_MSG_RESULT([${NM_G} says yes]) - pac_c_multi_attr_alias=yes - else - dnl echo "Different addresses. No multiple aliases support." - AC_MSG_RESULT([${NM_G} says no]) - pac_c_multi_attr_alias=no - fi - - else # if test "$cross_compiling" != "yes" - rm -f pac_conftestval - ac_try="./pac_conftest_main$EXEEXT" - if AC_TRY_EVAL(ac_try) ; then - pac_c_attr_alias_val=0 - if test -s pac_conftestval ; then - eval pac_c_attr_alias_val=`cat pac_conftestval` - fi - if test "$pac_c_attr_alias_val" -eq 1 ; then - AC_MSG_RESULT(yes) - pac_c_multi_attr_alias=yes - else - AC_MSG_RESULT(no) - pac_c_multi_attr_alias=no - fi - rm -f pac_conftestval - fi - fi - dnl Endof if test "$cross_compiling" = "yes" - rm -f pac_conftest_main$EXEEXT -else - AC_MSG_RESULT(no! link failure) - pac_c_multi_attr_alias=no -fi dnl Endof if test "$pac_c_attr_alias_main" = "yes" - -AC_LANG_POP(C) - -]) dnl Endof AC_DEFUN([PAC_C_MULTI_ATTR_ALIAS] -dnl -dnl PAC_C_ATTR_ALIGNED() -dnl -dnl Check if __attribute__((aligned)) support is there. -dnl If so, set pac_c_attr_aligned=yes. -dnl -dnl Do a link test instead of compile test to check if the linker -dnl would emit an error. -dnl -AC_DEFUN([PAC_C_ATTR_ALIGNED],[ -AC_LANG_PUSH(C) -AC_MSG_CHECKING([for __attribute__((aligned)) support]) -#Link the __attribute__ object file. -AC_LINK_IFELSE([ - AC_LANG_PROGRAM([ -struct mpif_cmblk_t_ { int imembers[5]; }; -typedef struct mpif_cmblk_t_ mpif_cmblk_t; -mpif_cmblk_t mpifcmbr __attribute__((aligned)) = {0}; - ],[]) -],[pac_c_attr_aligned=yes], [pac_c_attr_aligned=no]) -AC_MSG_RESULT([$pac_c_attr_aligned]) -AC_LANG_POP(C) -]) -dnl -dnl PAC_F2C_ATTR_ALIGNED_SIZE(ARRAY_SIZE, [OUTPUT_VAR], [MIN_ALIGNMENT]) -dnl -dnl ARRAY_SIZE : Size of the integer array within the fortran commmon block. -dnl OUTPUT_VAR : Optional variable to be set. -dnl if test succeeds, set OUTPUT_VAR=$pac_f2c_attr_aligned_str. -dnl if test fails, set OUTPUT_VAR="unknown". -dnl MIN_ALIGNMENT : Optional value. -dnl Minimum alignment size to be used in OUTPUT_VAR. -dnl pac_f2c_attr_aligned_str won't be modified. -dnl -dnl "pac_f2c_attr_aligned_str" will be set with -dnl 1) __attribute__((aligned(ALIGNMENT_SIZE))), -dnl 2) __attribute__((aligned)). -dnl 3) "", i.e. empty string. -dnl -dnl 2) means the test can't find a good alignment value, but both the Fortran -dnl and C compilers are OK with "aligned" which in principle means the C -dnl compiler will pick the maximum useful alignment supported by the -dnl architecture. -dnl 3) means that the test has failed to find the alignment. -dnl -AC_DEFUN([PAC_F2C_ATTR_ALIGNED_SIZE],[ -cmblksize=$1 -AC_MSG_CHECKING([the minimum alignment of Fortran common block of $cmblksize integers]) -dnl To find the minmium alignment of Fortran common block (of integer array) -dnl as seen by C object file, C object files of various (typical) alignments -dnl are linked to the Fortran code using the common block of integer array. -# -dnl Since the incorrect alignment results only a warning messages from the -dnl fortran compiler(or linker), so we use "diff" to compare the fortran -dnl compiler/linker output. We cannot use AC_LANG_WERROR, -dnl i.e. ac_fc_werror_flag=yes, because compiler like pgf77 at version 10.x) -dnl has non-zero stderr output if a fortran program is used in the linking. -dnl The stderr contains the name of fortran program even if the linking is -dnl successful. We could avoid the non-zero stderr output in pgf77 by -dnl compiling everthing into object files and linking all the object files -dnl with pgf77. Doing that would need us to use AC_TRY_EVAL instead of -dnl AC_LINK_IFELSE, so "diff" approach is used instead. -# -dnl Using diff of compiler(linker) output requires a reference output file -dnl as the base of diff. The process of creating this reference output file -dnl has to be exactly the same as the testing process, because pgf77 has -dnl the following weird behavour -dnl pgf77 -o ftest ftest.f => when $?=0 with zero stderr output -dnl pgf77 -o ftest ftest.f dummy.o => when $?=0 with non-zero stderr output. -dnl stderr has "ftest.f:". -dnl -# First create a fortran CONFTEST which will be used repeatedly. -AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program fconftest - integer isize - parameter (isize=$cmblksize) - integer status_array(isize) - common /mpifcmb/ status_array - save /mpifcmb/ - end - ]) -]) -AC_LANG_POP([Fortran]) dnl AC_LANG_POP([Fortran 77]) -dnl -dnl -dnl -# Compile a C dummy.$OBJEXT and link with Fortran test program to create -# a reference linker output file, pac_align0.log, as the base of "diff". -AC_LANG_PUSH([C]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[ - cp conftest.$ac_ext pac_conftest.c - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - PAC_PUSH_FLAG([LIBS]) - LIBS="pac_conftest.$OBJEXT $LIBS" - AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77]) - PAC_PUSH_FLAG([ac_link]) - ac_link="`echo $ac_link | sed -e 's|>.*$|> $pac_logfile 2>\&1|g'`" - pac_logfile="pac_align0.log" - rm -f $pac_logfile - AC_LINK_IFELSE([],[ - pac_f2c_alignedn_diffbase=yes - ],[ - pac_f2c_alignedn_diffbase=no - ]) - # Be sure NOT to remove the conftest.f which is still needed for later use. - # rm -f conftest.$ac_ext - # Restore everything in autoconf that has been overwritten - PAC_POP_FLAG([ac_link]) - # restore previously pushed LIBS - PAC_POP_FLAG([LIBS]) - AC_LANG_POP([Fortran]) dnl AC_LANG_POP([Fortran 77]) -],[ - pac_f2c_alignedn_diffbase=no -]) -AC_LANG_POP([C]) -dnl -dnl -if test "$pac_f2c_alignedn_diffbase" = "yes" ; then - # Initialize pac_result_str to empty string since part of the test - # depends on pac_result_str is empty or non-empty string. - pac_result_str="" - # Initialize pac_f2c_attr_aligned_str to empty string and - # it will remain as empty string if the following test fails. - pac_f2c_attr_aligned_str="" - for asize in 4 8 16 32 64 128 max ; do - if test "$asize" != "max" ; then - pac_attr_aligned_str="__attribute__((aligned($asize)))" - else - pac_attr_aligned_str="__attribute__((aligned))" - fi - AC_LANG_PUSH([C]) - #Compile the __attribute__ object file. - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -changequote(,) -struct mpif_cmblk_t_ { $MPI_FINT imembers[$cmblksize]; }; -changequote([,]) -typedef struct mpif_cmblk_t_ mpif_cmblk_t; -mpif_cmblk_t mpifcmbr $pac_attr_aligned_str = {0}; - -extern mpif_cmblk_t _CMPIFCMB __attribute__ ((alias("mpifcmbr"))); -extern mpif_cmblk_t MPIFCMB __attribute__ ((alias("mpifcmbr"))); -extern mpif_cmblk_t MPIFCMB_ __attribute__ ((alias("mpifcmbr"))); -extern mpif_cmblk_t _Cmpifcmb __attribute__ ((alias("mpifcmbr"))); -extern mpif_cmblk_t mpifcmb __attribute__ ((alias("mpifcmbr"))); -extern mpif_cmblk_t mpifcmb_ __attribute__ ((alias("mpifcmbr"))); - ]) - ],[ - cp conftest.$ac_ext pac_conftest.c - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - PAC_PUSH_FLAG([LIBS]) - LIBS="pac_conftest.$OBJEXT $LIBS" - AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77]) - PAC_PUSH_FLAG([ac_link]) - ac_link="`echo $ac_link | sed -e 's|>.*$|> $pac_logfile 2>\&1|g'`" - pac_logfile="pac_align1.log" - rm -f $pac_logfile - # Use conftest.f created in CONFTEST. - AC_LINK_IFELSE([],[ - PAC_RUNLOG_IFELSE([diff -b pac_align0.log pac_align1.log],[ - pac_attr_alignedn=yes - ],[ - pac_attr_alignedn=no - cat $pac_logfile >&AS_MESSAGE_LOG_FD - echo "failed C program was:" >&AS_MESSAGE_LOG_FD - cat pac_conftest.c >&AS_MESSAGE_LOG_FD - echo "failed Fortran program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD - ]) - ],[ - pac_attr_alignedn=no - ]) - # Restore everything in autoconf that has been overwritten - PAC_POP_FLAG([ac_link]) - # restore previously pushed LIBS - PAC_POP_FLAG([LIBS]) - AC_LANG_POP([Fortran]) dnl AC_LANG_POP([Fortran 77]) - # remove previously generated object file and C file. - rm -f pac_conftest.$OBJEXT pac_conftest.c - rm -f $pac_logfile - if test "$pac_attr_alignedn" = yes ; then - ifelse([$3],[],[ - pac_result_str="$asize" - pac_f2c_attr_aligned_str="$pac_attr_aligned_str" - break - ],[ - if test "$asize" != "max" -a "$asize" -lt "$3" ; then - if test "X$pac_result_str" = "X" ; then - pac_result_str="$asize" - pac_f2c_attr_aligned_str="$pac_attr_aligned_str" - fi - continue - else - pac_f2c_attr_aligned_str="$pac_attr_aligned_str" - if test "X$pac_result_str" != "X" ; then - pac_result_str="$pac_result_str, too small! reset to $asize" - else - pac_result_str="$asize" - fi - break - fi - ]) - fi - ], [ - pac_attr_alignedn=no - ]) - AC_LANG_POP([C]) - done - ifelse([$2],[],[],[$2="$pac_f2c_attr_aligned_str"]) -else - pac_result_str="" - # Since the test fails, set pac_f2c_attr_aligned_str to empty string. - pac_f2c_attr_aligned_str="" -fi -if test "X$pac_result_str" != "X" ; then - AC_MSG_RESULT([$pac_result_str]) -else - AC_MSG_RESULT([unknown]) -fi -rm -f pac_align0.log -]) -dnl diff --git a/3rd-party/romio321/confdb/aclocal_bugfix.m4 b/3rd-party/romio321/confdb/aclocal_bugfix.m4 deleted file mode 100644 index f580d3919ad..00000000000 --- a/3rd-party/romio321/confdb/aclocal_bugfix.m4 +++ /dev/null @@ -1,75 +0,0 @@ -dnl This internal macro fails to work properly with OTHER internal macros. -dnl Basically, if the prologue is [], then no message should be generated. -dnl This macro is in autoconf 2.52 -m4_define([AC_LANG_PROGRAM(Fortran 77)], -[m4_if([$1],[[[]]],,[m4_ifval([$1], - [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])])dnl - program main -$2 - end]) - - -dnl/*D -dnl PAC_PROG_CHECK_INSTALL_WORKS - Check whether the install program in INSTALL -dnl works. -dnl -dnl Synopsis: -dnl PAC_PROG_CHECK_INSTALL_WORKS -dnl -dnl Output Effect: -dnl Sets the variable 'INSTALL' to the value of 'ac_sh_install' if -dnl a file cannot be installed into a local directory with the 'INSTALL' -dnl program -dnl -dnl Notes: -dnl The 'AC_PROG_INSTALL' scripts tries to avoid broken versions of -dnl install by avoiding directories such as '/usr/sbin' where some -dnl systems are known to have bad versions of 'install'. Unfortunately, -dnl this is exactly the sort of test-on-name instead of test-on-capability -dnl that 'autoconf' is meant to eliminate. The test in this script -dnl is very simple but has been adequate for working around problems -dnl on Solaris, where the '/usr/sbin/install' program (known by -dnl autoconf to be bad because it is in /usr/sbin) is also reached by a -dnl soft link through /bin, which autoconf believes is good. -dnl -dnl No variables are cached to ensure that we do not make a mistake in -dnl our choice of install program. -dnl -dnl The Solaris configure requires the directory name to immediately -dnl follow the '-c' argument, rather than the more common -dnl.vb -dnl args sourcefiles destination-dir -dnl.ve -dnl D*/ -AC_DEFUN([PAC_PROG_CHECK_INSTALL_WORKS],[ -if test -z "$INSTALL" ; then - AC_MSG_RESULT([No install program available]) -else - # first make any "confdb/install-sh -c" into an absolute path - # this is a hack, but it's still much cleaner than anything else I could - # come up with (see tt#1007) [goodell@] - AS_CASE(["$INSTALL"], - [/*],[:], - [*install-sh*],[INSTALL="$master_top_srcdir/$INSTALL"]) - - # Check that this install really works - rm -f conftest - echo "Test file" > conftest - if test ! -d .conftest ; then mkdir .conftest ; fi - AC_MSG_CHECKING([whether install works]) - if $INSTALL conftest .conftest >/dev/null 2>&1 ; then - installOk=yes - else - installOk=no - fi - rm -rf .conftest conftest - AC_MSG_RESULT($installOk) - if test "$installOk" = no ; then - if test -n "$ac_install_sh" ; then - INSTALL=$ac_install_sh - else - AC_MSG_ERROR([Unable to find working install]) - fi - fi -fi -]) diff --git a/3rd-party/romio321/confdb/aclocal_cache.m4 b/3rd-party/romio321/confdb/aclocal_cache.m4 deleted file mode 100644 index 9d02c416387..00000000000 --- a/3rd-party/romio321/confdb/aclocal_cache.m4 +++ /dev/null @@ -1,372 +0,0 @@ -dnl -dnl/*D -dnl AC_CACHE_LOAD - Replacement for autoconf cache load -dnl -dnl Notes: -dnl Caching in autoconf is broken (at least through version 2.13). -dnl The problem is that the cache is read -dnl without any check for whether it makes any sense to read it. -dnl A common problem is a build on a shared file system; connecting to -dnl a different computer and then building within the same directory will -dnl lead to at best error messages from configure and at worse a build that -dnl is wrong but fails only at run time (e.g., wrong datatype sizes used). -dnl Later versions of autoconf do include some checks for changes in the -dnl environment that impact the choices, but still misses problems with -dnl multiple different systems. -dnl -dnl This fixes that by requiring the user to explicitly enable caching -dnl before the cache file will be loaded. -dnl -dnl To use this version of 'AC_CACHE_LOAD', you need to include -dnl 'aclocal_cache.m4' in your 'aclocal.m4' file. The sowing 'aclocal.m4' -dnl file includes this file. -dnl -dnl If no --enable-cache or --disable-cache option is selected, the -dnl command causes configure to keep track of the system being configured -dnl in a config.system file; if the current system matches the value stored -dnl in that file (or there is neither a config.cache nor config.system file), -dnl configure will enable caching. In order to ensure that the configure -dnl tests make sense, the values of CC, F77, F90, and CXX are also included -dnl in the config.system file. In addition, the value of PATH is included -dnl to ensure that changes in the PATH that might select a different version -dnl of a program with the same name (such as a native make versus gnumake) -dnl are detected. -dnl -dnl Bugs: -dnl This does not work with the Cygnus configure because the enable arguments -dnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid -dnl changing the value of enable_cache, and use real_enable_cache, duplicating -dnl the "notgiven" value. -dnl -dnl The environment variable CONFIGURE_DEBUG_CACHE, if set to yes, -dnl will cause additional data to be written out during the configure process. -dnl This can be helpful in debugging the cache file process. -dnl -dnl See Also: -dnl PAC_ARG_CACHING -dnl D*/ -define([AC_CACHE_LOAD], -[if test "$CONFIGURE_DEBUG_CACHE" = yes ; then - oldopts="$-" - clearMinusX=no - set -x - if test "$oldopts" != "$-" ; then - clearMinusX=yes - fi -fi -if test "X$cache_system" = "X" ; then - # A default file name, just in case - cache_system="config.system" - if test "$cache_file" != "/dev/null" ; then - # Get the directory for the cache file, if any - changequote(,) - dnl Be careful to ensure that there is no doubled slash - cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1config.system%'` - changequote([,]) - test "x$cache_system" = "x$cache_file" && cache_system="config.system" -# else -# We must *not* set enable_cache to no because we need to know if -# enable_cache was not set. -# enable_cache=no - fi -fi -dnl -dnl The "action-if-not-given" part of AC_ARG_ENABLE is not executed until -dnl after the AC_CACHE_LOAD is executed (!). Thus, the value of -dnl enable_cache if neither --enable-cache or --disable-cache is selected -dnl is null. Just in case autoconf ever fixes this, we test both cases. -dnl -dnl Include PATH in the cache.system file since changing the path can -dnl change which versions of programs are found (such as vendor make -dnl or GNU make). -dnl -# -# Get a test value and flag whether we should remove/replace the -# cache_system file (do so unless cache_system_ok is yes) -# FC and F77 should be synonyms. Save both in case -# We include the xxxFLAGS in case the user is using the flags to change -# the language (either input or output) of the compiler. E.g., -# using -xarch=v9 on Solaris to select 64 bit output or using -D_BSD_SOURCE -# with gcc to get different header files on input. -cleanargs=`echo "$CC $F77 $FC $CXX $F90 $CFLAGS $FFLAGS $CXXFLAGS $F90FLAGS $PATH" | tr '"' ' '` -if uname -srm >/dev/null 2>&1 ; then - cache_system_text="`uname -srm` $cleanargs" -else - cache_system_text="-no-uname- $cleanargs" -fi -cache_system_ok=no -# -if test -z "$real_enable_cache" ; then - real_enable_cache=$enable_cache - if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fi -fi -if test "X$real_enable_cache" = "Xnotgiven" ; then - # check for valid cache file - if test -z "$cache_system" ; then cache_system="config.system" ; fi - if uname -srm >/dev/null 2>&1 ; then - if test -f "$cache_system" -a -n "$cache_system_text" ; then - if test "$cache_system_text" = "`cat $cache_system`" ; then - real_enable_cache="yes" - cache_system_ok=yes - fi - elif test ! -f "$cache_system" -a -n "$cache_system_text" ; then - # remove the cache file because it may not correspond to our - # system - if test "$cache_file" != "/dev/null" ; then - rm -f $cache_file - fi - real_enable_cache="yes" - fi - fi -fi -if test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then - real_enable_cache=no -fi -if test "X$real_enable_cache" = "Xyes" ; then - if test -r "$cache_file" ; then - echo "loading cache $cache_file" - if test -w "$cache_file" ; then - # Clean the cache file (ergh) - PAC_CACHE_CLEAN - fi - . $cache_file - else - echo "Configure in `pwd` creating cache $cache_file" - > $cache_file - rm -f $cache_system - fi -else - cache_file="/dev/null" -fi -# Remember our location and the name of the cachefile -pac_cv_my_conf_dir=`pwd` -dnl do not include the cachefile name, since this may contain the process -dnl number and cause comparisons looking for changes to the cache file -dnl to detect a change that isn't real. -dnl pac_cv_my_cachefile=$cachefile -# -# Update the cache_system file if necessary -if test "$cache_system_ok" != yes ; then - if test -n "$cache_system" ; then - rm -f $cache_system - echo $cache_system_text > $cache_system - fi -fi -if test "$clearMinusX" = yes ; then - set +x -fi -]) -dnl -dnl/*D -dnl PAC_ARG_CACHING - Enable caching of results from a configure execution -dnl -dnl Synopsis: -dnl PAC_ARG_CACHING -dnl -dnl Output Effects: -dnl Adds '--enable-cache' and '--disable-cache' to the command line arguments -dnl accepted by 'configure'. -dnl -dnl See Also: -dnl AC_CACHE_LOAD -dnl D*/ -dnl Add this call to the other ARG_ENABLE calls. Note that the values -dnl set here are redundant; the LOAD_CACHE call relies on the way autoconf -dnl initially processes ARG_ENABLE commands. -AC_DEFUN([PAC_ARG_CACHING],[ -AC_ARG_ENABLE(cache, - AC_HELP_STRING([--enable-cache], [Turn on configure caching]),, - [enable_cache="notgiven"]) -]) - -dnl Clean the cache of extraneous quotes that AC_CACHE_SAVE may add -dnl -AC_DEFUN([PAC_CACHE_CLEAN],[ - rm -f confcache - sed -e "s/'\\\\''//g" -e "s/'\\\\/'/" -e "s/\\\\'/'/" \ - -e "s/'\\\\''//g" $cache_file > confcache - if cmp -s $cache_file confcache ; then - : - else - if test -w $cache_file ; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi - fi - rm -f confcache - if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then - echo "Results of cleaned cache file:" - echo "--------------------------------------------------------" - cat $cache_file - echo "--------------------------------------------------------" - fi -]) - -dnl/*D -dnl PAC_SUBDIR_CACHE - Create a cache file before ac_output for subdirectory -dnl configures. -dnl -dnl Synopsis: -dnl PAC_SUBDIR_CACHE(when) -dnl -dnl Input Parameter: -dnl . when - Indicates when the cache should be created (optional) -dnl If 'always', create a new cache file. This option -dnl should be used if any of the cache parameters (such as -dnl CFLAGS or LDFLAGS) may have changed. -dnl -dnl Output Effects: -dnl -dnl Create a cache file before ac_output so that subdir configures don't -dnl make mistakes. -dnl We can't use OUTPUT_COMMANDS to remove the cache file, because those -dnl commands are executed *before* the subdir configures. -dnl -dnl D*/ -AC_DEFUN([PAC_SUBDIR_CACHE],[]) -AC_DEFUN([PAC_SUBDIR_CACHE_OLD],[ -if test "x$1" = "xalways" -o \( "$cache_file" = "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" \) ; then - # Use an absolute directory to help keep the subdir configures from getting - # lost - cache_file=`pwd`/$$conf.cache - touch $cache_file - dnl - dnl For Autoconf 2.52+, we should ensure that the environment is set - dnl for the cache. Make sure that we get the values and set the - dnl xxx_set variables properly - ac_cv_env_CC_set=set - ac_cv_env_CC_value=$CC - ac_cv_env_CFLAGS_set=${CFLAGS+set} - ac_cv_env_CFLAGS_value=$CFLAGS - ac_cv_env_CPP_set=set - ac_cv_env_CPP_value=$CPP - ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} - ac_cv_env_CPPFLAGS_value=$CPPFLAGS - ac_cv_env_LDFLAGS_set=${LDFLAGS+set} - ac_cv_env_LDFLAGS_value=$LDFLAGS - ac_cv_env_LIBS_set=${LIBS+set} - ac_cv_env_LIBS_value=$LIBS - ac_cv_env_FC_set=${FC+set} - ac_cv_env_FC_value=$FC - ac_cv_env_F77_set=${F77+set} - ac_cv_env_F77_value=$F77 - ac_cv_env_F90_set=${F90+set} - ac_cv_env_F90_value=$F90 - ac_cv_env_FFLAGS_set=${FFLAGS+set} - ac_cv_env_FFLAGS_value=$FFLAGS - ac_cv_env_CXX_set=${CXX+set} - ac_cv_env_CXX_value=$CXX - - ac_env_CC_set=set - ac_env_CC_value=$CC - ac_env_CFLAGS_set=${CFLAGS+set} - ac_env_CFLAGS_value=$CFLAGS - ac_env_CPP_set=set - ac_env_CPP_value=$CPP - ac_env_CPPFLAGS_set=${CPPFLAGS+set} - ac_env_CPPFLAGS_value=$CPPFLAGS - ac_env_LDFLAGS_set=${LDFLAGS+set} - ac_env_LDFLAGS_value=$LDFLAGS - ac_env_LIBS_set=${LIBS+set} - ac_env_LIBS_value=$LIBS - ac_env_FC_set=${FC+set} - ac_env_FC_value=$FC - ac_env_F77_set=${F77+set} - ac_env_F77_value=$F77 - ac_env_F90_set=${F90+set} - ac_env_F90_value=$F90 - ac_env_FFLAGS_set=${FFLAGS+set} - ac_env_FFLAGS_value=$FFLAGS - ac_env_CXX_set=${CXX+set} - ac_env_CXX_value=$CXX - - dnl other parameters are - dnl build_alias, host_alias, target_alias - - # It turns out that A C CACHE_SAVE can't be invoked more than once - # with data that contains blanks. What happens is that the quotes - # that it adds get quoted and then added again. To avoid this, - # we strip off the outer quotes for all cached variables - dnl We add pac_cv_my_conf_dir to give the source of this cachefile, - dnl and pac_cv_my_cachefile to indicate how it chose the cachefile. - pac_cv_my_conf_dir=`pwd` - pac_cv_my_cachefile=$cachefile - AC_CACHE_SAVE - PAC_CACHE_CLEAN - ac_configure_args="$ac_configure_args -enable-cache" -fi -dnl Unconditionally export these values. Subdir configures break otherwise -export CC -export CFLAGS -export LDFLAGS -export LIBS -export CPPFLAGS -export CPP -export FC -export F77 -export F90 -export CXX -export FFLAGS -export CCFLAGS -]) -AC_DEFUN([PAC_SUBDIR_CACHE_CLEANUP],[]) -AC_DEFUN([PAC_SUBDIR_CACHE_CLEANUP_OLD],[ -if test "$cache_file" != "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then - rm -f $cache_file - cache_file=/dev/null -fi -]) -dnl -dnl The following three macros support the sharing of configure results -dnl by configure scripts, including ones that are not run with -dnl AC_CONFIG_SUBDIRS (the cachefiles managed by --enable-cache can -dnl only be used with AC_CONFIG_SUBDIRS; creating a autoconf-style -dnl cachefile before the the end of the autoconf process will often -dnl cause problems. -dnl -AC_DEFUN([PAC_CREATE_BASE_CACHE],[ -AC_ARG_ENABLE(base-cache, - AC_HELP_STRING([--enable-base-cache], - [Enable the use of a simple cache for the subsidiary - configure scripts]),,enable_base_cache=default) -# The default case is controlled by the environment variable CONF_USE_CACHEFILE -if test "$enable_base_cache" = "default" ; then - if test "$CONF_USE_CACHEFILE" = yes ; then - enable_base_cache=yes - else - enable_base_cache=no - fi -fi -if test "$enable_base_cache" != no ; then - if test "$enable_base_cache" = yes ; then - basecachefile=`pwd`/cache.base - else - basecachefile=`pwd`/$enable_base_cache - fi - set | grep ac_cv > $basecachefile - # Tell other configures to load this file - echo "Creating and exporting the base cache file $basecachefile" - CONF_BASE_CACHEFILE=$basecachefile - export CONF_BASE_CACHEFILE -fi -]) -AC_DEFUN([PAC_LOAD_BASE_CACHE],[ -if test -n "$CONF_BASE_CACHEFILE" -a -s "$CONF_BASE_CACHEFILE" ; then - echo "Loading base cachefile $CONF_BASE_CACHEFILE" - . $CONF_BASE_CACHEFILE - export CONF_BASE_CACHEFILE -fi -]) -AC_DEFUN([PAC_UPDATE_BASE_CACHE],[ -if test -n "$CONF_BASE_CACHEFILE" -a -s "$CONF_BASE_CACHEFILE" ; then - set | grep ac_cv > $CONF_BASE_CACHEFILE.new - if cmp -s $CONF_BASE_CACHEFILE.new $CONF_BASE_CACHEFILE ; then - : - else - echo "Replacing $CONF_BASE_CACHEFILE" - mv $CONF_BASE_CACHEFILE.new $CONF_BASE_CACHEFILE - fi -fi -]) diff --git a/3rd-party/romio321/confdb/aclocal_cc.m4 b/3rd-party/romio321/confdb/aclocal_cc.m4 deleted file mode 100644 index 666d0a4c262..00000000000 --- a/3rd-party/romio321/confdb/aclocal_cc.m4 +++ /dev/null @@ -1,1695 +0,0 @@ -dnl AC_PROG_CC_GNU -ifdef([AC_PROG_CC_GNU],,[AC_DEFUN([AC_PROG_CC_GNU],)]) - -dnl PAC_PROG_CC - reprioritize the C compiler search order -AC_DEFUN([PAC_PROG_CC],[ - dnl Many standard autoconf/automake/libtool macros, such as LT_INIT, - dnl perform an AC_REQUIRE([AC_PROG_CC]). If this macro (PAC_PROG_CC) - dnl comes after LT_INIT (or similar) then the default compiler search - dnl path will be used instead. This AC_BEFORE macro ensures that a - dnl warning will be emitted at autoconf-time (autogen.sh-time) to help - dnl developers notice this case. - AC_BEFORE([$0],[AC_PROG_CC]) - PAC_PUSH_FLAG([CFLAGS]) - AC_PROG_CC([icc pgcc xlc xlC pathcc gcc clang cc]) - PAC_POP_FLAG([CFLAGS]) -]) -dnl -dnl/*D -dnl PAC_C_CHECK_COMPILER_OPTION - Check that a compiler option is accepted -dnl without warning messages -dnl -dnl Synopsis: -dnl PAC_C_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) -dnl -dnl Output Effects: -dnl -dnl If no actions are specified, a working value is added to 'COPTIONS' -dnl -dnl Notes: -dnl This is now careful to check that the output is different, since -dnl some compilers are noisy. -dnl -dnl We are extra careful to prototype the functions in case compiler options -dnl that complain about poor code are in effect. -dnl -dnl Because this is a long script, we have ensured that you can pass a -dnl variable containing the option name as the first argument. -dnl -dnl D*/ -AC_DEFUN([PAC_C_CHECK_COMPILER_OPTION],[ -AC_MSG_CHECKING([whether C compiler accepts option $1]) -pac_opt="$1" -AC_LANG_PUSH([C]) -CFLAGS_orig="$CFLAGS" -CFLAGS_opt="$pac_opt $CFLAGS" -pac_result="unknown" - -AC_LANG_CONFTEST([ - AC_LANG_PROGRAM([[#include - const char hw[] = "Hello, World\n";]], - [[fputs (hw, stdout);]]) -]) -CFLAGS="$CFLAGS_orig" -rm -f pac_test1.log -PAC_LINK_IFELSE_LOG([pac_test1.log], [], [ - CFLAGS="$CFLAGS_opt" - rm -f pac_test2.log - PAC_LINK_IFELSE_LOG([pac_test2.log], [], [ - PAC_RUNLOG_IFELSE([diff -b pac_test1.log pac_test2.log], - [pac_result=yes],[pac_result=no]) - ],[ - pac_result=no - ]) -], [ - pac_result=no -]) -AC_MSG_RESULT([$pac_result]) -dnl Delete the conftest created by AC_LANG_CONFTEST. -rm -f conftest.$ac_ext - -# gcc 4.2.4 on 32-bit does not complain about the -Wno-type-limits option -# even though it doesn't support it. However, when another warning is -# triggered, it gives an error that the option is not recognized. So we -# need to test with a conftest file that will generate warnings. -# -# add an extra switch, pac_c_check_compiler_option_prototest, to -# disable this test just in case some new compiler does not like it. -# -# Linking with a program with an invalid prototype to ensure a compiler warning. - -if test "$pac_result" = "yes" \ - -a "$pac_c_check_compiler_option_prototest" != "no" ; then - AC_MSG_CHECKING([whether C compiler option $1 works with an invalid prototype program]) - AC_LINK_IFELSE([ - dnl We want a warning, but we don't want to inadvertently disable - dnl special warnings like -Werror-implicit-function-declaration (e.g., - dnl in PAC_CC_STRICT) by compiling something that might actually be - dnl treated as an error by the compiler. So we try to elicit an - dnl "unused variable" warning and/or an "uninitialized" warning with the - dnl test program below. - dnl - dnl The old sanity program was: - dnl void main() {return 0;} - dnl which clang (but not GCC) would treat as an *error*, invalidating - dnl the test for any given parameter. - AC_LANG_SOURCE([int main(int argc, char **argv){ int foo, bar = 0; foo += 1; return foo; }]) - ],[pac_result=yes],[pac_result=no]) - AC_MSG_RESULT([$pac_result]) -fi -# -if test "$pac_result" = "yes" ; then - AC_MSG_CHECKING([whether routines compiled with $pac_opt can be linked with ones compiled without $pac_opt]) - pac_result=unknown - CFLAGS="$CFLAGS_orig" - rm -f pac_test3.log - PAC_COMPILE_IFELSE_LOG([pac_test3.log], [ - AC_LANG_SOURCE([ - int foo(void); - int foo(void){return 0;} - ]) - ],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - - rm -f pac_test4.log - PAC_LINK_IFELSE_LOG([pac_test4.log], [AC_LANG_PROGRAM()], [ - CFLAGS="$CFLAGS_opt" - rm -f pac_test5.log - PAC_LINK_IFELSE_LOG([pac_test5.log], [AC_LANG_PROGRAM()], [ - PAC_RUNLOG_IFELSE([diff -b pac_test4.log pac_test5.log], - [pac_result=yes], [pac_result=no]) - ],[ - pac_result=no - ]) - ],[ - pac_result=no - ]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT - ],[ - pac_result=no - ]) - AC_MSG_RESULT([$pac_result]) - rm -f pac_test3.log pac_test4.log pac_test5.log -fi -rm -f pac_test1.log pac_test2.log - -dnl Restore CFLAGS before 2nd/3rd argument commands are executed, -dnl as 2nd/3rd argument command could be modifying CFLAGS. -CFLAGS="$CFLAGS_orig" -if test "$pac_result" = "yes" ; then - ifelse([$2],[],[COPTIONS="$COPTIONS $1"],[$2]) -else - ifelse([$3],[],[:],[$3]) -fi -AC_LANG_POP([C]) -]) -dnl -dnl/*D -dnl PAC_C_OPTIMIZATION - Determine C options for producing optimized code -dnl -dnl Synopsis -dnl PAC_C_OPTIMIZATION([action if found]) -dnl -dnl Output Effect: -dnl Adds options to 'COPTIONS' if no other action is specified -dnl -dnl Notes: -dnl This is a temporary standin for compiler optimization. -dnl It should try to match known systems to known compilers (checking, of -dnl course), and then falling back to some common defaults. -dnl Note that many compilers will complain about -g and aggressive -dnl optimization. -dnl D*/ -AC_DEFUN([PAC_C_OPTIMIZATION],[ - for copt in "-O4 -Ofast" "-Ofast" "-fast" "-O3" "-xO3" "-O" ; do - PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no) - if test "$found_opt" = "yes" ; then - ifelse($1,,COPTIONS="$COPTIONS $copt",$1) - break - fi - done - if test "$ac_cv_prog_gcc" = "yes" ; then - for copt in "-fomit-frame-pointer" "-finline-functions" \ - "-funroll-loops" ; do - PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no) - if test "$found_opt" = "yes" ; then - ifelse($1,,COPTIONS="$COPTIONS $copt",$1) - # no break because we're trying to add them all - fi - done - # We could also look for architecture-specific gcc options - fi - -]) - -dnl/*D -dnl PAC_PROG_C_UNALIGNED_DOUBLES - Check that the C compiler allows unaligned -dnl doubles -dnl -dnl Synopsis: -dnl PAC_PROG_C_UNALIGNED_DOUBLES(action-if-true,action-if-false, -dnl action-if-unknown) -dnl -dnl Notes: -dnl 'action-if-unknown' is used in the case of cross-compilation. -dnl D*/ -AC_DEFUN([PAC_PROG_C_UNALIGNED_DOUBLES],[ -AC_CACHE_CHECK([whether C compiler allows unaligned doubles], -pac_cv_prog_c_unaligned_doubles,[ -AC_TRY_RUN([ -void fetch_double( v ) -double *v; -{ -*v = 1.0; -} -int main( argc, argv ) -int argc; -char **argv; -{ -int p[4]; -double *p_val; -fetch_double( (double *)&(p[0]) ); -p_val = (double *)&(p[0]); -if (*p_val != 1.0) return 1; -fetch_double( (double *)&(p[1]) ); -p_val = (double *)&(p[1]); -if (*p_val != 1.0) return 1; -return 0; -} -],pac_cv_prog_c_unaligned_doubles="yes",pac_cv_prog_c_unaligned_doubles="no", -pac_cv_prog_c_unaligned_doubles="unknown")]) -ifelse($1,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "yes" ; then -$1 -fi) -ifelse($2,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "no" ; then -$2 -fi) -ifelse($3,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "unknown" ; then -$3 -fi) -]) - -dnl/*D -dnl PAC_PROG_C_WEAK_SYMBOLS - Test whether C supports weak alias symbols. -dnl -dnl Synopsis -dnl PAC_PROG_C_WEAK_SYMBOLS(action-if-true,action-if-false) -dnl -dnl Output Effect: -dnl Defines one of the following if a weak symbol pragma is found: -dnl.vb -dnl HAVE_PRAGMA_WEAK - #pragma weak -dnl HAVE_PRAGMA_HP_SEC_DEF - #pragma _HP_SECONDARY_DEF -dnl HAVE_PRAGMA_CRI_DUP - #pragma _CRI duplicate x as y -dnl.ve -dnl May also define -dnl.vb -dnl HAVE_WEAK_ATTRIBUTE -dnl.ve -dnl if functions can be declared as 'int foo(...) __attribute__ ((weak));' -dnl sets the shell variable pac_cv_attr_weak to yes. -dnl Also checks for __attribute__((weak_import)) which is supported by -dnl Apple in Mac OSX (at least in Darwin). Note that this provides only -dnl weak symbols, not weak aliases -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_C_WEAK_SYMBOLS],[ -pragma_extra_message="" -AC_CACHE_CHECK([for type of weak symbol alias support], -pac_cv_prog_c_weak_symbols,[ -# Test for weak symbol support... -# We can't put # in the message because it causes autoconf to generate -# incorrect code -AC_TRY_LINK([ -extern int PFoo(int); -#pragma weak PFoo = Foo -int Foo(int a) { return a; } -],[return PFoo(1);],has_pragma_weak=yes) -# -# Some systems (Linux ia64 and ecc, for example), support weak symbols -# only within a single object file! This tests that case. -# Note that there is an extern int PFoo declaration before the -# pragma. Some compilers require this in order to make the weak symbol -# externally visible. -if test "$has_pragma_weak" = yes ; then - PAC_COMPLINK_IFELSE([ - AC_LANG_SOURCE([ -extern int PFoo(int); -#pragma weak PFoo = Foo -int Foo(int); -int Foo(int a) { return a; } - ]) - ],[ - AC_LANG_SOURCE([ -extern int PFoo(int); -int main(int argc, char **argv) { -return PFoo(0);} - ]) - ],[ - PAC_COMPLINK_IFELSE([ - AC_LANG_SOURCE([ -extern int PFoo(int); -#pragma weak PFoo = Foo -int Foo(int); -int Foo(int a) { return a; } - ]) - ],[ - AC_LANG_SOURCE([ -extern int Foo(int); -int PFoo(int a) { return a+1;} -int main(int argc, char **argv) { -return Foo(0);} - ]) - ],[ - pac_cv_prog_c_weak_symbols="pragma weak" - ],[ - has_pragma_weak=0 - pragma_extra_message="pragma weak accepted but does not work (probably creates two non-weak entries)" - ]) - ],[ - has_pragma_weak=0 - pragma_extra_message="pragma weak accepted but does not work (probably creates two non-weak entries)" - ]) -fi -dnl -if test -z "$pac_cv_prog_c_weak_symbols" ; then - AC_TRY_LINK([ -extern int PFoo(int); -#pragma _HP_SECONDARY_DEF Foo PFoo -int Foo(int a) { return a; } -],[return PFoo(1);],pac_cv_prog_c_weak_symbols="pragma _HP_SECONDARY_DEF") -fi -dnl -if test -z "$pac_cv_prog_c_weak_symbols" ; then - AC_TRY_LINK([ -extern int PFoo(int); -#pragma _CRI duplicate PFoo as Foo -int Foo(int a) { return a; } -],[return PFoo(1);],pac_cv_prog_c_weak_symbols="pragma _CRI duplicate x as y") -fi -dnl -if test -z "$pac_cv_prog_c_weak_symbols" ; then - pac_cv_prog_c_weak_symbols="no" -fi -dnl -dnl If there is an extra explanatory message, echo it now so that it -dnl doesn't interfere with the cache result value -if test -n "$pragma_extra_message" ; then - echo $pragma_extra_message -fi -dnl -]) -if test "$pac_cv_prog_c_weak_symbols" != "no" ; then - case "$pac_cv_prog_c_weak_symbols" in - "pragma weak") AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Supports weak pragma]) - ;; - "pragma _HP") AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[HP style weak pragma]) - ;; - "pragma _CRI") AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Cray style weak pragma]) - ;; - esac -fi -AC_CACHE_CHECK([whether __attribute__ ((weak)) allowed], -pac_cv_attr_weak,[ -AC_TRY_COMPILE([int foo(int) __attribute__ ((weak));],[int a;], -pac_cv_attr_weak=yes,pac_cv_attr_weak=no)]) -# Note that being able to compile with weak_import doesn't mean that -# it works. -AC_CACHE_CHECK([whether __attribute__ ((weak_import)) allowed], -pac_cv_attr_weak_import,[ -AC_TRY_COMPILE([int foo(int) __attribute__ ((weak_import));],[int a;], -pac_cv_attr_weak_import=yes,pac_cv_attr_weak_import=no)]) -# Check if the alias option for weak attributes is allowed -AC_CACHE_CHECK([whether __attribute__((weak,alias(...))) allowed], -pac_cv_attr_weak_alias,[ -PAC_PUSH_FLAG([CFLAGS]) -# force an error exit if the weak attribute isn't understood -CFLAGS=-Werror -AC_TRY_COMPILE([int __foo(int a){return 0;} int foo(int) __attribute__((weak,alias("__foo")));],[int a;], -pac_cv_attr_weak_alias=yes,pac_cv_attr_weak_alias=no) -# Restore original CFLAGS -PAC_POP_FLAG([CFLAGS])]) -if test "$pac_cv_attr_weak_alias" = "yes" ; then - AC_DEFINE(HAVE_WEAK_ATTRIBUTE,1,[Attribute style weak pragma]) -fi -if test "$pac_cv_prog_c_weak_symbols" = "no" -a "$pac_cv_attr_weak_alias" = "no" ; then - ifelse([$2],,:,[$2]) -else - ifelse([$1],,:,[$1]) -fi -]) - -# -# This is a replacement that checks that FAILURES are signaled as well -# (later configure macros look for the .o file, not just success from the -# compiler, but they should not HAVE to -# -dnl --- insert 2.52 compatibility here --- -dnl 2.52 does not have AC_PROG_CC_WORKS -ifdef([AC_PROG_CC_WORKS],,[AC_DEFUN([AC_PROG_CC_WORKS],)]) -dnl -AC_DEFUN([PAC_PROG_CC_WORKS], -[AC_PROG_CC_WORKS -AC_MSG_CHECKING([whether the C compiler sets its return status correctly]) -AC_LANG_SAVE -AC_LANG_C -AC_TRY_COMPILE(,[int a = bzzzt;],notbroken=no,notbroken=yes) -AC_MSG_RESULT($notbroken) -if test "$notbroken" = "no" ; then - AC_MSG_ERROR([installation or configuration problem: C compiler does not -correctly set error code when a fatal error occurs]) -fi -]) - -dnl/*D -dnl PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS - Test whether C and the -dnl linker allow multiple weak symbols. -dnl -dnl Synopsis -dnl PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS(action-if-true,action-if-false) -dnl -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS],[ -AC_CACHE_CHECK([for multiple weak symbol support], -pac_cv_prog_c_multiple_weak_symbols,[ -# Test for multiple weak symbol support... -PAC_COMPLINK_IFELSE([ - AC_LANG_SOURCE([ -extern int PFoo(int); -extern int PFoo_(int); -extern int pfoo_(int); -#pragma weak PFoo = Foo -#pragma weak PFoo_ = Foo -#pragma weak pfoo_ = Foo -int Foo(int); -int Foo(a) { return a; } - ]) -],[ - AC_LANG_SOURCE([ -extern int PFoo(int), PFoo_(int), pfoo_(int); -int main() { -return PFoo(0) + PFoo_(1) + pfoo_(2);} - ]) -],[ - pac_cv_prog_c_multiple_weak_symbols="yes" -]) -dnl -]) -if test "$pac_cv_prog_c_multiple_weak_symbols" = "yes" ; then - ifelse([$1],,:,[$1]) -else - ifelse([$2],,:,[$2]) -fi -]) - -dnl Use the value of enable-strict to update CFLAGS -dnl pac_cc_strict_flags contains the strict flags. -dnl -dnl -std=c89 is used to select the C89 version of the ANSI/ISO C standard. -dnl As of this writing, many C compilers still accepted only this version, -dnl not the later C99 version. When all compilers accept C99, this -dnl should be changed to the appropriate standard level. Note that we've -dnl had trouble with gcc 2.95.3 accepting -std=c89 but then trying to -dnl compile program with a invalid set of options -dnl (-D __STRICT_ANSI__-trigraphs) -AC_DEFUN([PAC_CC_STRICT],[ -export enable_strict_done -if test "$enable_strict_done" != "yes" ; then - - # Some comments on strict warning options. - # These were added to improve portability - # -Wstack-usage=262144 -- 32 bit FreeBSD did not like the mprobe test - # allocating a big variable on the stack. (See tt#2160). The "right" - # value requires further investigation; 1 MiB would have at least - # caught #2160 at compile-time, and only two other tests show a - # warning at 256k. - # - # These were added to reduce warnings: - # -Wno-missing-field-initializers -- We want to allow a struct to be - # initialized to zero using "struct x y = {0};" and not require - # each field to be initialized individually. - # -Wno-unused-parameter -- For portability, some parameters go unused - # when we have different implementations of functions for - # different platforms - # -Wno-unused-label -- We add fn_exit: and fn_fail: on all functions, - # but fn_fail may not be used if the function doesn't return an - # error. - # -Wno-sign-compare -- read() and write() return bytes read/written - # as a signed value, but we often compare this to size_t (or - # msg_sz_t) variables. - # -Wno-format-zero-length -- this warning is irritating and useless, since - # a zero-length format string is very well defined - # These were removed to reduce warnings: - # -Wcast-qual -- Sometimes we need to cast "volatile char*" to - # "char*", e.g., for memcpy. - # -Wpadded -- We catch struct padding with asserts when we need to - # -Wredundant-decls -- Having redundant declarations is benign and the - # code already has some. - # -Waggregate-return -- This seems to be a performance-related warning - # aggregate return values are legal in ANSI C, but they may be returned - # in memory rather than through a register. We do use aggregate return - # values, but they are structs of a single basic type (used to enforce - # type checking for relative vs. absolute ptrs), and with optimization - # the aggregate value is converted to a scalar. - # -Wdeclaration-after-statement -- This is a C89 - # requirement. When compiling with C99, this should be - # disabled. - # -Wfloat-equal -- There are places in hwloc that set a float var to 0, then - # compare it to 0 later to see if it was updated. Also when using strtod() - # one needs to compare the return value with 0 to see whether a conversion - # was performed. - # -Werror-implicit-function-declaration -- implicit function declarations - # should never be tolerated. This also ensures that we get quick - # compilation failures rather than later link failures that usually - # come from a function name typo. - # -Wcast-align -- Casting alignment warnings. This is an - # important check, but is temporarily disabled, since it is - # throwing too many (correct) warnings currently, causing us - # to miss other warnings. - # -Wshorten-64-to-32 -- Bad type-casting warnings. This is an - # important check, but is temporarily disabled, since it is - # throwing too many (correct) warnings currently, causing us - # to miss other warnings. - # - # This was removed because it masks important failures (see ticket #2094). - # However, since Intel compiler currently does not include -Wtype-limits - # in -Wextra, -Wtype-limits was added to handle warnings with the Intel - # compiler. - # -Wno-type-limits -- There are places where we compare an unsigned to - # a constant that happens to be zero e.g., if x is unsigned and - # MIN_VAL is zero, we'd like to do "MPIU_Assert(x >= MIN_VAL);". - # Note this option is not supported by gcc 4.2. This needs to be added - # after most other warning flags, so that we catch a gcc bug on 32-bit - # that doesn't give a warning that this is unsupported, unless another - # warning is triggered, and then if gives an error. - # the embedded newlines in this string are safe because we evaluate each - # argument in the for-loop below and append them to the CFLAGS with a space - # as the separator instead - pac_common_strict_flags=" - -Wall - -Wextra - -Wno-missing-field-initializers - -Wstrict-prototypes - -Wmissing-prototypes - -DGCC_WALL - -Wno-unused-parameter - -Wno-unused-label - -Wshadow - -Wmissing-declarations - -Wno-long-long - -Wundef - -Wno-endif-labels - -Wpointer-arith - -Wbad-function-cast - -Wwrite-strings - -Wno-sign-compare - -Wold-style-definition - -Wno-multichar - -Wno-deprecated-declarations - -Wpacked - -Wnested-externs - -Winvalid-pch - -Wno-pointer-sign - -Wvariadic-macros - -Wno-format-zero-length - -Wtype-limits - -Werror-implicit-function-declaration - -Wstack-usage=262144 - " - - enable_c89=no - enable_c99=yes - enable_posix=2001 - enable_opt=yes - flags="`echo $1 | sed -e 's/:/ /g' -e 's/,/ /g'`" - for flag in ${flags}; do - case "$flag" in - c89) - enable_strict_done="yes" - enable_c89=yes - enable_c99=no - ;; - c99) - enable_strict_done="yes" - enable_c89=no - enable_c99=yes - ;; - posix1995) - enable_strict_done="yes" - enable_posix=1995 - ;; - posix|posix2001) - enable_strict_done="yes" - enable_posix=2001 - ;; - posix2008) - enable_strict_done="yes" - enable_posix=2008 - ;; - noposix) - enable_strict_done="yes" - enable_posix=no - ;; - opt) - enable_strict_done="yes" - enable_opt=yes - ;; - noopt) - enable_strict_done="yes" - enable_opt=no - ;; - all|yes) - enable_strict_done="yes" - enable_c99=yes - enable_posix=2001 - enable_opt=yes - ;; - no) - # Accept and ignore this value - : - ;; - *) - if test -n "$flag" ; then - AC_MSG_WARN([Unrecognized value for enable-strict:$flag]) - fi - ;; - esac - done - - pac_cc_strict_flags="" - if test "${enable_strict_done}" = "yes" ; then - if test "${enable_opt}" = "yes" ; then - pac_cc_strict_flags="-O2" - fi - pac_cc_strict_flags="$pac_cc_strict_flags $pac_common_strict_flags" - # We only allow one of strict-C99 or strict-C89 to be - # enabled. If C99 is enabled, we automatically disable C89. - if test "${enable_c99}" = "yes" ; then - PAC_APPEND_FLAG([-std=c99],[pac_cc_strict_flags]) - # Use -D_STDC_C99= for Solaris compilers. See - # http://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html - # for discussion on why not to use -xc99 - PAC_APPEND_FLAG([-D_STDC_C99=],[pac_cc_strict_flags]) - elif test "${enable_c89}" = "yes" ; then - PAC_APPEND_FLAG([-std=c89],[pac_cc_strict_flags]) - PAC_APPEND_FLAG([-Wdeclaration-after-statement],[pac_cc_strict_flags]) - fi - # POSIX 2001 should be used with C99. But the default standard for some - # compilers are not C99. We must test the support of POSIX 2001 after - # testing C99. - case "$enable_posix" in - no) : ;; - 1995) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=199506L],[pac_cc_strict_flags]) ;; - 2001) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=200112L],[pac_cc_strict_flags]) ;; - 2008) PAC_APPEND_FLAG([-D_POSIX_C_SOURCE=200809L],[pac_cc_strict_flags]) ;; - *) AC_MSG_ERROR([internal error, unexpected POSIX version: '$enable_posix']) ;; - esac - fi - - # See if the above options work with the compiler - accepted_flags="" - for flag in $pac_cc_strict_flags ; do - PAC_PUSH_FLAG([CFLAGS]) - CFLAGS="$CFLAGS $accepted_flags" - PAC_C_CHECK_COMPILER_OPTION([$flag],[accepted_flags="$accepted_flags $flag"],) - PAC_POP_FLAG([CFLAGS]) - done - pac_cc_strict_flags=$accepted_flags -fi -]) - -dnl/*D -dnl PAC_ARG_STRICT - Add --enable-strict to configure. -dnl -dnl Synopsis: -dnl PAC_ARG_STRICT -dnl -dnl Output effects: -dnl Adds '--enable-strict' to the command line. -dnl -dnl D*/ -AC_DEFUN([PAC_ARG_STRICT],[ -AC_ARG_ENABLE(strict, - AC_HELP_STRING([--enable-strict], [Turn on strict compilation testing])) -PAC_CC_STRICT($enable_strict) -CFLAGS="$CFLAGS $pac_cc_strict_flags" -export CFLAGS -]) - -dnl Return the integer structure alignment in pac_cv_c_max_integer_align -dnl Possible values include -dnl packed -dnl two -dnl four -dnl eight -dnl -dnl In addition, a "Could not determine alignment" and a "error!" -dnl return is possible. -AC_DEFUN([PAC_C_MAX_INTEGER_ALIGN],[ -AC_CACHE_CHECK([for max C struct integer alignment], -pac_cv_c_max_integer_align,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - int is_packed = 1; - int is_two = 1; - int is_four = 1; - int is_eight = 1; - struct { char a; int b; } char_int; - struct { char a; short b; } char_short; - struct { char a; long b; } char_long; - struct { char a; int b; char c; } char_int_char; - struct { char a; short b; char c; } char_short_char; -#ifdef HAVE_LONG_LONG_INT - struct { long long int a; char b; } lli_c; - struct { char a; long long int b; } c_lli; -#endif - int size, extent, extent2; - - /* assume max integer alignment isn't 8 if we don't have - * an eight-byte value :) - */ -#ifdef HAVE_LONG_LONG_INT - if (sizeof(int) < 8 && sizeof(long) < 8 && sizeof(long long int) < 8) - is_eight = 0; -#else - if (sizeof(int) < 8 && sizeof(long) < 8) is_eight = 0; -#endif - - size = sizeof(char) + sizeof(int); - extent = sizeof(char_int); - if (size != extent) is_packed = 0; - if ( (extent % 2) != 0) is_two = 0; - if ( (extent % 4) != 0) is_four = 0; - if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0; - DBG("char_int",size,extent); - - size = sizeof(char) + sizeof(short); - extent = sizeof(char_short); - if (size != extent) is_packed = 0; - if ( (extent % 2) != 0) is_two = 0; - if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0; - if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0; - DBG("char_short",size,extent); - - size = sizeof(char) + sizeof(long); - extent = sizeof(char_long); - if (size != extent) is_packed = 0; - if ( (extent % 2) != 0) is_two = 0; - if ( (extent % 4) != 0) is_four = 0; - if (sizeof(long) == 8 && (extent % 8) != 0) is_eight = 0; - DBG("char_long",size,extent); - -#ifdef HAVE_LONG_LONG_INT - size = sizeof(char) + sizeof(long long int); - extent = sizeof(lli_c); - extent2 = sizeof(c_lli); - if (size != extent) is_packed = 0; - if ( (extent % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(long long int) >= 8 && (extent % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; -#endif - - size = sizeof(char) + sizeof(int) + sizeof(char); - extent = sizeof(char_int_char); - if (size != extent) is_packed = 0; - if ( (extent % 2) != 0) is_two = 0; - if ( (extent % 4) != 0) is_four = 0; - if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0; - DBG("char_int_char",size,extent); - - size = sizeof(char) + sizeof(short) + sizeof(char); - extent = sizeof(char_short_char); - if (size != extent) is_packed = 0; - if ( (extent % 2) != 0) is_two = 0; - if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0; - if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0; - DBG("char_short_char",size,extent); - - /* If aligned mod 8, it will be aligned mod 4 */ - if (is_eight) { is_four = 0; is_two = 0; } - - if (is_four) is_two = 0; - - /* Tabulate the results */ - cf = fopen( "ctest.out", "w" ); - if (is_packed + is_two + is_four + is_eight == 0) { - fprintf( cf, "Could not determine alignment\n" ); - } - else { - if (is_packed + is_two + is_four + is_eight != 1) { - fprintf( cf, "error!\n" ); - } - else { - if (is_packed) fprintf( cf, "packed\n" ); - if (is_two) fprintf( cf, "two\n" ); - if (is_four) fprintf( cf, "four\n" ); - if (is_eight) fprintf( cf, "eight\n" ); - } - } - fclose( cf ); - return 0; -}], -pac_cv_c_max_integer_align=`cat ctest.out`, -pac_cv_c_max_integer_align="unknown", -pac_cv_c_max_integer_align="$CROSS_ALIGN_STRUCT_INT") -rm -f ctest.out -]) -if test -z "$pac_cv_c_max_integer_align" ; then - pac_cv_c_max_integer_align="unknown" -fi -]) - -dnl Return the floating point structure alignment in -dnl pac_cv_c_max_fp_align. -dnl -dnl Possible values include: -dnl packed -dnl two -dnl four -dnl eight -dnl sixteen -dnl -dnl In addition, a "Could not determine alignment" and a "error!" -dnl return is possible. -AC_DEFUN([PAC_C_MAX_FP_ALIGN],[ -AC_CACHE_CHECK([for max C struct floating point alignment], -pac_cv_c_max_fp_align,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - int is_packed = 1; - int is_two = 1; - int is_four = 1; - int is_eight = 1; - int is_sixteen = 1; - struct { char a; float b; } char_float; - struct { float b; char a; } float_char; - struct { char a; double b; } char_double; - struct { double b; char a; } double_char; -#ifdef HAVE_LONG_DOUBLE - struct { char a; long double b; } char_long_double; - struct { long double b; char a; } long_double_char; - struct { long double a; int b; char c; } long_double_int_char; -#endif - int size, extent1, extent2; - - size = sizeof(char) + sizeof(float); - extent1 = sizeof(char_float); - extent2 = sizeof(float_char); - if (size != extent1) is_packed = 0; - if ( (extent1 % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(float) == 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; - DBG("char_float",size,extent1); - - size = sizeof(char) + sizeof(double); - extent1 = sizeof(char_double); - extent2 = sizeof(double_char); - if (size != extent1) is_packed = 0; - if ( (extent1 % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(double) == 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; - DBG("char_double",size,extent1); - -#ifdef HAVE_LONG_DOUBLE - size = sizeof(char) + sizeof(long double); - extent1 = sizeof(char_long_double); - extent2 = sizeof(long_double_char); - if (size != extent1) is_packed = 0; - if ( (extent1 % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(long double) >= 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; - if (sizeof(long double) > 8 && (extent1 % 16) != 0 - && (extent2 % 16) != 0) is_sixteen = 0; - DBG("char_long-double",size,extent1); - - extent1 = sizeof(long_double_int_char); - if ( (extent1 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0) is_four = 0; - if (sizeof(long double) >= 8 && (extent1 % 8) != 0) is_eight = 0; - if (sizeof(long double) > 8 && (extent1 % 16) != 0) is_sixteen = 0; -#else - is_sixteen = 0; -#endif - - if (is_sixteen) { is_eight = 0; is_four = 0; is_two = 0; } - - if (is_eight) { is_four = 0; is_two = 0; } - - if (is_four) is_two = 0; - - /* Tabulate the results */ - cf = fopen( "ctest.out", "w" ); - if (is_packed + is_two + is_four + is_eight + is_sixteen == 0) { - fprintf( cf, "Could not determine alignment\n" ); - } - else { - if (is_packed + is_two + is_four + is_eight + is_sixteen != 1) { - fprintf( cf, "error!\n" ); - } - else { - if (is_packed) fprintf( cf, "packed\n" ); - if (is_two) fprintf( cf, "two\n" ); - if (is_four) fprintf( cf, "four\n" ); - if (is_eight) fprintf( cf, "eight\n" ); - if (is_sixteen) fprintf( cf, "sixteen\n" ); - } - } - fclose( cf ); - return 0; -}], -pac_cv_c_max_fp_align=`cat ctest.out`, -pac_cv_c_max_fp_align="unknown", -pac_cv_c_max_fp_align="$CROSS_ALIGN_STRUCT_FP") -rm -f ctest.out -]) -if test -z "$pac_cv_c_max_fp_align" ; then - pac_cv_c_max_fp_align="unknown" -fi -]) - -dnl Return the floating point structure alignment in -dnl pac_cv_c_max_double_fp_align. -dnl -dnl Possible values include: -dnl packed -dnl two -dnl four -dnl eight -dnl -dnl In addition, a "Could not determine alignment" and a "error!" -dnl return is possible. -AC_DEFUN([PAC_C_MAX_DOUBLE_FP_ALIGN],[ -AC_CACHE_CHECK([for max C struct alignment of structs with doubles], -pac_cv_c_max_double_fp_align,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - int is_packed = 1; - int is_two = 1; - int is_four = 1; - int is_eight = 1; - struct { char a; float b; } char_float; - struct { float b; char a; } float_char; - struct { char a; double b; } char_double; - struct { double b; char a; } double_char; - int size, extent1, extent2; - - size = sizeof(char) + sizeof(float); - extent1 = sizeof(char_float); - extent2 = sizeof(float_char); - if (size != extent1) is_packed = 0; - if ( (extent1 % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(float) == 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; - DBG("char_float",size,extent1); - - size = sizeof(char) + sizeof(double); - extent1 = sizeof(char_double); - extent2 = sizeof(double_char); - if (size != extent1) is_packed = 0; - if ( (extent1 % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(double) == 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; - DBG("char_double",size,extent1); - - if (is_eight) { is_four = 0; is_two = 0; } - - if (is_four) is_two = 0; - - /* Tabulate the results */ - cf = fopen( "ctest.out", "w" ); - if (is_packed + is_two + is_four + is_eight == 0) { - fprintf( cf, "Could not determine alignment\n" ); - } - else { - if (is_packed + is_two + is_four + is_eight != 1) { - fprintf( cf, "error!\n" ); - } - else { - if (is_packed) fprintf( cf, "packed\n" ); - if (is_two) fprintf( cf, "two\n" ); - if (is_four) fprintf( cf, "four\n" ); - if (is_eight) fprintf( cf, "eight\n" ); - } - } - fclose( cf ); - return 0; -}], -pac_cv_c_max_double_fp_align=`cat ctest.out`, -pac_cv_c_max_double_fp_align="unknown", -pac_cv_c_max_double_fp_align="$CROSS_ALIGN_STRUCT_DOUBLE_FP") -rm -f ctest.out -]) -if test -z "$pac_cv_c_max_double_fp_align" ; then - pac_cv_c_max_double_fp_align="unknown" -fi -]) -AC_DEFUN([PAC_C_MAX_LONGDOUBLE_FP_ALIGN],[ -AC_CACHE_CHECK([for max C struct floating point alignment with long doubles], -pac_cv_c_max_longdouble_fp_align,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - int is_packed = 1; - int is_two = 1; - int is_four = 1; - int is_eight = 1; - int is_sixteen = 1; - struct { char a; long double b; } char_long_double; - struct { long double b; char a; } long_double_char; - struct { long double a; int b; char c; } long_double_int_char; - int size, extent1, extent2; - - size = sizeof(char) + sizeof(long double); - extent1 = sizeof(char_long_double); - extent2 = sizeof(long_double_char); - if (size != extent1) is_packed = 0; - if ( (extent1 % 2) != 0 && (extent2 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0 && (extent2 % 4) != 0) is_four = 0; - if (sizeof(long double) >= 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0) - is_eight = 0; - if (sizeof(long double) > 8 && (extent1 % 16) != 0 - && (extent2 % 16) != 0) is_sixteen = 0; - DBG("char_long-double",size,extent1); - - extent1 = sizeof(long_double_int_char); - if ( (extent1 % 2) != 0) is_two = 0; - if ( (extent1 % 4) != 0) is_four = 0; - if (sizeof(long double) >= 8 && (extent1 % 8) != 0) is_eight = 0; - if (sizeof(long double) > 8 && (extent1 % 16) != 0) is_sixteen = 0; - - if (is_sixteen) { is_eight = 0; is_four = 0; is_two = 0; } - - if (is_eight) { is_four = 0; is_two = 0; } - - if (is_four) is_two = 0; - - /* Tabulate the results */ - cf = fopen( "ctest.out", "w" ); - if (is_packed + is_two + is_four + is_eight + is_sixteen == 0) { - fprintf( cf, "Could not determine alignment\n" ); - } - else { - if (is_packed + is_two + is_four + is_eight + is_sixteen != 1) { - fprintf( cf, "error!\n" ); - } - else { - if (is_packed) fprintf( cf, "packed\n" ); - if (is_two) fprintf( cf, "two\n" ); - if (is_four) fprintf( cf, "four\n" ); - if (is_eight) fprintf( cf, "eight\n" ); - if (is_sixteen) fprintf( cf, "sixteen\n" ); - } - } - fclose( cf ); - return 0; -}], -pac_cv_c_max_longdouble_fp_align=`cat ctest.out`, -pac_cv_c_max_longdouble_fp_align="unknown", -pac_cv_c_max_longdouble_fp_align="$CROSS_ALIGN_STRUCT_LONGDOUBLE_FP") -rm -f ctest.out -]) -if test -z "$pac_cv_c_max_longdouble_fp_align" ; then - pac_cv_c_max_longdouble_fp_align="unknown" -fi -]) - -dnl Other tests assume that there is potentially a maximum alignment -dnl and that if there is no maximum alignment, or a type is smaller than -dnl that value, then we align on the size of the value, with the exception -dnl of the "position-based alignment" rules we test for separately. -dnl -dnl It turns out that these assumptions have fallen short in at least one -dnl case, on MacBook Pros, where doubles are aligned on 4-byte boundaries -dnl even when long doubles are aligned on 16-byte boundaries. So this test -dnl is here specifically to handle this case. -dnl -dnl Puts result in pac_cv_c_double_alignment_exception. -dnl -dnl Possible values currently include no and four. -dnl -AC_DEFUN([PAC_C_DOUBLE_ALIGNMENT_EXCEPTION],[ -AC_CACHE_CHECK([if double alignment breaks rules, find actual alignment], -pac_cv_c_double_alignment_exception,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - struct { char a; double b; } char_double; - struct { double b; char a; } double_char; - int extent1, extent2, align_4 = 0; - - extent1 = sizeof(char_double); - extent2 = sizeof(double_char); - - /* we're interested in the largest value, will let separate test - * deal with position-based issues. - */ - if (extent1 < extent2) extent1 = extent2; - if ((sizeof(double) == 8) && (extent1 % 8) != 0) { - if (extent1 % 4 == 0) { -#ifdef HAVE_MAX_FP_ALIGNMENT - if (HAVE_MAX_FP_ALIGNMENT >= 8) align_4 = 1; -#else - align_4 = 1; -#endif - } - } - - cf = fopen( "ctest.out", "w" ); - - if (align_4) fprintf( cf, "four\n" ); - else fprintf( cf, "no\n" ); - - fclose( cf ); - return 0; -}], -pac_cv_c_double_alignment_exception=`cat ctest.out`, -pac_cv_c_double_alignment_exception="unknown", -pac_cv_c_double_alignment_exception="$CROSS_ALIGN_DOUBLE_EXCEPTION") -rm -f ctest.out -]) -if test -z "$pac_cv_c_double_alignment_exception" ; then - pac_cv_c_double_alignment_exception="unknown" -fi -]) - -dnl Test for odd struct alignment rule that only applies max. -dnl padding when double value is at front of type. -dnl Puts result in pac_cv_c_double_pos_align. -dnl -dnl Search for "Power alignment mode" for more details. -dnl -dnl Possible values include yes, no, and unknown. -dnl -AC_DEFUN([PAC_C_DOUBLE_POS_ALIGN],[ -AC_CACHE_CHECK([if alignment of structs with doubles is based on position], -pac_cv_c_double_pos_align,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - int padding_varies_by_pos = 0; - struct { char a; double b; } char_double; - struct { double b; char a; } double_char; - int extent1, extent2; - - extent1 = sizeof(char_double); - extent2 = sizeof(double_char); - if (extent1 != extent2) padding_varies_by_pos = 1; - - cf = fopen( "ctest.out", "w" ); - if (padding_varies_by_pos) fprintf( cf, "yes\n" ); - else fprintf( cf, "no\n" ); - - fclose( cf ); - return 0; -}], -pac_cv_c_double_pos_align=`cat ctest.out`, -pac_cv_c_double_pos_align="unknown", -pac_cv_c_double_pos_align="$CROSS_ALIGN_DOUBLE_POS") -rm -f ctest.out -]) -if test -z "$pac_cv_c_double_pos_align" ; then - pac_cv_c_double_pos_align="unknown" -fi -]) - -dnl Test for odd struct alignment rule that only applies max. -dnl padding when long long int value is at front of type. -dnl Puts result in pac_cv_c_llint_pos_align. -dnl -dnl Search for "Power alignment mode" for more details. -dnl -dnl Possible values include yes, no, and unknown. -dnl -AC_DEFUN([PAC_C_LLINT_POS_ALIGN],[ -AC_CACHE_CHECK([if alignment of structs with long long ints is based on position], -pac_cv_c_llint_pos_align,[ -AC_TRY_RUN([ -#include -#define DBG(a,b,c) -int main( int argc, char *argv[] ) -{ - FILE *cf; - int padding_varies_by_pos = 0; -#ifdef HAVE_LONG_LONG_INT - struct { char a; long long int b; } char_llint; - struct { long long int b; char a; } llint_char; - int extent1, extent2; - - extent1 = sizeof(char_llint); - extent2 = sizeof(llint_char); - if (extent1 != extent2) padding_varies_by_pos = 1; -#endif - - cf = fopen( "ctest.out", "w" ); - if (padding_varies_by_pos) fprintf( cf, "yes\n" ); - else fprintf( cf, "no\n" ); - - fclose( cf ); - return 0; -}], -pac_cv_c_llint_pos_align=`cat ctest.out`, -pac_cv_c_llint_pos_align="unknown", -pac_cv_c_llint_pos_align="$CROSS_ALIGN_LLINT_POS") -rm -f ctest.out -]) -if test -z "$pac_cv_c_llint_pos_align" ; then - pac_cv_c_llint_pos_align="unknown" -fi -]) - -dnl/*D -dnl PAC_FUNC_NEEDS_DECL - Set NEEDS__DECL if a declaration is needed -dnl -dnl Synopsis: -dnl PAC_FUNC_NEEDS_DECL(headerfiles,funcname) -dnl -dnl Output Effect: -dnl Sets 'NEEDS__DECL' if 'funcname' is not declared by the -dnl headerfiles. -dnl -dnl Approach: -dnl Attempt to assign library function to function pointer. If the function -dnl is not declared in a header, this will fail. Use a non-static global so -dnl the compiler does not warn about an unused variable. -dnl -dnl Simply calling the function is not enough because C89 compilers allow -dnl calls to implicitly-defined functions. Re-declaring a library function -dnl with an incompatible prototype is also not sufficient because some -dnl compilers (notably clang-3.2) only produce a warning in this case. -dnl -dnl D*/ -AC_DEFUN([PAC_FUNC_NEEDS_DECL],[ -AC_CACHE_CHECK([whether $2 needs a declaration], -pac_cv_func_decl_$2,[ -AC_TRY_COMPILE([$1 -void (*fptr)(void) = (void(*)(void))$2;],[], -pac_cv_func_decl_$2=no,pac_cv_func_decl_$2=yes)]) -if test "$pac_cv_func_decl_$2" = "yes" ; then -changequote(<<,>>)dnl -define(<>, translit(NEEDS_$2_DECL, [a-z *], [A-Z__]))dnl -changequote([, ])dnl - AC_DEFINE_UNQUOTED(PAC_FUNC_NAME,1,[Define if $2 needs a declaration]) -undefine([PAC_FUNC_NAME]) -fi -]) - -dnl PAC_C_GNU_ATTRIBUTE - See if the GCC __attribute__ specifier is allow. -dnl Use the following -dnl #ifndef HAVE_GCC_ATTRIBUTE -dnl #define __attribute__(a) -dnl #endif -dnl If *not*, define __attribute__(a) as null -dnl -dnl We start by requiring Gcc. Some other compilers accept __attribute__ -dnl but generate warning messages, or have different interpretations -dnl (which seems to make __attribute__ just as bad as #pragma) -dnl For example, the Intel icc compiler accepts __attribute__ and -dnl __attribute__((pure)) but generates warnings for __attribute__((format...)) -dnl -AC_DEFUN([PAC_C_GNU_ATTRIBUTE],[ -AC_REQUIRE([AC_PROG_CC_GNU]) -if test "$ac_cv_prog_gcc" = "yes" ; then - AC_CACHE_CHECK([whether __attribute__ allowed], -pac_cv_gnu_attr_pure,[ -AC_TRY_COMPILE([int foo(int) __attribute__ ((pure));],[int a;], -pac_cv_gnu_attr_pure=yes,pac_cv_gnu_attr_pure=no)]) -AC_CACHE_CHECK([whether __attribute__((format)) allowed], -pac_cv_gnu_attr_format,[ -AC_TRY_COMPILE([int foo(char *,...) __attribute__ ((format(printf,1,2)));],[int a;], -pac_cv_gnu_attr_format=yes,pac_cv_gnu_attr_format=no)]) - if test "$pac_cv_gnu_attr_pure" = "yes" -a "$pac_cv_gnu_attr_format" = "yes" ; then - AC_DEFINE(HAVE_GCC_ATTRIBUTE,1,[Define if GNU __attribute__ is supported]) - fi -fi -]) -dnl -dnl Check for a broken install (fails to preserve file modification times, -dnl thus breaking libraries. -dnl -dnl Create a library, install it, and then try to link against it. -AC_DEFUN([PAC_PROG_INSTALL_BREAKS_LIBS],[ -AC_CACHE_CHECK([whether install breaks libraries], -ac_cv_prog_install_breaks_libs,[ -AC_REQUIRE([AC_PROG_RANLIB]) -AC_REQUIRE([AC_PROG_INSTALL]) -AC_REQUIRE([AC_PROG_CC]) -ac_cv_prog_install_breaks_libs=yes - -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ int foo(int); int foo(int a){return a;} ]) -],[ - if ${AR-ar} ${AR_FLAGS-cr} libconftest.a conftest.$OBJEXT >/dev/null 2>&1 ; then - if ${RANLIB-:} libconftest.a >/dev/null 2>&1 ; then - # Anything less than sleep 10, and Mac OS/X (Darwin) - # will claim that install works because ranlib won't complain - sleep 10 - libinstall="$INSTALL_DATA" - eval "libinstall=\"$libinstall\"" - if ${libinstall} libconftest.a libconftest1.a >/dev/null 2>&1 ; then - saved_LIBS="$LIBS" - LIBS="libconftest1.a" - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -extern int foo(int); -int main(int argc, char **argv){ return foo(0); } - ]) - ],[ - # Success! Install works - ac_cv_prog_install_breaks_libs=no - ],[ - # Failure! Does install -p work? - rm -f libconftest1.a - if ${libinstall} -p libconftest.a libconftest1.a >/dev/null 2>&1 ; then - AC_LINK_IFELSE([],[ - # Success! Install works - ac_cv_prog_install_breaks_libs="no, with -p" - ]) - fi - ]) - LIBS="$saved_LIBS" - fi - fi - fi -]) -rm -f libconftest*.a -]) dnl Endof ac_cache_check - -if test -z "$RANLIB_AFTER_INSTALL" ; then - RANLIB_AFTER_INSTALL=no -fi -case "$ac_cv_prog_install_breaks_libs" in - yes) - RANLIB_AFTER_INSTALL=yes - ;; - "no, with -p") - INSTALL_DATA="$INSTALL_DATA -p" - ;; - *) - # Do nothing - : - ;; -esac -AC_SUBST(RANLIB_AFTER_INSTALL) -]) - -# -# determine if the compiler defines a symbol containing the function name -# -# These tests check not only that the compiler defines some symbol, such -# as __FUNCTION__, but that the symbol correctly names the function. -# -# Defines -# HAVE__FUNC__ (if __func__ defined) -# HAVE_CAP__FUNC__ (if __FUNC__ defined) -# HAVE__FUNCTION__ (if __FUNCTION__ defined) -# -AC_DEFUN([PAC_CC_FUNCTION_NAME_SYMBOL],[ -AC_CACHE_CHECK([whether the compiler defines __func__], -pac_cv_have__func__,[ -tmp_am_cross=no -AC_RUN_IFELSE([ -AC_LANG_SOURCE([ -#include -int foo(void); -int foo(void) -{ - return (strcmp(__func__, "foo") == 0); -} -int main(int argc, char ** argv) -{ - return (foo() ? 0 : 1); -} -]) -], pac_cv_have__func__=yes, pac_cv_have__func__=no,tmp_am_cross=yes) -if test "$tmp_am_cross" = yes ; then - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -#include -int foo(void); -int foo(void) -{ - return (strcmp(__func__, "foo") == 0); -} -int main(int argc, char ** argv) -{ - return (foo() ? 0 : 1); -} - ]) -], pac_cv_have__func__=yes, pac_cv_have__func__=no) -fi -]) - -if test "$pac_cv_have__func__" = "yes" ; then - AC_DEFINE(HAVE__FUNC__,,[define if the compiler defines __func__]) -fi - -AC_CACHE_CHECK([whether the compiler defines __FUNC__], -pac_cv_have_cap__func__,[ -tmp_am_cross=no -AC_RUN_IFELSE([ -AC_LANG_SOURCE([ -#include -int foo(void); -int foo(void) -{ - return (strcmp(__FUNC__, "foo") == 0); -} -int main(int argc, char ** argv) -{ - return (foo() ? 0 : 1); -} -]) -], pac_cv_have_cap__func__=yes, pac_cv_have_cap__func__=no,tmp_am_cross=yes) -if test "$tmp_am_cross" = yes ; then - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -#include -int foo(void); -int foo(void) -{ - return (strcmp(__FUNC__, "foo") == 0); -} -int main(int argc, char ** argv) -{ - return (foo() ? 0 : 1); -} - ]) -], pac_cv_have__func__=yes, pac_cv_have__func__=no) -fi -]) - -if test "$pac_cv_have_cap__func__" = "yes" ; then - AC_DEFINE(HAVE_CAP__FUNC__,,[define if the compiler defines __FUNC__]) -fi - -AC_CACHE_CHECK([whether the compiler sets __FUNCTION__], -pac_cv_have__function__,[ -tmp_am_cross=no -AC_RUN_IFELSE([ -AC_LANG_SOURCE([ -#include -int foo(void); -int foo(void) -{ - return (strcmp(__FUNCTION__, "foo") == 0); -} -int main(int argc, char ** argv) -{ - return (foo() ? 0 : 1); -} -]) -], pac_cv_have__function__=yes, pac_cv_have__function__=no,tmp_am_cross=yes) -if test "$tmp_am_cross" = yes ; then - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -#include -int foo(void); -int foo(void) -{ - return (strcmp(__FUNCTION__, "foo") == 0); -} -int main(int argc, char ** argv) -{ - return (foo() ? 0 : 1); -} - ]) -], pac_cv_have__func__=yes, pac_cv_have__func__=no) -fi -]) - -if test "$pac_cv_have__function__" = "yes" ; then - AC_DEFINE(HAVE__FUNCTION__,,[define if the compiler defines __FUNCTION__]) -fi - -]) - - -dnl Check structure alignment -AC_DEFUN([PAC_STRUCT_ALIGNMENT],[ - # Initialize alignment checks - is_packed=1 - is_two=1 - is_four=1 - is_eight=1 - is_largest=1 - - # See if long double exists - AC_TRY_COMPILE(,[long double a;],have_long_double=yes,have_long_double=no) - - # Get sizes of regular types - AC_CHECK_SIZEOF(char) - AC_CHECK_SIZEOF(int) - AC_CHECK_SIZEOF(short) - AC_CHECK_SIZEOF(long) - AC_CHECK_SIZEOF(float) - AC_CHECK_SIZEOF(double) - AC_CHECK_SIZEOF(long double) - - # char_int comparison - AC_CHECK_SIZEOF(char_int, 0, [typedef struct { char a; int b; } char_int; ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_int` - extent=$ac_cv_sizeof_char_int - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_int`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "`expr $extent % 4`" != "0" ; then is_four=0 ; fi - if test "$ac_cv_sizeof_int" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # char_short comparison - AC_CHECK_SIZEOF(char_short, 0, [typedef struct { char a; short b; } char_short; ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_short` - extent=$ac_cv_sizeof_char_short - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_short`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "$ac_cv_sizeof_short" = "4" -a "`expr $extent % 4`" != "0" ; then - is_four=0 - fi - if test "$ac_cv_sizeof_short" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # char_long comparison - AC_CHECK_SIZEOF(char_long, 0, [typedef struct { char a; long b; } char_long; ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_long` - extent=$ac_cv_sizeof_char_long - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_long`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "`expr $extent % 4`" != "0" ; then is_four=0 ; fi - if test "$ac_cv_sizeof_long" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # char_float comparison - AC_CHECK_SIZEOF(char_float, 0, [typedef struct { char a; float b; } char_float; ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_float` - extent=$ac_cv_sizeof_char_float - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_float`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "`expr $extent % 4`" != "0" ; then is_four=0 ; fi - if test "$ac_cv_sizeof_float" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # char_double comparison - AC_CHECK_SIZEOF(char_double, 0, [typedef struct { char a; double b; } char_double; ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_double` - extent=$ac_cv_sizeof_char_double - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_double`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "`expr $extent % 4`" != "0" ; then is_four=0 ; fi - if test "$ac_cv_sizeof_double" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # char_long_double comparison - if test "$have_long_double" = "yes"; then - AC_CHECK_SIZEOF(char_long_double, 0, [ - typedef struct { - char a; - long double b; - } char_long_double; - ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_long_double` - extent=$ac_cv_sizeof_char_long_double - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_long_double`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "`expr $extent % 4`" != "0" ; then is_four=0 ; fi - if test "$ac_cv_sizeof_long_double" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - fi - - # char_int_char comparison - AC_CHECK_SIZEOF(char_int_char, 0, [ - typedef struct { - char a; - int b; - char c; - } char_int_char; - ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_int + $ac_cv_sizeof_char` - extent=$ac_cv_sizeof_char_int_char - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_int`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "`expr $extent % 4`" != "0" ; then is_four=0 ; fi - if test "$ac_cv_sizeof_int" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # char_short_char comparison - AC_CHECK_SIZEOF(char_short_char, 0, [ - typedef struct { - char a; - short b; - char c; - } char_short_char; - ]) - size=`expr $ac_cv_sizeof_char + $ac_cv_sizeof_short + $ac_cv_sizeof_char` - extent=$ac_cv_sizeof_char_short_char - if test "$size" != "$extent" ; then is_packed=0 ; fi - if test "`expr $extent % $ac_cv_sizeof_short`" != "0" ; then is_largest=0 ; fi - if test "`expr $extent % 2`" != "0" ; then is_two=0 ; fi - if test "$ac_cv_sizeof_short" = "4" -a "`expr $extent % 4`" != "0" ; then - is_four=0 - fi - if test "$ac_cv_sizeof_short" = "8" -a "`expr $extent % 8`" != "0" ; then - is_eight=0 - fi - - # If aligned mod 8, it will be aligned mod 4 - if test $is_eight = 1 ; then is_four=0 ; is_two=0 ; fi - if test $is_four = 1 ; then is_two=0 ; fi - - # Largest supersedes 8 - if test $is_largest = 1 ; then is_eight=0 ; fi - - # Find the alignment - if test "`expr $is_packed + $is_largest + $is_two + $is_four + $is_eight`" = "0" ; then - pac_cv_struct_alignment="unknown" - elif test "`expr $is_packed + $is_largest + $is_two + $is_four + $is_eight`" != "1" ; then - pac_cv_struct_alignment="unknown" - elif test $is_packed = 1 ; then - pac_cv_struct_alignment="packed" - elif test $is_largest = 1 ; then - pac_cv_struct_alignment="largest" - elif test $is_two = 1 ; then - pac_cv_struct_alignment="two" - elif test $is_four = 1 ; then - pac_cv_struct_alignment="four" - elif test $is_eight = 1 ; then - pac_cv_struct_alignment="eight" - fi -]) -dnl -dnl PAC_C_MACRO_VA_ARGS -dnl -dnl will AC_DEFINE([HAVE_MACRO_VA_ARGS]) if the compiler supports C99 variable -dnl length argument lists in macros (#define foo(...) bar(__VA_ARGS__)) -AC_DEFUN([PAC_C_MACRO_VA_ARGS],[ - AC_MSG_CHECKING([for variable argument list macro functionality]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ - #include - #define conftest_va_arg_macro(...) printf(__VA_ARGS__) - ], - [conftest_va_arg_macro("a test %d", 3);])], - [AC_DEFINE([HAVE_MACRO_VA_ARGS],[1],[Define if C99-style variable argument list macro functionality]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) -])dnl - -# Will AC_DEFINE([HAVE_BUILTIN_EXPECT]) if the compiler supports __builtin_expect. -AC_DEFUN([PAC_C_BUILTIN_EXPECT],[ -AC_MSG_CHECKING([if C compiler supports __builtin_expect]) - -AC_TRY_LINK(, [ - return __builtin_expect(1, 1) ? 1 : 0 -], [ - have_builtin_expect=yes - AC_MSG_RESULT([yes]) -], [ - have_builtin_expect=no - AC_MSG_RESULT([no]) -]) -if test x$have_builtin_expect = xyes ; then - AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.]) -fi -]) diff --git a/3rd-party/romio321/confdb/aclocal_coverage.m4 b/3rd-party/romio321/confdb/aclocal_coverage.m4 deleted file mode 100644 index ce949d40a65..00000000000 --- a/3rd-party/romio321/confdb/aclocal_coverage.m4 +++ /dev/null @@ -1,90 +0,0 @@ - -dnl Macro to add --enable-coverage option (disabled by default) and add -dnl appropriate compiler flags to permit usage of gcov if that option is -dnl enabled. If WRAPPER_xFLAGS variables are set then the flags will also be -dnl added to those variables. -dnl -dnl Sets "pac_cv_use_coverage=yes" and AC_DEFINEs USE_COVERAGE if coverage was -dnl successfully enabled. Also creates an AM_CONDITIONAL with the name -dnl "BUILD_COVERAGE" that is true iff pac_cv_use_coverage=yes. -dnl -dnl Usage: PAC_CONFIG_SUBDIR_ARGS -dnl -dnl Assumes that all of the compiler macros have already been invoked -dnl (AC_PROG_CC and friends). -AC_DEFUN([PAC_ENABLE_COVERAGE],[ - -AC_ARG_VAR([GCOV],[name/path for the gcov utility]) -AC_CHECK_PROGS([GCOV],[gcov]) - -AC_ARG_ENABLE([coverage], - [AC_HELP_STRING([--enable-coverage], - [Turn on coverage analysis using gcc and gcov])], - [],[enable_coverage=no]) - -if test "$enable_coverage" = "yes" ; then - if test "$ac_cv_prog_gcc" = "yes" ; then - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - LIBS="$LIBS -lgcov" - if test ${WRAPPER_CFLAGS+set} = set ; then - WRAPPER_CFLAGS="$WRAPPER_CFLAGS -fprofile-arcs -ftest-coverage" - fi - else - AC_MSG_WARN([--enable-coverage only supported for GCC]) - fi - if test "$enable_cxx" = "yes" ; then - if test "$ac_cv_cxx_compiler_gnu" = "yes" ; then - CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" - LIBS="$LIBS -lgcov" - if test ${WRAPPER_CXXFLAGS+set} = set ; then - WRAPPER_CXXFLAGS="$WRAPPER_CXXFLAGS -fprofile-arcs -ftest-coverage" - fi - else - AC_MSG_WARN([--enable-coverage only supported for GCC]) - fi - fi - # Add similar options for g77 so that the Fortran tests will also - # - if test "$enable_f77" = yes ; then - if test "$ac_cv_f77_compiler_gnu" = "yes" ; then - FFLAGS="$FFLAGS -fprofile-arcs -ftest-coverage" - LIBS="$LIBS -lgcov" - if test ${WRAPPER_FFLAGS+set} = set ; then - WRAPPER_FFLAGS="$WRAPPER_FFLAGS -fprofile-arcs -ftest-coverage" - fi - else - AC_MSG_WARN([--enable-coverage only supported for G77/GFORTRAN]) - fi - fi - if test "$enable_fc" = yes ; then - if test "$ac_cv_fc_compiler_gnu" = "yes" ; then - FCFLAGS="$FCFLAGS -fprofile-arcs -ftest-coverage" - LIBS="$LIBS -lgcov" - if test ${WRAPPER_FCFLAGS+set} = set ; then - WRAPPER_FCFLAGS="$WRAPPER_FCFLAGS -fprofile-arcs -ftest-coverage" - fi - else - AC_MSG_WARN([--enable-coverage only supported for GFORTRAN]) - fi - fi - # On some platforms (e.g., Mac Darwin), we must also *link* - # with the -fprofile-args -ftest-coverage option. - AC_MSG_CHECKING([whether compilation with coverage analysis enabled works]) - AC_LINK_IFELSE([AC_LANG_SOURCE([int main(int argc, char **argv){return 1;}])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([Unable to link programs when coverage analysis enabled])]) - - # Test for the routines that we need to use to ensure that the - # data files are (usually) written out - # FIXME: Some versions of Linux provide usleep, but it rounds times - # up to the next second (!) - AC_CHECK_FUNCS([usleep]) - - # NOTE: using a "pac_cv_" prefix but not caching because of xFLAGS "side effects" - pac_cv_use_coverage=yes - AC_DEFINE([USE_COVERAGE],[1],[Define if performing coverage tests]) -fi -AM_CONDITIONAL([BUILD_COVERAGE],[test "X$pac_cv_use_coverage" = "Xyes"]) -]) - diff --git a/3rd-party/romio321/confdb/aclocal_cxx.m4 b/3rd-party/romio321/confdb/aclocal_cxx.m4 deleted file mode 100644 index 72febd8ab9d..00000000000 --- a/3rd-party/romio321/confdb/aclocal_cxx.m4 +++ /dev/null @@ -1,187 +0,0 @@ -dnl PAC_CXX_SEARCH_LIST - expands to a whitespace separated list of C++ -dnl compilers for use with AC_PROG_CXX that is more suitable for HPC software -dnl packages -AC_DEFUN([PAC_CXX_SEARCH_LIST],[$CCC icpc pgCC xlC pathCC g++ clang++ c++ cc++ cxx CC cl]) -dnl PAC_PROG_CXX - reprioritize the C++ compiler search order -dnl NOTE: this macro suffers from a basically intractable "expanded before it -dnl was required" problem when libtool is also used -AC_DEFUN([PAC_PROG_CXX],[ - PAC_PUSH_FLAG([CXXFLAGS]) - # This test uses the list from a recent PROG_CXX, but with the - # addition of the Portland group, IBM, and Intel C++ compilers - # (While the Intel icc compiler will compile C++ programs, it will - # not *link* C++ object files unless there is at least one C++ source - # file present on the command that performs the linking. icpc is the - # Intel C++ compiler that both compiles and links C++ programs) - AC_PROG_CXX([PAC_CXX_SEARCH_LIST]) - PAC_POP_FLAG([CXXFLAGS]) -]) - -dnl This is from crypt.to/autoconf-archive, slightly modified. -dnl It defines bool as int if it is not availalbe -dnl -AC_DEFUN([AX_CXX_BOOL], -[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, -ac_cv_cxx_bool, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([ -int f(int x){return 1;} -int f(char x){return 1;} -int f(bool x){return 1;} -],[bool b = true; return f(b);], - ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_bool" != yes; then - AC_DEFINE(bool,int,[define if bool is a built-in type]) -fi -]) - -dnl This is from crypt.to/autoconf-archive, slightly modified (name defined) -dnl -AC_DEFUN([AX_CXX_EXCEPTIONS], -[AC_CACHE_CHECK(whether the compiler supports exceptions, -ac_cv_cxx_exceptions, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }], - ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_exceptions" = yes; then - AC_DEFINE(HAVE_CXX_EXCEPTIONS,,[define if the compiler supports exceptions]) -fi -]) - -dnl This is from crypt.to/autoconf-archive -dnl -AC_DEFUN([AX_CXX_NAMESPACES], -[AC_CACHE_CHECK(whether the compiler implements namespaces, -ac_cv_cxx_namespaces, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) -fi -]) - -dnl Some compilers support namespaces but don't know about std -dnl -AC_DEFUN([AX_CXX_NAMESPACE_STD], -[AC_REQUIRE([AX_CXX_NAMESPACES]) -AC_CACHE_CHECK(whether the compiler implements the namespace std, -ac_cv_cxx_namespace_std, -[ac_cv_cxx_namespace_std=no -if test "$ac_cv_cxx_namespaces" = yes ; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([ -#include -using namespace std;], - [cout << "message\n";], - ac_cv_cxx_namespace_std=yes, ac_cv_cxx_namespace_std=no) - AC_LANG_RESTORE -fi -]) -if test "$ac_cv_cxx_namespace_std" = yes; then - AC_DEFINE(HAVE_NAMESPACE_STD,,[define if the compiler implements namespace std]) -fi -]) - -dnl/*D -dnl PAC_CXX_CHECK_COMPILER_OPTION - Check that a C++ compiler option is -dnl accepted without warning messages -dnl -dnl Synopsis: -dnl PAC_CXX_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) -dnl -dnl Output Effects: -dnl -dnl If no actions are specified, a working value is added to 'CXXOPTIONS' -dnl -dnl Notes: -dnl This is now careful to check that the output is different, since -dnl some compilers are noisy. -dnl -dnl We are extra careful to prototype the functions in case compiler options -dnl that complain about poor code are in effect. -dnl -dnl Because this is a long script, we have ensured that you can pass a -dnl variable containing the option name as the first argument. -dnl D*/ -AC_DEFUN([PAC_CXX_CHECK_COMPILER_OPTION],[ -AC_MSG_CHECKING([whether C++ compiler accepts option $1]) -pac_opt="$1" -AC_LANG_PUSH([C++]) -CXXFLAGS_orig="$CXXFLAGS" -CXXFLAGS_opt="$pac_opt $CXXFLAGS" -pac_result="unknown" - -AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) -CXXFLAGS="$CXXFLAGS_orig" -rm -f pac_test1.log -PAC_LINK_IFELSE_LOG([pac_test1.log], [], [ - CXXFLAGS="$CXXFLAGS_opt" - rm -f pac_test2.log - PAC_LINK_IFELSE_LOG([pac_test2.log], [], [ - PAC_RUNLOG_IFELSE([diff -b pac_test1.log pac_test2.log], - [pac_result=yes],[pac_result=no]) - ],[ - pac_result=no - ]) -], [ - pac_result=no -]) -AC_MSG_RESULT([$pac_result]) -dnl Delete the conftest created by AC_LANG_CONFTEST. -rm -f conftest.$ac_ext - -if test "$pac_result" = "yes" ; then - AC_MSG_CHECKING([whether routines compiled with $pac_opt can be linked with ones compiled without $pac_opt]) - pac_result=unknown - CXXFLAGS="$CXXFLAGS_orig" - rm -f pac_test3.log - PAC_COMPILE_IFELSE_LOG([pac_test3.log], [ - AC_LANG_SOURCE([ - int foo(void); - int foo(void){return 0;} - ]) - ],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - - CXXFLAGS="$CXXFLAGS_opt" - rm -f pac_test4.log - PAC_LINK_IFELSE_LOG([pac_test4.log], [AC_LANG_PROGRAM()], [ - PAC_RUNLOG_IFELSE([diff -b pac_test2.log pac_test4.log], - [pac_result=yes], [pac_result=no]) - ],[ - pac_result=no - ]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT - ],[ - pac_result=no - ]) - AC_MSG_RESULT([$pac_result]) - rm -f pac_test3.log pac_test4.log -fi -rm -f pac_test1.log pac_test2.log - -dnl Restore CXXFLAGS before 2nd/3rd argument commands are executed, -dnl as 2nd/3rd argument command could be modifying CXXFLAGS. -CXXFLAGS="$CXXFLAGS_orig" -if test "$pac_result" = "yes" ; then - ifelse([$2],[],[CXXOPTIONS="$CXXOPTIONS $1"],[$2]) -else - ifelse([$3],[],[:],[$3]) -fi -AC_LANG_POP([C++]) -]) diff --git a/3rd-party/romio321/confdb/aclocal_f77.m4 b/3rd-party/romio321/confdb/aclocal_f77.m4 deleted file mode 100644 index 92d310b0f21..00000000000 --- a/3rd-party/romio321/confdb/aclocal_f77.m4 +++ /dev/null @@ -1,1487 +0,0 @@ -dnl PAC_F77_SEARCH_LIST - expands to a whitespace separated list of fortran 77 -dnl compilers for use with AC_PROG_F77 that is more suitable for HPC software -dnl packages -AC_DEFUN([PAC_F77_SEARCH_LIST],[ifort pgf77 af77 xlf frt cf77 fort77 fl32 fort ifc efc ftn gfortran f77 g77]) -dnl PAC_PROG_F77 - reprioritize the F77 compiler search order -dnl NOTE: this macro suffers from a basically intractable "expanded before it -dnl was required" problem when libtool is also used -AC_DEFUN([PAC_PROG_F77],[ -PAC_PUSH_FLAG([FFLAGS]) -AC_PROG_F77([PAC_F77_SEARCH_LIST]) -PAC_POP_FLAG([FFLAGS]) -]) -dnl -dnl/*D -dnl PAC_PROG_F77_NAME_MANGLE - Determine how the Fortran compiler mangles -dnl names -dnl -dnl Synopsis: -dnl PAC_PROG_F77_NAME_MANGLE([action]) -dnl -dnl Output Effect: -dnl If no action is specified, one of the following names is defined: -dnl.vb -dnl If fortran names are mapped: -dnl lower -> lower F77_NAME_LOWER -dnl lower -> lower_ F77_NAME_LOWER_USCORE -dnl lower -> UPPER F77_NAME_UPPER -dnl lower_lower -> lower__ F77_NAME_LOWER_2USCORE -dnl mixed -> mixed F77_NAME_MIXED -dnl mixed -> mixed_ F77_NAME_MIXED_USCORE -dnl mixed -> UPPER@STACK_SIZE F77_NAME_UPPER_STDCALL -dnl.ve -dnl If an action is specified, it is executed instead. -dnl -dnl Notes: -dnl We assume that if lower -> lower (any underscore), upper -> upper with the -dnl same underscore behavior. Previous versions did this by -dnl compiling a Fortran program and running strings -a over it. Depending on -dnl strings is a bad idea, so instead we try compiling and linking with a -dnl C program, since that is why we are doing this anyway. A similar approach -dnl is used by FFTW, though without some of the cases we check (specifically, -dnl mixed name mangling). STD_CALL not only specifies a particular name -dnl mangling convention (adding the size of the calling stack into the function -dnl name, but also the stack management convention (callee cleans the stack, -dnl and arguments are pushed onto the stack from right to left) -dnl -dnl One additional problem is that some Fortran implementations include -dnl references to the runtime (like pgf90_compiled for the pgf90 compiler -dnl used as the "Fortran 77" compiler). This is not yet solved. -dnl -dnl D*/ -dnl -AC_DEFUN([PAC_PROG_F77_NAME_MANGLE],[ -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_CACHE_CHECK([for Fortran 77 name mangling], -pac_cv_prog_f77_name_mangle,[ -# Initialize pac_found to indicate if name mangling scheme has been found -pac_found=no -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - subroutine MY_name( ii ) - return - end - ]) -],[ - PAC_RUNLOG([mv conftest.$OBJEXT f77conftest.$OBJEXT]) - saved_LIBS="$LIBS" - dnl FLIBS is set by AC_F77_LIBRARY_LDFLAGS - LIBS="f77conftest.$OBJEXT $FLIBS $LIBS" - AC_LANG_PUSH([C]) - for call in "" __stdcall ; do - for sym in my_name_ my_name__ my_name MY_NAME MY_name MY_name_ NONE ; do - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([extern void ${call} ${sym}(int);],[${sym}(0);]) - ],[ - pac_found=yes - break - ]) - done - test "$pac_found" = "yes" && break - done - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - rm -f f77conftest.$OBJEXT -]) -AC_LANG_POP([Fortran 77]) -dnl -# If we got to here and pac_cv_prog_f77_name_mangle is still NOT definable, -# it may be that the programs have to be linked with the Fortran compiler, -# not the C compiler. Try reversing the language used for the test -if test "$pac_found" != "yes" ; then - AC_LANG_PUSH([C]) - for call in "" __stdcall ; do - for sym in my_name_ my_name__ my_name MY_NAME MY_name MY_name_ NONE ; do - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([void ${call} ${sym}(int a) {}]) - ],[ - PAC_RUNLOG([mv conftest.$OBJEXT cconftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="cconftest.$OBJEXT $LIBS" - AC_LANG_PUSH([Fortran 77]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([],[ call my_name(0)]) - ],[ - pac_found=yes - ]) - AC_LANG_POP([Fortran 77]) - LIBS="$saved_LIBS" - rm -f cconftest.$OBJEXT - test "$pac_found" = "yes" && break - ]) - done - test "$pac_found" = "yes" && break - done - AC_LANG_POP([C]) -fi -if test "$pac_found" = "yes" ; then - case ${sym} in - my_name_) - pac_cv_prog_f77_name_mangle="lower uscore" ;; - my_name__) - pac_cv_prog_f77_name_mangle="lower 2uscore" ;; - my_name) - pac_cv_prog_f77_name_mangle="lower" ;; - MY_NAME) - pac_cv_prog_f77_name_mangle="upper" ;; - MY_name) - pac_cv_prog_f77_name_mangle="mixed" ;; - MY_name_) - pac_cv_prog_f77_name_mangle="mixed uscore" ;; - *) - pac_cv_prog_f77_name_mangle="" - pac_found=no; - ;; - esac - if test "X$pac_cv_prog_f77_name_mangle" != "X" ; then - if test "$call" = "__stdcall" ; then - pac_cv_prog_f77_name_mangle="$pac_cv_prog_f77_name_mangle stdcall" - fi - fi -fi -]) -dnl Endof ac_cache_check -case $pac_cv_prog_f77_name_mangle in - *stdcall) - F77_STDCALL="__stdcall" ;; - *) - F77_STDCALL="" ;; -esac -# Get the standard call definition -# FIXME: This should use F77_STDCALL, not STDCALL (non-conforming name) -F77_STDCALL="$call" -AC_DEFINE_UNQUOTED(STDCALL,[$F77_STDCALL],[Define calling convention]) - -# new_name="`echo $name | tr ' ' '_' | tr [a-z] [A-Z]`" -# We could have done the character conversion with 'tr' -# which may not be portable, e.g. solaris's /usr/ucb/bin/tr. -# So use a conservative approach. - -# Replace blank with underscore -name_scheme="`echo $pac_cv_prog_f77_name_mangle | sed 's% %_%g'`" -# Turn lowercase into uppercase. -name_scheme="`echo $name_scheme | sed -e 'y%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ%'`" -F77_NAME_MANGLE="F77_NAME_${name_scheme}" -AC_DEFINE_UNQUOTED([$F77_NAME_MANGLE]) -AC_SUBST(F77_NAME_MANGLE) -if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then - AC_MSG_WARN([Unknown Fortran naming scheme]) -fi -dnl -dnl Define the macros that is needed by AC_DEFINE_UNQUOTED([$F77_NAME_MANGLE]) -AH_TEMPLATE([F77_NAME_LOWER], - [Fortran names are lowercase with no trailing underscore]) -AH_TEMPLATE([F77_NAME_LOWER_USCORE], - [Fortran names are lowercase with one trailing underscore]) -AH_TEMPLATE([F77_NAME_LOWER_2USCORE], - [Fortran names are lowercase with two trailing underscores]) -AH_TEMPLATE([F77_NAME_MIXED], - [Fortran names preserve the original case]) -AH_TEMPLATE([F77_NAME_MIXED_USCORE], - [Fortran names preserve the original case with one trailing underscore]) -AH_TEMPLATE([F77_NAME_UPPER], - [Fortran names are uppercase]) -AH_TEMPLATE([F77_NAME_LOWER_STDCALL], - [Fortran names are lowercase with no trailing underscore in stdcall]) -AH_TEMPLATE([F77_NAME_LOWER_USCORE_STDCALL], - [Fortran names are lowercase with one trailing underscore in stdcall]) -AH_TEMPLATE([F77_NAME_LOWER_2USCORE_STDCALL], - [Fortran names are lowercase with two trailing underscores in stdcall]) -AH_TEMPLATE([F77_NAME_MIXED_STDCALL], - [Fortran names preserve the original case in stdcall]) -AH_TEMPLATE([F77_NAME_MIXED_USCORE_STDCALL], - [Fortran names preserve the original case with one trailing underscore in stdcall]) -AH_TEMPLATE([F77_NAME_UPPER_STDCALL], - [Fortran names are uppercase in stdcall]) -]) -dnl -dnl/*D -dnl PAC_PROG_F77_CHECK_SIZEOF - Determine the size in bytes of a Fortran -dnl type -dnl -dnl Synopsis: -dnl PAC_PROG_F77_CHECK_SIZEOF(type,[cross-size]) -dnl -dnl Output Effect: -dnl Sets SIZEOF_F77_uctype to the size if bytes of type. -dnl If type is unknown, the size is set to 0. -dnl If cross-compiling, the value cross-size is used (it may be a variable) -dnl For example 'PAC_PROG_F77_CHECK_SIZEOF(real)' defines -dnl 'SIZEOF_F77_REAL' to 4 on most systems. The variable -dnl 'pac_cv_sizeof_f77_' (e.g., 'pac_cv_sizeof_f77_real') is also set to -dnl the size of the type. -dnl If the corresponding variable is already set, that value is used. -dnl If the name has an '*' in it (e.g., 'integer*4'), the defined name -dnl replaces that with an underscore (e.g., 'SIZEOF_F77_INTEGER_4'). -dnl -dnl Notes: -dnl If the 'cross-size' argument is not given, 'autoconf' will issue an error -dnl message. You can use '0' to specify undetermined. -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF],[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -changequote(<<, >>)dnl -dnl The name to #define. -dnl dnl If the arg value contains a variable, we need to update that -define(<>, translit(sizeof_f77_$1, [a-z *], [A-Z__]))dnl -dnl The cache variable name. -define(<>, translit(pac_cv_f77_sizeof_$1, [ *], [__]))dnl -changequote([, ])dnl -AC_CACHE_CHECK([for size of Fortran type $1],PAC_CV_NAME,[ -AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE]) -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - subroutine isize() - $1 i(2) - call cisize( i(1), i(2) ) - end - ]) -],[ - # pac_f77compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - # Save original LIBS, prepend previously generated object file to LIBS - saved_LIBS="$LIBS" - LIBS="pac_f77conftest.$OBJEXT $FLIBS $LIBS" - AC_LANG_PUSH([C]) - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -#ifdef F77_NAME_UPPER -#define cisize_ CISIZE -#define isize_ ISIZE -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define cisize_ cisize -#define isize_ isize -#endif -static int isize_val=0; -void cisize_(char *,char*); -void isize_(void); -void cisize_(char *i1p, char *i2p) -{ - isize_val = (int)(i2p - i1p); -} - ],[ - FILE *f = fopen("conftestval", "w"); - if (!f) return 1; - isize_(); - fprintf(f,"%d\n", isize_val); - ]) - dnl Endof ac_lang_program - ],[ - eval PAC_CV_NAME=`cat conftestval` - ],[ - eval PAC_CV_NAME=0 - ],[ - # Use -9999 as value to emit a warning message after the cache_check. - ifelse([$2],[],[eval PAC_CV_NAME=-9999],[eval PAC_CV_NAME=$2]) - ]) - dnl Endof ac_run_ifelse - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - # remove previously generated object file. - rm -f pac_f77conftest.$OBJEXT -],[ - # pac_f77compile_ok=no - ifelse([$2],,eval PAC_CV_NAME=0,eval PAC_CV_NAME=$2) -]) Endof ac_compile_ifelse -AC_LANG_POP([Fortran 77]) -]) -dnl Endof ac_cache_check -if test "$PAC_CV_NAME" = "-9999" ; then - AC_MSG_WARN([No value provided for size of $1 when cross-compiling]) -fi -AC_DEFINE_UNQUOTED(PAC_TYPE_NAME,$PAC_CV_NAME,[Define size of PAC_TYPE_NAME]) -undefine([PAC_TYPE_NAME]) -undefine([PAC_CV_NAME]) -]) -dnl -dnl This version uses a Fortran program to link programs. -dnl This is necessary because some compilers provide shared libraries -dnl that are not within the default linker paths (e.g., our installation -dnl of the Portland Group compilers) -dnl -AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF_EXT],[ -changequote(<<,>>)dnl -dnl The name to #define. -dnl If the arg value contains a variable, we need to update that -define(<>, translit(sizeof_f77_$1, [a-z *], [A-Z__]))dnl -dnl The cache variable name. -define(<>, translit(pac_cv_f77_sizeof_$1, [ *], [__]))dnl -changequote([,])dnl -AC_CACHE_CHECK([for size of Fortran type $1],PAC_CV_NAME,[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE]) -dnl if test "$cross_compiling" = yes ; then -dnl ifelse([$2],[], -dnl [AC_MSG_WARN([No value provided for size of $1 when cross-compiling])], -dnl [eval PAC_CV_NAME=$2]) -dnl fi -AC_LANG_PUSH([C]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -#ifdef F77_NAME_UPPER -#define cisize_ CISIZE -#define isize_ ISIZE -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define cisize_ cisize -#define isize_ isize -#endif -int cisize_(char *,char*); -int cisize_(char *i1p, char *i2p) { - int isize_val=0; - FILE *f = fopen("conftestval", "w"); - if (!f) return 1; - isize_val = (int)(i2p - i1p); - fprintf(f,"%d\n", isize_val); - fclose(f); - return 0; -} - ]) - dnl Endof ac_lang_source -],[ - # pac_compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - # Save LIBS and prepend object file to LIBS - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - AC_LANG_PUSH([Fortran 77]) - AC_RUN_IFELSE([ - AC_LANG_SOURCE([ - program main - $1 a(2) - integer irc, cisize - irc = cisize(a(1),a(2)) - end - ]) - ],[ - eval PAC_CV_NAME=`cat conftestval` - ],[ - eval PAC_CV_NAME=0 - ],[ - # Use -9999 as value to emit a warning message after the cache_check. - ifelse([$2],[],[eval PAC_CV_NAME=-9999],[eval PAC_CV_NAME=$2]) - ]) - AC_LANG_POP([Fortran 77]) - LIBS="$saved_LIBS" - # remove previously generated object file. - rm -f pac_conftest.$OBJEXT -],[ - AC_MSG_WARN([Unable to compile the C routine for finding the size of a $1]) -]) -AC_LANG_POP([C]) -]) -dnl Endof ac_cache_check -if test "$PAC_CV_NAME" = "-9999" ; then - AC_MSG_WARN([No value provided for size of $1 when cross-compiling]) -fi -AC_DEFINE_UNQUOTED(PAC_TYPE_NAME,$PAC_CV_NAME,[Define size of PAC_TYPE_NAME]) -undefine([PAC_TYPE_NAME]) -undefine([PAC_CV_NAME]) -]) -dnl -dnl/*D -dnl PAC_PROG_F77_EXCLAIM_COMMENTS -dnl -dnl Synopsis: -dnl PAC_PROG_F77_EXCLAIM_COMMENTS([action-if-true],[action-if-false]) -dnl -dnl Notes: -dnl Check whether '!' may be used to begin comments in Fortran. -dnl -dnl This macro requires a version of autoconf `after` 2.13; the 'acgeneral.m4' -dnl file contains an error in the handling of Fortran programs in -dnl 'AC_TRY_COMPILE' (fixed in our local version). -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_F77_EXCLAIM_COMMENTS],[ -AC_CACHE_CHECK([whether Fortran 77 accepts ! for comments], -pac_cv_prog_f77_exclaim_comments,[ -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([],[! This is a comment]) -],[ - pac_cv_prog_f77_exclaim_comments="yes" -],[ - pac_cv_prog_f77_exclaim_comments="no" -]) -AC_LANG_POP([Fortran 77]) -]) -if test "$pac_cv_prog_f77_exclaim_comments" = "yes" ; then - ifelse([$1],[],[:],[$1]) -else - ifelse([$2],[],[:],[$2]) -fi -])dnl -dnl -dnl/*D -dnl PAC_F77_CHECK_COMPILER_OPTION - Check that a F77 compiler option is -dnl accepted without warning messages -dnl -dnl Synopsis: -dnl PAC_F77_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) -dnl -dnl Output Effects: -dnl -dnl If no actions are specified, a working value is added to 'FOPTIONS' -dnl -dnl Notes: -dnl This is now careful to check that the output is different, since -dnl some compilers are noisy. -dnl -dnl We are extra careful to prototype the functions in case compiler options -dnl that complain about poor code are in effect. -dnl -dnl Because this is a long script, we have ensured that you can pass a -dnl variable containing the option name as the first argument. -dnl D*/ -AC_DEFUN([PAC_F77_CHECK_COMPILER_OPTION],[ -AC_MSG_CHECKING([whether Fortran 77 compiler accepts option $1]) -pac_opt="$1" -AC_LANG_PUSH([Fortran 77]) -FFLAGS_orig="$FFLAGS" -FFLAGS_opt="$pac_opt $FFLAGS" -pac_result="unknown" - -AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) -FFLAGS="$FFLAGS_orig" -rm -f pac_test1.log -PAC_LINK_IFELSE_LOG([pac_test1.log], [], [ - FFLAGS="$FFLAGS_opt" - rm -f pac_test2.log - PAC_LINK_IFELSE_LOG([pac_test2.log], [], [ - PAC_RUNLOG_IFELSE([diff -b pac_test1.log pac_test2.log], - [pac_result=yes], [pac_result=no]) - ],[ - pac_result=no - ]) -], [ - pac_result=no -]) -AC_MSG_RESULT([$pac_result]) -dnl Delete the conftest created by AC_LANG_CONFTEST. -rm -f conftest.$ac_ext -# -if test "$pac_result" = "yes" ; then - AC_MSG_CHECKING([whether routines compiled with $pac_opt can be linked with ones compiled without $pac_opt]) - pac_result=unknown - FFLAGS="$FFLAGS_orig" - rm -f pac_test3.log - PAC_COMPILE_IFELSE_LOG([pac_test3.log], [ - AC_LANG_SOURCE([ - subroutine try() - end - ]) - ],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - - FFLAGS="$FFLAGS_opt" - rm -f pac_test4.log - PAC_LINK_IFELSE_LOG([pac_test4.log], [AC_LANG_PROGRAM()], [ - PAC_RUNLOG_IFELSE([diff -b pac_test2.log pac_test4.log], - [pac_result=yes], [pac_result=no]) - ],[ - pac_result=no - ]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT - ],[ - pac_result=no - ]) - AC_MSG_RESULT([$pac_result]) - rm -f pac_test3.log pac_test4.log -fi -rm -f pac_test1.log pac_test2.log - -dnl Restore FFLAGS before 2nd/3rd argument commands are executed, -dnl as 2nd/3rd argument command could be modifying FFLAGS. -FFLAGS="$FFLAGS_orig" -if test "$pac_result" = "yes" ; then - ifelse([$2],[],[FOPTIONS="$FOPTIONS $1"],[$2]) -else - ifelse([$3],[],[:],[$3]) -fi -AC_LANG_POP([Fortran 77]) -]) -dnl -dnl/*D -dnl PAC_PROG_F77_LIBRARY_DIR_FLAG - Determine the flag used to indicate -dnl the directories to find libraries in -dnl -dnl Notes: -dnl Many compilers accept '-Ldir' just like most C compilers. -dnl Unfortunately, some (such as some HPUX Fortran compilers) do not, -dnl and require instead either '-Wl,-L,dir' or something else. This -dnl command attempts to determine what is accepted. The flag is -dnl placed into 'F77_LIBDIR_LEADER'. -dnl -dnl D*/ -dnl -dnl An earlier version of this only tried the arguments without using -dnl a library. This failed when the HP compiler complained about the -dnl arguments, but produced an executable anyway. -AC_DEFUN([PAC_PROG_F77_LIBRARY_DIR_FLAG],[ -AC_CACHE_CHECK([for Fortran 77 flag for library directories], -pac_cv_prog_f77_library_dir_flag,[ -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - subroutine f1conf - end - ]) -],[ - # pac_f77compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - PAC_RUNLOG([test -d conftestdir || mkdir conftestdir]) - PAC_RUNLOG([${AR-ar} ${AR_FLAGS-cr} conftestdir/libf77conftest.a pac_f77conftest.$OBJEXT]) - PAC_RUNLOG([${RANLIB-ranlib} conftestdir/libf77conftest.a]) - # Save original LIBS, prepend previously generated object file to LIBS - saved_LIBS="$LIBS" - LIBS="-lf77conftest $LIBS" - saved_LDFLAGS="$LDFLAGS" - pac_cv_prog_f77_library_dir_flag="none" - for ldir in "-L" "-Wl,-L," ; do - LDFLAGS="${ldir}conftestdir $saved_LDFLAGS" - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ - program main - call f1conf - end - ]) - ],[pac_cv_prog_f77_library_dir_flag="$ldir";break]) - done - LDFLAGS="$saved_LDFLAGS" - LIBS="$saved_LIBS" - rm -rf conftestdir - rm -f pac_f77conftest.$OBJEXT -],[]) -AC_LANG_POP([Fortran 77]) -]) -dnl Endof ac_cache_check -if test "X$pac_cv_prog_f77_library_dir_flag" != "Xnone" ; then - F77_LIBDIR_LEADER="$pac_cv_prog_f77_library_dir_flag" - AC_SUBST(F77_LIBDIR_LEADER) -fi -]) -dnl -dnl/*D -dnl PAC_PROG_F77_HAS_INCDIR - Check whether Fortran accepts -Idir flag -dnl -dnl Syntax: -dnl PAC_PROG_F77_HAS_INCDIR(directory,action-if-true,action-if-false) -dnl -dnl Output Effect: -dnl Sets 'F77_INCDIR' to the flag used to choose the directory. -dnl -dnl Notes: -dnl This refers to the handling of the common Fortran include extension, -dnl not to the use of '#include' with the C preprocessor. -dnl If directory does not exist, it will be created. In that case, the -dnl directory should be a direct descendant of the current directory. -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_F77_HAS_INCDIR],[ -ifelse([$1],[],[checkdir=f77tmpdir],[checkdir=$1;checkdir_is_given=yes]) -AC_CACHE_CHECK([for include directory flag for Fortran], -pac_cv_prog_f77_has_incdir,[ -test -d $checkdir || mkdir $checkdir -dnl PAC_RUNLOG([echo ' call sub()' > $checkdir/conftestf.h]) -echo ' call sub()' > $checkdir/conftestf.h -AC_LANG_PUSH([Fortran 77]) -saved_FFLAGS="$FFLAGS" -pac_cv_prog_f77_has_incdir="none" -# SGI wants -Wf,-I -for idir in "-I" "-Wf,-I" ; do - FFLAGS="${idir} $checkdir $saved_FFLAGS" - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - program main - include 'conftestf.h' - end - ]) - ],[pac_cv_prog_f77_has_incdir="$idir"; break]) -done -FFLAGS="$saved_FFLAGS" -AC_LANG_POP([Fortran 77]) -if test "$checkdir_is_given" = "yes" ; then - rm -f $checkdir/conftestf.h -else - rm -rf $checkdir -fi -]) -dnl Endof ac_cache_check -if test "X$pac_cv_prog_f77_has_incdir" != "Xnone" ; then - F77_INCDIR="$pac_cv_prog_f77_has_incdir" - AC_SUBST(F77_INCDIR) -fi -]) -dnl -dnl/*D -dnl PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS - Check whether the Fortran compiler -dnl allows unused and undefined functions to be listed in an external -dnl statement -dnl -dnl Syntax: -dnl PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS(action-if-true,action-if-false) -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS],[ -AC_CACHE_CHECK([whether Fortran allows unused externals], -pac_cv_prog_f77_allows_unused_externals,[ -AC_LANG_PUSH([Fortran 77]) -AC_LINK_IFELSE([ - AC_LANG_SOURCE([ - program main - external bar - end - ]) -],[ - pac_cv_prog_f77_allows_unused_externals="yes" -],[ - pac_cv_prog_f77_allows_unused_externals="no" -]) -AC_LANG_POP([Fortran 77]) -]) -dnl Endof ac_cache_check -if test "X$pac_cv_prog_f77_allows_unused_externals" = "Xyes" ; then - ifelse([$1],[],[:],[$1]) -else - ifelse([$2],[],[:],[$2]) -fi -]) -dnl PAC_PROG_F77_RUN_PROC_FROM_C( c main program, fortran routine, -dnl [action-if-works], [action-if-fails], -dnl [cross-action] ) -dnl Fortran routine MUST be named ftest unless you include code -dnl to select the appropriate Fortran name. -dnl -AC_DEFUN([PAC_PROG_F77_RUN_PROC_FROM_C],[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([$2]) -],[ - # pac_f77compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - # Save original LIBS, prepend previously generated object file to LIBS - saved_LIBS="$LIBS" - LIBS="pac_f77conftest.$OBJEXT $FLIBS $LIBS" - AC_LANG_PUSH([C]) - AC_RUN_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -#ifdef F77_NAME_UPPER -#define ftest_ FTEST -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define ftest_ ftest -#endif -$1 - ]) - ],[ - ifelse([$3],[],[:],[$3]) - ],[ - ifelse([$4],[],[:],[$4]) - ],[ - ifelse([$5],[],[:],[$5]) - ]) - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - rm -f pac_f77conftest.$OBJEXT -],[ -]) -AC_LANG_POP([Fortran 77]) -]) -dnl PAC_PROG_F77_IN_C_LIBS -dnl -dnl Find the essential libraries that are needed to use the C linker to -dnl create a program that includes a trival Fortran code. -dnl -dnl For example, all pgf90 compiled objects include a reference to the -dnl symbol pgf90_compiled, found in libpgf90 . -dnl -dnl There is an additional problem. To *run* programs, we may need -dnl additional arguments; e.g., if shared libraries are used. Even -dnl with autoconf 2.52, the autoconf macro to find the library arguments -dnl doesn't handle this, either by detecting the use of -rpath or -dnl by trying to *run* a trivial program. It only checks for *linking*. -dnl -dnl -AC_DEFUN([PAC_PROG_F77_IN_C_LIBS],[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_MSG_CHECKING([for which Fortran libraries are needed to link C with Fortran]) -F77_IN_C_LIBS="invalid" -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - subroutine ftest - end - ]) -],[ - # pac_f77compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - # Save original LIBS, prepend previously generated object file to LIBS - saved_LIBS="$LIBS" - LIBS="pac_f77conftest.$OBJEXT $FLIBS $saved_LIBS" - AC_LANG_PUSH([C]) - - # Create conftest for all link tests. - AC_LANG_CONFTEST([ - AC_LANG_PROGRAM([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif - ],[ -#ifdef F77_NAME_UPPER -#define ftest_ FTEST -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define ftest_ ftest -#endif -extern void ftest_(void); -ftest_(); - ]) - ]) - - F77_IN_C_LIBS="" - AC_LINK_IFELSE([],[:],[ - flibdirs=`echo $FLIBS | tr ' ' '\012' | grep '\-L' | tr '\012' ' '` - fliblibs=`echo $FLIBS | tr ' ' '\012' | grep -v '\-L' | tr '\012' ' '` - for flibs in $fliblibs ; do - LIBS="pac_f77conftest.$OBJEXT $flibdirs $flibs $saved_LIBS" - AC_LINK_IFELSE([],[F77_IN_C_LIBS="$flibdirs $flibs"; break]) - done - if test "X$F77_IN_C_LIBS" = "X" ; then - flibscat="" - for flibs in $fliblibs ; do - flibscat="$flibscat $flibs" - LIBS="pac_f77conftest.$OBJEXT $flibdirs $flibscat $saved_LIBS" - AC_LINK_IFELSE([],[F77_IN_C_LIBS="$flibdirs $flibscat";break]) - done - fi - ]) - - # remove conftest created by ac_lang_conftest - rm -f conftest.$ac_ext - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - rm -f pac_f77conftest.$OBJEXT -]) -AC_LANG_POP([Fortran 77]) -if test "X$F77_IN_C_LIBS" = "X" ; then - AC_MSG_RESULT(none) -else - AC_MSG_RESULT($F77_IN_C_LIBS) -fi -]) -dnl -dnl Test to see if we should use C or Fortran to link programs whose -dnl main program is in Fortran. We may find that neither work because -dnl we need special libraries in each case. -dnl -AC_DEFUN([PAC_PROG_F77_LINKER_WITH_C],[ -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_MSG_CHECKING([for linker for Fortran main program]) -dnl Create a C program that uses multiplication and division -dnl in case that requires special libraries -AC_LANG_PUSH([C]) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([],[long long a;]) -],[ - AC_DEFINE(HAVE_LONG_LONG,1,[Define if long long allowed]) -]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ -#ifdef HAVE_LONG_LONG -int f(int a, long long b) { int c; c = a * ( b / 3 ) / (b-1); return c ; } -#else -int f(int a, long b) { int c; c = a * b / (b-1); return c ; } -#endif - ]) -]) -AC_LANG_POP([C]) - -dnl Create a Fortran program for test -AC_LANG_PUSH([Fortran 77]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program main - double precision d - print *, "hi" - end - ]) -]) -AC_LANG_POP([Fortran 77]) - -dnl Initialize flags -pac_linkwithf77=no -pac_linkwithC=no - -dnl Use F77 as a linker to compile a Fortran main and C subprogram. -if test "$pac_linkwithC" != "yes" ; then - AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE([],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $saved_LIBS" - AC_LANG_PUSH([Fortran 77]) - AC_LINK_IFELSE([],[ - AC_MSG_RESULT([Use Fortran to link programs]) - pac_linkwithf77=yes - ]) - AC_LANG_POP([Fortran 77]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT - ]) - AC_LANG_POP([C]) -fi - -dnl Use C as a linker and FLIBS to compile a Fortran main and C subprogram. -if test "$pac_linkwithf77" != "yes" ; then - AC_LANG_PUSH([Fortran 77]) - AC_COMPILE_IFELSE([],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_f77conftest.$OBJEXT $FLIBS $saved_LIBS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([],[ - pac_linkwithC=yes - AC_MSG_RESULT([Use C with FLIBS to link programs]) - F77LINKER="$CC" - F77_LDFLAGS="$F77_LDFLAGS $FLIBS" - ]) - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - rm -f pac_f77conftest.$OBJEXT - ]) - AC_LANG_POP([Fortran 77]) -fi - -AC_LANG_PUSH([Fortran 77]) -rm -f conftest.$ac_ext -AC_LANG_POP([Fortran 77]) - -AC_LANG_PUSH([C]) -rm -f conftest.$ac_ext -AC_LANG_POP([C]) - -if test "$pac_linkwithf77" != "yes" -a "$pac_linkwithC" != "yes" ; then - AC_MSG_ERROR([Could not determine a way to link a Fortran test program!]) -fi -]) -dnl -dnl Check to see if a C program can be linked when using the libraries -dnl needed by C programs -dnl -AC_DEFUN([PAC_PROG_F77_CHECK_FLIBS],[ -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_MSG_CHECKING([whether $CC links with FLIBS found by autoconf]) -AC_LANG_PUSH([C]) -# Create a simple C program for the tests. -AC_LANG_CONFTEST([ - AC_LANG_PROGRAM([],[int a;]) -]) -# Try to link a C program with all of these libraries -saved_LIBS="$LIBS" -LIBS="$FLIBS $saved_LIBS" -AC_LINK_IFELSE([],[ - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for which libraries can be used]) - pac_ldirs="" - pac_libs="" - pac_other="" - for name in $FLIBS ; do - case $name in - -l*) pac_libs="$pac_libs $name" ;; - -L*) pac_ldirs="$pac_ldirs $name" ;; - *) pac_other="$pac_other $name" ;; - esac - done - keep_libs="" - for name in $pac_libs ; do - LIBS="$saved_LIBS $pac_ldirs $pac_other $name" - AC_LINK_IFELSE([],[ - keep_libs="$keep_libs $name" - ]) - done - AC_MSG_RESULT($keep_libs) - FLIBS="$pac_ldirs $pac_other $keep_libs" -]) -LIBS="$saved_LIBS" -rm -f conftest.$ac_ext -AC_LANG_PUSH([C]) -]) -dnl -dnl Test for extra libraries needed when linking C routines that use -dnl stdio with Fortran. This test was created for OSX, which -dnl sometimes requires -lSystemStubs. If another library is needed, -dnl add it to F77_OTHER_LIBS -dnl -AC_DEFUN([PAC_PROG_F77_AND_C_STDIO_LIBS],[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE]) -# To simply the code in the cache_check macro, chose the routine name -# first, in case we need it -confname=conf1_ -case "$pac_cv_prog_f77_name_mangle" in - "lower underscore") confname=conf1_ ;; - "upper stdcall") confname=CONF1 ;; - "upper") confname=CONF1 ;; - "lower doubleunderscore") confname=conf1_ ;; - "lower") confname=conf1 ;; - "mixed underscore") confname=conf1_ ;; - "mixed") confname=conf1 ;; -esac - -AC_CACHE_CHECK([for libraries to link Fortran main with C stdio routines], -pac_cv_prog_f77_and_c_stdio_libs,[ -pac_cv_prog_f77_and_c_stdio_libs=unknown -AC_LANG_PUSH([C]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -int $confname(int a) { - printf( "The answer is %d\n", a ); fflush(stdout); return 0; -} - ]) -],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - AC_LANG_PUSH([Fortran 77]) - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program main - call conf1(0) - end - ]) - ]) - for extralib in "" "-lSystemStubs" ; do - LIBS="pac_conftest.$OBJEXT $saved_LIBS $extralib" - AC_LINK_IFELSE([],[ - pac_cv_prog_f77_and_c_stdio_libs="$extralib"; break - ]) - done - if test "X$pac_cv_prog_f77_and_c_stdio_libs" = "X" ; then - pac_cv_prog_f77_and_c_stdio_libs=none - fi - rm -f conftest.$ac_ext - AC_LANG_POP([Fortran 77]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT -]) -AC_LANG_POP([C]) -]) -dnl Endof ac_cache_check -if test "$pac_cv_prog_f77_and_c_stdio_libs" != "none" \ - -a "$pac_cv_prog_f77_and_c_stdio_libs" != "unknown" ; then - F77_OTHER_LIBS="$F77_OTHER_LIBS $pac_cv_prog_f77_and_c_stdio_libs" -fi -]) -dnl -dnl Check that the FLIBS determined by AC_F77_LIBRARY_LDFLAGS is valid. -dnl That macro (at least as of autoconf 2.59) attempted to parse the output -dnl of the compiler when asked to be verbose; in the case of the Fujitsu -dnl frt Fortran compiler, it included files that frt looked for and then -dnl discarded because they did not exist. -dnl -AC_DEFUN([PAC_PROG_F77_FLIBS_VALID],[ -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_MSG_CHECKING([whether $F77 accepts the FLIBS found by autoconf]) -pac_cv_f77_flibs_valid=unknown -AC_LANG_PUSH([Fortran 77]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program main - end - ]) -]) -AC_LINK_IFELSE([],[ - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for valid entries in FLIBS]) - goodFLIBS="" - saveFLIBS=$FLIBS - FLIBS="" - for arg in $saveFLIBS ; do - FLIBS="$goodFLIBS $arg" - AC_LINK_IFELSE([],[goodFLIBS=$FLIBS]) - done - FLIBS=$goodFLIBS - AC_MSG_RESULT($FLIBS) -]) -rm -f conftest.$ac_ext -AC_LANG_POP([Fortran 77]) -]) -dnl -dnl Check if the Fortran 77 and C objects are compatible in linking. -dnl e.g. On some intel x86_64 Mac, Fortran compiler's default binary format -dnl is different from C, so either -m64 or -m32 is needed in either CFLAGS -dnl or FFLAGS. -dnl -AC_DEFUN([PAC_PROG_F77_OBJ_LINKS_WITH_C],[ -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -AC_MSG_CHECKING([whether Fortran 77 and C objects are compatible]) -AC_LANG_PUSH([C]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ -/* lower */ -void c_subpgm( int *rc ); -void c_subpgm( int *rc ) { *rc = 1; } - -/* lower underscore */ -void c_subpgm_( int *rc ); -void c_subpgm_( int *rc ) { *rc = 2; } - -/* upper */ -void C_SUBPGM( int *rc ); -void C_SUBPGM( int *rc ) { *rc = 3; } - -/* lower doubleunderscore */ -void c_subpgm__( int *rc ); -void c_subpgm__( int *rc ) { *rc = 4; } - -/* mixed */ -void C_subpgm( int *rc ); -void C_subpgm( int *rc ) { *rc = 5; } - -/* mixed underscore */ -void C_subpgm_( int *rc ); -void C_subpgm_( int *rc ) { *rc = 6; } - ]) -]) -AC_LANG_POP([C]) - -AC_LANG_PUSH([Fortran 77]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program test - integer rc - rc = -1 - call c_subpgm( rc ) - write(6,*) "rc=", rc - end - ]) -]) -AC_LANG_POP([Fortran 77]) - -dnl Initialize flags -pac_linkwithf77=no -pac_linkwithC=no - -dnl Use F77 as a linker to compile a Fortran main and C subprogram. -if test "$pac_linkwithC" != "yes" ; then - AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE([],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $saved_LIBS" - AC_LANG_PUSH([Fortran 77]) - AC_LINK_IFELSE([],[ - pac_linkwithf77=yes - AC_MSG_RESULT([yes]) - ]) - AC_LANG_POP([Fortran 77]) - LIBS="$saved_LIBS" - if test "$pac_linkwithf77" = "yes" ; then - rm -f pac_conftest.$OBJEXT - fi - ]) - AC_LANG_POP([C]) -fi - -dnl Use C as a linker and FLIBS to compile a Fortran main and C subprogram. -if test "$pac_linkwithf77" != "yes" ; then - AC_LANG_PUSH([Fortran 77]) - AC_COMPILE_IFELSE([],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_f77conftest.$OBJEXT $FLIBS $saved_LIBS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([],[ - pac_linkwithC=yes - AC_MSG_RESULT([yes]) - ]) - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - if test "$pac_linkwithC" = "yes" ; then - rm -f pac_f77conftest.$OBJEXT - fi - ]) - AC_LANG_POP([Fortran 77]) -fi - -AC_LANG_PUSH([Fortran 77]) -rm -f conftest.$ac_ext -AC_LANG_POP([Fortran 77]) - -AC_LANG_PUSH([C]) -rm -f conftest.$ac_ext -AC_LANG_POP([C]) - -if test "$pac_linkwithf77" != "yes" -a "$pac_linkwithC" != "yes" ; then - AC_MSG_RESULT(no) - AC_CHECK_PROG(FILE, file, file, []) - if test "X$FILE" != "X" ; then - fobjtype="`${FILE} pac_f77conftest.$OBJEXT | sed -e \"s|pac_f77conftest\.$OBJEXT||g\"`" - cobjtype="`${FILE} pac_conftest.$OBJEXT | sed -e \"s|pac_conftest\.$OBJEXT||g\"`" - if test "$fobjtype" != "$cobjtype" ; then - AC_MSG_ERROR([**** Incompatible Fortran and C Object File Types! **** -F77 Object File Type produced by \"${F77} ${FFLAGS}\" is : ${fobjtype}. - C Object File Type produced by \"${CC} ${CFLAGS}\" is : ${cobjtype}.]) - fi - fi -fi -]) -dnl -dnl /*D -dnl PAC_F77_WORKS_WITH_CPP -dnl -dnl Checks if Fortran 77 compiler works with C preprocessor -dnl -dnl Most systems allow the Fortran compiler to process .F and .F90 files -dnl using the C preprocessor. However, some systems either do not -dnl allow this or have serious bugs (OSF Fortran compilers have a bug -dnl that generates an error message from cpp). The following test -dnl checks to see if .F works, and if not, whether "cpp -P -C" can be used -dnl D*/ -AC_DEFUN([PAC_F77_WORKS_WITH_CPP],[ -AC_REQUIRE([AC_PROG_CPP]) -AC_MSG_CHECKING([whether Fortran 77 compiler processes .F files with C preprocessor]) -AC_LANG_PUSH([Fortran 77]) -saved_f77_ext=${ac_ext} -ac_ext="F" -saved_FFLAGS="$FFLAGS" -FFLAGS="$FFLAGS $CPPFLAGS" -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program main -#define ASIZE 10 - integer a(ASIZE) - end - ]) -]) -AC_COMPILE_IFELSE([],[ - pac_cv_f77_accepts_F=yes - ifelse([$1],[],[],[$1=""]) -],[ - pac_cv_f77_accepts_F=no - ifelse([$1],[],[:],[$1="false"]) -]) -# Restore Fortran 77's ac_ext but not FFLAGS -ac_ext="$saved_f77_ext" - -if test "$pac_cv_f77_accepts_F" != "yes" ; then - pac_cpp_f77="$ac_cpp -C -P conftest.F > conftest.$ac_ext" - PAC_RUNLOG_IFELSE([$pac_cpp_f77],[ - if test -s conftest.${ac_ext} ; then - AC_COMPILE_IFELSE([],[ - pac_cv_f77_accepts_F="no, use cpp" - ifelse([$1],[],[],[$1="$CPP -C -P"]) - ],[]) - rm -f conftest.${ac_ext} - fi - ],[]) -fi -FFLAGS="$saved_FFLAGS" -rm -f conftest.F -AC_LANG_POP([Fortran 77]) -AC_MSG_RESULT([$pac_cv_f77_accepts_F]) -]) -dnl -dnl /*D -dnl PAC_PROG_F77_CRAY_POINTER - Check if Fortran 77 supports Cray-style pointer. -dnl If so, set pac_cv_prog_f77_has_pointer to yes -dnl and find out if any extra compiler flag is -dnl needed and set it as CRAYPTR_FFLAGS. -dnl i.e. CRAYPTR_FFLAGS is meaningful only if -dnl pac_cv_prog_f77_has_pointer = yes. -dnl -dnl Synopsis: -dnl PAC_PROG_F77_CRAY_POINTER([action-if-true],[action-if-false]) -dnl D*/ -AC_DEFUN([PAC_PROG_F77_CRAY_POINTER],[ -AC_CACHE_CHECK([whether Fortran 77 supports Cray-style pointer], -pac_cv_prog_f77_has_pointer,[ -AC_LANG_PUSH([Fortran 77]) -AC_LANG_CONFTEST([ - AC_LANG_PROGRAM([],[ - integer M - pointer (MPTR,M) - data MPTR/0/ - ]) -]) -saved_FFLAGS="$FFLAGS" -pac_cv_prog_f77_has_pointer=no -CRAYPTR_FFLAGS="" -for ptrflag in '' '-fcray-pointer' ; do - FFLAGS="$saved_FFLAGS $ptrflag" - AC_COMPILE_IFELSE([], [ - pac_cv_prog_f77_has_pointer=yes - CRAYPTR_FFLAGS="$ptrflag" - break - ]) -done -dnl Restore FFLAGS first, since user may not want to modify FFLAGS -FFLAGS="$saved_FFLAGS" -dnl remove conftest after ac_lang_conftest -rm -f conftest.$ac_ext -AC_LANG_POP([Fortran 77]) -]) -if test "$pac_cv_prog_f77_has_pointer" = "yes" ; then - AC_MSG_CHECKING([for Fortran 77 compiler flag for Cray-style pointer]) - if test "X$CRAYPTR_FFLAGS" != "X" ; then - AC_MSG_RESULT([$CRAYPTR_FFLAGS]) - else - AC_MSG_RESULT([none]) - fi - ifelse([$1],[],[:],[$1]) -else - ifelse([$2],[],[:],[$2]) -fi -]) -dnl -dnl -dnl PAC_F77_INIT_WORKS_WITH_C -dnl -AC_DEFUN([PAC_F77_INIT_WORKS_WITH_C],[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_MSG_CHECKING([whether Fortran init will work with C]) -pac_f_init_works_with_c=unknown -AC_LANG_PUSH([Fortran 77]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - subroutine minit() - common /m1/ vc, vc2 - character*1 vc(1,1), vc2(1) - common /m2/ vd - integer vd - save /m1/, /m2/ - call minitc( vc, vc2, vd ) - end - ]) -],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - saved_LIBS="$LIBS" - # This test checks if Fortran init can be done in pure C environment, - # i.e. no FLIBS in linking, so don't put FLIBS in LIBS below - dnl LIBS="pac_f77conftest.$OBJEXT $FLIBS $LIBS" - LIBS="pac_f77conftest.$OBJEXT $LIBS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -#ifdef F77_NAME_UPPER -#define minit_ MINIT -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define minit_ minit -#endif -extern void minit_(void); -int main( int argc, char **argv ) -{ - minit_(); - return 0; -} -char *v1 = 0; -char *vc2 = 0; -int v2 = 0; -void minitc_( char *dv1, int d, char *dv2, int d2, int dv3 ); -void minitc_( char *dv1, int d, char *dv2, int d2, int dv3 ) -{ -v1 = dv1; -v2 = dv3; -vc2 = dv2; -*vc2 = ' '; -} - ]) - ],[pac_f_init_works_with_c=yes],[pac_f_init_works_with_c=no]) - AC_LANG_POP([C]) - LIBS="$saved_LIBS" - rm -f pac_f77conftest.$OBJEXT -]) -AC_LANG_POP([Fortran 77]) -AC_MSG_RESULT([$pac_f_init_works_with_c]) -]) -dnl -dnl PAC_F77_LOGICALS_IN_C(MPI_FINT) -dnl -dnl where MPI_FINT is the C type for Fortran integer. -dnl -dnl Use a Fortran main program. This simplifies some steps, -dnl since getting all of the Fortran libraries (including shared -dnl libraries that are not in the default library search path) can -dnl be tricky. Specifically, The PROG_F77_RUN_PROC_FROM_C failed with -dnl some installations of the Portland group compiler. -dnl -dnl We'd also like to check other values for .TRUE. and .FALSE. to see -dnl if the compiler allows (or uses) more than one value (some DEC compilers, -dnl for example, used the high (sign) bit to indicate true and false; the -dnl rest of the bits were ignored. For now, we'll assume that there are -dnl unique true and false values. -dnl -AC_DEFUN([PAC_F77_LOGICALS_IN_C],[ -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE]) -pac_mpi_fint="$1" -AC_MSG_CHECKING([for values of Fortran logicals]) -AC_CACHE_VAL(pac_cv_prog_f77_true_false_value,[ -pac_cv_prog_f77_true_false_value="" -AC_LANG_PUSH([C]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -#if defined(HAVE_STDLIB_H) || defined(STDC_HEADERS) -#include -#endif -#ifdef F77_NAME_UPPER -#define ftest_ FTEST -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define ftest_ ftest -#endif -void ftest_( $pac_mpi_fint *, $pac_mpi_fint *); -void ftest_( $pac_mpi_fint *itrue, $pac_mpi_fint *ifalse ) -{ - FILE *f = fopen("conftestval","w"); - if (!f) exit(1); - fprintf( f, "%d %d\n", *itrue, *ifalse ); - fclose(f); -} - ]) -],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $saved_LIBS" - AC_LANG_PUSH([Fortran 77]) - AC_RUN_IFELSE([ - AC_LANG_SOURCE([ - program main - logical itrue, ifalse - itrue = .TRUE. - ifalse = .FALSE. - call ftest( itrue, ifalse ) - end - ]) - ],[ - pac_cv_prog_f77_true_false_value="`cat conftestval`" - ],[ - AC_MSG_WARN([Failed to build/run program to determine Fortran logical values.]) - ],[ - # Cross-Compiling. Allow the user to set the values - if test -n "$CROSS_F77_TRUE_VALUE" -a -n "$CROSS_F77_FALSE_VALUE" ; then - pac_cv_prog_f77_true_false_value="$CROSS_F77_TRUE_VALUE $CROSS_F77_FALSE_VALUE" - else - AC_MSG_WARN([Either CROSS_F77_TRUE_VALUE="$CROSS_F77_TRUE_VALUE" or CROSS_F77_FALSE_VALUE="$CROSS_F77_FALSE_VALUE" is not set.]) - fi - ]) - AC_LANG_POP([Fortran 77]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT -]) -AC_LANG_POP([C]) -]) -dnl Endof ac_cache_val -if test "X$pac_cv_prog_f77_true_false_value" != "X" ; then - true_val="`echo $pac_cv_prog_f77_true_false_value | sed -e 's/ .*//g'`" - false_val="`echo $pac_cv_prog_f77_true_false_value | sed -e 's/.* *//g'`" - if test -n "$true_val" -a -n "$false_val" ; then - AC_MSG_RESULT([True is $true_val and False is $false_val]) - else - AC_MSG_RESULT([could not determine]) - fi -fi -if test -n "$true_val" -a -n "$false_val" ; then - AC_DEFINE(F77_TRUE_VALUE_SET,1,[Define if we know the value of Fortran true and false]) - AC_DEFINE_UNQUOTED(F77_TRUE_VALUE,$true_val,[The value of true in Fortran]) - AC_DEFINE_UNQUOTED(F77_FALSE_VALUE,$false_val,[The value of false in Fortran]) -fi -]) -dnl/*D -dnl PAC_PROG_F77_MISMATCHED_ARGS([option],[AllOnly]) - Determine whether the -dnl Fortran compiler allows routines to be called with different -dnl argument types. If not, attempts to determine a command-line argument -dnl that permits such use -dnl (The Fortran standard prohibits this usage) -dnl -dnl option is set to the compiler option to use. -dnl if AllOnly is yes (literal, not variable with value), then only consider -dnl options that turn off checking -dnl for all routines -dnl -dnl The NAG Fortran compiler, nagfor, is known to enforce this part of the -dnl Fortran standard. -dnl D*/ -AC_DEFUN([PAC_PROG_F77_MISMATCHED_ARGS],[ -AC_MSG_CHECKING([whether $F77 allows mismatched arguments]) -if test "X$pac_cv_prog_f77_mismatched_args" = X ; then - pac_cv_prog_f77_mismatched_args_parm="" - pac_cv_prog_f77_mismatched_args=no - AC_LANG_PUSH([Fortran 77]) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - program main - integer a - real b - character c - call foo1(a) - call foo1(b) - call foo1(c) - end -])],[pac_cv_prog_f77_mismatched_args=yes]) - if test "$pac_cv_prog_f77_mismatched_args" != "yes" ; then - # try again with -wmismatch=foo1 - save_FFLAGS="$FFLAGS" - # The best solution is to turn off errors on particular routines - # if that isn't possible (e.g., too many of them), then - # just try arguments that turn off all checking - for flags in ifelse($2,yes,,"-wmismatch=foo1") "-mismatch" ; do - testok=no - FFLAGS="$FFLAGS $flags" - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - program main - integer a - real b - character c - call foo1(a) - call foo1(b) - call foo1(c) - end -])],[testok=yes]) - FFLAGS="$save_FFLAGS" - if test "$testok" = yes ; then break ; fi - done - if test "$testok" = yes ; then - pac_cv_prog_f77_mismatched_args_parm="$flags" - pac_cv_prog_f77_mismatched_args="yes, with $pac_cv_prog_f77_mismatched_args_parm" - fi - fi - AC_LANG_POP([Fortran 77]) -fi -AC_MSG_RESULT($pac_cv_prog_f77_mismatched_args) -if test "$pac_cv_prog_f77_mismatched_args" = no ; then - AC_MSG_ERROR([The Fortran compiler $F77 will not compile files that call -the same routine with arguments of different types.]) -fi - -ifelse($1,,,[$1=$pac_cv_prog_f77_mismatched_args_parm]) -]) diff --git a/3rd-party/romio321/confdb/aclocal_f77old.m4 b/3rd-party/romio321/confdb/aclocal_f77old.m4 deleted file mode 100644 index 5d6e2d9e70a..00000000000 --- a/3rd-party/romio321/confdb/aclocal_f77old.m4 +++ /dev/null @@ -1,389 +0,0 @@ -dnl/*D -dnl PAC_PROG_F77_CMDARGS - Determine how to access the command line from -dnl Fortran 77 -dnl -dnl Output Effects: -dnl The following variables are set: -dnl.vb -dnl F77_GETARG - Statement to get an argument i into string s -dnl F77_IARGC - Routine to return the number of arguments -dnl FXX_MODULE - Module command when using Fortran 90 compiler -dnl F77_GETARGDECL - Declaration of routine used for F77_GETARG -dnl F77_GETARG_FFLAGS - Flags needed when compiling/linking -dnl F77_GETARG_LDFLAGS - Flags needed when linking -dnl.ve -dnl If 'F77_GETARG' has a value, then that value and the values for these -dnl other symbols will be used instead. If no approach is found, all of these -dnl variables will have empty values. -dnl If no other approach works and a file 'f77argdef' is in the directory, -dnl that file will be sourced for the values of the above four variables. -dnl -dnl In most cases, you should add F77_GETARG_FFLAGS to the FFLAGS variable -dnl and F77_GETARG_LDFLAGS to the LDFLAGS variable, to ensure that tests are -dnl performed on the compiler version that will be used. -dnl -dnl 'AC_SUBST' is called for all six variables. -dnl -dnl One complication is that on systems with multiple Fortran compilers, -dnl some libraries used by one Fortran compiler may have been (mis)placed -dnl in a common location. We have had trouble with libg2c in particular. -dnl To work around this, we test whether iargc etc. work first. This -dnl will catch most systems and will speed up the tests. -dnl -dnl Next, the libraries are only added if they are needed to complete a -dnl link; they aren''t added just because they exist. -dnl -dnl f77argdef -dnl D*/ -dnl -dnl Random notes -dnl You can export the command line arguments from C to the g77 compiler -dnl using -dnl extern char **__libc_argv; -dnl extern int __libc_argc; -dnl f_setarg( __libc_argc, __libc_argv ); -dnl -AC_DEFUN([PAC_PROG_F77_CMDARGS],[ -found_cached="yes" -AC_MSG_CHECKING([for routines to access the command line from Fortran 77]) -AC_CACHE_VAL(pac_cv_prog_f77_cmdarg, -[ - AC_MSG_RESULT([searching...]) - found_cached="no" - # First, we perform a quick check. Does iargc and getarg work? - fxx_module="${FXX_MODULE:-}" - f77_getargdecl="${F77_GETARGDECL:-external getarg}" - f77_getarg="${F77_GETARG:-call GETARG(i,s)}" - f77_iargc="${F77_IARGC:-IARGC()}" - # - # Grumble. The Absoft Fortran compiler computes i - i as 0 and then - # 1.0 / 0 at compile time, even though the code may never be executed. - # What we need is a way to generate an error, so the second usage of i - # was replaced with f77_iargc. - cat > conftest.f </dev/null 2>&1 ; then - found_answer="yes" - FXX_MODULE="$fxx_module" - F77_GETARGDECL="$f77_getargdecl" - F77_GETARG="$f77_getarg" - F77_IARGC="$f77_iargc" - AC_MSG_RESULT(yes) - fi - fi - fi - if test $found_answer = "no" ; then - AC_MSG_RESULT(no) - # Grumph. Here are a bunch of different approaches - # We have several axes the check: - # Library to link with (none, -lU77 (HPUX), -lg2c (LINUX f77)) - # PEPCF90 (Intel ifc) - # The first line is a dummy - # (we experimented with using a , but this caused other - # problems because we need in the IFS) - trial_LIBS="0 -lU77 -lPEPCF90" - if test "$NOG2C" != "1" ; then - trial_LIBS="$trial_LIBS -lg2c" - fi - # Discard libs that are not availble: - save_IFS="$IFS" - # Make sure that IFS includes a space, or the tests that run programs - # may fail - IFS=" "" -" - save_trial_LIBS="$trial_LIBS" - trial_LIBS="" - cat > conftest.f <, the space is important - # To make the Absoft f77 and f90 work together, we need to prefer the - # upper case versions of the arguments. They also require libU77. - # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based) - # Fortran compilers - # - # Problem: The Intel efc compiler hangs when presented with -N109 . - # The only real fix for this is to detect this compiler and exclude - # the test. We may want to reorganize these tests so that if we - # can compile code without special options, we never look for them. - # - using_intel_efc="no" - pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'` - if test "$pac_test_msg" != "" ; then - using_intel_efc="yes" - fi - if test "$using_intel_efc" = "yes" ; then - trial_FLAGS="000" - else - trial_FLAGS="000 --N109 --f --YEXT_NAMES=UCS --YEXT_NAMES=LCS --YCFRL=1 -+U77" - fi - # Discard options that are not available: - # (IFS already saved above) - IFS=" "" -" - save_trial_FLAGS="$trial_FLAGS" - trial_FLAGS="" - for flag in $save_trial_FLAGS ; do - if test "$flag" = " " -o "$flag" = "000" ; then - opt_ok="yes" - else - PAC_F77_CHECK_COMPILER_OPTION($flag,opt_ok=yes,opt_ok=no) - fi - if test "$opt_ok" = "yes" ; then - if test "$flag" = " " -o "$flag" = "000" ; then - fflag="" - else - fflag="$flag" - fi - # discard options that don't allow mixed-case name matching - cat > conftest.f < conftest.f </dev/null 2>&1 ; then - found_answer="yes" - fi - else - found_answer="yes" - fi - fi - IFS=" "" -" - if test "$found_answer" = "yes" ; then - AC_MSG_RESULT([yes]) - pac_cv_prog_f77_cmdarg="$MSG" - pac_cv_prog_f77_cmdarg_fflags="$flags" - pac_cv_prog_f77_cmdarg_ldflags="$libs" - break - else - AC_MSG_RESULT([no]) - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.f >&AC_FD_CC - fi - done - done - IFS="$save_IFS" - rm -f conftest.* - trial=`expr $trial + 1` - done -fi -pac_cv_F77_GETARGDECL="$F77_GETARGDECL" -pac_cv_F77_IARGC="$F77_IARGC" -pac_cv_F77_GETARG="$F77_GETARG" -pac_cv_FXX_MODULE="$FXX_MODULE" -]) -if test "$found_cached" = "yes" ; then - AC_MSG_RESULT([$pac_cv_prog_f77_cmdarg]) -elif test -z "$pac_cv_F77_IARGC" ; then - AC_MSG_WARN([Could not find a way to access the command line from Fortran 77]) -fi -# Set the variable values based on pac_cv_prog_xxx -F77_GETARGDECL="$pac_cv_F77_GETARGDECL" -F77_IARGC="$pac_cv_F77_IARGC" -F77_GETARG="$pac_cv_F77_GETARG" -FXX_MODULE="$pac_cv_FXX_MODULE" -F77_GETARG_FFLAGS="$pac_cv_prog_f77_cmdarg_fflags" -F77_GETARG_LDFLAGS="$pac_cv_prog_f77_cmdarg_ldflags" -AC_SUBST(F77_GETARGDECL) -AC_SUBST(F77_IARGC) -AC_SUBST(F77_GETARG) -AC_SUBST(FXX_MODULE) -AC_SUBST(F77_GETARG_FFLAGS) -AC_SUBST(F77_GETARG_LDFLAGS) -]) diff --git a/3rd-party/romio321/confdb/aclocal_fc.m4 b/3rd-party/romio321/confdb/aclocal_fc.m4 deleted file mode 100644 index c5e2d1fb0fb..00000000000 --- a/3rd-party/romio321/confdb/aclocal_fc.m4 +++ /dev/null @@ -1,1235 +0,0 @@ -dnl PAC_FC_SEARCH_LIST - expands to a whitespace separated list of modern -dnl fortran compilers for use with AC_PROG_FC that is more suitable for HPC -dnl software packages -AC_DEFUN([PAC_FC_SEARCH_LIST], - [ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 gfortran f90 epcf90 f95 fort lf95 g95 ifc efc gfc]) -dnl /*D -dnl PAC_PROG_FC([COMPILERS]) -dnl -dnl COMPILERS is a space separated list of Fortran 77 compilers to search -dnl for. Fortran 95 isn't strictly backwards-compatible with Fortran 77, -dnl but `f95' is worth trying. -dnl -dnl Compilers are ordered by -dnl 1. F77, F90, F95 -dnl 2. Good/tested native compilers, bad/untested native compilers -dnl 3. Wrappers around f2c go last. -dnl -dnl `fort77' is a wrapper around `f2c'. -dnl It is believed that under HP-UX `fort77' is the name of the native -dnl compiler. On some Cray systems, fort77 is a native compiler. -dnl frt is the Fujitsu F77 compiler. -dnl pgf77 and pgf90 are the Portland Group F77 and F90 compilers. -dnl xlf/xlf90/xlf95/xlf2003 are IBM (AIX) F77/F90/F95/F2003 compilers. -dnl lf95 is the Lahey-Fujitsu compiler. -dnl fl32 is the Microsoft Fortran "PowerStation" compiler. -dnl af77 is the Apogee F77 compiler for Intergraph hardware running CLIX. -dnl epcf90 is the "Edinburgh Portable Compiler" F90. -dnl fort is the Compaq Fortran 90 (now 95) compiler for Tru64 and Linux/Alpha. -dnl pathf90 is the Pathscale Fortran 90 compiler -dnl ifort is another name for the Intel f90 compiler -dnl efc - An older Intel compiler (?) -dnl ifc - An older Intel compiler -dnl fc - A compiler on some unknown system. This has been removed because -dnl it may also be the name of a command for something other than -dnl the Fortran compiler (e.g., fc=file system check!) -dnl gfortran - The GNU Fortran compiler (not the same as g95) -dnl gfc - An alias for gfortran recommended in cygwin installations -dnl NOTE: this macro suffers from a basically intractable "expanded before it -dnl was required" problem when libtool is also used -dnl D*/ -AC_DEFUN([PAC_PROG_FC],[ -PAC_PUSH_FLAG([FCFLAGS]) -AC_PROG_FC([m4_default([$1],[PAC_FC_SEARCH_LIST])]) -PAC_POP_FLAG([FCFLAGS]) -]) -dnl -dnl PAC_FC_EXT checks for the default Fortran 90 program extension, f90 then f. -dnl This could be replaced by AC_FC_SRCEXT but since AC_FC_SRCEXT -dnl adds FCFLAGS_ext, which is used to modify FCFLAGS or Makefile.in. -dnl So will do this later. -dnl -AC_DEFUN([PAC_FC_EXT],[ -AC_MSG_CHECKING([for extension for Fortran 90 programs]) -ac_fc_srcext="f90" -AC_LANG_PUSH(Fortran) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM() -],[ - AC_MSG_RESULT([f90]) -],[ - ac_fc_srcext="f" - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM() - ],[ - AC_MSG_RESULT([f]) - ],[ - AC_MSG_RESULT([unknown!]) - ]) -]) -AC_LANG_POP(Fortran) -]) -dnl -dnl Internal routine for testing F90 -dnl PAC_PROG_FC_WORKS() -dnl -AC_DEFUN([PAC_PROG_FC_WORKS],[ -AC_REQUIRE([PAC_FC_EXT]) -AC_LANG_PUSH(Fortran) -AC_MSG_CHECKING([whether the Fortran 90 compiler ($FC $FCFLAGS $LDFLAGS) works]) -AC_LINK_IFELSE([ - AC_LANG_SOURCE([ - program conftest - integer, dimension(10) :: n - end - ]) -],[ - pac_cv_prog_fc_works="yes" - AC_MSG_RESULT([$pac_cv_prog_fc_works]) - AC_MSG_CHECKING([whether the Fortran 90 compiler ($FC $FCFLAGS $LDFLAGS) is a cross-compiler]) - AC_RUN_IFELSE([], - [pac_cv_prog_fc_cross="no"], - [pac_cv_prog_fc_cross="yes"], - [pac_cv_prog_fc_cross="$cross_compiling"] - ) - AC_MSG_RESULT($pac_cv_prog_fc_cross) -],[ - pac_cv_prog_fc_works="no" - AC_MSG_WARN([installation or configuration problem: Fortran 90 compiler cannot create executables.]) -]) -# The intel compiler sometimes generates these work.pc and .pcl files -rm -f work.pc work.pcl -AC_LANG_POP(Fortran) -dnl cross_compiling no longer maintained by autoconf as part of the -dnl AC_LANG changes. If we set it here, a later AC_LANG may not -dnl restore it (in the case where one compiler claims to be a cross compiler -dnl and another does not) -dnl cross_compiling=$pac_cv_prog_f90_cross -]) -dnl/*D -dnl PAC_PROG_FC_INT_KIND - Determine kind parameter for an integer with -dnl the specified number of bytes. -dnl -dnl Synopsis: -dnl PAC_PROG_FC_INT_KIND(variable-to-set,number-of-bytes,[cross-size]) -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_FC_INT_KIND],[ -# Set the default -$1=-1 -if test "$pac_cv_prog_fc_cross" = "yes" ; then - AS_IF([test -z "$3"],[AC_MSG_ERROR(['$3' is empty])]) - $1="$3" -else - AC_LANG_PUSH(Fortran) - AC_MSG_CHECKING([for Fortran 90 integer kind for $2-byte integers]) - # Convert bytes to digits - case $2 in - 1) sellen=2 ;; - 2) sellen=4 ;; - 4) sellen=8 ;; - 8) sellen=16 ;; - 16) sellen=30 ;; - *) sellen=8 ;; - esac - # Check for cached value - eval testval=\$"pac_cv_prog_fc_int_kind_$sellen" - if test -n "$testval" ; then - AC_MSG_RESULT([$testval (cached)]) - $1=$testval - else - KINDVAL="unavailable" - eval "pac_cv_prog_fc_int_kind_$sellen"=-1 - AC_RUN_IFELSE([ - AC_LANG_SOURCE([ - program main - integer ii - ii = selected_int_kind($sellen) - open(8, file="conftest1.out", form="formatted") - write (8,*) ii - close(8) - stop - end - ]) - ],[pac_run_ok=yes],[pac_run_ok=no]) - if test "$pac_run_ok" = "yes" ; then - if test -s conftest1.out ; then - # Because of write, there may be a leading blank. - KINDVAL=`cat conftest1.out | sed 's/ //g'` - eval "pac_cv_prog_fc_int_kind_$sellen"=$KINDVAL - $1=$KINDVAL - fi - fi - AC_MSG_RESULT([$KINDVAL]) - fi # not cached - AC_LANG_POP(Fortran) -fi # is not cross compiling -])dnl -dnl -dnl ------------------------------------------------------------------------ -dnl Special characteristics that have no autoconf counterpart but that -dnl we need as part of the Fortran 90 support. To distinquish these, they -dnl have a [PAC] prefix. -dnl -dnl At least one version of the Cray compiler needs the option -em to -dnl generate a separate module file, rather than including the module -dnl information in the object (.o) file. -dnl -dnl -dnl PAC_FC_MODULE_EXT(action if found,action if not found) -dnl -AC_DEFUN([PAC_FC_MODULE_EXT], -[AC_CACHE_CHECK([for Fortran 90 module extension], -pac_cv_fc_module_ext,[ -pac_cv_fc_module_case="unknown" -AC_LANG_PUSH(Fortran) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - module conftest - integer n - parameter (n=1) - end module conftest - ]) -],[ - # Look for module name - # First, try to find known names. This avoids confusion caused by - # additional files (like .stb created by some versions of pgf90) - # Early versions of the Intel compiler used d as the module extension; - # we include that just to finish the test as early as possible. - for name in conftest CONFTEST ; do - for ext in mod MOD d ; do - if test -s $name.$ext ; then - if test $name = conftest ; then - pac_cv_fc_module_case=lower - else - pac_cv_fc_module_case=upper - fi - pac_cv_fc_module_ext=$ext - pac_MOD=$ext - break - fi - done - if test -n "$pac_cv_fc_module_ext" ; then break ; fi - done - if test -z "$pac_MOD" ; then - # The test on .err is needed for Cray Fortran. - pac_MOD=`ls conftest.* 2>&1 | grep -v conftest.${ac_fc_srcext} | grep -v conftest.o | grep -v conftest.err` - pac_MOD=`echo $pac_MOD | sed -e 's/conftest\.//g'` - pac_cv_fc_module_case="lower" - if test "X$pac_MOD" = "X" ; then - pac_MOD=`ls CONFTEST* 2>&1 | grep -v CONFTEST.${ac_fc_srcext} | grep -v CONFTEST.o | grep -v CONFTEST.err` - pac_MOD=`echo $pac_MOD | sed -e 's/CONFTEST\.//g'` - if test -n "$pac_MOD" -a -s "CONFTEST.$pac_MOD" ; then - pac_cv_fc_module_case="upper" - else - # Clear because we must have gotten an error message - pac_MOD="" - fi - fi - if test -z "$pac_MOD" ; then - pac_cv_fc_module_ext="unknown" - else - pac_cv_fc_module_ext=$pac_MOD - fi - fi -],[ - pac_cv_fc_module_ext="unknown" -]) - -if test "$pac_cv_fc_module_ext" = "unknown" ; then - # Try again, but with an -em option. Abbreviated, because we're - # just looking for the Cray option - saveFCFLAGS=$FCFLAGS - FCFLAGS="$FCFLAGS -em" - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - module conftest - integer n - parameter (n=1) - end module conftest - ]) -],[ - if test -s conftest.mod ; then - pac_cv_fc_module_ext="mod" - pac_cv_fc_module_case="lower" - elif test -s CONFTEST.mod ; then - pac_cv_fc_module_ext="mod" - pac_cv_fc_module_case="upper" - fi -],[ - : - # do nothing - already have the unknown default value -]) - if test "$pac_cv_fc_module_ext" = "unknown" ; then - # The additional command line option did not help - restore - # the original flags. - FCFLAGS=$saveFCFLAGS - fi -fi -AC_LANG_POP(Fortran) -]) -# -AC_SUBST(FCMODEXT) -if test "$pac_cv_fc_module_ext" = "unknown" ; then - ifelse($2,,:,[$2]) -else - ifelse($1,,FCMODEXT=$pac_MOD,[$1]) -fi -]) -dnl -dnl -dnl PAC_FC_MODULE_INCFLAG -AC_DEFUN([PAC_FC_MODULE_INCFLAG],[ -AC_REQUIRE([PAC_FC_MODULE_EXT]) -AC_CACHE_CHECK([for Fortran 90 module include flag], -pac_cv_fc_module_incflag,[ -AC_LANG_PUSH(Fortran) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - module conf - integer n - parameter (n=1) - end module conf - ]) -]) -pac_madedir="no" -if test ! -d conf ; then mkdir conftestdir ; pac_madedir="yes"; fi -if test "$pac_cv_fc_module_case" = "upper" ; then - pac_module="CONF.$pac_cv_fc_module_ext" -else - pac_module="conf.$pac_cv_fc_module_ext" -fi -AC_COMPILE_IFELSE([],[ - if test -s "$pac_module" ; then - mv $pac_module conftestdir - # Remove any temporary files, and hide the work.pc file - # (if the compiler generates them) - if test -f work.pc ; then - mv -f work.pc conftest.pc - fi - rm -f work.pcl - else - AC_MSG_WARN([Unable to build a simple Fortran 90 module]) - # echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - # cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD - _AC_MSG_LOG_CONFTEST - fi -],[]) -# Remove the conftest* after AC_LANG_CONFTEST -rm -rf conftest.dSYM -rm -f conftest.$ac_ext - -dnl Create the conftest here so the test isn't created everytime inside loop. -AC_LANG_CONFTEST([AC_LANG_PROGRAM([],[use conf])]) - -# Save the original FCFLAGS -saved_FCFLAGS="$FCFLAGS" -pac_cv_fc_module_incflag="" -for inchdr in '-I' '-M' '-p' ; do - FCFLAGS="$saved_FCFLAGS ${inchdr}conftestdir" - AC_COMPILE_IFELSE([],[pac_cv_fc_module_incflag="$inchdr" ; break]) -done -if test "X$pac_cv_fc_module_incflag" = "X" ; then - if test -s conftest.pc ; then - mv conftest.pc conftestdir/mpimod.pc - echo "mpimod.pc" > conftestdir/mpimod.pcl - echo "`pwd`/conftestdir/mpimod.pc" >> conftestdir/mpimod.pcl - inchdr='-cl,' - FCFLAGS="$save_FCFLAGS ${inchdr}conftestdir" - AC_COMPILE_IFELSE([], [pac_fcompile_ok=yes], [pac_fcompile_ok=no]) - if test "$pac_fcompile_ok" = "yes" ; then - pac_cv_fc_module_incflag="$inchdr" - # Not quite right; see the comments that follow - AC_MSG_RESULT([-cl,filename where filename contains a list of files and directories]) - FC_WORK_FILES_ARG="-cl,mpimod.pcl" - FCMODINCSPEC="-cl,/mod.pcl" - else - # The version of the Intel compiler that I have refuses to let - # you put the "work catalog" list anywhere but the current directory. - pac_cv_fc_module_incflag="Unavailable!" - fi - else - # Early versions of the Intel ifc compiler required a *file* - # containing the names of files that contained the names of the - # - # -cl,filename.pcl - # filename.pcl contains - # fullpathname.pc - # The "fullpathname.pc" is generated, I believe, when a module is - # compiled. - # Intel compilers use a wierd system: -cl,filename.pcl . If no file is - # specified, work.pcl and work.pc are created. However, if you specify - # a file, it must contain the name of a file ending in .pc . Ugh! - pac_cv_fc_module_incflag="unknown" - fi -fi -# Restore the original FCFLAGS -FCFLAGS="$saved_FCFLAGS" -if test "$pac_madedir" = "yes" ; then rm -rf conftestdir ; fi -# Remove the conftest* after AC_LANG_CONFTEST -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -AC_LANG_POP(Fortran) -]) -AC_SUBST(FC_WORK_FILES_ARG) -AC_SUBST(FCMODINCFLAG) -FCMODINCFLAG=$pac_cv_fc_module_incflag -]) -dnl -dnl -dnl -AC_DEFUN([PAC_FC_MODULE],[ -PAC_FC_MODULE_EXT -PAC_FC_MODULE_INCFLAG -PAC_FC_MODULE_OUTFLAG -]) -dnl -dnl PAC_FC_MODULE_OUTFLAG -AC_DEFUN([PAC_FC_MODULE_OUTFLAG],[ -AC_REQUIRE([PAC_FC_MODULE_EXT]) -AC_CACHE_CHECK([for Fortran 90 module output directory flag], - [pac_cv_fc_module_outflag], -[ -AC_LANG_PUSH([Fortran]) -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - module conf - integer n - parameter (n=1) - end module conf - ]) -]) -pac_madedir="no" -if test ! -d conf ; then mkdir conftestdir ; pac_madedir="yes"; fi -if test "$pac_cv_fc_module_case" = "upper" ; then - pac_module="CONF.$pac_cv_fc_module_ext" -else - pac_module="conf.$pac_cv_fc_module_ext" -fi - -# check base case that the compiler can create modules and that they endup in -# the current directory -AC_COMPILE_IFELSE([],[ - if test -s "$pac_module" ; then - rm -f "$pac_module" - # Remove any temporary files, and hide the work.pc file - # (if the compiler generates them) - if test -f work.pc ; then - mv -f work.pc conftest.pc - fi - rm -f work.pcl - else - AC_MSG_WARN([Unable to build a simple Fortran 90 module]) - # echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - # cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD - _AC_MSG_LOG_CONFTEST - fi -],[]) - -# known flags for reasonably recent versions of various f90 compilers: -# gfortran -J${dir} -# xlf -qmoddir=${dir} -# pgf90 -module ${dir} -# ifort -module ${dir} -# nagfor -mdir ${dir} -# ftn -J ${dir} ## the Cray fortran compiler -# ftn -em -J${dir} ## the Cray fortran compiler (crayftn, in 2013) -# For this above case, we must have added -em to FCFLAGS, since other -# module tests do not always use the module output flag. See -# FC_MODULE_EXT , where this is determined. -# f95 -YMOD_OUT_DIR=${dir} ## the Absoft fortran compiler -# lf95 -M ${dir} ## the Lahey/Fujitsu fortran compiler -# f90 -moddir=${dir} ## the Sun f90 compiler -# g95 -fmod=${dir} -# -# If there are any compilers still out there that are totally brain-dead and -# don't support an output directory flag, we can write a wrapper script to tell -# users to use. Alternatively they can use an older version of MPICH. - -pac_cv_fc_module_outflag= -for mod_flag in '-J' '-J ' '-qmoddir=' '-module ' '-YMOD_OUT_DIR=' '-mdir ' '-moddir=' '-fmod=' '-M '; do - rm -f conftestdir/NONEXISTENT conftestdir/* - PAC_PUSH_FLAG([FCFLAGS]) - FCFLAGS="$FCFLAGS ${mod_flag}conftestdir" - AC_COMPILE_IFELSE([],[pac_build_success=yes],[pac_build_success=no]) - AS_IF([test "X$pac_build_success" = Xyes], - [AS_IF([test -s "conftestdir/${pac_module}"], - [pac_cv_fc_module_outflag="$mod_flag"])]) - PAC_POP_FLAG([FCFLAGS]) - AS_IF([test "X$pac_cv_fc_module_outflag" = X],[:],[break]) -done - -# Remove the conftest* after AC_LANG_CONFTEST -rm -rf conftest.dSYM -rm -f conftest.$ac_ext - -if test "$pac_madedir" = "yes" ; then rm -rf conftestdir ; fi -AS_UNSET([pac_madedir]) -# Remove the conftest* after AC_LANG_CONFTEST -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -AC_LANG_POP(Fortran) -])dnl end AC_CACHE_CHECK - -AC_SUBST([FCMODOUTFLAG],[$pac_cv_fc_module_outflag]) -])dnl end AC_DEFUN([PAC_FC_MODULE_OUTFLAG]) -dnl -dnl PAC_FC_AND_F77_COMPATIBLE([action-if-true],[action-if-false]) -dnl -dnl Determine whether object files compiled with Fortran 77 can be -dnl linked to Fortran 90 main programs. -dnl -dnl The test uses a name that includes an underscore unless the 3rd -dnl argument provides another routine name. -dnl -AC_DEFUN([PAC_FC_AND_F77_COMPATIBLE],[ -AC_REQUIRE([PAC_PROG_FC_WORKS]) -AC_CACHE_CHECK([whether Fortran 90 compiler works with Fortran 77 compiler], -pac_cv_fc_and_f77,[ -pacTestRoutine=foo_abc -ifelse([$3],,,[eval pacTestRoutine=$3]) -pac_cv_fc_and_f77="unknown" -# compile the f77 program and link with the f90 program -# The reverse may not work because the Fortran 90 environment may -# expect to be in control (and to provide library files unknown to any other -# environment, even Fortran 77!) -AC_LANG_PUSH(Fortran 77) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ - subroutine ${pacTestRoutine}(b) - integer b - b = b + 1 - end - ]) -],[ - # pac_f77compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT]) - # Save original LIBS, prepend previously generated object file to LIBS - saved_LIBS="$LIBS" - LIBS="pac_f77conftest.$OBJEXT $LIBS" - AC_LANG_PUSH(Fortran) - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ - program main - integer a - a = 1 - call ${pacTestRoutine}(a) - end - ]) - ],[pac_cv_fc_and_f77=yes],[pac_cv_fc_and_f77=no]) - # Some versions of the Intel compiler produce these two files - rm -f work.pc work.pcl - # Restore LIBS - LIBS="$saved_LIBS" - AC_LANG_POP(Fortran) - # remove previously generated object file. - rm -f pac_f77conftest.$OBJEXT -], [ - # pac_f77compile_ok=no - pac_cv_fc_and_f77=no -]) -AC_LANG_POP(Fortran 77) -# Perform the requested action based on whether the test succeeded -if test "$pac_cv_fc_and_f77" = yes ; then - ifelse($1,,:,[$1]) -else - ifelse($2,,:,[$2]) - AC_MSG_WARN([See config.log for the failed test program and its output.]) -fi -]) -dnl -]) -dnl -dnl -dnl /*D -dnl PAC_PROG_FC_CRAY_POINTER - Check if Fortran supports Cray-style pointer. -dnl If so, set pac_cv_prog_fc_has_pointer to yes -dnl and find out if any extra compiler flag is -dnl needed and set it as CRAYPTR_FCFLAGS. -dnl i.e. CRAYPTR_FCFLAGS is meaningful only if -dnl pac_cv_prog_fc_has_pointer = yes. -dnl -dnl Synopsis: -dnl PAC_PROG_FC_CRAY_POINTER([action-if-true],[action-if-false]) -dnl D*/ -AC_DEFUN([PAC_PROG_FC_CRAY_POINTER],[ -AC_CACHE_CHECK([whether Fortran 90 supports Cray-style pointer], -pac_cv_prog_fc_has_pointer,[ -AC_LANG_PUSH([Fortran]) -AC_LANG_CONFTEST([ - AC_LANG_PROGRAM([],[ - integer M - pointer (MPTR,M) - data MPTR/0/ - ]) -]) -saved_FCFLAGS="$FCFLAGS" -pac_cv_prog_fc_has_pointer=no -CRAYPTR_FCFLAGS="" -for ptrflag in '' '-fcray-pointer' ; do - FCFLAGS="$saved_FCFLAGS $ptrflag" - AC_COMPILE_IFELSE([],[ - pac_cv_prog_fc_has_pointer=yes - CRAYPTR_FCFLAGS="$ptrflag" - break - ]) -done -dnl Restore FCFLAGS first, since user may not want to modify FCFLAGS -FCFLAGS="$saved_FCFLAGS" -dnl remove conftest after ac_lang_conftest -rm -f conftest.$ac_ext -AC_LANG_POP([Fortran]) -]) -if test "$pac_cv_prog_fc_has_pointer" = "yes" ; then - AC_MSG_CHECKING([for Fortran 90 compiler flag for Cray-style pointer]) - if test "X$CRAYPTR_FCFLAGS" != "X" ; then - AC_MSG_RESULT([$CRAYPTR_FCFLAGS]) - else - AC_MSG_RESULT([none]) - fi - ifelse([$1],[],[:],[$1]) -else - ifelse([$2],[],[:],[$2]) -fi -]) -dnl -dnl -dnl -AC_DEFUN([PAC_PROG_FC_AND_C_STDIO_LIBS],[ -AC_REQUIRE([AC_HEADER_STDC]) -# To simply the code in the cache_check macro, chose the routine name -# first, in case we need it -confname=conf1_ -case "$pac_cv_prog_f77_name_mangle" in - "lower underscore") confname=conf1_ ;; - "upper stdcall") confname=CONF1 ;; - upper) confname=CONF1 ;; - "lower doubleunderscore") confname=conf1_ ;; - lower) confname=conf1 ;; - "mixed underscore") confname=conf1_ ;; - mixed) confname=conf1 ;; -esac - -AC_CACHE_CHECK([what libraries are needed to link Fortran90 programs with C routines that use stdio],pac_cv_prog_fc_and_c_stdio_libs,[ -pac_cv_prog_fc_and_c_stdio_libs=unknown - -AC_LANG_PUSH(C) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS) -#include -#endif -int $confname( int a ) -{ printf( "The answer is %d\n", a ); fflush(stdout); return 0; } - ]) -],[ - pac_compile_ok=yes - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - # Save LIBS and prepend object file to LIBS - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - AC_LANG_PUSH(Fortran) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([],[call conf1(0)]) - ],[ - pac_cv_prog_fc_and_c_stdio_libs=none - ],[ - # Try again with -lSystemStubs - LIBS="$LIBS -lSystemStubs" - AC_LINK_IFELSE([],[ - pac_cv_prog_fc_and_c_stdio_libs="-lSystemStubs" - ],[]) - ]) - LIBS="$saved_LIBS" - AC_LANG_POP(Fortran) - rm -f pac_conftest.$OBJEXT -]) -AC_LANG_POP(C) -dnl -if test "$pac_cv_prog_fc_and_c_stdio_libs" != none -a \ - "$pac_cv_prog_fc_and_c_stdio_libs" != unknown ; then - FC_OTHER_LIBS="$FC_OTHER_LIBS $pac_cv_prog_fc_and_c_stdio_libs" -fi -]) -dnl -]) -dnl -dnl/*D -dnl PAC_FC_CHECK_COMPILER_OPTION - Check that a FC compiler option is -dnl accepted without warning messages -dnl -dnl Synopsis: -dnl PAC_FC_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) -dnl -dnl Output Effects: -dnl -dnl If no actions are specified, a working value is added to 'FCOPTIONS' -dnl -dnl Notes: -dnl This is now careful to check that the output is different, since -dnl some compilers are noisy. -dnl -dnl We are extra careful to prototype the functions in case compiler options -dnl that complain about poor code are in effect. -dnl -dnl Because this is a long script, we have ensured that you can pass a -dnl variable containing the option name as the first argument. -dnl D*/ -AC_DEFUN([PAC_FC_CHECK_COMPILER_OPTION],[ -AC_MSG_CHECKING([whether Fortran 90 compiler accepts option $1]) -pac_opt="$1" -AC_LANG_PUSH(Fortran) -FCFLAGS_orig="$FCFLAGS" -FCFLAGS_opt="$pac_opt $FCFLAGS" -pac_result="unknown" - -AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) -FCFLAGS="$FCFLAGS_orig" -rm -f pac_test1.log -PAC_LINK_IFELSE_LOG([pac_test1.log], [], [ - FCFLAGS="$FCFLAGS_opt" - rm -f pac_test2.log - PAC_LINK_IFELSE_LOG([pac_test2.log], [], [ - PAC_RUNLOG_IFELSE([diff -b pac_test1.log pac_test2.log], - [pac_result=yes], [pac_result=no]) - ],[ - pac_result=no - ]) -], [ - pac_result=no -]) -AC_MSG_RESULT([$pac_result]) -dnl Delete the conftest created by AC_LANG_CONFTEST. -rm -f conftest.$ac_ext -# -if test "$pac_result" = "yes" ; then - AC_MSG_CHECKING([whether routines compiled with $pac_opt can be linked with ones compiled without $pac_opt]) - pac_result=unknown - FCFLAGS="$FCFLAGS_orig" - rm -f pac_test3.log - PAC_COMPILE_IFELSE_LOG([pac_test3.log], [ - AC_LANG_SOURCE([ - subroutine try() - end - ]) - ],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - - FCFLAGS="$FCFLAGS_opt" - rm -f pac_test4.log - PAC_LINK_IFELSE_LOG([pac_test4.log], [AC_LANG_PROGRAM()], [ - PAC_RUNLOG_IFELSE([diff -b pac_test2.log pac_test4.log], - [pac_result=yes], [pac_result=no]) - ],[ - pac_result=no - ]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT - ],[ - pac_result=no - ]) - AC_MSG_RESULT([$pac_result]) - rm -f pac_test3.log pac_test4.log -fi -rm -f pac_test1.log pac_test2.log - -dnl Restore FCFLAGS before 2nd/3rd argument commands are executed, -dnl as 2nd/3rd argument command could be modifying FCFLAGS. -FCFLAGS="$FCFLAGS_orig" -if test "$pac_result" = "yes" ; then - ifelse([$2],[],[FCOPTIONS="$FCOPTIONS $1"],[$2]) -else - ifelse([$3],[],[:],[$3]) -fi -AC_LANG_POP(Fortran) -]) -dnl /*D -dnl PAC_FC_WORKS_WITH_CPP -dnl -dnl Checks if Fortran 90 compiler works with C preprocessor -dnl -dnl Most systems allow the Fortran compiler to process .F and .F90 files -dnl using the C preprocessor. However, some systems either do not -dnl allow this or have serious bugs (OSF Fortran compilers have a bug -dnl that generates an error message from cpp). The following test -dnl checks to see if .F works, and if not, whether "cpp -P -C" can be used -dnl D*/ -AC_DEFUN([PAC_FC_WORKS_WITH_CPP],[ -AC_REQUIRE([AC_PROG_CPP]) -AC_MSG_CHECKING([whether Fortran 90 compiler processes .F90 files with C preprocessor]) -AC_LANG_PUSH([Fortran]) -saved_fc_ext=${ac_ext} -ac_ext="F90" -saved_FCFLAGS="$FCFLAGS" -FCFLAGS="$FCFLAGS $CPPFLAGS" -AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program main -#define ASIZE 10 - integer a(ASIZE) - end - ]) -]) -AC_COMPILE_IFELSE([],[ - pac_cv_fc_accepts_F90=yes - ifelse([$1],[],[],[$1=""]) -],[ - pac_cv_fc_accepts_F90=no - ifelse([$1],[],[:],[$1="false"]) -]) -# Restore Fortran's ac_ext but not FCFLAGS -ac_ext="$saved_fc_ext" - -if test "$pac_cv_fc_accepts_F90" != "yes" ; then - pac_cpp_fc="$ac_cpp -C -P conftest.F90 > conftest.$ac_ext" - PAC_RUNLOG_IFELSE([$pac_cpp_fc],[ - if test -s conftest.${ac_ext} ; then - AC_COMPILE_IFELSE([],[ - pac_cv_fc_accepts_F90="no, use cpp" - ifelse([$1],[],[],[$1="$CPP -C -P"]) - ],[]) - rm -f conftest.${ac_ext} - fi - ],[]) -fi -FCFLAGS="$saved_FCFLAGS" -rm -f conftest.F90 -AC_LANG_POP([Fortran]) -AC_MSG_RESULT([$pac_cv_fc_accepts_F90]) -]) -dnl -dnl PAC_FC_VENDOR: -dnl Try to get a version string for the F90 compiler. We may -dnl need this to find likely command-line arguments for accessing -dnl shared libraries -dnl -AC_DEFUN([PAC_FC_VENDOR],[ -AC_MSG_CHECKING([for Fortran 90 compiler vendor]) -# This is complicated by some compilers (such as the Intel 8.1 ifort) -# that return a non-zero status even when they accept the -V option -# (a zero status is returned only if there is a file). -pac_cv_fc_vendor="unknown" -for arg in --version -V -v ; do - rm -f conftest.txt - PAC_RUNLOG([$FC $arg conftest.txt 2>&1]) - # Ignore the return code, because some compilers set the - # return code to zero on invalid arguments and some to - # non-zero on success (with no files to compile) - if test -f conftest.txt ; then - if grep 'Portland Group' conftest.txt >/dev/null 2>&1 ; then - pac_cv_fc_vendor=pgi - elif grep 'Sun Workshop' conftest.txt >/dev/null 2>&1 ; then - pac_cv_fc_vendor=sun - elif grep 'Sun Fortran 9' conftest.txt >/dev/null 2>&1 ; then - pac_cv_fc_vendor=sun - elif grep 'Absoft' conftest.txt >/dev/null 2>&1 ; then - pac_cv_fc_vendor=absoft - elif grep 'G95' conftest.txt >/dev/null 2>&1 ; then - pac_cv_fc_vendor=gnu - elif grep 'GNU Fortran' conftest.txt >/dev/null 2>&1 ; then - # This is gfortran - pac_cv_fc_vendor=gnu - elif grep Intel conftest.txt >/dev/null 2>&1 ; then - pac_cv_fc_vendor=intel - fi - fi - if test "$pac_cv_fc_vendor" != "unknown" ; then break ; fi -done -if test "$pac_cv_fc_vendor" = "unknown" ; then - # Try to use the compiler name - if test "$FC" = "ifort" -o "$FC" = "ifc" ; then - pac_cv_fc_vendor=intel - elif test "$FC" = "pgf90" ; then - pac_cv_fc_vendor=pgi - elif test "$FC" = "xlf90" -o "$FC" = "xlf90_r" ; then - pac_cv_fc_vendor=ibm - elif test "$FC" = "xlf95" -o "$FC" = "xlf95_r" ; then - pac_cv_fc_vendor=ibm - fi -fi -AC_MSG_RESULT([$pac_cv_fc_vendor]) -rm -f conftest.txt -# End of checking for F90 compiler vendor -]) -dnl -dnl PAC_F77_IS_FC([ACTION_IF_TRUE],[ACTION_IF_FALSE]) -dnl Check if F77 is a Fortran 90 compiler. -dnl -AC_DEFUN([PAC_F77_IS_FC],[ -AC_MSG_CHECKING([whether $F77 is a Fortran 90 compiler]) -AC_LANG_PUSH([Fortran 77]) -saved_ac_ext=$ac_ext -ac_ext="f90" -AC_LINK_IFELSE([ - AC_LANG_SOURCE([ - program main - integer, dimension(10) :: n - integer k - print *, range(k) - end - ]) -],[ - pac_cv_prog_f77_is_fc=yes - ifelse([$1],[],[],[$1]) -],[ - pac_cv_prog_f77_is_fc=no - ifelse([$2],[],[],[$2]) -]) -AC_MSG_RESULT([$pac_cv_prog_f77_is_fc]) -AC_LANG_POP([Fortran 77]) -]) -dnl -dnl PAC_FC_FLOAT_MODEL(float_type, [variable-set-if-successful-test]) -dnl variable-set-if-successful-test is optional variable. -dnl -dnl This is a runtime test. -dnl -AC_DEFUN([PAC_FC_FLOAT_MODEL],[ -type="$1" -AC_MSG_CHECKING([for precision and range of $type]) -AC_LANG_PUSH([Fortran]) -rm -f pac_fconftest.out -AC_RUN_IFELSE([ - AC_LANG_SOURCE([ - program main - $type aa - open(8, file="pac_fconftest.out", form="formatted") - write(8,*) precision(aa), ",", range(aa) - close(8) - end - ]) -],[ - if test -s pac_fconftest.out ; then - pac_fc_num_model="`sed -e 's/ */ /g' pac_fconftest.out`" - AC_MSG_RESULT([$pac_fc_num_model]) - ifelse([$2],[],[],[$2=$pac_fc_num_model]) - else - AC_MSG_RESULT([Error]) - AC_MSG_WARN([No output from test program!]) - fi - rm -f pac_fconftest.out -],[ - AC_MSG_RESULT([Error]) - AC_MSG_WARN([Failed to run program to determine the precision and range of $type]) -]) -AC_LANG_POP([Fortran]) -]) -dnl -dnl PAC_FC_SIMPLE_NUMBER_MODEL(message, Fortran-type, Fortran-write, -dnl [variable-set-if-successful-test], -dnl [cross-value]) -dnl -dnl message : message of what test-fc-code is checking -dnl Fortran-type : Fortran90 type's data model to be examined. -dnl Fortran-write : Fortran90 type's write statement used with write(N,*). -dnl variable-set-if-successful-test : -dnl The optional variable to be set if the codelet: -dnl "Fortran-type" + "write(N,*) Fortran-write" -dnl is successful in returning the simple data model. -dnl cross-value : value to be used for above variable when -dnl cross_compiling=yes -dnl -dnl This is a runtime test. -dnl -AC_DEFUN([PAC_FC_SIMPLE_NUMBER_MODEL],[ -pac_msg="$1" -AC_MSG_CHECKING([for $pac_msg]) -AC_LANG_PUSH([Fortran]) -rm -f pac_fconftest.out -AC_RUN_IFELSE([ - AC_LANG_SOURCE([ - program main - $2 - open(8, file="pac_fconftest.out", form="formatted") - write(8,*) $3 - close(8) - end - ]) -],[ - if test -s pac_fconftest.out ; then - pac_fc_num_model="`sed -e 's/ */ /g' pac_fconftest.out`" - AC_MSG_RESULT([$pac_fc_num_model]) - ifelse([$4],[],[],[$4=$pac_fc_num_model]) - else - AC_MSG_RESULT([Error]) - AC_MSG_WARN([No output from test program!]) - fi - rm -f pac_fconftest.out -],[ - AC_MSG_RESULT([Error]) - AC_MSG_WARN([Failed to run program to determine $pac_msg]) -],[ - AC_MSG_RESULT([$5]) - ifelse([$4],[],[],[$4=$5]) -]) -AC_LANG_POP([Fortran]) -]) -dnl -dnl PAC_FC_AVAIL_INTEGER_MODELS([INTEGER-MODELS-FLAG],[CROSS-VARIABLE]) -dnl -dnl INTEGER-MODELS-FLAG : an optional variable to be set if provided. -dnl If it isn't provided, PAC_FC_ALL_INTEGER_MODELS -dnl will be set. -dnl CROSS-VALUE : value will be used to set INTEGER-MODELS-FLAG -dnl or PAC_FC_ALL_INTEGER_MODELS if cross_compiling=yes. -dnl -dnl This is a runtime test. -dnl -AC_DEFUN([PAC_FC_AVAIL_INTEGER_MODELS],[ -AC_MSG_CHECKING([for available integer kinds]) -AC_LANG_PUSH([Fortran]) -rm -f pac_fconftest.out -AC_RUN_IFELSE([ - AC_LANG_SOURCE([ - program main - integer r, lastkind - lastkind=selected_int_kind(1) - open(8, file="pac_fconftest.out", form="formatted") - do r=2,30 - k = selected_int_kind(r) - if (k .ne. lastkind) then - write(8,*) r-1, ",", lastkind - lastkind = k - endif - if (k .le. 0) then - exit - endif - enddo - if (k.ne.lastkind) then - write(8,*) 31, ",", k - endif - close(8) - end - ]) -],[ - if test -s pac_fconftest.out ; then - pac_flag="`sed -e 's/ */ /g' pac_fconftest.out | tr '\012' ','`" - AC_MSG_RESULT([$pac_flag]) - pac_validKinds="`sed -e 's/ */ /g' pac_fconftest.out | tr '\012' ':'`" - ifelse([$1],[],[PAC_FC_ALL_INTEGER_MODELS=$pac_flag],[$1=$pac_flag]) - else - AC_MSG_RESULT([Error]) - AC_MSG_WARN([No output from test program!]) - fi - rm -f pac_fconftest.out -],[ - AC_MSG_RESULT([Error]) - AC_MSG_WARN([Failed to run program to determine available integer models]) -],[ - dnl Even when cross_compiling=yes, - dnl pac_validKinds needs to be set for PAC_FC_INTEGER_MODEL_MAP() - pac_validKinds="`echo \"$2\" | tr ',' ':'`" - AC_MSG_RESULT([$2]) - ifelse([$1],[],[PAC_FC_ALL_INTEGER_MODELS=$2],[$1=$2]) -]) -AC_LANG_POP([Fortran]) -]) -dnl -dnl PAC_FC_INTEGER_MODEL_MAP([INTEGER-MODEL-MAP-FLAG],[CROSS-VALUE])) -dnl -dnl INTEGER-MODEL-MAP-FLAG : an optional variable to be set if provided. -dnl If it isn't provided, PAC_FC_INTEGER_MODEL_MAP -dnl will be set. -dnl CROSS-VALUE : value will be used to set INTEGER-MODEL-MAP-FLAG -dnl or PAC_FC_INTEGER_MODEL_MAP if cross_compiling=yes. -dnl -dnl This test requires $pac_validKinds set by PAC_FC_ALL_INTEGER_MODELS(). -dnl -dnl This is a runtime test. -dnl -dnl Compile the C subroutine as pac_conftest.o and Link it with a Fortran main. -AC_DEFUN([PAC_FC_INTEGER_MODEL_MAP],[ -AC_REQUIRE([PAC_FC_AVAIL_INTEGER_MODELS]) -AC_MSG_CHECKING([for available integer ranges]) -AC_LANG_PUSH([C]) -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#ifdef F77_NAME_UPPER -#define cisize_ CISIZE -#define isize_ ISIZE -#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) -#define cisize_ cisize -#define isize_ isize -#endif -int cisize_(char *,char*); -int cisize_(char *i1p, char *i2p) -{ - int isize_val=0; - isize_val = (int)(i2p - i1p); - return isize_val; -} - ]) -],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - pac_ccompile_ok=yes -],[ - pac_ccompile_ok=no -]) -AC_LANG_POP([C]) -dnl -if test "$pac_ccompile_ok" = "yes" ; then - saved_LIBS="$LIBS" - LIBS="pac_conftest.$OBJEXT $LIBS" - saved_IFS=$IFS - IFS=: - AC_LANG_PUSH([Fortran]) - pac_flag="" - for rangekind in $pac_validKinds ; do - kind="`echo $rangekind | sed -e 's/.*,//'`" - range="`echo $rangekind | sed -e 's/,.*//'`" - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([ - program main - integer (kind=$kind) a(2) - integer cisize - open(8, file="pac_fconftest.out", form="formatted") - write(8,*) $range, ",", $kind, ",", cisize( a(1), a(2) ) - close(8) - end - ]) - ]) - IFS=$saved_IFS - rm -f pac_fconftest.out - AC_RUN_IFELSE([],[ - if test -s pac_fconftest.out ; then - sizes="`sed -e 's/ */ /g' pac_fconftest.out`" - pac_flag="$pac_flag { $sizes }," - else - AC_MSG_WARN([No output from test program!]) - fi - rm -f pac_fconftest.out - ],[ - AC_MSG_WARN([Fortran program fails to build or run!]) - ],[ - pac_flag="$2" - ]) - IFS=: - done - IFS=$saved_IFS - AC_MSG_RESULT([$pac_flag]) - ifelse([$1],[],[PAC_FC_INTEGER_MODEL_MAP=$pac_flag],[$1=$pac_flag]) - AC_LANG_POP([Fortran]) - LIBS="$saved_LIBS" - rm -f pac_conftest.$OBJEXT -fi -]) - - -AC_DEFUN([PAC_FC_2008_SUPPORT],[ -AC_MSG_CHECKING([for Fortran 2008 support]) - -AC_LANG_PUSH([C]) -f08_works=yes -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE( -[[ -#include - -int foo_c(CFI_cdesc_t * a_desc, CFI_cdesc_t * b_desc) -{ - char * a_row = (char*) a_desc->base_addr; - if (a_desc->type != CFI_type_int) { return 1; } - if (a_desc->rank != 2) { return 2; } - if (a_desc->dim[1].extent != b_desc->dim[0].extent) { return 3; } - return 0; -} -]])],[mv conftest.$OBJEXT conftest1.$OBJEXT],[f08_works=no]) -AC_LANG_POP([C]) - -AC_LANG_PUSH([Fortran]) -PAC_PUSH_FLAG([LIBS]) -LIBS="conftest1.$OBJEXT $LIBS" -AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -MODULE F08TS_MODULE -IMPLICIT NONE - -! Test public, private, protected -REAL, PUBLIC :: x -REAL, PRIVATE :: y -LOGICAL, PROTECTED :: z - -! Test abstract -ABSTRACT INTERFACE - SUBROUTINE user_func(x, y) - INTEGER :: x(*) - REAL :: y - END SUBROUTINE -END INTERFACE - -! Test TS 29113 assumed type , assumed rank and bind(C) -INTERFACE - FUNCTION FOO(A, B, C) & - BIND(C,name="foo_c") RESULT(err) - USE, intrinsic :: iso_c_binding, ONLY : c_int - TYPE(*), DIMENSION(..) :: A, B, C - INTEGER(c_int) :: err - END FUNCTION FOO -END INTERFACE - -! Test assumed-rank + asynchronous -INTERFACE TEST_ASSUMED_RANK_ASYNC - SUBROUTINE TEST_ASSUMED_RANK_ASYNC_IMPL(BUF) - IMPLICIT NONE - TYPE(*), DIMENSION(..), ASYNCHRONOUS :: BUF - END SUBROUTINE TEST_ASSUMED_RANK_ASYNC_IMPL -END INTERFACE TEST_ASSUMED_RANK_ASYNC - -CONTAINS - -! Test TS 29113 asychronous attribute and optional -SUBROUTINE test1(buf, count, ierr) - INTEGER, ASYNCHRONOUS :: buf(*) - INTEGER :: count - INTEGER, OPTIONAL :: ierr -END SUBROUTINE - -! Test procedure type and non-bind(c) x in C_FUNCLOC(x) -SUBROUTINE test2(func) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_FUNLOC, C_FUNPTR - PROCEDURE(user_func) :: func - TYPE(C_FUNPTR) :: errhandler_fn - errhandler_fn = C_FUNLOC(func) -END SUBROUTINE - -! Test intrinsic storage_size -SUBROUTINE test3(x, size) - CHARACTER, DIMENSION(..) :: x - INTEGER, INTENT(OUT) :: size - size = storage_size(x)/8 -END SUBROUTINE test3 - -END MODULE - -!============================================== -PROGRAM MAIN -USE :: F08TS_MODULE, ONLY : FOO, TEST_ASSUMED_RANK_ASYNC -IMPLICIT NONE - -INTEGER, DIMENSION(4,4) :: A, B -INTEGER, DIMENSION(2,2) :: C -INTEGER :: ERRCODE -INTEGER, DIMENSION(10), ASYNCHRONOUS :: IAR - -! Test contiguous and non-contiguous array section passing -! and linkage with C code -ERRCODE = FOO(A(1:4:2, :), B(:, 2:4:2), C) -CALL TEST_ASSUMED_RANK_ASYNC(IAR(2:7)) - -END PROGRAM - ])],[],[f08_works=no]) -PAC_POP_FLAG([LIBS]) -AC_LANG_POP([Fortran]) - -if test "$f08_works" = "yes" ; then - $1 -else - $2 -fi -rm -f conftest1.$OBJEXT F08TS_MODULE.* f08ts_module.* -AC_MSG_RESULT([$f08_works]) -]) diff --git a/3rd-party/romio321/confdb/aclocal_libs.m4 b/3rd-party/romio321/confdb/aclocal_libs.m4 deleted file mode 100644 index 8868e994cba..00000000000 --- a/3rd-party/romio321/confdb/aclocal_libs.m4 +++ /dev/null @@ -1,107 +0,0 @@ - -dnl PAC_SET_HEADER_LIB_PATH(with_option,[default_path]) -dnl This macro looks for the --with-xxx=, --with-xxx-include and --with-xxx-lib= -dnl options and sets the library and include paths. -dnl -dnl TODO as written, this macro cannot handle a "with_option" arg that has "-" -dnl characters in it. Use AS_TR_SH (and possibly AS_VAR_* macros) to handle -dnl this case if it ever arises. -AC_DEFUN([PAC_SET_HEADER_LIB_PATH],[ - AC_ARG_WITH([$1], - [AC_HELP_STRING([--with-$1=PATH], - [specify path where $1 include directory and lib directory can be found])], - - [AS_CASE(["$withval"], - [yes|no|''], - [AC_MSG_WARN([--with[out]-$1=PATH expects a valid PATH]) - with_$1=""])], - [with_$1=$2]) - AC_ARG_WITH([$1-include], - [AC_HELP_STRING([--with-$1-include=PATH], - [specify path where $1 include directory can be found])], - [AS_CASE(["$withval"], - [yes|no|''], - [AC_MSG_WARN([--with[out]-$1-include=PATH expects a valid PATH]) - with_$1_include=""])], - []) - AC_ARG_WITH([$1-lib], - [AC_HELP_STRING([--with-$1-lib=PATH], - [specify path where $1 lib directory can be found])], - [AS_CASE(["$withval"], - [yes|no|''], - [AC_MSG_WARN([--with[out]-$1-lib=PATH expects a valid PATH]) - with_$1_lib=""])], - []) - - # The args have been sanitized into empty/non-empty values above. - # Now append -I/-L args to CPPFLAGS/LDFLAGS, with more specific options - # taking priority - - AS_IF([test -n "${with_$1_include}"], - [PAC_APPEND_FLAG([-I${with_$1_include}],[CPPFLAGS])], - [AS_IF([test -n "${with_$1}"], - [PAC_APPEND_FLAG([-I${with_$1}/include],[CPPFLAGS])])]) - - AS_IF([test -n "${with_$1_lib}"], - [PAC_APPEND_FLAG([-L${with_$1_lib}],[LDFLAGS])], - [AS_IF([test -n "${with_$1}"], - dnl is adding lib64 by default really the right thing to do? What if - dnl we are on a 32-bit host that happens to have both lib dirs available? - [PAC_APPEND_FLAG([-L${with_$1}/lib],[LDFLAGS]) - AS_IF([test -d "${with_$1}/lib64"], - [PAC_APPEND_FLAG([-L${with_$1}/lib64],[LDFLAGS])]) - ]) - ]) -]) - - -dnl PAC_CHECK_HEADER_LIB(header.h, libname, function, action-if-yes, action-if-no) -dnl This macro checks for a header and lib. It is assumed that the -dnl user can specify a path to the includes and libs using --with-xxx=. -dnl The xxx is specified in the "with_option" parameter. -dnl -dnl NOTE: This macro expects a corresponding PAC_SET_HEADER_LIB_PATH -dnl macro (or equivalent logic) to be used before this macro is used. -AC_DEFUN([PAC_CHECK_HEADER_LIB],[ - failure=no - AC_CHECK_HEADER([$1],,failure=yes) - AC_CHECK_LIB($2,$3,,failure=yes) - if test "$failure" = "no" ; then - $4 - else - $5 - fi -]) - -dnl PAC_CHECK_HEADER_LIB_FATAL(with_option, header.h, libname, function) -dnl Similar to PAC_CHECK_HEADER_LIB, but errors out on failure -AC_DEFUN([PAC_CHECK_HEADER_LIB_FATAL],[ - PAC_CHECK_HEADER_LIB($2,$3,$4,success=yes,success=no) - if test "$success" = "no" ; then - AC_MSG_ERROR(['$2 or lib$3 library not found. Did you specify --with-$1= or --with-$1-include= or --with-$1-lib=?']) - fi -]) - -dnl PAC_CHECK_PREFIX(with_option,prefixvar) -AC_DEFUN([PAC_CHECK_PREFIX],[ - AC_ARG_WITH([$1-prefix], - [AS_HELP_STRING([[--with-$1-prefix[=DIR]]], [use the $1 - library installed in DIR, rather than the - one included in the distribution. Pass - "embedded" to force usage of the included - $1 source.])], - [if test "$withval" = "system" ; then - : - elif test "$withval" = "embedded" ; then - : - else - PAC_APPEND_FLAG([-I${with_$1_prefix}/include],[CPPFLAGS]) - if test -d "${with_$1_prefix}/lib64" ; then - PAC_APPEND_FLAG([-L${with_$1_prefix}/lib64],[LDFLAGS]) - fi - PAC_APPEND_FLAG([-L${with_$1_prefix}/lib],[LDFLAGS]) - fi - ], - [with_$1_prefix="embedded"]) - ] -) diff --git a/3rd-party/romio321/confdb/aclocal_make.m4 b/3rd-party/romio321/confdb/aclocal_make.m4 deleted file mode 100644 index 147e92e9c2e..00000000000 --- a/3rd-party/romio321/confdb/aclocal_make.m4 +++ /dev/null @@ -1,315 +0,0 @@ -dnl -dnl We need routines to check that make works. Possible problems with -dnl make include -dnl -dnl It is really gnumake, and contrary to the documentation on gnumake, -dnl it insists on screaming everytime a directory is changed. The fix -dnl is to add the argument --no-print-directory to the make -dnl -dnl It is really BSD 4.4 make, and can't handle 'include'. For some -dnl systems, this can be fatal; there is no fix (other than removing this -dnl alleged make). -dnl -dnl It is the OSF V3 make, and can't handle a comment in a block of target -dnl code. There is no acceptable fix. -dnl -dnl -dnl -dnl -dnl Find a make program if none is defined. -AC_DEFUN([PAC_PROG_MAKE_PROGRAM],[true -if test "X$MAKE" = "X" ; then - AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake) -fi -])dnl - -dnl/*D -dnl PAC_PROG_MAKE_INCLUDE - Check whether make supports include -dnl -dnl Synopsis: -dnl PAC_PROG_MAKE_INCLUDE([action if true],[action if false]) -dnl -dnl Output Effect: -dnl None -dnl -dnl Notes: -dnl This checks for makes that do not support 'include filename'. Some -dnl versions of BSD 4.4 make required '#include' instead; some versions of -dnl 'pmake' have the same syntax. -dnl -dnl See Also: -dnl PAC_PROG_MAKE -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_MAKE_INCLUDE],[ -AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[ -AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest -cat > conftest <<. -ALL: - @echo "success" -. -cat > conftest1 <<. -include conftest -. -pac_str=`$MAKE -f conftest1 2>&1` -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest conftest1 -if test "$pac_str" != "success" ; then - pac_cv_prog_make_include="no" -else - pac_cv_prog_make_include="yes" -fi -]) -if test "$pac_cv_prog_make_include" = "no" ; then - ifelse([$2],,:,[$2]) -else - ifelse([$1],,:,[$1]) -fi -])dnl - -dnl/*D -dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in -dnl shell commands in a makefile -dnl -dnl Synopsis: -dnl PAC_PROG_MAKE_ALLOWS_COMMENTS([false text]) -dnl -dnl Output Effect: -dnl Issues a warning message if comments are not allowed in a makefile. -dnl Executes the argument if one is given. -dnl -dnl Notes: -dnl Some versions of OSF V3 make do not all comments in action commands. -dnl -dnl See Also: -dnl PAC_PROG_MAKE -dnl D*/ -dnl -AC_DEFUN([PAC_PROG_MAKE_ALLOWS_COMMENTS],[ -AC_CACHE_CHECK([whether make allows comments in actions], -pac_cv_prog_make_allows_comments,[ -AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest -cat > conftest <<. -SHELL=/bin/sh -ALL: - @# This is a valid comment! - @echo "success" -. -pac_str=`$MAKE -f conftest 2>&1` -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest -if test "$pac_str" != "success" ; then - pac_cv_prog_make_allows_comments="no" -else - pac_cv_prog_make_allows_comments="yes" -fi -]) -if test "$pac_cv_prog_make_allows_comments" = "no" ; then - AC_MSG_WARN([Your make does not allow comments in target code. -Using this make may cause problems when building programs. -You should consider using gnumake instead.]) - ifelse([$1],,[$1]) -fi -])dnl - -dnl/*D -dnl PAC_PROG_MAKE_VPATH - Check whether make supports source-code paths. -dnl -dnl Synopsis: -dnl PAC_PROG_MAKE_VPATH -dnl -dnl Output Effect: -dnl Sets the variable 'VPATH' to either -dnl.vb -dnl VPATH = .:${srcdir} -dnl.ve -dnl or -dnl.vb -dnl .PATH: . ${srcdir} -dnl.ve -dnl -dnl Notes: -dnl The test checks that the path works with implicit targets (some makes -dnl support only explicit targets with 'VPATH' or 'PATH'). -dnl -dnl NEED TO DO: Check that $< works on explicit targets. -dnl -dnl See Also: -dnl PAC_PROG_MAKE -dnl -dnl D*/ -AC_DEFUN([PAC_PROG_MAKE_VPATH],[ -AC_SUBST(VPATH) -dnl AM_IGNORE(VPATH) -AC_CACHE_CHECK([for virtual path format], -pac_cv_prog_make_vpath,[ -AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -rf conftest* -mkdir conftestdir -cat >conftestdir/a.c < conftest <&1 | grep 'conftestdir/a.c'` -if test -n "$ac_out" ; then - pac_cv_prog_make_vpath="VPATH" -else - rm -f conftest - cat > conftest <&1 | grep 'conftestdir/a.c'` - if test -n "$ac_out" ; then - pac_cv_prog_make_vpath=".PATH" - else - pac_cv_prog_make_vpath="neither VPATH nor .PATH works" - fi -fi -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -rf conftest* -]) -if test "$pac_cv_prog_make_vpath" = "VPATH" ; then - VPATH='VPATH=.:${srcdir}' -elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then - VPATH='.PATH: . ${srcdir}' -fi -])dnl - -dnl/*D -dnl PAC_PROG_MAKE_SET_CFLAGS - Check whether make sets CFLAGS -dnl -dnl Synopsis: -dnl PAC_PROG_MAKE_SET_CFLAGS([action if true],[action if false]) -dnl -dnl Output Effects: -dnl Executes the first argument if 'CFLAGS' is set by 'make'; executes -dnl the second argument if 'CFLAGS' is not set by 'make'. -dnl -dnl Notes: -dnl If 'CFLAGS' is set by make, you may wish to override that choice in your -dnl makefile. -dnl -dnl See Also: -dnl PAC_PROG_MAKE -dnl D*/ -AC_DEFUN([PAC_PROG_MAKE_SET_CFLAGS],[ -AC_CACHE_CHECK([whether make sets CFLAGS], -pac_cv_prog_make_set_cflags,[ -AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest -cat > conftest <&1` -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest -if test "$pac_str" = "XX" ; then - pac_cv_prog_make_set_cflags="no" -else - pac_cv_prog_make_set_cflags="yes" -fi -]) -if test "$pac_cv_prog_make_set_cflags" = "no" ; then - ifelse([$2],,:,[$2]) -else - ifelse([$1],,:,[$1]) -fi -])dnl - -dnl/*D -dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with -dnl clock skew in suing make. -dnl -dnl Effect: -dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no -dnl D*/ -AC_DEFUN([PAC_PROG_MAKE_CLOCK_SKEW],[ -AC_CACHE_CHECK([whether clock skew breaks make], -pac_cv_prog_make_found_clock_skew,[ -AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -cat > conftest < conftest.out 2>&1 -if grep -i skew conftest >/dev/null 2>&1 ; then - pac_cv_prog_make_found_clock_skew=yes -else - pac_cv_prog_make_found_clock_skew=no -fi -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -]) -dnl We should really do something if we detect clock skew. The question is, -dnl what? -if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then - AC_MSG_WARN([Clock skew found by make. The configure and build may fail. -Consider building in a local instead of NFS filesystem.]) -fi -]) - -dnl/*D -dnl PAC_PROG_MAKE - Checks for the varieties of MAKE, including support for -dnl VPATH -dnl -dnl Synopsis: -dnl PAC_PROG_MAKE -dnl -dnl Output Effect: -dnl Sets 'MAKE' to the make program to use if 'MAKE' is not already set. -dnl Sets the variable 'SET_CFLAGS' to 'CFLAGS =' if make sets 'CFLAGS'. -dnl -dnl Notes: -dnl This macro uses 'PAC_PROG_MAKE_INCLUDE', -dnl 'PAC_PROG_MAKE_ALLOWS_COMMENTS', 'PAC_PROG_MAKE_VPATH', and -dnl 'PAC_PROG_MAKE_SET_CFLAGS'. See those commands for details about their -dnl actions. -dnl -dnl It may call 'AC_PROG_MAKE_SET', which sets 'SET_MAKE' to 'MAKE = @MAKE@' -dnl if the make program does not set the value of make, otherwise 'SET_MAKE' -dnl is set to empty; if the make program echos the directory name, then -dnl 'SET_MAKE' is set to 'MAKE = $MAKE'. -dnl D*/ -AC_DEFUN([PAC_PROG_MAKE],[ -PAC_PROG_MAKE_PROGRAM -PAC_PROG_MAKE_CLOCK_SKEW -PAC_PROG_MAKE_INCLUDE -PAC_PROG_MAKE_ALLOWS_COMMENTS -PAC_PROG_MAKE_VPATH -AC_SUBST(SET_CFLAGS) -dnl AM_IGNORE(SET_CFLAGS) -PAC_PROG_MAKE_SET_CFLAGS([SET_CFLAGS='CFLAGS=']) -if test "$pac_cv_prog_make_echos_dir" = "no" ; then - AC_PROG_MAKE_SET -else - SET_MAKE="MAKE=${MAKE-make}" -fi -]) diff --git a/3rd-party/romio321/confdb/aclocal_mpi.m4 b/3rd-party/romio321/confdb/aclocal_mpi.m4 deleted file mode 100644 index f0013a9bd18..00000000000 --- a/3rd-party/romio321/confdb/aclocal_mpi.m4 +++ /dev/null @@ -1,519 +0,0 @@ -dnl -dnl/*D -dnl PAC_LIB_MPI - Check for MPI library -dnl -dnl Synopsis: -dnl PAC_LIB_MPI([action if found],[action if not found]) -dnl -dnl Output Effect: -dnl -dnl Notes: -dnl Currently, only checks for lib mpi and mpi.h. Later, we will add -dnl MPI_Pcontrol prototype (const int or not?). -dnl -dnl Prerequisites: -dnl autoconf version 2.13 (for AC_SEARCH_LIBS) -dnl D*/ -dnl Other tests to add: -dnl Version of MPI -dnl MPI-2 I/O? -dnl MPI-2 Spawn? -dnl MPI-2 RMA? -dnl PAC_LIB_MPI([found text],[not found text]) -AC_DEFUN([PAC_LIB_MPI],[ -dnl Set the prereq to 2.50 to avoid having -AC_PREREQ(2.50) -if test "X$pac_lib_mpi_is_building" != "Xyes" ; then - # Use CC if TESTCC is defined - if test "X$pac_save_level" != "X" ; then - pac_save_TESTCC="${TESTCC}" - pac_save_TESTCPP="${TESTCPP}" - CC="$pac_save_CC" - if test "X$pac_save_CPP" != "X" ; then - CPP="$pac_save_CPP" - fi - fi - # Look for MPILIB first if it is defined - AC_SEARCH_LIBS(MPI_Init,$MPILIB mpi mpich) - if test "$ac_cv_search_MPI_Init" = "no" ; then - ifelse($2,, - AC_MSG_ERROR([Could not find MPI library]),[$2]) - fi - AC_CHECK_HEADER(mpi.h,pac_have_mpi_h="yes",pac_have_mpi_h="no") - if test $pac_have_mpi_h = "no" ; then - ifelse($2,, - AC_MSG_ERROR([Could not find mpi.h include file]),[$2]) - fi - if test "X$pac_save_level" != "X" ; then - CC="$pac_save_TESTCC" - CPP="$pac_save_TESTCPP" - fi -fi -ifelse($1,,,[$1]) -]) - -dnl This should also set MPIRUN. -dnl -dnl/*D -dnl PAC_ARG_MPI_TYPES - Add command-line switches for different MPI -dnl environments -dnl -dnl Synopsis: -dnl PAC_ARG_MPI_TYPES([default]) -dnl -dnl Output Effects: -dnl Adds the following command line options to configure -dnl+ \-\-with\-mpich[=path] - MPICH. 'path' is the location of MPICH commands -dnl. \-\-with\-ibmmpi - IBM MPI -dnl. \-\-with\-lammpi[=path] - LAM/MPI -dnl. \-\-with\-mpichnt - MPICH NT -dnl- \-\-with\-sgimpi - SGI MPI -dnl If no type is selected, and a default ("mpich", "ibmmpi", or "sgimpi") -dnl is given, that type is used as if '--with-' was given. -dnl -dnl Sets 'CC', 'F77', 'TESTCC', 'TESTF77', and 'MPILIBNAME'. Does `not` -dnl perform an AC_SUBST for these values. -dnl Also sets 'MPIBOOT' and 'MPIUNBOOT'. These are used to specify -dnl programs that may need to be run before and after running MPI programs. -dnl For example, 'MPIBOOT' may start demons necessary to run MPI programs and -dnl 'MPIUNBOOT' will stop those demons. -dnl -dnl The two forms of the compilers are to allow for tests of the compiler -dnl when the MPI version of the compiler creates executables that cannot -dnl be run on the local system (for example, the IBM SP, where executables -dnl created with mpcc will not run locally, but executables created -dnl with xlc may be used to discover properties of the compiler, such as -dnl the size of data types). -dnl -dnl Historical note: -dnl Some common autoconf tests, such as AC_CHECK_SIZEOF, used to require -dnl running a program. But some MPI compilers (often really compilation -dnl scripts) produced programs that could only be run with special commands, -dnl such as a batch submission system. To allow these test programs to be -dnl run, a separate set of compiler variables, TESTCC, TESTF77, etc., -dnl were defined. However, in later versions of autoconf, it both became -dnl unnecessary to run programs for tests such as AC_CHECK_SIZEOF and -dnl it became necessary to define CC etc. before invoking AC_PROG_CC (and -dnl the othe language compilers), because those commands now do much, much -dnl more than just determining the compiler. -dnl -dnl To address the change, we still define the TESTCC etc. compilers where -dnl possible to allow the use of AC_TRY_RUN when required, but we define -dnl the CC etc variables and do not define ac_cv_prog_CC etc., as these -dnl cause autoconf to skip all of the other initialization code that -dnl AC_PROG_CC etc. runs. Note also that this command must occur before -dnl AC_PROG_CC (or anything that might cause AC_PROG_CC to be invoked). -dnl -dnl See also: -dnl PAC_LANG_PUSH_COMPILERS, PAC_LIB_MPI -dnl D*/ -AC_DEFUN([PAC_ARG_MPI_TYPES],[ -# known types -PAC_ARG_MPI_KNOWN_TYPES -# find compilers -PAC_MPI_FIND_COMPILER_SCRIPTS -PAC_MPI_FIND_COMPILERS -# check for MPI library -PAC_MPI_CHECK_MPI_LIB -]) -dnl -dnl To keep autoconf from prematurely invoking the compiler check scripts, -dnl we need a command that first sets the compilers and a separate one -dnl that makes any necessary checks for libraries -dnl -AC_DEFUN([PAC_ARG_MPI_KNOWN_TYPES],[ -AC_ARG_WITH(mpich, -[--with-mpich=path - Assume that we are building with MPICH], -ac_mpi_type=mpich) -# Allow MPICH as well as MPICH -AC_ARG_WITH(mpich, -[--with-mpich=path - Assume that we are building with MPICH], -ac_mpi_type=mpich) -AC_ARG_WITH(lammpi, -[--with-lammpi=path - Assume that we are building with LAM/MPI], -ac_mpi_type=lammpi) -AC_ARG_WITH(ibmmpi, -[--with-ibmmpi - Use the IBM SP implementation of MPI], -ac_mpi_type=ibmmpi) -AC_ARG_WITH(sgimpi, -[--with-sgimpi - Use the SGI implementation of MPI], -ac_mpi_type=sgimpi) -AC_ARG_WITH(mpichnt, -[--with-mpichnt - Use MPICH for Windows NT ], -ac_mpi_type=mpichnt) -AC_ARG_WITH(mpi, -[--with-mpi=path - Use an MPI implementation with compile scripts mpicc - and mpif77 in path/bin],ac_mpi_type=generic) - -if test "X$ac_mpi_type" = "X" ; then - if test "X$1" != "X" ; then - ac_mpi_type=$1 - else - ac_mpi_type=unknown - fi -fi -if test "$ac_mpi_type" = "unknown" -a "$pac_lib_mpi_is_building" = "yes" ; then - ac_mpi_type="mpich" -fi -]) -dnl -dnl Because autoconf insists on moving code to the beginning of -dnl certain definitions, it is *not possible* to define a single command -dnl that selects compilation scripts and also check for other options. -dnl Thus, this needs to be divided into -dnl MPI_FIND_COMPILER_SCRIPTS -dnl which can fail (i.e., not find a script), and -dnl MPI_FIND_COMPILERS -dnl which runs the various PROC_xx for the compilers. -dnl WARNING: this function ignores --program-suffix and --program-prefix. -dnl However, this function is not currently used at all. -AC_DEFUN([PAC_MPI_FIND_COMPILER_SCRIPTS],[ -# Set defaults -MPIRUN_NP="-np " -MPIEXEC_N="-n " -AC_SUBST(MPIRUN_NP) -AC_SUBST(MPIEXEC_N) -dnl -AC_ARG_VAR([MPIEXEC],[Name and path of mpiexec program]) -AC_ARG_VAR([MPIRUN],[Name and path of mpirun program]) -AC_ARG_VAR([MPIBOOT],[Name and path of program to run before mpirun]) -AC_ARG_VAR([MPIUNBOOT],[Name and path of program to run after all mpirun]) -AC_ARG_VAR([MPICC],[Name and absolute path of program used to compile MPI programs in C]) -AC_ARG_VAR([MPIF77],[Name and absolute path of program used to compile MPI programs in F77]) -AC_ARG_VAR([MPICXX],[Name and absolute path of program used to compile MPI programs in C++]) -AC_ARG_VAR([MPIF90],[Name and absolute path of program used to compile MPI programs in F90]) -# -# Check for things that will cause trouble. For example, -# if MPICC is defined but does not contain a / or \, then PATH_PROG will -# ignore the value -if test -n "$MPICC" ; then - case $MPICC in -changequote(<<,>>) - [\\/]* | ?:[\\/]*) -changequote([,]) - # Ok, PATH_PROG will figure it out - ;; - *) - AC_MSG_ERROR([MPICC must be set to an absolute path if it is set]) - esac -fi -if test -n "$MPICXX" ; then - case $MPICXX in -changequote(<<,>>) - [\\/]* | ?:[\\/]*) -changequote([,]) - # Ok, PATH_PROG will figure it out - ;; - *) - AC_MSG_ERROR([MPICXX must be set to an absolute path if it is set]) - esac -fi -if test -n "$MPIF77" ; then - case $MPIF77 in -changequote(<<,>>) - [\\/]* | ?:[\\/]*) -changequote([,]) - # Ok, PATH_PROG will figure it out - ;; - *) - AC_MSG_ERROR([MPIF77 must be set to an absolute path if it is set]) - esac -fi -if test -n "$MPIF90" ; then - case $MPIF90 in -changequote(<<,>>) - [\\/]* | ?:[\\/]*) -changequote([,]) - # Ok, PATH_PROG will figure it out - ;; - *) - AC_MSG_ERROR([MPIF90 must be set to an absolute path if it is set]) - esac -fi - -case $ac_mpi_type in - mpich) - dnl - dnl This isn't correct. It should try to get the underlying compiler - dnl from the mpicc and mpif77 scripts or mpireconfig - if test "X$pac_lib_mpi_is_building" != "Xyes" ; then - PAC_PUSH_FLAG([PATH]) - if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then - # Look for commands; if not found, try adding bin to the - # path - if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then - with_mpich="$with_mpich/bin" - fi - PATH=$with_mpich:${PATH} - fi - AC_PATH_PROG(MPICC,mpicc) - if test -z "$TESTCC" ; then TESTCC=${CC-cc} ; fi - CC="$MPICC" - # Note that autoconf may unconditionally change the value of - # CC (!) in some other command. Thus, we define CCMASTER - CCMASTER=$CC - # Force autoconf to respect this choice - ac_ct_CC=$CC - # to permit configure codes to recover the correct CC. This - # is an ugly not-quite-correct workaround for the fact that - # does not want you to change the C compiler once you have set it - # (But since it does so unconditionally, it silently creates - # bogus output files.) - AC_PATH_PROG(MPIF77,mpif77) - if test -z "$TESTF77" ; then TESTF77=${F77-f77} ; fi - F77="$MPIF77" - AC_PATH_PROG(MPIFC,mpif90) - if test -z "$TESTFC" ; then TESTFC=${FC-f90} ; fi - FC="$MPIFC" - AC_PATH_PROG(MPICXX,mpiCC) - if test -z "$TESTCXX" ; then TESTCXX=${CXX-CC} ; fi - CXX="$MPICXX" - # We may want to restrict this to the path containing mpirun - AC_PATH_PROG(MPIEXEC,mpiexec) - AC_PATH_PROG(MPIRUN,mpirun) - AC_PATH_PROG(MPIBOOT,mpichboot) - AC_PATH_PROG(MPIUNBOOT,mpichstop) - PAC_POP_FLAG([PATH]) - MPILIBNAME="mpich" - else - # All of the above should have been passed in the environment! - : - fi - ;; - - mpichnt) - ;; - - lammpi) - dnl - dnl This isn't correct. It should try to get the underlying compiler - dnl from the mpicc and mpif77 scripts or mpireconfig - PAC_PUSH_FLAG([PATH]) - if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then - # Look for commands; if not found, try adding bin to the path - if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then - with_lammpi="$with_lammpi/bin" - fi - PATH=$with_lammpi:${PATH} - fi - AC_PATH_PROG(MPICC,mpicc) - if test -z "$TESTCC" ; then TESTCC=${CC-cc} ; fi - CC="$MPICC" - AC_PATH_PROG(MPIF77,mpif77) - if test -z "$TESTCC" ; then TESTF77=${F77-f77} ; fi - F77="$MPIF77" - AC_PATH_PROG(MPIFC,mpif90) - TESTFC=${FC-f90} - if test -z "$TESTFC" ; then TESTFC=${FC-f90} ; fi - FC="$MPIFC" - AC_PATH_PROG(MPICXX,mpiCC) - if test -z "$TESTCXX" ; then TESTCXX=${CXX-CC} ; fi - CXX="$MPICXX" - PAC_POP_FLAG([PATH]) - MPILIBNAME="lammpi" - MPIBOOT="lamboot" - MPIUNBOOT="wipe" - MPIRUN="mpirun" - ;; - - ibmmpi) - AC_CHECK_PROGS(MPCC,mpcc) - AC_CHECK_PROGS(MPXLF,mpxlf mpfort) - if test -z "$MPCC" -o -z "$MPXLF" ; then - AC_MSG_ERROR([Could not find IBM MPI compilation scripts. Either mpcc or mpxlf/mpfort is missing]) - fi - if test -z "$TESTCC" ; then TESTCC=${CC-xlC} ; fi - if test -z "$TESTF77" ; then TESTF77=${F77-xlf}; fi - CC=mpcc; F77=$MPXLF - # There is no mpxlf90, but the options langlvl and free can - # select the Fortran 90 version of xlf - if test "$enable_f90" != no ; then - AC_CHECK_PROGS(MPIXLF90,mpxlf90 mpfort) - if test -z "$TESTFC" ; then TESTFC=${FC-xlf90}; fi - if test "X$MPIXLF90" != "X" ; then - FC="$MPIXLF90" - else - FC="$MPXLF -qlanglvl=90ext -qfree=f90" - fi - fi - MPILIBNAME="" - cross_compiling=yes - # Turn off the autoconf version 3 warning message - ac_tool_warned=yes - ;; - - sgimpi) - if test -z "$TESTCC" ; then TESTCC=${CC:=cc} ; fi - if test -z "$TESTF77" ; then TESTF77=${F77:=f77} ; fi - if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} ; fi - if test -z "$TESTFC" ; then TESTFC=${FC:=f90} ; fi - # Must check for the MPI library in a separate macro - adding - # a test here will cause autoconf to prematurely define the - # C compiler - MPIRUN=mpirun - MPIBOOT="" - MPIUNBOOT="" - ;; - - generic) - # in $with_mpi/bin or $with_mpi - if test "X$MPICC" = "X" ; then - if test -x "$with_mpi/bin/mpicc" ; then - MPICC=$with_mpi/bin/mpicc - elif test -x "$with_mpi/mpicc" ; then - MPICC=$with_mpi/mpicc - fi - fi - if test "X$MPICXX" = "X" ; then - if test -x "$with_mpi/bin/mpicxx" ; then - MPICXX=$with_mpi/bin/mpicxx - elif test -x "$with_mpi/mpicxx" ; then - MPICXX=$with_mpi/mpicxx - fi - fi - if test "X$MPIF77" = "X" ; then - if test -x "$with_mpi/bin/mpif77" ; then - MPIF77=$with_mpi/bin/mpif77 - elif test -x "$with_mpi/mpif77" ; then - MPIF77=$with_mpi/mpif77 - fi - fi - if test "X$MPIF90" = "X" ; then - if test -x "$with_mpi/bin/mpif90" ; then - MPIF90=$with_mpi/bin/mpif90 - elif test -x "$with_mpi/mpif90" ; then - MPIF90=$with_mpi/mpif90 - fi - fi - if test "X$MPIEXEC" = "X" ; then - if test -x "$with_mpi/bin/mpiexec" ; then - MPIEXEC=$with_mpi/bin/mpiexec - elif test -x "$with_mpi/mpiexec" ; then - MPIEXEC=$with_mpi/mpiexec - fi - fi - CC=$MPICC - F77=$MPIF77 - if test "X$MPICXX" != "X" ; then CXX=$MPICXX ; fi - if test "X$MPIF90" != "X" ; then F90=$MPIF90 ; fi - ;; - - *) - # Use the default choices for the compilers - ;; -esac -]) - -AC_DEFUN([PAC_MPI_FIND_COMPILERS],[ -# Tell autoconf to determine properties of the compilers (these are the -# compilers for MPI programs) -PAC_PROG_CC -if test "$enable_f77" != no -a "$enable_fortran" != no ; then - AC_PROG_F77 -fi -if test "$enable_cxx" != no ; then - AC_PROG_CXX -fi -if test "$enable_f90" != no ; then - PAC_PROG_FC -fi -]) - -dnl -dnl This uses the selected CC etc to check for include paths and libraries -AC_DEFUN([PAC_MPI_CHECK_MPI_LIB],[ -AC_REQUIRE([AC_PROG_CC]) -case $ac_mpi_type in - mpich) - ;; - - mpichnt) - dnl - dnl This isn't adequate, but it helps with using MPICH-NT/SDK.gcc - PAC_PUSH_FLAG([CFLAGS]) - CFLAGS="$CFLAGS -I$with_mpichnt/include" - PAC_PUSH_FLAG([CPPFLAGS]) - CPPFLAGS="$CPPFLAGS -I$with_mpichnt/include" - PAC_PUSH_FLAG([LDFLAGS]) - LDFLAGS="$LDFLAGS -L$with_mpichnt/lib" - AC_CHECK_LIB(mpich,MPI_Init,found="yes",found="no") - if test "$found" = "no" ; then - AC_CHECK_LIB(mpich,MPI_Init,found="yes",found="no") - fi - if test "$enable_cxx" != no ; then - AC_PROG_CXX - fi - if test "$enable_f90" != no ; then - PAC_PROG_FC - fi - # Set defaults for the TEST versions if not already set - if test -z "$TESTCC" ; then TESTCC=${CC:=cc} ; fi - if test -z "$TESTF77" ; then TESTF77=${F77:=f77} ; fi - if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} ; fi - if test -z "$TESTFC" ; then TESTFC=${FC:=f90} ; fi - if test "$found" = "no" ; then - PAC_POP_FLAG([CFLAGS]) - PAC_POP_FLAG([CPPFLAGS]) - PAC_POP_FLAG([LDFLAGS]) - fi - ;; - - lammpi) - ;; - - ibmmpi) - ;; - - sgimpi) - AC_CHECK_LIB(mpi,MPI_Init) - if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then - MPILIBNAME="mpi" - fi - ;; - - generic) - AC_SEARCH_LIBS(MPI_Init,mpi mpich mpich) - if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then - MPILIBNAME="mpi" - fi - ;; - - *) - ;; -esac -]) - -dnl -dnl/*D -dnl PAC_MPI_F2C - Determine if MPI has the MPI-2 functions MPI_xxx_f2c and -dnl MPI_xxx_c2f -dnl -dnl Output Effect: -dnl Define 'HAVE_MPI_F2C' if the routines are found. -dnl -dnl Notes: -dnl Looks only for 'MPI_Request_c2f'. -dnl D*/ -AC_DEFUN([PAC_MPI_F2C],[ -AC_CACHE_CHECK([for MPI F2C and C2F routines], -pac_cv_mpi_f2c, -[ -AC_TRY_LINK([#include "mpi.h"], -[MPI_Request request;MPI_Fint a;a = MPI_Request_c2f(request);], -pac_cv_mpi_f2c="yes",pac_cv_mpi_f2c="no") -]) -if test "$pac_cv_mpi_f2c" = "yes" ; then - AC_DEFINE(HAVE_MPI_F2C,1,[Define if MPI has F2C]) -fi -]) -dnl -dnl/*D -dnl PAC_HAVE_ROMIO - make mpi.h include mpio.h if romio enabled -dnl -dnl Output Effect: -dnl expands @HAVE_ROMIO@ in mpi.h into #include "mpio.h" -dnl D*/ -AC_DEFUN([PAC_HAVE_ROMIO],[ -if test "$enable_romio" = "yes" ; then HAVE_ROMIO='#include "mpio.h"'; fi -AC_SUBST(HAVE_ROMIO) -]) diff --git a/3rd-party/romio321/confdb/aclocal_romio.m4 b/3rd-party/romio321/confdb/aclocal_romio.m4 deleted file mode 100644 index af80d3c1024..00000000000 --- a/3rd-party/romio321/confdb/aclocal_romio.m4 +++ /dev/null @@ -1,872 +0,0 @@ -dnl -dnl This files contains additional macros for using autoconf to -dnl build configure scripts. -dnl -dnl Almost all of this file is taken from the aclocal.m4 of MPICH -dnl -dnl Get the format of Fortran names. Uses F77, FFLAGS, and sets WDEF. -dnl If the test fails, sets NOF77 to 1, HAVE_FORTRAN to 0. -dnl -dnl -AC_DEFUN([PAC_GET_FORTNAMES],[ - rm -f confftest.f confftest.$OBJEXT - cat > confftest.f < /dev/null 2>&1 - if test ! -s confftest.$OBJEXT ; then - AC_MSG_WARN([Unable to test Fortran compiler. Compiling a test -program failed to produce an object file]) - NOF77=1 - elif test -z "$FORTRANNAMES" ; then - # MAC OS X (and probably FreeBSD need strings - (not strings -a) - # Cray doesn't accept -a ... - allstrings="-a" - if test $arch_CRAY ; then - allstrings="" - elif strings - confftest.$OBJEXT < /dev/null >/dev/null 2>&1 ; then - allstrings="-" - elif strings -a confftest.$OBJEXT < /dev/null >/dev/null 2>&1 ; then - allstrings="-a" - fi - - nameform1=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop_ | head -1` - nameform2=`strings $allstrings confftest.$OBJEXT | grep MPIR_INIT_FOP | head -1` - nameform3=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop | head -1` - nameform4=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop__ | head -1` - rm -f confftest.f confftest.$OBJEXT - if test -n "$nameform4" ; then - echo "Fortran externals are lower case and have two trailing underscores" - FORTRANNAMES="FORTRANDOUBLEUNDERSCORE" - elif test -n "$nameform1" ; then - # We don't set this in CFLAGS; it is a default case - echo "Fortran externals have a trailing underscore and are lowercase" - FORTRANNAMES="FORTRANUNDERSCORE" - elif test -n "$nameform2" ; then - echo "Fortran externals are uppercase" - FORTRANNAMES="FORTRANCAPS" - elif test -n "$nameform3" ; then - echo "Fortran externals are lower case" - FORTRANNAMES="FORTRANNOUNDERSCORE" - else - AC_MSG_WARN([Unable to determine the form of Fortran external names. -Make sure that the compiler $F77 can be run on this system. -Turning off Fortran (-nof77 being assumed)]) - NOF77=1 - fi - fi - if test -n "$FORTRANNAMES" ; then - WDEF="-D$FORTRANNAMES" - fi - # Delete confftest files with any extension. This catches the case - # where auxillary files, such as coverage files, are removed. - rm -f confftest.* - ])dnl -dnl -define(PAC_GET_SPECIAL_SYSTEM_INFO,[ -# -if test -n "$arch_IRIX"; then - AC_MSG_CHECKING(for IRIX OS version) - dnl This block of code replaces a generic "IRIX" arch value with - dnl IRIX__ - dnl For example - dnl IRIX_5_4400 (IRIX 5.x, using MIPS 4400) - osversion=`uname -r | sed 's/\..*//'` - dnl Note that we need to allow brackets here, so we briefly turn off - dnl the macro quotes - changequote(,)dnl - dnl Get the second field (looking for 6.1) - osvminor=`uname -r | sed 's/[0-9]\.\([0-9]*\)\..*/\1/'` - changequote([,])dnl - AC_MSG_RESULT($osversion) - dnl Get SGI processor count by quick hack - AC_MSG_CHECKING(for IRIX cpucount) - changequote(,)dnl - cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '` - if test "$cpucount" = "" ; then - cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'` - fi - changequote([,])dnl - if test "$cpucount" = "" ; then - AC_MSG_RESULT([Could not determine cpucount. Please send]) - hinv - AC_MSG_ERROR([to romio-maint@mcs.anl.gov]) - fi - AC_MSG_RESULT($cpucount) - dnl - AC_MSG_CHECKING(for IRIX cpumodel) - dnl The tail -1 is necessary for multiple processor SGI boxes - dnl We might use this to detect SGI multiprocessors and recommend - dnl -comm=shared - cputype=`hinv -t cpu | tail -1 | cut -f 3 -d' '` - if test -z "$cputype" ; then - AC_MSG_RESULT([Could not get cputype from hinv -t cpu command. Please send]) - hinv -t cpu 2>&1 - hinv -t cpu | cut -f 3 -d' ' 2>&1 - AC_MSG_ERROR([to romio-maint@mcs.anl.gov]) - fi - AC_MSG_RESULT($cputype) - dnl echo "checking for osversion and cputype" - dnl cputype may contain R4400, R2000A/R3000, or something else. - dnl We may eventually need to look at it. - if test -z "$osversion" ; then - AC_MSG_RESULT([Could not determine OS version. Please send]) - uname -a - AC_MSG_ERROR([to romio-maint@mcs.anl.gov]) - elif test $osversion = 4 ; then - true - elif test $osversion = 5 ; then - true - elif test $osversion = 6 ; then - true - else - AC_MSG_RESULT([Could not recognize the version of IRIX (got $osversion). -ROMIO knows about versions 4, 5 and 6; the version being returned from -uname -r is $osversion. Please send]) - uname -a 2>&1 - hinv 2>&1 - AC_MSG_ERROR([to romio-maint@mcs.anl.gov]) - fi - AC_MSG_CHECKING(for cputype) - OLD_ARCH=IRIX - IRIXARCH="$ARCH_$osversion" - dnl Now, handle the chip set - changequote(,)dnl - cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"` - changequote([,])dnl - case $cputype in - 3000) ;; - 4000) ;; - 4400) ;; - 4600) ;; - 5000) ;; - 8000) ;; - 10000);; - 12000);; - *) - AC_MSG_WARN([Unexpected IRIX/MIPS chipset $cputype. Please send the output]) - uname -a 2>&1 - hinv 2>&1 - AC_MSG_WARN([to romio-maint@mcs.anl.gov -ROMIO will continue and assume that the cputype is -compatible with a MIPS 4400 processor.]) - cputype=4400 - ;; - esac - AC_MSG_RESULT($cputype) - IRIXARCH="$IRIXARCH_$cputype" - echo "IRIX-specific architecture is $IRIXARCH" -fi -])dnl -dnl -dnl -define(PAC_TEST_MPI,[ - AC_MSG_CHECKING(if a simple MPI program compiles and links) - rm -f mpitest.c - cat > mpitest.c <&5 - $cmd >&5 2>&5 - if test ! -x conftest$EXEEXT ; then - echo "$as_me:$LINENO: failed program was:" >&5 - sed 's/^/| /' mpitest.c >&5 - rm -f conftest$EXEEXT mpitest.c - AC_MSG_ERROR([Unable to compile a simple MPI program. -Use environment variables to provide the location of MPI libraries and -include directories]) - else - rm -f conftest$EXEEXT mpitest.c - fi -AC_MSG_RESULT(yes) -])dnl -dnl -dnl -dnl -define(PAC_NEEDS_FINT,[ - AC_MSG_CHECKING(if MPI_Fint is defined in the MPI implementation) - cat > mpitest1.c < /dev/null 2>&1 - if test ! -s mpitest1.$OBJEXT ; then - NEEDS_MPI_FINT="#define NEEDS_MPI_FINT" - CFLAGS="$CFLAGS -DNEEDS_MPI_FINT" - AC_MSG_RESULT(no) - rm -f mpitest1.$OBJEXT mpitest1.c - else - NEEDS_MPI_FINT="" - AC_MSG_RESULT(yes) - rm -f mpitest1.$OBJEXT mpitest1.c - fi -])dnl -dnl -define(PAC_MPI_LONG_LONG_INT,[ - AC_MSG_CHECKING(if MPI_LONG_LONG_INT is defined in mpi.h) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPI_LONG_LONG_INT,,[Define if mpi has long long it]) - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -dnl PAC_LONG_LONG_64: check if there is a 64-bit long long -dnl -define(PAC_LONG_LONG_64,[ -if test -n "$longlongsize" ; then - if test "$longlongsize" = 8 ; then - echo "defining MPI_Offset as long long in C and integer*8 in Fortran" - AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits]) - DEFINE_MPI_OFFSET="typedef long long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer*8" - LL="\%lld" - elif test "$longlongsize" = "int" ; then # a hack to set MPI_Offset as int - echo "defining MPI_Offset as int in C and integer in Fortran" - DEFINE_MPI_OFFSET="typedef int MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - AC_DEFINE(MPI_OFFSET_IS_INT,,[Define if MPI_Offset is int]) - LL="\%d" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - else - echo "defining MPI_Offset as long in C and integer in Fortran" - DEFINE_MPI_OFFSET="typedef long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - LL="\%ld" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - fi -else - PAC_GET_TYPE_SIZE(long long, longlongsize) - if test -n "$longlongsize" ; then - if test "$longlongsize" = 8 ; then - PAC_TEST_LONG_LONG() - else - echo "defining MPI_Offset as long in C and integer in Fortran" - DEFINE_MPI_OFFSET="typedef long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - LL="\%ld" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - fi - else -dnl check if longlong is not supported or only its size cannot be determined -dnl because the program cannot be run. - rm -f ltest.c - cat > ltest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - echo "assuming size of long long is 8bytes; use '-longlongsize' to indicate otherwise" - rm -f conftest$EXEEXT ltest.c - echo "defining MPI_Offset as long long in C and integer*8 in Fortran" - AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits]) - DEFINE_MPI_OFFSET="typedef long long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer*8" - LL="\%lld" - else - echo "assuming long long is not available; use '-longlongsize' to indicate otherwise" - echo "defining MPI_Offset as long in C and integer in Fortran" - DEFINE_MPI_OFFSET="typedef long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - LL="\%ld" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - fi - fi -fi -])dnl -dnl -dnl -define(PAC_MPI_INFO,[ - AC_MSG_CHECKING(if MPI_Info functions are defined in the MPI implementation) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI_Info available]) - HAVE_MPI_INFO="#define HAVE_MPI_INFO" - MPI_FINFO1="!" - MPI_FINFO2="!" - MPI_FINFO3="!" - MPI_FINFO4="!" - else - AC_MSG_RESULT(no) - BUILD_MPI_INFO=1 - MPI_FINFO1=" INTEGER MPI_MAX_INFO_KEY, MPI_MAX_INFO_VAL" - MPI_FINFO2=" PARAMETER (MPI_MAX_INFO_KEY=255, MPI_MAX_INFO_VAL=1024)" - MPI_FINFO3=" INTEGER MPI_INFO_NULL" - MPI_FINFO4=" PARAMETER (MPI_INFO_NULL=0)" - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -dnl -define(PAC_MPI_DARRAY_SUBARRAY,[ - AC_MSG_CHECKING(if darray and subarray constructors are defined in the MPI implementation) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,,[Define if MPI Darray available]) - HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY" - MPI_FARRAY1="!" - MPI_FARRAY2="!" - MPI_FARRAY3="!" - MPI_FARRAY4="!" - MPI_FARRAY5="!" - MPI_FARRAY6="!" - MPI_FARRAY7="!" - else - AC_MSG_RESULT(no) - BUILD_MPI_ARRAY=1 - MPI_FARRAY1=" INTEGER MPI_ORDER_C, MPI_ORDER_FORTRAN" - MPI_FARRAY2=" PARAMETER (MPI_ORDER_C=56, MPI_ORDER_FORTRAN=57)" - MPI_FARRAY3=" INTEGER MPI_DISTRIBUTE_BLOCK, MPI_DISTRIBUTE_CYCLIC" - MPI_FARRAY4=" INTEGER MPI_DISTRIBUTE_NONE, MPI_DISTRIBUTE_DFLT_DARG" - MPI_FARRAY5=" PARAMETER (MPI_DISTRIBUTE_BLOCK=121, MPI_DISTRIBUTE_CYCLIC=122)" - MPI_FARRAY6=" PARAMETER (MPI_DISTRIBUTE_NONE=123)" - MPI_FARRAY7=" PARAMETER (MPI_DISTRIBUTE_DFLT_DARG=-49767)" - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -dnl -define(PAC_CHECK_MPI_SGI_INFO_NULL,[ - AC_MSG_CHECKING([if MPI_INFO_NULL is defined in mpi.h]) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - cp adio/sgi/mpi3.1/*.h include - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -dnl -dnl -define(PAC_CHECK_MPIOF_H,[ - AC_MSG_CHECKING(if mpiof.h is included in mpif.h) - rm -f mpitest.f - cat > mpitest.f < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - MPIOF_H_INCLUDED=1 - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.f -])dnl -dnl -dnl -dnl check if pread64 is defined in IRIX. needed on IRIX 6.5 -dnl -define(PAC_HAVE_PREAD64,[ - AC_MSG_CHECKING(if pread64 is defined) - rm -f conftest.c - cat > conftest.c < - main() - { - int fd=0, buf=0, i=0; - off64_t off=0; - pread64(fd, &buf, i, off); - } -EOF - rm -f conftest$EXEEXT - $CC $USER_CFLAGS -o conftest$EXEEXT conftest.c > /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PREAD64,,[Define if pread64 available]) - else - AC_MSG_RESULT(no) - fi -rm -f conftest$EXEEXT conftest.c -])dnl -dnl -dnl -define(PAC_TEST_MPI_SGI_type_is_contig,[ - AC_MSG_CHECKING(if MPI_SGI_type_is_contig is defined) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - AC_DEFINE(NO_MPI_SGI_type_is_contig,,[Define if no MPI type is contig]) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -dnl -dnl -define(PAC_TEST_MPI_COMBINERS,[ - AC_MSG_CHECKING(if MPI-2 combiners are defined in mpi.h) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPI_COMBINERS,,[Define if MPI combiners available]) - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -dnl -dnl PAC_MPI_OFFSET_KIND() -dnl -dnl tries to determine the Fortran 90 kind parameter for 8-byte integers -dnl -define(PAC_MPI_OFFSET_KIND, -[ -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -# Determine the extension for Fortran 90 files (not all compilers accept -# .f and not all accept .f90) -if test -z "$ac_f90ext" ; then - if test -z "$FC" ; then - # This list should correspond to the list in aclocal_fc.m4 - AC_CHECK_PROGS(FC,ifort pgf90 pathf90 pathf95 xlf90 xlf95 f90 epcf90 \ - f95 fort lf95 gfortran g95 ifc efc) - fi - AC_MSG_CHECKING([for extension for Fortran 90 programs]) - ac_f90ext="f90" - ac_f90compile='${FC-f90} -c $FCFLAGS conftest.$ac_f90ext 1>&AC_FD_CC' - cat > conftest.$ac_f90ext < conftest.$ac_f90ext < conftest.$ac_f90ext - program main - integer i - i = selected_int_kind(16) - open(8, file="conftest.out", form="formatted") - write (8,*) i - close(8) - stop - end -EOF -if test -z "$FC" ; then - FC=f90 -fi -KINDVAL="" -if $FC -o conftest$EXEEXT conftest.$ac_f90ext >/dev/null 2>&1 ; then - ./conftest$EXEEXT >/dev/null 2>&1 - if test -s conftest.out ; then - KINDVAL=`cat conftest.out` - fi -fi -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then - AC_MSG_RESULT($KINDVAL) - MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND" - MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$KINDVAL)" -else - AC_MSG_RESULT(unavailable) -fi -])dnl -dnl -dnl -define(PAC_TEST_MPI_HAVE_OFFSET_KIND,[ - AC_MSG_CHECKING(if MPI_OFFSET_KIND is defined in mpif.h) - rm -f mpitest.f - cat > mpitest.f < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.f -])dnl -dnl -dnl -dnl PAC_GET_XFS_MEMALIGN -dnl -dnl -define(PAC_GET_XFS_MEMALIGN, -[AC_MSG_CHECKING([for memory alignment needed for direct I/O]) -rm -f memalignval -rm -f /tmp/romio_tmp.bin -AC_TEST_PROGRAM([#include -#include -#include -#include -main() { - struct dioattr st; - int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644); - FILE *f=fopen("memalignval","w"); - if (fd == -1) exit(1); - if (!f) exit(1); - fcntl(fd, F_DIOINFO, &st); - fprintf( f, "%u\n", st.d_mem); - exit(0); -}],Pac_CV_NAME=`cat memalignval`,Pac_CV_NAME="") -rm -f memalignval -rm -f /tmp/romio_tmp.bin -if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then - AC_MSG_RESULT($Pac_CV_NAME) - CFLAGS="$CFLAGS -DXFS_MEMALIGN=$Pac_CV_NAME" -else - AC_MSG_RESULT(unavailable, assuming 128) - CFLAGS="$CFLAGS -DXFS_MEMALIGN=128" -fi -])dnl -dnl - -define(PAC_HAVE_MOUNT_NFS,[ - AC_MSG_CHECKING([if MOUNT_NFS is defined in the include files]) - rm -f conftest.c - cat > conftest.c < -#include - main() - { - int i=MOUNT_NFS; - } -EOF - rm -f conftest$EXEEXT - $CC $USER_CFLAGS -o conftest$EXEEXT conftest.c > /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - ROMIO_HAVE_MOUNT_NFS=1 - AC_DEFINE(HAVE_MOUNT_NFS,,[Define if MOUNT_NFS defined]) - else - ROMIO_HAVE_MOUNT_NFS=0 - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT conftest.c -])dnl -dnl -dnl -dnl PAC_MPI_OFFSET_KIND_4BYTE() -dnl -dnl tries to determine the Fortran 90 kind parameter for 4-byte integers -dnl -define(PAC_MPI_OFFSET_KIND_4BYTE, -[AC_MSG_CHECKING([for Fortran 90 KIND parameter for 4-byte integers]) -rm -f kind.f kind.$OBJEXT kind$EXEEXT -cat < kind.f - program main - integer i - i = selected_int_kind(8) - open(8, file="k.out", form="formatted") - write (8,*) i - close(8) - stop - end -EOF -if test -z "$FC" ; then - FC=f90 -fi -KINDVAL="" -if $FC -o kind$EXEEXT kind.f >/dev/null 2>&1 ; then - ./kind >/dev/null 2>&1 - if test -s k.out ; then - KINDVAL=`cat k.out` - fi -fi -rm -f kind$EXEEXT k.out kind.f kind.$OBJEXT -if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then - AC_MSG_RESULT($KINDVAL) - MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND" - MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$KINDVAL)" -else - AC_MSG_RESULT(unavailable) -fi -])dnl -dnl -dnl -define(PAC_FUNC_STRERROR,[ - AC_MSG_CHECKING([for strerror()]) - rm -f conftest.c - cat > conftest.c < - main() - { - char *s = strerror(5); - } -EOF - rm -f conftest$EXEEXT - $CC $USER_CFLAGS -o conftest$EXEXT conftest.c >> config.log 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STRERROR,,[Define if strerror available]) - else - AC_MSG_RESULT(no) - AC_MSG_CHECKING([for sys_errlist]) - rm -f conftest.c -changequote(,) - cat > conftest.c < - main() - { - extern char *sys_errlist[]; - printf("%s\n", sys_errlist[34]); - } -EOF -changequote([,]) - rm -f conftest$EXEEXT - $CC $USER_CFLAGS -o conftest$EXEEXT conftest.c > config.log 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SYSERRLIST,,[Define if syserrlist available]) - else - AC_MSG_RESULT(no) - fi - fi - rm -f conftest$EXEEXT conftest.c -])dnl -dnl -define(PAC_TEST_MPIR_STATUS_SET_BYTES,[ - AC_MSG_CHECKING(if MPIR_Status_set_bytes is defined) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_STATUS_SET_BYTES,,[Define if status set bytes available]) - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -define(PAC_TEST_MPIU_FUNCS,[ - AC_MSG_CHECKING(support for MPICH memory macros) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH memory tracing macros defined]) - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl -dnl -define(PAC_TEST_MPI_GREQUEST,[ - AC_MSG_CHECKING(support for generalized requests) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPI_GREQUEST,1,[Define if generalized requests avaliable]) - DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1" - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl - -define(PAC_TEST_MPI_GREQUEST_EXTENSIONS,[ - AC_MSG_CHECKING(support for non-standard extended generalized requests) - rm -f mpitest.c - cat > mpitest.c < /dev/null 2>&1 - if test -x conftest$EXEEXT ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPI_GREQUEST_EXTENTIONS,1,[Define if non-standard generalized requests extensions avaliable]) - DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#define HAVE_MPI_GREQUEST_EXTENSIONS 1" - else - AC_MSG_RESULT(no) - fi - rm -f conftest$EXEEXT mpitest.c -])dnl - -define(PAC_TEST_NEEDS_CONST,[ - AC_MSG_CHECKING([const declarations needed in MPI routines]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE( - [ #include - int MPI_File_delete(char *filename, MPI_Info info) { return (0); } - ] )], - [ - AC_MSG_RESULT(no) - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MPIIO_CONST, const, [Define if MPI-IO routines need a const qualifier]) - ]) - ]) diff --git a/3rd-party/romio321/confdb/aclocal_runlog.m4 b/3rd-party/romio321/confdb/aclocal_runlog.m4 deleted file mode 100644 index f22e6ddbc3a..00000000000 --- a/3rd-party/romio321/confdb/aclocal_runlog.m4 +++ /dev/null @@ -1,218 +0,0 @@ -dnl -dnl PAC_RUN_LOG mimics _AC_RUN_LOG which is autoconf internal routine. -dnl We also make sure PAC_RUN_LOG can be used in AS_IF, so the last -dnl test command should have terminating ]), i.e. without newline before ]). -dnl -AC_DEFUN([PAC_RUNLOG],[ -{ AS_ECHO(["$as_me:$LINENO: $1"]) >&AS_MESSAGE_LOG_FD - (eval $1) 2>&AS_MESSAGE_LOG_FD - ac_status=$? - AS_ECHO(["$as_me:$LINENO: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD - test $ac_status = 0; }]) - -dnl -dnl PAC_COMMAND_IFELSE is written to replace AC_TRY_EVAL with added logging -dnl to config.log, i.e. AC_TRY_EVAL does not log anything to config.log. -dnl If autoconf provides AC_COMMAND_IFELSE or AC_EVAL_IFELSE, -dnl AC_COMMAND_IFELSE dnl should be replaced by the official autoconf macros. -dnl -dnl PAC_COMMAND_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL]) -dnl -AC_DEFUN([PAC_COMMAND_IFELSE],[ -AS_IF([PAC_RUNLOG([$1])],[ - $2 -],[ - AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD - m4_ifvaln([$3],[ - (exit $ac_status) - $3 - ]) -]) -]) - -AC_DEFUN([PAC_RUNLOG_IFELSE],[ -dnl pac_TESTLOG is the internal temporary logfile for this macro. -pac_TESTLOG="pac_test.log" -rm -f $pac_TESTLOG -PAC_COMMAND_IFELSE([$1 > $pac_TESTLOG],[ - ifelse([$2],[],[],[$2]) -],[ - AS_ECHO(["*** $1 :"]) >&AS_MESSAGE_LOG_FD - cat $pac_TESTLOG >&AS_MESSAGE_LOG_FD - ifelse([$3],[],[],[$3]) -]) -rm -f $pac_TESTLOG -]) - - -dnl PAC_VAR_PUSHVAL(VARNAME, [LastSavedValue])) -dnl -dnl Save the content of the shell variable, VARNAME, onto a stack. -dnl The saved value of VARNAME is restorable with respect to the nesting -dnl of the macro. -dnl -dnl The Last saved value of VARNAME on the stack is stored in shell variable -dnl pac_LastSavedValueOf_$VARNAME if the 2nd argument is NOT supplied. -dnl If the 2nd argument is present, the last saved value will be stored -dnl in the 2nd argument instead. -dnl -dnl The First saved value of VARNAME on the stack is stored in shell variable -dnl dnl pac_FirstSavedValueOf_$VARNAME. -dnl -AC_DEFUN([PAC_VAR_PUSHVAL],[ -# START of PUSHVAL -dnl define local m4-name pac_stk_level. -AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level]) -AS_VAR_SET_IF([pac_stk_level],[ - AS_VAR_ARITH([pac_stk_level], [$pac_stk_level + 1]) -],[ - AS_VAR_SET([pac_stk_level], [0]) -]) -dnl AS_ECHO_N(["PUSHVAL: pac_stk_level = $pac_stk_level, "]) -dnl Save the content of VARNAME, i.e. $VARNAME, onto the stack. -AS_VAR_SET([pac_stk_$1_$pac_stk_level],[$$1]) -AS_VAR_IF([pac_stk_level], [0], [ - dnl Save the 1st pushed value of VARNAME as pac_FirstSavedValueOf_$VARNAME - AS_VAR_COPY([pac_FirstSavedValueOf_$1],[pac_stk_$1_$pac_stk_level]) -]) -ifelse([$2],[],[ - dnl Save the last pushed value of VARNAME as pac_LastSavedValueOf_$VARNAME - AS_VAR_COPY([pac_LastSavedValueOf_$1],[pac_stk_$1_$pac_stk_level]) - dnl AS_ECHO(["pac_LastSavedValueOf_$1 = $pac_LastSavedValueOf_$1"]) -],[ - dnl Save the last pushed value of VARNAME as $2 - AS_VAR_COPY([$2],[pac_stk_$1_$pac_stk_level]) - dnl AS_ECHO(["$2 = $$2"]) -]) -AS_VAR_POPDEF([pac_stk_level]) -# END of PUSHVAL -]) -dnl -dnl -dnl -dnl PAC_VAR_POPVAL(VARNAME) -dnl -dnl Restore variable, VARNAME, from the stack. -dnl This macro is safe with respect to the nesting. -dnl Some minimal checking of nesting balance of PAC_VAR_PUSH[POP]VAL() -dnl is done here. -dnl -AC_DEFUN([PAC_VAR_POPVAL],[ -# START of POPVAL -dnl define local m4-name pac_stk_level. -AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level]) -AS_VAR_SET_IF([pac_stk_level],[ - AS_VAR_IF([pac_stk_level],[-1],[ - AC_MSG_WARN(["Imbalance of PUSHVAL/POPVAL of $1"]) - ],[ - dnl AS_ECHO_N(["POPVAL: pac_stk_level = $pac_stk_level, "]) - AS_VAR_COPY([$1],[pac_stk_$1_$pac_stk_level]) - dnl AS_ECHO(["popped_val = $$1"]) - AS_VAR_ARITH([pac_stk_level], [ $pac_stk_level - 1 ]) - ]) -],[ - AC_MSG_WARN(["Uninitialized PUSHVAL/POPVAL of $1"]) -]) -AS_VAR_POPDEF([pac_stk_level]) -# END of POPVAL -]) -dnl -dnl -dnl -dnl PAC_COMPILE_IFELSE_LOG is a wrapper around AC_COMPILE_IFELSE with the -dnl output of ac_compile to a specified logfile instead of AS_MESSAGE_LOG_FD -dnl -dnl PAC_COMPILE_IFELSE_LOG(logfilename, input, -dnl [action-if-true], [action-if-false]) -dnl -dnl where input, [action-if-true] and [action-if-false] are used -dnl in AC_COMPILE_IFELSE(input, [action-if-true], [action-if-false]). -dnl This macro is nesting safe. -dnl -AC_DEFUN([PAC_COMPILE_IFELSE_LOG],[ -dnl -dnl Instead of defining our own ac_compile and do AC_TRY_EVAL -dnl on these variables. We modify ac_compile used by AC_*_IFELSE -dnl by piping the output of the command to a logfile. The reason is that -dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_compile -dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in -dnl these commands, i.e. deviate from how GNU standard uses these variables. -dnl -dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_compile. -dnl Save a copy of ac_compile on a stack -dnl which is safe through nested invocations of this macro. -PAC_VAR_PUSHVAL([ac_compile]) -dnl Modify ac_compile based on the unmodified ac_compile. -ac_compile="`echo $pac_FirstSavedValueOf_ac_compile | sed -e 's|>.*$|> $1 2>\&1|g'`" -AC_COMPILE_IFELSE([$2],[ - ifelse([$3],[],[:],[$3]) -],[ - ifelse([$4],[],[:],[$4]) -]) -dnl Restore the original ac_compile from the stack. -PAC_VAR_POPVAL([ac_compile]) -]) -dnl -dnl -dnl -dnl PAC_LINK_IFELSE_LOG is a wrapper around AC_LINK_IFELSE with the -dnl output of ac_link to a specified logfile instead of AS_MESSAGE_LOG_FD -dnl -dnl PAC_LINK_IFELSE_LOG(logfilename, input, -dnl [action-if-true], [action-if-false]) -dnl -dnl where input, [action-if-true] and [action-if-false] are used -dnl in AC_LINK_IFELSE(input, [action-if-true], [action-if-false]). -dnl This macro is nesting safe. -dnl -AC_DEFUN([PAC_LINK_IFELSE_LOG],[ -dnl -dnl Instead of defining our own ac_link and do AC_TRY_EVAL -dnl on these variables. We modify ac_link used by AC_*_IFELSE -dnl by piping the output of the command to a logfile. The reason is that -dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_link -dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in -dnl these commands, i.e. deviate from how GNU standard uses these variables. -dnl -dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_link. -dnl Save a copy of ac_link on a stack -dnl which is safe through nested invocations of this macro. -PAC_VAR_PUSHVAL([ac_link]) -dnl Modify ac_link based on the unmodified ac_link. -ac_link="`echo $pac_FirstSavedValueOf_ac_link | sed -e 's|>.*$|> $1 2>\&1|g'`" -dnl -AC_LINK_IFELSE([$2],[ - ifelse([$3],[],[:],[$3]) -],[ - ifelse([$4],[],[:],[$4]) -]) -dnl Restore the original ac_link from the stack. -PAC_VAR_POPVAL([ac_link]) -]) -dnl -dnl -dnl -dnl PAC_COMPLINK_IFELSE (input1, input2, [action-if-true], [action-if-false]) -dnl -dnl where input1 and input2 are either AC_LANG_SOURCE or AC_LANG_PROGRAM -dnl enclosed input programs. -dnl -dnl The macro first compiles input1 and uses the object file created -dnl as part of LIBS during linking. This macro is nesting safe. -dnl -AC_DEFUN([PAC_COMPLINK_IFELSE],[ -AC_COMPILE_IFELSE([$1],[ - PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT]) - PAC_VAR_PUSHVAL([LIBS]) - LIBS="pac_conftest.$OBJEXT $pac_FirstSavedValueOf_LIBS" - AC_LINK_IFELSE([$2],[ - ifelse([$3],[],[:],[$3]) - ],[ - ifelse([$4],[],[:],[$4]) - ]) - PAC_VAR_POPVAL([LIBS]) - rm -f pac_conftest.$OBJEXT -],[ - ifelse([$4],[],[:],[$4]) -]) -]) diff --git a/3rd-party/romio321/confdb/aclocal_shl.m4 b/3rd-party/romio321/confdb/aclocal_shl.m4 deleted file mode 100644 index f974bfa2261..00000000000 --- a/3rd-party/romio321/confdb/aclocal_shl.m4 +++ /dev/null @@ -1,500 +0,0 @@ -dnl -dnl Definitions for creating shared libraries -dnl -dnl The purpose of these definitions is to provide common support for -dnl shared libraries, with *or without* the use of the GNU Libtool package. -dnl For many of our important platforms, the Libtool approach is overkill, -dnl and can be particularly painful for developers. -dnl -dnl To use libtool, you need macros that are defined by libtool for libtool -dnl Don't even think about the consequences of this for updating and for -dnl using user-versions of libtool :( -dnl -dnl !!!!!!!!!!!!!!!!!!!!! -dnl libtool requires ac 2.50 !!!!!!!!!!!!!!!!! -dnl -dnl builtin(include,libtool.m4) -dnl -dnl/*D -dnl PAC_ARG_SHAREDLIBS - Add --enable-sharedlibs=kind to configure. -dnl -dnl Synopsis: -dnl PAC_ARG_SHAREDLIBS -dnl -dnl Output effects: -dnl Adds '--enable-sharedlibs=kind' to the command line. If this is enabled, -dnl then based on the value of 'kind', programs are selected for the -dnl names 'CC_SHL' and 'CC_LINK_SHL' that configure will substitute for in -dnl 'Makefile.in's. These symbols are generated by 'simplemake' when -dnl shared library support is selected. -dnl The variable 'C_LINKPATH_SHL' is set to the option to specify the -dnl path to search at runtime for libraries (-rpath in gcc/GNU ld). -dnl This can be turned off with --disable-rpath , which is appropriate -dnl for libraries and for executables that may be installed in different -dnl locations. -dnl The variable 'SHLIB_EXT' is set to the extension used by shared -dnl libraries; under most forms of Unix, this is 'so'; under Mac OS/X, this -dnl is 'dylib', and under Windows (including cygwin), this is 'dll'. -dnl -dnl Supported values of 'kind' include \: -dnl+ gcc - Use gcc to create both shared objects and libraries -dnl. osx-gcc - Use gcc on Mac OS/X to create both shared objects and -dnl libraries -dnl. solaris-cc - Use native Solaris cc to create shared objects and -dnl libraries -dnl. cygwin-gcc - Use gcc on Cygwin to create shared objects and libraries -dnl- none - The same as '--disable-sharedlibs' -dnl -dnl Others will be added as experience dictates. Likely names are -dnl + libtool - For general GNU libtool -dnl - linux-pgcc - For Portland group under Linux -dnl -dnl Notes: -dnl Shared libraries are only partially implemented. Additional symbols -dnl will probably be defined, including symbols to specify how shared library -dnl search paths are specified and how shared library names are set. -dnl D*/ -AC_DEFUN([PAC_ARG_SHAREDLIBS],[ - -AC_ARG_ENABLE(shared, - AC_HELP_STRING([--enable-shared], [Enable shared library builds]),, - enable_shared=no) - -AC_ARG_ENABLE(rpath, - AC_HELP_STRING([--enable-rpath], - [Determine whether the rpath is set when programs are - compiled and linked when shared libraries are built. - The default is yes; use --disable-rpath to turn this - feature off; in that case, shared libraries will be - found according to the rules for your system (e.g., in - LD_LIBRARY_PATH)]),,enable_rpath=yes) - -AC_ARG_ENABLE(sharedlibs, -[ --enable-sharedlibs=kind - Enable shared libraries. kind may be - gcc - Standard gcc and GNU ld options for creating shared libraries - osx-gcc - Special options for gcc needed only on OS/X - solaris-cc - Solaris native (SPARC) compilers for 32 bit systems - cygwin-gcc - Special options for gcc needed only for cygwin - none - same as --disable-sharedlibs - Only gcc, osx-gcc, and solaris-cc are currently supported -],,enable_sharedlibs=default) - -if test "$enable_sharedlibs" = "default" ; then - if test "$enable_shared" = "yes" ; then - AS_CASE([$host], - [*-*-darwin*], [enable_sharedlibs=gcc-osx], - [*-*-cygwin*|*-*-mingw*|*-*-pw32*|*-*-cegcc*], [enable_sharedlibs=cygwin-gcc], - [*-*-sunos*], [enable_sharedlibs=solaris-gcc], - [enable_sharedlibs=gcc]) - else - enable_sharedlibs=none - fi -fi - -# If --enable-sharedlibs is given, but --enable-shared is not, throw -# an error -if test "$enable_sharedlibs" != "no" -a "$enable_sharedlibs" != "none" ; then - if test "$enable_shared" = "no" ; then - AC_MSG_ERROR([--enable-sharedlibs cannot be used without --enable-shared]) - fi -fi - -CC_SHL=true -C_LINK_SHL=true -C_LINKPATH_SHL="" -SHLIB_EXT=unknown -SHLIB_FROM_LO=no -SHLIB_INSTALL='$(INSTALL_PROGRAM)' -case "$enable_sharedlibs" in - no|none) - ;; - gcc-osx|osx-gcc) - AC_MSG_RESULT([Creating shared libraries using GNU for Mac OSX]) - C_LINK_SHL='${CC} -dynamiclib -undefined suppress -single_module -flat_namespace' - CC_SHL='${CC} -fPIC' - # No way in osx to specify the location of the shared libraries at link - # time (see the code in createshlib in mpich/src/util) - # As of 10.5, -Wl,-rpath,dirname should work . The dirname - # must be a single directory, not a colon-separated list (use multiple - # -Wl,-rpath,path for each of the paths in the list). However, os x - # apparently records the library full path, so rpath isn't as useful - # as it is on other systems - C_LINKPATH_SHL="" - SHLIB_EXT="dylib" - enable_sharedlibs="osx-gcc" - ;; - gcc) - AC_MSG_RESULT([Creating shared libraries using GNU]) - # Not quite right yet. See mpich/util/makesharedlib - # Use syntax that works in both Make and the shell - #C_LINK_SHL='${CC} -shared -Wl,-r' - C_LINK_SHL='${CC} -shared' - # For example, include the libname as ${LIBNAME_SHL} - #C_LINK_SHL='${CC} -shared -Wl,-h,' - # May need -fPIC . Test to see which one works. - for sh_arg in "-fPIC" "-fpic" "-KPIC" ; do - PAC_C_CHECK_COMPILER_OPTION($sh_arg,works=yes,works=no) - if test "$works" = "yes" ; then - CC_SHL="${CC} ${sh_arg}" - break - fi - done - if test "$works" != "yes"; then - AC_MSG_ERROR([Cannot build shared libraries with this compiler]) - fi - # This used to have -Wl,-rpath earlier, but that causes problems - # on many systems. - if test $enable_rpath = "yes" ; then - C_LINKPATH_SHL="-Wl,-rpath," - fi - SHLIB_EXT=so - # We need to test that this isn't osx. The following is a - # simple hack - osname=`uname -s` - case $osname in - *Darwin*|*darwin*) - AC_MSG_ERROR([You must specify --enable-sharedlibs=osx-gcc for Mac OS/X]) - ;; - *CYGWIN*|*cygwin*) - AC_MSG_ERROR([You must specify --enable-sharedlibs=cygwin-gcc for Cygwin]) - ;; - *SunOS*) - AC_MSG_ERROR([You must specify --enable-sharedlibs=solaris-gcc for Solaris with gcc]) - ;; - esac - ;; - - cygwin|cygwin-gcc|gcc-cygwin) - AC_MSG_RESULT([Creating shared libraries using GNU under CYGWIN]) - C_LINK_SHL='${CC} -shared' - CC_SHL='${CC}' - # DLL Libraries need to be in the user's path (!) - C_LINKPATH_SHL="" - SHLIB_EXT="dll" - enable_sharedlibs="cygwin-gcc" - ;; - - libtool) - # set TRY_LIBTOOL to yes to experiment with libtool. You are on your - # own - only send fixes, not bug reports. - if test "$TRY_LIBTOOL" != yes ; then - AC_MSG_ERROR([Creating shared libraries using libtool not yet supported]) - else - # Using libtool requires a heavy-weight process to test for - # various stuff that libtool needs. Without this, you'll get a - # bizarre error message about libtool being unable to find - # configure.in or configure.ac (!) - # Libtool expects to see at least enable-shared. - if test "X$enable_shared" = "X" ; then enable_shared=yes ; fi - # Initialize libtool - # This works, but libtool version 2 places the object files - # in a different place, making it harder to integrate with - # our base approach. Disabling for now - dnl LT_PREREQ([2.2.6]) - dnl LT_INIT([disable-shared]) - AC_MSG_ERROR([To use this test verison, edit aclocal_shl.m4]) - # Likely to be - # either CC or CC_SHL is libtool $cc - CC_SHL='${LIBTOOL} --mode=compile ${CC}' - # CC_LINK_SHL includes the final installation path - # For many systems, the link may need to include *all* libraries - # (since many systems don't allow any unsatisfied dependencies) - # We need to give libtool the .lo file, not the .o files - SHLIB_FROM_LO=yes - # We also need to add -no-undefined when the compiler is gcc and - # we are building under cygwin - sysname=`uname -s | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` - isCygwin=no - case "$sysname" in - *CYGWIN*) isCygwin=yes ;; - esac - if test "$isCygwin" = yes ; then - C_LINK_SHL='${LIBTOOL} --mode=link ${CC} -no-undefined -rpath ${libdir}' - else - C_LINK_SHL='${LIBTOOL} --mode=link ${CC} -rpath ${libdir}' - fi - if test $enable_rpath = "yes" ; then - C_LINKPATH_SHL="-rpath " - fi - # We also need a special install process with libtool. Note that this - # will also install the static libraries - SHLIB_INSTALL='$(LIBTOOL) --mode=install $(INSTALL_PROGRAM)' - # Note we may still need to add - #'$(LIBTOOL) --mode=finish $(libdir)' - fi - ;; -dnl -dnl Other, such as solaris-cc - solaris|solaris-cc) - AC_MSG_RESULT([Creating shared libraries using Solaris]) - # pic32 is appropriate for both 32 and 64 bit Solaris - C_LINK_SHL='${CC} -G -xcode=pic32' - CC_SHL='${CC} -xcode=pic32' - if test $enable_rpath = "yes" ; then - C_LINKPATH_SHL="-R" - fi - SHLIB_EXT=so - enable_sharedlibs="solaris-cc" - ;; - - solaris-gcc) - # This is the same as gcc, except for the C_LINKPATH_SHL - AC_MSG_RESULT([Creating shared libraries using Solaris with gcc]) - C_LINK_SHL='${CC} -shared' - CC_SHL='${CC} -fPIC' - if test $enable_rpath = "yes" ; then - C_LINKPATH_SHL="-R" - fi - SHLIB_EXT=so - enable_sharedlibs="solaris-gcc" - ;; - - linuxppc-xlc) - # This is only the beginning of xlc support, thanks to andy@vpac.org - CC_SHL='${CC} -qmkshrobj' - # More recent versions allow multiple args, separated by commas - if test $enable_rpath = "yes" ; then - C_LINKPATH_SHL="-Wl,-rpath," - fi - #C_LINKPATH_SHL="-Wl,-rpath -Wl," - C_LINK_SHL='${CC} -shared -qmkshrobj' - SHLIB_EXT=so - # Note that the full line should be more like - # $CLINKER -shared -qmkshrobj -Wl,-h,$libbase.$slsuffix -o ../shared/$libbase.$slsuffix *.o $OtherLibs - # for the appropriate values of $libbase and $slsuffix - # The -h name sets the name of the object; this is necessary to - # ensure that the dynamic linker can find the proper shared library. - ;; - - *) - AC_MSG_ERROR([Unknown value $enable_sharedlibs for enable-sharedlibs. Values should be gcc or osx-gcc]) - enable_sharedlibs=no - ;; -esac -# Check for the shared-library extension -PAC_CC_SHLIB_EXT -dnl -AC_SUBST(CC_SHL) -AC_SUBST(C_LINK_SHL) -AC_SUBST(C_LINKPATH_SHL) -AC_SUBST(SHLIB_EXT) -AC_SUBST(SHLIB_FROM_LO) -AC_SUBST(SHLIB_INSTALL) -]) - -dnl /*D -dnl PAC_xx_SHAREDLIBS - Get compiler and linker for shared libraries -dnl These routines may be used to determine the compiler and the -dnl linker to be used in creating shared libraries -dnl Rather than set predefined variable names, they set an argument -dnl (if provided) -dnl -dnl Synopsis -dnl PAC_CC_SHAREDLIBS(type,CCvar,CLINKvar) -dnl D*/ -AC_DEFUN([PAC_CC_SHAREDLIBS], -[ -pac_kinds=$1 -ifelse($1,,[ - pac_prog="" - AC_CHECK_PROG(pac_prog,gcc,yes,no) - # If we are gcc but OS X, set the special type - # We need a similar setting for cygwin - if test "$pac_prog" = yes ; then - osname=`uname -s` - case $osname in - *Darwin*|*darwin*) pac_kinds=gcc-osx - ;; - *) pac_kinds=gcc - ;; - esac - fi - pac_prog="" - AC_CHECK_PROG(pac_prog,libtool,yes,no) - if test "$pac_prog" = yes ; then pac_kinds="$pac_kinds libtool" ; fi -]) -for pac_arg in $pac_kinds ; do - case $pac_arg in - gcc) - # For example, include the libname as ${LIBNAME_SHL} - #C_LINK_SHL='${CC} -shared -Wl,-h,' - pac_cc_sharedlibs='gcc -shared' - # Make sure we select the correct fpic option - PAC_C_CHECK_COMPILER_OPTION(-fPIC,fPIC_OK=yes,fPIC_OK=no) - if test "$fPIC_OK" != yes ; then - PAC_C_CHECK_COMPILER_OPTION(-fpic,fpic_ok=yes,fpic_ok=no) - if test "$fpic_ok" != yes ; then - AC_MSG_ERROR([Neither -fpic nor -fPIC accepted by $CC]) - else - pac_cc_sharedlibs="$pac_cc_sharedlibs -fpic" - fi - else - pac_cc_sharedlibs="$pac_cc_sharedlibs -fPIC" - fi - pac_clink_sharedlibs='gcc -shared' - pac_type_sharedlibs=gcc - ;; - gcc-osx|osx-gcc) - pac_clink_sharedlibs='${CC} -dynamiclib -undefined suppress -single_module -flat_namespace' - pac_cc_sharedlibs='${CC} -fPIC' - pac_type_sharedlibs=gcc-osx - ;; - libtool) - AC_CHECK_PROGS(LIBTOOL,libtool,false) - if test "$LIBTOOL" = "false" ; then - AC_MSG_WARN([Could not find libtool]) - else - # Likely to be - # either CC or CC_SHL is libtool $cc - pac_cc_sharedlibs'${LIBTOOL} -mode=compile ${CC}' - pac_clink_sharedlibs='${LIBTOOL} -mode=link ${CC} -rpath ${libdir}' - pac_type_sharedlibs=libtool - fi - ;; - *) - ;; - esac - if test -n "$pac_cc_sharedlibs" ; then break ; fi -done -if test -z "$pac_cc_sharedlibs" ; then pac_cc_sharedlibs=true ; fi -if test -z "$pac_clink_sharedlibs" ; then pac_clink_sharedlibs=true ; fi -ifelse($2,,CC_SHL=$pac_cc_sharedlibs,$2=$pac_cc_sharedlibs) -ifelse($3,,C_LINK_SHL=$pac_clink_sharedlibs,$3=$pac_clink_sharedlibs) -ifelse($4,,SHAREDLIB_TYPE=$pac_type_sharedlibs,$4=$pac_type_sharedlibs) -]) - -dnl This macro ensures that all of the necessary substitutions are -dnl made by any subdirectory configure (which may simply SUBST the -dnl necessary values rather than trying to determine them from scratch) -dnl This is a more robust (and, in the case of libtool, only -dnl managable) method. -AC_DEFUN([PAC_CC_SUBDIR_SHLIBS],[ - AC_SUBST(CC_SHL) - AC_SUBST(C_LINK_SHL) - AC_SUBST(LIBTOOL) - AC_SUBST(ENABLE_SHLIB) - AC_SUBST(SHLIB_EXT) - if test "$ENABLE_SHLIB" = "libtool" ; then - if test -z "$LIBTOOL" ; then - AC_MSG_WARN([libtool selected for shared library support but LIBTOOL is not defined]) - fi - # Libtool needs master_top_builddir - if test "X$master_top_builddir" = "X" ; then - AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.ac sources]) - fi - AC_SUBST(master_top_builddir) - fi -]) - -dnl PAC_CC_SHLIB_EXT - get the extension for shared libraries -dnl Set the variable SHLIB_EXT if it is other than unknown. -AC_DEFUN([PAC_CC_SHLIB_EXT],[ -# Not all systems use .so as the extension for shared libraries (cygwin -# and OSX are two important examples). If we did not set the SHLIB_EXT, -# then try and determine it. We need this to properly implement -# clean steps that look for libfoo.$SHLIB_EXT . -if test "$SHLIB_EXT" = "unknown" ; then - osname=`uname -s` - case $osname in - *Darwin*|*darwin*) SHLIB_EXT=dylib - ;; - *CYGWIN*|*cygwin*) SHLIB_EXT=dll - ;; - *Linux*|*LINUX*|*SunOS*) SHLIB_EXT=so - ;; - esac -fi -]) - -dnl PAC_COMPILER_SHLIB_FLAGS(compiler-var,output-file) -dnl -dnl Uses confdb/config.rpath to determine important linking flags and -dnl information. This is mainly intended to support the compiler wrapper -dnl scripts in MPICH ("mpicc" and friends) which cannot directly use libtool to -dnl handle linking. MPICH's compiler wrappers attempt to link executables with -dnl an rpath by default. The resulting variable assignment statements will be -dnl placed into "output-file", which is then suitable for AC_SUBST_FILE or -dnl sourcing in a shell script (including configure itself). -dnl -dnl This macro assumes that the basic tests associated with "compiler-var" have -dnl been run already, but does not AC_REQUIRE them in order to prevent problems -dnl with "expanded before required" when requiring the AC_PROG_{CC,F77,FC,CXX} -dnl macros. -dnl -dnl Example usage: -dnl -dnl ----8<---- -dnl # compute flags for linking executables against shared libraries when using -dnl # the modern Fortran compiler ($FC). -dnl PAC_COMPILER_SHLIB_FLAGS([FC],[src/env/fc_shlib.conf]) -dnl ----8<---- -AC_DEFUN([PAC_COMPILER_SHLIB_FLAGS],[ -AC_REQUIRE_AUX_FILE([config.rpath]) -AC_REQUIRE([AC_CANONICAL_HOST]) - -# It appears that the libtool dynamic linking strategy on Darwin is this: -# 1. Link all shared libs with "-install_name /full/path/to/libfoo.dylib" -# 2. Don't do anything special when linking programs, since it seems that the -# darwin dynamic linker will always use the "install_name" field from the lib -# that was found at program link-time. (CONFIRMED) This is in opposition to -# the way that Linux does it, where specifying a "-rpath" argument at program -# link-time is important. -# -# There is an alternative darwin strategy for versions -# >= 10.5, see this: http://www.cmake.org/pipermail/cmake/2010-August/038970.html -# (goodell@ 2011-06-17) - -AC_MSG_CHECKING([for shared library (esp. rpath) characteristics of $1]) - -# unfortunately, config.rpath expects the compiler in question is always CC and -# uses several other environment variables as input -PAC_PUSH_FLAG([CC]) -PAC_PUSH_FLAG([GCC]) -PAC_PUSH_FLAG([LD]) -# these two don't currently get overridden, but we push/pop them for safety in -# case they do in the future -PAC_PUSH_FLAG([LDFLAGS]) -PAC_PUSH_FLAG([with_gnu_ld]) - -# set the temporary override values (if any) -m4_case([$1], -[CC], - [:], dnl do nothing special for CC, values are already correct -[F77], - [CC="$$1" - GCC="$G77" - LD="$LD_F77"], -[FC], - [CC="$$1" - GCC="$GCC_FC" - LD="$LD_FC"], -[CXX], - [CC="$$1" - GCC="$GXX" - LD="$LD_CXX"], -[m4_fatal([unknown compiler argument "$1"])]) - -# ensure the values are available to the script -export CC -export GCC -export LDFLAGS -export LD -export with_gnu_ld - -AS_IF([$ac_aux_dir/config.rpath "$host" > $2],[:],[AC_MSG_ERROR([unable to execute $ac_aux_dir/config.rpath])]) - -C_LINKPATH_SHL="" -AC_SUBST([C_LINKPATH_SHL]) - -rm -f conftest.out - -# restore the old values -PAC_POP_FLAG([with_gnu_ld]) -PAC_POP_FLAG([LD]) -PAC_POP_FLAG([LDFLAGS]) -PAC_POP_FLAG([GCC]) -PAC_POP_FLAG([CC]) - -AC_MSG_RESULT([done (results in $2)]) -]) - diff --git a/3rd-party/romio321/confdb/aclocal_shm.m4 b/3rd-party/romio321/confdb/aclocal_shm.m4 deleted file mode 100644 index d2cbaade434..00000000000 --- a/3rd-party/romio321/confdb/aclocal_shm.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl -dnl Definitions for using shared memory -dnl - -dnl/*D -dnl PAC_ARG_SHARED_MEMORY - add --with-shared-memory=kind to configure -dnl -dnl Synopsis: -dnl PAC_ARG_SHARED_MEMORY -dnl -dnl Output effects: -dnl Adds '--with-shared-memory' to the command line. Checks for available -dnl shared memory functionality. -dnl -dnl Supported values of 'kind' include \: -dnl+ auto - default -dnl. mmap - use mmap and munmap -dnl- sysv - use sysv shared memory functions -dnl D*/ -AC_DEFUN([PAC_ARG_SHARED_MEMORY],[ - -# check how to allocate shared memory -AC_ARG_WITH(shared-memory, - AC_HELP_STRING([--with-shared-memory[=auto|sysv|mmap]], [create shared memory using sysv or mmap (default is auto)]),, - with_shared_memory=auto) - -if test "$with_shared_memory" = auto -o "$with_shared_memory" = mmap; then - found_mmap_funcs=yes - AC_CHECK_FUNCS(mmap munmap, , found_mmap_funcs=no) - if test "$found_mmap_funcs" = yes ; then - with_shared_memory=mmap - AC_DEFINE(USE_MMAP_SHM,1,[Define if we have sysv shared memory]) - AC_MSG_NOTICE([Using a memory-mapped file for shared memory]) - elif test "$with_shared_memory" = mmap ; then - AC_MSG_ERROR([cannot support shared memory: mmap() or munmap() not found]) - fi -fi -if test "$with_shared_memory" = auto -o "$with_shared_memory" = sysv; then - found_sysv_shm_funcs=yes - AC_CHECK_FUNCS(shmget shmat shmctl shmdt, , found_sysv_shm_funcs=no) - if test "$found_sysv_shm_funcs" = yes ; then - with_shared_memory=sysv - AC_DEFINE(USE_SYSV_SHM,1,[Define if we have sysv shared memory]) - AC_MSG_NOTICE([Using SYSV shared memory]) - elif test "$with_shared_memory" = sysv ; then - AC_MSG_ERROR([cannot support shared memory: sysv shared memory functions functions not found]) - fi -fi -]) diff --git a/3rd-party/romio321/confdb/aclocal_subcfg.m4 b/3rd-party/romio321/confdb/aclocal_subcfg.m4 deleted file mode 100644 index 53fb78e3d9e..00000000000 --- a/3rd-party/romio321/confdb/aclocal_subcfg.m4 +++ /dev/null @@ -1,261 +0,0 @@ -dnl PAC_RESET_ALL_FLAGS - Reset precious flags to those set by the user -AC_DEFUN([PAC_RESET_ALL_FLAGS],[ - if test "$FROM_MPICH" = "yes" ; then - CFLAGS="$USER_CFLAGS" - CPPFLAGS="$USER_CPPFLAGS" - CXXFLAGS="$USER_CXXFLAGS" - FFLAGS="$USER_FFLAGS" - FCFLAGS="$USER_FCFLAGS" - LDFLAGS="$USER_LDFLAGS" - LIBS="$USER_LIBS" - fi -]) - -dnl PAC_RESET_LINK_FLAGS - Reset precious link flags to those set by the user -AC_DEFUN([PAC_RESET_LINK_FLAGS],[ - if test "$FROM_MPICH" = "yes" ; then - LDFLAGS="$USER_LDFLAGS" - LIBS="$USER_LIBS" - fi -]) - -dnl Sandbox configure with additional arguments -dnl Usage: PAC_CONFIG_SUBDIR_ARGS(subdir,configure-args,action-if-success,action-if-failure) -dnl -dnl The subconfigure argument list is created based on "ac_precious_vars" -dnl instead of explicitly use of well-known Makefile variables, like -dnl CC/CFLAGS/CPPFLAGS..., this generalization is effective as long as -dnl calling configure.ac declares the needed variables to be passed down -dnl to subconfigure as "precious" appropriately. The precious variable -dnl can be created in the following ways: -dnl 1) implicit declaration through use of autoconf macros, like -dnl AC_PROG_CC (declares CC/CFLAGS/CPPFLAGS/LIBS/LDFLAGS), or -dnl AC_PROG_F77 (declares F77/FFLAGS/FLIBS) ... -dnl which are in turns invoked by other subconfigure. -dnl When in doubt, check "ac_precious_var" in the calling configure. -dnl 2) explicit "precious" declaration through AC_ARG_VAR. -dnl Without correct "precious" declaration in the calling configure.ac, -dnl there would be variables not being included in the subconfigure -dnl argument list. -dnl -dnl Note: I suspect this DEFUN body is underquoted in places, but it does not -dnl seem to cause problems in practice yet. [goodell@ 2010-05-18] -AC_DEFUN([PAC_CONFIG_SUBDIR_ARGS],[ - pac_dir="$1" - AC_MSG_NOTICE([===== configuring $1 =====]) - - pac_abs_srcdir=`(cd $srcdir && pwd)` - - if test -f $pac_abs_srcdir/$1/setup ; then - AC_MSG_NOTICE([sourcing $pac_abs_srcdir/$1/setup]) - . $pac_abs_srcdir/$1/setup - fi - - # Adapted for MPICH from the autoconf-2.67 implementation of - # AC_CONFIG_SUBDIRS. Search for "MPICH note:" for relevant commentary and - # local modifications. - - # Remove --cache-file, --srcdir, and --disable-option-checking arguments - # so they do not pile up. Otherwise relative paths (like --srcdir=.. from - # make distcheck) will be incorrect. - pac_sub_configure_args="$2" - pac_prev= - eval "set x $ac_configure_args" - shift - for pac_arg - do - if test -n "$pac_prev"; then - pac_prev= - continue - fi - case $pac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - pac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - pac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - pac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - --disable-option-checking) - ;; - *) - # MPICH note: this is a more robust version of the "precious - # variable" propagation code that was present in the previous - # incarnation of this macro - for pac_pvar in $ac_precious_vars ; do - # check if configure argument token contains the - # precious variable, i.e. "name_of_prec_var=". - if ( echo $pac_arg | grep "^$pac_pvar=" >/dev/null 2>&1 ) ; then - # check if current precious variable is set in env - eval pvar_set=\${$pac_pvar+set} - if test "$pvar_set" = "set" ; then - # Append 'name_of_prec_var=value_of_prec_var' - # to the subconfigure arguments list, where - # value_of_prec_var is fetched from the env. - # this also overrides any value set on the command line - eval pac_pval=\${$pac_pvar} - pac_arg="$pac_pvar=$pac_pval" - break - fi - fi - done - case $pac_arg in - *\'*) pac_arg=`AS_ECHO(["$pac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;; - esac - AS_VAR_APPEND([pac_sub_configure_args], [" '$pac_arg'"]) ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - # MPICH note: see tt#983 for an example of why this is necessary - pac_arg="--prefix=$prefix" - case $pac_arg in - *\'*) pac_arg=`AS_ECHO(["$pac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;; - esac - pac_sub_configure_args="'$pac_arg' $pac_sub_configure_args" - - # Pass --silent - if test "$silent" = yes; then - pac_sub_configure_args="--silent $pac_sub_configure_args" - fi - - # Always prepend --disable-option-checking to silence warnings, since - # different subdirs can have different --enable and --with options. - pac_sub_configure_args="--disable-option-checking $pac_sub_configure_args" - - pac_popdir=`pwd` - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$pac_dir" || continue - - # MPICH note: modified to remove the internal "_AS_*" macro usage, also - # msg is already printed at top -dnl _AS_ECHO_LOG([$pac_msg]) -dnl _AS_ECHO([$pac_msg]) - AS_MKDIR_P(["$pac_dir"]) - # MPICH note: we leave this internal macro reference for now. We can clone - # the macro locally if this turns out to be non-portable across several autoconf - # versions. It sets the following variables: ac_builddir, - # ac_top_builddir_sub, ac_top_build_prefix, ac_srcdir, ac_top_srcdir, - # ac_abs_top_builddir, ac_abs_builddir, ac_abs_top_srcdir, ac_abs_srcdir - _AC_SRCDIRS(["$pac_dir"]) - - cd "$pac_dir" - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - pac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - pac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.ac"; then - # This should be Cygnus configure. - pac_sub_configure=$ac_aux_dir/configure - else - AC_MSG_WARN([no configuration information is in $pac_dir]) - pac_sub_configure= - fi - - # The recursion is here. - if test -n "$pac_sub_configure"; then - # MPICH note: overriding the cache file on purpose to prevent strange - # issues resulting from inter-dir caching -dnl # Make the cache file name correct relative to the subdirectory. -dnl case $cache_file in -dnl [[\\/]]* | ?:[[\\/]]* ) pac_sub_cache_file=$cache_file ;; -dnl *) # Relative name. -dnl pac_sub_cache_file=$ac_top_build_prefix$cache_file ;; -dnl esac - pac_sub_cache_file="/dev/null" - - AC_MSG_NOTICE([running $SHELL $pac_sub_configure $pac_sub_configure_args --cache-file=$pac_sub_cache_file --srcdir=$ac_srcdir]) - # The eval makes quoting arguments work. - # MPICH note: we want to execute the provided actions, not be silent - # or error out if the subconfigure succeeded/failed -dnl eval "\$SHELL \"\$pac_sub_configure\" $pac_sub_configure_args \ -dnl --cache-file=\"\$pac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || -dnl AC_MSG_ERROR([$pac_sub_configure failed for $pac_dir]) - if eval "\$SHELL \"\$pac_sub_configure\" $pac_sub_configure_args \ - --cache-file=\"\$pac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" - then - # restore the current dir for the provided actions - cd "$pac_popdir" - $3 - else - # restore the current dir for the provided actions - cd "$pac_popdir" - $4 - fi - fi - - cd "$pac_popdir" - - AC_MSG_NOTICE([===== done with $1 configure =====]) - - # Check for any localdefs files. These may be created, so we - # look in the local directory first. - if test -f $1/localdefs ; then - AC_MSG_NOTICE([sourcing $1/localdefs]) - . $1/localdefs - elif test -f $pac_abs_srcdir/$1/localdefs ; then - AC_MSG_NOTICE([sourcing $pac_abs_srcdir/$1/localdefs]) - . $pac_abs_srcdir/$1/localdefs - fi -]) - -dnl Sandbox configure -dnl Usage: PAC_CONFIG_SUBDIR(subdir,action-if-success,action-if-failure) -AC_DEFUN([PAC_CONFIG_SUBDIR],[PAC_CONFIG_SUBDIR_ARGS([$1],[],[$2],[$3])]) - -dnl PAC_SUBCFG_EXPAND_SUFFIX_MACRO(MACRO_PREFIX,MACRO_PATH_SUFFIX) -dnl converts the path given by MACRO_PATH_SUFFIX (with '/' chars in it) to one -dnl with '_' chars in it and then appends that to MACRO_PREFIX with '_' in -dnl between. The resulting macro name is then expanded, but with informative -dnl "##" comments before and after the expansion. -dnl -dnl This is intended to be an internal helper macro for the PAC_SUBCFG -dnl implementation. -dnl -dnl XXX DJG FIXME: need to be able to deal with PREREQ macros that potentially -dnl aren't present while having safety for BODY macros when there are -dnl misspellings -AC_DEFUN([PAC_SUBCFG_EXPAND_PATH_SUFFIX_MACRO],[ -dnl convert path separators into '_', the m4_translit is intentionally unquoted -m4_pushdef([subsys_uscore_name],[$1_]m4_translit([$2],[\/],[__]))dnl -m4_ifdef(m4_defn([subsys_uscore_name]),[],[m4_fatal([macro ]m4_defn([subsys_uscore_name])[ is undefined])])dnl -[##] begin expansion of m4_defn([subsys_uscore_name]) -dnl call the computed routine name with the remaining args -m4_indir(m4_defn([subsys_uscore_name]),m4_shift($@)) -dnl there is intentionally no "dnl" on the previous line to reduce the chance of -dnl a "fi## end expansion" bug when the BODY macro doesn't end in a newline -[##] end expansion of m4_defn([subsys_uscore_name]) -]) - -dnl invokes the PAC_SUBCFG_BODY_foo macro for the "foo" subsys, when "foo" is -dnl passed as the only argument to this macro. The first arg may be the '/' -dnl path version instead of having underscores. -AC_DEFUN([PAC_SUBCFG_CONFIGURE_SUBSYS],[PAC_SUBCFG_EXPAND_PATH_SUFFIX_MACRO([PAC_SUBCFG_BODY],[$1])]) - -dnl invokes the PAC_SUBCFG_PREREQ_foo macro for the "foo" subsys, when "foo" is -dnl passed as the only argument to this macro. The first arg may be the '/' -dnl path version instead of having underscores. -AC_DEFUN([PAC_SUBCFG_DO_PREREQ],[PAC_SUBCFG_EXPAND_PATH_SUFFIX_MACRO([PAC_SUBCFG_PREREQ],[$1])]) - -dnl takes no arguments, expands to "foo_bar_baz" when invoked in a file named -dnl "foo/bar/baz/subconfigure.m4" -dnl -dnl This is useful for reducing copy-paste errors when defining PREREQ and BODY -dnl macros. If you tinker with this macro, watch the quoting carefully. -AC_DEFUN([PAC_SUBCFG_AUTO_SUFFIX],[m4_translit(m4_bpatsubst(m4_dquote(__file__),[/[^/]+.m4],[]),[/],[_])]) - diff --git a/3rd-party/romio321/confdb/aclocal_util.m4 b/3rd-party/romio321/confdb/aclocal_util.m4 deleted file mode 100644 index 2648be54303..00000000000 --- a/3rd-party/romio321/confdb/aclocal_util.m4 +++ /dev/null @@ -1,216 +0,0 @@ -dnl Nesting safe macros for saving variables -dnl Usage: PAC_PUSH_FLAG(CFLAGS) -AC_DEFUN([PAC_PUSH_FLAG],[ - if test -z "${pac_save_$1_nesting}" ; then - pac_save_$1_nesting=0 - fi - eval pac_save_$1_${pac_save_$1_nesting}='"$$1"' - pac_save_$1_nesting=`expr ${pac_save_$1_nesting} + 1` -]) - -dnl Usage: PAC_POP_FLAG(CFLAGS) -AC_DEFUN([PAC_POP_FLAG],[ - pac_save_$1_nesting=`expr ${pac_save_$1_nesting} - 1` - eval $1="\$pac_save_$1_${pac_save_$1_nesting}" - eval pac_save_$1_${pac_save_$1_nesting}="" -]) - -dnl Usage: PAC_PUSH_ALL_FLAGS -AC_DEFUN([PAC_PUSH_ALL_FLAGS],[ - PAC_PUSH_FLAG(CFLAGS) - PAC_PUSH_FLAG(CPPFLAGS) - PAC_PUSH_FLAG(CXXFLAGS) - PAC_PUSH_FLAG(FFLAGS) - PAC_PUSH_FLAG(FCFLAGS) - PAC_PUSH_FLAG(LDFLAGS) - PAC_PUSH_FLAG(LIBS) -]) - -dnl Usage: PAC_POP_ALL_FLAGS -AC_DEFUN([PAC_POP_ALL_FLAGS],[ - PAC_POP_FLAG(CFLAGS) - PAC_POP_FLAG(CPPFLAGS) - PAC_POP_FLAG(CXXFLAGS) - PAC_POP_FLAG(FFLAGS) - PAC_POP_FLAG(FCFLAGS) - PAC_POP_FLAG(LDFLAGS) - PAC_POP_FLAG(LIBS) -]) - -dnl PAC_PREFIX_FLAG - Save flag with a prefix -dnl Usage: PAC_PREFIX_FLAG(PREFIX, FLAG) -AC_DEFUN([PAC_PREFIX_FLAG],[ - $1_$2=$$2 - export $1_$2 - AC_SUBST($1_$2) -]) - -dnl PAC_PREFIX_ALL_FLAGS - Save flags with a prefix -dnl Usage: PAC_PREFIX_ALL_FLAGS(PREFIX) -AC_DEFUN([PAC_PREFIX_ALL_FLAGS],[ - PAC_PREFIX_FLAG($1, CFLAGS) - PAC_PREFIX_FLAG($1, CPPFLAGS) - PAC_PREFIX_FLAG($1, CXXFLAGS) - PAC_PREFIX_FLAG($1, FFLAGS) - PAC_PREFIX_FLAG($1, FCFLAGS) - PAC_PREFIX_FLAG($1, LDFLAGS) - PAC_PREFIX_FLAG($1, LIBS) - PAC_PREFIX_FLAG($1, EXTRA_LIBS) -]) - -dnl Usage: PAC_APPEND_FLAG([-02], [CFLAGS]) -dnl appends the given argument to the specified shell variable unless the -dnl argument is already present in the variable -AC_DEFUN([PAC_APPEND_FLAG],[ - AC_REQUIRE([AC_PROG_FGREP]) - AS_IF( - [echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1], - [echo "$2(='$$2') contains '$1', not appending" >&AS_MESSAGE_LOG_FD], - [echo "$2(='$$2') does not contain '$1', appending" >&AS_MESSAGE_LOG_FD - $2="$$2 $1"] - ) -]) - -dnl Usage: PAC_PREPEND_FLAG([-lpthread], [LIBS]) -dnl Prepends the given argument to the specified shell variable unless the -dnl argument is already present in the variable. -dnl -dnl This is typically used for LIBS and similar variables because libraries -dnl should be added in reverse order. -AC_DEFUN([PAC_PREPEND_FLAG],[ - AC_REQUIRE([AC_PROG_FGREP]) - AS_IF( - [echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1], - [echo "$2(='$$2') contains '$1', not prepending" >&AS_MESSAGE_LOG_FD], - [echo "$2(='$$2') does not contain '$1', prepending" >&AS_MESSAGE_LOG_FD - $2="$1 $$2"] - ) -]) - - -dnl PAC_MKDIRS(path) -dnl Create any missing directories in the path -AC_DEFUN([PAC_MKDIRS],[ -# Build any intermediate directories -for dir in $1 ; do - PAC_PUSH_FLAG([IFS]) - IFS="/" - tmp_curdir="" - for tmp_subdir in $dir ; do - tmp_curdir="${tmp_curdir}$tmp_subdir" - if test ! -d "$tmp_curdir" ; then mkdir "$tmp_curdir" ; fi - tmp_curdir="${tmp_curdir}/" - done - PAC_POP_FLAG([IFS]) -done -]) - -# Find something to use for mkdir -p. Eventually, this will have a -# script for backup. As of autoconf-2.63, AC_PROG_MKDIR_P was broken; -# it was checking to see if it recognized the "version" of mkdir and -# was deciding based on that. This should always be a feature test. -AC_DEFUN([PAC_PROG_MKDIR_P],[ -AC_CACHE_CHECK([whether mkdir -p works], -pac_cv_mkdir_p,[ -pac_cv_mkdir_p=no -rm -rf .tmp -if mkdir -p .tmp/.foo 1>/dev/null 2>&1 ; then - if test -d .tmp/.foo ; then - pac_cv_mkdir_p=yes - fi -fi -rm -rf .tmp -]) -if test "$pac_cv_mkdir_p" = "yes" ; then - MKDIR_P="mkdir -p" - export MKDIR_P -else - AC_MSG_WARN([mkdir -p does not work; the install step may fail]) -fi -AC_SUBST(MKDIR_P) -]) - -dnl Test for a clean VPATH directory. Provide this command with the names -dnl of all of the generated files that might cause problems -dnl (Makefiles won't cause problems because there's no VPATH usage for them) -dnl -dnl Synopsis -dnl PAC_VPATH_CHECK([file-names],[directory-names]) -dnl file-names should be files other than config.status and any header (e.g., -dnl fooconf.h) file that should be removed. It is optional -AC_DEFUN([PAC_VPATH_CHECK],[ -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -date >conftest$$ -# If creating a file in the current directory does not show up in the srcdir -# then we're doing a VPATH build (or something is very wrong) -if test ! -s $srcdir/conftest$$ ; then - pac_dirtyfiles="" - pac_dirtydirs="" - pac_header="" - ifdef([AC_LIST_HEADER],[pac_header=AC_LIST_HEADER]) - for file in config.status $pac_header $1 ; do - if test -f $srcdir/$file ; then - pac_dirtyfiles="$pac_dirtyfiles $file" - fi - done - ifelse($2,,,[ - for dir in $2 ; do - if test -d $srcdir/$dir ; then - pac_dirtydirs="$pac_dirtydirs $dir" - fi - done - ]) - - if test -n "$pac_dirtyfiles" -o -n "$pac_dirtydirs" ; then - # Create a nice message about what to remove - rmmsg="" - if test -n "$pac_dirtyfiles" ; then - rmmsg="files $pac_dirtyfiles" - fi - if test -n "$pac_dirtydirs" ; then - if test -n "$rmmsg" ; then - rmmsg="$rmmsg and directories $pac_dirtydirs" - else - rmmsg="directories $pac_dirtydirs" - fi - fi - if test -f $srcdir/Makefile ; then - AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been - configured. Run "make distclean" in $srcdir first and make sure that the - $rmmsg have been removed.]) - else - AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been - configured. Remove the $rmmsg in $srcdir.]) - fi - fi -fi -# This is needed for Mac OSX 10.5 -rm -rf conftest.dSYM -rm -f conftest* -]) - -dnl PAC_CONF_HEX_TO_DEC(value,out_var) -dnl -dnl Converts the given hexadecimal integer constant to an integer constant and -dnl stores the result in the shell variable given by 'out_var'. -dnl -dnl I think that printf like this will be sufficiently portable, but I don't -dnl have any guarantee of it. If not, we can fall back to AS_VAR_ARITH -dnl and/or AC_COMPUTE_INT (the latter will probably be slow) -AC_DEFUN([PAC_CONV_HEX_TO_DEC],[AS_VAR_SET([$2],[`printf "%d" $1`])]) - -dnl PAC_GET_EXENAME(exe_name, out_exe_name) -dnl -dnl Prepends and appends program prefix and suffix as supplied by --program_prefix -dnl and --program-sufix -AC_DEFUN([PAC_GET_EXENAME],[ -$2=$1 -if test "$program_prefix" != "NONE" ; then - $2="${program_prefix}$$2" -fi -if test "$program_suffix" != "NONE" ; then - $2="$$2$program_suffix" -fi -]) diff --git a/3rd-party/romio321/confdb/ax_prefix_config_h.m4 b/3rd-party/romio321/confdb/ax_prefix_config_h.m4 deleted file mode 100644 index 83f8df6f4b7..00000000000 --- a/3rd-party/romio321/confdb/ax_prefix_config_h.m4 +++ /dev/null @@ -1,219 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/ax_prefix_config_h.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] -# -# DESCRIPTION -# -# This is a new variant from ac_prefix_config_ this one will use a -# lowercase-prefix if the config-define was starting with a -# lowercase-char, e.g. "#define const", "#define restrict", or "#define -# off_t", (and this one can live in another directory, e.g. -# testpkg/config.h therefore I decided to move the output-header to be the -# first arg) -# -# takes the usual config.h generated header file; looks for each of the -# generated "#define SOMEDEF" lines, and prefixes the defined name (ie. -# makes it "#define PREFIX_SOMEDEF". The result is written to the output -# config.header file. The PREFIX is converted to uppercase for the -# conversions. -# -# Defaults: -# -# OUTPUT-HEADER = $PACKAGE-config.h -# PREFIX = $PACKAGE -# ORIG-HEADER, from AM_CONFIG_HEADER(config.h) -# -# Your configure.ac script should contain both macros in this order, and -# unlike the earlier variations of this prefix-macro it is okay to place -# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation. -# -# Example: -# -# AC_INIT(config.h.in) # config.h.in as created by "autoheader" -# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE -# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in -# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it.. -# AC_MEMORY_H # makes "#undef NEED_MEMORY_H" -# AC_C_CONST_H # makes "#undef const" -# AC_OUTPUT(Makefile) # creates the "config.h" now -# # and also mylib/_config.h -# -# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the -# default outputfile would have been called simply "testpkg-config.h", but -# even under the name "mylib/_config.h" it contains prefix-defines like -# -# #ifndef TESTPKG_VERSION -# #define TESTPKG_VERSION "0.1.1" -# #endif -# #ifndef TESTPKG_NEED_MEMORY_H -# #define TESTPKG_NEED_MEMORY_H 1 -# #endif -# #ifndef _testpkg_const -# #define _testpkg_const _const -# #endif -# -# and this "mylib/_config.h" can be installed along with other -# header-files, which is most convenient when creating a shared library -# (that has some headers) where some functionality is dependent on the -# OS-features detected at compile-time. No need to invent some -# "mylib-confdefs.h.in" manually. :-) -# -# Note that some AC_DEFINEs that end up in the config.h file are actually -# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T -# say that they "will define inline|const|off_t if the system does not do -# it by itself". You might want to clean up about these - consider an -# extra mylib/conf.h that reads something like: -# -# #include -# #ifndef _testpkg_const -# #define _testpkg_const const -# #endif -# -# and then start using _testpkg_const in the header files. That is also a -# good thing to differentiate whether some library-user has starting to -# take up with a different compiler, so perhaps it could read something -# like this: -# -# #ifdef _MSC_VER -# #include -# #else -# #include -# #endif -# #ifndef _testpkg_const -# #define _testpkg_const const -# #endif -# -# LAST MODIFICATION -# -# 2008-04-12 -# -# COPYLEFT -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2008 Marten Svantesson -# Copyright (c) 2008 Gerald Point -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. - -AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl -AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl -AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl -AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl -AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl -AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl -AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl -AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl -AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl -m4_pushdef([_script],[conftest.prefix])dnl -m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl -_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)` -_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` -_PKG=`echo ifelse($2, , $PACKAGE, $2)` -_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` -_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` -_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'` -if test ".$_INP" = "."; then - for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue - case "$ac_file" in - *.h) _INP=$ac_file ;; - *) - esac - test ".$_INP" != "." && break - done -fi -if test ".$_INP" = "."; then - case "$_OUT" in - */*) _INP=`basename "$_OUT"` - ;; - *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` - ;; - *) _INP=config.h - ;; - esac -fi -if test -z "$_PKG" ; then - AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) -else - if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then - _INP="$srcdir/$_INP" - fi fi - AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) - if test -f $_INP ; then - echo "s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script - echo "s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script - echo "s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script - echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script - echo "@%:@endif/" >>_script - echo "s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script - echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script - echo "@%:@endif/" >> _script - # now executing _script on _DEF input to create _OUT output file - echo "@%:@ifndef $_DEF" >$tmp/pconfig.h - echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h - echo ' ' >>$tmp/pconfig.h - echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h - - sed -f _script $_INP >>$tmp/pconfig.h - echo ' ' >>$tmp/pconfig.h - echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h - echo "@%:@endif" >>$tmp/pconfig.h - if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then - AC_MSG_NOTICE([$_OUT is unchanged]) - else - ac_dir=`AS_DIRNAME(["$_OUT"])` - AS_MKDIR_P(["$ac_dir"]) - rm -f "$_OUT" - mv $tmp/pconfig.h "$_OUT" - fi - cp _script _configs.sed - else - AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) - fi - rm -f conftest.* -fi -m4_popdef([_symbol])dnl -m4_popdef([_script])dnl -AS_VAR_POPDEF([_INP])dnl -AS_VAR_POPDEF([_UPP])dnl -AS_VAR_POPDEF([_LOW])dnl -AS_VAR_POPDEF([_PKG])dnl -AS_VAR_POPDEF([_DEF])dnl -AS_VAR_POPDEF([_OUT])dnl -],[PACKAGE="$PACKAGE"])]) - -dnl implementation note: a bug report (31.5.2005) from Marten Svantesson points -dnl out a problem where `echo "\1"` results in a Control-A. The unix standard -dnl http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html -dnl defines all backslash-sequences to be inherently non-portable asking -dnl for replacement mit printf. Some old systems had problems with that -dnl one either. However, the latest libtool (!) release does export an $ECHO -dnl (and $echo) that does the right thing - just one question is left: what -dnl was the first version to have it? Is it greater 2.58 ? diff --git a/3rd-party/romio321/confdb/ax_tls.m4 b/3rd-party/romio321/confdb/ax_tls.m4 deleted file mode 100644 index 3f6a0ac04f4..00000000000 --- a/3rd-party/romio321/confdb/ax_tls.m4 +++ /dev/null @@ -1,90 +0,0 @@ -# =========================================================================== -# http://www.nongnu.org/autoconf-archive/ax_tls.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_TLS -# -# DESCRIPTION -# -# Provides a test for the compiler support of thread local storage (TLS) -# extensions. Defines TLS if it is found. Currently only knows about GCC -# and MSVC. I think SunPro uses the same as GCC, and Borland apparently -# supports either. -# -# LICENSE -# -# Copyright (c) 2008 Alan Woodland -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -AC_DEFUN([AX_TLS], [ - AC_MSG_CHECKING(for thread local storage specifier) - AC_CACHE_VAL(ac_cv_tls, [ - ax_tls_keywords="__thread __declspec(thread) none" - for ax_tls_keyword in $ax_tls_keywords; do - case $ax_tls_keyword in - none) ac_cv_tls=none ; break ;; - *) - # MPICH modification: This was an AC_TRY_COMPILE before, but - # Darwin with non-standard compilers will accept __thread at - # compile time but fail to link due to an undefined - # "__emutls_get_address" symbol unless -lgcc_eh is added to the - # link line. - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([$ax_tls_keyword int bar = 5;],[++bar;])], - [ac_cv_tls=$ax_tls_keyword], - [ac_cv_tls=none]) - - # MPICH modification: Also test with the extern keyword. - # The intel compiler on Darwin (at least as of 15.0.1) - # seems to break with the above error when the extern - # keyword is specified in shared library builds. - PAC_PUSH_FLAG([LIBS]) - PAC_APPEND_FLAG([-shared],[LIBS]) - if test "$ac_cv_tls" != "none" ; then - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([extern $ax_tls_keyword int bar;],[++bar;])], - [ac_cv_tls=$ax_tls_keyword], - [ac_cv_tls=none]) - fi - PAC_POP_FLAG([LIBS]) - - if test "$ac_cv_tls" != "none" ; then break ; fi - esac - done -]) - - if test "$ac_cv_tls" != "none"; then - # MPICH modification: this was "TLS" before instead of - # "MPICH_TLS_SPECIFIER", but TLS had a reasonably high chance of conflicting - # with a system library. - AC_DEFINE_UNQUOTED([MPICH_TLS_SPECIFIER], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here]) - fi - AC_MSG_RESULT($ac_cv_tls) -]) diff --git a/3rd-party/romio321/configure.ac b/3rd-party/romio321/configure.ac deleted file mode 100644 index 20298739d8a..00000000000 --- a/3rd-party/romio321/configure.ac +++ /dev/null @@ -1,1835 +0,0 @@ -# -*- Mode: shell-script -*- -# build with -# autoconf --localdir=../confdb configure.ac -# (or wherever the confdb is) -# -# irrelevant / unnecessary in an Open MPI environment, but are -# harmless and are left here solely for the sake of ease of future -# patching/importing. -AC_PREREQ([2.63]) - -# Open MPI: Modifications to this file were done on an "let's do the -# minimum possible" basis, not so that we can skip on the work or -# provide any less functionality, but more from a perspective that we -# want to be able to import new versions of ROMIO in as easy a fashion -# as possible. Hence, there are some things in this file that are -# irrelevant / unnecessary in an Open MPI environment, but are -# harmless and are left here solely for the sake of ease of future -# patching/importing. -AC_INIT([ROMIO], - [Open MPI], - [discuss@mpich.org], - [romio], - [http://www.mpich.org/]) - -dnl AC_CONFIG_AUX_DIR(../../../confdb) -dnl Set the directory that contains the required install-sh, config.sub, -dnl and config.guess . Make sure that these are updated (in MPICH, use -dnl the top-level confdb files). This separate directory is used for -dnl the moment to allow ROMIO to be separatedly distributed. -dnl scripts. -AC_CONFIG_AUX_DIR([confdb]) -AC_CONFIG_MACRO_DIR([confdb]) - -AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability-recursive foreign 1.12 silent-rules subdir-objects]) -AM_MAINTAINER_MODE([enable]) - -dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC -PAC_PROG_CC -AM_PROG_CC_C_O - -AM_PROG_AR - -LT_INIT([]) -# Non-verbose make by default -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -# VERSION=1.2.6 -# AC_MSG_RESULT([Configuring ROMIO Version $VERSION]) -CONFIGURE_ARGS="$*" -if test -n "$CONFIGURE_ARGS" ; then - echo "Configuring with args $CONFIGURE_ARGS" -fi - -AC_CONFIG_HEADER(adio/include/romioconf.h) -# Open MPI: modified AH_TOP -AH_TOP([/* - * (C) 2011 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#ifndef ROMIOCONF_H_INCLUDED -#define ROMIOCONF_H_INCLUDED - -#include "romioconf-undefs.h" -]) -AH_BOTTOM([ -/* quash PACKAGE and PACKAGE_* vars, see MPICH top-level configure.ac for - * more info */ -#include "nopackage.h" - -#endif /* !defined(ROMIOCONF_H_INCLUDED) */ -]) - -# Open MPI: this configure script doesn't seem to define these -# anywhere, so just do them manually here because "we know better" -# (i.e., Open MPI can be hard-wired to these values). -AC_DEFINE([HAVE_MPI_OFFSET], [1], [Will always be 1 - OMPI has MPI_OFFSET]) - -# Open MPI: look for top Open MPI directory -AC_MSG_CHECKING([for Open MPI support files]) -if test -f "$srcdir/../../config/opal_mca.m4"; then - - # This is needed for VPATH builds, so that it will -I the - # appropriate include directory (don't know why automake - # doesn't do this # automatically). - - OMPI_TOP_SRCDIR='$(top_srcdir)/../..' - OMPI_TOP_BUILDDIR='$(top_builddir)/../..' - with_mpi="$OMPI_TOP_SRCDIR" - AC_MSG_RESULT([in Open MPI source tree -- good]) - AC_SUBST(OMPI_TOP_SRCDIR) - AC_SUBST(OMPI_TOP_BUILDDIR) -else - AC_MSG_RESULT([not found]) - AC_MSG_WARN([*** Could not find Open MPI support files]) - AC_MSG_WARN([*** Can only build this version of ROMIO in an Open MPI source tree]) - AC_MSG_ERROR([*** Cannot continue]) -fi - -dnl -# Open MPI: disable the f77 and f90 tests, as we provide our own -# MPI interface and use only the C parts of ROMIO -NOF77=1 -NOF90=1 -ARCH="" -arch_IRIX="" -MPI_IMPL="" -MPI_INCLUDE_DIR="" -ROMIO_INCLUDE="" - -# Used by the new build system, should contain zero or more "-Iblah" args for -# inclusion in AM_CPPFLAGS. Should not contain relative paths. This probably -# overlaps with ROMIO_INCLUDE some, but adding a new var is easier than teasing -# apart all of the current usages of that variable and re-testing all of the -# non-MPICH and exotic platform cases. -MPI_H_INCLUDE="" -AC_SUBST([MPI_H_INCLUDE]) - -TEST_LIBNAME="" -FILE_SYSTEM="" - -# Do not set variables to empty that may be communicated from the -# outside environment (e.g., MPI_LIB, MPI_BIN_DIR, LIBNAME) -DEBUG=no -MIPS=0 -BITS=0 - -AC_ARG_VAR([FROM_MPICH],[set to "yes" if building ROMIO inside of MPICH]) -FROM_MPICH=${FROM_MPICH:-no} - -AC_ARG_VAR([FROM_LAM],[set to "yes" if building ROMIO inside of LAM]) -FROM_LAM=${FROM_LAM:-no} -if test "$FROM_LAM" = 1 ; then FROM_LAM=yes ; fi - -AC_ARG_VAR([FROM_OMPI],[set to "yes" if building ROMIO inside of Open MPI]) -FROM_OMPI=${FROM_OMPI:-no} -if test "$FROM_OMPI" = 1 ; then FROM_OMPI=yes ; fi - -AC_ARG_VAR([FROM_OMPI],[set to "yes" if building ROMIO inside of Open MPI]) -FROM_OMPI=${FROM_OMPI:-no} -if test "$FROM_OMPI" = 1 ; then FROM_OMPI=yes ; fi - -CFLAGS=${CFLAGS:-""} -LL="lld" -AR_LOCAL="" -DEFINE_HAVE_MPI_GREQUEST="#undef HAVE_MPI_GREQUEST" -HAVE_MPI_INFO="" -BUILD_MPI_INFO="" -MPI_FINFO1="" -MPI_FINFO2="" -MPI_FINFO3="" -MPI_FINFO4="" -MPI_FARRAY1="" -MPI_FARRAY2="" -MPI_FARRAY3="" -MPI_FARRAY4="" -MPI_FARRAY5="" -MPI_FARRAY6="" -MPI_FARRAY7="" -DEFS="" -ROMIO_LFLAGS="" -ROMIO_TCFLAGS="" -ROMIO_TCPPFLAGS="" -ROMIO_TFFLAGS="" -NOPROFILE=0 -MPIRUN="" -FORTRAN_TEST="" -# Open MPI: This (setting make) is a Bad Thing to do in Automake-based build systems -# MAKE=${MAKE:-"make"} -# foll. needed for f77 test programs -F77GETARG="call getarg(i,str)" -F77IARGC="iargc()" -F77MPIOINC="" -FTESTDEFINE="" -FORTRAN_MPI_OFFSET="" -MPIOF_H_INCLUDED=0 -MPI_OFFSET_KIND1="!" -MPI_OFFSET_KIND2="!" -TEST_CC="" -TEST_F77="" -# -# Error handlers (not used with MPICH2, which provides its own routines) -MPIO_EXTRA_OBJECTS="get_errh.o set_errh.o" -MPIO_EXTRA_TMP_POBJECTS="get_errh.p set_errh.p" -MPIO_EXTRA_REAL_POBJECTS="_get_errh.o _set_errh.o" -# -# Completion routines for MPIO_Requests. MPI Implementations with -# generalized requests do not need these -# ioreq_c2f and ioreq_f2c are not MPIO_Requests; rather, they -MPIO_REQOBJECTS="iotest.o iotestall.o iotestany.o iotestsome.o iowait.o iowaitall.o iowaitany.o iowaitsome.o ioreq_c2f.o ioreq_f2c.o" -MPIO_REQ_TMP_POBJECTS="iotest.p iowait.p iowaitall.p iowaitany.p iotestall.p iotestany.p iowaitsome.p iotestsome.p" -MPIO_REQ_REAL_POBJECTS="_iotest.o _iowait.o _iowaitall.o _iowaitany.o _iotestall.o _iotestany.o _iowaitsome.o _iotestsome.o" -# -known_mpi_impls="mpich_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi open_mpi_mpi" - -dnl An m4 macro for use with m4_foreach_w and friends. You should modify this -dnl list if you want to add a known file system. The list is just whitespace -dnl separated, so you can use newlines and tabs as well. -m4_define([known_filesystems_m4_w], - [nfs ufs pfs pvfs pvfs2 testfs xfs panfs gridftp lustre gpfs zoidfs hfs piofs sfs])dnl -dnl -dnl An m4 macro for use with m4_foreach and friends. Expands to a quoted list of -dnl quoted elements. A bit easier to use without unintended expansion than the -dnl whitespace version. -m4_define([known_filesystems_m4], m4_dquote(m4_map_args_w(m4_defn([known_filesystems_m4_w]),[],[],[,])))dnl -dnl -# a shell var for checking arguments given via --with-file-system=... -known_filesystems="m4_join([ ],known_filesystems_m4)" - -##################################################################### - -# -# Defaults -AC_ARG_ENABLE(aio,[ ---enable-aio - Request use of asynchronous I/O routines (default)], -[ - if test "x$enableval" = "xno" ; then - disable_aio=yes - else - disable_aio=no - fi -], disable_aio=no) -AC_ARG_ENABLE(echo, -[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x) -AC_ARG_ENABLE(f77, -[--enable-f77 - Turn on support for Fortran 77 (default)],,enable_f77=yes) -AC_ARG_ENABLE(f90, -[--enable-f90 - Turn on support for Fortran 90 (default)],,enable_f90=yes) -AC_ARG_ENABLE(weak-symbols, -[--enable-weak-symbols - Turn on support for weak symbols],,enable_weak_symbols=no) -AC_ARG_ENABLE(debug, -[--enable-debug - Build a debugging version],,) -AC_ARG_WITH(file-system,[ ---with-file-system=name - Build with support for the named file systems],,) -AC_ARG_WITH(pvfs2,[ ---with-pvfs2=path - Path to installation of PVFS (version 2)],,) -AC_ARG_WITH(mpi-impl,[ ---with-mpi-impl=name - Specify MPI implementation to build ROMIO for],,) -dnl -AC_ARG_WITH(mpi, [ ---with-mpi=path - Path to instalation of MPI (headers, libs, etc)],,) -dnl -if test "$enable_f77" != "yes" ; then - NOF77=1 -fi -if test "$enable_f90" != "yes" ; then - NOF90=1 -fi -if test "$enable_debug" = "yes" ; then - DEBUG=yes -fi -MPI=$with_mpi -# Open MPI: No! -#if test -n "$with_mpi"; then -# CC=$MPI/bin/mpicc -#fi - -# start with the set of file systems that the user asked for -# FILE_SYSTEM=$with_file_system -FILE_SYSTEM=`echo $with_file_system | sed -e 's/:.*$//'` - -# Check if Make is working -PAC_PROG_MAKE -# -# Check that an arch was set -# If it wasn't set, try to guess using "util/tarch" -# -# Sometimes tarch looses its execute bit (!) -if test -s $srcdir/util/tarch -a ! -x $srcdir/util/tarch ; then - chmod a+x $srcdir/util/tarch -fi -if test -z "$ARCH" -a -x $srcdir/util/tarch ; then - AC_MSG_CHECKING([for architecture]) - ARCH=`$srcdir/util/tarch | sed s/-/_/g` - if test -z "$ARCH" ; then - AC_MSG_RESULT([Unknown!]) - AC_MSG_ERROR([Error: Could not guess target architecture, you must -set an architecture type with the environment variable ARCH]) - fi - eval "arch_$ARCH=1" - AC_MSG_RESULT($ARCH) -fi -# -# check for valid architecture. Use __ so that _ALPHA_ does not match -# LINUX_ALPHA_ -#### WE SHOULD REMOVE THIS SOON -grep __"$ARCH"_ $srcdir/.config_params > /dev/null 2>&1 -if test $? != 0 ; then - AC_MSG_WARN([Unknown architecture $ARCH... proceeding anyway]) -fi -# -# -# Find the home directory if not specified -if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then - ROMIO_HOME_TRIAL=$srcdir -else - # Take advantage of autoconf2 features - if test -n "$ac_confdir" ; then - ROMIO_HOME_TRIAL=$ac_confdir - else - if test -s configure ; then - ROMIO_HOME_TRIAL=`pwd` - else - ac_confdir=`dirname "$0" 2>/dev/null` - if test -n "$ac_confdir" ; then - ROMIO_HOME_TRIAL=$ac_confdir - fi - fi - fi -fi -AC_MSG_RESULT([ROMIO home directory is $ROMIO_HOME_TRIAL]) -ROMIO_HOME=$ROMIO_HOME_TRIAL - -# get a fully qualified pathname for our build directory -top_build_dir=`pwd` -# used in romioinstall -AC_SUBST(top_build_dir) - -# Open MPI: these shouldn't be needed with AM -# -# Create the "autoconf" style directory names... -# Most of these are done for us; add the documentation directories -# -# mandir is the root for the man pages -if test -z "$mandir" ; then mandir='${prefix}/man' ; fi -AC_SUBST(mandir) -if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi -AC_SUBST(docdir) -if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi -AC_SUBST(htmldir) - - -# If we are building within a known MPI implementation, we must avoid the -# tests about an existing implementation -if test "$FROM_MPICH" != no -o "$FROM_LAM" != no -o "$FROM_OMPI" != no ; then - WITHIN_KNOWN_MPI_IMPL=yes -else - WITHIN_KNOWN_MPI_IMPL=no -fi - -# Open MPI: Set the MPI implementation -if test "$FROM_OMPI" = "yes" ; then - MPI_IMPL=open_mpi -fi - -# check for valid MPI implementation -if test -n "$MPI_IMPL" ; then - found=no - for mpi in $known_mpi_impls ; do - if test "${MPI_IMPL}_mpi" = "$mpi" ; then - found=yes - break - fi - done - if test $found = no ; then - AC_MSG_WARN([Unknown MPI implementation $MPI... proceeding anyway]) - fi -fi -# - -if test -n "${with_mpi}" ; then - MPI_INCLUDE_DIR="${with_mpi}"/include - MPI_LIB_DIR="${with_mpi}"/lib -fi - -# check for valid MPI include directory if specified -if test $WITHIN_KNOWN_MPI_IMPL = no ; then - if test -n "$MPI_INCLUDE_DIR"; then - if test ! -f "$MPI_INCLUDE_DIR/mpi.h" ; then - AC_MSG_ERROR([Include file $MPI_INCLUDE_DIR/mpi.h not found]) - fi - else -# assume that mpi.h is in the default path -# set MPI_INCLUDE_DIR to ".", so that it translates to -I. in the -# compile command. Some compilers complain if it's only -I - MPI_INCLUDE_DIR=. - fi -else - MPI_INCLUDE_DIR=. -fi -# -# check for valid MPI library if specified -if test $WITHIN_KNOWN_MPI_IMPL = no ; then - if test -n "$MPI_LIB" ; then - if test ! -f "$MPI_LIB" ; then - AC_MSG_ERROR([MPI library $MPI_LIB not found]) - fi - fi -fi - -# USER_CFLAGS and USER_FFLAGS are used only in test/Makefile.in -if test $DEBUG = "yes"; then - USER_CFLAGS="$CFLAGS -g" - USER_FFLAGS="$FFLAGS -g" -else - USER_CFLAGS="$CFLAGS -O" - USER_FFLAGS="$FFLAGS -O" -fi -# -# Here begin the architecture-specific tests. -# -------------------------------------------------------------------------- -# We must first select the C and Fortran compilers. Because of the -# way that the PROG_CC autoconf macro works (and all of the macros that -# require it, including CHECK_HEADERS), that macro must occur exactly -# once in the configure.ac file, at least as of autoconf 2.57 . -# Unfortunately, this requirement is not enforced. To handle this, -# we first case on the architecture; then use PROG_CC, then case on the -# architecture again for any arch-specific features. We also set the -# C_DEBUG_FLAG and F77_DEBUG_FLAG in case debugging is selected. -# -# For the MPICH and MPICH configures, the compilers will already be -# selected, so most of the compiler-selection code will be bypassed. -# -------------------------------------------------------------------------- -# For historical reasons -if test -z "$FC" ; then - FC=$F77 -fi -# -C_DEBUG_FLAG="-g" -F77_DEBUG_FLAG="-g" - -dnl AC_PROG_{CXX,F77,FC} must come early in configure.ac in order to control -dnl compiler search order and avoid some esoteric autoconf macro expansion -dnl errors -if test "$enable_f77" = "yes" ; then - # suppress default "-g -O2" from AC_PROG_F77 - : ${FFLAGS=""} - AC_PROG_F77([PAC_F77_SEARCH_LIST]) -fi -if test "$enable_f90" = "yes" ; then - # suppress default "-g -O2" from AC_PROG_FC - : ${FCFLAGS=""} - AC_PROG_FC([PAC_FC_SEARCH_LIST]) -fi - -if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then - C_DEBUG_FLAG="-g -O -Wall -Wstrict-prototypes -Wmissing-prototypes" -fi -if test $DEBUG = "yes" ; then - CFLAGS="$CFLAGS $C_DEBUG_FLAG" -# Open MPI: don't add optflags - they'll come from the top-level configure -#else -# CFLAGS="$CFLAGS $C_OPT_FLAG" -fi -# --------------------------------------------------------------------------- -# Here go the rest of the tests -# --------------------------------------------------------------------------- - -AC_CHECK_TYPE(long long) -AC_CHECK_SIZEOF(long long) -if test -z "$MPI_IMPL" ; then - MPI_IMPL=mpich - mpi_mpich=1 -fi -if test $MPI_IMPL = "mpich" ; then - TEST_CC=mpicc - TEST_F77=mpifort -else - TEST_CC="$CC" - TEST_F77="$F77" -fi -# there used to be a ton of arch-specific stuff in here. If some random -# platform really truly needs it, restore it, but that defeats the whole - -PAC_GET_SPECIAL_SYSTEM_INFO - -AC_HAVE_FUNCS(memalign) - -# -# Question: Should ROMIO under MPICH ignore the Fortran tests, since -# MPICH provides all of the Fortran interface routines? -# -if test $NOF77 = 0 ; then - echo "checking Fortran external names" - PAC_GET_FORTNAMES - if test -n "$WDEF" ; then - CFLAGS="$CFLAGS $WDEF" - fi - dnl PAC_PROG_F77_NAME_MANGLE - dnl (need to set the new name format) - rm -f test/mpif.h - if test "$MPI_INCLUDE_DIR" != "." && test $WITHIN_KNOWN_MPI_IMPL = no ; then - if test ! -d test ; then mkdir test ; fi - ln -s $MPI_INCLUDE_DIR/mpif.h test - fi -else - F77=":" -fi -# -# Open MPI: We already do this test top-level -dnl AC_C_INLINE - -AC_TYPE_SIZE_T -AC_TYPE_SSIZE_T -AC_TYPE_OFF_T - -# Header files -# Find the CPP before the header check -AC_PROG_CPP -AC_CHECK_HEADERS([unistd.h fcntl.h malloc.h stddef.h sys/types.h limits.h time.h]) -AC_CHECK_HEADERS(mpix.h,,,[#include ]) -# - -# When compiling ROMIO on Darwin with _POSIX_C_SOURCE defined (such as when -# using --enable-strict in MPICH), sys/types.h does not define u_short and -# friends unless _DARWIN_C_SOURCE is also defined (see compat(5) on a Darwin -# box). This would normally be fine, except sys/stat.h defines struct stat to -# use u_long, so strict compiles fail. One option is to also compile with -# _DARWIN_C_SOURCE, but this disables much of the strictness that is intended -# by _POSIX_C_SOURCE. Instead we just define our own types if they are not -# provided by the system. This isn't quite as safe as typedef'ing the -# replacement types, but it will apply to later configure tests, which is -# important. -AC_CHECK_TYPE([u_char],[],[AC_DEFINE_UNQUOTED([u_char],[unsigned char],[Define to "unsigned char" if sys/types.h does not define.])]) -AC_CHECK_TYPE([u_short],[],[AC_DEFINE_UNQUOTED([u_short],[unsigned short],[Define to "unsigned short" if sys/types.h does not define.])]) -AC_CHECK_TYPE([u_int],[],[AC_DEFINE_UNQUOTED([u_int],[unsigned int],[Define to "unsigned int" if sys/types.h does not define.])]) -AC_CHECK_TYPE([u_long],[],[AC_DEFINE_UNQUOTED([u_long],[unsigned long],[Define to "unsigned long" if sys/types.h does not define.])]) - -# must come _after_ the above checks for u_char/u_short/u_int/u_long -AC_CHECK_HEADERS([sys/attr.h]) - -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(void *) -AC_CACHE_CHECK([for int large enough for pointers], -pac_cv_int_hold_pointer,[ -if test "$ac_cv_sizeof_int" = "0" -o \ - "$ac_cv_sizeof_void_p" = "0" ; then - pac_cv_int_hold_pointer=unknown -elif test "$ac_cv_sizeof_int" -lt "$ac_cv_sizeof_void_p" ; then - pac_cv_int_hold_pointer=no -else - pac_cv_int_hold_pointer=yes -fi -]) -if test "$pac_cv_int_hold_pointer" != yes ; then - AC_DEFINE(INT_LT_POINTER,1,[Define if int smaller than pointer]) - dnl Switch to a conforming name (start with HAVE or USE) - AC_DEFINE(HAVE_INT_LT_POINTER,1,[Define if int smaller than pointer]) -fi - -# LL is the printf-style format name for output of a MPI_Offset. -# We have to match this to the type that we use for MPI_Offset. -AC_CHECK_SIZEOF(long long) -if test "$ac_cv_sizeof_long_long" != 0 ; then - if test "$ac_cv_sizeof_long_long" = "8" ; then - AC_DEFINE(HAVE_LONG_LONG_64,1,[Define if long long is 64 bits]) - MPI_OFFSET_TYPE="long long" - DEFINE_MPI_OFFSET="typedef long long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer*8" - LL="lld" - elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_int" ; then - MPI_OFFSET_TYPE="int" - DEFINE_MPI_OFFSET="typedef int MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - AC_DEFINE(MPI_OFFSET_IS_INT,1,[Define if MPI_Offset is int]) - LL="d" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - else - echo "defining MPI_Offset as long in C and integer in Fortran" - MPI_OFFSET_TYPE="long" - DEFINE_MPI_OFFSET="typedef long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - LL="ld" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" - fi -else - echo "defining MPI_Offset as long in C and integer in Fortran" - MPI_OFFSET_TYPE="long" - DEFINE_MPI_OFFSET="typedef long MPI_Offset;" - FORTRAN_MPI_OFFSET="integer" - LL="ld" - MPI_OFFSET_KIND1="!" - MPI_OFFSET_KIND2="!" -fi - - -# -if test -n "$ac_cv_sizeof_long_long"; then - if test $WITHIN_KNOWN_MPI_IMPL = no ; then - PAC_MPI_LONG_LONG_INT - else - AC_DEFINE(HAVE_MPI_LONG_LONG_INT,1,[Define if supports long long int]) - fi -fi -# -if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then - MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND" - MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$OFFSET_KIND)" - MPI_OFFSET_KIND_VAL=$OFFSET_KIND -else - if test "$FORTRAN_MPI_OFFSET" = "integer*8" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then - PAC_MPI_OFFSET_KIND - fi - # - if test "$FORTRAN_MPI_OFFSET" = "integer" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then - PAC_MPI_OFFSET_KIND_4BYTE - fi -fi -# -# Test that we can use the FORTRAN_MPI_OFFSET type. If the environment -# is a strict Fortran 90/95 or later compiler, the "integer*8" format -# may not work. -if test "$NOF77" = 0 ; then - rm -f conftest* - ac_cv_f77_offset_type_works=no - AC_MSG_CHECKING([that we can use $FORTRAN_MPI_OFFSET to declare MPI_DISPLACMENT_CURRENT]) - cat >conftest.f <>config.log 2>&1 && test -x conftest$EXEEXT ; then - ac_cv_f77_offset_type_works=yes - fi - rm -f conftest* - AC_MSG_RESULT($ac_cv_f77_offset_type_works) - - if test "$ac_cv_f77_offset_type_works" != "yes" -a -n "$MPI_OFFSET_KIND_VAL"; then - AC_MSG_CHECKING([whether we can use KIND with the selected F77 compiler $F77]) - ac_cv_f77_allows_offset_kind=no - rm -f conftest* - cat >conftest.f <>config.log 2>&1 && test -x conftest$EXEEXT ; then - ac_cv_f77_allows_offset_kind=yes - fi - rm -f conftest* - AC_MSG_RESULT($ac_cv_f77_allows_offset_kind) - if test "$ac_cv_f77_allows_offset_kind" ; then - FORTRAN_MPI_OFFSET="integer (kind=$MPI_OFFSET_KIND_VAL)" - else - AC_MSG_WARN([Could not find a way to declare an integer type corresponding to MPI_Offset in Fortran.]) - fi - fi -fi - -# -# check if MPI_Info functions are defined in the MPI implementation -if test $WITHIN_KNOWN_MPI_IMPL = no ; then - PAC_MPI_INFO -else - AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI Info is available]) - HAVE_MPI_INFO="#define HAVE_MPI_INFO" - MPI_FINFO1="!" - MPI_FINFO2="!" - MPI_FINFO3="!" - MPI_FINFO4="!" -fi -# -if test -n "$mpi_sgi"; then -dnl if test -z "$HAVE_MPI_INFO" ; then -dnl PAC_CHECK_MPI_SGI_INFO_NULL # is MPI_INFO_NULL defined in mpi.h? -dnl fi - PAC_TEST_MPI_SGI_type_is_contig - PAC_TEST_MPI_COMBINERS - PAC_TEST_MPI_HAVE_OFFSET_KIND -fi -# -# check if darray and subarray constructors are defined in the MPI -# implementation -if test $WITHIN_KNOWN_MPI_IMPL = no ; then - PAC_MPI_DARRAY_SUBARRAY -fi -if test $FROM_MPICH = yes ; then - dnl Made this a message instead of a warning because the warning is - dnl likely to confuse users. - AC_MSG_RESULT([Overriding Array test for MPICH]) - unset BUILD_MPI_ARRAY - AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,1,[Define if Darray is available]) - HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY" - MPI_FARRAY1="!" - MPI_FARRAY2="!" - MPI_FARRAY3="!" - MPI_FARRAY4="!" - MPI_FARRAY5="!" - MPI_FARRAY6="!" - MPI_FARRAY7="!" -fi - -# Check to see if weak symbols work correctly -if test "$enable_weak_symbols" = "yes" ; then - # Turn off weak symbols if they aren't available - PAC_PROG_C_WEAK_SYMBOLS(,enable_weak_symbols=no) -fi -if test "$enable_weak_symbols" = "yes" ; then - AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define if weak symbols should be used]) - # Check for the ability to support multiple weak symbols - if test "$pac_cv_prog_c_weak_symbols" = "pragma weak" ; then - PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS(AC_DEFINE(HAVE_MULTIPLE_PRAGMA_WEAK,1,[Define if multiple weak symbols may be defined])) - fi -fi - -if test "$enable_weak_symbols" = "yes" ; then - AC_DEFINE(HAVE_WEAK_SYMBOLS,1,[Define if weak symbols available]) - HAVE_WEAK_SYMBOLS=1 -else - HAVE_WEAK_SYMBOLS=0 -fi -AC_SUBST(HAVE_WEAK_SYMBOLS) - -AM_CONDITIONAL([BUILD_ROMIO_EMBEDDED],[test "$WITHIN_KNOWN_MPI_IMPL" = "yes" ]) -# FIXME need to get this right for non-MPICH builds -AM_CONDITIONAL([BUILD_MPIO_REQUEST],[false]) -# FIXME need to get this right for non-MPICH builds -AM_CONDITIONAL([BUILD_MPIO_ERRHAN],[false]) - -# if we don't have weak symbol support, we must build a separate convenience -# library in order to provide the "PMPI_" symbols -# Open MPI: Disable the profile library -#AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0"]) -AM_CONDITIONAL([BUILD_PROFILING_LIB],[false]) - -# weird: we have conflated "buid ROMIO's versions of the fortran bindings" and -# "build ROMIO"s fortran I/O tests". Of course the common situaiton is that we -# are building as part of MPICH, which builds its own fortran bindings, but we -# still want tests built -AM_CONDITIONAL([BUILD_F77_BINDINGS],[test "x$NOF77" != "x1" && test "x$FROM_MPICH" != "xyes"]) - -AM_CONDITIONAL([BUILD_F77_TESTS],[test "x$NOF77" != "x1"]) - -# -# Check whether the MPI Offset type is compatible with struct flock -AC_MSG_CHECKING([whether struct flock compatible with MPI_Offset]) -AC_TRY_COMPILE([#include ], -[struct flock l; - $MPI_OFFSET_TYPE a=1; - l.l_start = a; - l.l_len = a; -],pac_cv_struct_flock_and_mpi_offset=yes,pac_cv_struct_flock_and_mpi_offset=no) -AC_MSG_RESULT($pac_cv_struct_flock_and_mpi_offset) -# FIXME: We should look for struct flock64 and the F_SETLK64/F_GETLK64 -# ADIOI_Set_lock could use these instead. -if test "$pac_cv_struct_flock_and_mpi_offset" = no ; then - AC_MSG_CHECKING([whether struct flock compatible with int]) - AC_TRY_COMPILE([#include ], -[struct flock l; - int a=1; - l.l_start = a; - l.l_len = a; -],pac_cv_struct_flock_and_int=yes,pac_cv_struct_flock_and_int=no) - AC_MSG_RESULT($pac_cv_struct_flock_and_int) - if test "$pac_cv_struct_flock_and_int" = yes ; then - AC_DEFINE(NEEDS_INT_CAST_WITH_FLOCK,1,[Define if l_start and l_len data should be cast as int]) - fi - # FIXME. Solaris header files define off_t as a UNION if 64bit file - # sizes are selected. Gah! -fi - -# -# if FILE_SYSTEM is not set above, use ufs and nfs as default -# -if test -z "$FILE_SYSTEM" ; then - FILE_SYSTEM="ufs nfs" -fi - -# no matter what, always build testfs -FILE_SYSTEM="testfs $FILE_SYSTEM" - -# check for valid file system -if test -n "$FILE_SYSTEM" ; then - # if multiple filesystems are passed in, they are '+'-delimited - # we could set the IFS to tokenize FILE_SYSTEM, but the FILE_SYSTEM env var - # is used in multiple places in the build system: get rid of the '+'s so we - # can use the 'for x in $FILE_SYSTEM ...' idiom - FILE_SYSTEM=`echo $FILE_SYSTEM|sed -e 's/\+/ /g'` - for x in $FILE_SYSTEM - do - found=no - # We could also do test -d "ad_$y" to test for known file systems - # based on having access to the adio code. Then adding a file - # system would not require changing configure to change known_filesystems - for y in $known_filesystems ; do - if test $x = $y ; then - found=yes - eval "file_system_`echo $x`=1" - break - fi - done - if test "$found" = "no" ; then - AC_MSG_WARN([Unknown file system $x... proceeding anyway]) - fi - done -fi - -############################################# -# This PVFS2 logic is special because it's hard to get it right if it comes -# before the known_filesystems check loop above. So we handle it down here, -# after the loop but before the AM_CONDITIONAL m4 loop. -############################################# -# -# An attempt to "do the right thing" with as little help from the end-user as -# possible: -# - if 'with-pvfs2' given, use that to find pvfs2-config. complain if we -# cannot find it, as this is probably what the user would expect -# - if we can find 'pvfs2-config' in our path, we can use it to set CFLAGS, -# LIBS, and LDFLAGS accordingly -# - as a fallback, use CFLAGS, LIBS, and LDFLAGS passed in by the user -# - don't do any of this if --with-file-system was given and did not include -# 'pvfs2': i.e. don't surprise the user with pvfs support. - -AC_PATH_PROG(PVFS2_CONFIG, pvfs2-config, notfound, [${with_pvfs2}/bin:$PATH]) -if test $PVFS2_CONFIG != "notfound" ; then - if test -n "${with_pvfs2}" -o -n "${file_system_pvfs2}" ; then - # the user either told us where pvfs is or asked for it in - # --with-file-system (or both) - CFLAGS="$CFLAGS $( $PVFS2_CONFIG --cflags)" - LIBS="$LIBS $( $PVFS2_CONFIG --libs)" - FILE_SYSTEM="pvfs2 $FILE_SYSTEM" - file_system_pvfs2=1 - fi -fi - -if test "$PVFS2_CONFIG" = "notfound" -a -n "$with_pvfs2" ; then - AC_MSG_ERROR([pvfs2-config not found in $with_pvfs2]) -fi -############################################# - - -# Setup an AM_CONDITIONAL named BUILD_AD_FOO for use in each adio's Makefile.mk. -# This must come *after* the condition becomes valid, in this case after all -# $file_system_foo variables have been set. -# -# If you fiddle with this, please watch the m4 quoting carefully. m4_foreach -# expands any macros in the "list" argument exactly once. The defn bits ensure -# that any macro names in "fs"'s value will not be expanded, such as if someone -# is daft enough to "m4_define([ufs],[some crazy value])". -m4_foreach([fs],[known_filesystems_m4],[ -AM_CONDITIONAL([BUILD_AD_]m4_toupper(defn([fs])),[test x$file_system_]defn([fs])[ = x1]) -]) - - -# -# Print list of configured file systems -# -# TODO: REMOVE BAD ONES FROM THE LIST SOMEHOW? -# -AC_MSG_CHECKING([configured file systems]) -AC_MSG_RESULT([$FILE_SYSTEM]) - - -if test -n "$file_system_nfs" ; then - AC_DEFINE(ROMIO_NFS,1,[Define for ROMIO with NFS]) - AC_MSG_WARN([File locks may not work with NFS. See the Installation and -users manual for instructions on testing and if necessary fixing this]) -fi - -if test -n "$file_system_panfs"; then - # TODO: are there ever any installations with the panfs SDK somewhere else? - CPPFLAGS="${CPPFLAGS} -I/opt/panfs/include" - AC_CHECK_HEADER(pan_fs_client_cw_mode.h, - AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS]), - AC_MSG_ERROR([PANFS support requested but cannot find pan_fs_client_cw_mode.h header file]) - ) - AC_CHECK_TYPES([pan_fs_client_raidn_encoding_t], , , - [[#include ]]) -fi -AM_CONDITIONAL([BUILD_PANFS_OPEN6], [test "X$ac_cv_type_pan_fs_client_raidn_encoding_t" = "Xyes"]) - -if test -n "$file_system_ufs"; then - AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS]) -fi - -changequote(<<,>>) -file_system_args=`echo $with_file_system | sed -e 's/^[^:]*//' -e 's/^://'` -changequote([,]) - -if test -n "$file_system_gpfs"; then - AC_DEFINE(ROMIO_GPFS,1,[Define for ROMIO with GPFS]) -fi - -AM_CONDITIONAL([BUILD_AD_BG],[false]) -AM_CONDITIONAL([BUILD_AD_PE],[false]) -if test "$file_system_args" = "BGQ" -a -n "$file_system_gpfs"; then - AC_DEFINE(BGQPLATFORM,1,BGQ platform) - AM_CONDITIONAL([BUILD_AD_BG],[true]) - dnl what if anything can make Blue Gene support aio? - disable_aio=yes -fi -if test "$file_system_args" = "PE" -a -n "$file_system_gpfs"; then - AC_DEFINE(PEPLATFORM,1,PE platform) - AM_CONDITIONAL([BUILD_AD_PE],[true]) -fi - -# echo "with_file_system is :"$with_file_system": file_system_args is :"$file_system_args": FILE_SYSTEM is :"$FILE_SYSTEM":" - -if test -n "$file_system_hfs"; then - AC_DEFINE(ROMIO_HFS,1,[Define for ROMIO with HFS]) -fi -if test -n "$file_system_sfs"; then - AC_DEFINE(ROMIO_SFS,1,[Define for ROMIO with SFS]) -fi - -if test -n "$file_system_pfs"; then - AC_DEFINE(ROMIO_PFS,1,[Define for ROMIO with PFS]) -fi - -if test -n "$file_system_testfs"; then - AC_DEFINE(ROMIO_TESTFS,1,[Define for ROMIO with TESTFS]) -fi -# -# Verify presence of lustre/lustre_user.h -# -if test -n "$file_system_lustre"; then - AC_CHECK_HEADERS(lustre/lustre_user.h, - AC_DEFINE(ROMIO_LUSTRE,1,[Define for ROMIO with LUSTRE]), - AC_MSG_ERROR([LUSTRE support requested but cannot find lustre/lustre_user.h header file]) - ) -fi - -if test -n "$file_system_xfs"; then - AC_DEFINE(ROMIO_XFS,1,[Define for ROMIO with XFS]) - # Check for memalign value - AC_CACHE_CHECK([for memory alignment needed for direct I/O], - pac_cv_memalignval, - [ - rm -f confmemalignval - rm -f /tmp/romio_tmp.bin - AC_TRY_RUN([ -#include -#include -#include -#include -int main(int argc, char **argv) { - struct dioattr st; - int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644); - FILE *f=fopen("confmemalignval","w"); - if (fd == -1) exit(1); - if (!f) exit(1); - fcntl(fd, F_DIOINFO, &st); - fprintf( f, "%u\n", st.d_mem); - exit(0); - } - ], - pac_cv_memalignval=`cat confmemalignval`, - pac_cv_memalignval="unknown",pac_cv_memalignval="unknown" - ) - rm -f confmemalignval - rm -f /tmp/romio_tmp.bin - ]) - if test -n "$pac_cv_memalignval" -a "$pac_cv_memalignval" != 0 -a \ - "$pac_cv_memalignval" != "unknown" ; then - CFLAGS="$CFLAGS -DXFS_MEMALIGN=$pac_cv_memalignval" - else - AC_MSG_RESULT(assuming 128 for memory alignment) - CFLAGS="$CFLAGS -DXFS_MEMALIGN=128" - fi -fi - -# -# Verify presence of pvfs.h, issue with int64 -# -if test -n "$file_system_pvfs"; then - CPPFLAGS="$CPPFLAGS $CFLAGS" - AC_CHECK_HEADERS(pvfs.h, - AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS]), - AC_MSG_ERROR([PVFS support requested but cannot find pvfs.h header file]) - ) - # Check for missing int64_t (intel version 8 compiler and -no-gcc - # selected) - AC_MSG_CHECKING([that pvfs.h can be compiled]) - AC_TRY_COMPILE([ -#include - ],[ - ],pvfs_header_ok=yes,pvfs_header_ok=no - ) - AC_MSG_RESULT($pvfs_header_ok) - if test "$pvfs_header_ok" = no -a "$ac_cv_sizeof_long_long" = 8 ; then - AC_MSG_CHECKING([if pvfs.h can be compiled if we define int64_t]) - # Try again, but with int64_t - AC_TRY_COMPILE([ - typedef long long int int64_t; -#include - ],[ - ], - pvfs_header_ok="yes with int64 definition" - ) - AC_MSG_RESULT($pvfs_header_ok) - fi - if test "$pvfs_header_ok" = "yes with int64 definition" ; then - AC_DEFINE(ROMIO_PVFS_NEEDS_INT64_DEFINITION,1,[Define if int64_t must be defined for PVFS]) - fi - if test "$pvfs_header_ok" != "no" ; then - AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS]) - AC_DEFINE(HAVE_PVFS_SUPER_MAGIC, 1, [Define if PVFS_SUPER_MAGIC defined.]) - else - AC_MSG_WARN(missing or broken pvfs.h header file; disabling ROMIO PVFS support) - fi -fi - - - -if test -n "$file_system_zoidfs"; then - AC_CHECK_HEADERS(zoidfs.h, - AC_DEFINE(ROMIO_ZOIDFS,1,[Define for ROMIO with ZoidFD]), - AC_MSG_ERROR([ZoidFS support requested but cannot find zoidfs.h header file]) - ) -fi - -# -# Verify presence of pvfs2.h -# -if test -n "$file_system_pvfs2"; then - CPPFLAGS="$CPPFLAGS $CFLAGS" - AC_CHECK_HEADERS(pvfs2.h, - AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS2]) - AC_DEFINE(HAVE_PVFS2_SUPER_MAGIC, 1, [Define if PVFS2_SUPER_MAGIC defined.]), - AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file]) - ) -fi - -# layout change after pvfs-2.6.3: -if test -n "$file_system_pvfs2"; then - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([ -#include -#include "pvfs2.h" - int main(int argc, char **argv) { - PVFS_object_ref ref; - PVFS_sys_attr attr; - PVFS_sys_create(NULL, ref, attr, NULL, NULL, NULL, NULL); - return 0; } - ])], - , AC_DEFINE(HAVE_PVFS2_CREATE_WITHOUT_LAYOUT, 1, - [Define if PVFS_sys_create does not have layout parameter]) - ) -fi - - -if test -n "$file_system_gridftp"; then - AC_DEFINE(ROMIO_GRIDFTP, 1, [Define for ROMIO with gridftp]) -fi - -AS_IF([test -n "$file_system_gpfs"], - [SYSDEP_INC=-I${prefix}/include], [SYSDEP_INC=]) - -AS_IF([test -n "$file_system_gpfs"], - AC_CHECK_HEADERS([gpfs.h gpfs_fcntl.h]) - AS_IF([test "$ac_cv_header_gpfs_h" = "yes" -o "$ac_cv_header_gpfs_fcntl_h" = "yes"], [ - AC_SEARCH_LIBS([gpfs_fcntl], [gpfs], [], - [AC_MSG_ERROR([Library containing gpfs_fcntl symbols not found])]) - ]) - ) -# Check for presence and characteristics of async. I/O calls if -# not disabled. - -# Some systems need pthreads to get AIO to work. However, we don't want -# to add pthreads just because it is there, as that can cause problems -# with some implementations of pthreads and compilers (e.g., gcc version 3 -# would fail if there was an int a[100000] on the stack if the application -# was *linked* with pthreads, but would succeed if the application was -# *not linked* with pthreads. -# -if test "x$disable_aio" = "xno" ; then - AC_SEARCH_LIBS(aio_write,aio rt,aio_write_found=yes,aio_write_found=no) - if test "$aio_write_found" = no ; then - # If not found, try finding pthread_create first, and if - # found, try the test again. - AC_SEARCH_LIBS(pthread_create,pthread,foundPTHREAD=yes,foundPTHREAD=no) - if test "$foundPTHREAD" = yes ; then - AC_SEARCH_LIBS(aio_write,aio rt,aio_write_found=yes,aio_write_found=no) - fi - fi -fi - -if test "x$disable_aio" = "xno" -a -n "$aio_write_found" ; then - AC_CHECK_HEADERS([signal.h aio.h sys/aio.h] ) - if test "$ac_cv_header_aio_h" = "no" -a "$ac_cv_header_sys_aio_h" = "no" ; then - disable_aio=yes - fi -fi - -if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" -o "x$disable_aio" = "xno"; then - - # Check that aio is available (many systems appear to have aio - # either installed improperly or turned off). - # The test is the following: if not cross compiling, try to run a - # program that includes a *reference* to aio_write but does not call it - # If the libraries are not set up correctly, then this will fail. - - AC_MSG_CHECKING([whether aio routines can be used]) - # Include aio.h and the aiocb struct (since we'll need these to - # actually use the aio_write interface). Note that this will - # fail for some pre-POSIX implementations of the aio interface - # (an old IBM interface needs an fd argument as well) - AC_TRY_RUN([ -#include -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - int main(int argc, char **argv) - { - struct aiocb *aiocbp; - if (argc > 10) aio_write(aiocbp); - return 0; - } - ], - aio_runs=yes - AC_MSG_RESULT(yes), - aio_runs=no - AC_MSG_RESULT(no), - aio_runs=no - AC_MSG_RESULT(no: aio routines disabled when cross compiling) - ) - if test "$aio_runs" != "no" ; then - AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work) - fi - - # now about that old IBM interface... - # modern AIO interfaces have the file descriptor in the aiocb structure, - # and will set ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES. Old IBM - # implementations pass the file descriptor as an argument to aio_write and - # aio_read. AIO still works on these platforms, but we have to test with - # two-argument aio_write to avoid a false negative. no need to worry about - # the two-argument vs. one-argument aio_write and aio_read: ROMIO already - # uses ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES to call aio_write and - # aio_read correctly - - AC_MSG_CHECKING([for obsolete two-argument aio_write]) - AC_TRY_RUN([ -#include -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - int main(int argc, char **argv) - { - int fd; - struct aiocb *aiocbp; - if (argc > 10) aio_write(fd, aiocbp); - return 0; - } - ], - aio_two_arg_write=yes - AC_MSG_RESULT(yes), - aio_two_arg_write=no - AC_MSG_RESULT(no), - aio_two_arg_write=no - AC_MSG_RESULT(no: cannot test when cross-compiling) - ) - - if test "$aio_two_arg_write" != "no" -a "$aio_runs" != "yes" ; then - AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work) - AC_DEFINE(ROMIO_HAVE_AIO_CALLS_NEED_FILEDES, 1, Define if AIO calls need file descriptor) - fi - - AC_MSG_CHECKING([for obsolete two-argument aio_suspend]) - AC_TRY_RUN([ -#include -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_AIO_H -#include -#endif -#ifdef HAVE_SYS_AIO_H -#include -#endif - int main(int argc, char **argv) - { - struct aiocb *aiocbp; - if (argc > 10) aio_suspend(1, &aiocbp); - return 0; - } - ], - aio_two_arg_suspend=yes - AC_MSG_RESULT(yes), - aio_two_arg_suspend=no - AC_MSG_RESULT(no), - aio_two_arg_suspend=no - AC_MSG_RESULT(no: cannot test when cross compiling) - ) - - if test "$aio_two_arg_suspend" != "no" -a "$aio_runs" != "yes" ; then - AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments) - fi - - AC_CHECK_MEMBERS( - [struct aiocb.aio_fildes, - struct aiocb.aio_whence, - struct aiocb.aio_handle, - struct aiocb.aio_reqprio, - struct aiocb.aio_sigevent], - [], - [], - [[#ifdef HAVE_AIO_H - #include - #endif - #ifdef HAVE_SYS_AIO_H - #include - #endif] ] ) -fi - -# the aio-lite package provides an aio facility in case system aio library is -# buggy or does not perform well. for example, one fortran test does not pass -# its non-blocking collective I/O test -# See http://trac.mpich.org/projects/mpich/ticket/2201 for one such failure. - -AC_ARG_WITH([aio-lite], - [AS_HELP_STRING([--with-aio-lite], - [use alternate external aio implementation])], - [with_aiolite=yes], - []) -AS_IF([test "x$with_aiolite" == xyes], - AC_CHECK_LIB([aio-lite], [lio_listio], - [], [], [-lpthread] - ) - AC_CHECK_HEADERS([aio-lite.h]) - ) -# End of aio-related tests - -# Linux aio library seems to have problems when they are used in our NBC I/O -# implementation. We let the code know when the host OS is Linux so that the -# NBC I/O implementation uses blocking I/O operations. -# See http://trac.mpich.org/projects/mpich/ticket/2201. - -# compute canonical system types -AC_CANONICAL_HOST -AS_CASE([$host_os], - [linux*], AC_DEFINE(ROMIO_RUN_ON_LINUX,1,[Define if run on Linux])) -# End of OS check - -# -# Check for statfs (many) and specifically f_fstypename field (BSD) -# -AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h sys/statvfs.h) -AC_CHECK_FUNCS([statfs]) -AC_MSG_CHECKING([whether struct statfs properly defined]) -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_VFS_H -#include -#endif -#ifdef HAVE_SYS_STATVFS_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif - ],[ - struct statfs f; - ], - pac_cv_have_statfs=yes,pac_cv_have_statfs=no -) -AC_MSG_RESULT($pac_cv_have_statfs) -# At this point, we could check for whether defining -# __SWORD_TYPE as sizet_t or int/long (size of pointer) -# would help. FIXME - -if test "$pac_cv_have_statfs" = yes ; then - AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled]) -fi - -AC_MSG_CHECKING([for f_fstypename member of statfs structure]) -AC_TRY_COMPILE([ -#include -#include -#include - ],[ - struct statfs f; - memset(&f, 0, sizeof(f)); - strncmp("nfs", f.f_fstypename, 3); - ], - pac_cv_have_statfs_f_fstypename=yes, - pac_cv_have_statfs_f_fstypename=no -) -AC_MSG_RESULT($pac_cv_have_statfs_f_fstypename) -if test $pac_cv_have_statfs_f_fstypename = yes ; then - AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME, 1,[Define if statfs has f_fstypename]) -fi - -# -# Check for stat and st_fstype field (NEC SX4) -# -AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h) -AC_CHECK_FUNCS(stat, - AC_DEFINE(HAVE_STAT, 1, Define if stat function is present) - AC_MSG_CHECKING([for st_fstype member of stat structure]) - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - ],[ - struct stat s; - - s.st_fstype = NULL; - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE, 1, Define if struct stat has a st_fstype member), - AC_MSG_RESULT(no) - ) -) - -# -# Check for statvfs and f_basetype field (Solaris, Irix, AIX, etc.) -# -AC_CHECK_HEADERS(sys/types.h sys/statvfs.h sys/vfs.h) -AC_CHECK_FUNCS(statvfs, - AC_DEFINE(HAVE_STATVFS, 1, Define if statvfs function is present) - AC_MSG_CHECKING([for f_basetype member of statvfs structure]) - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_VFS_H -#include -#endif -#ifdef HAVE_SYS_STATVFS_H -#include -#endif - ], [[ - struct statvfs foo; - - foo.f_basetype[0] = 'a'; - ]], - AC_MSG_RESULT(yes) - AC_DEFINE(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE, 1, defined if struct statvfs has a f_basetype member), - AC_MSG_RESULT(no) - ) -) - -AC_CHECK_TYPE([blksize_t],[],[AC_DEFINE_UNQUOTED([blksize_t],[__blksize_t],[Provide blksize_t if not available]) ], [[ - #ifdef HAVE_SYS_TYPES_H - #include - #endif - #ifdef HAVE_SYS_STAT_H - #include - #endif - #ifdef HAVE_UNISTD_H - #include - #endif]] ) - -# -# in 2004, solairs defined off_t as a union. Today (2016) that is not the case -# and we can simplify this check -# - -AC_SYS_LARGEFILE() - -# pread and pwrite are useful to ROMIO: if implemented well, they help us avoid -# an extra system call. But --enable-strict or CFLAGS="--std=c99" does not -# expose this feature. If we define XOPEN_SOURCE in ROMIO, we cause headaches -# for some versions of lustre, quota.h, and caddr_t. see if we need to provide -# our own pread/pwrite - -AC_CHECK_DECLS([pwrite]) - - -#################################################################### -# We're about to mess with CC etc. No more feature tests past here, -# because we may set CC to something that does not yet exist! -#################################################################### - -if test -n "$mpi_mpich"; then - if test -z "$arch_SX4" ; then - MPIOF_H_INCLUDED=1 - fi - if test "$FROM_MPICH" = no; then - AC_DEFINE(NEEDS_MPI_TEST,1,[Define if mpi_test needed]) - AC_DEFINE(MPICH,1,[Define if using MPICH]) - fi -fi - -if test -n "$mpi_sgi"; then - AC_DEFINE(MPISGI,1,[Define if SGI MPI]) -fi - -if test -n "$mpi_lam"; then - AC_DEFINE(MPILAM,1,[Define if using LAM/MPI]) -fi - -if test -n "$mpi_hp"; then - AC_DEFINE(MPIHP,1,[Define if using HP MPI]) - if test "$NOF77" = 0; then - PAC_CHECK_MPIOF_H - fi -fi -# -AC_CHECK_FUNCS(strerror) -if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fi -AC_SUBST(srcdir) - -# preserve these values across a config.status --recheck -AC_ARG_VAR([master_top_srcdir],[set by the MPICH configure to indicate the MPICH source root]) -AC_ARG_VAR([master_top_builddir],[set by the MPICH configure to indicate the MPICH build root]) - -# The master_top_srcdir is the location of the source for the building -# package. This is used only as part of the MPICH build, including -# the documentation targets mandoc, htmldoc, and latexdoc -if test -z "$master_top_srcdir" ; then - if test "$FROM_MPICH" = yes ; then - AC_MSG_WARN([Could not determine master_top_srcdir]) - fi -fi -# -# Get the master builddir (which may be imported from above) -if test -z "$master_top_builddir" ; then - if test "$FROM_MPICH" = yes ; then - # this variable is essential to proper build operation - AC_MSG_ERROR([Could not determine master_top_srcdir]) - fi - master_top_builddir=`pwd` -fi -# Make sure the alternate spelling is used until we clean up all of the code -master_topbuild_dir=$master_top_builddir -export master_topbuild_dir -AC_SUBST(master_topbuild_dir) - -# The following definitions are needed within adio/common/status_setb.c -if test "$FROM_MPICH" = yes ; then - AC_DEFINE(ROMIO_INSIDE_MPICH,1,[Define if compiling within MPICH]) -elif test "$FROM_MPILAM" = yes ; then - AC_DEFINE(MPILAM,1,[Define if compiling within LAM/MPI]) -fi - -if test "$FROM_MPICH" = no ; then - if test -z "$LIBNAME"; then - LIBNAME="$top_build_dir/lib/libmpio.a" - fi - # - if test ! -d $top_build_dir/lib ; then - mkdir $top_build_dir/lib - fi -else - MPILIBNAME=${MPILIBNAME:-mpich} - if test -z "$LIBNAME" ; then - if test -d "$master_top_builddir/lib" ; then - LIBNAME=$master_top_builddir/lib/lib${MPILIBNAME}.a - else - LIBNAME="$ROMIO_HOME/lib${MPILIBNAME}.a" - fi - fi -fi -if test "$FROM_MPICH" != no ; then - # use the error handlers from MPICH - MPIO_EXTRA_OBJECTS= - MPIO_EXTRA_TMP_POBJECTS= - MPIO_EXTRA_REAL_POBJECTS= - # Use generalized request to get the multiple-completion routines - MPIO_REQOBJECTS= -fi -AC_SUBST(MPIO_EXTRA_OBJECTS) -AC_SUBST(MPIO_EXTRA_TMP_POBJECTS) -AC_SUBST(MPIO_EXTRA_REAL_POBJECTS) -# -# Use DOCTEXT instead of doctext -AC_CHECK_PROGS(DOCTEXT,doctext,true) -AC_SUBST(DOCTEXT) -# -if test $NOF77 = 1 ; then - F77=":" -else - FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test" -fi -# -if test $WITHIN_KNOWN_MPI_IMPL = no ; then - PAC_TEST_MPI - PAC_NEEDS_FINT -else - NEEDS_MPI_FINT="" -fi -# -if test "$MPI_INCLUDE_DIR" = "." ; then - ROMIO_INCLUDE="-I../include" -else - ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR" -fi -# -TEST_LIBNAME=$LIBNAME -MPIRUN=mpirun -if test $FROM_OMPI = yes ; then - # Open MPI does have the status set bytes functionality - - AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes]) - - # Used in the tests/ subdirectory for after ROMIO is built - - TEST_CC=mpicc - TEST_F77=mpifort - MPIRUN=mpirun - MPI_LIB= - NOPROFILE=1 - ROMIO_INCLUDE= - USER_CFLAGS= - USER_FFLAGS= - TEST_LIBNAME= - AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,1,[Define if Darray is available]) - HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY" - # Open MPI: see comments in mpi-io/mpioprof.h - AC_DEFINE(MPIO_BUILD_PROFILING, 1, [hack to make ROMIO build without profiling]) - DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1" - AC_ARG_ENABLE([grequest-extensions], - [AC_HELP_STRING([--enable-grequest-extensions], - [Enable support for Grequest extensions (default: disabled)])]) - AS_IF([test "x$enable_grequest_extensions" = "xyes"], - [DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#include \"ompi_grequestx.h\""], - [DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#undef HAVE_MPI_GREQUEST_EXTENSIONS"]) - - AC_DEFINE(HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK, 1, [Define if MPI library provides HINDEXED_BLOCK datatype]) - AC_DEFINE(HAVE_MPIIO_CONST, 1, Set if MPI-IO prototypes use const qualifier) -elif test $FROM_LAM = yes ; then - # LAM does have the status set bytes functionality - AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes]) - - # Used in the tests/ subdirectory for after ROMIO is built - TEST_CC=mpicc - TEST_F77=mpifort - MPIRUN=mpirun - MPI_LIB= - ROMIO_INCLUDE= - USER_CFLAGS= - USER_FFLAGS= - TEST_LIBNAME= - EXTRA_DIRS="mpi-io/fortran mpi2-other/info mpi2-other/info/fortran mpi2-other/array mpi2-other/array/fortran" -elif test $FROM_MPICH = yes ; then - # For now, separate the mpich from mpich cases - MPICH_HOME=`dirname $ROMIO_HOME` - MPICH_HOME=`dirname $MPICH_HOME` - MPICH_HOME=`dirname $MPICH_HOME` - if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi - # No special compiler script. - # BUT we need the include paths - # CC="$CC -I${use_top_srcdir}/src/include -I${top_build_dir}/src/include" - # TEST_CC="$CC" - # MPI_LIB="$LIBNAME" - # To allow ROMIO to work with the LIBTOOL scripts, we want to - # work directly with the CC, not the mpicc, compiler. - # Note that in the "FROM_MPICH" case, the CPPFLAGS and INCLUDES are already - # properly set - #CC=${top_build_dir}/bin/mpicc - # - # set the compilers to the ones in MPICH bin directory (master_top_builddir/bin) - TEST_CC='$(bindir)/mpicc' - TEST_F77='$(bindir)/mpifort' - MPI_H_INCLUDE="-I${master_top_builddir}/src/include" - ROMIO_INCLUDE="" - USER_CFLAGS="" - USER_FFLAGS="" - TEST_LIBNAME="" - MPIRUN='${bindir}/mpiexec' - # - # Turn off the building of the Fortran interface and the Info routines - EXTRA_DIRS="" - AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if status_set_bytes available]) - DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1" - DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#define HAVE_MPI_GREQUEST_EXTENSIONS 1" - AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH memory tracing macros defined]) - AC_DEFINE(HAVE_MPIX_H, 1, []) - AC_DEFINE(HAVE_MPIIO_CONST, 1, Set if MPI-IO prototypes use const qualifier) - AC_DEFINE(HAVE_MPI_TYPE_SIZE_X, 1, [Define if MPI library provides MPI_TYPE_SIZE_X]) - AC_DEFINE(HAVE_MPI_STATUS_SET_ELEMENTS_X, 1, [Define if MPI library provides MPI_STATUS_SET_ELEMENTS_X]) - AC_DEFINE(HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK, 1, [Define if MPI library provides HINDEXED_BLOCK datatype]) -fi -# -# -# feature tests: we can't test features if building as part of MPICH because -# we don't yet have an implementation against which we can test -# -if test $WITHIN_KNOWN_MPI_IMPL = no ; then - PAC_TEST_MPIR_STATUS_SET_BYTES - PAC_TEST_MPI_GREQUEST - PAC_TEST_MPIU_FUNCS - AC_DEFINE(PRINT_ERR_MSG,1,[Define for printing error messages]) - AC_CHECK_TYPE([MPI_Count],[],[AC_DEFINE_UNQUOTED([MPI_Count],[MPI_Aint],[Define to "MPI_Aint" if MPI does not provide MPI_Count]) ], [[#include ]]) - PAC_TEST_NEEDS_CONST - AC_CHECK_DECLS([MPI_COMBINER_HINDEXED_BLOCK], [], [], [[#include ]]) - AC_CHECK_FUNCS(MPI_Type_size_x MPI_Status_set_elements_x) -fi -# -if test -z "$TEST_CC" ; then - TEST_CC="$CC" -fi -if test -z "$TEST_F77" ; then - TEST_F77="$F77" -fi -# -AC_CHECK_FUNCS(strdup) -if test "$ac_cv_func_strdup" = "yes" ; then - # Do we need to declare strdup? - PAC_FUNC_NEEDS_DECL([#include ],strdup) -fi -AC_CHECK_FUNCS(snprintf) -if test "$ac_cv_func_snprintf" = "yes" ; then - # Do we need to declare snprintf? - PAC_FUNC_NEEDS_DECL([#include ],snprintf) -fi -AC_CHECK_FUNCS(lstat) -if test "$ac_cv_func_lstat" = "yes" ; then - # Do we need to declare lstat? - PAC_FUNC_NEEDS_DECL([#include - #include ],lstat) -fi -AC_CHECK_FUNCS(readlink) -if test "$ac_cv_func_readlink" = "yes" ; then - # Do we need to declare readlink? - PAC_FUNC_NEEDS_DECL([#include ],readlink) -fi -AC_CHECK_FUNCS(fsync) -if test "$ac_cv_func_fsync" = "yes" ; then - # Do we need to declare fsync? - PAC_FUNC_NEEDS_DECL([#include ],fsync) -fi -AC_CHECK_FUNCS(ftruncate) -if test "$ac_cv_func_ftruncate" = "yes" ; then - # Do we need to declare ftruncate? - PAC_FUNC_NEEDS_DECL([#include ],ftruncate) -fi - -AC_CHECK_FUNCS(lseek64) -if test "$ac_cv_func_lseek64" = "yes" ; then - PAC_FUNC_NEEDS_DECL([#include ],lseek64) -fi - -AC_CHECK_FUNCS(usleep) -if test "$ac_cv_func_usleep" = "yes" ; then - PAC_FUNC_NEEDS_DECL([#include ],usleep) -fi - -# -# Create the directory lists for the Makefile -FILE_SYS_DIRS="" -for dir in $FILE_SYSTEM ; do - FILE_SYS_DIRS="$FILE_SYS_DIRS adio/ad_$dir" -done -# FIXME eliminate FILE_SYS_DIRS and EXTRA_SRC_DIRS -EXTRA_SRC_DIRS="" - -mpio_glue="" -if test "$FROM_MPICH" = yes -o "${MPI_IMPL}_mpi" = "mpich_mpi"; then - mpio_glue=mpich -elif test "$FROM_OMPI" = yes -o "${MPI_IMPL}_mpi" = "open_mpi_mpi" ; then - mpio_glue=openmpi -else - mpio_glue=default -fi - -AM_CONDITIONAL([MPIO_GLUE_MPICH],[test "X$mpio_glue" = "Xmpich"]) -AM_CONDITIONAL([MPIO_GLUE_OPENMPI],[test "X$mpio_glue" = "Xopenmpi"]) -AM_CONDITIONAL([MPIO_GLUE_DEFAULT],[test "X$mpio_glue" = "Xdefault"]) - -if test "$BUILD_MPI_INFO" = 1 ; then - EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info" - if test "$NOF77" = 0 -a "$FROM_MPICH" != yes ; then - EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info/fortran" - fi -fi -if test "$BUILD_MPI_ARRAY" = 1 ; then - EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array" - if test "$NOF77" = 0 -a "$FROM_MPICH" != yes ; then - EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array/fortran" - fi -fi -if test "$NOF77" = 0 -a "$FROM_MPICH" != yes ; then - EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi-io/fortran" -fi -AC_SUBST(EXTRA_SRC_DIRS) -AC_SUBST(FILE_SYS_DIRS) - -# -CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H" -# - -if test -n "$MPIOF_H_INCLUDED"; then - F77MPIOINC="" -else - F77MPIOINC="include 'mpiof.h'" -fi - -echo "setting SYSDEP_INC to $SYSDEP_INC" -AC_SUBST(SYSDEP_INC) - -# Open MPI: use the exact same restrict test that we use in the -# upper-level Open MPI configure script so that we always get the same -# #define for "restrict" (there are a small number of files that will -# end up including both ROMIO's romioconf.h and opal_config.h, so we -# need to #defines to agree). -AC_C_RESTRICT -PAC_C_GNU_ATTRIBUTE - -# Open MPI: we need libtool -AM_PROG_LIBTOOL - -# Open MPI: setup the AM_CONDITIONALs to build the different adio devices - m4_foreach([my_fs], - [gpfs, gridftp, hfs, lustre, nfs, ntfs, panfs, pfs, pvfs, piofs, pvfs, pvfs2, sfs, testfs, ufs, xfs, zoidfs], - [AM_CONDITIONAL(BUILD_[]AS_TR_CPP(my_fs), [test -n "$file_system_]my_fs["])]) - -# support gcov test coverage information -PAC_ENABLE_COVERAGE - -echo "setting CC to $CC" -echo "setting F77 to $F77" -echo "setting TEST_CC to $TEST_CC" -echo "setting TEST_F77 to $TEST_F77" -echo "setting CFLAGS to $CFLAGS" -echo "setting USER_CFLAGS to $USER_CFLAGS" -echo "setting USER_FFLAGS to $USER_FFLAGS" - -# Open MPI: Add on CFLAGS that we figured out up top. They have -# makefile macros in them, so we couldn't substitute them until now. -CFLAGS="$CFLAGS $OMPI_CFLAGS "'-I$(top_builddir)/include' -# -# Open MPI - AM doesn't want the following: -# VPATH, CC, CPPFLAGS, CFLAGS, AR, RANLIB, F77, MAKE -AC_SUBST(ARCH) -AC_SUBST(FILE_SYSTEM) -#AC_SUBST(CC) -#AC_SUBST(CPPFLAGS) -#AC_SUBST(CFLAGS) -AC_SUBST(USER_CFLAGS) -AC_SUBST(USER_FFLAGS) -AC_SUBST(MIPS) -AC_SUBST(BITS) -#AC_SUBST(AR) -AC_SUBST(AR_FLAGS) -AC_SUBST(MPI_INCLUDE_DIR) -AC_SUBST(MPI_LIB) -#AC_SUBST(F77) -AC_SUBST(NOF77) -AC_SUBST(NOPROFILE) -#AC_SUBST(MAKE) -AC_SUBST(arch_IRIX) -AC_SUBST(ROMIO_HOME) -AC_SUBST(LIBNAME) -AC_SUBST(TEST_LIBNAME) -AC_SUBST(LL) -AC_SUBST(F77GETARG) -AC_SUBST(F77IARGC) -AC_SUBST(F77MPIOINC) -AC_SUBST(FTESTDEFINE) -AC_SUBST(FORTRAN_MPI_OFFSET) -AC_SUBST(FROM_MPICH) -AC_SUBST(FROM_LAM) -AC_SUBST(WITHIN_KNOWN_MPI_IMPL) -AC_SUBST(NEEDS_MPI_FINT) -AC_SUBST(HAVE_MPI_INFO) -AC_SUBST(BUILD_MPI_INFO) -AC_SUBST(HAVE_MPI_DARRAY_SUBARRAY) -AC_SUBST(BUILD_MPI_ARRAY) -AC_SUBST(DEFINE_MPI_OFFSET) -AC_SUBST(DEFINE_HAVE_MPI_GREQUEST) -AC_SUBST(DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS) -AC_SUBST(MPI_OFFSET_TYPE) -AC_SUBST(MPI_FINFO1) -AC_SUBST(MPI_FINFO2) -AC_SUBST(MPI_FINFO3) -AC_SUBST(MPI_FINFO4) -AC_SUBST(MPI_FARRAY1) -AC_SUBST(MPI_FARRAY2) -AC_SUBST(MPI_FARRAY3) -AC_SUBST(MPI_FARRAY4) -AC_SUBST(MPI_FARRAY5) -AC_SUBST(MPI_FARRAY6) -AC_SUBST(MPI_FARRAY7) -AC_SUBST(MPI_OFFSET_KIND1) -AC_SUBST(MPI_OFFSET_KIND2) -AC_SUBST(TEST_CC) -AC_SUBST(TEST_F77) -AC_SUBST(ROMIO_INCLUDE) -AC_SUBST(ROMIO_LFLAGS) -AC_SUBST(ROMIO_TCFLAGS) -AC_SUBST(ROMIO_TCPPFLAGS) -AC_SUBST(ROMIO_TFFLAGS) -AC_SUBST(MPIRUN) -AC_SUBST(FORTRAN_TEST) -#dnl -#dnl Support shared libraries -#if test -z "$ENABLE_SHLIB" ; then -# ENABLE_SHLIB=none -#fi -#AC_SUBST(ENABLE_SHLIB) -#AC_SUBST(CC_SHL) -#AC_SUBST(LIBTOOL) -# Open MPI: This is no longer necessary with modern versions of autotools -# Remove the .a from the library file name (so that we can use .so or -# other appropriate suffix) -#SHLIBNAME=`echo $LIBNAME | sed 's/\.a$//'` -#AC_SUBST(SHLIBNAME) -#dnl -#if test ! -d adio ; then mkdir adio ; fi -#if test ! -d adio/include ; then mkdir adio/include ; fi -#if test ! -d mpi2-other ; then mkdir mpi2-other ; fi -#if test ! -d mpi-io ; then mkdir mpi-io ; fi -#if test ! -d mpi-io/glue ; then mkdir mpi-io/glue ; fi - -# Create makefiles for all of the adio devices. Only the ones that -# are active will be called by the top level ROMIO make -AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests]) -AC_CONFIG_FILES([ - Makefile - localdefs - test/Makefile - test/misc.c - test/large_file.c - test/runtests - test-internal/Makefile - util/romioinstall - include/mpio.h - test/fmisc.f - test/fcoll_test.f - test/pfcoll_test.f - test/fperf.f -]) -# Open MPI: intentionally skip the following: -# mpi2-other/info/Makefile -# mpi2-other/array/Makefile -# mpi2-other/info/fortran/Makefile -# mpi2-other/array/fortran/Makefile -# include/mpiof.h -AC_OUTPUT - -dnl PAC_SUBDIR_CACHE_CLEANUP -exit 0 diff --git a/3rd-party/romio321/doc/README b/3rd-party/romio321/doc/README deleted file mode 100644 index b61e73ee204..00000000000 --- a/3rd-party/romio321/doc/README +++ /dev/null @@ -1,35 +0,0 @@ -The ROMIO Users Guide is in the file users-guide.ps.gz. - -The book ``Using MPI-2: Advanced Features of the Message-Passing -Interface,'' by William Gropp, Ewing Lusk, and Rajeev Thakur, -MIT Press, 1999, provides a tutorial introduction to all aspects of -MPI-2, including I/O. It has lots of example programs. - -The following papers related to ROMIO are available online: - -* Rajeev Thakur, William Gropp, and Ewing Lusk, ``Optimizing -Noncontiguous Accesses in MPI-IO,'' Parallel Computing, (28)1:83--105, -January 2002. -http://www.mcs.anl.gov/~thakur/papers/mpi-io-noncontig.ps - -* R. Thakur, W. Gropp, and E. Lusk, ``On Implementing MPI-IO Portably -and with High Performance,'' in Proc. of the Sixth Workshop on I/O in -Parallel and Distributed Systems, May 1999. -http://www.mcs.anl.gov/~thakur/papers/mpio-impl.ps - -* R. Thakur, W. Gropp, and E. Lusk, ``Data Sieving and Collective I/O -in ROMIO,'' in Proc. of the 7th Symposium on the Frontiers of -Massively Parallel Computation, February 1999, pp. 182--189. -http://www.mcs.anl.gov/~thakur/papers/romio-coll.ps - -* R. Thakur, W. Gropp, and E. Lusk, ``A Case for Using MPI's Derived -Datatypes to Improve I/O Performance,'' in Proc. of SC98: High -Performance Networking and Computing, November 1998. -http://www.mcs.anl.gov/~thakur/dtype - -* R. Thakur, W. Gropp, and E. Lusk, ``An Abstract-Device Interface for -Implementing Portable Parallel-I/O Interfaces,'' in Proc. of the 6th -Symposium on the Frontiers of Massively Parallel Computation, -October 1996, pp. 180-187. -http://www.mcs.anl.gov/~thakur/papers/adio.ps - diff --git a/3rd-party/romio321/doc/makepubpage.sh b/3rd-party/romio321/doc/makepubpage.sh deleted file mode 100755 index 390519e580c..00000000000 --- a/3rd-party/romio321/doc/makepubpage.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# if you have bibtext2html installed (http://www.lri.fr/~filliatr/bibtex2html/ -# but I know there are other packages by that name), then you can re-generate -# the "ROMIO publication page" -# (http://www.mcs.anl.gov/research/projects/romio/pubs.html) - -# If you update the command below, please be sure to retain the link to the -# older papers - -WEB_HOST=login3.mcs.anl.gov -WEB_DIR=/mcs/web/research/projects/romio - -bibtex2html -t "Papers using ROMIO" \ - --header "Please help us keep this list up to date. Contact mpich-discuss@mcs.anl.gov for any corrections or additions.

Last updated at $(date).

Recent publications

" \ - --footer "

Other publications

-

    -
  • Northwestern University CUCIS group -
  • Weikuan Yu -
  • Phillip Dickens -
  • Older ROMIO papers" \ - -r -d -both pubs.bib - -if [ $? -eq 0 ] ; then - scp pubs* ${WEB_HOST}:${WEB_DIR} -else - echo "error running bibtex2html. website not updated" -fi diff --git a/3rd-party/romio321/doc/pubs.bib b/3rd-party/romio321/doc/pubs.bib deleted file mode 100644 index 5799bc305cf..00000000000 --- a/3rd-party/romio321/doc/pubs.bib +++ /dev/null @@ -1,465 +0,0 @@ -@InProceedings{gropp:selfconsist-io, - author={William Gropp and Dries Kimpe and Robert B. Ross and Rajeev Thakur and Jesper Larsson Tr\"aff}, - title={Self-Consistent {MPI-IO} Performance Requirements and Expectations}, - booktitle={Proc. of the 15th European PVM/MPI Users' Group Meeting (Euro - PVM/MPI 2008)}, - month={September}, - year={2008} -} - -@InProceedings{kimpe:log-based, - author={D. Kimpe and R. Ross and S. Vandewalle and S. Poedts}, - title={Transparent Log-Based Data Storage in {MPI-IO} Applications}, - booktitle={Proc. of the 14th European PVM/MPI Users' Group Meeting (Euro PVM/MPI 2007)}, - month={September}, - year={2007} -} - -@InProceedings{latham:gen-req, - author={Robert Latham and William Gropp and Robert B. Ross and Rajeev Thakur}, - title={Extending the {MPI-2} Generalized Request Interface}, - booktitle={Proc. of the 14th European PVM/MPI Users' Group Meeting (Euro PVM/MPI 2007)}, - month={September}, - year={2007}, - pages={223--232} -} - -@InProceedings{lee:mpiio-l, - author={Jonghyun Lee and Robert B. Ross and Scott Atchley and Micah Beck and - and Rajeev Thakur}, - title={{MPI-IO/L}: Efficient Remote {I/O} for {MPI-IO} via Logistical Networking}, - booktitle={Proceedings of the 20th IEEE International Parallel and Distributed - Processing Symposium (IPDPS 2006)}, - address={Rhodes Island, Greece}, - month={April}, - year={2006} -} - -@InProceedings{ross:atomic, - author = {Robert Ross and Robert Latham and William Gropp and Rajeev Thakur - and Brian Toonen}, - title = {Implementing {MPI-IO} Atomic Mode Without File System Support}, - booktitle = {Proceedings of CCGrid 2005}, - month = {May}, - year = {2005}, -} - -@InProceedings{latham:sharedfp, - author = {Robert Latham and Robert Ross and Rajeev Thakur}, - title = {Implementing {MPI-IO} Shared File Pointers Without File - System Support}, - booktitle = {Proceedings of EuroPVM/MPI 2005}, - month={September}, - year = {2005}, -} - -@article{latham:rma-ops, - author = {Latham, Robert and Ross, Robert and Thakur, Rajeev}, - title = {{Implementing MPI-IO Atomic Mode and Shared File Pointers Using MPI - One-Sided Communication}}, - journal = {International Journal of High Performance Computing Applications}, - volume = {21}, - number = {2}, - pages = {132-143}, - doi = {10.1177/1094342007077859}, - year = {2007}, - abstract = {The ROMIO implementation of the MPI-IO standard provides a - portable infrastructure for use on top of a variety of underlying storage - targets. These targets vary widely in their capabilities, and in some cases - additional effort is needed within ROMIO to support all MPI-IO semantics. Two - aspects of the interface that can be problematic to implement are MPI-IO - atomic mode and the shared file pointer access routines. Atomic mode requires - enforcing strict consistency semantics, and shared file pointer routines - require communication and coordination in order to atomically update a shared - resource. For some file systems, native locks may be used to implement these - features, but not all file systems have lock support. In this work, we - describe algorithms for implementing efficient mutex locks using MPI-1 and - the one-sided capabilities from MPI-2. We then show how these algorithms may - be used to implement both MPI-IO atomic mode and shared file pointer - methods for ROMIO without requiring any features from the underlying file - system. We show that these algorithms can outperform traditional file system - lock approaches. Because of the portable nature of these algorithms, they are - likely useful in a variety of situations where distributed locking or - coordination is needed in the MPI-2 environment. }, - URL = {http://hpc.sagepub.com/cgi/content/abstract/21/2/132}, - pdf = {papers/latham_rmaops.pdf}, - eprint = {http://hpc.sagepub.com/cgi/reprint/21/2/132.pdf} -} - -@Article{latham:mpi-io-scalability, - author = {Rob Latham and Rob Ross and Rajeev Thakur}, - title = {The impact of file systems on {MPI-IO} scalability}, - journal = {Lecture Notes in Computer Science}, - booktitle = {11th European Parallel Virtual Machine and Message Passing - Interface Users Group Meeting; September 19-22, 2004; Budapest, HUNGARY}, - editor = {Kranzlmuller, D; Kacsuk, P; Dongarra, J}, - year = {2004}, - month = {September}, - volume = {3241}, - pages = {87--96}, - institution = {Argonne Natl Lab, 9700 S Cass Ave, Argonne, IL 60439 USA; - Argonne Natl Lab, Argonne, IL 60439 USA}, - publisher = {Springer-Verlag Heidelberg}, - copyright = {(c)2004 Institute for Scientific Information, Inc.}, - URL = {http://www.springerlink.com/link.asp?id=m31px2lt90296b62}, - pdf = {papers/latham:scalable_ops.pdf}, - keywords = {scalability analysis, MPI-IO, pario-bib}, - abstract = {As the number of nodes in cluster systems continues to grow, - leveraging scalable algorithms in all aspects of such systems becomes key to - maintaining performance. While scalable algorithms have been applied - successfully in some areas of parallel I/O, many operations are still - performed in an uncoordinated manner. In this work we consider, in three file - system scenarios, the possibilities for applying scalable algorithms to the - many operations that make up the MPI-IO interface. From this evaluation we - extract a set of file system characteristics that aid in developing scalable - MPI-IO implementations.} -} - - - -@InProceedings{thakur:byte-range, - author = {Rajeev Thakur and Robert Ross and Robert Latham}, - title = {Implementing Byte-Range Locks Using {MPI} One-Sided Communication}, - booktitle = {Proceedings of the 12th European PVM/MPI Users' Group Meeting (Euro PVM/MPI 2005), Recent Advances in Parallel Virtual Machine and Message Passing Interface, Lecture Notes in Computer Science, LNCS 3666, Springer}, - month = {September}, - year = {2005}, - pages = {119-128}, -} - -@InProceedings{gropp:io-redundancy, - author={William Gropp and Robert B. Ross and Neill Miller}, - title={Providing Efficient {I/O} Redundancy in {MPI} Environments}, - booktitle={Proceedings of EuroPVM/MPI 2004}, - month={September}, - year={2004} -} - -@InProceedings{lee:rfs, - author = {Jonghyun Lee and Xiaosong Ma and Robert B. Ross and Rajeev Thakur - and Marianne Winslett}, - title={{RFS}: Implementing Efficient and Flexible Remote File Access for - {MPI-IO}}, - booktitle={Proceedings of Cluster 2004}, - month={September}, - year={2004} -} - -@InProceedings{yu:bgl-io, - author = {Hao Yu and R. K. Sahoo and C. Howson and George. Almasi and - J. G. Castanos and M. Gupta and Jose. E. Moreira and J. J. Parker and - T. E. Engelsiepen and Robert Ross and Rajeev Thakur and Robert Latham - and W. D. Gropp}, - title = {High Performance File {I/O} for the {BlueGene/L} Supercomputer}, - booktitle = {Proceedings of the 12th International Symposium on High-Performance Computer Architecture (HPCA-12)}, - month = {February}, - year = {2006}, - url = {http://www.mcs.anl.gov/~thakur/papers/bgl-io.pdf}, -} - -@Article{Hastings:pio-shmem, - author = {Andrew B. Hastings and Alok Choudhary}, - title = {Exploiting Shared Memory to Improve Parallel {I/O} Performance}, - journal = {Lecture Notes in Computer Science}, - booktitle = {13th European PVM/MPI User's Group Meeting; September 17-20, 2006; Bonn, Germany}, - editor = {Mohr, B; Worringen, J; Dongarra, J}, - year = {2006}, - month = {September}, - volume = {4192}, - pages = {212-221}, - publisher = {Springer-Verlag Heidelberg}, -} - -@Article{seidel:memfs, - author = {Jan Seidel and Rudolf Berrendorf and Marcel Birkner and Marc-Andre Hermanns}, - title = {High-Bandwidth Remote Parallel {I/O} with the Distributed Memory Filesystem {MEMFS}}, - journal = {Lecture Notes in Computer Science}, - booktitle = {13th European PVM/MPI User's Group Meeting; September 17-20, 2006; Bonn, Germany}, - editor = {Mohr, B; Worringen, J; Dongarra, J}, - year = {2006}, - month = {September}, - volume = {4192}, - pages = {222-229}, - publisher = {Springer-Verlag Heidelberg}, -} - -@InProceedings{calderon:ft-mpiio, - author={A. Calderon and F. Garcia-Carballeira and Florin Isaila and Rainer Keller and Alexander Schulz}, - title={Faul Tolerant File Models for {MPI-IO} Parallel File Systems}, - booktitle={Proc. of the 14th European PVM/MPI Users' Group Meeting (Euro PVM/MPI 2007)}, - month={September}, - year={2007}, - pages={153-160} -} -@InProceedings{Blas:romio-gpfs, - author={Francisco Javier Garc{\'i}a Blas and Florin Isaila and Jes{\'u}s Carretero - and Thomas Grossmann}, - title={Implementation and Evaluation of an {MPI-IO} Interface for - {GPFS} in {ROMIO}}, - booktitle={Proc. of the 15th European PVM/MPI Users' Group Meeting (Euro - PVM/MPI 2008)}, - month={September}, - year={2008} -} - -@InProceedings{dickens:y-lib, - author = {Dickens, Phillip M. and Logan, Jeremy}, - title = {Y-lib: a user level library to increase the performance of {MPI-IO} in a lustre file system environment}, - booktitle = {HPDC '09: Proceedings of the 18th ACM international symposium on High performance distributed computing}, - year = {2009}, - isbn = {978-1-60558-587-1}, - pages = {31--38}, - location = {Garching, Germany}, - doi = {http://doi.acm.org/10.1145/1551609.1551617}, - publisher = {ACM}, - address = {New York, NY, USA}, - } - - -% these ROMIO-related papers won't be published until EuroPVM/MPI 2009 - -@InProceedings{buettner:nonblocking-io, - author = {David Buettner and Julian Kunkel and Thomas Ludwig}, - title = {Using Non-Blocking {I/O} Operations in High Performance Computing to Reduce Execution Times}, - booktitle = {To be Published in Proc. of the 16th European PVM/MPI User's Group Meeting (Euro PVM/MPI 2009)}, - month={September}, - year={2009} - } - -@InProceedings{sehrish:conflicts, - author = {Saba Sehrish and Jun Wang and Rajeev Thakur}, - title = {Conflict Detection Algorithm to Minimize Locking for {MPI-IO} Atomicity}, - booktitle = {To be Published in Proc. of the 16th European PVM/MPI User's Group Meeting (Euro PVM/MPI 2009)}, - month={September}, - year={2009} -} - -@InProceedings{blas:bg-writeback, - author = {Javier Garc{\'i}a Blas and Florin Isaila and Jes{\'u}s Carretero and Robert Latham and Robert Ross}, - title = {Multiple-level {MPI} file write-back and prefetching for {Blue Gene} systems}, - booktitle = {To be Published in Proc. of the 16th European PVM/MPI User's Group Meeting (Euro PVM/MPI 2009)}, - month={September}, - year={2009} -} - -@InProceedings{isaila:ahpios, - author = {Florin Isaila and Javier Garc{\'i}a Blas and Jes{\'u}s Carretero and Wei-keng Liao and Alok Choudhary}, - title = {{AHPIOS}: An {MPI-based} ad-hoc parallel {I/O} system}, - booktitle = {14th Intl Conference on Parallel and Distributed Systems. Melbourne, Victoria, Austraila}, - year={2008} -} - -@InProceedings{blas:viewio, - author = {Javier Garc{\'i}a Blas and Florin Isaila and David E. Singh and Jes{\'u}s Carretero}, - title ={View-based collective {I/O} for {MPI-IO}}, - booktitle={8th IEEE International Symposium on Cluster Computing and the Grid}, - year={2008} -} - -@InProceedings{yu:lustre-joining, - author = {Weikuan Yu and Jeffrey Vetter and R. Shane Canon and Song Jiang}, - title = {Exploiting {Lustre} File Joining for Effective Collective {IO}}, - booktitle = {Seventh IEEE International Symposium on Cluster Computing and the Grid (CCGrid 2007)}, - month = {May}, - year = {2007}, -} - -@InProceedings{yu:opal, - author = {Weikuan Yu and Jeffrey Vetter and Shane Canon}, - title = {{OPAL}: An Open-Source {MPI-IO} Library over {Cray XT}}, - booktitle = {International Workshop on Storage Network Architecture and Parallel I/O (SNAPI'07)}, - month={September}, - year = {2007} -} - -@InProceedings{dickens:lustre-mpi, - title = {Towards a High Performance Implementation of {MPI-IO} on the {Lustre} File System}, - author = { Phillip M. Dickens and Jeremy Logan}, - booktitle = {Proceedings of GADA'08: Grid computing, high-performAnce and Distributed Applications. Monterrey, Mexico}, - month = {November}, - year = {2008} -} - -@article{dickens:lustre-mpi-journal, - author = {Phillip Dickens and J. Logan}, - title = {A High Performance Implementation of {MPI-IO} for a {Lustre} File System Environment}, - journal = {To appear: Concurrency and Computation: Practice and Experience}, - year = {2009} -} - -@InProceedings{logan:objectio, - author = {J. Logan and Phillip Dickens}, - title = {Using Object Based Files for High Performance Parallel {I/O}}, - booktitle = {Proceedings of the IEEE 4th International Workshop on Intelligent Data acquisition and Advanced Computing Systems: Technology and Applications. Dortmund, Germany}, - month = {September}, - year = {2007} - } - -@InProceedings{logan:dynamic-object-io, - author = {J. Logan and Phillip Dickens}, - title = {Dynamic Object Based {I/O}. (Invited Paper)}, - booktitle = {To appear: IEEE 5th International Workshop on Intelligent Data - acquisition and Advanced Computing Systems: Technology and Applications}, - year = {2009}, - month = {August} -} - - -@InProceedings{liao:partitioning, - author = {Wei-keng Liao and Alok Choudhary}, - title = {Dynamically Adapting File Domain Partitioning Methods for Collective {I/O} Based on Underlying Parallel File System Locking Protocols}, - booktitle = {Proceedings of International Conference for High Performance Computing, Networking, Storage and Analysis (SC08), Austin, Texas}, - month={November}, - year = {2008} -} - -@InProceedings{nisar:io-delegation, - author = {Arifa Nisar and Wei-keng Liao and Alok Choudhary}, - title = {Scaling Parallel {I/O} Performance through {I/O} Delegate and Caching System}, - booktitle = {Proceedings of International Conference for High Performance Computing, Networking, Storage and Analysis (SC08), Austin, Texas}, - month={November}, - year ={2008} -} - -@InProceedings{liao:caching-large-scale, - author = { Wei-keng Liao and Avery Ching and Kenin Coloma and Arifa Nisar and Alok Choudhary and Jackie Chen and Ramanan Sankaran and Scott Klasky}, - title = {Using {MPI} File Caching to Improve Parallel Write Performance for Large-Scale Scientific Applications}, - booktitle = {Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC 2007), Reno, Nevada}, - month = {November}, - year = {2007} -} - -@article{liao:cooperative_caching_mpi_journal, - author = {Wei-keng Liao and Kenin Coloma and Alok Choudhary and Lee Ward}, - title = {Cooperative Client-side File Caching for {MPI} Applications}, - journal = {International Journal of High Performance Computing Applications}, - volume = {21}, - number = {2}, - pages = {144-154}, - month = {May}, - year = {2007} -} - -@InProceedings{liao:client_cache_eval, - author = {Wei-keng Liao and Avery Ching and Kenin Coloma and Alok Choudhary and Lee Ward}, - title = {An Implementation and Evaluation of Client-side File Caching for {MPI-IO}}, - booktitle = {Proceedings of the 21st International Parallel and Distributed -Processing Symposium (IPDPS), Long Beach, California}, - month = {March}, - year = {2007} -} - -@article{liao:overlapping_io, - author = {Wei-keng Liao and Kenin Coloma and Alok Choudhary and Lee Ward and Eric Russell and Neil Pundit}, - title = {Scalable Design and Implementations for MPI Parallel Overlapping {I/O}}, - journal = {{IEEE} Transactions on Parallel and Distributed System}, - volume = {17}, - number = {11}, - pages = {1264-1276}, - month = {November}, - year = {2006} -} - - -@InProceedings{coloma:new_collective_io, - author = {Kenin Coloma and Avery Ching and Alok Choudhary and Wei-keng Liao and Robert Ross and Rajeev Thakur and Lee Ward}, - title = {A New Flexible {MPI} Collective {I/O} Implementation}, - booktitle = {Proceedings of the IEEE Conference on Cluster Computing (Cluster 2006), Barcelona, Spain}, - month = {September}, - year = {2006} -} - -@article{memik:multicollective_io, - author = {Gokhan Memik and Mahmut T. Kandemir and Wei-Keng Liao and Alok Choudhary}, - title = {Multicollective {I/O}: A Technique for Exploiting Inter-file Access Patterns}, - journal = {{ACM} Transactions on Storage (TOS)}, - volume = {2}, - number = {3}, - pages = {349-360}, - month = {August}, - year = {2006} -} - -@Inbook{liao:atomicity_overlap, - author = {Wei-keng Liao and Alok Choudhary and Kenin Coloma and Lee Ward and Eric Russell and Neil Pundit}, - title = {{MPI} Atomicity and Concurrent Overlapping {I/O}}, - booktitle = {High Performance Computing: Paradigm and Infrastructure}, - pages = {203-218}, - chapter = {10}, - month = {November}, - year = {2005}, - publisher = {John Wiley & Sons Inc}, - note = {ISBN: 978-0-471-65471-1} -} - -@InProceedings{liao:cooperative_write-behind, - author = {Wei-keng Liao and Kenin Coloma and Alok Choudhary and Lee Ward}, - title = {{Cooperative Write-Behind Data Buffering for MPI I/O}}, - booktitle = {Proceedings of the 12th European Parallel Virtual Machine and Message Passing Interface Conference (EURO PVM/MPI), Sorrento (Naples), Italy}, - month = {September}, - year = {2005} - } - -@InProceedings{liao:app_aware_caching, - author = {Wei-keng Liao and Kenin Coloma and Alok Choudhary and Lee Ward and Eric Russell and Sonja Tideman}, - title = {{Collective Caching: Application-aware Client-side File Caching}}, - booktitle = {Proceedings of the 14th IEEE International Symposium on High Performance Distributed Computing (HPDC-14), Research Triangle Park, NC}, - month = {July}, - year = {2005} - } - -@InProceedings{coloma:dache, - author = {Kenin Coloma and Alok Choudhary and Wei-keng Liao and Lee Ward and Sonja Tideman}, - title = {{DAChe: Direct Access Cache System for Parallel I/O}}, - booktitle = {Proceedings of the International Supercomputer Conference, Heidelberg, Germany}, - month = {June}, - year = {2005} - } - -@InProceedings{coloma:scalable_caching, - author = {Kenin Coloma and Alok Choudhary and Wei-keng Liao and Lee Ward and Eric Russell and Neil Pundit}, - title = {{Scalable High-level Caching for Parallel I/O}}, - booktitle = {Proceedings of the International Parallel and Distributed Parallel Processing Symposium (IPDPS), New Mexico}, - month = {April}, - year = {2004} -} - -@InProceedings{Liao:scalable_atomicity, - author = {Wei-keng Liao and Alok Choudhary and Kenin Coloma and George K. Thiruvathukal and Lee Ward and Eric Russell and Neil Pundit}, - title = {{Scalable Implementations of MPI Atomicity for Concurrent Overlapping I/O}}, - booktitle = {Proceedings of the International Conference on Parallel Processing (ICPP), Kaohsiung, Taiwan}, - month = {October}, - year = {2003} - } - -@InProceedings{ching:noncontig, - author = {Avery Ching and Alok Choudhary and Kenin Coloma and Wei-keng Liao and Robert Ross and William Gropp}, - title = {{Noncontiguous I/O Accesses Through MPI-IO}}, - booktitle = {Proceedings of the International Symposium on Cluster Computing and the Grid (CCGrid), Tokyo, Japan}, - month = {May}, - year = {2003} -} - -@Article{chaarawi:collective_writes, - author = {Mohamad Chaarawi and Suneet Chandok and Edgar Gabriel}, - title = {{Performance Evaluation of Collective Write Algorithms in MPI I/O}}, - journal = {Lecture Notes in Computer Science}, - booktitle = {International Conference on Computer Science (ICCS) 2009}, - month = {May}, - year = {2009}, - volume = {5544}, - pages = {185-194}, - publisher = {Springer Berlin / Heidelberg}, - doi = {10.1007/978-3-642-01970-8_19} -} -@Article{kulkarni::shared_file_pointers, - author = {Ketan Kulkarni and Edgar Gabriel}, - title = {{Evaluating Algorithms for Shared File Pointer Operations in MPI I/O}}, - journal = {Lecture Notes in Computer Science}, - booktitle = {International Conference on Computer Science (ICCS) 2009}, - month = {May}, - year = {2009}, - volume = {5544}, - pages = {280-289}, - publisher = {Springer Berlin / Heidelberg}, - doi = {10.1007/978-3-642-01970-8_28} -} diff --git a/3rd-party/romio321/doc/romio.bib b/3rd-party/romio321/doc/romio.bib deleted file mode 100644 index bb94a2d2ea1..00000000000 --- a/3rd-party/romio321/doc/romio.bib +++ /dev/null @@ -1,92 +0,0 @@ -@Book{grop99a, - author = {William Gropp and Ewing Lusk and Rajeev Thakur}, - title = {{Using MPI-2: Advanced Features of the Message-Passing Interface}}, - publisher = {MIT Press}, - year = 1999, - address = {Cambridge, MA} -} - -@Misc{mpi97a, - author = "{Message Passing Interface Forum}", - title = "{{MPI-2}: Extensions to the Message-Passing Interface}", - note = "{\tt http://www.mpi-forum.org/docs/docs.html}", - year = {July 1997} -} - -@InProceedings{thak96e, - author = {Rajeev Thakur and William Gropp and Ewing Lusk}, - title = {An Abstract-Device Interface for Implementing Portable - Parallel-{I/O} Interfaces}, - booktitle = {Proceedings of the 6th Symposium on the Frontiers of - Massively Parallel Computation}, - publisher = {IEEE Computer Society Press}, - pages = {180--187}, - month = {October}, - year = {1996} -} - -@InProceedings{thak99b, - author = {Rajeev Thakur and William Gropp and Ewing Lusk}, - title = {On Implementing {MPI-IO} Portably and with High Performance}, - booktitle = {Proceedings of the 6th Workshop on I/O in Parallel and - Distributed Systems}, - pages = {23--32}, - year = {1999}, - month = {May}, - publisher = {ACM Press} -} - -@InProceedings{bordawekar:primitives, - author = {Rajesh Bordawekar and Juan Miguel {del Rosario} and Alok - Choudhary}, - title = {Design and Evaluation of Primitives for Parallel {I/O}}, - booktitle = {Proceedings of Supercomputing '93}, - year = {1993}, - pages = {452--461}, - publisher = {IEEE Computer Society Press}, - address = {Portland, OR}, - URL = {ftp://erc.cat.syr.edu/ece/choudhary/PASSION/sc93.ps.Z}, - keywords = {parallel I/O, pario-bib}, - abstract = {In this paper, we show that the performance of parallel file - systems can vary greatly as a function of the selected data distributions, - and that some data distributions can not be supported. Also, we describe how - the parallel language extensions, though simplifying the programming, do not - address the performance problems found in parallel file systems. \par We have - devised an alternative scheme for conducting parallel I/O - the Two-Phase - Access Strategy - which guarantees higher and more consistent performance - over a wider spectrum of data distributions. We have designed and implemented - runtime primitives that make use of the two-phase access strategy to conduct - parallel I/O, and facilitate the programming of parallel I/O operations. We - describe these primitives in detail and provide performance results which - show that I/O access rates are improved by up to several orders of magnitude. - Further, we show that the variation in performance over various data - distributions is restricted to within a factor of 2 of the best access - rate.}, - comment = {Much of this is the same as delrosario:two-phase, except for - section~4 where they describe their actual run-time library of primitives, - with a little bit about how it works. It's not clear, for example, how their - meta-data structures are distributed across the machine. They also do not - describe their methods for the data redistribution.} -} - -@TechReport{choudhary:passion, - author = {Alok Choudhary and Rajesh Bordawekar and Michael Harry and Rakesh - Krishnaiyer and Ravi Ponnusamy and Tarvinder Singh and Rajeev Thakur}, - title = {{PASSION:} Parallel And Scalable Software for Input-Output}, - year = {1994}, - month = {September}, - number = {SCCS-636}, - institution = {ECE Dept., NPAC and CASE Center, Syracuse University}, - later = {thakur:jpassion}, - URL = {ftp://erc.cat.syr.edu/ece/choudhary/PASSION/passion_report.ps.Z}, - keywords = {parallel I/O, out-of-core, pario-bib}, - comment = {This TR overviews the PASSION project, and all its components: - two-phase access, out-of-core support for structured and unstructured - problems, data sieving, prefetching, caching, compiler and language support, - file system support, virtual parallel file system, and parallel pipes. They - reference many of their related papers in an extensive bibliography. See also - singh:adopt, jadav:ioschedule, thakur:passion, thakur:runtime, - bordawekar:efficient, thakur:out-of-core, delrosario:prospects, - delrosario:two-phase, bordawekar:primitives, bordawekar:delta-fs.} -} - diff --git a/3rd-party/romio321/doc/source-guide.tex b/3rd-party/romio321/doc/source-guide.tex deleted file mode 100644 index 96fa7ca58d9..00000000000 --- a/3rd-party/romio321/doc/source-guide.tex +++ /dev/null @@ -1,494 +0,0 @@ -% \documentstyle[11pt,psfig]{article} -\documentclass[11pt]{article} -\hoffset=-.7in -\voffset=-.6in -\textwidth=6.5in -\textheight=8.5in - -\begin{document} -\vspace*{-1in} -\thispagestyle{empty} -\begin{center} -ARGONNE NATIONAL LABORATORY \\ -9700 South Cass Avenue \\ -Argonne, IL 60439 -\end{center} -\vskip .5 in - -\begin{center} -\rule{1.75in}{.01in} \\ -\vspace{.1in} - -ANL/MCS-TM-XXX \\ - -\rule{1.75in}{.01in} \\ - -\vskip 1.3 in -{\Large\bf A Guide to the ROMIO MPI-IO Implementation } \\ -by \\ [2ex] -{\large\it Robert Ross, Robert Latham, and Rajeev Thakur} -\vspace{1in} - -Mathematics and Computer Science Division - -\bigskip - -Technical Memorandum No.\ XXX - - -% \vspace{1.4in} -% Revised May 2004 - -\end{center} - -\vfill - -{\small -\noindent -This work was supported by the Mathematical, Information, and -Computational Sciences Division subprogram of the Office of Advanced -Scientific Computing Research, U.S. Department of Energy, under -Contract W-31-109-Eng-38; and by the Scalable I/O Initiative, a -multiagency project funded by the Defense Advanced Research Projects -Agency (Contract DABT63-94-C-0049), the Department of Energy, the -National Aeronautics and Space Administration, and the National -Science Foundation.} - -\newpage - - -%% Line Spacing (e.g., \ls{1} for single, \ls{2} for double, even \ls{1.5}) -%% - -\newcommand{\ls}[1] - {\dimen0=\fontdimen6\the\font - \lineskip=#1\dimen0 - \advance\lineskip.5\fontdimen5\the\font - \advance\lineskip-\dimen0 - \lineskiplimit=.9\lineskip - \baselineskip=\lineskip - \advance\baselineskip\dimen0 - \normallineskip\lineskip - \normallineskiplimit\lineskiplimit - \normalbaselineskip\baselineskip - \ignorespaces - } -\renewcommand{\baselinestretch}{1} -\newcommand {\ix} {\hspace*{2em}} -\newcommand {\mc} {\multicolumn} - - -\tableofcontents -\thispagestyle{empty} -\newpage - -\pagenumbering{arabic} -\setcounter{page}{1} -\begin{center} -{\bf Users Guide for ROMIO: A High-Performance,\\[1ex] -Portable MPI-IO Implementation} \\ [2ex] -by \\ [2ex] -{\it Rajeev Thakur, Robert Ross, Ewing Lusk, and William Gropp} - -\end{center} -\addcontentsline{toc}{section}{Abstract} -\begin{abstract} -\noindent -ROMIO is a high-performance, portable implementation of MPI-IO (the -I/O chapter in the \mbox{MPI Standard}). -This document describes the internals of the ROMIO implementation. -\end{abstract} - -\section{Introduction} - -The ROMIO MPI-IO implementation, originally written by Rajeev Thakur, has been -in existence since XXX. - -... Discussion of the evolution of ROMIO ... - -Architecturally, ROMIO is broken up into three layers: a layer implementing -the MPI I/O routines in terms of an abstract device for I/O (ADIO), a layer of -common code implementing a subset of the ADIO interface, and a set of storage -system specific functions that complete the ADIO implementation in terms of -that storage type. These three layers work together to provide I/O support -for MPI applications. - -In this document we will discuss the details of the ROMIO implementation, -including the major components, how those components are implemented, and -where those components are located in the ROMIO source tree. - -\section{The Directory Structure} - -The ROMIO directory structure consists of two main branches, the MPI-IO branch -(mpi-io) and the ADIO branch (adio). The MPI-IO branch contains code that -implements the functions defined in the MPI specification for I/O, such as -MPI\_File\_open. These functions are then written in terms of other functions -that provide an abstract interface to I/O resources, the ADIO functions. -There is an additional glue subdirectory in the MPI-IO branch that defines -functions related to the MPI implementation as a whole, such as how to -allocate MPI\_File structures and how to report errors. - -Code for the ADIO functions is located under the ADIO branch. This code is -responsible for performing I/O operations on whatever underlying storage is -available. There are two categories of directories in this branch. The first -is the common directory. This directory contains two distinct types of -source: source that is used by all ADIO implementations and source that is -common across many ADIO implementations. This distinction will become more -apparent when we discuss file system implementations. - -The second category of directory in the ADIO branch is the file system -specific directory (e.g. ad\_ufs, ad\_pvfs2). These directories provide code -that is specific to a particular file system type and is only built if that -file system type is selected at configure time. - -\section{The Configure Process} - -... What can be specified, AIO stuff, where romioconf exists, how to add -another Makefile.in into the list. - -\section{File System Implementations} - -Each file system implementation exists in its own subdirectory under the adio -directory in the source tree. Each of these subdirectories must contain at -least two files, a Makefile.in (describing how to build the code in the -directory) and a C source file describing the mapping of ADIO operations to C -functions. - -The common practice is to name this file based on the name of the ADIO -implementation. In the ad\_ufs implementation this file is called ad\_ufs.c, -and contains the following: - -\begin{verbatim} -struct ADIOI_Fns_struct ADIO_UFS_operations = { - ADIOI_UFS_Open, /* Open */ - ADIOI_GEN_ReadContig, /* ReadContig */ - ADIOI_GEN_WriteContig, /* WriteContig */ - ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ - ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ - ADIOI_GEN_SeekIndividual, /* SeekIndividual */ - ADIOI_GEN_Fcntl, /* Fcntl */ - ADIOI_GEN_SetInfo, /* SetInfo */ - ADIOI_GEN_ReadStrided, /* ReadStrided */ - ADIOI_GEN_WriteStrided, /* WriteStrided */ - ADIOI_GEN_Close, /* Close */ - ADIOI_GEN_IreadContig, /* IreadContig */ - ADIOI_GEN_IwriteContig, /* IwriteContig */ - 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 */ -}; -\end{verbatim} - -The ADIOI\_Fns\_struct structure is defined in adio/include/adioi.h. This -structure holds pointers to appropriate functions for a given file system -type. "Generic" functions, defined in adio/common, are denoted by the -"ADIOI\_GEN" prefix, while file system specific functions use a file system -related prefix. In this example, the only file system specific function is -ADIOI\_UFS\_Open. All other operations use the generic versions. - -Typically a third file, a header with file system specific defines and -includes, is also provided and named based on the name of the ADIO -implementation (e.g. ad\_ufs.h). - -Because the UFS implementation provides its own open function, that code must be provided in the ad\_ufs subdirectory. That function is implemented in adio/ad\_ufs/ad\_ufs\_open.c. - -\section{Generic Functions} - -As we saw in the discussion above, generic ADIO function implementations are -used to minimize the amount of code in the ROMIO tree by sharing common -functionality between ADIO implementations. As the ROMIO implementation has -grown, a few categories of generic implementations have developed. At this -time, these are all lumped into the adio/common subdirectory together, which -can be confusing. - -The easiest category of generic functions to understand is the ones that -implement functionality in terms of some other ADIO function. -ADIOI\_GEN\_ReadStridedColl is a good example of this type of function and is -implemented in adio/common/ad\_read\_coll.c. This function implements -collective read operations (e.g. MPI\_File\_read\_at\_all). We will discuss how -it works later in this document, but for the time being it is sufficient to -note that it is written in terms of ADIO ReadStrided or ReadContig calls. - -A second category of generic functions are ones that implement functionality -in terms of POSIX I/O calls. ADIOI\_GEN\_ReadContig (adio/common/ad\_read.c) is -a good example of this type of function. These "generic" functions are the -result of a large number of ADIO implementations that are largely POSIX I/O -based, such as the UFS, XFS, and PANFS implementations. We have discussed -moving these functions into a separate common/posix subdirectory and renaming -them with ADIOI\_POSIX prefixes, but this has not been done as of the writing -of this document. - -The next category of generic functions holds functions that do not actually -require I/O at all. ADIOI\_GEN\_SeekIndividual (adio/common/ad\_seek.c) is a -good example of this. Since we don't need to actually perform I/O at seek -time, we can just update local variables at each process. In fact, one could -argue that we no longer need the ADIO SeekIndividual function at all - all the -ADIO implementations simply use this generic version (with the exception of -TESTFS, which prints the value as well). - -The next category of generic functions are the "FAKE" functions (e.g. -ADIOI\_FAKE\_IODone implemented in adio/common/ad\_done\_fake.c). These functions -are all related to asynchronous I/O (AIO) operations. These implement the AIO -operations in terms of blocking operations - in other words, they follow the -standard but do not allow for overlap of I/O and computation or communication. -These are used in cases where AIO support is otherwise unavailable or -unimplemented. - -The final category of generic functions are the "nave" functions (e.g. -ADIOI\_GEN\_WriteStrided\_naive in adio/common/ad\_write\_str\_naive.c). These -functions avoid the use of certain optimizations, such as data sieving. - -Other Things in adio/common - -... what else is in there? - -\subsection{Calling ADIO Functions} - -Throughout the code you will see calls to functions such as ADIO\_ReadContig. -There is no such function - this is actually a macro defined in -adio/include/adioi.h that calls the particular function out of the correct -ADIOI\_Fns\_struct for the file being accessed. This is done for convenience. - -Exceptions!!! ADIO\_Open, ADIO\_Close... - -\section{ROMIO Implementation Details} - -The ROMIO Implementation relies on some basic concepts in order to operate and -to optimize I/O access. In this section we will discuss these concepts and -how they are implemented within ROMIO. Before we do that though, we will -discuss the core data structure of ROMIO, the ADIO\_File structure. - -\subsection{ADIO\_File} - -... discussion ... - -\subsection{I/O Aggregation and Aggregators} - -When performing collective I/O operations, it is often to our advantage to -combine operations or eliminate redundant operations altogether. We call this -combining process "aggregation", and processes that perform these combined -operations aggregators. - -Aggregators are defined at the time the file is opened. A collection of MPI -hints can be used to tune what processes become aggregators for a given file -(see ROMIO User's Guide). The aggregators will then interact with the file -system during collective operations. - -Note that it is possible to implement a system where ALL I/O operations pass -exclusively through aggregators, including independent I/O operations from -non-aggregators. However, this would require a guarantee of progress from the -aggregators that for portability would mean adding a thread to manage I/O. We -have chosen not to pursue this path at this time, so independent operations -continue to be serviced by the process making the call. - -... how implemented ... - -Rank 0 in the communicator opening a file \emph{always} processes the -cb\_config\_list hint using ADIOI\_cb\_config\_list\_parse. A previous call to -ADIOI\_cb\_gather\_name\_array had collected the processor names from all hosts -into an array that is cached on the communicator (so we don't have to gather -it more than once). This creates an ordered array of ranks (relative to the -communicator used to open the file) that will be aggregators. This array is -distributed to all processes using ADIOI\_cb\_bcast\_rank\_map. Aggregators are -referenced by their rank in the communicator used to open the file. These -ranks are stored in fd->hints->ranklist[]. - -Note that this could be a big list for very large runs. If we were to -restrict aggregators to a rank order subset, we could use a bitfield instead. - -If the user specified hints and met conditions for deferred open, then a -separate communicator is also set up (fd->agg\_comm) that contains all the -aggregators, in order of their original ranks (not their order in the rank -list). Otherwise this communicator is set to MPI\_COMM\_NULL, and in any case -it is set to this for non-aggregators. This communicator is currently only -used at ADIO\_Close (adio/common/ad\_close.c), but could be useful in two-phase -I/O as well (discussed later). - - -\subsection{Deferred Open} - -We do not always want all processes to attempt to actually open a file when -MPI\_File\_open is called. We might want to avoid this open because in fact -some processes (non-aggregators) cannot access the file at all and would get -an error, or we might want to avoid this open to avoid a storm of system calls -hitting the file system all at once. In either case, ROMIO implements a -"deferred open" mode that allows some processes to avoid opening the file -until such time as they perform an independent I/O operation on the file (see -ROMIO User's Guide). - -Deferred open has a broad impact on the ROMIO implementation, because with its -addition there are now many places where we must first check to see if we have -called the file system specific ADIO Open call before performing I/O. This -impact is limited to the MPI-IO layer by semantically guaranteeing the FS ADIO -Open call has been made by the process prior to calling a read or write -function. - -... how implemented ... - -\subsection{Two-Phase I/O} - -Two-Phase I/O is a technique for increasing the efficiency of I/O operations -by reordering data between processes, either before writes, or after reads. - -ROMIO implements two-phase I/O as part of the generic implementations of -ADIO\_WriteStridedColl and ADIO\_ReadStridedColl. These implementations in turn -rely heavily on the aggregation code to determine what processes will actually -perform I/O on behalf of the application as a whole. - - - -\subsection{Data Sieving} - -Data sieving is a single-process technique for reducing the number of I/O -operations used to service a MPI read or write operation by accessing a -contiguous region of the file that contains more than one desired region at -once. Because often I/O operations require data movement across the network, -this is usually a more efficient way to access data. - -Data sieving is implemented in the common strided I/O routines -(adio/common/ad\_write\_str.c and adio/common/ad\_read\_str.c). These functions -use the contig read and write routines to perform actual I/O. In the case of -a write operation, a read/modify/write sequence is used. In that case, as -well as in the atomic mode case, locking is required on the region. Some of -the ADIO implementations do not currently support locking, and in those cases -it would be erroneous to use the generic strided I/O routines. - -\subsection{Shared File Pointers} - -Because no file systems supported by ROMIO currently support a shared file -pointer mode, ROMIO must implement shared file pointers under the covers on -its own. - -Currently ROMIO implements shared file pointers by storing the file pointer -value in a separate file... - -Note that the ROMIO team has devised a portable method for implementing shared -file pointers using only MPI functions. However, this method has -not yet been implemented in ROMIO. - -file name is selected at end of mpi-io/open.c. - -\subsection{Error Handling} - -\subsection{MPI and MPIO Requests} - -\section*{Appendix A: ADIO Functions and Semantics} - -ADIOI\_Open(ADIO\_File fd, int *error\_code) - -Open is used in a strange way in ROMIO, as described previously. - -The Open function is used to perform whatever operations are necessary prior -to actually accessing a file using read or write. The file name for the file -is stored in fd->filename prior to Open being called. - -Note that when deferred open is in effect, all processes may not immediately -call Open at MPI\_File\_open time, but instead call open if they perform -independent I/O. This can result in somewhat unusual error returns to -processes (e.g. learning that a file is not accessible at write time). - -ADIOI\_ReadContig(ADIO\_File fd, void *buf, int count, MPI\_Datatype datatype, -int file\_ptr\_type, ADIO\_Offset offset, ADIO\_Status *status, int *error\_code) - -ReadContig is used to read a contiguous region from a file into a contiguous -buffer. The datatype (which refers to the buffer) can be assumed to be -contiguous. The offset is in bytes and is an absolute offset if -ADIO\_EXPLICIT\_OFFSET was passed as the file\_ptr\_type or relative to the -current individual file pointer if ADIO\_INDIVIDUAL was passed as -file\_ptr\_type. Open has been called by this process prior to the call to -ReadContig. There is no guarantee that any other processes will call this -function at the same time. - -ADIOI\_WriteContig(ADIO\_File fd, void *buf, int count, MPI\_Datatype datatype, -int file\_ptr\_type, ADIO\_Offset offset, ADIO\_Status *status, int *error\_code) - -WriteContig is used to write a contiguous region to a file from a contiguous -buffer. The datatype (which refers to the buffer) can be assumed to be -contiguous. The offset is in bytes and is an absolute offset if -ADIO\_EXPLICIT\_OFFSET was passed as the file\_ptr\_type or relative to the -current individual file pointer if ADIO\_INDIVIDUAL was passed as -file\_ptr\_type. Open has been called by this process prior to the call to -WriteContig. There is no guarantee that any other processes will call this -function at the same time. - -ADIOI\_ReadStridedColl - -ADIOI\_WriteStridedColl - -ADIOI\_SeekIndividual - -ADIOI\_Fcntl - -ADIOI\_SetInfo - -ADIOI\_ReadStrided - -ADIOI\_WriteStrided - -ADIOI\_Close(ADIO\_File fd, int *error\_code) - -Close is responsible for releasing any resources associated with an open file. -It is called on all processes that called the corresponding ADIOI Open, which -might not be all the processes that opened the file (due to deferred open). -Thus it is not safe to perform collective communication among all processes in -the communicator during Close, although collective communication between -aggregators would be safe (if desired). - -For performance reasons ROMIO does not guarantee that all file data is written -to "storage" at MPI\_File\_close, instead only performing synchronization -operations at MPI\_File\_sync time. As a result, our Close implementations do -not typically call a sync. However, any locally cached data, if any, should -be passed on to the underlying storage system at this time. - -Note that ADIOI\_GEN\_Close is implemented in adio/common/adi\_close.c; -ad\_close.c implements ADIO\_Close, which is called by all processes that opened -the file. - -ADIOI\_IreadContig - -ADIOI\_IwriteContig - -ADIOI\_ReadDone - -ADIOI\_WriteDone - -ADIOI\_ReadComplete - -ADIOI\_WriteComplete - -ADIOI\_IreadStrided - -ADIOI\_IwriteStrided - -ADIOI\_Flush - -ADIOI\_Resize(ADIO\_File fd, ADIO\_Offset size, int *error\_code) - -Resize is called collectively by all processes that opened the file referenced -by fd. It is not required that the Resize implementation block until all -processes have completed resize operations, but each process should be able to -see the correct size with a corresponding MPI\_File\_get\_size operation (an -independent operation that results in an ADIO Fcntl to obtain the file size). - -ADIOI\_Delete(char *filename, int *error\_code) - -Delete is called independently, and because only a filename is passed, there -is no opportunity to coordinate deletion if an application were to choose to -have all processes call MPI\_File\_delete. That's not likely to be an issue -though. - -\section*{Appendix B: Status of ADIO Implementations} - -... who wrote what, status, etc. - -Appendix C: Adding a New ADIO Implementation - -References - -\end{document} diff --git a/3rd-party/romio321/doc/users-guide.pdf b/3rd-party/romio321/doc/users-guide.pdf deleted file mode 100644 index 4d060499a95..00000000000 Binary files a/3rd-party/romio321/doc/users-guide.pdf and /dev/null differ diff --git a/3rd-party/romio321/doc/users-guide.tex b/3rd-party/romio321/doc/users-guide.tex deleted file mode 100644 index 3715431b718..00000000000 --- a/3rd-party/romio321/doc/users-guide.tex +++ /dev/null @@ -1,1143 +0,0 @@ -% \documentstyle[11pt,psfig]{article} -\documentstyle[11pt]{article} -\hoffset=-.7in -\voffset=-.6in -\textwidth=6.5in -\textheight=8.5in -\begin{document} -\vspace*{-1in} -\thispagestyle{empty} -\begin{center} -ARGONNE NATIONAL LABORATORY \\ -9700 South Cass Avenue \\ -Argonne, IL 60439 -\end{center} -\vskip .5 in -\begin{center} -\rule{1.75in}{.01in} \\ -\vspace{.1in} - -ANL/MCS-TM-234 \\ - -\rule{1.75in}{.01in} \\ - -\vskip 1.3in -{\Large\bf Users Guide for ROMIO: A High-Performance, \\ [1ex] -Portable MPI-IO Implementation} \\ [4ex] -by \\ [2ex] -{\large\it Rajeev Thakur, Robert Ross, Ewing Lusk, William Gropp, Robert Latham} -\vspace{1in} - -Mathematics and Computer Science Division - -\bigskip - -Technical Memorandum No.\ 234 - - -\vspace{1.4in} -Revised May 2004, November 2007, April 2010 - -\end{center} - -\vfill - -{\small -\noindent -This work was supported by the Mathematical, Information, and -Computational Sciences Division subprogram of the Office of Advanced -Scientific Computing Research, U.S. Department of Energy, under -Contract W-31-109-Eng-38; and by the Scalable I/O Initiative, a -multiagency project funded by the Defense Advanced Research Projects -Agency (Contract DABT63-94-C-0049), the Department of Energy, the -National Aeronautics and Space Administration, and the National -Science Foundation.} - -\newpage - - -%% Line Spacing (e.g., \ls{1} for single, \ls{2} for double, even \ls{1.5}) -%% - -\newcommand{\ls}[1] - {\dimen0=\fontdimen6\the\font - \lineskip=#1\dimen0 - \advance\lineskip.5\fontdimen5\the\font - \advance\lineskip-\dimen0 - \lineskiplimit=.9\lineskip - \baselineskip=\lineskip - \advance\baselineskip\dimen0 - \normallineskip\lineskip - \normallineskiplimit\lineskiplimit - \normalbaselineskip\baselineskip - \ignorespaces - } -\renewcommand{\baselinestretch}{1} -\newcommand {\ix} {\hspace*{2em}} -\newcommand {\mc} {\multicolumn} - - -\tableofcontents -\thispagestyle{empty} -\newpage - -\pagenumbering{arabic} -\setcounter{page}{1} -\begin{center} -{\bf Users Guide for ROMIO: A High-Performance,\\[1ex] -Portable MPI-IO Implementation} \\ [2ex] -by \\ [2ex] -{\it Rajeev Thakur, Robert Ross, Ewing Lusk, and William Gropp} - -\end{center} -\addcontentsline{toc}{section}{Abstract} -\begin{abstract} -\noindent -ROMIO is a high-performance, portable implementation of MPI-IO (the -I/O chapter in the \mbox{MPI Standard}). This document describes how to install and use -ROMIO version~1.2.4 on various machines. -\end{abstract} - -\section{Introduction} - -ROMIO\footnote{\tt http://www.mcs.anl.gov/romio} is a -high-performance, portable implementation of MPI-IO (the I/O chapter in -MPI~\cite{mpi97a}). This document describes how to install and use -ROMIO version~1.2.4 on various machines. - - -% -% MAJOR CHANGES IN THIS VERSION -% -\section{Major Changes in This Version} -\begin{itemize} -\item Added section describing ROMIO \texttt{MPI\_FILE\_SYNC} and - \texttt{MPI\_FILE\_CLOSE} behavior to User's Guide -\item Bug removed from PVFS ADIO implementation regarding resize operations -\item Added support for PVFS listio operations (see Section \ref{sec:hints}) -\item Added the following working hints: - \texttt{romio\_pvfs\_listio\_read}, \texttt{romio\_pvfs\_listio\_write} -\end{itemize} - -% -% GENERAL INFORMATION -% -\section{General Information} - -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 (\S~4.13.3). The subarray and -distributed array datatype constructor functions from Chapter 4 -(\S~4.14.4 \& \S~4.14.5) have been implemented. They are useful for -accessing arrays stored in files. The functions {\tt MPI\_File\_f2c} -and {\tt MPI\_File\_c2f} (\S~4.12.4) are also implemented. C, -Fortran, and profiling interfaces are provided for all functions that -have been implemented. - -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, NTFS, and any Unix file system (UFS). - -This version of ROMIO is included in MPICH 1.2.4; an earlier version -is included in at least the following MPI implementations: LAM, HP -MPI, SGI MPI, and NEC MPI. - -Note that proper I/O error codes and classes are returned and the status -variable is filled only when used with MPICH revision 1.2.1 or later. - -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 from 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, for example, -{\tt ls}, {\tt mv}, {\tt cp}, {\tt rm}, {\tt ftp}. - -Please read the limitations of this version of ROMIO that are listed -in Section~\ref{sec:limit} of this document (e.g., restriction to homogeneous -environments). - -\subsection{ROMIO Optimizations} -\label{sec:opt} - -ROMIO implements two I/O optimization techniques that in general -result in improved performance for applications. The first of these -is \emph{data sieving}~\cite{choudhary:passion}. Data sieving is a -technique for efficiently accessing noncontiguous regions of data in files -when noncontiguous accesses are not provided as a file system primitive. -The naive approach to accessing noncontiguous regions is to use a separate -I/O call for each contiguous region in the file. This results in a large -number of I/O operations, each of which is often for a very small amount -of data. The added network cost of performing an I/O operation across the -network, as in parallel I/O systems, is often high because of latency. -Thus, this naive approach typically performs very poorly because of -the overhead of multiple operations. -% -In the data sieving technique, a number of noncontiguous regions are -accessed by reading a block of data containing all of the regions, -including the unwanted data between them (called ``holes''). The regions -of interest are then extracted from this large block by the client. -This technique has the advantage of a single I/O call, but additional -data is read from the disk and passed across the network. - -There are four hints that can be used to control the application of -data sieving in ROMIO: \texttt{ind\_rd\_buffer\_size}, -\texttt{ind\_wr\_buffer\_size}, \texttt{romio\_ds\_read}, -and \texttt{romio\_ds\_write}. These are discussed in -Section~\ref{sec:hints}. - -The second optimization is \emph{two-phase -I/O}~\cite{bordawekar:primitives}. Two-phase I/O, also called collective -buffering, is an optimization that only applies to collective I/O -operations. In two-phase I/O, the collection of independent I/O operations -that make up the collective operation are analyzed to determine what -data regions must be transferred (read or written). These regions are -then split up amongst a set of aggregator processes that will actually -interact with the file system. In the case of a read, these aggregators -first read their regions from disk and redistribute the data to the -final locations, while in the case of a write, data is first collected -from the processes before being written to disk by the aggregators. - -There are five hints that can be used to control the application -of two-phase I/O: \texttt{cb\_config\_list}, \texttt{cb\_nodes}, -\texttt{cb\_buffer\_size}, \texttt{romio\_cb\_read}, -and \texttt{romio\_cb\_write}. These are discussed in -Subsection~\ref{sec:hints}. - -\subsection{Hints} -\label{sec:hints} - -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 for a file -can be obtained at any time via {\tt MPI\_File\_get\_info}. - -The following hints control the data sieving optimization and are -applicable to all file system types: - -\begin{itemize} -\item \texttt{ind\_rd\_buffer\_size} -- Controls the size (in bytes) of the -intermediate buffer used by ROMIO when performing data sieving during -read operations. Default is \texttt{4194304} (4~Mbytes). -\item \texttt{ind\_wr\_buffer\_size} -- Controls the size (in bytes) of the -intermediate buffer used by ROMIO when performing data sieving during -write operations. Default is \texttt{524288} (512~Kbytes). -\item \texttt{romio\_ds\_read} -- -Determines when ROMIO will choose to perform data sieving. -Valid values are \texttt{enable}, \texttt{disable}, or \texttt{automatic}. -Default value is \texttt{automatic}. In \texttt{automatic} mode ROMIO -may choose to enable or disable data sieving based on heuristics. -\item \texttt{romio\_ds\_write} -- Same as above, only for writes. -\end{itemize} - -The following hints control the two-phase (collective buffering) -optimization and are applicable to all file system types: -\begin{itemize} -\item \texttt{cb\_buffer\_size} -- Controls the size (in bytes) of the -intermediate buffer used in two-phase collective I/O. If the amount -of data that an aggregator will transfer is larger than this value, -then multiple operations are used. The default is \texttt{4194304} (4~Mbytes). -\item \texttt{cb\_nodes} -- Controls the maximum number of aggregators -to be used. By default this is set to the number of unique hosts in the -communicator used when opening the file. -\item \texttt{romio\_cb\_read} -- Controls when collective buffering is -applied to collective read operations. Valid values are -\texttt{enable}, \texttt{disable}, and \texttt{automatic}. Default is -\texttt{automatic}. When enabled, all collective reads will use -collective buffering. When disabled, all collective reads will be -serviced with individual operations by each process. When set to -\texttt{automatic}, ROMIO will use heuristics to determine when to -enable the optimization. -\item \texttt{romio\_cb\_write} -- Controls when collective buffering is -applied to collective write operations. Valid values are -\texttt{enable}, \texttt{disable}, and \texttt{automatic}. Default is -\texttt{automatic}. See the description of \texttt{romio\_cb\_read} for -an explanation of the values. -\item \texttt{romio\_no\_indep\_rw} -- This hint controls when ``deferred -open'' is used. When set to \texttt{true}, ROMIO will make an effort to avoid -performing any file operation on non-aggregator nodes. The application is -expected to use only collective operations. This is discussed in further -detail below. -\item \texttt{cb\_config\_list} -- Provides explicit control over -aggregators. This is discussed in further detail below. -\end{itemize} - -For some systems configurations, more control is needed to specify which -hardware resources (processors or nodes in an SMP) are preferred for -collective I/O, either for performance reasons or because only certain -resources have access to storage. The additional MPI\_Info key name -\texttt{cb\_config\_list} specifies a comma-separated list of strings, -each string specifying a particular node and an optional limit on the -number of processes to be used for collective buffering on this node. - -This refers to the same processes that \texttt{cb\_nodes} refers to, -but specifies the available nodes more precisely. - -The format of the value of \texttt{cb\_config\_list} is given by the -following BNF: -\begin{verbatim} -cb_config_list => hostspec [ ',' cb_config_list ] -hostspec => hostname [ ':' maxprocesses ] -hostname => - | '*' -maxprocesses => - | '*' -\end{verbatim} - -The value \texttt{hostname} identifies a processor. This name must match -the name returned by \texttt{MPI\_Get\_processor\_name}~\footnote{The -MPI standard requires that the output from this routine identify a -particular piece of hardware; some MPI implementations may not conform -to this requirement. MPICH does conform to the MPI standard.} -% -for the specified hardware. The value \texttt{*} as a hostname matches all -processors. The value of maxprocesses may be any nonnegative integer -(zero is allowed). - -The value \texttt{maxprocesses} specifies the maximum number of -processes that may be used for collective buffering on the specified -host. If no value is specified, the value one is assumed. If \texttt{*} -is specified for the number of processes, then all MPI processes with -this same hostname will be used.. - -Leftmost components of the info value take precedence. - -Note: Matching of processor names to \texttt{cb\_config\_list} entries -is performed with string matching functions and is independent of the -listing of machines that the user provides to mpirun/mpiexec. In other -words, listing the same machine multiple times in the list of hosts to -run on will not cause a \texttt{*:1} to assign the same host four -aggregators, because the matching code will see that the processor name -is the same for all four and will assign exactly one aggregator to the -processor. - -The value of this info key must be the same for all processes (i.e., the -call is collective and each process must receive the same hint value for -these collective buffering hints). Further, in the ROMIO implementation -the hint is only recognized at \texttt{MPI\_File\_open} time. - -The set of hints used with a file is available through the routine -\texttt{MPI\_File\_get\_info}, as documented in the MPI standard. -As an additional feature in the ROMIO implementation, wildcards will -be expanded to indicate the precise configuration used with the file, -with the hostnames in the rank order used for the collective buffering -algorithm (\emph{this is not implemented at this time}). - -Here are some examples of how this hint might be used: -\begin{itemize} -\item \texttt{*:1} One process per hostname (i.e., one process per node) -\item \texttt{box12:30,*:0} Thirty processes on one machine, namely - \texttt{box12}, and none anywhere else. -\item \texttt{n01,n11,n21,n31,n41} One process on each of these specific - nodes only. -\end{itemize} - -When the values specified by \texttt{cb\_config\_list} conflict with -other hints (e.g., the number of collective buffering nodes specified by -\texttt{cb\_nodes}), the implementation is encouraged to take the minimum -of the two values. In other words, if \texttt{cb\_config\_list} specifies -ten processors on which I/O should be performed, but \texttt{cb\_nodes} -specifies a smaller number, then an implementation is encouraged to use -only \texttt{cb\_nodes} total aggregators. If \texttt{cb\_config\_list} -specifies fewer processes than \texttt{cb\_nodes}, no more than the -number in \texttt{cb\_config\_list} should be used. - -The implementation is also encouraged to assign processes in the order -that they are listed in \texttt{cb\_config\_list}. - -The following hint controls the deferred open feature of romio and are also -applicable to all file system types: -\begin{itemize} -\item \texttt{romio\_no\_indep\_rw} -- If the application plans on performing only - collecitve operations and this hint is set to ``true'', then ROMIO can - have just the aggregators open a file. The \texttt{cb\_config\_list} and - \texttt{cb\_nodes} hints can be given to further control which nodes are - aggregators. -\end{itemize} - -For PVFS, PIOFS, and PFS: -\begin{itemize} -\item \texttt{striping\_factor} -- Controls the number of I/O devices to -stripe across. The default is file system dependent, but for PVFS it is -\texttt{-1}, indicating that the file should be striped across all I/O -devices. -\item \texttt{striping\_unit} -- Controls the striping unit (in bytes). -For PVFS the default will be the PVFS file system default strip size. -\item \texttt{start\_iodevice} -- Determines what I/O device data will -first be written to. This is a number in the range of 0 ... -striping\_factor - 1. -\end{itemize} - -\subsubsection{Hints for PFS} -\label{sec:hints_pfs} -\begin{itemize} -\item \texttt{pfs\_svr\_buf} -- Turns on PFS server buffering. Valid -values are \texttt{true} and \texttt{false}. Default is \texttt{false}. -\end{itemize} - -\subsubsection{Hints for XFS} -\label{sec:hints_xfs} -For XFS control is provided for the direct I/O optimization: -\begin{itemize} -\item \texttt{direct\_read} -- Controls direct I/O for reads. Valid -values are \texttt{true} and \texttt{false}. Default is \texttt{false}. -\item \texttt{direct\_write} -- Controls direct I/O for writes. Valid -values are \texttt{true} and \texttt{false}. Default is \texttt{false}. -\end{itemize} - -\subsubsection{Hints for PVFS (v1)} -\label{sec:hints_oldpvfs} - -For PVFS control is provided for the use of the listio interface. This -interface to PVFS allows for a collection of noncontiguous regions to be -requested (for reading or writing) with a single operation. This can result -in substantially higher performance when accessing noncontiguous regions. -Support for these operations in PVFS exists after version 1.5.4, but has not -been heavily tested, so use of the interface is disabled in ROMIO by default -at this time. The hints to control listio use are: -\begin{itemize} -\item \texttt{romio\_pvfs\_listio\_read} -- Controls use of listio for reads. -Valid values are \texttt{enable}, \texttt{disable}, and \texttt{automatic}. -Default is \texttt{disable}. -\item \texttt{romio\_pvfs\_listio\_write} -- Controls use of listio for writes. -Valid values are \texttt{enable}, \texttt{disable}, and \texttt{automatic}. -Default is \texttt{disable}. -\end{itemize} - -\subsubsection{Hints for PVFS (v2)} -\label{sec:hints_pvfs} - -The PVFS v2 file system has many tuning parameters. -\begin{itemize} -\item dtype i/o -\end{itemize} - -\subsubsection{Hints for Lustre} - -\begin{itemize} -\item romio\_lustre\_co\_ratio - -In stripe-contiguous IO pattern, each OST will be accessed by a group of -IO clients. CO means *C*lient/*O*ST ratio, or the max. number of IO clients -for each OST. -CO=1 by default. - -\item \texttt{romio\_lustre\_coll\_threshold} - -We won't do collective I/O if this hint is set and the IO request size is -bigger than this value. That's because when the request size is big, the -collective communication overhead increases and the benefits from collective -I/O becomes limited. A value of 0 means always perform collective I/O - -\item \texttt{romio\_lustre\_cb\_ds\_threshold} - -ROMIO can optimize collective I/O with a version of data sieving. If the I/O -request is smaller than this hint's value, though, ROMIO will not try to apply -the data sieving optimization. - -\item \texttt{romio\_lustre\_ds\_in\_coll} - -Collective IO will apply read-modify-write to deal with non-contiguous -data by default. However, it will introduce some overhead(IO operation and -locking). The Lustre developers have run tests where data sieving showed bad -collective write performance for some kinds of workloads. So, to avoid this, -we define the \texttt{romio\_lustre\_ds\_in\_coll} hint to disable the read-modify-write -step in collective I/O. This optimization is distinct from the one in -independent I/O (controlled by \texttt{romio\_ds\_read} and -\texttt{romio\_ds\_write}). - -\end{itemize} - -\subsubsection{Hints for PANFS (Panasas)} - -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 -\texttt{panfs\_layout\_*} hints are only used if supplied at file-creation -time. -\begin{itemize} - -\item \texttt{panfs\_layout\_type} Specifies the layout of a file: 2 = RAID0 -3 = RAID5 Parity Stripes - -\item \texttt{panfs\_layout\_stripe\_unit} The size of the stripe unit -in bytes - -\item \texttt{panfs\_layout\_total\_num\_comps} The total number of -StorageBlades a file is striped across. - -\item \texttt{ panfs\_layout\_parity\_stripe\_width} If the layout type is -RAID5 Parity Stripes, this hint specifies the number of StorageBlades in a -parity stripe. - -\item \texttt{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. - -\item \texttt{panfs\_layout\_visit\_policy} If the layout type is RAID5 Parity -Stripes, the policy used to determine the parity stripe a given file offset is -written to: 1 = Round Robin -\end{itemize} - -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. - -\begin{itemize} -\item \texttt{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. -\end{itemize} - -Below is an example PanFS layout using the following parameters: -\begin{verbatim} - - - panfs_layout_type = 3 - - panfs_layout_total_num_comps = 100 - - panfs_layout_parity_stripe_width = 10 - - 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 . . . . . . - ... -\end{verbatim} - -\subsubsection{Systemwide Hints} -\label{sec:system_hints} - -A site administrator with knowledge of the storage and networking capabilities -of a machine might be able to come up with a set of hint values that work -better for that machine than the ROMIO default values. As an extention to the -standard, ROMIO will consult a ``hints file''. This file provides an -additional mechanism for setting MPI-IO hints, albeit in a ROMIO-specific -manner. The hints file contains a list of hints and their values. ROMIO will -use these initial hint settings, though programs are free to override any of -them. - -The format of the hints file is a list of hints and their values, one per line. -A \# character in the first column indicates a comment, and ROMIO will ignore -the entire line. Here's an example: - -\begin{verbatim} -# this is a comment describing the following setting -cb_nodes 32 -# these nodes happen to have the best connection to storage -cb_config_list n01,n11,n21,n31,n41 -\end{verbatim} - -ROMIO will look for these hints in the file \texttt{/etc/romio-hints}. A user -can set the environment variable \texttt{ROMIO\_HINTS} to the name of a file -which ROMIO will use instead. - -\subsection{Using ROMIO on NFS} - -It is worth first mentioning that in no way do we encourage the use -of ROMIO on NFS volumes. NFS is not a high-performance protocol, nor -are NFS servers typically very good at handling the types of concurrent -access seen from MPI-IO applications. Nevertheless, NFS is a very popular -mechanism for providing access to a shared space, and ROMIO does support -MPI-IO to NFS volumes, provided that they are configured properly. - -To use ROMIO on NFS, file locking with {\tt 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 ``{\tt 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 {\tt 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. - -\begin{verbatim} - >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 -\end{verbatim} - -\subsubsection{ROMIO, NFS, and Synchronization} - -NFS has a ``sync'' option that specifies that the server should put data on -the disk before replying that an operation is complete. This means that -the actual I/O cost on the server side cannot be hidden with caching, -etc. when this option is selected. - -In the ``async'' mode the server can get the data into a buffer (and -perhaps put it in the write queue; this depends on the implementation) -and reply right away. Obviously if the server were to go down after the -reply was sent but before the data was written, the system would be in -a strange state, which is why so many articles suggest the "sync" option. - -Some systems default to ``sync'', while others default to ``async'', -and the default can change from version to version of the NFS software. If -you find that access to an NFS volume through MPI-IO is particularly slow, -this is one thing to check out. - - -\subsection{Using testfs} -The testfs ADIO implementation provides a harness for testing components -of ROMIO or discovering the underlying I/O access patterns of an -application. When testfs is specified as the file system type, no -actual files will be opened. Instead debugging information will be -displayed on the processes opening the file. Subsequent I/O operations -on this testfs file will provide additional debugging information. - -The intention of the testfs implementation is that it serve as a -starting point for further instrumentation when debugging new features -or applications. As such it is expected that users will want to modify -the ADIO implementation in order to get the specific output they desire. - -\subsection{ROMIO and {\tt MPI\_FILE\_SYNC}} - -The MPI specification notes that a call to {\tt MPI\_FILE\_SYNC} ``causes -all previous writes to {\tt fh} by the calling process to be transferred to -the storage device.'' Likewise, calls to {\tt MPI\_FILE\_CLOSE} have this -same semantic. Further, ``if all processes have made updates to the storage -device, then all such updates become visible to subsequent reads of {\tt fh} -by the calling process.'' - -The intended use of {\tt MPI\_FILE\_SYNC} is to allow all processes in the -communicator used to open the file to see changes made to the file by each -other (the second part of the specification). The definition of ``storage -device'' in the specification is vague, and it isn't necessarily the case that -calling {\tt MPI\_FILE\_SYNC} will force data out to permanent storage. - -Since users often use {\tt MPI\_FILE\_SYNC} to attempt to force data out to -permanent storage (i.e. disk), the ROMIO implementation of this call enforces -stronger semantics for most underlying file systems by calling the appropriate -file sync operation when {\tt MPI\_FILE\_SYNC} is called (e.g. {\tt fsync}). -However, it is still unwise to assume that the data has all made it to disk -because some file systems (e.g. NFS) may not force data to disk when a client -system makes a sync call. - -For performance reasons we do \emph{not} make this same file system call at -{\tt MPI\_FILE\_CLOSE} time. At close time ROMIO ensures any data has been -written out to the ``storage device'' (file system) as defined in the -standard, but does not try to push the data beyond this and into physical -storage. Users should call {\tt MPI\_FILE\_SYNC} before the close if they wish -to encourage the underlying file system to push data to permanent storage. - -\subsection{ROMIO and {\tt MPI\_FILE\_SET\_SIZE}} - -{\tt MPI\_FILE\_SET\_SIZE} is a collective routine used to resize a file. It -is important to remember that a MPI-IO routine being collective does not imply -that the routine synchronizes the calling processes in any way (unless this is -specified explicitly). - -As of 1.2.4, ROMIO implements {\tt MPI\_FILE\_SET\_SIZE} by calling {\tt -ftruncate} from all processes. Since different processes may call the -function at different times, it means that unless external synchronization is -used, a resize operation mixed in with writes or reads could have unexpected -results. - -In short, if synchronization after a set size is needed, the user should add a -barrier or similar operation to ensure the set size has completed. - - -% -% INSTALLATION INSTRUCTIONS -% -\section{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 -\begin{verbatim} - gunzip -c romio.tar.gz | tar xvf - -\end{verbatim} -{\noindent or} -\begin{verbatim} - zcat romio.tar.Z | tar xvf - -\end{verbatim} - -{\noindent then} - -\begin{verbatim} - cd romio - ./configure - make -\end{verbatim} - -Some example programs and a Makefile are provided in the {\tt romio/test} -directory. Run the examples as you would run any MPI program. Each -program takes the filename as a command-line argument ``{\tt -fname -filename}''. - -The {\tt configure} script by default configures ROMIO for the file -systems most likely -to be used on the given machine. If you wish, you can explicitly specify the file -systems by using the ``{\tt -file\_system}'' option to configure. Multiple file -systems can be specified by using `+' as a separator, e.g., \\ -\hspace*{.4in} {\tt ./configure -file\_system=xfs+nfs} \\ -For the entire list of options to configure, do\\ -\hspace*{.4in} {\tt ./configure -h | more} \\ -After building a specific version, you can install it in a -particular directory with \\ -\hspace*{.4in} {\tt make install PREFIX=/usr/local/romio (or whatever directory you like)} \\ -or just\\ -\hspace*{.4in} {\tt make install (if you used -prefix at configure time)} - -If you intend to leave ROMIO where you built it, you should {\it not} -install it; {\tt make 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 {\tt 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\\ -\hspace*{.4in} {\tt make distclean}\\ -to clean everything, including the Makefiles created by {\tt -configure}. Then run {\tt configure} again with the new options, -followed by {\tt make}. - -\subsection{Configuring for Linux and Large Files } - -32-bit systems running linux kernel version 2.4.0 or newer and glibc -version 2.2.0 or newer can support files greater than 2 GBytes in size. -This support is currently automaticly detected and enabled. We document the -manual steps should the automatic detection not work for some reason. - -The two macros {\tt\_FILE\_OFFSET\_BITS=64} and -{\tt\_LARGEFILE64\_SOURCE} tell gnu libc it's ok to support large files -on 32 bit platforms. The former changes the size of {\tt off\_t} (no -need to change source. might affect interoperability with libraries -compiled with a different size of {\tt off\_t}). The latter exposes -the gnu libc functions open64(), write64(), read64(), etc. ROMIO does -not make use of the 64 bit system calls directly at this time, but we -add this flag for good measure. - -If your linux system is relatively new, there is an excellent chance it -is running kernel 2.4.0 or newer and glibc-2.2.0 or newer. Add the -string -\begin{verbatim} -"-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE" -\end{verbatim} -to your CFLAGS environment variable before runnint {\tt./configure} - -% -% TESTING ROMIO -% -\section{Testing ROMIO} -To test if the installation works, do\\ -\hspace*{.4in} {\tt make testing}\\ -in the {\tt romio/test} directory. This calls a script that runs the test -programs and compares the results with what they should be. By -default, {\tt 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:\\ -\hspace*{.4in} {\tt make testing TESTARGS="-fname=/foo/piofs/test"} - - -% -% COMPILING AND RUNNING MPI-IO PROGRAMS -% -\section{Compiling and Running MPI-IO Programs} -If ROMIO is not already included in the MPI implementation, you need -to include the file {\tt mpio.h} for C or {\tt mpiof.h} for Fortran in -your MPI-IO program. - -Note that on HP machines running HPUX and on NEC SX-4, you need to -compile Fortran programs with {\tt mpifort}, because {\tt mpif77} does -not support 8-byte integers. - -With MPICH, HP MPI, or NEC MPI, you can compile MPI-IO programs as \\ -\hspace*{.4in} {\tt mpicc foo.c}\\ -or \\ -\hspace*{.4in} {\tt mpif77 foo.f }\\ -or\\ -\hspace*{.4in} {\tt mpifort foo.f}\\ - -As mentioned above, mpifort is preferred over mpif77 on HPUX and NEC -because the f77 compilers on those machines do not support 8-byte integers. - -With SGI MPI, you can compile MPI-IO programs as \\ -\hspace*{.4in} {\tt cc foo.c -lmpi}\\ -or \\ -\hspace*{.4in} {\tt f77 foo.f -lmpi}\\ -or \\ -\hspace*{.4in} {\tt f90 foo.f -lmpi}\\ - -With LAM, you can compile MPI-IO programs as \\ -\hspace*{.4in} {\tt hcc foo.c -lmpi}\\ -or \\ -\hspace*{.4in} {\tt 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 {\tt \$(ROMIO\_HOME)/lib/\$(ARCH)/libmpio.a}. - -Run the program as you would run any MPI program on the machine. -If you use {\tt mpirun}, make sure you use the correct {\tt 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 -{\tt mpirun} and not SGI's {\tt mpirun}. - - -% -% LIMITATIONS -% -\section{Limitations of This Version of ROMIO \label{sec:limit}} - -\begin{itemize} -\item When used with any MPI implementation other than MPICH revision -1.2.1 or later, the {\tt status} argument is not filled in any MPI-IO -function. Consequently, {\tt MPI\_Get\_count} and\linebreak {\tt -MPI\_Get\_elements} will not work when passed the {\tt status} object -from an MPI-IO operation. - -\item Additionally, when used with any MPI implementation other than MPICH -revision 1.2.1 or later, all MPI-IO functions return only two possible -error codes---{\tt MPI\_SUCCESS} on success and {\tt MPI\_ERR\_UNKNOWN} -on failure. - -\item This version works only on a homogeneous cluster of machines, -and only the ``native'' file data representation is supported. - -\item Shared file pointers are not supported on PVFS and IBM PIOFS -file systems because they don't support {\tt fcntl} file locks, -and ROMIO uses that feature to implement shared file pointers. - -\item On HP machines running HPUX and on NEC SX-4, you need to compile -Fortran programs with {\tt mpifort} instead of {\tt mpif77}, because -the {\tt f77} compilers on these machines don't support 8-byte integers. - -\item The file-open mode {\tt MPI\_MODE\_EXCL} does not work on Intel -PFS file system, due to a bug in PFS. - -\end{itemize} - - -% -% USAGE TIPS -% -\section{Usage Tips} -\begin{itemize} -\item 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 -{\tt MPI\_TYPE\_MAX} for additional space.'' If you get this error message, -add the following line to your {\tt .cshrc} file:\\ -\hspace*{.4in} {\tt setenv MPI\_TYPE\_MAX 65536}\\ -Use a larger number if you still get the error message. -\item If a Fortran program uses a file handle created using ROMIO's C -interface, or vice versa, you must use the functions {\tt MPI\_File\_c2f} -or {\tt MPI\_File\_f2c} (see \S~4.12.4 in~\cite{mpi97a}). Such a -situation occurs, for example, if a Fortran program uses an I/O -library written in C -with MPI-IO calls. Similar functions {\tt MPIO\_Request\_f2c} and -{\tt MPIO\_Request\_c2f} are also provided. -\item For Fortran programs on the Intel Paragon, you may need -to provide the complete path to {\tt mpif.h} in the {\tt include} -statement, e.g., \\ -\hspace*{.4in} {\tt include '/usr/local/mpich/include/mpif.h'}\\ -instead of \\ -\hspace*{.4in} {\tt include 'mpif.h'}\\ -This is because the {\tt -I} -option to the Paragon Fortran compiler {\tt if77} doesn't work -correctly. It always looks in the default directories first and, -therefore, picks up Intel's {\tt mpif.h}, which is actually the {\tt -mpif.h} of an older version of MPICH. - -\end{itemize} - -% -% MAILING LIST -% -% this mailing list has been dead for a while -% -% REPORTING BUGS -% -\section{Reporting Bugs} -If you have trouble, first check the users guide. Then check if there -is a list of known bugs and patches on the ROMIO web page at {\tt -http://www.mcs.anl.gov/romio}. Finally, if you still have problems, send a -detailed message containing:\\ -\hspace*{.2in}$\bullet$ the type of system (often {\tt uname -a}),\\ -\hspace*{.2in}$\bullet$ the output of {\tt configure},\\ -\hspace*{.2in}$\bullet$ the output of {\tt make}, and \\ -\hspace*{.2in}$\bullet$ any programs or tests\\ -to {\tt romio-maint@mcs.anl.gov}. - - -% -% ROMIO INTERNALS -% -\section{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~\cite{thak96e}. 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~\cite{thak96e} will help you get started. - -MPI-IO implementation issues are discussed in~\cite{thak99b}. All -ROMIO-related papers are available online at {\tt -http://www.mcs.anl.gov/romio}. - - -\section{Learning MPI-IO} -The book {\em Using MPI-2: Advanced Features of the Message-Passing -Interface}~\cite{grop99a}, 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 {\tt -http://www.mcs.anl.gov/mpi/usingmpi2} for further information about -the book. - -% -% MAJOR CHANGES IN PREVIOUS RELEASES -% -\section{Major Changes in Previous Releases} - -\subsection{Major Changes in Version 1.2.3} -\begin{itemize} -\item Added explicit control over aggregators for collective operations - (see description of \texttt{cb\_config\_list}). -\item Added the following working hints: \texttt{cb\_config\_list}, - \texttt{romio\_cb\_read}, \texttt{romio\_cb\_write},\newline - \texttt{romio\_ds\_read}. These additional hints have - been added but are currently ignored by the implementation: - \texttt{romio\_ds\_write}, \texttt{romio\_no\_indep\_rw}. -\item Added NTFS ADIO implementation. -\item Added testfs ADIO implementation for use in debugging. -\item Added delete function to ADIO interface so that file systems that - need to use their own delete function may do so (e.g. PVFS). -\item Changed version numbering to match version number of MPICH release. -\end{itemize} - -\subsection{Major Changes in Version 1.0.3} -\begin{itemize} -\item When used with MPICH 1.2.1, the MPI-IO functions return proper -error codes and classes, and the status object is filled in. - -\item 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 {\tt -MPIO\_DIRECT\_READ} and/or {\tt MPIO\_DIRECT\_WRITE} to {\tt TRUE}, or -on a per-file basis by using the info keys {\tt direct\_read} and {\tt -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. - -\item Miscellaneous bug fixes. -\end{itemize} - -\subsection{Major Changes in Version 1.0.2} -\begin{itemize} -\item 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. - -\item Added support for using ``direct I/O'' on SGI's XFS file system. - Direct I/O is an optional feature of XFS in which data is moved - directly between the user's buffer and the storage devices, bypassing - the file-system cache. This can improve performance significantly on - 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 -\begin{verbatim} - setenv MPIO_DIRECT_READ TRUE - setenv MPIO_DIRECT_WRITE TRUE -\end{verbatim} - To use the hints method, the two keys are {\tt direct\_read} and {\tt - direct\_write}. By default their values are {\tt false}. To turn on - direct I/O, set the values to {\tt true}. The environment variables - have priority over the info keys. In other words, if the environment - variables are set to {\tt TRUE}, direct I/O will be used even if the - info keys say {\tt 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 {\tt ch\_shmem} device of MPICH. - -\item Added support (new ADIO device, {\tt ad\_pvfs}) for the PVFS parallel - file system for Linux clusters, developed at Clemson University - (see {\tt http://www.parl.clemson.edu/pvfs}). To use it, you - must first install PVFS and then when configuring ROMIO, specify - {\tt -file\_system=pvfs} in addition to any other options to {\tt - configure}. (As usual, you can configure for multiple file systems by - using ``{\tt +}''; for example, {\tt -file\_system=pvfs+ufs+nfs}.) You - will need to specify the path to the PVFS include files via the {\tt - -cflags} option to {\tt configure}, for example, \newline {\tt 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 {\tt - -lib} option to MPICH's {\tt configure} script (assuming you are using - ROMIO from within MPICH). - -\item Uses weak symbols (where available) for building the profiling version, - i.e., the PMPI routines. As a result, the size of the library is reduced - considerably. - -\item The Makefiles use {\em virtual paths} if supported by the make - utility. GNU {\tt make} - supports it, for example. This feature allows you to untar the - distribution in some directory, say a slow NFS directory, - and compile the library (create the .o files) in another - directory, say on a faster local disk. For example, if the tar file - has been untarred in an NFS directory called {\tt /home/thakur/romio}, - one can compile it in a different directory, say {\tt /tmp/thakur}, as - follows: -\begin{verbatim} - cd /tmp/thakur - /home/thakur/romio/configure - make -\end{verbatim} - The .o files will be created in {\tt /tmp/thakur}; the library will be created in\newline - {\tt /home/thakur/romio/lib/\$ARCH/libmpio.a}. - This method works only if the {\tt make} utility supports {\em - virtual paths}. - If the default {\tt make} utility does not, you can install GNU {\tt - make} which does, and specify it to {\tt configure} as -\begin{verbatim} - /home/thakur/romio/configure -make=/usr/gnu/bin/gmake (or whatever) -\end{verbatim} - -\item Lots of miscellaneous bug fixes and other enhancements. - -\item This version is included in MPICH 1.2.0. If you are using MPICH, you - need not download ROMIO separately; it gets built as part of MPICH. - The previous version of ROMIO is included in LAM, HP MPI, SGI MPI, and - NEC MPI. NEC has also implemented the MPI-IO functions missing - in ROMIO, and therefore NEC MPI has a complete implementation of MPI-IO. -\end{itemize} - - -\subsection{Major Changes in Version 1.0.1} - -\begin{itemize} -\item This version is included in MPICH 1.1.1 and HP MPI 1.4. - -\item Added support for NEC SX-4 and created a new device {\tt ad\_sfs} for -NEC SFS file system. - -\item New devices {\tt ad\_hfs} for HP HFS file system and {\tt -ad\_xfs} for SGI XFS file system. - -\item Users no longer need to prefix the filename with the type of -file system; ROMIO determines the file-system type on its own. - -\item Added support for 64-bit file sizes on IBM PIOFS, SGI XFS, -HP HFS, and NEC SFS file systems. - -\item {\tt MPI\_Offset} is an 8-byte integer on machines that support -8-byte integers. It is of type {\tt long long} in C and {\tt -integer*8} in Fortran. With a Fortran 90 compiler, you can use either -{\tt integer*8} or {\tt integer(kind=MPI\_OFFSET\_KIND)}. -If you {\tt printf} an {\tt MPI\_Offset} in C, remember to use {\tt \%lld} -or {\tt \%ld} as required by your compiler. (See what is used in the test -program {\tt romio/test/misc.c}). -On some machines, ROMIO detects at configure time that {\tt long long} is -either not supported by the C compiler or it doesn't work properly. -In such cases, configure sets {\tt MPI\_Offset} to {\tt long} in C and {\tt -integer} in Fortran. This happens on Intel Paragon, Sun4, and FreeBSD. - -\item Added support for passing hints to the implementation via the -{\tt MPI\_Info} parameter. ROMIO understands the following hints (keys -in {\tt MPI\_Info} object): -\texttt{cb\_buffer\_size}, -\texttt{cb\_nodes},\newline -\texttt{ind\_rd\_buffer\_size}, -\texttt{ind\_wr\_buffer\_size} (on all but IBM PIOFS), -\texttt{striping\_factor} (on PFS and PIOFS), -\texttt{striping\_unit} (on PFS and PIOFS), -\texttt{start\_iodevice} (on PFS and PIOFS), -and \texttt{pfs\_svr\_buf} (on PFS only). - -\end{itemize} -\newpage - -\addcontentsline{toc}{section}{References} -\bibliographystyle{plain} -%% these are the "full" bibliography databases -%\bibliography{/homes/thakur/tex/bib/papers,/homes/robl/projects/papers/pario} -% this is the pared-down one containing only those references used in -% users-guide.tex -% to regenerate, uncomment the full databases above, then run -% ~gropp/bin/citetags users-guide.tex | sort | uniq | \ -% ~gropp/bin/citefind - /homes/thakur/tex/bib/papers.bib \ -% /homes/robl/projects/papers/pario -\bibliography{romio} - -\end{document} diff --git a/3rd-party/romio321/include/io_romio_conv.h b/3rd-party/romio321/include/io_romio_conv.h deleted file mode 100644 index ae3ea7deb48..00000000000 --- a/3rd-party/romio321/include/io_romio_conv.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_IO_ROMIO_CONV_H -#define MCA_IO_ROMIO_CONV_H - -/* Prefix that we add to all ROMIO symbols */ -#ifdef ROMIO_PREFIX -#undef ROMIO_PREFIX -#endif -#define ROMIO_PREFIX(foo) mca_io_romio_dist_##foo - -/* Section 9.2 */ -/* Begin Prototypes */ -#define MPI_File_open ROMIO_PREFIX(MPI_File_open) -#define MPI_File_close ROMIO_PREFIX(MPI_File_close) -#define MPI_File_delete ROMIO_PREFIX(MPI_File_delete) -#define MPI_File_set_size ROMIO_PREFIX(MPI_File_set_size) -#define MPI_File_preallocate ROMIO_PREFIX(MPI_File_preallocate) -#define MPI_File_get_size ROMIO_PREFIX(MPI_File_get_size) -#define MPI_File_get_group ROMIO_PREFIX(MPI_File_get_group) -#define MPI_File_get_amode ROMIO_PREFIX(MPI_File_get_amode) -#define MPI_File_set_info ROMIO_PREFIX(MPI_File_set_info) -#define MPI_File_get_info ROMIO_PREFIX(MPI_File_get_info) - -/* Section 9.3 */ -#define MPI_File_set_view ROMIO_PREFIX(MPI_File_set_view) -#define MPI_File_get_view ROMIO_PREFIX(MPI_File_get_view) - -/* Section 9.4.2 */ -#define MPI_File_read_at ROMIO_PREFIX(MPI_File_read_at) -#define MPI_File_read_at_all ROMIO_PREFIX(MPI_File_read_at_all) -#define MPI_File_write_at ROMIO_PREFIX(MPI_File_write_at) -#define MPI_File_write_at_all ROMIO_PREFIX(MPI_File_write_at_all) -#define MPI_File_iread_at ROMIO_PREFIX(MPI_File_iread_at) -#define MPI_File_iwrite_at ROMIO_PREFIX(MPI_File_iwrite_at) - -/* Section 9.4.3 */ -#define MPI_File_read ROMIO_PREFIX(MPI_File_read) -#define MPI_File_read_all ROMIO_PREFIX(MPI_File_read_all) -#define MPI_File_write ROMIO_PREFIX(MPI_File_write) -#define MPI_File_write_all ROMIO_PREFIX(MPI_File_write_all) - -#define MPI_File_iread ROMIO_PREFIX(MPI_File_iread) -#define MPI_File_iread_all ROMIO_PREFIX(MPI_File_iread_all) -#define MPI_File_iwrite ROMIO_PREFIX(MPI_File_iwrite) -#define MPI_File_iwrite_all ROMIO_PREFIX(MPI_File_iwrite_all) -#define MPI_File_iread_at_all ROMIO_PREFIX(MPI_File_iread_at_all) -#define MPI_File_iwrite_at_all ROMIO_PREFIX(MPI_File_iwrite_at_all) - - -#define MPI_File_seek ROMIO_PREFIX(MPI_File_seek) -#define MPI_File_get_position ROMIO_PREFIX(MPI_File_get_position) -#define MPI_File_get_byte_offset ROMIO_PREFIX(MPI_File_get_byte_offset) - -/* Section 9.4.4 */ -#define MPI_File_read_shared ROMIO_PREFIX(MPI_File_read_shared) -#define MPI_File_write_shared ROMIO_PREFIX(MPI_File_write_shared) -#define MPI_File_iread_shared ROMIO_PREFIX(MPI_File_iread_shared) -#define MPI_File_iwrite_shared ROMIO_PREFIX(MPI_File_iwrite_shared) -#define MPI_File_read_ordered ROMIO_PREFIX(MPI_File_read_ordered) -#define MPI_File_write_ordered ROMIO_PREFIX(MPI_File_write_ordered) -#define MPI_File_seek_shared ROMIO_PREFIX(MPI_File_seek_shared) -#define MPI_File_get_position_shared ROMIO_PREFIX(MPI_File_get_position_shared) - -/* Section 9.4.5 */ -#define MPI_File_read_at_all_begin ROMIO_PREFIX(MPI_File_read_at_all_begin) -#define MPI_File_read_at_all_end ROMIO_PREFIX(MPI_File_read_at_all_end) -#define MPI_File_write_at_all_begin ROMIO_PREFIX(MPI_File_write_at_all_begin) -#define MPI_File_write_at_all_end ROMIO_PREFIX(MPI_File_write_at_all_end) -#define MPI_File_read_all_begin ROMIO_PREFIX(MPI_File_read_all_begin) -#define MPI_File_read_all_end ROMIO_PREFIX(MPI_File_read_all_end) -#define MPI_File_write_all_begin ROMIO_PREFIX(MPI_File_write_all_begin) -#define MPI_File_write_all_end ROMIO_PREFIX(MPI_File_write_all_end) -#define MPI_File_read_ordered_begin ROMIO_PREFIX(MPI_File_read_ordered_begin) -#define MPI_File_read_ordered_end ROMIO_PREFIX(MPI_File_read_ordered_end) -#define MPI_File_write_ordered_begin ROMIO_PREFIX(MPI_File_write_ordered_begin) -#define MPI_File_write_ordered_end ROMIO_PREFIX(MPI_File_write_ordered_end) - -/* Section 9.5.1 */ -#define MPI_File_get_type_extent ROMIO_PREFIX(MPI_File_get_type_extent) - -/* Section 9.6.1 */ -#define MPI_File_set_atomicity ROMIO_PREFIX(MPI_File_set_atomicity) -#define MPI_File_get_atomicity ROMIO_PREFIX(MPI_File_get_atomicity) -#define MPI_File_sync ROMIO_PREFIX(MPI_File_sync) - -/* Section 4.13.3 */ -#define MPI_File_set_errhandler ROMIO_PREFIX(MPI_File_set_errhandler) -#define MPI_File_get_errhandler ROMIO_PREFIX(MPI_File_get_errhandler) -/* End Prototypes */ - -#define MPI_Register_datarep ROMIO_PREFIX(MPI_Register_datarep) - -/* JMS these don't seem to work... */ -#define MPI_File_f2c ROMIO_PREFIX(MPI_File_f2c) -#define MPI_File_c2f ROMIO_PREFIX(MPI_File_c2f) - -#define MPIO_Request_c2f ROMIO_PREFIX(MPIO_Request_c2f) -#define MPIO_Request_f2c ROMIO_PREFIX(MPIO_Request_f2c) - -/* Conversion of MPI_File and MPIO_Request */ -#define MPI_File ROMIO_PREFIX(MPI_File) - -/* Open MPI's mpi.h #define's MPI_FILE_NULL, so we need to undef it - here and allow it to be re-assigned to whatever ROMIO wants */ -#undef MPI_FILE_NULL - -/* Let's not use MPIR_Status_set_bytes */ -#ifndef MPIR_Status_set_bytes -#define MPIR_Status_set_bytes ROMIO_PREFIX(MPIR_Status_set_bytes) -#endif - -#endif /* MCA_IO_ROMIO_CONV_H */ diff --git a/3rd-party/romio321/include/mpio.h.in b/3rd-party/romio321/include/mpio.h.in deleted file mode 100644 index 9ef709dc651..00000000000 --- a/3rd-party/romio321/include/mpio.h.in +++ /dev/null @@ -1,558 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * - * Copyright (C) 1997 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -/* user include file for MPI-IO programs */ - -#ifndef MPIO_INCLUDE -#define MPIO_INCLUDE - -#include "mpi.h" -/* Open MPI: We need to rename almost all of these functions, as well - a the types to be names that conform to the prefix rule */ -#include "io_romio_conv.h" - -#define MPIIMPL_HAVE_MPI_COMBINER_DARRAY 1 -#define MPIIMPL_HAVE_MPI_TYPE_CREATE_DARRAY 1 -#define MPIIMPL_HAVE_MPI_COMBINER_SUBARRAY 1 -#define MPIIMPL_HAVE_MPI_TYPE_CREATE_DARRAY 1 -#define MPIIMPL_HAVE_MPI_COMBINER_DUP 1 -#define MPICH_ATTR_POINTER_WITH_TYPE_TAG(x,y) - -#if defined(__cplusplus) -extern "C" { -#endif - -#define ROMIO_VERSION 126 /* version 1.2.6 */ - -/* define MPI-IO datatypes and constants */ - -#ifndef MPI_FILE_DEFINED -typedef struct ADIOI_FileD *MPI_File; -#endif - -@DEFINE_HAVE_MPI_GREQUEST@ -#ifndef HAVE_MPI_GREQUEST -typedef struct ADIOI_RequestD *MPIO_Request; -#else -#define MPIO_Request MPI_Request -#define MPIO_USES_MPI_REQUEST -/* Also rename the MPIO routines to get the MPI versions */ -#define MPIO_Wait MPI_Wait -#define MPIO_Test MPI_Test -#define PMPIO_Wait PMPI_Wait -#define PMPIO_Test PMPI_Test -#endif -#define MPIO_REQUEST_DEFINED - -@DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS@ - -#ifndef HAVE_MPI_OFFSET -@DEFINE_MPI_OFFSET@ -/* If we needed to define MPI_Offset, then we also need to make - this definition. */ -#ifndef HAVE_MPI_DATAREP_FUNCTIONS -#define HAVE_MPI_DATAREP_FUNCTIONS -typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, - void *, MPI_Offset, void *); -typedef int (MPI_Datarep_extent_function)(MPI_Datatype datatype, MPI_Aint *, - void *); -#endif -#endif - -#ifndef NEEDS_MPI_FINT -@NEEDS_MPI_FINT@ -#endif -#ifdef NEEDS_MPI_FINT -typedef int MPI_Fint; -#endif - -#ifndef HAVE_MPI_INFO -@HAVE_MPI_INFO@ -#endif -#ifndef HAVE_MPI_INFO - typedef struct MPIR_Info *MPI_Info; -# define MPI_INFO_NULL ((MPI_Info) 0) -# define MPI_MAX_INFO_KEY 255 -# define MPI_MAX_INFO_VAL 1024 -#endif - -#define MPI_MODE_RDONLY 2 /* ADIO_RDONLY */ -#define MPI_MODE_RDWR 8 /* ADIO_RDWR */ -#define MPI_MODE_WRONLY 4 /* ADIO_WRONLY */ -#define MPI_MODE_CREATE 1 /* ADIO_CREATE */ -#define MPI_MODE_EXCL 64 /* ADIO_EXCL */ -#define MPI_MODE_DELETE_ON_CLOSE 16 /* ADIO_DELETE_ON_CLOSE */ -#define MPI_MODE_UNIQUE_OPEN 32 /* ADIO_UNIQUE_OPEN */ -#define MPI_MODE_APPEND 128 /* ADIO_APPEND */ -#define MPI_MODE_SEQUENTIAL 256 /* ADIO_SEQUENTIAL */ - -#define MPI_DISPLACEMENT_CURRENT -54278278 - -#ifndef MPICH -/* FIXME: Make sure that we get a consistent definition of MPI_FILE_NULL - in MPICH */ -/* MPICH defines null object handles differently */ -#define MPI_FILE_NULL ((MPI_File) 0) -#endif -#define MPIO_REQUEST_NULL ((MPIO_Request) 0) - -#define MPI_SEEK_SET 600 -#define MPI_SEEK_CUR 602 -#define MPI_SEEK_END 604 - -/* Open MPI: don't define MPI_MAX_DATAREP_STRING here; it's defined in - OMPI's mpi.h. */ -#ifndef OPEN_MPI -#define MPI_MAX_DATAREP_STRING 128 -#endif - -#ifndef HAVE_MPI_DARRAY_SUBARRAY -@HAVE_MPI_DARRAY_SUBARRAY@ -#endif -#ifndef HAVE_MPI_DARRAY_SUBARRAY -# define MPI_ORDER_C 56 -# define MPI_ORDER_FORTRAN 57 -# define MPI_DISTRIBUTE_BLOCK 121 -# define MPI_DISTRIBUTE_CYCLIC 122 -# define MPI_DISTRIBUTE_NONE 123 -# define MPI_DISTRIBUTE_DFLT_DARG -49767 -#endif - - -/* MPI-IO function prototypes */ - -/* The compiler must support ANSI C style prototypes, otherwise - long long constants (e.g. 0) may get passed as ints. */ - -#ifndef HAVE_PRAGMA_HP_SEC_DEF - -/* Section 9.2 */ -/* Begin Prototypes */ -int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh); -int MPI_File_close(MPI_File *fh); -int MPI_File_delete(const char *filename, MPI_Info info); -int MPI_File_set_size(MPI_File fh, MPI_Offset size); -int MPI_File_preallocate(MPI_File fh, MPI_Offset size); -int MPI_File_get_size(MPI_File fh, MPI_Offset *size); -int MPI_File_get_group(MPI_File fh, MPI_Group *group); -int MPI_File_get_amode(MPI_File fh, int *amode); -int MPI_File_set_info(MPI_File fh, MPI_Info info); -int MPI_File_get_info(MPI_File fh, MPI_Info *info_used); - -/* Section 9.3 */ -int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, - const char *datarep, MPI_Info info); -int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, - char *datarep); - -/* Section 9.4.2 */ -int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void * buf, int count, - MPI_Datatype datatype, MPI_Status *status) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void * buf, int count, - MPI_Datatype datatype, MPI_Status *status) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ -int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPIO_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); - -/* Section 9.4.3 */ -int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_write(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); - -int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); -int MPI_File_get_position(MPI_File fh, MPI_Offset *offset); -int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp); - -/* Section 9.4.4 */ -int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); -int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); - -/* Section 9.4.5 */ -int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, - MPI_Datatype datatype) MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); -int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype) MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status); -int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); -int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status); -int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); -int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status); - -/* Section 9.5.1 */ -int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent); - -/* Section 9.5.3 */ -int MPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, - MPI_Datarep_conversion_function *write_conversion_fn, - MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state); - -/* Section 9.6.1 */ -int MPI_File_set_atomicity(MPI_File fh, int flag); -int MPI_File_get_atomicity(MPI_File fh, int *flag); -int MPI_File_sync(MPI_File fh); - -/* Section 4.13.3 */ -#ifndef MPICH -/* MPICH provides these definitions */ -int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler); -int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler); -#endif - -/* For MPI 3.1 */ -int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -/* End Prototypes */ - -#ifndef HAVE_MPI_DARRAY_SUBARRAY -/* Section 4.14.4 */ -int MPI_Type_create_subarray(int ndims, const int array_of_sizes[], const int array_of_subsizes[], - const int array_of_starts[], int order, MPI_Datatype oldtype, - MPI_Datatype *newtype); - -/* Section 4.14.5 */ -int MPI_Type_create_darray(int size, int rank, int ndims, const int array_of_gsizes[], - const int array_of_distribs[], const int array_of_dargs[], - const int array_of_psizes, int order, MPI_Datatype oldtype, - MPI_Datatype *newtype); -#endif - -/* The globus2 device has to rename MPI_ symbols in order to use the vendor - MPI as one of its transport mechanisms. Therefore, the following undefines - should only happen if MPICH_RENAMING_MPI_FUNCS is not defined. */ -/* Section 4.12.4 */ -#if !defined(MPICH_RENAMING_MPI_FUNCS) -#ifdef MPI_File_f2c -#undef MPI_File_f2c -#endif -#ifdef MPI_File_c2f -#undef MPI_File_c2f -#endif -#endif -/* above needed for some versions of mpi.h in MPICH!! */ -/* Open MPI: I can't seem to make these #define properly. Oh well -- - we don't need them anyway :-( */ -#if 0 -MPI_File MPI_File_f2c(MPI_Fint file); -MPI_Fint MPI_File_c2f(MPI_File file); -#endif - -#ifndef HAVE_MPI_GREQUEST -/* The following functions are required if generalized requests are not - available, because in that case, an MPIO_Request object - is currently used for nonblocking I/O. */ -int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status); -int MPIO_Wait(MPIO_Request *request, MPI_Status *status); -int MPIO_Testall(int count, MPIO_Request array_of_requests[], int *flag, - MPI_Status array_of_statuses[]); -int MPIO_Waitall(int count, MPIO_Request array_of_requests[], MPI_Status array_of_statuses[]); -int MPIO_Testany(int count, MPIO_Request array_of_requests[], int *indx, int *flag, - MPI_Status *status); -int MPIO_Waitany(int count, MPIO_Request array_of_requests[], int *indx, MPI_Status *status); -int MPIO_Waitsome(int incount, MPIO_Request array_of_requests[], int *outcount, - int array_of_indices[], MPI_Status array_of_statuses[]); -int MPIO_Testsome(int incount, MPIO_Request array_of_requests[], int *outcount, - int array_of_indices[], MPI_Status array_of_statuses[]); - -MPI_Fint MPIO_Request_c2f(MPIO_Request request); -MPIO_Request MPIO_Request_f2c(MPI_Fint request); -#endif /* HAVE_MPI_GREQUEST */ - -/* info functions if not defined in the MPI implementation */ -#ifndef HAVE_MPI_INFO - -int MPI_Info_create(MPI_Info *info); -int MPI_Info_set(MPI_Info info, const char *key, const char *value); -int MPI_Info_delete(MPI_Info info, const char *key); -int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value, int *flag); -int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag); -int MPI_Info_get_nkeys(MPI_Info info, int *nkeys); -int MPI_Info_get_nthkey(MPI_Info info, int n, char *key); -int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo); -int MPI_Info_free(MPI_Info *info); - -/* The globus2 device has to rename MPI_ symbols in order to use the vendor - MPI as one of its transport mechanisms. Therefore, the following undefines - should only happen if MPICH_RENAMING_MPI_FUNCS is not defined. */ -#if !defined(MPICH_RENAMING_MPI_FUNCS) -#ifdef MPI_Info_f2c -#undef MPI_Info_f2c -#endif -#ifdef MPI_Info_c2f -#undef MPI_Info_c2f -#endif -#endif -/* above needed for some versions of mpi.h in MPICH!! */ -/* Open MPI: we don't need these in ROMIO */ -#if 0 -MPI_Fint MPI_Info_c2f(MPI_Info info); -MPI_Info MPI_Info_f2c(MPI_Fint info); -#endif -#endif - -#endif /* HAVE_PRAGMA_HP_SEC_DEF */ - - -/**************** BINDINGS FOR THE PROFILING INTERFACE ***************/ - -/* Open MPI: We don't want any of the profiling layer */ -#if 0 - - -/* Section 9.2 */ -int PMPI_File_open(MPI_Comm, const char *, int, MPI_Info, MPI_File *); -int PMPI_File_close(MPI_File *); -int PMPI_File_delete(const char *, MPI_Info); -int PMPI_File_set_size(MPI_File, MPI_Offset); -int PMPI_File_preallocate(MPI_File, MPI_Offset); -int PMPI_File_get_size(MPI_File, MPI_Offset *); -int PMPI_File_get_group(MPI_File, MPI_Group *); -int PMPI_File_get_amode(MPI_File, int *); -int PMPI_File_set_info(MPI_File, MPI_Info); -int PMPI_File_get_info(MPI_File, MPI_Info *); - -/* Section 9.3 */ -int PMPI_File_set_view(MPI_File, MPI_Offset, - MPI_Datatype, MPI_Datatype, const char *, MPI_Info); -int PMPI_File_get_view(MPI_File, MPI_Offset *, - MPI_Datatype *, MPI_Datatype *, char *); - -/* Section 9.4.2 */ -int PMPI_File_read_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_read_at_all(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_write_at(MPI_File, MPI_Offset, const void *, - int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_write_at_all(MPI_File, MPI_Offset, const void *, - int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int PMPI_File_iread_at(MPI_File, MPI_Offset, void *, - int, MPI_Datatype, MPIO_Request *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_iwrite_at(MPI_File, MPI_Offset, const void *, - int, MPI_Datatype, MPIO_Request *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); - -/* Section 9.4.3 */ -int PMPI_File_read(MPI_File, void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_read_all(MPI_File, void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_write(MPI_File, const void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_write_all(MPI_File, const void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); - -/* nonblocking calls currently use MPIO_Request, because generalized - requests not yet implemented. For the same reason, MPIO_Test and - MPIO_Wait are used to test and wait on nonblocking I/O requests */ - -int PMPI_File_iread(MPI_File, void *, int, MPI_Datatype, MPIO_Request *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_iwrite(MPI_File, const void *, int, MPI_Datatype, MPIO_Request *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); - -int PMPI_File_seek(MPI_File, MPI_Offset, int); -int PMPI_File_get_position(MPI_File, MPI_Offset *); -int PMPI_File_get_byte_offset(MPI_File, MPI_Offset, MPI_Offset *); - -/* Section 9.4.4 */ -int PMPI_File_read_shared(MPI_File, void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_write_shared(MPI_File, const void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_iread_shared(MPI_File, void *, int, - MPI_Datatype, MPIO_Request *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_iwrite_shared(MPI_File, const void *, int, - MPI_Datatype, MPIO_Request *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_read_ordered(MPI_File, void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_write_ordered(MPI_File, const void *, int, MPI_Datatype, MPI_Status *) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_seek_shared(MPI_File, MPI_Offset, int); -int PMPI_File_get_position_shared(MPI_File, MPI_Offset *); - -/* Section 9.4.5 */ -int PMPI_File_read_at_all_begin(MPI_File, MPI_Offset, void *, - int, MPI_Datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_read_at_all_end(MPI_File, void *, MPI_Status *); -int PMPI_File_write_at_all_begin(MPI_File, MPI_Offset, const void *, - int, MPI_Datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_write_at_all_end(MPI_File, const void *, MPI_Status *); -int PMPI_File_read_all_begin(MPI_File, void *, int, MPI_Datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_read_all_end(MPI_File, void *, MPI_Status *); -int PMPI_File_write_all_begin(MPI_File, const void *, int, MPI_Datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_write_all_end(MPI_File, const void *, MPI_Status *); -int PMPI_File_read_ordered_begin(MPI_File, void *, int, MPI_Datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_read_ordered_end(MPI_File, void *, MPI_Status *); -int PMPI_File_write_ordered_begin(MPI_File, const void *, int, MPI_Datatype) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_write_ordered_end(MPI_File, const void *, MPI_Status *); - -/* Section 9.5.1 */ -int PMPI_File_get_type_extent(MPI_File, MPI_Datatype, MPI_Aint *); - -/* Section 9.5.3 */ -int PMPI_Register_datarep(const char *, - MPI_Datarep_conversion_function *, - MPI_Datarep_conversion_function *, - MPI_Datarep_extent_function *, - void *); - -/* Section 9.6.1 */ -int PMPI_File_set_atomicity(MPI_File, int); -int PMPI_File_get_atomicity(MPI_File, int *); -int PMPI_File_sync(MPI_File); - -/* Section 4.13.3 */ -#ifndef MPICH -/* MPICH provides these definitions */ -int PMPI_File_set_errhandler( MPI_File, MPI_Errhandler ); -int PMPI_File_get_errhandler( MPI_File, MPI_Errhandler * ); -#endif - -/* For MPI 3.1 */ -int PMPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5); -int PMPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); -int PMPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) - MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4); - -#ifndef HAVE_MPI_DARRAY_SUBARRAY -/* Section 4.14.4 */ -int PMPI_Type_create_subarray(int, int *, int *, int *, int, - MPI_Datatype, MPI_Datatype *); - -/* Section 4.14.5 */ -int PMPI_Type_create_darray(int, int, int, int *, int *, - int *, int *, int, MPI_Datatype, MPI_Datatype *); -#endif - -/* Section 4.12.4 */ -MPI_File PMPI_File_f2c(MPI_Fint); -MPI_Fint PMPI_File_c2f(MPI_File); - -#ifndef HAVE_MPI_GREQUEST -/* The following functions are required if generalized requests are not - available, because in that case, an MPIO_Request object - is currently used for nonblocking I/O. */ -int PMPIO_Test(MPIO_Request *, int *, MPI_Status *); -int PMPIO_Wait(MPIO_Request *, MPI_Status *); -int PMPIO_Testall(int, MPIO_Request *, int *, MPI_Status *); -int PMPIO_Waitall(int, MPIO_Request *, MPI_Status *); -int PMPIO_Testany(int, MPIO_Request *, int *, int *, MPI_Status *); -int PMPIO_Waitany(int, MPIO_Request *, int *, MPI_Status *); -int PMPIO_Waitsome(int, MPIO_Request *, int *, int *, MPI_Status *); -int PMPIO_Testsome(int, MPIO_Request *, int *, int *, MPI_Status *); -MPI_Fint PMPIO_Request_c2f(MPIO_Request); -MPIO_Request PMPIO_Request_f2c(MPI_Fint); -#endif /* HAVE_MPI_GREQUEST */ - -/* info functions if not defined in the MPI implementation */ -#ifndef HAVE_MPI_INFO - -int PMPI_Info_create(MPI_Info *); -int PMPI_Info_set(MPI_Info, char *, char *); -int PMPI_Info_delete(MPI_Info, char *); -int PMPI_Info_get(MPI_Info, char *, int, char *, int *); -int PMPI_Info_get_valuelen(MPI_Info, char *, int *, int *); -int PMPI_Info_get_nkeys(MPI_Info, int *); -int PMPI_Info_get_nthkey(MPI_Info, int, char *); -int PMPI_Info_dup(MPI_Info, MPI_Info *); -int PMPI_Info_free(MPI_Info *); - -MPI_Fint PMPI_Info_c2f(MPI_Info); -MPI_Info PMPI_Info_f2c(MPI_Fint); -#endif - -#endif /* Open MPI: We don't want any of the profiling layer */ - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/3rd-party/romio321/include/mpiof.h.in b/3rd-party/romio321/include/mpiof.h.in deleted file mode 100644 index fa945807bdc..00000000000 --- a/3rd-party/romio321/include/mpiof.h.in +++ /dev/null @@ -1,46 +0,0 @@ -! -! Copyright (C) 1997 University of Chicago. -! See COPYRIGHT notice in top-level directory. -! -! -! user include file for Fortran MPI-IO programs -! - INTEGER MPI_MODE_RDONLY, MPI_MODE_RDWR, MPI_MODE_WRONLY - INTEGER MPI_MODE_DELETE_ON_CLOSE, MPI_MODE_UNIQUE_OPEN - INTEGER MPI_MODE_CREATE, MPI_MODE_EXCL - INTEGER MPI_MODE_APPEND, MPI_MODE_SEQUENTIAL - PARAMETER (MPI_MODE_RDONLY=2, MPI_MODE_RDWR=8, MPI_MODE_WRONLY=4) - PARAMETER (MPI_MODE_CREATE=1, MPI_MODE_DELETE_ON_CLOSE=16) - PARAMETER (MPI_MODE_UNIQUE_OPEN=32, MPI_MODE_EXCL=64) - PARAMETER (MPI_MODE_APPEND=128, MPI_MODE_SEQUENTIAL=256) -! - INTEGER MPI_FILE_NULL - PARAMETER (MPI_FILE_NULL=0) -! - INTEGER MPI_MAX_DATAREP_STRING - PARAMETER (MPI_MAX_DATAREP_STRING=128) -! - INTEGER MPI_SEEK_SET, MPI_SEEK_CUR, MPI_SEEK_END - PARAMETER (MPI_SEEK_SET=600, MPI_SEEK_CUR=602, MPI_SEEK_END=604) -! - INTEGER MPIO_REQUEST_NULL - PARAMETER (MPIO_REQUEST_NULL=0) -! - @FORTRAN_MPI_OFFSET@ MPI_DISPLACEMENT_CURRENT - PARAMETER (MPI_DISPLACEMENT_CURRENT=-54278278) -! -@MPI_OFFSET_KIND1@ -@MPI_OFFSET_KIND2@ -! -@MPI_FARRAY1@ -@MPI_FARRAY2@ -@MPI_FARRAY3@ -@MPI_FARRAY4@ -@MPI_FARRAY5@ -@MPI_FARRAY6@ -@MPI_FARRAY7@ -! -@MPI_FINFO1@ -@MPI_FINFO2@ -@MPI_FINFO3@ -@MPI_FINFO4@ diff --git a/3rd-party/romio321/include/ompi_grequestx.h b/3rd-party/romio321/include/ompi_grequestx.h deleted file mode 100644 index 3aae40d8fb5..00000000000 --- a/3rd-party/romio321/include/ompi_grequestx.h +++ /dev/null @@ -1,34 +0,0 @@ -#define HAVE_MPI_GREQUEST_EXTENSIONS 1 - -extern void opal_progress(void); - -typedef int (MPIX_Grequest_poll_function)(void *, MPI_Status *); -typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *); -typedef int MPIX_Grequest_class; - -extern int ompi_grequestx_start( - MPI_Grequest_query_function *gquery, - MPI_Grequest_free_function *gfree, - MPI_Grequest_cancel_function *gcancel, - MPIX_Grequest_poll_function *gpoll, - void* gstate, - MPI_Request* request); - -extern int ompi_grequestx_class_create( - MPI_Grequest_query_function *gquery, - MPI_Grequest_free_function *gfree, - MPI_Grequest_cancel_function *gcancel, - MPIX_Grequest_poll_function *gpoll, - MPIX_Grequest_wait_function *gwait, - MPIX_Grequest_class *greq_class); - -extern int ompi_grequestx_class_allocate( - MPIX_Grequest_class greq_class, - void *extra_state, - MPI_Request* request); - -#define MPIR_Ext_cs_yield opal_progress -#define PMPIX_Grequest_class_allocate(greq_class,extra_state,request) ompi_grequestx_class_allocate(greq_class,extra_state,request) -#define PMPIX_Grequest_class_create(query_fn,free_fn,cancel_fn,poll_fn,wait_fn,greq_class) ompi_grequestx_class_create(query_fn,free_fn,cancel_fn,poll_fn,wait_fn,greq_class) -#define PMPIX_Grequest_start(query_fn,free_fn,cancel_fn,poll_fn,extra_state,request) ompi_grequestx_start(query_fn,free_fn,cancel_fn,poll_fn,extra_state,request) - diff --git a/3rd-party/romio321/localdefs.in b/3rd-party/romio321/localdefs.in deleted file mode 100644 index 94fd9508dae..00000000000 --- a/3rd-party/romio321/localdefs.in +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -# Append ROMIO library dependencies to the global list -WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@" - -MPI_OFFSET_TYPE="@MPI_OFFSET_TYPE@" -FORTRAN_MPI_OFFSET="@FORTRAN_MPI_OFFSET@" diff --git a/3rd-party/romio321/mpi-io/Makefile.mk b/3rd-party/romio321/mpi-io/Makefile.mk deleted file mode 100644 index 264976e06c1..00000000000 --- a/3rd-party/romio321/mpi-io/Makefile.mk +++ /dev/null @@ -1,106 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -include $(top_srcdir)/mpi-io/glue/Makefile.mk -include $(top_srcdir)/mpi-io/fortran/Makefile.mk - -AM_CPPFLAGS += -I$(top_builddir)/mpi-io -I$(top_srcdir)/mpi-io -noinst_HEADERS += mpi-io/mpioimpl.h mpi-io/mpioprof.h - -romio_mpi_sources += \ - mpi-io/close.c \ - mpi-io/delete.c \ - mpi-io/fsync.c \ - mpi-io/get_amode.c \ - mpi-io/get_atom.c \ - mpi-io/get_bytoff.c \ - mpi-io/get_extent.c \ - mpi-io/get_group.c \ - mpi-io/get_info.c \ - mpi-io/get_posn.c \ - mpi-io/get_posn_sh.c \ - mpi-io/get_size.c \ - mpi-io/get_view.c \ - mpi-io/iread.c \ - mpi-io/iread_all.c \ - mpi-io/iread_at.c \ - mpi-io/iread_atall.c \ - mpi-io/iread_sh.c \ - mpi-io/iwrite.c \ - mpi-io/iwrite_all.c \ - mpi-io/iwrite_at.c \ - mpi-io/iwrite_atall.c \ - mpi-io/iwrite_sh.c \ - mpi-io/open.c \ - mpi-io/prealloc.c \ - mpi-io/rd_atallb.c \ - mpi-io/rd_atalle.c \ - mpi-io/read.c \ - mpi-io/read_all.c \ - mpi-io/read_allb.c \ - mpi-io/read_alle.c \ - mpi-io/read_at.c \ - mpi-io/read_atall.c \ - mpi-io/read_ord.c \ - mpi-io/read_ordb.c \ - mpi-io/read_orde.c \ - mpi-io/read_sh.c \ - mpi-io/register_datarep.c \ - mpi-io/seek.c \ - mpi-io/seek_sh.c \ - mpi-io/set_atom.c \ - mpi-io/set_info.c \ - mpi-io/set_size.c \ - mpi-io/set_view.c \ - mpi-io/wr_atallb.c \ - mpi-io/wr_atalle.c \ - mpi-io/write.c \ - mpi-io/write_all.c \ - mpi-io/write_allb.c \ - mpi-io/write_alle.c \ - mpi-io/write_at.c \ - mpi-io/write_atall.c \ - mpi-io/write_ord.c \ - mpi-io/write_ordb.c \ - mpi-io/write_orde.c \ - mpi-io/write_sh.c - - -# non-MPI/PMPI sources that will be included in libromio -romio_other_sources += \ - mpi-io/mpich_fileutil.c \ - mpi-io/mpir-mpioinit.c \ - mpi-io/mpiu_greq.c \ - mpi-io/mpiu_external32.c - -# helper variables for conditionally compiled sources -mpio_request_sources= \ - mpi-io/ioreq_c2f.c \ - mpi-io/ioreq_f2c.c \ - mpi-io/iotest.c \ - mpi-io/iotestall.c \ - mpi-io/iotestany.c \ - mpi-io/iotestsome.c \ - mpi-io/iowait.c \ - mpi-io/iowaitall.c \ - mpi-io/iowaitany.c \ - mpi-io/iowaitsome.c - -mpio_extra_sources = \ - mpi-io/get_errh.c \ - mpi-io/set_errh.c - -# not used in MPICH, we use generalized requests instead -if BUILD_MPIO_REQUEST -romio_other_sources += $(mpio_request_sources) -endif BUILD_MPIO_REQUEST - -# not used in MPICH -if BUILD_MPIO_ERRHAN -romio_other_sources += $(mpio_request_sources) -endif BUILD_MPIO_ERRHAN - diff --git a/3rd-party/romio321/mpi-io/close.c b/3rd-party/romio321/mpi-io/close.c deleted file mode 100644 index 12d5c4791f5..00000000000 --- a/3rd-party/romio321/mpi-io/close.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_close = PMPI_File_close -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_close MPI_File_close -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_close as PMPI_File_close -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_close(MPI_File *fh) __attribute__((weak,alias("PMPI_File_close"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_close - Closes a file - -Input Parameters: -. fh - file handle (handle) - -.N fortran -@*/ -int MPI_File_close(MPI_File *fh) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_CLOSE"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_WSTART(fl_xmpi, BLKMPIFILECLOSE, TRDTBLOCK, *adio_fh); -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(*fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - if (ADIO_Feature(adio_fh, ADIO_SHARED_FP)) - { - ADIOI_Free((adio_fh)->shared_fp_fname); - /* POSIX semantics say a deleted file remains available until all - * processes close the file. But since when was NFS posix-compliant? - */ - /* this used to be gated by the lack of the UNLINK_AFTER_CLOSE feature, - * but a race condition in GPFS necessated this. See ticket #2214 */ - MPI_Barrier((adio_fh)->comm); - if ((adio_fh)->shared_fp_fd != ADIO_FILE_NULL) { - MPI_File *fh_shared = &(adio_fh->shared_fp_fd); - ADIO_Close((adio_fh)->shared_fp_fd, &error_code); - MPIO_File_free(fh_shared); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) goto fn_fail; - /* --END ERROR HANDLING-- */ - } - } - - /* Because ROMIO expects the MPI library to provide error handler management - * routines but it doesn't ever participate in MPI_File_close, we have to - * somehow inform the MPI library that we no longer hold a reference to any - * user defined error handler. We do this by setting the errhandler at this - * point to MPI_ERRORS_RETURN. */ -/* Open MPI: The call to PMPI_File_set_errhandler has to be done in romio/src/io_romio_file_open.c - in routine mca_io_romio_file_close() -*/ -#if 0 - error_code = PMPI_File_set_errhandler(*fh, MPI_ERRORS_RETURN); - if (error_code != MPI_SUCCESS) goto fn_fail; -#endif - - ADIO_Close(adio_fh, &error_code); - MPIO_File_free(fh); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) goto fn_fail; - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_WEND(fl_xmpi); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -fn_fail: - /* --BEGIN ERROR HANDLING-- */ - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - /* --END ERROR HANDLING-- */ -} diff --git a/3rd-party/romio321/mpi-io/delete.c b/3rd-party/romio321/mpi-io/delete.c deleted file mode 100644 index 47b52a054c4..00000000000 --- a/3rd-party/romio321/mpi-io/delete.c +++ /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. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_delete = PMPI_File_delete -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_delete MPI_File_delete -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_delete as PMPI_File_delete -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_delete(const char *filename, MPI_Info info) __attribute__((weak,alias("PMPI_File_delete"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_delete - Deletes a file - -Input Parameters: -. filename - name of file to delete (string) -. info - info object (handle) - -.N fortran -@*/ -int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info) -{ - int error_code, file_system; - char *tmp; - ADIOI_Fns *fsops; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEDELETE, TRDTBLOCK, - MPI_FILE_NULL, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - MPIU_UNREFERENCED_ARG(info); - - ROMIO_THREAD_CS_ENTER(); - - MPIR_MPIOInit(&error_code); - if (error_code != MPI_SUCCESS) goto fn_exit; - - /* resolve file system type from file name; this is a collective call */ - ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops, - &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - /* ADIO_ResolveFileType() will print as informative a message as it - * possibly can or call MPIR_Err_setmsg. We just need to propagate - * the error up. In the PRINT_ERR_MSG case MPI_Abort has already - * been called as well, so we probably didn't even make it this far. - */ - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - /* skip prefixes on file names if they have more than one character; - * single-character prefixes are assumed to be windows drive - * specifications (e.g. c:\foo) and are left alone. - */ - tmp = strchr(filename, ':'); - if (tmp > filename + 1) - filename = tmp + 1; - - /* call the fs-specific delete function */ - (fsops->ADIOI_xxx_Delete)(filename, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/file_c2f.c b/3rd-party/romio321/mpi-io/file_c2f.c deleted file mode 100644 index 4eaae9fafa0..00000000000 --- a/3rd-party/romio321/mpi-io/file_c2f.c +++ /dev/null @@ -1,41 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_c2f = PMPI_File_c2f -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_c2f MPI_File_c2f -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_c2f as PMPI_File_c2f -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -MPI_Fint MPI_File_c2f(MPI_File fh) __attribute__((weak,alias("PMPI_File_c2f"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#include "adio_extern.h" - -/*@ - MPI_File_c2f - Translates a C file handle to a Fortran file handle - -Input Parameters: -. fh - C file handle (handle) - -Return Value: - Fortran file handle (integer) -@*/ -MPI_Fint MPI_File_c2f(MPI_File fh) -{ - return MPIO_File_c2f(fh); -} diff --git a/3rd-party/romio321/mpi-io/file_f2c.c b/3rd-party/romio321/mpi-io/file_f2c.c deleted file mode 100644 index b6b4896b389..00000000000 --- a/3rd-party/romio321/mpi-io/file_f2c.c +++ /dev/null @@ -1,41 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_f2c = PMPI_File_f2c -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_f2c MPI_File_f2c -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_f2c as PMPI_File_f2c -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -MPI_File MPI_File_f2c(MPI_Fint fh) __attribute__((weak,alias("PMPI_File_f2c"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#include "adio_extern.h" - -/*@ - MPI_File_f2c - Translates a Fortran file handle to a C file handle - -Input Parameters: -. fh - Fortran file handle (integer) - -Return Value: - C file handle (handle) -@*/ -MPI_File MPI_File_f2c(MPI_Fint fh) -{ - return MPIO_File_f2c(fh); -} diff --git a/3rd-party/romio321/mpi-io/fortran/Makefile.mk b/3rd-party/romio321/mpi-io/fortran/Makefile.mk deleted file mode 100644 index f7ed72b69b4..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/Makefile.mk +++ /dev/null @@ -1,68 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if BUILD_F77_BINDINGS - -romio_mpi_sources += \ - mpi-io/fortran/closef.c \ - mpi-io/fortran/deletef.c \ - mpi-io/fortran/fsyncf.c \ - mpi-io/fortran/get_amodef.c \ - mpi-io/fortran/get_atomf.c \ - mpi-io/fortran/get_bytofff.c \ - mpi-io/fortran/get_errhf.c \ - mpi-io/fortran/get_extentf.c \ - mpi-io/fortran/get_groupf.c \ - mpi-io/fortran/get_infof.c \ - mpi-io/fortran/get_posn_shf.c \ - mpi-io/fortran/get_posnf.c \ - mpi-io/fortran/get_sizef.c \ - mpi-io/fortran/get_viewf.c \ - mpi-io/fortran/iotestf.c \ - mpi-io/fortran/iowaitf.c \ - mpi-io/fortran/iread_atf.c \ - mpi-io/fortran/iread_shf.c \ - mpi-io/fortran/ireadf.c \ - mpi-io/fortran/iwrite_atf.c \ - mpi-io/fortran/iwrite_shf.c \ - mpi-io/fortran/iwritef.c \ - mpi-io/fortran/openf.c \ - mpi-io/fortran/preallocf.c \ - mpi-io/fortran/rd_atallbf.c \ - mpi-io/fortran/rd_atallef.c \ - mpi-io/fortran/read_allbf.c \ - mpi-io/fortran/read_allef.c \ - mpi-io/fortran/read_allf.c \ - mpi-io/fortran/read_atallf.c \ - mpi-io/fortran/read_atf.c \ - mpi-io/fortran/read_ordbf.c \ - mpi-io/fortran/read_ordef.c \ - mpi-io/fortran/read_ordf.c \ - mpi-io/fortran/read_shf.c \ - mpi-io/fortran/readf.c \ - mpi-io/fortran/seek_shf.c \ - mpi-io/fortran/seekf.c \ - mpi-io/fortran/set_atomf.c \ - mpi-io/fortran/set_errhf.c \ - mpi-io/fortran/set_infof.c \ - mpi-io/fortran/set_sizef.c \ - mpi-io/fortran/set_viewf.c \ - mpi-io/fortran/wr_atallbf.c \ - mpi-io/fortran/wr_atallef.c \ - mpi-io/fortran/write_allbf.c \ - mpi-io/fortran/write_allef.c \ - mpi-io/fortran/write_allf.c \ - mpi-io/fortran/write_atallf.c \ - mpi-io/fortran/write_atf.c \ - mpi-io/fortran/write_ordbf.c \ - mpi-io/fortran/write_ordef.c \ - mpi-io/fortran/write_ordf.c \ - mpi-io/fortran/write_shf.c \ - mpi-io/fortran/writef.c - -endif BUILD_F77_BINDINGS - diff --git a/3rd-party/romio321/mpi-io/fortran/closef.c b/3rd-party/romio321/mpi-io/fortran/closef.c deleted file mode 100644 index aebdf56a611..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/closef.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_CLOSE( MPI_File*, MPI_Fint * ); -#pragma weak MPI_FILE_CLOSE = PMPI_FILE_CLOSE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_close__( MPI_File*, MPI_Fint * ); -#pragma weak mpi_file_close__ = pmpi_file_close__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_close( MPI_File*, MPI_Fint * ); -#pragma weak mpi_file_close = pmpi_file_close -#else -extern FORTRAN_API void FORT_CALL mpi_file_close_( MPI_File*, MPI_Fint * ); -#pragma weak mpi_file_close_ = pmpi_file_close_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_CLOSE MPI_FILE_CLOSE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_close__ mpi_file_close__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_close mpi_file_close -#else -#pragma _HP_SECONDARY_DEF pmpi_file_close_ mpi_file_close_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_CLOSE as PMPI_FILE_CLOSE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_close__ as pmpi_file_close__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_close as pmpi_file_close -#else -#pragma _CRI duplicate mpi_file_close_ as pmpi_file_close_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_close_ PMPI_FILE_CLOSE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_close_ pmpi_file_close__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_close pmpi_file_close_ -#endif -#define mpi_file_close_ pmpi_file_close -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_close_ pmpi_file_close -#endif -#define mpi_file_close_ pmpi_file_close_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_close_ MPI_FILE_CLOSE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_close_ mpi_file_close__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_close mpi_file_close_ -#endif -#define mpi_file_close_ mpi_file_close -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_close_ mpi_file_close -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_close_(MPI_Fint *fh, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_close_(MPI_Fint *fh, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_close(&fh_c); - *fh = MPI_File_c2f(fh_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/deletef.c b/3rd-party/romio321/mpi-io/fortran/deletef.c deleted file mode 100644 index 660129f7605..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/deletef.c +++ /dev/null @@ -1,144 +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. - */ - -#ifdef _UNICOS -#include -#endif -#include "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_DELETE( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak MPI_FILE_DELETE = PMPI_FILE_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_delete__( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_delete__ = pmpi_file_delete__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_delete( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_delete = pmpi_file_delete -#else -extern FORTRAN_API void FORT_CALL mpi_file_delete_( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_delete_ = pmpi_file_delete_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_DELETE MPI_FILE_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_delete__ mpi_file_delete__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_delete mpi_file_delete -#else -#pragma _HP_SECONDARY_DEF pmpi_file_delete_ mpi_file_delete_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_DELETE as PMPI_FILE_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_delete__ as pmpi_file_delete__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_delete as pmpi_file_delete -#else -#pragma _CRI duplicate mpi_file_delete_ as pmpi_file_delete_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_delete_ PMPI_FILE_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_delete_ pmpi_file_delete__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_delete pmpi_file_delete_ -#endif -#define mpi_file_delete_ pmpi_file_delete -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_delete_ pmpi_file_delete -#endif -#define mpi_file_delete_ pmpi_file_delete_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_delete_ MPI_FILE_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_delete_ mpi_file_delete__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_delete mpi_file_delete_ -#endif -#define mpi_file_delete_ mpi_file_delete -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_delete_ mpi_file_delete -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -/* -FORTRAN_API void FORT_CALL mpi_file_delete_(char *filename, MPI_Fint *info, MPI_Fint *ierr, int str_len); - -#ifdef _UNICOS -void mpi_file_delete_(_fcd filename_fcd, MPI_Fint *info, MPI_Fint *ierr) -{ - char *filename = _fcdtocp(filename_fcd); - int str_len = _fcdlen(filename_fcd); -#else -FORTRAN_API void FORT_CALL mpi_file_delete_(char *filename, MPI_Fint *info, MPI_Fint *ierr, int str_len) -*/ -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_delete_(char *filename FORT_MIXED_LEN_DECL, MPI_Fint *info, MPI_Fint *ierr FORT_END_LEN_DECL); - -#ifdef _UNICOS -void mpi_file_delete_(_fcd filename_fcd, MPI_Fint *info, MPI_Fint *ierr) -{ - char *filename = _fcdtocp(filename_fcd); - int str_len = _fcdlen(filename_fcd); -#else -FORTRAN_API void FORT_CALL mpi_file_delete_(char *filename FORT_MIXED_LEN(str_len), MPI_Fint *info, MPI_Fint *ierr FORT_END_LEN(str_len)) -{ -#endif - char *newfname; - int real_len, i; - MPI_Info info_c; - - info_c = MPI_Info_f2c(*info); - - /* strip trailing blanks */ - if (filename <= (char *) 0) { - FPRINTF(stderr, "MPI_File_delete: filename is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - for (i=str_len-1; i>=0; i--) if (filename[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_File_delete: filename is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - real_len = i + 1; - - newfname = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); - ADIOI_Strncpy(newfname, filename, real_len); - newfname[real_len] = '\0'; - - *ierr = MPI_File_delete(newfname, info_c); - - ADIOI_Free(newfname); -} diff --git a/3rd-party/romio321/mpi-io/fortran/fsyncf.c b/3rd-party/romio321/mpi-io/fortran/fsyncf.c deleted file mode 100644 index b52245256b8..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/fsyncf.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SYNC( MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_SYNC = PMPI_FILE_SYNC -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_sync__( MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_sync__ = pmpi_file_sync__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_sync( MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_sync = pmpi_file_sync -#else -extern FORTRAN_API void FORT_CALL mpi_file_sync_( MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_sync_ = pmpi_file_sync_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SYNC MPI_FILE_SYNC -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_sync__ mpi_file_sync__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_sync mpi_file_sync -#else -#pragma _HP_SECONDARY_DEF pmpi_file_sync_ mpi_file_sync_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SYNC as PMPI_FILE_SYNC -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_sync__ as pmpi_file_sync__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_sync as pmpi_file_sync -#else -#pragma _CRI duplicate mpi_file_sync_ as pmpi_file_sync_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_sync_ PMPI_FILE_SYNC -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_sync_ pmpi_file_sync__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_sync pmpi_file_sync_ -#endif -#define mpi_file_sync_ pmpi_file_sync -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_sync_ pmpi_file_sync -#endif -#define mpi_file_sync_ pmpi_file_sync_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_sync_ MPI_FILE_SYNC -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_sync_ mpi_file_sync__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_sync mpi_file_sync_ -#endif -#define mpi_file_sync_ mpi_file_sync -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_sync_ mpi_file_sync -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_sync_(MPI_Fint *fh, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_sync_(MPI_Fint *fh, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_sync(fh_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_amodef.c b/3rd-party/romio321/mpi-io/fortran/get_amodef.c deleted file mode 100644 index 2427f068310..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_amodef.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_AMODE( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_GET_AMODE = PMPI_FILE_GET_AMODE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_amode__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_amode__ = pmpi_file_get_amode__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_amode( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_amode = pmpi_file_get_amode -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_amode_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_amode_ = pmpi_file_get_amode_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_AMODE MPI_FILE_GET_AMODE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_amode__ mpi_file_get_amode__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_amode mpi_file_get_amode -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_amode_ mpi_file_get_amode_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_AMODE as PMPI_FILE_GET_AMODE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_amode__ as pmpi_file_get_amode__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_amode as pmpi_file_get_amode -#else -#pragma _CRI duplicate mpi_file_get_amode_ as pmpi_file_get_amode_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_amode_ PMPI_FILE_GET_AMODE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_amode_ pmpi_file_get_amode__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_amode pmpi_file_get_amode_ -#endif -#define mpi_file_get_amode_ pmpi_file_get_amode -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_amode_ pmpi_file_get_amode -#endif -#define mpi_file_get_amode_ pmpi_file_get_amode_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_amode_ MPI_FILE_GET_AMODE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_amode_ mpi_file_get_amode__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_amode mpi_file_get_amode_ -#endif -#define mpi_file_get_amode_ mpi_file_get_amode -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_amode_ mpi_file_get_amode -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_amode_(MPI_Fint *fh, MPI_Fint *amode, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_amode_(MPI_Fint *fh, MPI_Fint *amode, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_amode(fh_c, amode); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_atomf.c b/3rd-party/romio321/mpi-io/fortran/get_atomf.c deleted file mode 100644 index 98bf557e34b..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_atomf.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_ATOMICITY( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_GET_ATOMICITY = PMPI_FILE_GET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_atomicity__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_atomicity__ = pmpi_file_get_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_atomicity( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_atomicity = pmpi_file_get_atomicity -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_atomicity_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_atomicity_ = pmpi_file_get_atomicity_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_ATOMICITY MPI_FILE_GET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_atomicity__ mpi_file_get_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_atomicity mpi_file_get_atomicity -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_atomicity_ mpi_file_get_atomicity_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_ATOMICITY as PMPI_FILE_GET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_atomicity__ as pmpi_file_get_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_atomicity as pmpi_file_get_atomicity -#else -#pragma _CRI duplicate mpi_file_get_atomicity_ as pmpi_file_get_atomicity_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_atomicity_ PMPI_FILE_GET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_atomicity_ pmpi_file_get_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_atomicity pmpi_file_get_atomicity_ -#endif -#define mpi_file_get_atomicity_ pmpi_file_get_atomicity -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_atomicity_ pmpi_file_get_atomicity -#endif -#define mpi_file_get_atomicity_ pmpi_file_get_atomicity_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_atomicity_ MPI_FILE_GET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_atomicity_ mpi_file_get_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_atomicity mpi_file_get_atomicity_ -#endif -#define mpi_file_get_atomicity_ mpi_file_get_atomicity -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_atomicity_ mpi_file_get_atomicity -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_atomicity_(MPI_Fint *fh, MPI_Fint *flag, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_atomicity_(MPI_Fint *fh, MPI_Fint *flag, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_atomicity(fh_c, flag); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/get_bytofff.c b/3rd-party/romio321/mpi-io/fortran/get_bytofff.c deleted file mode 100644 index fb38b7be4ca..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_bytofff.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_BYTE_OFFSET( MPI_Fint *, MPI_Offset *, MPI_Offset*, MPI_Fint * ); -#pragma weak MPI_FILE_GET_BYTE_OFFSET = PMPI_FILE_GET_BYTE_OFFSET -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_byte_offset__( MPI_Fint *, MPI_Offset *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_byte_offset__ = pmpi_file_get_byte_offset__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_byte_offset( MPI_Fint *, MPI_Offset *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_byte_offset = pmpi_file_get_byte_offset -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_byte_offset_( MPI_Fint *, MPI_Offset *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_byte_offset_ = pmpi_file_get_byte_offset_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_BYTE_OFFSET MPI_FILE_GET_BYTE_OFFSET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_byte_offset__ mpi_file_get_byte_offset__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_byte_offset mpi_file_get_byte_offset -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_byte_offset_ mpi_file_get_byte_offset_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_BYTE_OFFSET as PMPI_FILE_GET_BYTE_OFFSET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_byte_offset__ as pmpi_file_get_byte_offset__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_byte_offset as pmpi_file_get_byte_offset -#else -#pragma _CRI duplicate mpi_file_get_byte_offset_ as pmpi_file_get_byte_offset_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_byte_offset_ PMPI_FILE_GET_BYTE_OFFSET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_byte_offset_ pmpi_file_get_byte_offset__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_byte_offset pmpi_file_get_byte_offset_ -#endif -#define mpi_file_get_byte_offset_ pmpi_file_get_byte_offset -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_byte_offset_ pmpi_file_get_byte_offset -#endif -#define mpi_file_get_byte_offset_ pmpi_file_get_byte_offset_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_byte_offset_ MPI_FILE_GET_BYTE_OFFSET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_byte_offset_ mpi_file_get_byte_offset__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_byte_offset mpi_file_get_byte_offset_ -#endif -#define mpi_file_get_byte_offset_ mpi_file_get_byte_offset -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_byte_offset_ mpi_file_get_byte_offset -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_byte_offset_(MPI_Fint *fh, MPI_Offset *offset, MPI_Offset *disp, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_byte_offset_(MPI_Fint *fh,MPI_Offset *offset, MPI_Offset *disp, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_byte_offset(fh_c,*offset,disp); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_errhf.c b/3rd-party/romio321/mpi-io/fortran/get_errhf.c deleted file mode 100644 index 96901ad7766..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_errhf.c +++ /dev/null @@ -1,103 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_ERRHANDLER( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_GET_ERRHANDLER = PMPI_FILE_GET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_errhandler__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_errhandler__ = pmpi_file_get_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_errhandler( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_errhandler = pmpi_file_get_errhandler -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_errhandler_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_errhandler_ = pmpi_file_get_errhandler_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_ERRHANDLER MPI_FILE_GET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_errhandler__ mpi_file_get_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_errhandler mpi_file_get_errhandler -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_errhandler_ mpi_file_get_errhandler_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_ERRHANDLER as PMPI_FILE_GET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_errhandler__ as pmpi_file_get_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_errhandler as pmpi_file_get_errhandler -#else -#pragma _CRI duplicate mpi_file_get_errhandler_ as pmpi_file_get_errhandler_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_errhandler_ PMPI_FILE_GET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_errhandler_ pmpi_file_get_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_errhandler pmpi_file_get_errhandler_ -#endif -#define mpi_file_get_errhandler_ pmpi_file_get_errhandler -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_errhandler_ pmpi_file_get_errhandler -#endif -#define mpi_file_get_errhandler_ pmpi_file_get_errhandler_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_errhandler_ MPI_FILE_GET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_errhandler_ mpi_file_get_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_errhandler mpi_file_get_errhandler_ -#endif -#define mpi_file_get_errhandler_ mpi_file_get_errhandler -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_errhandler_ mpi_file_get_errhandler -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_errhandler_(MPI_Fint *fh, MPI_Fint *err_handler, MPI_Fint *ierr); - -FORTRAN_API void FORT_CALL mpi_file_get_errhandler_(MPI_Fint *fh, MPI_Fint *err_handler, MPI_Fint *ierr) -{ - MPI_File fh_c; - MPI_Errhandler err_handler_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_errhandler(fh_c, &err_handler_c); - *err_handler = MPI_Errhandler_c2f(err_handler_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_extentf.c b/3rd-party/romio321/mpi-io/fortran/get_extentf.c deleted file mode 100644 index 9a11d3c946f..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_extentf.c +++ /dev/null @@ -1,126 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_TYPE_EXTENT( MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_GET_TYPE_EXTENT = PMPI_FILE_GET_TYPE_EXTENT -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_type_extent__( MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_get_type_extent__ = pmpi_file_get_type_extent__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_type_extent( MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_get_type_extent = pmpi_file_get_type_extent -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_type_extent_( MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_get_type_extent_ = pmpi_file_get_type_extent_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_TYPE_EXTENT MPI_FILE_GET_TYPE_EXTENT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_type_extent__ mpi_file_get_type_extent__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_type_extent mpi_file_get_type_extent -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_type_extent_ mpi_file_get_type_extent_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_TYPE_EXTENT as PMPI_FILE_GET_TYPE_EXTENT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_type_extent__ as pmpi_file_get_type_extent__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_type_extent as pmpi_file_get_type_extent -#else -#pragma _CRI duplicate mpi_file_get_type_extent_ as pmpi_file_get_type_extent_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_type_extent_ PMPI_FILE_GET_TYPE_EXTENT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_type_extent_ pmpi_file_get_type_extent__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_type_extent pmpi_file_get_type_extent_ -#endif -#define mpi_file_get_type_extent_ pmpi_file_get_type_extent -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_type_extent_ pmpi_file_get_type_extent -#endif -#define mpi_file_get_type_extent_ pmpi_file_get_type_extent_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_type_extent_ MPI_FILE_GET_TYPE_EXTENT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_type_extent_ mpi_file_get_type_extent__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_type_extent mpi_file_get_type_extent_ -#endif -#define mpi_file_get_type_extent_ mpi_file_get_type_extent -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_type_extent_ mpi_file_get_type_extent -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Fint *datatype, - MPI_Fint *extent, MPI_Fint *ierr ); - -void mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Fint *datatype, - MPI_Fint *extent, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - MPI_Aint extent_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_get_type_extent(fh_c,datatype_c, &extent_c); - *(MPI_Aint*)extent = extent_c; /* Have to assume it's really an MPI_Aint?*/ -} - -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Datatype *datatype, - MPI_Fint *extent, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Datatype *datatype, - MPI_Fint *extent, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Aint extent_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_type_extent(fh_c,*datatype, &extent_c); - *(MPI_Aint*)extent = extent_c; /* Have to assume it's really an MPI_Aint?*/ -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/get_groupf.c b/3rd-party/romio321/mpi-io/fortran/get_groupf.c deleted file mode 100644 index bb8c9a9cba7..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_groupf.c +++ /dev/null @@ -1,116 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_GROUP( MPI_Fint *, MPI_Group*, MPI_Fint * ); -#pragma weak MPI_FILE_GET_GROUP = PMPI_FILE_GET_GROUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_group__( MPI_Fint *, MPI_Group*, MPI_Fint * ); -#pragma weak mpi_file_get_group__ = pmpi_file_get_group__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_group( MPI_Fint *, MPI_Group*, MPI_Fint * ); -#pragma weak mpi_file_get_group = pmpi_file_get_group -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_group_( MPI_Fint *, MPI_Group*, MPI_Fint * ); -#pragma weak mpi_file_get_group_ = pmpi_file_get_group_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_GROUP MPI_FILE_GET_GROUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_group__ mpi_file_get_group__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_group mpi_file_get_group -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_group_ mpi_file_get_group_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_GROUP as PMPI_FILE_GET_GROUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_group__ as pmpi_file_get_group__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_group as pmpi_file_get_group -#else -#pragma _CRI duplicate mpi_file_get_group_ as pmpi_file_get_group_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_group_ PMPI_FILE_GET_GROUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_group_ pmpi_file_get_group__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_group pmpi_file_get_group_ -#endif -#define mpi_file_get_group_ pmpi_file_get_group -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_group_ pmpi_file_get_group -#endif -#define mpi_file_get_group_ pmpi_file_get_group_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_group_ MPI_FILE_GET_GROUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_group_ mpi_file_get_group__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_group mpi_file_get_group_ -#endif -#define mpi_file_get_group_ mpi_file_get_group -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_group_ mpi_file_get_group -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_get_group_(MPI_Fint *fh, MPI_Fint *group, MPI_Fint *ierr ); - -void mpi_file_get_group_(MPI_Fint *fh, MPI_Fint *group, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Group group_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_group(fh_c, &group_c); - *group = MPI_Group_c2f(group_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_group_(MPI_Fint *fh,MPI_Group *group, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_group_(MPI_Fint *fh,MPI_Group *group, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_group(fh_c, group); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/get_infof.c b/3rd-party/romio321/mpi-io/fortran/get_infof.c deleted file mode 100644 index eb2ba551a45..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_infof.c +++ /dev/null @@ -1,104 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_INFO( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_GET_INFO = PMPI_FILE_GET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_info__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_info__ = pmpi_file_get_info__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_info( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_info = pmpi_file_get_info -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_info_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_get_info_ = pmpi_file_get_info_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_INFO MPI_FILE_GET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_info__ mpi_file_get_info__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_info mpi_file_get_info -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_info_ mpi_file_get_info_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_INFO as PMPI_FILE_GET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_info__ as pmpi_file_get_info__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_info as pmpi_file_get_info -#else -#pragma _CRI duplicate mpi_file_get_info_ as pmpi_file_get_info_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_info_ PMPI_FILE_GET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_info_ pmpi_file_get_info__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_info pmpi_file_get_info_ -#endif -#define mpi_file_get_info_ pmpi_file_get_info -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_info_ pmpi_file_get_info -#endif -#define mpi_file_get_info_ pmpi_file_get_info_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_info_ MPI_FILE_GET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_info_ mpi_file_get_info__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_info mpi_file_get_info_ -#endif -#define mpi_file_get_info_ mpi_file_get_info -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_info_ mpi_file_get_info -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_info_(MPI_Fint *fh, MPI_Fint *info_used, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_info_(MPI_Fint *fh, MPI_Fint *info_used, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Info info_used_c; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_get_info(fh_c, &info_used_c); - *info_used = MPI_Info_c2f(info_used_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_posn_shf.c b/3rd-party/romio321/mpi-io/fortran/get_posn_shf.c deleted file mode 100644 index 8f5bff5c06e..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_posn_shf.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_POSITION_SHARED( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak MPI_FILE_GET_POSITION_SHARED = PMPI_FILE_GET_POSITION_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_position_shared__( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_position_shared__ = pmpi_file_get_position_shared__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_position_shared( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_position_shared = pmpi_file_get_position_shared -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_position_shared_( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_position_shared_ = pmpi_file_get_position_shared_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_POSITION_SHARED MPI_FILE_GET_POSITION_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_shared__ mpi_file_get_position_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_shared mpi_file_get_position_shared -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_shared_ mpi_file_get_position_shared_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_POSITION_SHARED as PMPI_FILE_GET_POSITION_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_position_shared__ as pmpi_file_get_position_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_position_shared as pmpi_file_get_position_shared -#else -#pragma _CRI duplicate mpi_file_get_position_shared_ as pmpi_file_get_position_shared_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_position_shared_ PMPI_FILE_GET_POSITION_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_position_shared_ pmpi_file_get_position_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_shared pmpi_file_get_position_shared_ -#endif -#define mpi_file_get_position_shared_ pmpi_file_get_position_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_shared_ pmpi_file_get_position_shared -#endif -#define mpi_file_get_position_shared_ pmpi_file_get_position_shared_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_position_shared_ MPI_FILE_GET_POSITION_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_position_shared_ mpi_file_get_position_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_position_shared mpi_file_get_position_shared_ -#endif -#define mpi_file_get_position_shared_ mpi_file_get_position_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_position_shared_ mpi_file_get_position_shared -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_position_shared_(MPI_Fint *fh, MPI_Offset *offset, - MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_position_shared_(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_position_shared(fh_c, offset); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_posnf.c b/3rd-party/romio321/mpi-io/fortran/get_posnf.c deleted file mode 100644 index e21f37674a7..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_posnf.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_POSITION( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak MPI_FILE_GET_POSITION = PMPI_FILE_GET_POSITION -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_position__( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_position__ = pmpi_file_get_position__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_position( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_position = pmpi_file_get_position -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_position_( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_position_ = pmpi_file_get_position_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_POSITION MPI_FILE_GET_POSITION -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position__ mpi_file_get_position__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position mpi_file_get_position -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_ mpi_file_get_position_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_POSITION as PMPI_FILE_GET_POSITION -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_position__ as pmpi_file_get_position__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_position as pmpi_file_get_position -#else -#pragma _CRI duplicate mpi_file_get_position_ as pmpi_file_get_position_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_position_ PMPI_FILE_GET_POSITION -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_position_ pmpi_file_get_position__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position pmpi_file_get_position_ -#endif -#define mpi_file_get_position_ pmpi_file_get_position -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_position_ pmpi_file_get_position -#endif -#define mpi_file_get_position_ pmpi_file_get_position_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_position_ MPI_FILE_GET_POSITION -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_position_ mpi_file_get_position__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_position mpi_file_get_position_ -#endif -#define mpi_file_get_position_ mpi_file_get_position -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_position_ mpi_file_get_position -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_position_(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_position_(MPI_Fint *fh, MPI_Offset *offset, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_position(fh_c, offset); -} diff --git a/3rd-party/romio321/mpi-io/fortran/get_sizef.c b/3rd-party/romio321/mpi-io/fortran/get_sizef.c deleted file mode 100644 index 71ff17bb562..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_sizef.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_SIZE( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak MPI_FILE_GET_SIZE = PMPI_FILE_GET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_size__( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_size__ = pmpi_file_get_size__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_size( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_size = pmpi_file_get_size -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_size_( MPI_Fint *, MPI_Offset*, MPI_Fint * ); -#pragma weak mpi_file_get_size_ = pmpi_file_get_size_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_SIZE MPI_FILE_GET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_size__ mpi_file_get_size__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_size mpi_file_get_size -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_size_ mpi_file_get_size_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_SIZE as PMPI_FILE_GET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_size__ as pmpi_file_get_size__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_size as pmpi_file_get_size -#else -#pragma _CRI duplicate mpi_file_get_size_ as pmpi_file_get_size_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_size_ PMPI_FILE_GET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_size_ pmpi_file_get_size__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_size pmpi_file_get_size_ -#endif -#define mpi_file_get_size_ pmpi_file_get_size -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_size_ pmpi_file_get_size -#endif -#define mpi_file_get_size_ pmpi_file_get_size_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_size_ MPI_FILE_GET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_size_ mpi_file_get_size__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_size mpi_file_get_size_ -#endif -#define mpi_file_get_size_ mpi_file_get_size -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_size_ mpi_file_get_size -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_get_size_(MPI_Fint *fh, MPI_Offset *size, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_get_size_(MPI_Fint *fh, MPI_Offset *size, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_size(fh_c, size); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/get_viewf.c b/3rd-party/romio321/mpi-io/fortran/get_viewf.c deleted file mode 100644 index 8a4bc3d7fb8..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/get_viewf.c +++ /dev/null @@ -1,187 +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. - */ - -#ifdef _UNICOS -#include -#endif -#include "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_GET_VIEW( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak MPI_FILE_GET_VIEW = PMPI_FILE_GET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_view__( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_get_view__ = pmpi_file_get_view__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_get_view( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_get_view = pmpi_file_get_view -#else -extern FORTRAN_API void FORT_CALL mpi_file_get_view_( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_get_view_ = pmpi_file_get_view_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_GET_VIEW MPI_FILE_GET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_view__ mpi_file_get_view__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_get_view mpi_file_get_view -#else -#pragma _HP_SECONDARY_DEF pmpi_file_get_view_ mpi_file_get_view_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_GET_VIEW as PMPI_FILE_GET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_view__ as pmpi_file_get_view__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_get_view as pmpi_file_get_view -#else -#pragma _CRI duplicate mpi_file_get_view_ as pmpi_file_get_view_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_get_view_ PMPI_FILE_GET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_view_ pmpi_file_get_view__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_view pmpi_file_get_view_ -#endif -#define mpi_file_get_view_ pmpi_file_get_view -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_get_view_ pmpi_file_get_view -#endif -#define mpi_file_get_view_ pmpi_file_get_view_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_get_view_ MPI_FILE_GET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_get_view_ mpi_file_get_view__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_view mpi_file_get_view_ -#endif -#define mpi_file_get_view_ mpi_file_get_view -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_get_view_ mpi_file_get_view -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_get_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, - MPI_Fint *filetype,char *datarep, MPI_Fint *ierr, int str_len ); - -void mpi_file_get_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, - MPI_Fint *filetype,char *datarep, MPI_Fint *ierr, int str_len ) -{ - MPI_File fh_c; - MPI_Datatype etype_c, filetype_c; - int i, tmpreplen; - char *tmprep; - - if (datarep <= (char *) 0) { - FPRINTF(stderr, "MPI_File_get_view: datarep is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - tmprep = (char *) ADIOI_Malloc((MPI_MAX_DATAREP_STRING+1) * sizeof(char)); - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_get_view(fh_c, disp, &etype_c, &filetype_c, tmprep); - - tmpreplen = strlen(tmprep); - if (tmpreplen <= str_len) { - ADIOI_Strncpy(datarep, tmprep, tmpreplen); - - /* blank pad the remaining space */ - for (i=tmpreplen; iPMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpio_test_ PMPIO_TEST -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpio_test_ pmpio_test__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpio_test pmpio_test_ -#endif -#define mpio_test_ pmpio_test -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpio_test_ pmpio_test -#endif -#define mpio_test_ pmpio_test_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpio_test_ MPIO_TEST -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpio_test_ mpio_test__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpio_test mpio_test_ -#endif -#define mpio_test_ mpio_test -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpio_test_ mpio_test -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpio_test_(MPI_Fint *request,MPI_Fint *flag,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpio_test_(MPI_Fint *request,MPI_Fint *flag,MPI_Status *status, MPI_Fint *ierr ) -{ - MPIO_Request req_c; - - req_c = MPIO_Request_f2c(*request); - *ierr = MPIO_Test(&req_c,flag,status); - *request = MPIO_Request_c2f(req_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/iowaitf.c b/3rd-party/romio321/mpi-io/fortran/iowaitf.c deleted file mode 100644 index a87ca6a6d91..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/iowaitf.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 "adio.h" -#include "mpio.h" - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -FORTRAN_API void FORT_CALL MPIO_WAIT(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ); -#pragma weak MPIO_WAIT = PMPIO_WAIT -#elif defined(FORTRANDOUBLEUNDERSCORE) -FORTRAN_API void FORT_CALL mpio_wait__(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ); -#pragma weak mpio_wait__ = pmpio_wait__ -#elif !defined(FORTRANUNDERSCORE) -FORTRAN_API void FORT_CALL mpio_wait(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ); -#pragma weak mpio_wait = pmpio_wait -#else -FORTRAN_API void FORT_CALL mpio_wait_(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ); -#pragma weak mpio_wait_ = pmpio_wait_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPIO_WAIT MPIO_WAIT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpio_wait__ mpio_wait__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpio_wait mpio_wait -#else -#pragma _HP_SECONDARY_DEF pmpio_wait_ mpio_wait_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPIO_WAIT as PMPIO_WAIT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpio_wait__ as pmpio_wait__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpio_wait as pmpio_wait -#else -#pragma _CRI duplicate mpio_wait_ as pmpio_wait_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpio_wait_ PMPIO_WAIT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpio_wait_ pmpio_wait__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpio_wait pmpio_wait_ -#endif -#define mpio_wait_ pmpio_wait -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpio_wait_ pmpio_wait -#endif -#define mpio_wait_ pmpio_wait_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpio_wait_ MPIO_WAIT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpio_wait_ mpio_wait__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpio_wait mpio_wait_ -#endif -#define mpio_wait_ mpio_wait -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpio_wait_ mpio_wait -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpio_wait_(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpio_wait_(MPI_Fint *request,MPI_Status *status, MPI_Fint *ierr ) -{ - MPIO_Request req_c; - - req_c = MPIO_Request_f2c(*request); - *ierr = MPIO_Wait(&req_c, status); - *request = MPIO_Request_c2f(req_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/iread_atf.c b/3rd-party/romio321/mpi-io/fortran/iread_atf.c deleted file mode 100644 index c6a687dcee0..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/iread_atf.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_IREAD_AT( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_IREAD_AT = PMPI_FILE_IREAD_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iread_at__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_at__ = pmpi_file_iread_at__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iread_at( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_at = pmpi_file_iread_at -#else -extern FORTRAN_API void FORT_CALL mpi_file_iread_at_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_at_ = pmpi_file_iread_at_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_IREAD_AT MPI_FILE_IREAD_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_at__ mpi_file_iread_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_at mpi_file_iread_at -#else -#pragma _HP_SECONDARY_DEF pmpi_file_iread_at_ mpi_file_iread_at_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_IREAD_AT as PMPI_FILE_IREAD_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_iread_at__ as pmpi_file_iread_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_iread_at as pmpi_file_iread_at -#else -#pragma _CRI duplicate mpi_file_iread_at_ as pmpi_file_iread_at_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_iread_at_ PMPI_FILE_IREAD_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iread_at_ pmpi_file_iread_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_at pmpi_file_iread_at_ -#endif -#define mpi_file_iread_at_ pmpi_file_iread_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_at_ pmpi_file_iread_at -#endif -#define mpi_file_iread_at_ pmpi_file_iread_at_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_iread_at_ MPI_FILE_IREAD_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iread_at_ mpi_file_iread_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iread_at mpi_file_iread_at_ -#endif -#define mpi_file_iread_at_ mpi_file_iread_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iread_at_ mpi_file_iread_at -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_iread_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Fint *request, MPI_Fint *ierr ); - -void mpi_file_iread_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_iread_at(fh_c,*offset,buf,*count,datatype_c,&req_c); - - *request = MPIO_Request_c2f(req_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_iread_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Datatype *datatype, - MPI_Fint *request, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_iread_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Datatype *datatype, - MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iread_at(fh_c,*offset,buf,*count,*datatype,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/iread_shf.c b/3rd-party/romio321/mpi-io/fortran/iread_shf.c deleted file mode 100644 index 84dc3753c4a..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/iread_shf.c +++ /dev/null @@ -1,124 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_IREAD_SHARED( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_IREAD_SHARED = PMPI_FILE_IREAD_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iread_shared__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_shared__ = pmpi_file_iread_shared__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iread_shared( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_shared = pmpi_file_iread_shared -#else -extern FORTRAN_API void FORT_CALL mpi_file_iread_shared_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_shared_ = pmpi_file_iread_shared_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_IREAD_SHARED MPI_FILE_IREAD_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_shared__ mpi_file_iread_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_shared mpi_file_iread_shared -#else -#pragma _HP_SECONDARY_DEF pmpi_file_iread_shared_ mpi_file_iread_shared_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_IREAD_SHARED as PMPI_FILE_IREAD_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_iread_shared__ as pmpi_file_iread_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_iread_shared as pmpi_file_iread_shared -#else -#pragma _CRI duplicate mpi_file_iread_shared_ as pmpi_file_iread_shared_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_iread_shared_ PMPI_FILE_IREAD_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iread_shared_ pmpi_file_iread_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_shared pmpi_file_iread_shared_ -#endif -#define mpi_file_iread_shared_ pmpi_file_iread_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_shared_ pmpi_file_iread_shared -#endif -#define mpi_file_iread_shared_ pmpi_file_iread_shared_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_iread_shared_ MPI_FILE_IREAD_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iread_shared_ mpi_file_iread_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iread_shared mpi_file_iread_shared_ -#endif -#define mpi_file_iread_shared_ mpi_file_iread_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iread_shared_ mpi_file_iread_shared -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_iread_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -void mpi_file_iread_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - MPI_Datatype datatype_c; - - datatype_c = MPI_Type_f2c(*datatype); - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iread_shared(fh_c,buf,*count,datatype_c,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_iread_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_iread_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iread_shared(fh_c,buf,*count,*datatype,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/ireadf.c b/3rd-party/romio321/mpi-io/fortran/ireadf.c deleted file mode 100644 index ae9fbaf3bfd..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/ireadf.c +++ /dev/null @@ -1,124 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_IREAD( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_IREAD = PMPI_FILE_IREAD -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iread__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread__ = pmpi_file_iread__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iread( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread = pmpi_file_iread -#else -extern FORTRAN_API void FORT_CALL mpi_file_iread_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iread_ = pmpi_file_iread_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_IREAD MPI_FILE_IREAD -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iread__ mpi_file_iread__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iread mpi_file_iread -#else -#pragma _HP_SECONDARY_DEF pmpi_file_iread_ mpi_file_iread_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_IREAD as PMPI_FILE_IREAD -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_iread__ as pmpi_file_iread__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_iread as pmpi_file_iread -#else -#pragma _CRI duplicate mpi_file_iread_ as pmpi_file_iread_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_iread_ PMPI_FILE_IREAD -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iread_ pmpi_file_iread__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iread pmpi_file_iread_ -#endif -#define mpi_file_iread_ pmpi_file_iread -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iread_ pmpi_file_iread -#endif -#define mpi_file_iread_ pmpi_file_iread_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_iread_ MPI_FILE_IREAD -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iread_ mpi_file_iread__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iread mpi_file_iread_ -#endif -#define mpi_file_iread_ mpi_file_iread -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iread_ mpi_file_iread -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_iread_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -void mpi_file_iread_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - MPI_Datatype datatype_c; - - datatype_c = MPI_Type_f2c(*datatype); - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iread(fh_c,buf,*count,datatype_c,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_iread_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_iread_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iread(fh_c,buf,*count,*datatype,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/iwrite_atf.c b/3rd-party/romio321/mpi-io/fortran/iwrite_atf.c deleted file mode 100644 index b326fc3d1a7..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/iwrite_atf.c +++ /dev/null @@ -1,129 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_IWRITE_AT( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_IWRITE_AT = PMPI_FILE_IWRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_at__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_at__ = pmpi_file_iwrite_at__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_at( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_at = pmpi_file_iwrite_at -#else -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_at_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_at_ = pmpi_file_iwrite_at_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_IWRITE_AT MPI_FILE_IWRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_at__ mpi_file_iwrite_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_at mpi_file_iwrite_at -#else -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_at_ mpi_file_iwrite_at_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_IWRITE_AT as PMPI_FILE_IWRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_iwrite_at__ as pmpi_file_iwrite_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_iwrite_at as pmpi_file_iwrite_at -#else -#pragma _CRI duplicate mpi_file_iwrite_at_ as pmpi_file_iwrite_at_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_iwrite_at_ PMPI_FILE_IWRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iwrite_at_ pmpi_file_iwrite_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_at pmpi_file_iwrite_at_ -#endif -#define mpi_file_iwrite_at_ pmpi_file_iwrite_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_at_ pmpi_file_iwrite_at -#endif -#define mpi_file_iwrite_at_ pmpi_file_iwrite_at_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_iwrite_at_ MPI_FILE_IWRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iwrite_at_ mpi_file_iwrite_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iwrite_at mpi_file_iwrite_at_ -#endif -#define mpi_file_iwrite_at_ mpi_file_iwrite_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iwrite_at_ mpi_file_iwrite_at -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_iwrite_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Fint *request, MPI_Fint *ierr ); - -void mpi_file_iwrite_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_iwrite_at(fh_c,*offset,buf,*count,datatype_c,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_iwrite_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Datatype *datatype, - MPI_Fint *request, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_iwrite_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Datatype *datatype, - MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iwrite_at(fh_c,*offset,buf,*count,*datatype,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/iwrite_shf.c b/3rd-party/romio321/mpi-io/fortran/iwrite_shf.c deleted file mode 100644 index 90ea68777b6..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/iwrite_shf.c +++ /dev/null @@ -1,124 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_IWRITE_SHARED( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_IWRITE_SHARED = PMPI_FILE_IWRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_shared__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_shared__ = pmpi_file_iwrite_shared__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_shared( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_shared = pmpi_file_iwrite_shared -#else -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_shared_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_shared_ = pmpi_file_iwrite_shared_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_IWRITE_SHARED MPI_FILE_IWRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_shared__ mpi_file_iwrite_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_shared mpi_file_iwrite_shared -#else -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_shared_ mpi_file_iwrite_shared_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_IWRITE_SHARED as PMPI_FILE_IWRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_iwrite_shared__ as pmpi_file_iwrite_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_iwrite_shared as pmpi_file_iwrite_shared -#else -#pragma _CRI duplicate mpi_file_iwrite_shared_ as pmpi_file_iwrite_shared_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_iwrite_shared_ PMPI_FILE_IWRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iwrite_shared_ pmpi_file_iwrite_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_shared pmpi_file_iwrite_shared_ -#endif -#define mpi_file_iwrite_shared_ pmpi_file_iwrite_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_shared_ pmpi_file_iwrite_shared -#endif -#define mpi_file_iwrite_shared_ pmpi_file_iwrite_shared_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_iwrite_shared_ MPI_FILE_IWRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iwrite_shared_ mpi_file_iwrite_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iwrite_shared mpi_file_iwrite_shared_ -#endif -#define mpi_file_iwrite_shared_ mpi_file_iwrite_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iwrite_shared_ mpi_file_iwrite_shared -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ); -void mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_iwrite_shared(fh_c,buf,*count,datatype_c,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_iwrite_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iwrite_shared(fh_c,buf,*count,*datatype,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/iwritef.c b/3rd-party/romio321/mpi-io/fortran/iwritef.c deleted file mode 100644 index 4410c011a14..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/iwritef.c +++ /dev/null @@ -1,125 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_IWRITE( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak MPI_FILE_IWRITE = PMPI_FILE_IWRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iwrite__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite__ = pmpi_file_iwrite__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_iwrite( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite = pmpi_file_iwrite -#else -extern FORTRAN_API void FORT_CALL mpi_file_iwrite_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint*, MPI_Fint * ); -#pragma weak mpi_file_iwrite_ = pmpi_file_iwrite_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_IWRITE MPI_FILE_IWRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite__ mpi_file_iwrite__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite mpi_file_iwrite -#else -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_ mpi_file_iwrite_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_IWRITE as PMPI_FILE_IWRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_iwrite__ as pmpi_file_iwrite__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_iwrite as pmpi_file_iwrite -#else -#pragma _CRI duplicate mpi_file_iwrite_ as pmpi_file_iwrite_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_iwrite_ PMPI_FILE_IWRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iwrite_ pmpi_file_iwrite__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite pmpi_file_iwrite_ -#endif -#define mpi_file_iwrite_ pmpi_file_iwrite -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_iwrite_ pmpi_file_iwrite -#endif -#define mpi_file_iwrite_ pmpi_file_iwrite_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_iwrite_ MPI_FILE_IWRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_iwrite_ mpi_file_iwrite__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iwrite mpi_file_iwrite_ -#endif -#define mpi_file_iwrite_ mpi_file_iwrite -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_iwrite_ mpi_file_iwrite -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_iwrite_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -void mpi_file_iwrite_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_iwrite(fh_c,buf,*count,datatype_c,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_iwrite_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_iwrite_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Datatype *datatype,MPI_Fint *request, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPIO_Request req_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_iwrite(fh_c,buf,*count,*datatype,&req_c); - *request = MPIO_Request_c2f(req_c); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/openf.c b/3rd-party/romio321/mpi-io/fortran/openf.c deleted file mode 100644 index ea1a5d1c47e..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/openf.c +++ /dev/null @@ -1,187 +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. - */ - -#ifdef _UNICOS -#include -#endif -#include "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_OPEN( MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint *, MPI_File*, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak MPI_FILE_OPEN = PMPI_FILE_OPEN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_open__( MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint *, MPI_File*, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_open__ = pmpi_file_open__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_open( MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint *, MPI_File*, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_open = pmpi_file_open -#else -extern FORTRAN_API void FORT_CALL mpi_file_open_( MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint *, MPI_File*, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_open_ = pmpi_file_open_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_OPEN MPI_FILE_OPEN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_open__ mpi_file_open__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_open mpi_file_open -#else -#pragma _HP_SECONDARY_DEF pmpi_file_open_ mpi_file_open_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_OPEN as PMPI_FILE_OPEN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_open__ as pmpi_file_open__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_open as pmpi_file_open -#else -#pragma _CRI duplicate mpi_file_open_ as pmpi_file_open_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_open_ PMPI_FILE_OPEN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_open_ pmpi_file_open__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_open pmpi_file_open_ -#endif -#define mpi_file_open_ pmpi_file_open -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_open_ pmpi_file_open -#endif -#define mpi_file_open_ pmpi_file_open_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_open_ MPI_FILE_OPEN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_open_ mpi_file_open__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_open mpi_file_open_ -#endif -#define mpi_file_open_ mpi_file_open -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_open_ mpi_file_open -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_open_(MPI_Fint *comm,char *filename,MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr, int str_len ); - -void mpi_file_open_(MPI_Fint *comm,char *filename,MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr, int str_len ) -{ - char *newfname; - MPI_File fh_c; - int real_len, i; - MPI_Comm comm_c; - MPI_Info info_c; - - comm_c = MPI_Comm_f2c(*comm); - info_c = MPI_Info_f2c(*info); - - /* strip trailing blanks */ - if (filename <= (char *) 0) { - FPRINTF(stderr, "MPI_File_open: filename is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - for (i=str_len-1; i>=0; i--) if (filename[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_File_open: filename is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - real_len = i + 1; - - newfname = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); - ADIOI_Strncpy(newfname, filename, real_len); - newfname[real_len] = '\0'; - - *ierr = MPI_File_open(comm_c, newfname, *amode, info_c, &fh_c); - - *fh = MPI_File_c2f(fh_c); - ADIOI_Free(newfname); -} - -#else - -#ifdef _UNICOS -void mpi_file_open_(MPI_Fint *comm,_fcd filename_fcd,MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr) -{ - char *filename = _fcdtocp(filename_fcd); - int str_len = _fcdlen(filename_fcd); -#else -/* Prototype to keep compiler happy */ -/* -FORTRAN_API void FORT_CALL mpi_file_open_(MPI_Comm *comm,char *filename,MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr, int str_len ); - -FORTRAN_API void FORT_CALL mpi_file_open_(MPI_Comm *comm,char *filename,MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr, int str_len ) -*/ -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_open_(MPI_Fint *comm,char *filename FORT_MIXED_LEN_DECL,MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr FORT_END_LEN_DECL); - -FORTRAN_API void FORT_CALL mpi_file_open_(MPI_Fint *comm,char *filename FORT_MIXED_LEN(str_len),MPI_Fint *amode, - MPI_Fint *info, MPI_Fint *fh, MPI_Fint *ierr FORT_END_LEN(str_len)) -{ -#endif - char *newfname; - MPI_File fh_c; - int real_len, i; - MPI_Info info_c; - - info_c = MPI_Info_f2c(*info); - - /* strip trailing blanks */ - if (filename <= (char *) 0) { - FPRINTF(stderr, "MPI_File_open: filename is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - for (i=str_len-1; i>=0; i--) if (filename[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_File_open: filename is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - real_len = i + 1; - - newfname = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); - ADIOI_Strncpy(newfname, filename, real_len); - newfname[real_len] = '\0'; - - *ierr = MPI_File_open((MPI_Comm)(*comm), newfname, *amode, info_c, &fh_c); - - *fh = MPI_File_c2f(fh_c); - ADIOI_Free(newfname); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/preallocf.c b/3rd-party/romio321/mpi-io/fortran/preallocf.c deleted file mode 100644 index 515aa4a9125..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/preallocf.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_PREALLOCATE( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak MPI_FILE_PREALLOCATE = PMPI_FILE_PREALLOCATE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_preallocate__( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak mpi_file_preallocate__ = pmpi_file_preallocate__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_preallocate( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak mpi_file_preallocate = pmpi_file_preallocate -#else -extern FORTRAN_API void FORT_CALL mpi_file_preallocate_( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak mpi_file_preallocate_ = pmpi_file_preallocate_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_PREALLOCATE MPI_FILE_PREALLOCATE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_preallocate__ mpi_file_preallocate__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_preallocate mpi_file_preallocate -#else -#pragma _HP_SECONDARY_DEF pmpi_file_preallocate_ mpi_file_preallocate_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_PREALLOCATE as PMPI_FILE_PREALLOCATE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_preallocate__ as pmpi_file_preallocate__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_preallocate as pmpi_file_preallocate -#else -#pragma _CRI duplicate mpi_file_preallocate_ as pmpi_file_preallocate_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_preallocate_ PMPI_FILE_PREALLOCATE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_preallocate_ pmpi_file_preallocate__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_preallocate pmpi_file_preallocate_ -#endif -#define mpi_file_preallocate_ pmpi_file_preallocate -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_preallocate_ pmpi_file_preallocate -#endif -#define mpi_file_preallocate_ pmpi_file_preallocate_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_preallocate_ MPI_FILE_PREALLOCATE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_preallocate_ mpi_file_preallocate__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_preallocate mpi_file_preallocate_ -#endif -#define mpi_file_preallocate_ mpi_file_preallocate -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_preallocate_ mpi_file_preallocate -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_preallocate_(MPI_Fint *fh,MPI_Offset *size, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_preallocate_(MPI_Fint *fh,MPI_Offset *size, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_preallocate(fh_c,*size); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/rd_atallbf.c b/3rd-party/romio321/mpi-io/fortran/rd_atallbf.c deleted file mode 100644 index 5fff4e9e7ec..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/rd_atallbf.c +++ /dev/null @@ -1,121 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_AT_ALL_BEGIN( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_READ_AT_ALL_BEGIN = PMPI_FILE_READ_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_begin__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_begin__ = pmpi_file_read_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_begin( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_begin = pmpi_file_read_at_all_begin -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_begin_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_begin_ = pmpi_file_read_at_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_AT_ALL_BEGIN MPI_FILE_READ_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_begin__ mpi_file_read_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_begin mpi_file_read_at_all_begin -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_begin_ mpi_file_read_at_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_AT_ALL_BEGIN as PMPI_FILE_READ_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at_all_begin__ as pmpi_file_read_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at_all_begin as pmpi_file_read_at_all_begin -#else -#pragma _CRI duplicate mpi_file_read_at_all_begin_ as pmpi_file_read_at_all_begin_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_at_all_begin_ PMPI_FILE_READ_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_all_begin_ pmpi_file_read_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_begin pmpi_file_read_at_all_begin_ -#endif -#define mpi_file_read_at_all_begin_ pmpi_file_read_at_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_begin_ pmpi_file_read_at_all_begin -#endif -#define mpi_file_read_at_all_begin_ pmpi_file_read_at_all_begin_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_at_all_begin_ MPI_FILE_READ_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_all_begin_ mpi_file_read_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_all_begin mpi_file_read_at_all_begin_ -#endif -#define mpi_file_read_at_all_begin_ mpi_file_read_at_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_all_begin_ mpi_file_read_at_all_begin -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ); - -void mpi_file_read_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_at_all_begin(fh_c,*offset,buf,*count,datatype_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_at_all_begin(fh_c,*offset,buf,*count,(MPI_Datatype) *datatype); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/rd_atallef.c b/3rd-party/romio321/mpi-io/fortran/rd_atallef.c deleted file mode 100644 index 8a3441126dd..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/rd_atallef.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_AT_ALL_END( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_AT_ALL_END = PMPI_FILE_READ_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_end__( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_end__ = pmpi_file_read_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_end( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_end = pmpi_file_read_at_all_end -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_end_( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_end_ = pmpi_file_read_at_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_AT_ALL_END MPI_FILE_READ_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_end__ mpi_file_read_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_end mpi_file_read_at_all_end -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_end_ mpi_file_read_at_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_AT_ALL_END as PMPI_FILE_READ_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at_all_end__ as pmpi_file_read_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at_all_end as pmpi_file_read_at_all_end -#else -#pragma _CRI duplicate mpi_file_read_at_all_end_ as pmpi_file_read_at_all_end_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_at_all_end_ PMPI_FILE_READ_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_all_end_ pmpi_file_read_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_end pmpi_file_read_at_all_end_ -#endif -#define mpi_file_read_at_all_end_ pmpi_file_read_at_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_end_ pmpi_file_read_at_all_end -#endif -#define mpi_file_read_at_all_end_ pmpi_file_read_at_all_end_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_at_all_end_ MPI_FILE_READ_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_all_end_ mpi_file_read_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_all_end mpi_file_read_at_all_end_ -#endif -#define mpi_file_read_at_all_end_ mpi_file_read_at_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_all_end_ mpi_file_read_at_all_end -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_at_all_end(fh_c,buf,status); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/read_allbf.c b/3rd-party/romio321/mpi-io/fortran/read_allbf.c deleted file mode 100644 index 5708a03c8dc..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_allbf.c +++ /dev/null @@ -1,120 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_ALL_BEGIN( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_READ_ALL_BEGIN = PMPI_FILE_READ_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_all_begin__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_all_begin__ = pmpi_file_read_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_all_begin( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_all_begin = pmpi_file_read_all_begin -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_all_begin_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_all_begin_ = pmpi_file_read_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_ALL_BEGIN MPI_FILE_READ_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_begin__ mpi_file_read_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_begin mpi_file_read_all_begin -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_begin_ mpi_file_read_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_ALL_BEGIN as PMPI_FILE_READ_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_all_begin__ as pmpi_file_read_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_all_begin as pmpi_file_read_all_begin -#else -#pragma _CRI duplicate mpi_file_read_all_begin_ as pmpi_file_read_all_begin_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_all_begin_ PMPI_FILE_READ_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_all_begin_ pmpi_file_read_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_begin pmpi_file_read_all_begin_ -#endif -#define mpi_file_read_all_begin_ pmpi_file_read_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_begin_ pmpi_file_read_all_begin -#endif -#define mpi_file_read_all_begin_ pmpi_file_read_all_begin_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_all_begin_ MPI_FILE_READ_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_all_begin_ mpi_file_read_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_all_begin mpi_file_read_all_begin_ -#endif -#define mpi_file_read_all_begin_ mpi_file_read_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_all_begin_ mpi_file_read_all_begin -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ); - -void mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_all_begin(fh_c,buf,*count,datatype_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_all_begin(fh_c,buf,*count,(MPI_Datatype) *datatype); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/read_allef.c b/3rd-party/romio321/mpi-io/fortran/read_allef.c deleted file mode 100644 index 776b182d640..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_allef.c +++ /dev/null @@ -1,103 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_ALL_END( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_ALL_END = PMPI_FILE_READ_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_all_end__( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_all_end__ = pmpi_file_read_all_end__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_all_end( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_all_end = pmpi_file_read_all_end -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_all_end_( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_all_end_ = pmpi_file_read_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_ALL_END MPI_FILE_READ_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_end__ mpi_file_read_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_end mpi_file_read_all_end -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_end_ mpi_file_read_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_ALL_END as PMPI_FILE_READ_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_all_end__ as pmpi_file_read_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_all_end as pmpi_file_read_all_end -#else -#pragma _CRI duplicate mpi_file_read_all_end_ as pmpi_file_read_all_end_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_all_end_ PMPI_FILE_READ_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_all_end_ pmpi_file_read_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_end pmpi_file_read_all_end_ -#endif -#define mpi_file_read_all_end_ pmpi_file_read_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_end_ pmpi_file_read_all_end -#endif -#define mpi_file_read_all_end_ pmpi_file_read_all_end_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_all_end_ MPI_FILE_READ_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_all_end_ mpi_file_read_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_all_end mpi_file_read_all_end_ -#endif -#define mpi_file_read_all_end_ mpi_file_read_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_all_end_ mpi_file_read_all_end -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, - MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_read_all_end(fh_c,buf,status); -} diff --git a/3rd-party/romio321/mpi-io/fortran/read_allf.c b/3rd-party/romio321/mpi-io/fortran/read_allf.c deleted file mode 100644 index 99e1229b7f1..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_allf.c +++ /dev/null @@ -1,120 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_ALL( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_ALL = PMPI_FILE_READ_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_all__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_all__ = pmpi_file_read_all__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_all( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_all = pmpi_file_read_all -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_all_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_all_ = pmpi_file_read_all_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_ALL MPI_FILE_READ_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all__ mpi_file_read_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all mpi_file_read_all -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_ mpi_file_read_all_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_ALL as PMPI_FILE_READ_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_all__ as pmpi_file_read_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_all as pmpi_file_read_all -#else -#pragma _CRI duplicate mpi_file_read_all_ as pmpi_file_read_all_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_all_ PMPI_FILE_READ_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_all_ pmpi_file_read_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all pmpi_file_read_all_ -#endif -#define mpi_file_read_all_ pmpi_file_read_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_all_ pmpi_file_read_all -#endif -#define mpi_file_read_all_ pmpi_file_read_all_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_all_ MPI_FILE_READ_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_all_ mpi_file_read_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_all mpi_file_read_all_ -#endif -#define mpi_file_read_all_ mpi_file_read_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_all_ mpi_file_read_all -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_all(fh_c,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_all(fh_c,buf,*count,(MPI_Datatype)*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/read_atallf.c b/3rd-party/romio321/mpi-io/fortran/read_atallf.c deleted file mode 100644 index b9f30a00562..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_atallf.c +++ /dev/null @@ -1,125 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_AT_ALL( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_AT_ALL = PMPI_FILE_READ_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_all__ = pmpi_file_read_at_all__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_all = pmpi_file_read_at_all -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_at_all_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_all_ = pmpi_file_read_at_all_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_AT_ALL MPI_FILE_READ_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all__ mpi_file_read_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all mpi_file_read_at_all -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_ mpi_file_read_at_all_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_AT_ALL as PMPI_FILE_READ_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at_all__ as pmpi_file_read_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at_all as pmpi_file_read_at_all -#else -#pragma _CRI duplicate mpi_file_read_at_all_ as pmpi_file_read_at_all_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_at_all_ PMPI_FILE_READ_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_all_ pmpi_file_read_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all pmpi_file_read_at_all_ -#endif -#define mpi_file_read_at_all_ pmpi_file_read_at_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_all_ pmpi_file_read_at_all -#endif -#define mpi_file_read_at_all_ pmpi_file_read_at_all_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_at_all_ MPI_FILE_READ_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_all_ mpi_file_read_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_all mpi_file_read_at_all_ -#endif -#define mpi_file_read_at_all_ mpi_file_read_at_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_all_ mpi_file_read_at_all -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_read_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_at_all(fh_c,*offset,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_at_all(fh_c,*offset,buf,*count,(MPI_Datatype)*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/read_atf.c b/3rd-party/romio321/mpi-io/fortran/read_atf.c deleted file mode 100644 index 2602e399bf6..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_atf.c +++ /dev/null @@ -1,121 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_AT( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_AT = PMPI_FILE_READ_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at__ = pmpi_file_read_at__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_at( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at = pmpi_file_read_at -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_at_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_at_ = pmpi_file_read_at_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_AT MPI_FILE_READ_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at__ mpi_file_read_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at mpi_file_read_at -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_ mpi_file_read_at_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_AT as PMPI_FILE_READ_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at__ as pmpi_file_read_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_at as pmpi_file_read_at -#else -#pragma _CRI duplicate mpi_file_read_at_ as pmpi_file_read_at_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_at_ PMPI_FILE_READ_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_ pmpi_file_read_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at pmpi_file_read_at_ -#endif -#define mpi_file_read_at_ pmpi_file_read_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_at_ pmpi_file_read_at -#endif -#define mpi_file_read_at_ pmpi_file_read_at_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_at_ MPI_FILE_READ_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_at_ mpi_file_read_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at mpi_file_read_at_ -#endif -#define mpi_file_read_at_ mpi_file_read_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_at_ mpi_file_read_at -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_read_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_at(fh_c,*offset,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_at(fh_c,*offset,buf,*count,(MPI_Datatype)*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/read_ordbf.c b/3rd-party/romio321/mpi-io/fortran/read_ordbf.c deleted file mode 100644 index 74389174f4c..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_ordbf.c +++ /dev/null @@ -1,120 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_ORDERED_BEGIN( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_READ_ORDERED_BEGIN = PMPI_FILE_READ_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_begin__ = pmpi_file_read_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_begin = pmpi_file_read_ordered_begin -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_begin_ = pmpi_file_read_ordered_begin_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_ORDERED_BEGIN MPI_FILE_READ_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_begin__ mpi_file_read_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_begin mpi_file_read_ordered_begin -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_begin_ mpi_file_read_ordered_begin_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_ORDERED_BEGIN as PMPI_FILE_READ_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_ordered_begin__ as pmpi_file_read_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_ordered_begin as pmpi_file_read_ordered_begin -#else -#pragma _CRI duplicate mpi_file_read_ordered_begin_ as pmpi_file_read_ordered_begin_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_ordered_begin_ PMPI_FILE_READ_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ordered_begin_ pmpi_file_read_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_begin pmpi_file_read_ordered_begin_ -#endif -#define mpi_file_read_ordered_begin_ pmpi_file_read_ordered_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_begin_ pmpi_file_read_ordered_begin -#endif -#define mpi_file_read_ordered_begin_ pmpi_file_read_ordered_begin_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_ordered_begin_ MPI_FILE_READ_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ordered_begin_ mpi_file_read_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ordered_begin mpi_file_read_ordered_begin_ -#endif -#define mpi_file_read_ordered_begin_ mpi_file_read_ordered_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ordered_begin_ mpi_file_read_ordered_begin -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *ierr ); - -void mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_ordered_begin(fh_c,buf,*count,datatype_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_ordered_begin(fh_c,buf,*count,(MPI_Datatype)*datatype); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/read_ordef.c b/3rd-party/romio321/mpi-io/fortran/read_ordef.c deleted file mode 100644 index 63425c8ad33..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_ordef.c +++ /dev/null @@ -1,103 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_ORDERED_END( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_ORDERED_END = PMPI_FILE_READ_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_end__( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_end__ = pmpi_file_read_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_end( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_end = pmpi_file_read_ordered_end -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_end_ = pmpi_file_read_ordered_end_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_ORDERED_END MPI_FILE_READ_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_end__ mpi_file_read_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_end mpi_file_read_ordered_end -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_end_ mpi_file_read_ordered_end_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_ORDERED_END as PMPI_FILE_READ_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_ordered_end__ as pmpi_file_read_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_ordered_end as pmpi_file_read_ordered_end -#else -#pragma _CRI duplicate mpi_file_read_ordered_end_ as pmpi_file_read_ordered_end_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_ordered_end_ PMPI_FILE_READ_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ordered_end_ pmpi_file_read_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_end pmpi_file_read_ordered_end_ -#endif -#define mpi_file_read_ordered_end_ pmpi_file_read_ordered_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_end_ pmpi_file_read_ordered_end -#endif -#define mpi_file_read_ordered_end_ pmpi_file_read_ordered_end_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_ordered_end_ MPI_FILE_READ_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ordered_end_ mpi_file_read_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ordered_end mpi_file_read_ordered_end_ -#endif -#define mpi_file_read_ordered_end_ mpi_file_read_ordered_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ordered_end_ mpi_file_read_ordered_end -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, - MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_read_ordered_end(fh_c,buf,status); -} diff --git a/3rd-party/romio321/mpi-io/fortran/read_ordf.c b/3rd-party/romio321/mpi-io/fortran/read_ordf.c deleted file mode 100644 index a45ae1282ff..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_ordf.c +++ /dev/null @@ -1,120 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_ORDERED( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_ORDERED = PMPI_FILE_READ_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ordered__ = pmpi_file_read_ordered__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ordered = pmpi_file_read_ordered -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_ordered_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ordered_ = pmpi_file_read_ordered_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_ORDERED MPI_FILE_READ_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered__ mpi_file_read_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered mpi_file_read_ordered -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_ mpi_file_read_ordered_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_ORDERED as PMPI_FILE_READ_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_ordered__ as pmpi_file_read_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_ordered as pmpi_file_read_ordered -#else -#pragma _CRI duplicate mpi_file_read_ordered_ as pmpi_file_read_ordered_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_ordered_ PMPI_FILE_READ_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ordered_ pmpi_file_read_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered pmpi_file_read_ordered_ -#endif -#define mpi_file_read_ordered_ pmpi_file_read_ordered -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ordered_ pmpi_file_read_ordered -#endif -#define mpi_file_read_ordered_ pmpi_file_read_ordered_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_ordered_ MPI_FILE_READ_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ordered_ mpi_file_read_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ordered mpi_file_read_ordered_ -#endif -#define mpi_file_read_ordered_ mpi_file_read_ordered -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ordered_ mpi_file_read_ordered -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_ordered(fh_c,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_ordered(fh_c,buf,*count,(MPI_Datatype)*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/read_shf.c b/3rd-party/romio321/mpi-io/fortran/read_shf.c deleted file mode 100644 index 937e54fb95e..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/read_shf.c +++ /dev/null @@ -1,119 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ_SHARED( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ_SHARED = PMPI_FILE_READ_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_shared__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_shared__ = pmpi_file_read_shared__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read_shared( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_shared = pmpi_file_read_shared -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_shared_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_shared_ = pmpi_file_read_shared_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ_SHARED MPI_FILE_READ_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_shared__ mpi_file_read_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read_shared mpi_file_read_shared -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_shared_ mpi_file_read_shared_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ_SHARED as PMPI_FILE_READ_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_shared__ as pmpi_file_read_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read_shared as pmpi_file_read_shared -#else -#pragma _CRI duplicate mpi_file_read_shared_ as pmpi_file_read_shared_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_shared_ PMPI_FILE_READ_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_shared_ pmpi_file_read_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_shared pmpi_file_read_shared_ -#endif -#define mpi_file_read_shared_ pmpi_file_read_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_shared_ pmpi_file_read_shared -#endif -#define mpi_file_read_shared_ pmpi_file_read_shared_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_shared_ MPI_FILE_READ_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_shared_ mpi_file_read_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_shared mpi_file_read_shared_ -#endif -#define mpi_file_read_shared_ mpi_file_read_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_shared_ mpi_file_read_shared -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); -void mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read_shared(fh_c,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); -FORTRAN_API void FORT_CALL mpi_file_read_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read_shared(fh_c,buf,*count,(MPI_Datatype)*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/readf.c b/3rd-party/romio321/mpi-io/fortran/readf.c deleted file mode 100644 index c802739139e..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/readf.c +++ /dev/null @@ -1,121 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_READ( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_READ = PMPI_FILE_READ -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read__ = pmpi_file_read__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_read( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read = pmpi_file_read -#else -extern FORTRAN_API void FORT_CALL mpi_file_read_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_read_ = pmpi_file_read_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_READ MPI_FILE_READ -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read__ mpi_file_read__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_read mpi_file_read -#else -#pragma _HP_SECONDARY_DEF pmpi_file_read_ mpi_file_read_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_READ as PMPI_FILE_READ -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_read__ as pmpi_file_read__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_read as pmpi_file_read -#else -#pragma _CRI duplicate mpi_file_read_ as pmpi_file_read_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_read_ PMPI_FILE_READ -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ pmpi_file_read__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read pmpi_file_read_ -#endif -#define mpi_file_read_ pmpi_file_read -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_read_ pmpi_file_read -#endif -#define mpi_file_read_ pmpi_file_read_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_read_ MPI_FILE_READ -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_read_ mpi_file_read__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read mpi_file_read_ -#endif -#define mpi_file_read_ mpi_file_read -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_read_ mpi_file_read -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_read_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_read_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_read(fh_c,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_read_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_read_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_read(fh_c,buf,*count,(MPI_Datatype)*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/seek_shf.c b/3rd-party/romio321/mpi-io/fortran/seek_shf.c deleted file mode 100644 index 158e626c0e7..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/seek_shf.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SEEK_SHARED( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_SEEK_SHARED = PMPI_FILE_SEEK_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_seek_shared__( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_seek_shared__ = pmpi_file_seek_shared__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_seek_shared( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_seek_shared = pmpi_file_seek_shared -#else -extern FORTRAN_API void FORT_CALL mpi_file_seek_shared_( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_seek_shared_ = pmpi_file_seek_shared_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SEEK_SHARED MPI_FILE_SEEK_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_seek_shared__ mpi_file_seek_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_seek_shared mpi_file_seek_shared -#else -#pragma _HP_SECONDARY_DEF pmpi_file_seek_shared_ mpi_file_seek_shared_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SEEK_SHARED as PMPI_FILE_SEEK_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_seek_shared__ as pmpi_file_seek_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_seek_shared as pmpi_file_seek_shared -#else -#pragma _CRI duplicate mpi_file_seek_shared_ as pmpi_file_seek_shared_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_seek_shared_ PMPI_FILE_SEEK_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_seek_shared_ pmpi_file_seek_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_seek_shared pmpi_file_seek_shared_ -#endif -#define mpi_file_seek_shared_ pmpi_file_seek_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_seek_shared_ pmpi_file_seek_shared -#endif -#define mpi_file_seek_shared_ pmpi_file_seek_shared_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_seek_shared_ MPI_FILE_SEEK_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_seek_shared_ mpi_file_seek_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_seek_shared mpi_file_seek_shared_ -#endif -#define mpi_file_seek_shared_ mpi_file_seek_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_seek_shared_ mpi_file_seek_shared -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_seek_shared_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, - MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_seek_shared_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_seek_shared(fh_c,*offset,*whence); -} diff --git a/3rd-party/romio321/mpi-io/fortran/seekf.c b/3rd-party/romio321/mpi-io/fortran/seekf.c deleted file mode 100644 index 8e125d1849c..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/seekf.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SEEK( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_SEEK = PMPI_FILE_SEEK -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_seek__( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_seek__ = pmpi_file_seek__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_seek( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_seek = pmpi_file_seek -#else -extern FORTRAN_API void FORT_CALL mpi_file_seek_( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_seek_ = pmpi_file_seek_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SEEK MPI_FILE_SEEK -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_seek__ mpi_file_seek__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_seek mpi_file_seek -#else -#pragma _HP_SECONDARY_DEF pmpi_file_seek_ mpi_file_seek_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SEEK as PMPI_FILE_SEEK -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_seek__ as pmpi_file_seek__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_seek as pmpi_file_seek -#else -#pragma _CRI duplicate mpi_file_seek_ as pmpi_file_seek_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_seek_ PMPI_FILE_SEEK -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_seek_ pmpi_file_seek__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_seek pmpi_file_seek_ -#endif -#define mpi_file_seek_ pmpi_file_seek -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_seek_ pmpi_file_seek -#endif -#define mpi_file_seek_ pmpi_file_seek_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_seek_ MPI_FILE_SEEK -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_seek_ mpi_file_seek__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_seek mpi_file_seek_ -#endif -#define mpi_file_seek_ mpi_file_seek -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_seek_ mpi_file_seek -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_seek_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_seek_(MPI_Fint *fh,MPI_Offset *offset,MPI_Fint *whence, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_seek(fh_c,*offset,*whence); -} diff --git a/3rd-party/romio321/mpi-io/fortran/set_atomf.c b/3rd-party/romio321/mpi-io/fortran/set_atomf.c deleted file mode 100644 index c4388950da5..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/set_atomf.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SET_ATOMICITY( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_SET_ATOMICITY = PMPI_FILE_SET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_atomicity__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_atomicity__ = pmpi_file_set_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_atomicity( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_atomicity = pmpi_file_set_atomicity -#else -extern FORTRAN_API void FORT_CALL mpi_file_set_atomicity_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_atomicity_ = pmpi_file_set_atomicity_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SET_ATOMICITY MPI_FILE_SET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_atomicity__ mpi_file_set_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_atomicity mpi_file_set_atomicity -#else -#pragma _HP_SECONDARY_DEF pmpi_file_set_atomicity_ mpi_file_set_atomicity_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SET_ATOMICITY as PMPI_FILE_SET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_atomicity__ as pmpi_file_set_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_atomicity as pmpi_file_set_atomicity -#else -#pragma _CRI duplicate mpi_file_set_atomicity_ as pmpi_file_set_atomicity_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_set_atomicity_ PMPI_FILE_SET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_atomicity_ pmpi_file_set_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_atomicity pmpi_file_set_atomicity_ -#endif -#define mpi_file_set_atomicity_ pmpi_file_set_atomicity -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_atomicity_ pmpi_file_set_atomicity -#endif -#define mpi_file_set_atomicity_ pmpi_file_set_atomicity_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_set_atomicity_ MPI_FILE_SET_ATOMICITY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_atomicity_ mpi_file_set_atomicity__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_atomicity mpi_file_set_atomicity_ -#endif -#define mpi_file_set_atomicity_ mpi_file_set_atomicity -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_atomicity_ mpi_file_set_atomicity -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_set_atomicity_(MPI_Fint *fh,MPI_Fint *flag, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_set_atomicity_(MPI_Fint *fh,MPI_Fint *flag, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_set_atomicity(fh_c,*flag); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/set_errhf.c b/3rd-party/romio321/mpi-io/fortran/set_errhf.c deleted file mode 100644 index c622660898c..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/set_errhf.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SET_ERRHANDLER( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_SET_ERRHANDLER = PMPI_FILE_SET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_errhandler__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_errhandler__ = pmpi_file_set_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_errhandler( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_errhandler = pmpi_file_set_errhandler -#else -extern FORTRAN_API void FORT_CALL mpi_file_set_errhandler_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_errhandler_ = pmpi_file_set_errhandler_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SET_ERRHANDLER MPI_FILE_SET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_errhandler__ mpi_file_set_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_errhandler mpi_file_set_errhandler -#else -#pragma _HP_SECONDARY_DEF pmpi_file_set_errhandler_ mpi_file_set_errhandler_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SET_ERRHANDLER as PMPI_FILE_SET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_errhandler__ as pmpi_file_set_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_errhandler as pmpi_file_set_errhandler -#else -#pragma _CRI duplicate mpi_file_set_errhandler_ as pmpi_file_set_errhandler_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_set_errhandler_ PMPI_FILE_SET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_errhandler_ pmpi_file_set_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_errhandler pmpi_file_set_errhandler_ -#endif -#define mpi_file_set_errhandler_ pmpi_file_set_errhandler -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_errhandler_ pmpi_file_set_errhandler -#endif -#define mpi_file_set_errhandler_ pmpi_file_set_errhandler_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_set_errhandler_ MPI_FILE_SET_ERRHANDLER -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_errhandler_ mpi_file_set_errhandler__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_errhandler mpi_file_set_errhandler_ -#endif -#define mpi_file_set_errhandler_ mpi_file_set_errhandler -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_errhandler_ mpi_file_set_errhandler -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_set_errhandler_(MPI_Fint *fh, MPI_Fint *err_handler, MPI_Fint *ierr); - -FORTRAN_API void FORT_CALL mpi_file_set_errhandler_(MPI_Fint *fh, MPI_Fint *err_handler, MPI_Fint *ierr) -{ - MPI_File fh_c; - MPI_Errhandler err_handler_c; - - fh_c = MPI_File_f2c(*fh); - err_handler_c = MPI_Errhandler_f2c(*err_handler); - - *ierr = MPI_File_set_errhandler(fh_c,err_handler_c); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/set_infof.c b/3rd-party/romio321/mpi-io/fortran/set_infof.c deleted file mode 100644 index 85c05e8f1da..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/set_infof.c +++ /dev/null @@ -1,104 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SET_INFO( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_SET_INFO = PMPI_FILE_SET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_info__( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_info__ = pmpi_file_set_info__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_info( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_info = pmpi_file_set_info -#else -extern FORTRAN_API void FORT_CALL mpi_file_set_info_( MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_set_info_ = pmpi_file_set_info_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SET_INFO MPI_FILE_SET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_info__ mpi_file_set_info__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_info mpi_file_set_info -#else -#pragma _HP_SECONDARY_DEF pmpi_file_set_info_ mpi_file_set_info_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SET_INFO as PMPI_FILE_SET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_info__ as pmpi_file_set_info__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_info as pmpi_file_set_info -#else -#pragma _CRI duplicate mpi_file_set_info_ as pmpi_file_set_info_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_set_info_ PMPI_FILE_SET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_info_ pmpi_file_set_info__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_info pmpi_file_set_info_ -#endif -#define mpi_file_set_info_ pmpi_file_set_info -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_info_ pmpi_file_set_info -#endif -#define mpi_file_set_info_ pmpi_file_set_info_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_set_info_ MPI_FILE_SET_INFO -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_info_ mpi_file_set_info__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_info mpi_file_set_info_ -#endif -#define mpi_file_set_info_ mpi_file_set_info -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_info_ mpi_file_set_info -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_set_info_(MPI_Fint *fh, MPI_Fint *info, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_set_info_(MPI_Fint *fh, MPI_Fint *info, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Info info_c; - - fh_c = MPI_File_f2c(*fh); - info_c = MPI_Info_f2c(*info); - - *ierr = MPI_File_set_info(fh_c, info_c); -} diff --git a/3rd-party/romio321/mpi-io/fortran/set_sizef.c b/3rd-party/romio321/mpi-io/fortran/set_sizef.c deleted file mode 100644 index c595f2b8550..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/set_sizef.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SET_SIZE( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak MPI_FILE_SET_SIZE = PMPI_FILE_SET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_size__( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak mpi_file_set_size__ = pmpi_file_set_size__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_size( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak mpi_file_set_size = pmpi_file_set_size -#else -extern FORTRAN_API void FORT_CALL mpi_file_set_size_( MPI_Fint *, MPI_Offset *, MPI_Fint * ); -#pragma weak mpi_file_set_size_ = pmpi_file_set_size_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SET_SIZE MPI_FILE_SET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_size__ mpi_file_set_size__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_size mpi_file_set_size -#else -#pragma _HP_SECONDARY_DEF pmpi_file_set_size_ mpi_file_set_size_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SET_SIZE as PMPI_FILE_SET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_size__ as pmpi_file_set_size__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_size as pmpi_file_set_size -#else -#pragma _CRI duplicate mpi_file_set_size_ as pmpi_file_set_size_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_set_size_ PMPI_FILE_SET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_size_ pmpi_file_set_size__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_size pmpi_file_set_size_ -#endif -#define mpi_file_set_size_ pmpi_file_set_size -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_size_ pmpi_file_set_size -#endif -#define mpi_file_set_size_ pmpi_file_set_size_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_set_size_ MPI_FILE_SET_SIZE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_size_ mpi_file_set_size__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_size mpi_file_set_size_ -#endif -#define mpi_file_set_size_ mpi_file_set_size -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_size_ mpi_file_set_size -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_set_size_(MPI_Fint *fh,MPI_Offset *size, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_set_size_(MPI_Fint *fh,MPI_Offset *size, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_set_size(fh_c,*size); -} - diff --git a/3rd-party/romio321/mpi-io/fortran/set_viewf.c b/3rd-party/romio321/mpi-io/fortran/set_viewf.c deleted file mode 100644 index 97151d978fb..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/set_viewf.c +++ /dev/null @@ -1,182 +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. - */ - -#ifdef _UNICOS -#include -#endif -#include "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_SET_VIEW( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak MPI_FILE_SET_VIEW = PMPI_FILE_SET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_view__( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_set_view__ = pmpi_file_set_view__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_set_view( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_set_view = pmpi_file_set_view -#else -extern FORTRAN_API void FORT_CALL mpi_file_set_view_( MPI_Fint *, MPI_Offset *, MPI_Fint *, MPI_Fint *, char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL ); -#pragma weak mpi_file_set_view_ = pmpi_file_set_view_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_SET_VIEW MPI_FILE_SET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_view__ mpi_file_set_view__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_set_view mpi_file_set_view -#else -#pragma _HP_SECONDARY_DEF pmpi_file_set_view_ mpi_file_set_view_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_SET_VIEW as PMPI_FILE_SET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_view__ as pmpi_file_set_view__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_set_view as pmpi_file_set_view -#else -#pragma _CRI duplicate mpi_file_set_view_ as pmpi_file_set_view_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_set_view_ PMPI_FILE_SET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_view_ pmpi_file_set_view__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_view pmpi_file_set_view_ -#endif -#define mpi_file_set_view_ pmpi_file_set_view -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_set_view_ pmpi_file_set_view -#endif -#define mpi_file_set_view_ pmpi_file_set_view_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_set_view_ MPI_FILE_SET_VIEW -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_set_view_ mpi_file_set_view__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_view mpi_file_set_view_ -#endif -#define mpi_file_set_view_ mpi_file_set_view -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_set_view_ mpi_file_set_view -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_set_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, - MPI_Fint *filetype,char *datarep,MPI_Fint *info, MPI_Fint *ierr, - int str_len ); - -void mpi_file_set_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype, - MPI_Fint *filetype,char *datarep,MPI_Fint *info, MPI_Fint *ierr, - int str_len ) -{ - char *newstr; - MPI_File fh_c; - int i, real_len; - MPI_Datatype etype_c, filetype_c; - MPI_Info info_c; - - etype_c = MPI_Type_f2c(*etype); - filetype_c = MPI_Type_f2c(*filetype); - info_c = MPI_Info_f2c(*info); - - /* strip trailing blanks in datarep */ - if (datarep <= (char *) 0) { - FPRINTF(stderr, "MPI_File_set_view: datarep is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - for (i=str_len-1; i>=0; i--) if (datarep[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_File_set_view: datarep is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - real_len = i + 1; - - newstr = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); - ADIOI_Strncpy(newstr, datarep, real_len); - newstr[real_len] = '\0'; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_set_view(fh_c,*disp,etype_c,filetype_c,newstr,info_c); - - ADIOI_Free(newstr); -} - -#else - -#ifdef _UNICOS -void mpi_file_set_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Datatype *etype, - MPI_Datatype *filetype,_fcd datarep_fcd,MPI_Fint *info, MPI_Fint *ierr) -{ - char *datarep = _fcdtocp(datarep_fcd); - int str_len = _fcdlen(datarep_fcd); -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_set_view_( MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep FORT_MIXED_LEN_DECL, MPI_Fint *info, MPI_Fint *ierr FORT_END_LEN_DECL ); - -FORTRAN_API void FORT_CALL mpi_file_set_view_( MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep FORT_MIXED_LEN(str_len), MPI_Fint *info, MPI_Fint *ierr FORT_END_LEN(str_len) ) -{ -#endif - char *newstr; - MPI_File fh_c; - int i, real_len; - MPI_Info info_c; - - info_c = MPI_Info_f2c(*info); - - /* strip trailing blanks in datarep */ - if (datarep <= (char *) 0) { - FPRINTF(stderr, "MPI_File_set_view: datarep is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - for (i=str_len-1; i>=0; i--) if (datarep[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_File_set_view: datarep is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - real_len = i + 1; - - newstr = (char *) ADIOI_Malloc((real_len+1)*sizeof(char)); - ADIOI_Strncpy(newstr, datarep, real_len); - newstr[real_len] = '\0'; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_set_view(fh_c,*disp,*etype,*filetype,newstr,info_c); - - ADIOI_Free(newstr); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/wr_atallbf.c b/3rd-party/romio321/mpi-io/fortran/wr_atallbf.c deleted file mode 100644 index 836dd378aee..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/wr_atallbf.c +++ /dev/null @@ -1,122 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_AT_ALL_BEGIN( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_AT_ALL_BEGIN = PMPI_FILE_WRITE_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_begin__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_begin__ = pmpi_file_write_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_begin( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_begin = pmpi_file_write_at_all_begin -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_begin_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_begin_ = pmpi_file_write_at_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_AT_ALL_BEGIN MPI_FILE_WRITE_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_begin__ mpi_file_write_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_begin mpi_file_write_at_all_begin -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_begin_ mpi_file_write_at_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_AT_ALL_BEGIN as PMPI_FILE_WRITE_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at_all_begin__ as pmpi_file_write_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at_all_begin as pmpi_file_write_at_all_begin -#else -#pragma _CRI duplicate mpi_file_write_at_all_begin_ as pmpi_file_write_at_all_begin_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_at_all_begin_ PMPI_FILE_WRITE_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_all_begin_ pmpi_file_write_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_begin pmpi_file_write_at_all_begin_ -#endif -#define mpi_file_write_at_all_begin_ pmpi_file_write_at_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_begin_ pmpi_file_write_at_all_begin -#endif -#define mpi_file_write_at_all_begin_ pmpi_file_write_at_all_begin_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_at_all_begin_ MPI_FILE_WRITE_AT_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_all_begin_ mpi_file_write_at_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_all_begin mpi_file_write_at_all_begin_ -#endif -#define mpi_file_write_at_all_begin_ mpi_file_write_at_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_all_begin_ mpi_file_write_at_all_begin -#endif -#endif -#endif - - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ); - -void mpi_file_write_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_at_all_begin(fh_c,*offset,buf,*count,datatype_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_at_all_begin_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_at_all_begin(fh_c,*offset,buf,*count,(MPI_Datatype)*datatype); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/wr_atallef.c b/3rd-party/romio321/mpi-io/fortran/wr_atallef.c deleted file mode 100644 index 7426c48bf2f..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/wr_atallef.c +++ /dev/null @@ -1,103 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_AT_ALL_END( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_AT_ALL_END = PMPI_FILE_WRITE_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_end__( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_end__ = pmpi_file_write_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_end( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_end = pmpi_file_write_at_all_end -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_end_ = pmpi_file_write_at_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_AT_ALL_END MPI_FILE_WRITE_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_end__ mpi_file_write_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_end mpi_file_write_at_all_end -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_end_ mpi_file_write_at_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_AT_ALL_END as PMPI_FILE_WRITE_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at_all_end__ as pmpi_file_write_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at_all_end as pmpi_file_write_at_all_end -#else -#pragma _CRI duplicate mpi_file_write_at_all_end_ as pmpi_file_write_at_all_end_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_at_all_end_ PMPI_FILE_WRITE_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_all_end_ pmpi_file_write_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_end pmpi_file_write_at_all_end_ -#endif -#define mpi_file_write_at_all_end_ pmpi_file_write_at_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_end_ pmpi_file_write_at_all_end -#endif -#define mpi_file_write_at_all_end_ pmpi_file_write_at_all_end_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_at_all_end_ MPI_FILE_WRITE_AT_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_all_end_ mpi_file_write_at_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_all_end mpi_file_write_at_all_end_ -#endif -#define mpi_file_write_at_all_end_ mpi_file_write_at_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_all_end_ mpi_file_write_at_all_end -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, - MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_at_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_write_at_all_end(fh_c,buf,status); -} diff --git a/3rd-party/romio321/mpi-io/fortran/write_allbf.c b/3rd-party/romio321/mpi-io/fortran/write_allbf.c deleted file mode 100644 index e47d3cd2008..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_allbf.c +++ /dev/null @@ -1,117 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_ALL_BEGIN( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_ALL_BEGIN = PMPI_FILE_WRITE_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_all_begin__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_all_begin__ = pmpi_file_write_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_all_begin( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_all_begin = pmpi_file_write_all_begin -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_all_begin_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_all_begin_ = pmpi_file_write_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_ALL_BEGIN MPI_FILE_WRITE_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_begin__ mpi_file_write_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_begin mpi_file_write_all_begin -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_begin_ mpi_file_write_all_begin_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_ALL_BEGIN as PMPI_FILE_WRITE_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_all_begin__ as pmpi_file_write_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_all_begin as pmpi_file_write_all_begin -#else -#pragma _CRI duplicate mpi_file_write_all_begin_ as pmpi_file_write_all_begin_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_all_begin_ PMPI_FILE_WRITE_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_all_begin_ pmpi_file_write_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_begin pmpi_file_write_all_begin_ -#endif -#define mpi_file_write_all_begin_ pmpi_file_write_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_begin_ pmpi_file_write_all_begin -#endif -#define mpi_file_write_all_begin_ pmpi_file_write_all_begin_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_all_begin_ MPI_FILE_WRITE_ALL_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_all_begin_ mpi_file_write_all_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_all_begin mpi_file_write_all_begin_ -#endif -#define mpi_file_write_all_begin_ mpi_file_write_all_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_all_begin_ mpi_file_write_all_begin -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ); -void mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ){ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_all_begin(fh_c,buf,*count,datatype_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ); -FORTRAN_API void FORT_CALL mpi_file_write_all_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_all_begin(fh_c,buf,*count,(MPI_Datatype)*datatype); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/write_allef.c b/3rd-party/romio321/mpi-io/fortran/write_allef.c deleted file mode 100644 index 9ccc1eb8db9..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_allef.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 "adio.h" -#include "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_ALL_END( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_ALL_END = PMPI_FILE_WRITE_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_all_end__( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_all_end__ = pmpi_file_write_all_end__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_all_end( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_all_end = pmpi_file_write_all_end -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_all_end_( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_all_end_ = pmpi_file_write_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_ALL_END MPI_FILE_WRITE_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_end__ mpi_file_write_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_end mpi_file_write_all_end -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_end_ mpi_file_write_all_end_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_ALL_END as PMPI_FILE_WRITE_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_all_end__ as pmpi_file_write_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_all_end as pmpi_file_write_all_end -#else -#pragma _CRI duplicate mpi_file_write_all_end_ as pmpi_file_write_all_end_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_all_end_ PMPI_FILE_WRITE_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_all_end_ pmpi_file_write_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_end pmpi_file_write_all_end_ -#endif -#define mpi_file_write_all_end_ pmpi_file_write_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_end_ pmpi_file_write_all_end -#endif -#define mpi_file_write_all_end_ pmpi_file_write_all_end_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_all_end_ MPI_FILE_WRITE_ALL_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_all_end_ mpi_file_write_all_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_all_end mpi_file_write_all_end_ -#endif -#define mpi_file_write_all_end_ mpi_file_write_all_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_all_end_ mpi_file_write_all_end -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_all_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_write_all_end(fh_c,buf,status); -} diff --git a/3rd-party/romio321/mpi-io/fortran/write_allf.c b/3rd-party/romio321/mpi-io/fortran/write_allf.c deleted file mode 100644 index bddcac15092..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_allf.c +++ /dev/null @@ -1,119 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_ALL( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_ALL = PMPI_FILE_WRITE_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_all__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_all__ = pmpi_file_write_all__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_all( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_all = pmpi_file_write_all -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_all_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_all_ = pmpi_file_write_all_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_ALL MPI_FILE_WRITE_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all__ mpi_file_write_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all mpi_file_write_all -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_ mpi_file_write_all_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_ALL as PMPI_FILE_WRITE_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_all__ as pmpi_file_write_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_all as pmpi_file_write_all -#else -#pragma _CRI duplicate mpi_file_write_all_ as pmpi_file_write_all_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_all_ PMPI_FILE_WRITE_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_all_ pmpi_file_write_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all pmpi_file_write_all_ -#endif -#define mpi_file_write_all_ pmpi_file_write_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_all_ pmpi_file_write_all -#endif -#define mpi_file_write_all_ pmpi_file_write_all_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_all_ MPI_FILE_WRITE_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_all_ mpi_file_write_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_all mpi_file_write_all_ -#endif -#define mpi_file_write_all_ mpi_file_write_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_all_ mpi_file_write_all -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_all(fh_c,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_all_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_all(fh_c,buf,*count,*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/write_atallf.c b/3rd-party/romio321/mpi-io/fortran/write_atallf.c deleted file mode 100644 index 030e7ae359d..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_atallf.c +++ /dev/null @@ -1,125 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_AT_ALL( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_AT_ALL = PMPI_FILE_WRITE_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_all__ = pmpi_file_write_at_all__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_all = pmpi_file_write_at_all -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_at_all_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_all_ = pmpi_file_write_at_all_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_AT_ALL MPI_FILE_WRITE_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all__ mpi_file_write_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all mpi_file_write_at_all -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_ mpi_file_write_at_all_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_AT_ALL as PMPI_FILE_WRITE_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at_all__ as pmpi_file_write_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at_all as pmpi_file_write_at_all -#else -#pragma _CRI duplicate mpi_file_write_at_all_ as pmpi_file_write_at_all_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_at_all_ PMPI_FILE_WRITE_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_all_ pmpi_file_write_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all pmpi_file_write_at_all_ -#endif -#define mpi_file_write_at_all_ pmpi_file_write_at_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_all_ pmpi_file_write_at_all -#endif -#define mpi_file_write_at_all_ pmpi_file_write_at_all_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_at_all_ MPI_FILE_WRITE_AT_ALL -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_all_ mpi_file_write_at_all__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_all mpi_file_write_at_all_ -#endif -#define mpi_file_write_at_all_ mpi_file_write_at_all -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_all_ mpi_file_write_at_all -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_write_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_at_all(fh_c,*offset,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_at_all_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_at_all(fh_c,*offset,buf,*count,*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/write_atf.c b/3rd-party/romio321/mpi-io/fortran/write_atf.c deleted file mode 100644 index 8ba429dcc6b..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_atf.c +++ /dev/null @@ -1,125 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_AT( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_AT = PMPI_FILE_WRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at__( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at__ = pmpi_file_write_at__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_at( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at = pmpi_file_write_at -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_at_( MPI_Fint *, MPI_Offset *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_at_ = pmpi_file_write_at_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_AT MPI_FILE_WRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at__ mpi_file_write_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at mpi_file_write_at -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_ mpi_file_write_at_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_AT as PMPI_FILE_WRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at__ as pmpi_file_write_at__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_at as pmpi_file_write_at -#else -#pragma _CRI duplicate mpi_file_write_at_ as pmpi_file_write_at_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_at_ PMPI_FILE_WRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_ pmpi_file_write_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at pmpi_file_write_at_ -#endif -#define mpi_file_write_at_ pmpi_file_write_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_at_ pmpi_file_write_at -#endif -#define mpi_file_write_at_ pmpi_file_write_at_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_at_ MPI_FILE_WRITE_AT -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_at_ mpi_file_write_at__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at mpi_file_write_at_ -#endif -#define mpi_file_write_at_ mpi_file_write_at -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_at_ mpi_file_write_at -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_write_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_at(fh_c,*offset,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_at_(MPI_Fint *fh,MPI_Offset *offset,void *buf, - MPI_Fint *count,MPI_Fint *datatype, - MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_at(fh_c,*offset,buf,*count,*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/write_ordbf.c b/3rd-party/romio321/mpi-io/fortran/write_ordbf.c deleted file mode 100644 index 41b9accfbef..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_ordbf.c +++ /dev/null @@ -1,119 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_ORDERED_BEGIN( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_ORDERED_BEGIN = PMPI_FILE_WRITE_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_begin__ = pmpi_file_write_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_begin = pmpi_file_write_ordered_begin -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_begin_ = pmpi_file_write_ordered_begin_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_ORDERED_BEGIN MPI_FILE_WRITE_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_begin__ mpi_file_write_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_begin mpi_file_write_ordered_begin -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_begin_ mpi_file_write_ordered_begin_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_ORDERED_BEGIN as PMPI_FILE_WRITE_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_ordered_begin__ as pmpi_file_write_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_ordered_begin as pmpi_file_write_ordered_begin -#else -#pragma _CRI duplicate mpi_file_write_ordered_begin_ as pmpi_file_write_ordered_begin_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_ordered_begin_ PMPI_FILE_WRITE_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ordered_begin_ pmpi_file_write_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_begin pmpi_file_write_ordered_begin_ -#endif -#define mpi_file_write_ordered_begin_ pmpi_file_write_ordered_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_begin_ pmpi_file_write_ordered_begin -#endif -#define mpi_file_write_ordered_begin_ pmpi_file_write_ordered_begin_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_ordered_begin_ MPI_FILE_WRITE_ORDERED_BEGIN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ordered_begin_ mpi_file_write_ordered_begin__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ordered_begin mpi_file_write_ordered_begin_ -#endif -#define mpi_file_write_ordered_begin_ mpi_file_write_ordered_begin -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ordered_begin_ mpi_file_write_ordered_begin -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ); - -void mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ){ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_ordered_begin(fh_c,buf,*count,datatype_c); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_ordered_begin_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_ordered_begin(fh_c,buf,*count,*datatype); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/write_ordef.c b/3rd-party/romio321/mpi-io/fortran/write_ordef.c deleted file mode 100644 index a979f70eee9..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_ordef.c +++ /dev/null @@ -1,102 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_ORDERED_END( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_ORDERED_END = PMPI_FILE_WRITE_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_end__( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_end__ = pmpi_file_write_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_end( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_end = pmpi_file_write_ordered_end -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_( MPI_Fint *, void*, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_end_ = pmpi_file_write_ordered_end_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_ORDERED_END MPI_FILE_WRITE_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_end__ mpi_file_write_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_end mpi_file_write_ordered_end -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_end_ mpi_file_write_ordered_end_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_ORDERED_END as PMPI_FILE_WRITE_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_ordered_end__ as pmpi_file_write_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_ordered_end as pmpi_file_write_ordered_end -#else -#pragma _CRI duplicate mpi_file_write_ordered_end_ as pmpi_file_write_ordered_end_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_ordered_end_ PMPI_FILE_WRITE_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ordered_end_ pmpi_file_write_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_end pmpi_file_write_ordered_end_ -#endif -#define mpi_file_write_ordered_end_ pmpi_file_write_ordered_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_end_ pmpi_file_write_ordered_end -#endif -#define mpi_file_write_ordered_end_ pmpi_file_write_ordered_end_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_ordered_end_ MPI_FILE_WRITE_ORDERED_END -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ordered_end_ mpi_file_write_ordered_end__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ordered_end mpi_file_write_ordered_end_ -#endif -#define mpi_file_write_ordered_end_ mpi_file_write_ordered_end -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ordered_end_ mpi_file_write_ordered_end -#endif -#endif -#endif - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, - MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_ordered_end_(MPI_Fint *fh,void *buf,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - - *ierr = MPI_File_write_ordered_end(fh_c,buf,status); -} diff --git a/3rd-party/romio321/mpi-io/fortran/write_ordf.c b/3rd-party/romio321/mpi-io/fortran/write_ordf.c deleted file mode 100644 index fe96406d9bb..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_ordf.c +++ /dev/null @@ -1,119 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_ORDERED( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_ORDERED = PMPI_FILE_WRITE_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ordered__ = pmpi_file_write_ordered__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ordered = pmpi_file_write_ordered -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_ordered_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ordered_ = pmpi_file_write_ordered_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_ORDERED MPI_FILE_WRITE_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered__ mpi_file_write_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered mpi_file_write_ordered -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_ mpi_file_write_ordered_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_ORDERED as PMPI_FILE_WRITE_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_ordered__ as pmpi_file_write_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_ordered as pmpi_file_write_ordered -#else -#pragma _CRI duplicate mpi_file_write_ordered_ as pmpi_file_write_ordered_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_ordered_ PMPI_FILE_WRITE_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ordered_ pmpi_file_write_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered pmpi_file_write_ordered_ -#endif -#define mpi_file_write_ordered_ pmpi_file_write_ordered -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ordered_ pmpi_file_write_ordered -#endif -#define mpi_file_write_ordered_ pmpi_file_write_ordered_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_ordered_ MPI_FILE_WRITE_ORDERED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ordered_ mpi_file_write_ordered__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ordered mpi_file_write_ordered_ -#endif -#define mpi_file_write_ordered_ mpi_file_write_ordered -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ordered_ mpi_file_write_ordered -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_ordered(fh_c,buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_ordered_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ){ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_ordered(fh_c,buf,*count,*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/write_shf.c b/3rd-party/romio321/mpi-io/fortran/write_shf.c deleted file mode 100644 index 30d80e0ee6d..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/write_shf.c +++ /dev/null @@ -1,121 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE_SHARED( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE_SHARED = PMPI_FILE_WRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_shared__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_shared__ = pmpi_file_write_shared__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write_shared( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_shared = pmpi_file_write_shared -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_shared_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_shared_ = pmpi_file_write_shared_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE_SHARED MPI_FILE_WRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_shared__ mpi_file_write_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write_shared mpi_file_write_shared -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_shared_ mpi_file_write_shared_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE_SHARED as PMPI_FILE_WRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_shared__ as pmpi_file_write_shared__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write_shared as pmpi_file_write_shared -#else -#pragma _CRI duplicate mpi_file_write_shared_ as pmpi_file_write_shared_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_shared_ PMPI_FILE_WRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_shared_ pmpi_file_write_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_shared pmpi_file_write_shared_ -#endif -#define mpi_file_write_shared_ pmpi_file_write_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_shared_ pmpi_file_write_shared -#endif -#define mpi_file_write_shared_ pmpi_file_write_shared_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_shared_ MPI_FILE_WRITE_SHARED -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_shared_ mpi_file_write_shared__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_shared mpi_file_write_shared_ -#endif -#define mpi_file_write_shared_ mpi_file_write_shared -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_shared_ mpi_file_write_shared -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_write_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write_shared(fh_c, buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_shared_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write_shared(fh_c, buf,*count,*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fortran/writef.c b/3rd-party/romio321/mpi-io/fortran/writef.c deleted file mode 100644 index 9b07ba095fa..00000000000 --- a/3rd-party/romio321/mpi-io/fortran/writef.c +++ /dev/null @@ -1,121 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_FILE_WRITE( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak MPI_FILE_WRITE = PMPI_FILE_WRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write__( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write__ = pmpi_file_write__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_file_write( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write = pmpi_file_write -#else -extern FORTRAN_API void FORT_CALL mpi_file_write_( MPI_Fint *, void*, MPI_Fint *, MPI_Fint *, MPI_Status*, MPI_Fint * ); -#pragma weak mpi_file_write_ = pmpi_file_write_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_FILE_WRITE MPI_FILE_WRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write__ mpi_file_write__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_file_write mpi_file_write -#else -#pragma _HP_SECONDARY_DEF pmpi_file_write_ mpi_file_write_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_FILE_WRITE as PMPI_FILE_WRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_file_write__ as pmpi_file_write__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_file_write as pmpi_file_write -#else -#pragma _CRI duplicate mpi_file_write_ as pmpi_file_write_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_file_write_ PMPI_FILE_WRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ pmpi_file_write__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write pmpi_file_write_ -#endif -#define mpi_file_write_ pmpi_file_write -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_file_write_ pmpi_file_write -#endif -#define mpi_file_write_ pmpi_file_write_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_file_write_ MPI_FILE_WRITE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_file_write_ mpi_file_write__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write mpi_file_write_ -#endif -#define mpi_file_write_ mpi_file_write -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_file_write_ mpi_file_write -#endif -#endif -#endif - -#if defined(MPIHP) || defined(MPILAM) -/* Prototype to keep compiler happy */ -void mpi_file_write_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -void mpi_file_write_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - MPI_Datatype datatype_c; - - fh_c = MPI_File_f2c(*fh); - datatype_c = MPI_Type_f2c(*datatype); - - *ierr = MPI_File_write(fh_c, buf,*count,datatype_c,status); -} -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL mpi_file_write_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL mpi_file_write_(MPI_Fint *fh,void *buf,MPI_Fint *count, - MPI_Fint *datatype,MPI_Status *status, MPI_Fint *ierr ) -{ - MPI_File fh_c; - - fh_c = MPI_File_f2c(*fh); - *ierr = MPI_File_write(fh_c, buf,*count,*datatype,status); -} -#endif diff --git a/3rd-party/romio321/mpi-io/fsync.c b/3rd-party/romio321/mpi-io/fsync.c deleted file mode 100644 index 00c94996294..00000000000 --- a/3rd-party/romio321/mpi-io/fsync.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_sync = PMPI_File_sync -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_sync MPI_File_sync -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_sync as PMPI_File_sync -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_sync(MPI_File fh) __attribute__((weak,alias("PMPI_File_sync"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_sync - Causes all previous writes to be transferred - to the storage device - -Input Parameters: -. fh - file handle (handle) - -.N fortran -@*/ -int MPI_File_sync(MPI_File fh) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_SYNC"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILESYNC, TRDTBLOCK, adio_fh, - MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - /* --BEGIN ERROR HANDLING-- */ - if ((adio_fh == NULL) || ((adio_fh)->cookie != ADIOI_FILE_COOKIE)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadfh", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - MPIO_CHECK_WRITABLE(fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIO_Flush(adio_fh, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/get_amode.c b/3rd-party/romio321/mpi-io/get_amode.c deleted file mode 100644 index 3e9e2c3120f..00000000000 --- a/3rd-party/romio321/mpi-io/get_amode.c +++ /dev/null @@ -1,55 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_amode = PMPI_File_get_amode -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_amode MPI_File_get_amode -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_amode as PMPI_File_get_amode -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_amode(MPI_File fh, int *amode) __attribute__((weak,alias("PMPI_File_get_amode"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_amode - Returns the file access mode - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. amode - access mode (integer) - -.N fortran -@*/ -int MPI_File_get_amode(MPI_File fh, int *amode) -{ - int error_code=MPI_SUCCESS; - static char myname[] = "MPI_FILE_GET_AMODE"; - ADIO_File adio_fh; - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - *amode = adio_fh->orig_access_mode; - -fn_exit: - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/get_atom.c b/3rd-party/romio321/mpi-io/get_atom.c deleted file mode 100644 index 1a9eae1389e..00000000000 --- a/3rd-party/romio321/mpi-io/get_atom.c +++ /dev/null @@ -1,55 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_atomicity = PMPI_File_get_atomicity -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_atomicity MPI_File_get_atomicity -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_atomicity as PMPI_File_get_atomicity -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_atomicity(MPI_File fh, int *flag) __attribute__((weak,alias("PMPI_File_get_atomicity"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_atomicity - Returns the atomicity mode - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. flag - true if atomic mode, false if nonatomic mode (logical) - -.N fortran -@*/ -int MPI_File_get_atomicity(MPI_File fh, int *flag) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_ATOMICITY"; - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - *flag = adio_fh->atomicity; - -fn_exit: - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/get_bytoff.c b/3rd-party/romio321/mpi-io/get_bytoff.c deleted file mode 100644 index f5cb452e5a8..00000000000 --- a/3rd-party/romio321/mpi-io/get_bytoff.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 "mpioimpl.h" -#include "adioi.h" /* ADIOI_Get_byte_offset() prototype */ - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_byte_offset = PMPI_File_get_byte_offset -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_byte_offset MPI_File_get_byte_offset -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_byte_offset as PMPI_File_get_byte_offset -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) __attribute__((weak,alias("PMPI_File_get_byte_offset"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_byte_offset - Returns the absolute byte position in - the file corresponding to "offset" etypes relative to - the current view - -Input Parameters: -. fh - file handle (handle) -. offset - offset (nonnegative integer) - -Output Parameters: -. disp - absolute byte position of offset (nonnegative integer) - -.N fortran -@*/ -int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_BYTE_OFFSET"; - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Get_byte_offset(adio_fh, offset, disp); - -fn_exit: - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/get_errh.c b/3rd-party/romio321/mpi-io/get_errh.c deleted file mode 100644 index 7962e33f921..00000000000 --- a/3rd-party/romio321/mpi-io/get_errh.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 "mpioimpl.h" -#include "adio_extern.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_errhandler = PMPI_File_get_errhandler -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_errhandler MPI_File_get_errhandler -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_errhandler as PMPI_File_get_errhandler -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler) __attribute__((weak,alias("PMPI_File_get_errhandler"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_errhandler - Returns the error handler for a file - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. errhandler - error handler (handle) - -.N fortran -@*/ -int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler) -{ - int error_code = MPI_SUCCESS; - ADIO_File fh; - static char myname[] = "MPI_FILE_GET_ERRHANDLER"; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (mpi_fh == MPI_FILE_NULL) { - *errhandler = ADIOI_DFLT_ERR_HANDLER; - } - else { - fh = MPIO_File_resolve(mpi_fh); - /* --BEGIN ERROR HANDLING-- */ - if ((fh <= (MPI_File) 0) || ((fh)->cookie != ADIOI_FILE_COOKIE)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadfh", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - *errhandler = fh->err_handler; - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/get_extent.c b/3rd-party/romio321/mpi-io/get_extent.c deleted file mode 100644 index 960afab5e55..00000000000 --- a/3rd-party/romio321/mpi-io/get_extent.c +++ /dev/null @@ -1,60 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_type_extent = PMPI_File_get_type_extent -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_type_extent MPI_File_get_type_extent -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_type_extent as PMPI_File_get_type_extent -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent) __attribute__((weak,alias("PMPI_File_get_type_extent"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_type_extent - Returns the extent of datatype in the file - -Input Parameters: -. fh - file handle (handle) -. datatype - datatype (handle) - -Output Parameters: -. extent - extent of the datatype (nonnegative integer) - -.N fortran -@*/ -int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_TYPE_EXTENT"; - MPI_Aint lb; - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - /* FIXME: handle other file data representations */ - - error_code = MPI_Type_get_extent(datatype, &lb, extent); - -fn_exit: - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/get_group.c b/3rd-party/romio321/mpi-io/get_group.c deleted file mode 100644 index 2b3077c7dc1..00000000000 --- a/3rd-party/romio321/mpi-io/get_group.c +++ /dev/null @@ -1,64 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_group = PMPI_File_get_group -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_group MPI_File_get_group -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_group as PMPI_File_get_group -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_group(MPI_File fh, MPI_Group *group) __attribute__((weak,alias("PMPI_File_get_group"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_group - Returns the group of processes that - opened the file - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. group - group that opened the file (handle) - -.N fortran -@*/ -int MPI_File_get_group(MPI_File fh, MPI_Group *group) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_GROUP"; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - - /* note: this will return the group of processes that called open, but - * with deferred open this might not be the group of processes that - * actually opened the file from the file system's perspective - */ - error_code = MPI_Comm_group(adio_fh->comm, group); - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/get_info.c b/3rd-party/romio321/mpi-io/get_info.c deleted file mode 100644 index e923e2b95ec..00000000000 --- a/3rd-party/romio321/mpi-io/get_info.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_info = PMPI_File_get_info -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_info MPI_File_get_info -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_info as PMPI_File_get_info -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) __attribute__((weak,alias("PMPI_File_get_info"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_info - Returns the hints for a file that are actually being used by MPI - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. info_used - info object (handle) - -.N fortran -@*/ -int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_INFO"; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - error_code = MPI_Info_dup(adio_fh->info, info_used); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/get_posn.c b/3rd-party/romio321/mpi-io/get_posn.c deleted file mode 100644 index 49d8e4919bd..00000000000 --- a/3rd-party/romio321/mpi-io/get_posn.c +++ /dev/null @@ -1,59 +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 "mpioimpl.h" -#include "adioi.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_position = PMPI_File_get_position -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_position MPI_File_get_position -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_position as PMPI_File_get_position -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) __attribute__((weak,alias("PMPI_File_get_position"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_position - Returns the current position of the - individual file pointer in etype units relative to - the current view - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. offset - offset of individual file pointer (nonnegative integer) - -.N fortran -@*/ -int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_POSITION"; - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Get_position(adio_fh, offset); - -fn_exit: - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/get_posn_sh.c b/3rd-party/romio321/mpi-io/get_posn_sh.c deleted file mode 100644 index c6172c9d734..00000000000 --- a/3rd-party/romio321/mpi-io/get_posn_sh.c +++ /dev/null @@ -1,64 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_position_shared = PMPI_File_get_position_shared -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_position_shared MPI_File_get_position_shared -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_position_shared as PMPI_File_get_position_shared -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) __attribute__((weak,alias("PMPI_File_get_position_shared"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_position_shared - Returns the current position of the - shared file pointer in etype units relative to the current view - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. offset - offset of shared file pointer (nonnegative integer) - -.N fortran -@*/ -int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_POSITION_SHARED"; - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - ADIO_Get_shared_fp(adio_fh, 0, offset, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/get_size.c b/3rd-party/romio321/mpi-io/get_size.c deleted file mode 100644 index d7836c2791e..00000000000 --- a/3rd-party/romio321/mpi-io/get_size.c +++ /dev/null @@ -1,86 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_size = PMPI_File_get_size -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_size MPI_File_get_size -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_size as PMPI_File_get_size -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_size(MPI_File fh, MPI_Offset *size) __attribute__((weak,alias("PMPI_File_get_size"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_get_size - Returns the file size - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. size - size of the file in bytes (nonnegative integer) - -.N fortran -@*/ -int MPI_File_get_size(MPI_File fh, MPI_Offset *size) -{ - int error_code; - ADIO_File adio_fh; - ADIO_Fcntl_t *fcntl_struct; - static char myname[] = "MPI_FILE_GET_SIZE"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEGETSIZE, TRDTBLOCK, adio_fh, - MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - if(size == NULL){ - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**nullptr", "**nullptr %s", "size"); - goto fn_fail; - } - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - fcntl_struct = (ADIO_Fcntl_t *) ADIOI_Malloc(sizeof(ADIO_Fcntl_t)); - ADIO_Fcntl(adio_fh, ADIO_FCNTL_GET_FSIZE, fcntl_struct, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - *size = fcntl_struct->fsize; - ADIOI_Free(fcntl_struct); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - -fn_exit: - return error_code; -fn_fail: - /* --BEGIN ERROR HANDLING-- */ - error_code = MPIO_Err_return_file(fh, error_code); - goto fn_exit; - /* --END ERROR HANDLING-- */ -} diff --git a/3rd-party/romio321/mpi-io/get_view.c b/3rd-party/romio321/mpi-io/get_view.c deleted file mode 100644 index e07cd9fa951..00000000000 --- a/3rd-party/romio321/mpi-io/get_view.c +++ /dev/null @@ -1,102 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_get_view = PMPI_File_get_view -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_get_view MPI_File_get_view -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_get_view as PMPI_File_get_view -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, - char *datarep) __attribute__((weak,alias("PMPI_File_get_view"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#ifdef MPISGI -#include "mpisgi2.h" -#endif - -/*@ - MPI_File_get_view - Returns the file view - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. disp - displacement (nonnegative integer) -. etype - elementary datatype (handle) -. filetype - filetype (handle) -. datarep - data representation (string) - -.N fortran -@*/ -int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, - MPI_Datatype *filetype, char *datarep) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_GET_VIEW"; - int i, j, k, combiner; - MPI_Datatype copy_etype, copy_filetype; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (datarep == NULL) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iodatarepnomem", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - *disp = adio_fh->disp; - ADIOI_Strncpy(datarep, - (adio_fh->is_external32 ? "external32": "native"), MPI_MAX_DATAREP_STRING); - - MPI_Type_get_envelope(adio_fh->etype, &i, &j, &k, &combiner); - if (combiner == MPI_COMBINER_NAMED) *etype = adio_fh->etype; - else { - /* FIXME: It is wrong to use MPI_Type_contiguous; the user could choose to - re-implement MPI_Type_contiguous in an unexpected way. Either use - MPIR_Barrier_impl as in MPICH or PMPI_Type_contiguous */ - MPI_Type_contiguous(1, adio_fh->etype, ©_etype); - - /* FIXME: Ditto for MPI_Type_commit - use NMPI or PMPI */ - MPI_Type_commit(©_etype); - *etype = copy_etype; - } - /* FIXME: Ditto for MPI_Type_xxx - use NMPI or PMPI */ - MPI_Type_get_envelope(adio_fh->filetype, &i, &j, &k, &combiner); - if (combiner == MPI_COMBINER_NAMED) *filetype = adio_fh->filetype; - else { - MPI_Type_contiguous(1, adio_fh->filetype, ©_filetype); - - MPI_Type_commit(©_filetype); - *filetype = copy_filetype; - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/glue/Makefile.mk b/3rd-party/romio321/mpi-io/glue/Makefile.mk deleted file mode 100644 index 66f7f9efab9..00000000000 --- a/3rd-party/romio321/mpi-io/glue/Makefile.mk +++ /dev/null @@ -1,15 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -include $(top_srcdir)/mpi-io/glue/default/Makefile.mk -include $(top_srcdir)/mpi-io/glue/mpich/Makefile.mk -include $(top_srcdir)/mpi-io/glue/openmpi/Makefile.mk - -if !BUILD_ROMIO_EMBEDDED -romio_other_sources += \ - mpi-io/glue/large_count.c -endif diff --git a/3rd-party/romio321/mpi-io/glue/default/Makefile.mk b/3rd-party/romio321/mpi-io/glue/default/Makefile.mk deleted file mode 100644 index 96995410b7a..00000000000 --- a/3rd-party/romio321/mpi-io/glue/default/Makefile.mk +++ /dev/null @@ -1,13 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if MPIO_GLUE_DEFAULT -romio_other_sources += \ - mpi-io/glue/default/mpio_file.c \ - mpi-io/glue/default/mpio_err.c -endif MPIO_GLUE_DEFAULT - diff --git a/3rd-party/romio321/mpi-io/glue/default/mpio_err.c b/3rd-party/romio321/mpi-io/glue/default/mpio_err.c deleted file mode 100644 index 880de9077a6..00000000000 --- a/3rd-party/romio321/mpi-io/glue/default/mpio_err.c +++ /dev/null @@ -1,88 +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 "mpioimpl.h" -#include "adio_extern.h" - -#include -#include - -/* Default error handling implementation. - * - * Note that only MPI_ERRORS_ARE_FATAL and MPI_ERRORS_RETURN are - * handled correctly; other handlers cause an abort. - */ - -int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[], - int line, int error_class, const char generic_msg[], - const char specific_msg[], ... ) -{ - va_list Argp; - int idx = 0; - char *buf; - - buf = (char *) ADIOI_Malloc(1024); - if (buf != NULL) { - idx += ADIOI_Snprintf(buf, 1023, "%s (line %d): ", fcname, line); - if (specific_msg == NULL) { - ADIOI_Snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg); - } - else { - va_start(Argp, specific_msg); - vsnprintf(&buf[idx], 1023 - idx, specific_msg, Argp); - va_end(Argp); - } - FPRINTF(stderr, "%s", buf); - ADIOI_Free(buf); - } - - return error_class; -} - -int MPIO_Err_return_file(MPI_File mpi_fh, int error_code) -{ - ADIO_File adio_fh; - - if (mpi_fh == MPI_FILE_NULL) - { - if (ADIOI_DFLT_ERR_HANDLER == MPI_ERRORS_ARE_FATAL || - ADIOI_DFLT_ERR_HANDLER != MPI_ERRORS_RETURN) - { - MPI_Abort(MPI_COMM_WORLD, 1); - } - else - { - return error_code; - } - } - - adio_fh = MPIO_File_resolve(mpi_fh); - - if (adio_fh->err_handler == MPI_ERRORS_ARE_FATAL || - adio_fh->err_handler != MPI_ERRORS_RETURN) - { - MPI_Abort(MPI_COMM_WORLD, 1); - } - else - { - return error_code; - } -} - -int MPIO_Err_return_comm(MPI_Comm mpi_comm, int error_code) -{ - MPI_Errhandler errh; - - MPI_Errhandler_get(mpi_comm, &errh); - - if (errh == MPI_ERRORS_ARE_FATAL || - errh != MPI_ERRORS_RETURN) - { - MPI_Abort(mpi_comm, 1); - } - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/glue/default/mpio_file.c b/3rd-party/romio321/mpi-io/glue/default/mpio_file.c deleted file mode 100644 index 38222f77f28..00000000000 --- a/3rd-party/romio321/mpi-io/glue/default/mpio_file.c +++ /dev/null @@ -1,90 +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 "mpioimpl.h" - -/* Hooks for allocation of MPI_File handles. - * - * Three functions are used in ROMIO for allocation/deallocation - * of MPI_File structures: - * - MPIO_File_create(size) - * - MPIO_File_resolve(mpi_fh) - * - MPIO_File_free(mpi_fh) - * - */ - -MPI_File MPIO_File_create(int size) -{ - MPI_File mpi_fh; - - mpi_fh = (MPI_File) ADIOI_Calloc(size,1); - return mpi_fh; -} - -ADIO_File MPIO_File_resolve(MPI_File mpi_fh) -{ - return mpi_fh; -} - -void MPIO_File_free(MPI_File *mpi_fh) -{ - ADIOI_Free(*mpi_fh); - *mpi_fh = MPI_FILE_NULL; -} - -extern ADIO_File *ADIOI_Ftable; -extern int ADIOI_Ftable_ptr; -extern int ADIOI_Ftable_max; - -MPI_File MPIO_File_f2c(MPI_Fint fh) -{ -#ifndef INT_LT_POINTER - return (MPI_File) ((void *) fh); - /* the extra cast is to get rid of a compiler warning on Exemplar. - The warning is because MPI_File points to a structure containing - longlongs, which may be 8-byte aligned. But MPI_Fint itself - may not be 8-byte aligned.*/ -#else - if (!fh) return MPI_FILE_NULL; - if ((fh < 0) || (fh > ADIOI_Ftable_ptr)) { - FPRINTF(stderr, "MPI_File_f2c: Invalid file handle\n"); - /* there is no way to return an error from MPI_File_f2c */ - return MPI_FILE_NULL; - } - return ADIOI_Ftable[fh]; -#endif -} - -MPI_Fint MPIO_File_c2f(MPI_File fh) -{ -#ifndef INT_LT_POINTER - return (MPI_Fint) fh; -#else - int i; - - if ((fh == NULL) || (fh->cookie != ADIOI_FILE_COOKIE)) - return (MPI_Fint) 0; - if (!ADIOI_Ftable) { - ADIOI_Ftable_max = 1024; - ADIOI_Ftable = (MPI_File *) - ADIOI_Malloc(ADIOI_Ftable_max*sizeof(MPI_File)); - ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because - MPI_FILE_NULL=0 */ - for (i=0; i -#include - -#include "mpioimpl.h" -#include "adio_extern.h" - -/* MPICH error handling implementation */ -/* FIXME: These external prototypes should be included from - mpich/src/include/mpiext.h */ -int MPIR_Err_create_code_valist(int, int, const char [], int, int, - const char [], const char [], va_list ); -int MPIR_Err_is_fatal(int); - -void MPIR_Get_file_error_routine( MPI_Errhandler, - void (**)(MPI_File *, int *, ...), - int * ); -int MPIR_File_call_cxx_errhandler( MPI_File *, int *, - void (*)(MPI_File *, int *, ... ) ); - -typedef int (* MPIR_Err_get_class_string_func_t)(int error, char *str, int length); -void MPIR_Err_get_string( int, char *, int, MPIR_Err_get_class_string_func_t ); - -struct MPID_Comm; -int MPID_Abort(struct MPID_Comm *comm, int mpi_errno, int exit_code, const char *error_msg); - -int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[], - int line, int error_class, const char generic_msg[], - const char specific_msg[], ... ) -{ - va_list Argp; - int error_code; - - va_start(Argp, specific_msg); - - error_code = MPIR_Err_create_code_valist(lastcode, fatal, fcname, line, - error_class, generic_msg, - specific_msg, Argp); - - va_end(Argp); - - return error_code; -} - -int MPIO_Err_return_file(MPI_File mpi_fh, int error_code) -{ - MPI_Errhandler e; - void (*c_errhandler)(MPI_File *, int *, ... ); - int kind; /* Error handler kind (see below) */ - char error_msg[4096]; - int len; - - /* If the file pointer is not valid, we use the handler on - MPI_FILE_NULL (MPI-2, section 9.7). For now, this code assumes that - MPI_FILE_NULL has the default handler (return). FIXME. See - below - the set error handler uses ADIOI_DFLT_ERR_HANDLER; - */ - - /* First, get the handler and the corresponding function */ - if (mpi_fh == MPI_FILE_NULL) { - e = ADIOI_DFLT_ERR_HANDLER; - } - else { - ADIO_File fh; - - fh = MPIO_File_resolve(mpi_fh); - e = fh->err_handler; - } - - /* Actually, e is just the value provide by the MPICH routines - file_set_errhandler. This is actually a *pointer* to the - errhandler structure. We don't know that, so we ask - the MPICH code to translate this object into an error handler. - kind = 0: errors are fatal - kind = 1: errors return - kind = 2: errors call function - */ - if (e == MPI_ERRORS_RETURN || e == MPIR_ERRORS_THROW_EXCEPTIONS || !e) { - /* FIXME: This is a hack in case no error handler was set */ - kind = 1; - c_errhandler = 0; - } - else { - MPIR_Get_file_error_routine( e, &c_errhandler, &kind ); - } - - /* --BEGIN ERROR HANDLING-- */ - if (MPIR_Err_is_fatal(error_code) || kind == 0) - { - ADIOI_Snprintf(error_msg, 4096, "I/O error: "); - len = (int)strlen(error_msg); - MPIR_Err_get_string(error_code, &error_msg[len], 4096-len, NULL); - MPID_Abort(NULL, MPI_SUCCESS, error_code, error_msg); - } - /* --END ERROR HANDLING-- */ - else if (kind == 2) { - (*c_errhandler)( &mpi_fh, &error_code, 0 ); - } - else if (kind == 3) { - MPIR_File_call_cxx_errhandler( &mpi_fh, &error_code, c_errhandler ); - } - - /* kind == 1 just returns */ - return error_code; -} - -int MPIO_Err_return_comm(MPI_Comm mpi_comm, int error_code) -{ - /* note: MPI calls inside the MPICH implementation are prefixed - * with an "N", indicating a nested call. - */ - MPI_Comm_call_errhandler(mpi_comm, error_code); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/glue/mpich/mpio_file.c b/3rd-party/romio321/mpi-io/glue/mpich/mpio_file.c deleted file mode 100644 index a5e54a7b4bc..00000000000 --- a/3rd-party/romio321/mpi-io/glue/mpich/mpio_file.c +++ /dev/null @@ -1,92 +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 "mpioimpl.h" - -#include "adio_extern.h" - -/* Hooks for allocation of MPI_File handles. - * - * Three functions are used in ROMIO for allocation/deallocation - * of MPI_File structures: - * - MPIO_File_create(size) - * - MPIO_File_resolve(mpi_fh) - * - MPIO_File_free(mpi_fh) - * - */ - -MPI_File MPIO_File_create(int size) -{ - MPI_File mpi_fh; - - mpi_fh = (MPI_File) ADIOI_Calloc(size,1); - return mpi_fh; -} - -ADIO_File MPIO_File_resolve(MPI_File mpi_fh) -{ - return mpi_fh; -} - -void MPIO_File_free(MPI_File *mpi_fh) -{ - ADIOI_Free(*mpi_fh); - *mpi_fh = MPI_FILE_NULL; -} - -MPI_File MPIO_File_f2c(MPI_Fint fh) -{ -#ifndef INT_LT_POINTER - return (MPI_File) ((void *) fh); - /* the extra cast is to get rid of a compiler warning on Exemplar. - The warning is because MPI_File points to a structure containing - longlongs, which may be 8-byte aligned. But MPI_Fint itself - may not be 8-byte aligned.*/ -#else - if (!fh) return MPI_FILE_NULL; - if ((fh < 0) || (fh > ADIOI_Ftable_ptr)) { - /* there is no way to return an error from MPI_File_f2c */ - return MPI_FILE_NULL; - } - return ADIOI_Ftable[fh]; -#endif -} - -MPI_Fint MPIO_File_c2f(MPI_File fh) -{ -#ifndef INT_LT_POINTER - return (MPI_Fint) fh; -#else - int i; - - if ((fh == NULL) || (fh->cookie != ADIOI_FILE_COOKIE)) - return (MPI_Fint) 0; - - if (fh->fortran_handle != -1) - return fh->fortran_handle; - - if (!ADIOI_Ftable) { - ADIOI_Ftable_max = 1024; - ADIOI_Ftable = (MPI_File *) - ADIOI_Malloc(ADIOI_Ftable_max*sizeof(MPI_File)); - ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because - MPI_FILE_NULL=0 */ - for (i=0; ifortran_handle = ADIOI_Ftable_ptr; - return (MPI_Fint) ADIOI_Ftable_ptr; -#endif -} diff --git a/3rd-party/romio321/mpi-io/glue/openmpi/Makefile.mk b/3rd-party/romio321/mpi-io/glue/openmpi/Makefile.mk deleted file mode 100644 index ab7c15078e9..00000000000 --- a/3rd-party/romio321/mpi-io/glue/openmpi/Makefile.mk +++ /dev/null @@ -1,13 +0,0 @@ -## -*- Mode: Makefile; -*- -## vim: set ft=automake : -## -## (C) 2011 by Argonne National Laboratory. -## See COPYRIGHT in top-level directory. -## - -if MPIO_GLUE_OPENMPI -romio_other_sources += \ - mpi-io/glue/openmpi/mpio_file.c \ - mpi-io/glue/openmpi/mpio_err.c -endif MPIO_GLUE_OPENMPI - diff --git a/3rd-party/romio321/mpi-io/glue/openmpi/mpio_err.c b/3rd-party/romio321/mpi-io/glue/openmpi/mpio_err.c deleted file mode 100644 index 2dddaee8edd..00000000000 --- a/3rd-party/romio321/mpi-io/glue/openmpi/mpio_err.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * Copyright (C) 2004 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include -#include - -#include "mpioimpl.h" -#include "adio_extern.h" - -/* Default error handling implementation. - * - * Note that only MPI_ERRORS_ARE_FATAL and MPI_ERRORS_RETURN are - * handled correctly; other handlers cause an abort. - */ - -int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[], - int line, int error_class, const char generic_msg[], - const char specific_msg[], ...) -{ - va_list Argp; - int idx = 0; - char *buf; - - buf = (char *) ADIOI_Malloc(1024); - if (buf != NULL) { - idx += ADIOI_Snprintf(buf, 1023, "%s (line %d): ", fcname, line); - if (specific_msg == NULL) { - ADIOI_Snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg); - } - else { - va_start(Argp, specific_msg); - vsnprintf(&buf[idx], 1023 - idx, specific_msg, Argp); - va_end(Argp); - } - ADIOI_Free(buf); - } - - return error_class; -} - -int MPIO_Err_return_file(MPI_File mpi_fh, int error_code) -{ - return error_code; -} - -int MPIO_Err_return_comm(MPI_Comm mpi_comm, int error_code) -{ - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/glue/openmpi/mpio_file.c b/3rd-party/romio321/mpi-io/glue/openmpi/mpio_file.c deleted file mode 100644 index f0b6d511889..00000000000 --- a/3rd-party/romio321/mpi-io/glue/openmpi/mpio_file.c +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * - * Copyright (C) 2004 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "mpioimpl.h" - -#include "adio_extern.h" - -/* Hooks for allocation of MPI_File handles. - * - * Three functions are used in ROMIO for allocation/deallocation - * of MPI_File structures: - * - MPIO_File_create(size) - * - MPIO_File_resolve(mpi_fh) - * - MPIO_File_free(mpi_fh) - * - */ - -MPI_File MPIO_File_create(int size) -{ - MPI_File mpi_fh; - - mpi_fh = (MPI_File) ADIOI_Calloc(size, 1); - return mpi_fh; -} - -ADIO_File MPIO_File_resolve(MPI_File mpi_fh) -{ - return mpi_fh; -} - -void MPIO_File_free(MPI_File * mpi_fh) -{ - ADIOI_Free(*mpi_fh); - *mpi_fh = MPI_FILE_NULL; -} - -/* these functions aren't needed with the way Open MPI uses ROMIO */ -#if 0 - - -MPI_File MPIO_File_f2c(MPI_Fint fh) -{ -#ifndef INT_LT_POINTER - return (MPI_File) ((void *) fh); - /* the extra cast is to get rid of a compiler warning on Exemplar. - * The warning is because MPI_File points to a structure containing - * longlongs, which may be 8-byte aligned. But MPI_Fint itself - * may not be 8-byte aligned. */ -#else - if (!fh) - return MPI_FILE_NULL; - if ((fh < 0) || (fh > ADIOI_Ftable_ptr)) { - FPRINTF(stderr, "MPI_File_f2c: Invalid file handle\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - return ADIOI_Ftable[fh]; -#endif -} - -MPI_Fint MPIO_File_c2f(MPI_File fh) -{ -#ifndef INT_LT_POINTER - return (MPI_Fint) fh; -#else - int i; - - if ((fh == NULL) || (fh->cookie != ADIOI_FILE_COOKIE)) - return (MPI_Fint) 0; - if (!ADIOI_Ftable) { - ADIOI_Ftable_max = 1024; - ADIOI_Ftable = (MPI_File *) - ADIOI_Malloc(ADIOI_Ftable_max * sizeof(MPI_File)); - ADIOI_Ftable_ptr = 0; /* 0 can't be used though, because - * MPI_FILE_NULL=0 */ - for (i = 0; i < ADIOI_Ftable_max; i++) - ADIOI_Ftable[i] = MPI_FILE_NULL; - } - if (ADIOI_Ftable_ptr == ADIOI_Ftable_max - 1) { - ADIOI_Ftable = (MPI_File *) ADIOI_Realloc(ADIOI_Ftable, - (ADIOI_Ftable_max + 1024) * sizeof(MPI_File)); - for (i = ADIOI_Ftable_max; i < ADIOI_Ftable_max + 1024; i++) - ADIOI_Ftable[i] = MPI_FILE_NULL; - ADIOI_Ftable_max += 1024; - } - ADIOI_Ftable_ptr++; - ADIOI_Ftable[ADIOI_Ftable_ptr] = fh; - return (MPI_Fint) ADIOI_Ftable_ptr; -#endif -} - -#endif /* #if 0 */ diff --git a/3rd-party/romio321/mpi-io/ioreq_c2f.c b/3rd-party/romio321/mpi-io/ioreq_c2f.c deleted file mode 100644 index d49ebcd2b94..00000000000 --- a/3rd-party/romio321/mpi-io/ioreq_c2f.c +++ /dev/null @@ -1,82 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPIO_Request_c2f = PMPIO_Request_c2f -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPIO_Request_c2f MPIO_Request_c2f -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPIO_Request_c2f as PMPIO_Request_c2f -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#include "adio_extern.h" - -/*@ - MPIO_Request_c2f - Translates a C I/O-request handle to a - Fortran I/O-request handle - -Input Parameters: -. request - C I/O-request handle (handle) - -Return Value: - Fortran I/O-request handle (integer) -@*/ -#ifdef HAVE_MPI_GREQUEST -MPI_Fint MPIO_Request_c2f(MPIO_Request request) -{ - return ((MPI_Fint)request); -} -#else - -MPI_Fint MPIO_Request_c2f(MPIO_Request request) -{ -#ifndef INT_LT_POINTER - return (MPI_Fint) request; -#else - int i; - MPID_THREADPRIV_DECL; - - /* We can make this test outside of the GLOBAL mutex because it does - not access any shared data */ - if ((request <= (MPIO_Request) 0) || (request->cookie != ADIOI_REQ_COOKIE)) - { - return (MPI_Fint) 0; - } - - ROMIO_THREAD_CS_ENTER(); - if (!ADIOI_Reqtable) { - ADIOI_Reqtable_max = 1024; - ADIOI_Reqtable = (MPIO_Request *) - ADIOI_Malloc(ADIOI_Reqtable_max*sizeof(MPIO_Request)); - ADIOI_Reqtable_ptr = 0; /* 0 can't be used though, because - MPIO_REQUEST_NULL=0 */ - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#include "adio_extern.h" - -/*@ - MPIO_Request_f2c - Translates a Fortran I/O-request handle to - a C I/O-request handle - -Input Parameters: -. request - Fortran I/O-request handle (integer) - -Return Value: - C I/O-request handle (handle) -@*/ -#ifdef HAVE_MPI_GREQUEST -MPIO_Request MPIO_Request_f2c(MPI_Fint request) { - return((MPIO_Request) request); -} -#else -MPIO_Request MPIO_Request_f2c(MPI_Fint request) -{ - int error_code; - static char myname[] = "MPIO_REQUEST_F2C"; - MPID_THREADPRIV_DECL; - -#ifndef INT_LT_POINTER - return (MPIO_Request) request; -#else - - ROMIO_THREAD_CS_ENTER(); - - if (!request) { - return MPIO_REQUEST_NULL; - } - /* --BEGIN ERROR HANDLING-- */ - if ((request < 0) || (request > ADIOI_Reqtable_ptr)) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_REQUEST, - "**request", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - return MPIO_REQUEST_NULL; - } - /* --END ERROR HANDLING-- */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return ADIOI_Reqtable[request]; -#endif -} -#endif diff --git a/3rd-party/romio321/mpi-io/iotest.c b/3rd-party/romio321/mpi-io/iotest.c deleted file mode 100644 index 42bc8a3ae5e..00000000000 --- a/3rd-party/romio321/mpi-io/iotest.c +++ /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. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPIO_Test = PMPIO_Test -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPIO_Test MPIO_Test -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPIO_Test as PMPIO_Test -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPIO_Test - Test the completion of a nonblocking read or write - -Input Parameters: -. request - request object (handle) - -Output Parameters: -. flag - true if operation completed (logical) -. status - status object (Status) - -.N fortran -@*/ -#ifdef HAVE_MPI_GREQUEST -int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status) -{ - return (MPI_Test(request, flag, status)); -} -#else -int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPIO_TEST"; - MPID_THREADPRIV_DECL; -#ifdef MPI_hpux - int fl_xmpi; - - if (*request != MPIO_REQUEST_NULL) { - HPMP_IO_WSTART(fl_xmpi, BLKMPIOTEST, TRDTSYSTEM, (*request)->fd); - } -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - if (*request == MPIO_REQUEST_NULL) { - error_code = MPI_SUCCESS; - goto fn_exit; - } - - /* --BEGIN ERROR HANDLING-- */ - if ((*request < (MPIO_Request) 0) || - ((*request)->cookie != ADIOI_REQ_COOKIE)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_REQUEST, - "**request", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - switch ((*request)->optype) { - case ADIOI_READ: - *flag = ADIO_ReadDone(request, status, &error_code); - break; - case ADIOI_WRITE: - *flag = ADIO_WriteDone(request, status, &error_code); - break; - } - -#ifdef MPI_hpux - HPMP_IO_WEND(fl_xmpi); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iotestall.c b/3rd-party/romio321/mpi-io/iotestall.c deleted file mode 100644 index 24dd8b2bc58..00000000000 --- a/3rd-party/romio321/mpi-io/iotestall.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPIO_Testall = PMPIO_Testall -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPIO_Testall MPIO_Testall -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPIO_Testall as PMPIO_Testall -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* - This is a temporary function until we switch to using MPI-2's generalized - requests. -*/ - -int MPIO_Testall(int count, MPIO_Request requests[], int *flag, - MPI_Status statuses[]) -{ - int done, i, err; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - if (count == 1) { - err = MPIO_Test( requests, flag, statuses ); - goto fn_exit; - } - - /* This is actually very difficult to do. We can't use MPIO_Test, - since we must change the requests only if *ALL* requests are complete - */ - /* FIXME: THIS IS NOT CORRECT (see above). But most applications won't - care */ - done = 1; - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* - This is a temporary function until we switch to using MPI-2's generalized - requests. -*/ - -int MPIO_Testany(int count, MPIO_Request requests[], int *index, - int *flag, MPI_Status *status) -{ - int i, err; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (count == 1) { - err = MPIO_Test( requests, flag, status ); - if (!err) *index = 0; - goto fn_exit; - } - - /* Check for no active requests */ - for (i=0; iMPI_SOURCE = MPI_ANY_SOURCE; - status->MPI_TAG = MPI_ANY_TAG; - MPIR_STATUS_SET_COUNT(*status, 0); - MPIR_STATUS_SET_CANCEL_BIT(*status, 0); - } -#endif - err = MPI_SUCCESS; - goto fn_exit; - } - - err = MPI_SUCCESS; - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* - This is a temporary function until we switch to using MPI-2's generalized - requests. -*/ - -int MPIO_Testsome(int count, MPIO_Request requests[], int *outcount, - int indices[], MPI_Status *statuses) -{ - int i, err; - int flag; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (count == 1) { - err = MPIO_Test( requests, &flag, statuses ); - if (!err) { - if (flag) { - indices[0] = 0; - *outcount = 1; - } - else { - *outcount = 0; - } - } - goto fn_exit; - } - - /* Check for no active requests */ - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPIO_Wait - Waits for the completion of a nonblocking read or write - -Input Parameters: -. request - request object (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -#ifdef HAVE_MPI_GREQUEST -int MPIO_Wait(MPIO_Request *request, MPI_Status *status) -{ - return(MPI_Wait(request, status)); -} -#else -int MPIO_Wait(MPIO_Request *request, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPIO_WAIT"; - MPID_THREADPRIV_DECL; - -#ifdef MPI_hpux - int fl_xmpi; - - if (*request != MPIO_REQUEST_NULL) { - HPMP_IO_WSTART(fl_xmpi, BLKMPIOWAIT, TRDTBLOCK, (*request)->fd); - } -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - if (*request == MPIO_REQUEST_NULL) { - error_code = MPI_SUCCESS; - goto fn_exit; - } - - - /* --BEGIN ERROR HANDLING-- */ - if ((*request < (MPIO_Request) 0) || - ((*request)->cookie != ADIOI_REQ_COOKIE)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_REQUEST, - "**request", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - switch ((*request)->optype) { - case ADIOI_READ: - ADIO_ReadComplete(request, status, &error_code); - break; - case ADIOI_WRITE: - ADIO_WriteComplete(request, status, &error_code); - break; - } - -#ifdef MPI_hpux - HPMP_IO_WEND(fl_xmpi); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iowaitall.c b/3rd-party/romio321/mpi-io/iowaitall.c deleted file mode 100644 index 3e5e5b89da5..00000000000 --- a/3rd-party/romio321/mpi-io/iowaitall.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 2003 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPIO_Waitall = PMPIO_Waitall -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPIO_Waitall MPIO_Waitall -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPIO_Waitall as PMPIO_Waitall -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* - This is a temporary function until we switch to using MPI-2's generalized - requests. -*/ - -int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] ) -{ - int notdone, i, flag, err; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (count == 1) { - err = MPIO_Wait(requests, statuses); - goto fn_exit; - } - - - do { - notdone = 0; - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* - This is a temporary function until we switch to using MPI-2's generalized - requests. -*/ - -int MPIO_Waitany(int count, MPIO_Request requests[], int *index, - MPI_Status *status) -{ - int i, flag, err; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (count == 1) { - err = MPIO_Wait( requests, status ); - if (!err) *index = 0; - goto fn_exit; - } - - /* Check for no active requests */ - for (i=0; iMPI_SOURCE = MPI_ANY_SOURCE; - status->MPI_TAG = MPI_ANY_TAG; - MPIR_STATUS_SET_COUNT(*status, 0); - MPIR_STATUS_SET_CANCEL_BIT(*status, 0); - } -#endif - err = MPI_SUCCESS; - goto fn_exit; - } - - err = MPI_SUCCESS; - do { - flag = 0; - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* - This is a temporary function until we switch to using MPI-2's generalized - requests. -*/ - -int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount, - int indices[], MPI_Status *statuses) -{ - int i, flag, err; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (count == 1) { - err = MPIO_Wait( requests, statuses ); - if (!err) { - *outcount = 1; - indices[0] = 0; - } - goto fn_exit; - } - - /* Check for no active requests */ - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -/*@ - MPI_File_iread - Nonblocking read using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) -{ - int error_code=MPI_SUCCESS; - static char myname[] = "MPI_FILE_IREAD"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIREAD, TRDTSYSTEM, fh, datatype, - count); -#endif /* MPI_hpux */ - - - error_code = MPIOI_File_iread(fh, (MPI_Offset) 0, ADIO_INDIVIDUAL, - buf, count, datatype, myname, request); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count, - MPI_Datatype datatype, char *myname, MPI_Request *request) -{ - int error_code, buftype_is_contig, filetype_is_contig; - MPI_Count datatype_size; - ADIO_Status status; - ADIO_File adio_fh; - ADIO_Offset off, bufsize; - MPI_Offset nbytes=0; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_READABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - if (buftype_is_contig && filetype_is_contig) { - /* convert count and offset to bytes */ - bufsize = datatype_size * count; - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = adio_fh->disp + adio_fh->etype_size * offset; - } - else { - off = adio_fh->fp_ind; - } - - if (!(adio_fh->atomicity)) - ADIO_IreadContig(adio_fh, buf, count, datatype, file_ptr_type, - off, request, &error_code); - else { - /* to maintain strict atomicity semantics with other concurrent - operations, lock (exclusive) and call blocking routine */ - if (ADIO_Feature(adio_fh, ADIO_LOCKS)) - { - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - } - - ADIO_ReadContig(adio_fh, buf, count, datatype, file_ptr_type, - off, &status, &error_code); - - if (ADIO_Feature(adio_fh, ADIO_LOCKS)) - { - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - if (error_code == MPI_SUCCESS) { - nbytes = count*datatype_size; - } - MPIO_Completed_request_create(&adio_fh, nbytes, &error_code, request); - } - } - else ADIO_IreadStrided(adio_fh, buf, count, datatype, file_ptr_type, - offset, request, &error_code); - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iread_all.c b/3rd-party/romio321/mpi-io/iread_all.c deleted file mode 100644 index 00a0640f5a4..00000000000 --- a/3rd-party/romio321/mpi-io/iread_all.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iread_all = PMPI_File_iread_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iread_all MPI_File_iread_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iread_all as PMPI_File_iread_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) - __attribute__((weak,alias("PMPI_File_iread_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#if HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -/*@ - MPI_File_iread_all - Nonblocking collective read using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iread_all(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) -{ - int error_code; - static char myname[] = "MPI_FILE_IREAD_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEREADALL, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_iread_all(fh, (MPI_Offset)0, - ADIO_INDIVIDUAL, buf, - count, datatype, myname, request); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) { - error_code = MPIO_Err_return_file(fh, error_code); - } - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* Note: MPIOI_File_iread_all also used by MPI_File_iread_at_all */ -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_iread_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request) -{ - int error_code; - MPI_Count datatype_size; - ADIO_File adio_fh; - void *xbuf=NULL, *e32_buf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_READABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - xbuf = buf; - if (adio_fh->is_external32) { - MPI_Aint e32_size = 0; - error_code = MPIU_datatype_full_size(datatype, &e32_size); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - e32_buf = ADIOI_Malloc(e32_size*count); - xbuf = e32_buf; - } - - ADIO_IreadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, request, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(buf, datatype, - count, e32_buf); - ADIOI_Free(e32_buf); - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iread_at.c b/3rd-party/romio321/mpi-io/iread_at.c deleted file mode 100644 index 29bda8462f1..00000000000 --- a/3rd-party/romio321/mpi-io/iread_at.c +++ /dev/null @@ -1,75 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iread_at = PMPI_File_iread_at -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iread_at MPI_File_iread_at -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iread_at as PMPI_File_iread_at -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) __attribute__((weak,alias("PMPI_File_iread_at"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -/*@ - MPI_File_iread_at - Nonblocking read using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) -{ - int error_code; - static char myname[] = "MPI_FILE_IREAD_AT"; - -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIREADAT, TRDTSYSTEM, fh, datatype, - count); -#endif /* MPI_hpux */ - - - error_code = MPIOI_File_iread(fh, offset, ADIO_EXPLICIT_OFFSET, buf, - count, datatype, myname, request); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/iread_atall.c b/3rd-party/romio321/mpi-io/iread_atall.c deleted file mode 100644 index da9326a5b0d..00000000000 --- a/3rd-party/romio321/mpi-io/iread_atall.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iread_at_all = PMPI_File_iread_at_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iread_at_all MPI_File_iread_at_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iread_at_all as PMPI_File_iread_at_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void * buf, int count, - MPI_Datatype datatype, MPI_Request *request) - __attribute__((weak,alias("PMPI_File_iread_at_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -/*@ - MPI_File_iread_at_all - Nonblocking collective read using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, - MPI_Request *request) -{ - int error_code; - static char myname[] = "MPI_FILE_IREAD_AT_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIREADATALL, TRDTBLOCK, fh, datatype, - count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_iread_all(fh, offset, ADIO_EXPLICIT_OFFSET, buf, - count, datatype, myname, request); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/iread_sh.c b/3rd-party/romio321/mpi-io/iread_sh.c deleted file mode 100644 index bd643130590..00000000000 --- a/3rd-party/romio321/mpi-io/iread_sh.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. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iread_shared = PMPI_File_iread_shared -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iread_shared MPI_File_iread_shared -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iread_shared as PMPI_File_iread_shared -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) __attribute__((weak,alias("PMPI_File_iread_shared"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" - -/*@ - MPI_File_iread_shared - Nonblocking read using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iread_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) -{ - int error_code, buftype_is_contig, filetype_is_contig; - ADIO_Offset bufsize; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_IREAD_SHARED"; - MPI_Count datatype_size, incr; - MPI_Status status; - ADIO_Offset off, shared_fp; - MPI_Offset nbytes=0; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - incr = (count*datatype_size)/adio_fh->etype_size; - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - /* note: ADIO_Get_shared_fp should have set up error code already? */ - MPIO_Err_return_file(adio_fh, error_code); - } - /* --END ERROR HANDLING-- */ - - if (buftype_is_contig && filetype_is_contig) - { - /* convert count and shared_fp to bytes */ - bufsize = datatype_size * count; - off = adio_fh->disp + adio_fh->etype_size * shared_fp; - if (!(adio_fh->atomicity)) - { - ADIO_IreadContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, request, &error_code); - } - else - { - /* to maintain strict atomicity semantics with other concurrent - operations, lock (exclusive) and call blocking routine */ - - if (adio_fh->file_system != ADIO_NFS) - { - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - } - - ADIO_ReadContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, &status, &error_code); - - if (adio_fh->file_system != ADIO_NFS) - { - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - if (error_code == MPI_SUCCESS){ - nbytes = count * datatype_size; - } - MPIO_Completed_request_create(&adio_fh, nbytes, &error_code, request); - } - } - else - { - ADIO_IreadStrided(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, request, &error_code); - } - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iwrite.c b/3rd-party/romio321/mpi-io/iwrite.c deleted file mode 100644 index ae6c6aec59c..00000000000 --- a/3rd-party/romio321/mpi-io/iwrite.c +++ /dev/null @@ -1,168 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iwrite = PMPI_File_iwrite -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iwrite MPI_File_iwrite -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iwrite as PMPI_File_iwrite -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) __attribute__((weak,alias("PMPI_File_iwrite"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_iwrite - Nonblocking write using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. request - request object (handle) - -.N fortran -@*/ -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -int MPI_File_iwrite(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) -{ - int error_code=MPI_SUCCESS; - static char myname[] = "MPI_FILE_IWRITE"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITE, TRDTSYSTEM, fh, datatype, - count); -#endif /* MPI_hpux */ - - - error_code = MPIOI_File_iwrite(fh, (MPI_Offset) 0, ADIO_INDIVIDUAL, - buf, count, datatype, myname, request); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_iwrite(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request) -{ - int error_code, buftype_is_contig, filetype_is_contig; - MPI_Count datatype_size; - ADIO_Status status; - ADIO_Offset off, bufsize; - ADIO_File adio_fh; - MPI_Offset nbytes=0; - - ROMIO_THREAD_CS_ENTER(); - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_WRITABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - if (buftype_is_contig && filetype_is_contig) { - /* convert sizes to bytes */ - bufsize = datatype_size * count; - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = adio_fh->disp + adio_fh->etype_size * offset; - } - else { - off = adio_fh->fp_ind; - } - - if (!(adio_fh->atomicity)) { - ADIO_IwriteContig(adio_fh, buf, count, datatype, file_ptr_type, - off, request, &error_code); - } - else { - /* to maintain strict atomicity semantics with other concurrent - operations, lock (exclusive) and call blocking routine */ - if (ADIO_Feature(adio_fh, ADIO_LOCKS) ) - { - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - } - - ADIO_WriteContig(adio_fh, buf, count, datatype, file_ptr_type, off, - &status, &error_code); - - if (ADIO_Feature(adio_fh, ADIO_LOCKS) ) - { - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - if (error_code == MPI_SUCCESS) { - nbytes = count * datatype_size; - } - - MPIO_Completed_request_create(&adio_fh, nbytes, &error_code, request); - } - } - else { - ADIO_IwriteStrided(adio_fh, buf, count, datatype, file_ptr_type, - offset, request, &error_code); - } -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iwrite_all.c b/3rd-party/romio321/mpi-io/iwrite_all.c deleted file mode 100644 index 9f486e700f5..00000000000 --- a/3rd-party/romio321/mpi-io/iwrite_all.c +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iwrite_all = PMPI_File_iwrite_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_all MPI_File_iwrite_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iwrite_all as PMPI_File_iwrite_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) - __attribute__((weak,alias("PMPI_File_iwrite_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -/*@ - MPI_File_iwrite_all - Nonblocking collective write using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iwrite_all(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) -{ - int error_code; - static char myname[] = "MPI_FILE_IWRITE_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEALL, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_iwrite_all(fh, (MPI_Offset) 0, - ADIO_INDIVIDUAL, buf, - count, datatype, myname, request); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* Note: MPIOI_File_iwrite_all also used by MPI_File_iwrite_at_all */ -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_iwrite_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Request *request) -{ - int error_code; - MPI_Count datatype_size; - ADIO_File adio_fh; - void *e32buf=NULL; - const void *xbuf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_WRITABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - - ADIO_IwriteStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, request, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - if (e32buf != NULL) ADIOI_Free(e32buf); - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/iwrite_at.c b/3rd-party/romio321/mpi-io/iwrite_at.c deleted file mode 100644 index 10862bd0334..00000000000 --- a/3rd-party/romio321/mpi-io/iwrite_at.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iwrite_at = PMPI_File_iwrite_at -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_at MPI_File_iwrite_at -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iwrite_at as PMPI_File_iwrite_at -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPIO_Request *request) - __attribute__((weak,alias("PMPI_File_iwrite_at"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_iwrite_at - Nonblocking write using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. request - request object (handle) - -.N fortran -@*/ -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype, - MPIO_Request *request) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_IWRITE_AT"; - -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEAT, TRDTSYSTEM, - fh, datatype, count); -#endif /* MPI_hpux */ - - - adio_fh = MPIO_File_resolve(fh); - - error_code = MPIOI_File_iwrite(adio_fh, offset, ADIO_EXPLICIT_OFFSET, buf, - count, datatype, myname, request); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count) -#endif /* MPI_hpux */ - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/iwrite_atall.c b/3rd-party/romio321/mpi-io/iwrite_atall.c deleted file mode 100644 index 9c0564efd8d..00000000000 --- a/3rd-party/romio321/mpi-io/iwrite_atall.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iwrite_at_all = PMPI_File_iwrite_at_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_at_all MPI_File_iwrite_at_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iwrite_at_all as PMPI_File_iwrite_at_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) - __attribute__((weak,alias("PMPI_File_iwrite_at_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -/*@ - MPI_File_iwrite_at_all - Nonblocking collective write using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. request - request object (handle) - -.N fortran -@*/ -int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype, - MPI_Request *request) -{ - int error_code; - static char myname[] = "MPI_FILE_IWRITE_AT_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEATALL, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_iwrite_all(fh, offset, ADIO_EXPLICIT_OFFSET, - buf, count, datatype, myname, request); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - return error_code; -} - diff --git a/3rd-party/romio321/mpi-io/iwrite_sh.c b/3rd-party/romio321/mpi-io/iwrite_sh.c deleted file mode 100644 index 3f9612a7895..00000000000 --- a/3rd-party/romio321/mpi-io/iwrite_sh.c +++ /dev/null @@ -1,120 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_iwrite_shared = PMPI_File_iwrite_shared -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_shared MPI_File_iwrite_shared -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_iwrite_shared as PMPI_File_iwrite_shared -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPIO_Request *request) __attribute__((weak,alias("PMPI_File_iwrite_shared"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_iwrite_shared - Nonblocking write using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. request - request object (handle) - -.N fortran -@*/ -#ifdef HAVE_MPI_GREQUEST -#include "mpiu_greq.h" -#endif - -int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPIO_Request *request) -{ - int error_code, buftype_is_contig, filetype_is_contig; - ADIO_File adio_fh; - ADIO_Offset incr, bufsize; - MPI_Count datatype_size; - ADIO_Status status; - ADIO_Offset off, shared_fp; - static char myname[] = "MPI_FILE_IWRITE_SHARED"; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - incr = (count*datatype_size)/adio_fh->etype_size; - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - if (error_code != MPI_SUCCESS) { - /* note: ADIO_Get_shared_fp should have set up error code already? */ - MPIO_Err_return_file(adio_fh, error_code); - } - - /* contiguous or strided? */ - if (buftype_is_contig && filetype_is_contig) { - /* convert sizes to bytes */ - bufsize = datatype_size * count; - off = adio_fh->disp + adio_fh->etype_size * shared_fp; - if (!(adio_fh->atomicity)) - ADIO_IwriteContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, request, &error_code); - else { - /* to maintain strict atomicity semantics with other concurrent - operations, lock (exclusive) and call blocking routine */ - - if (adio_fh->file_system != ADIO_NFS) - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - - ADIO_WriteContig(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, &status, &error_code); - - if (adio_fh->file_system != ADIO_NFS) - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - - MPIO_Completed_request_create(&adio_fh, bufsize, &error_code, request); - } - } - else - ADIO_IwriteStrided(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, request, &error_code); - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/mpich_fileutil.c b/3rd-party/romio321/mpi-io/mpich_fileutil.c deleted file mode 100644 index b853b588fa7..00000000000 --- a/3rd-party/romio321/mpi-io/mpich_fileutil.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpioimpl.h" -#include "adio_extern.h" - -#ifdef MPICH - -/* Forward ref for the routine to extract and set the error handler - in a ROMIO File structure. FIXME: These should be imported from a common - header file that is also used in errhan/file_set_errhandler.c - */ -int MPIR_ROMIO_Get_file_errhand( MPI_File, MPI_Errhandler * ); -int MPIR_ROMIO_Set_file_errhand( MPI_File, MPI_Errhandler ); -void MPIR_Get_file_error_routine( MPI_Errhandler, - void (**)(MPI_File *, int *, ...), - int * ); - -/* These next two routines are used to allow MPICH to access/set the - error handers in the MPI_File structure until MPICH knows about the - file structure, and to handle the errhandler structure, which - includes a reference count. Not currently used. */ -int MPIR_ROMIO_Set_file_errhand( MPI_File file_ptr, MPI_Errhandler e ) -{ - if (file_ptr == MPI_FILE_NULL) ADIOI_DFLT_ERR_HANDLER = e; - /* --BEGIN ERROR HANDLING-- */ - else if (file_ptr->cookie != ADIOI_FILE_COOKIE) { - return MPI_ERR_FILE; - } - /* --END ERROR HANDLING-- */ - else - file_ptr->err_handler = e; - return 0; -} -int MPIR_ROMIO_Get_file_errhand( MPI_File file_ptr, MPI_Errhandler *e ) -{ - if (file_ptr == MPI_FILE_NULL) { - if (ADIOI_DFLT_ERR_HANDLER == MPI_ERRORS_RETURN) - *e = 0; - else { - *e = ADIOI_DFLT_ERR_HANDLER; - } - } - /* --BEGIN ERROR HANDLING-- */ - else if (file_ptr->cookie != ADIOI_FILE_COOKIE) { - return MPI_ERR_FILE; - } - /* --END ERROR HANDLING-- */ - else { - if (file_ptr->err_handler == MPI_ERRORS_RETURN) - *e = 0; - else - *e = file_ptr->err_handler; - } - return 0; -} - -#endif /* MPICH */ diff --git a/3rd-party/romio321/mpi-io/mpioimpl.h b/3rd-party/romio321/mpi-io/mpioimpl.h deleted file mode 100644 index 4eb2843bcaf..00000000000 --- a/3rd-party/romio321/mpi-io/mpioimpl.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * Copyright (C) 1997 University of Chicago. - * Copyright (c) 2018 IBM Corporation. All rights reserved. - * $COPYRIGHT$ - * See COPYRIGHT notice in top-level directory. - */ - - -/* header file for MPI-IO implementation. not intended to be - user-visible */ - -#ifndef MPIOIMPL_INCLUDE -#define MPIOIMPL_INCLUDE - -#include "adio.h" -#include "mpio.h" - -#ifdef ROMIO_INSIDE_MPICH -#include "glue_romio.h" - -#define ROMIO_THREAD_CS_ENTER() MPIR_Ext_cs_enter() -#define ROMIO_THREAD_CS_EXIT() MPIR_Ext_cs_exit() -#define ROMIO_THREAD_CS_YIELD() MPIR_Ext_cs_yield() - -/* committed datatype checking support in ROMIO */ -#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) \ - do { \ - err_ = MPIR_Ext_datatype_iscommitted(dtype_); \ - } while (0) - -#else /* not ROMIO_INSIDE_MPICH */ -/* Any MPI implementation that wishes to follow the thread-safety and - error reporting features provided by MPICH must implement these - four functions. Defining these as empty should not change the behavior - of correct programs */ -#define ROMIO_THREAD_CS_ENTER() -#define ROMIO_THREAD_CS_EXIT() -#define ROMIO_THREAD_CS_YIELD() -/* The MPI_DATATYPE_ISCOMMITTED macro now always sets err_=0. - This is an optimistic approach for Open MPI, but it is likely other - upper layers already checked the datatype was committed. - Not setting err_ is incorrect since it can lead to use of - uninitialized variable.*/ -#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do { err_ = 0; } while (0) -#ifdef HAVE_WINDOWS_H -#define MPIU_UNREFERENCED_ARG(a) a -#else -#define MPIU_UNREFERENCED_ARG(a) -#endif -#endif /* ROMIO_INSIDE_MPICH */ - -/* info is a linked list of these structures */ -struct MPIR_Info { - int cookie; - char *key, *value; - struct MPIR_Info *next; -}; - -#define MPIR_INFO_COOKIE 5835657 - -MPI_Comm_delete_attr_function ADIOI_End_call; - -/* common initialization routine */ -void MPIR_MPIOInit(int * error_code); - -#ifdef HAVE_MPIIO_CONST -#define ROMIO_CONST const -#else -#define ROMIO_CONST -#endif - -#include "mpiu_external32.h" - - -#include "mpioprof.h" - -#ifdef MPI_hpux -# include "mpioinst.h" -#endif /* MPI_hpux */ - -#endif - diff --git a/3rd-party/romio321/mpi-io/mpioprof.h b/3rd-party/romio321/mpi-io/mpioprof.h deleted file mode 100644 index c74413d1e81..00000000000 --- a/3rd-party/romio321/mpi-io/mpioprof.h +++ /dev/null @@ -1,224 +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. - */ - -/* - This header file converts all MPI_ names into PMPI_ names, for - building the profiling interface - */ - -/* - * Open MPI: Unfortunately, ROMIO doesn't seem to be able to build - * without a profiling interface, but we don't want a profiling - * interface, since we are just using ROMIO "behind the scenes". - * So enable all the profiling defines, only compile once, and don't - * do all the name mangling. The effect is about the same, but without - * modification to all the files in the mpi-io directory. - */ -#if 0 -#ifdef MPIO_BUILD_PROFILING - -#undef MPI_File_open -#define MPI_File_open PMPI_File_open -#undef MPI_File_close -#define MPI_File_close PMPI_File_close -#undef MPI_File_delete -#define MPI_File_delete PMPI_File_delete -#undef MPI_File_set_size -#define MPI_File_set_size PMPI_File_set_size -#undef MPI_File_preallocate -#define MPI_File_preallocate PMPI_File_preallocate -#undef MPI_File_get_size -#define MPI_File_get_size PMPI_File_get_size -#undef MPI_File_get_group -#define MPI_File_get_group PMPI_File_get_group -#undef MPI_File_get_amode -#define MPI_File_get_amode PMPI_File_get_amode -#undef MPI_File_set_info -#define MPI_File_set_info PMPI_File_set_info -#undef MPI_File_get_info -#define MPI_File_get_info PMPI_File_get_info - -#undef MPI_File_set_view -#define MPI_File_set_view PMPI_File_set_view -#undef MPI_File_get_view -#define MPI_File_get_view PMPI_File_get_view - -#undef MPI_File_read_at -#define MPI_File_read_at PMPI_File_read_at -#undef MPI_File_read_at_all -#define MPI_File_read_at_all PMPI_File_read_at_all -#undef MPI_File_write_at -#define MPI_File_write_at PMPI_File_write_at -#undef MPI_File_write_at_all -#define MPI_File_write_at_all PMPI_File_write_at_all -#undef MPI_File_iread_at -#define MPI_File_iread_at PMPI_File_iread_at -#undef MPI_File_iwrite_at -#define MPI_File_iwrite_at PMPI_File_iwrite_at - -#undef MPI_File_read -#define MPI_File_read PMPI_File_read -#undef MPI_File_read_all -#define MPI_File_read_all PMPI_File_read_all -#undef MPI_File_write -#define MPI_File_write PMPI_File_write -#undef MPI_File_write_all -#define MPI_File_write_all PMPI_File_write_all -#undef MPI_File_iread -#define MPI_File_iread PMPI_File_iread -#undef MPI_File_iwrite -#define MPI_File_iwrite PMPI_File_iwrite -#undef MPI_File_seek -#define MPI_File_seek PMPI_File_seek -#undef MPI_File_get_position -#define MPI_File_get_position PMPI_File_get_position -#undef MPI_File_get_byte_offset -#define MPI_File_get_byte_offset PMPI_File_get_byte_offset - -#undef MPI_File_iread_at_all -#define MPI_File_iread_at_all PMPI_File_iread_at_all -#undef MPI_File_iwrite_at_all -#define MPI_File_iwrite_at_all PMPI_File_iwrite_at_all -#undef MPI_File_iread_all -#define MPI_File_iread_all PMPI_File_iread_all -#undef MPI_File_iwrite_all -#define MPI_File_iwrite_all PMPI_File_iwrite_all - -#undef MPI_File_read_shared -#define MPI_File_read_shared PMPI_File_read_shared -#undef MPI_File_write_shared -#define MPI_File_write_shared PMPI_File_write_shared -#undef MPI_File_iread_shared -#define MPI_File_iread_shared PMPI_File_iread_shared -#undef MPI_File_iwrite_shared -#define MPI_File_iwrite_shared PMPI_File_iwrite_shared -#undef MPI_File_read_ordered -#define MPI_File_read_ordered PMPI_File_read_ordered -#undef MPI_File_write_ordered -#define MPI_File_write_ordered PMPI_File_write_ordered -#undef MPI_File_seek_shared -#define MPI_File_seek_shared PMPI_File_seek_shared -#undef MPI_File_get_position_shared -#define MPI_File_get_position_shared PMPI_File_get_position_shared - -#undef MPI_File_read_at_all_begin -#define MPI_File_read_at_all_begin PMPI_File_read_at_all_begin -#undef MPI_File_read_at_all_end -#define MPI_File_read_at_all_end PMPI_File_read_at_all_end -#undef MPI_File_write_at_all_begin -#define MPI_File_write_at_all_begin PMPI_File_write_at_all_begin -#undef MPI_File_write_at_all_end -#define MPI_File_write_at_all_end PMPI_File_write_at_all_end -#undef MPI_File_read_all_begin -#define MPI_File_read_all_begin PMPI_File_read_all_begin -#undef MPI_File_read_all_end -#define MPI_File_read_all_end PMPI_File_read_all_end -#undef MPI_File_write_all_begin -#define MPI_File_write_all_begin PMPI_File_write_all_begin -#undef MPI_File_write_all_end -#define MPI_File_write_all_end PMPI_File_write_all_end -#undef MPI_File_read_ordered_begin -#define MPI_File_read_ordered_begin PMPI_File_read_ordered_begin -#undef MPI_File_read_ordered_end -#define MPI_File_read_ordered_end PMPI_File_read_ordered_end -#undef MPI_File_write_ordered_begin -#define MPI_File_write_ordered_begin PMPI_File_write_ordered_begin -#undef MPI_File_write_ordered_end -#define MPI_File_write_ordered_end PMPI_File_write_ordered_end - -#undef MPI_File_get_type_extent -#define MPI_File_get_type_extent PMPI_File_get_type_extent -#undef MPI_Register_datarep -#define MPI_Register_datarep PMPI_Register_datarep -#undef MPI_File_set_atomicity -#define MPI_File_set_atomicity PMPI_File_set_atomicity -#undef MPI_File_get_atomicity -#define MPI_File_get_atomicity PMPI_File_get_atomicity -#undef MPI_File_sync -#define MPI_File_sync PMPI_File_sync - -#undef MPI_Type_create_subarray -#define MPI_Type_create_subarray PMPI_Type_create_subarray -#undef MPI_Type_create_darray -#define MPI_Type_create_darray PMPI_Type_create_darray - -#undef MPI_File_set_errhandler -#define MPI_File_set_errhandler PMPI_File_set_errhandler -#undef MPI_File_get_errhandler -#define MPI_File_get_errhandler PMPI_File_get_errhandler - -#if !defined(MPI_File_f2c) || defined(MPICH_RENAMING_MPI_FUNCS) -#undef MPI_File_f2c -#define MPI_File_f2c PMPI_File_f2c -#undef MPI_File_c2f -#define MPI_File_c2f PMPI_File_c2f -#endif - -#undef MPIO_Test -#undef PMPIO_Test -#define MPIO_Test PMPIO_Test -#undef MPIO_Wait -#undef PMPIO_Wait -#define MPIO_Wait PMPIO_Wait -#undef MPIO_Testall -#define MPIO_Testall PMPIO_Testall -#undef MPIO_Waitall -#define MPIO_Waitall PMPIO_Waitall -#undef MPIO_Testany -#define MPIO_Testany PMPIO_Testany -#undef MPIO_Waitany -#define MPIO_Waitany PMPIO_Waitany -#undef MPIO_Testsome -#define MPIO_Testsome PMPIO_Testsome -#undef MPIO_Waitsome -#define MPIO_Waitsome PMPIO_Waitsome -#undef MPIO_Request_f2c -#define MPIO_Request_f2c PMPIO_Request_f2c -#undef MPIO_Request_c2f -#define MPIO_Request_c2f PMPIO_Request_c2f - -#if defined(HAVE_MPI_INFO_SRC) /* only in info source directory */ - -#undef MPI_Info_create -#define MPI_Info_create PMPI_Info_create -#undef MPI_Info_set -#define MPI_Info_set PMPI_Info_set -#undef MPI_Info_delete -#define MPI_Info_delete PMPI_Info_delete -#undef MPI_Info_get -#define MPI_Info_get PMPI_Info_get -#undef MPI_Info_get_valuelen -#define MPI_Info_get_valuelen PMPI_Info_get_valuelen -#undef MPI_Info_get_nkeys -#define MPI_Info_get_nkeys PMPI_Info_get_nkeys -#undef MPI_Info_get_nthkey -#define MPI_Info_get_nthkey PMPI_Info_get_nthkey -#undef MPI_Info_dup -#define MPI_Info_dup PMPI_Info_dup -#undef MPI_Info_free -#define MPI_Info_free PMPI_Info_free -#undef MPI_Info_c2f -#define MPI_Info_c2f PMPI_Info_c2f -#undef MPI_Info_f2c -#define MPI_Info_f2c PMPI_Info_f2c - -#endif - -#undef MPI_Grequest_start -#define MPI_Grequest_start PMPI_Grequest_start -#undef MPI_Grequest_complete -#define MPI_Grequest_complete PMPI_Grequest_complete -#undef MPI_Status_set_cancelled -#define MPI_Status_set_cancelled PMPI_Status_set_cancelled - -#undef MPIX_Grequest_start -#define MPIX_Grequest_start PMPIX_Grequest_start -#undef MPIX_Grequest_class_create -#define MPIX_Grequest_class_create PMPIX_Grequest_class_create - -#endif -#endif diff --git a/3rd-party/romio321/mpi-io/mpir-mpioinit.c b/3rd-party/romio321/mpi-io/mpir-mpioinit.c deleted file mode 100644 index 90a2739a210..00000000000 --- a/3rd-party/romio321/mpi-io/mpir-mpioinit.c +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2009 UChicago/Argonne LLC - * See COPYRIGHT in top-level directory. - */ -#include "mpioimpl.h" -#include - -#ifdef HAVE_WEAK_SYMBOLS -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -extern int ADIO_Init_keyval; - -/* common code to stuff an attribute on a communicator for the purpose of - * cleaning up in MPI_Finalize() */ - -void MPIR_MPIOInit(int * error_code) { - - int flag; - char myname[] = "MPIR_MPIOInit"; - - /* first check if ADIO has been initialized. If not, initialize it */ - if (ADIO_Init_keyval == MPI_KEYVAL_INVALID) { - MPI_Initialized(&flag); - - /* --BEGIN ERROR HANDLING-- */ - if (!flag) { - *error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, __LINE__, - MPI_ERR_OTHER, "**initialized", 0); - *error_code = MPIO_Err_return_file(MPI_FILE_NULL, *error_code); - return; - } - /* --END ERROR HANDLING-- */ - - MPI_Comm_create_keyval (MPI_COMM_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval, - (void *) 0); - - /* put a dummy attribute on MPI_COMM_SELF, because we want the delete - function to be called when MPI_COMM_SELF is freed. Clarified - in MPI-2 section 4.8, the standard mandates that attributes on - MPI_COMM_SELF get cleaned up early in MPI_Finalize */ - - MPI_Comm_set_attr (MPI_COMM_SELF, ADIO_Init_keyval, (void *) 0); - - /* initialize ADIO */ - ADIO_Init( (int *)0, (char ***)0, error_code); - } - *error_code = MPI_SUCCESS; -} -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/mpi-io/mpiu_external32.c b/3rd-party/romio321/mpi-io/mpiu_external32.c deleted file mode 100644 index 8a8254cbb82..00000000000 --- a/3rd-party/romio321/mpi-io/mpiu_external32.c +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* (C) 2012 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include "mpioimpl.h" -#include "mpiu_external32.h" - -#ifdef HAVE_WEAK_SYMBOLS -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datatype, - int count, void *filebuf) -{ - int position_i = 0; - MPI_Aint position = 0; - MPI_Aint bytes = 0; - int mpi_errno = MPI_SUCCESS; - int is_contig = 0; - - ADIOI_Datatype_iscontig(datatype, &is_contig); - mpi_errno = MPI_Pack_external_size("external32", count, datatype, &bytes); - if (mpi_errno != MPI_SUCCESS) - goto fn_exit; - - if (is_contig) - { -#ifdef HAVE_MPIIO_CONST - mpi_errno = MPI_Pack_external("external32", userbuf, count, - datatype, filebuf, bytes, &position); -#else - mpi_errno = MPI_Pack_external("external32", (void *)userbuf, count, - datatype, filebuf, bytes, &position); -#endif - if (mpi_errno != MPI_SUCCESS) - goto fn_exit; - } - else - { - void *tmp_buf = NULL; - tmp_buf = ADIOI_Malloc(bytes); - if (!tmp_buf) - { - mpi_errno = MPI_ERR_NO_MEM; - goto fn_exit; - } - -#ifdef HAVE_MPIIO_CONST - mpi_errno = MPI_Pack_external("external32", userbuf, count, - datatype, tmp_buf, bytes, &position); -#else - mpi_errno = MPI_Pack_external("external32", (void *)userbuf, count, - datatype, tmp_buf, bytes, &position); -#endif - if (mpi_errno != MPI_SUCCESS) - { - ADIOI_Free(tmp_buf); - goto fn_exit; - } - - mpi_errno = MPI_Unpack(tmp_buf, bytes, &position_i, filebuf, count, - datatype, MPI_COMM_WORLD); - if (mpi_errno != MPI_SUCCESS) - { - ADIOI_Free(tmp_buf); - goto fn_exit; - } - - ADIOI_Free(tmp_buf); - } -fn_exit: - return mpi_errno; -} - -int MPIU_read_external32_conversion_fn(void *userbuf, MPI_Datatype datatype, - int count, void *filebuf) -{ - int position_i = 0; - MPI_Aint position = 0; - MPI_Aint bytes = 0; - int mpi_errno = MPI_SUCCESS; - int is_contig = 0; - - ADIOI_Datatype_iscontig(datatype, &is_contig); - mpi_errno = MPI_Pack_external_size("external32", count, datatype, &bytes); - if (mpi_errno != MPI_SUCCESS) - goto fn_exit; - - if (is_contig) - { - mpi_errno = MPI_Unpack_external("external32", filebuf, bytes, - &position, userbuf, count, datatype); - if (mpi_errno != MPI_SUCCESS) - goto fn_exit; - } - else - { - void *tmp_buf = NULL; - tmp_buf = ADIOI_Malloc(bytes); - if (!tmp_buf) - { - mpi_errno = MPI_ERR_NO_MEM; - goto fn_exit; - } - - mpi_errno = MPI_Pack(filebuf, count, datatype, tmp_buf, bytes, - &position_i, MPI_COMM_WORLD); - if (mpi_errno != MPI_SUCCESS) - { - ADIOI_Free(tmp_buf); - goto fn_exit; - } - - mpi_errno = MPI_Unpack_external("external32", tmp_buf, bytes, - &position, userbuf, count, datatype); - if (mpi_errno != MPI_SUCCESS) - { - ADIOI_Free(tmp_buf); - goto fn_exit; - } - - ADIOI_Free(tmp_buf); - } -fn_exit: - return mpi_errno; -} -int MPIU_datatype_full_size(MPI_Datatype datatype, MPI_Aint *size) -{ - int error_code = MPI_SUCCESS; - MPI_Aint true_extent = 0; - MPI_Aint true_lb = 0; - - error_code = MPI_Type_get_true_extent(datatype, &true_lb, &true_extent); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - *size = true_extent; -fn_exit: - return error_code; -} - -/* given a buffer, count, and datatype, return an apropriately allocated, sized - * and external32-formatted buffer, suitable for handing off to a subsequent - * write routine. Caller is responsible for freeing 'newbuf' */ -int MPIU_external32_buffer_setup(const void * buf, int count, MPI_Datatype type, void **newbuf) -{ - - MPI_Aint datatype_size=0, bytes=0; - int error_code; - - error_code = MPIU_datatype_full_size(type, &datatype_size); - if (error_code != MPI_SUCCESS) - return error_code; - - bytes = datatype_size * count; - *newbuf = ADIOI_Malloc(bytes); - - error_code = MPIU_write_external32_conversion_fn(buf, type, count, *newbuf); - if (error_code != MPI_SUCCESS) { - ADIOI_Free(*newbuf); - return error_code; - } - return MPI_SUCCESS; -} - - -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/mpi-io/mpiu_greq.c b/3rd-party/romio321/mpi-io/mpiu_greq.c deleted file mode 100644 index ad1e4d25826..00000000000 --- a/3rd-party/romio321/mpi-io/mpiu_greq.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2003 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpioimpl.h" -#include "mpiu_greq.h" - -#include -#ifdef HAVE_WEAK_SYMBOLS -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -int MPIU_Greq_query_fn(void *extra_state, MPI_Status *status) -{ - int foo; - - /* can't touch user's MPI_ERROR, so hold it for a moment */ - foo = status->MPI_ERROR; - - /* get the status from the blocking operation */ - memcpy(status, extra_state, sizeof(MPI_Status)); - - /* restore MPI_ERROR to whatever it had when we got it */ - status->MPI_ERROR = foo; - - /* and let Test|Wait know we weren't canceled */ - MPI_Status_set_cancelled(status, 0); - - return MPI_SUCCESS; -} - -int MPIU_Greq_free_fn(void *extra_state) -{ - /* frees the memory allocated in MPIO_Completed_request_create */ - ADIOI_Free(extra_state); - - return MPI_SUCCESS; -} -int MPIU_Greq_cancel_fn(void *extra_state, int complete) -{ - MPIU_UNREFERENCED_ARG(extra_state); - MPIU_UNREFERENCED_ARG(complete); - - /* can't cancel */ - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/open.c b/3rd-party/romio321/mpi-io/open.c deleted file mode 100644 index 7cebb5abc79..00000000000 --- a/3rd-party/romio321/mpi-io/open.c +++ /dev/null @@ -1,209 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_open = PMPI_File_open -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_open MPI_File_open -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_open as PMPI_File_open -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh) __attribute__((weak,alias("PMPI_File_open"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* for user-definde reduce operator */ -#include "adio_extern.h" - - -extern int ADIO_Init_keyval; - -/*@ - MPI_File_open - Opens a file - -Input Parameters: -. comm - communicator (handle) -. filename - name of file to open (string) -. amode - file access mode (integer) -. info - info object (handle) - -Output Parameters: -. fh - file handle (handle) - -.N fortran -@*/ -int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode, - MPI_Info info, MPI_File *fh) -{ - int error_code = MPI_SUCCESS, file_system, flag, tmp_amode=0, rank; - char *tmp; - MPI_Comm dupcomm = MPI_COMM_NULL; - ADIOI_Fns *fsops; - static char myname[] = "MPI_FILE_OPEN"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_OPEN_START(fl_xmpi, comm); -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_COMM(comm, myname, error_code); - MPIO_CHECK_INFO_ALL(info, error_code, comm); - /* --END ERROR HANDLING-- */ - - error_code = MPI_Comm_test_inter(comm, &flag); - /* --BEGIN ERROR HANDLING-- */ - if (error_code || flag) - { - error_code = MPIO_Err_create_code(error_code, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_COMM, - "**commnotintra", 0); - goto fn_fail; - } - - if ( ((amode&MPI_MODE_RDONLY)?1:0) + ((amode&MPI_MODE_RDWR)?1:0) + - ((amode&MPI_MODE_WRONLY)?1:0) != 1 ) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_AMODE, - "**fileamodeone", 0); - goto fn_fail; - } - - if ((amode & MPI_MODE_RDONLY) && - ((amode & MPI_MODE_CREATE) || (amode & MPI_MODE_EXCL))) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_AMODE, - "**fileamoderead", 0); - goto fn_fail; - } - - if ((amode & MPI_MODE_RDWR) && (amode & MPI_MODE_SEQUENTIAL)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_AMODE, - "**fileamodeseq", 0); - goto fn_fail; - } - - MPI_Comm_dup(comm, &dupcomm); - -/* check if ADIO has been initialized. If not, initialize it */ - MPIR_MPIOInit(&error_code); - if (error_code != MPI_SUCCESS) goto fn_fail; - -/* check if amode is the same on all processes: at first glance, one might try - * to use a built-in operator like MPI_BAND, but we need every mpi process to - * agree the amode was not the same. Consider process A with - * MPI_MODE_CREATE|MPI_MODE_RDWR, and B with MPI_MODE_RDWR: MPI_BAND yields - * MPI_MODE_RDWR. A determines amodes are different, but B proceeds having not - * detected an error */ - MPI_Allreduce(&amode, &tmp_amode, 1, MPI_INT, ADIO_same_amode, dupcomm); - - if (tmp_amode == ADIO_AMODE_NOMATCH) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_NOT_SAME, - "**fileamodediff", 0); - goto fn_fail; - } - /* --END ERROR HANDLING-- */ - - file_system = -1; - - /* resolve file system type from file name; this is a collective call */ - ADIO_ResolveFileType(dupcomm, filename, &file_system, &fsops, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - /* ADIO_ResolveFileType() will print as informative a message as it - * possibly can or call MPIO_Err_setmsg. We just need to propagate - * the error up. - */ - goto fn_fail; - } - - /* --END ERROR HANDLING-- */ - - /* strip off prefix if there is one, but only skip prefixes - * if they are greater than length one to allow for windows - * drive specifications (e.g. c:\...) */ - - tmp = strchr(filename, ':'); - if (tmp > filename + 1) { - filename = tmp + 1; - } - -/* use default values for disp, etype, filetype */ - - *fh = ADIO_Open(comm, dupcomm, filename, file_system, fsops, amode, 0, - MPI_BYTE, MPI_BYTE, info, ADIO_PERM_NULL, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) { - goto fn_fail; - } - /* --END ERROR HANDLING-- */ - - /* if MPI_MODE_SEQUENTIAL requested, file systems cannot do explicit offset - * or independent file pointer accesses, leaving not much else aside from - * shared file pointer accesses. */ - if ( !ADIO_Feature((*fh), ADIO_SHARED_FP) && (amode & MPI_MODE_SEQUENTIAL)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_UNSUPPORTED_OPERATION, - "**iosequnsupported", 0); - ADIO_Close(*fh, &error_code); - goto fn_fail; - } - - /* determine name of file that will hold the shared file pointer */ - /* can't support shared file pointers on a file system that doesn't - support file locking. */ - if ((error_code == MPI_SUCCESS) && - ADIO_Feature((*fh), ADIO_SHARED_FP)) { - MPI_Comm_rank(dupcomm, &rank); - ADIOI_Shfp_fname(*fh, rank, &error_code); - if (error_code != MPI_SUCCESS) - goto fn_fail; - - /* if MPI_MODE_APPEND, set the shared file pointer to end of file. - indiv. file pointer already set to end of file in ADIO_Open. - Here file view is just bytes. */ - if ((*fh)->access_mode & MPI_MODE_APPEND) { - if (rank == (*fh)->hints->ranklist[0]) /* only one person need set the sharedfp */ - ADIO_Set_shared_fp(*fh, (*fh)->fp_ind, &error_code); - MPI_Barrier(dupcomm); - } - } - -#ifdef MPI_hpux - HPMP_IO_OPEN_END(fl_xmpi, *fh, comm); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -fn_fail: - /* --BEGIN ERROR HANDLING-- */ - if (dupcomm != MPI_COMM_NULL) MPI_Comm_free(&dupcomm); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - /* --END ERROR HANDLING-- */ -} diff --git a/3rd-party/romio321/mpi-io/prealloc.c b/3rd-party/romio321/mpi-io/prealloc.c deleted file mode 100644 index 1542e47a5d2..00000000000 --- a/3rd-party/romio321/mpi-io/prealloc.c +++ /dev/null @@ -1,107 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_preallocate = PMPI_File_preallocate -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_preallocate MPI_File_preallocate -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_preallocate as PMPI_File_preallocate -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_preallocate(MPI_File fh, MPI_Offset size) __attribute__((weak,alias("PMPI_File_preallocate"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_preallocate - Preallocates storage space for a file - -Input Parameters: -. fh - file handle (handle) -. size - size to preallocate (nonnegative integer) - -.N fortran -@*/ -int MPI_File_preallocate(MPI_File fh, MPI_Offset size) -{ - ADIO_Fcntl_t *fcntl_struct; - int error_code=0, mynod=0; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_PREALLOCATE"; - MPI_Offset tmp_sz, max_sz, min_sz; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEPREALLOCATE, TRDTBLOCK, - adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (size < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadsize", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - tmp_sz = size; - MPI_Allreduce(&tmp_sz, &max_sz, 1, ADIO_OFFSET, MPI_MAX, adio_fh->comm); - MPI_Allreduce(&tmp_sz, &min_sz, 1, ADIO_OFFSET, MPI_MIN, adio_fh->comm); - - if (max_sz != min_sz) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**notsame", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - if (size == 0) goto fn_exit; - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - MPI_Comm_rank(adio_fh->comm, &mynod); - if (!mynod) { - fcntl_struct = (ADIO_Fcntl_t *) ADIOI_Malloc(sizeof(ADIO_Fcntl_t)); - fcntl_struct->diskspace = size; - ADIO_Fcntl(adio_fh, ADIO_FCNTL_SET_DISKSPACE, fcntl_struct, &error_code); - ADIOI_Free(fcntl_struct); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - } - MPI_Barrier(adio_fh->comm); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - /* TODO: bcast result? */ - if (!mynod) return error_code; - else return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/rd_atallb.c b/3rd-party/romio321/mpi-io/rd_atallb.c deleted file mode 100644 index a7120b3da21..00000000000 --- a/3rd-party/romio321/mpi-io/rd_atallb.c +++ /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. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_at_all_begin = PMPI_File_read_at_all_begin -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_at_all_begin MPI_File_read_at_all_begin -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_at_all_begin as PMPI_File_read_at_all_begin -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, - MPI_Datatype datatype) __attribute__((weak,alias("PMPI_File_read_at_all_begin"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_read_at_all_begin - Begin a split collective read using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) - -.N fortran -@*/ -int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype) -{ - int error_code; - static char myname[] = "MPI_FILE_READ_AT_ALL_BEGIN"; - - error_code = MPIOI_File_read_all_begin(fh, offset, - ADIO_EXPLICIT_OFFSET, - buf, count, datatype, myname); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/rd_atalle.c b/3rd-party/romio321/mpi-io/rd_atalle.c deleted file mode 100644 index 207d5ba3698..00000000000 --- a/3rd-party/romio321/mpi-io/rd_atalle.c +++ /dev/null @@ -1,50 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_at_all_end = PMPI_File_read_at_all_end -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_at_all_end MPI_File_read_at_all_end -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_at_all_end as PMPI_File_read_at_all_end -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) __attribute__((weak,alias("PMPI_File_read_at_all_end"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_read_at_all_end - Complete a split collective read using - explicit offset - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_READ_AT_ALL_END"; - - - error_code = MPIOI_File_read_all_end(fh, buf, myname, status); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/read.c b/3rd-party/romio321/mpi-io/read.c deleted file mode 100644 index 6f129148937..00000000000 --- a/3rd-party/romio321/mpi-io/read.c +++ /dev/null @@ -1,187 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read = PMPI_File_read -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read MPI_File_read -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read as PMPI_File_read -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) - __attribute__((weak,alias("PMPI_File_read"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_read - Read using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_READ"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEREAD, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_read(fh, (MPI_Offset) 0, ADIO_INDIVIDUAL, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_read(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status) -{ - int error_code, buftype_is_contig, filetype_is_contig; - MPI_Count datatype_size; - ADIO_File adio_fh; - ADIO_Offset off, bufsize; - void *xbuf=NULL, *e32_buf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - if (count*datatype_size == 0) - { -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, 0); -#endif - error_code = MPI_SUCCESS; - goto fn_exit; - } - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_READABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - xbuf = buf; - if (adio_fh->is_external32) - { - MPI_Aint e32_size = 0; - error_code = MPIU_datatype_full_size(datatype, &e32_size); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - e32_buf = ADIOI_Malloc(e32_size*count); - xbuf = e32_buf; - } - - if (buftype_is_contig && filetype_is_contig) - { - /* convert count and offset to bytes */ - bufsize = datatype_size * count; - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = adio_fh->disp + adio_fh->etype_size * offset; - } - else /* ADIO_INDIVIDUAL */ { - off = adio_fh->fp_ind; - } - - /* if atomic mode requested, lock (exclusive) the region, because - there could be a concurrent noncontiguous request. - */ - if ((adio_fh->atomicity) && ADIO_Feature(adio_fh, ADIO_LOCKS)) { - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - } - - ADIO_ReadContig(adio_fh, xbuf, count, datatype, file_ptr_type, - off, status, &error_code); - - if ((adio_fh->atomicity) && ADIO_Feature(adio_fh, ADIO_LOCKS)) { - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - } - else - { - ADIO_ReadStrided(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, status, &error_code); - /* For strided and atomic mode, locking is done in ADIO_ReadStrided */ - } - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(buf, datatype, - count, e32_buf); - ADIOI_Free(e32_buf); - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/read_all.c b/3rd-party/romio321/mpi-io/read_all.c deleted file mode 100644 index efce7832b79..00000000000 --- a/3rd-party/romio321/mpi-io/read_all.c +++ /dev/null @@ -1,142 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_all = PMPI_File_read_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_all MPI_File_read_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_all as PMPI_File_read_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) - __attribute__((weak,alias("PMPI_File_read_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_read_all - Collective read using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_all(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_READ_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEREADALL, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_read_all(fh, (MPI_Offset) 0, - ADIO_INDIVIDUAL, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* Note: MPIOI_File_read_all also used by MPI_File_read_at_all */ -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_read_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status) -{ - int error_code; - MPI_Count datatype_size; - ADIO_File adio_fh; - void *xbuf=NULL, *e32_buf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_READABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - xbuf = buf; - if (adio_fh->is_external32) - { - MPI_Aint e32_size = 0; - error_code = MPIU_datatype_full_size(datatype, &e32_size); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - e32_buf = ADIOI_Malloc(e32_size*count); - xbuf = e32_buf; - } - - ADIO_ReadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(buf, datatype, - count, e32_buf); - ADIOI_Free(e32_buf); - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/read_allb.c b/3rd-party/romio321/mpi-io/read_allb.c deleted file mode 100644 index ae1053b1518..00000000000 --- a/3rd-party/romio321/mpi-io/read_allb.c +++ /dev/null @@ -1,139 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_all_begin = PMPI_File_read_all_begin -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_all_begin MPI_File_read_all_begin -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_all_begin as PMPI_File_read_all_begin -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) - __attribute__((weak,alias("PMPI_File_read_all_begin"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_read_all_begin - Begin a split collective read using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) - -.N fortran -@*/ -int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) -{ - int error_code; - static char myname[] = "MPI_FILE_READ_ALL_BEGIN"; - - error_code = MPIOI_File_read_all_begin(fh, (MPI_Offset) 0, - ADIO_INDIVIDUAL, buf, count, - datatype, myname); - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_read_all_begin(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - void *buf, - int count, - MPI_Datatype datatype, - char *myname) -{ - int error_code; - MPI_Count datatype_size; - ADIO_File adio_fh; - void *xbuf=NULL, *e32_buf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_READABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - - if (adio_fh->split_coll_count) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcoll", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - adio_fh->split_coll_count = 1; - - xbuf = buf; - if (adio_fh->is_external32) - { - MPI_Aint e32_size = 0; - error_code = MPIU_datatype_full_size(datatype, &e32_size); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - e32_buf = ADIOI_Malloc(e32_size*count); - xbuf = e32_buf; - } - - ADIO_ReadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, &adio_fh->split_status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(buf, datatype, - count, e32_buf); - ADIOI_Free(e32_buf); - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/read_alle.c b/3rd-party/romio321/mpi-io/read_alle.c deleted file mode 100644 index e2853c13dd2..00000000000 --- a/3rd-party/romio321/mpi-io/read_alle.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_all_end = PMPI_File_read_all_end -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_all_end MPI_File_read_all_end -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_all_end as PMPI_File_read_all_end -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) __attribute__((weak,alias("PMPI_File_read_all_end"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_read_all_end - Complete a split collective read using - individual file pointer - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_IREAD"; - - error_code = MPIOI_File_read_all_end(fh, buf, myname, status); - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_read_all_end(MPI_File fh, - void *buf, - char *myname, - MPI_Status *status) -{ - int error_code = MPI_SUCCESS; - ADIO_File adio_fh; - - MPIU_UNREFERENCED_ARG(buf); - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (!(adio_fh->split_coll_count)) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcollnone", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - -#ifdef HAVE_STATUS_SET_BYTES - if (status != MPI_STATUS_IGNORE) - *status = adio_fh->split_status; -#endif - adio_fh->split_coll_count = 0; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/read_at.c b/3rd-party/romio321/mpi-io/read_at.c deleted file mode 100644 index 53dc8c42e3a..00000000000 --- a/3rd-party/romio321/mpi-io/read_at.c +++ /dev/null @@ -1,66 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_at = PMPI_File_read_at -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_at MPI_File_read_at -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_at as PMPI_File_read_at -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_read_at"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_read_at - Read using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_READ_AT"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEREADAT, TRDTBLOCK, fh, datatype, - count); -#endif /* MPI_hpux */ - - /* ADIOI_File_read() defined in mpi-io/read.c */ - error_code = MPIOI_File_read(fh, offset, ADIO_EXPLICIT_OFFSET, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/read_atall.c b/3rd-party/romio321/mpi-io/read_atall.c deleted file mode 100644 index 2bed66be4d6..00000000000 --- a/3rd-party/romio321/mpi-io/read_atall.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_at_all = PMPI_File_read_at_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_at_all MPI_File_read_at_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_at_all as PMPI_File_read_at_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void * buf, int count, - MPI_Datatype datatype, MPI_Status *status) - __attribute__((weak,alias("PMPI_File_read_at_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_read_at_all - Collective read using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_IREAD_AT"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEREADATALL, TRDTBLOCK, fh, datatype, - count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_read_all(fh, offset, ADIO_EXPLICIT_OFFSET, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/read_ord.c b/3rd-party/romio321/mpi-io/read_ord.c deleted file mode 100644 index be877633c8e..00000000000 --- a/3rd-party/romio321/mpi-io/read_ord.c +++ /dev/null @@ -1,111 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_ordered = PMPI_File_read_ordered -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_ordered MPI_File_read_ordered -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_ordered as PMPI_File_read_ordered -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_read_ordered"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_read_ordered - Collective read using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_ordered(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code, nprocs, myrank; - ADIO_Offset incr; - MPI_Count datatype_size; - int source, dest; - static char myname[] = "MPI_FILE_READ_ORDERED"; - ADIO_Offset shared_fp=0; - ADIO_File adio_fh; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, "MPI_File_read_ordered", &error_code); - - MPI_Comm_size(adio_fh->comm, &nprocs); - MPI_Comm_rank(adio_fh->comm, &myrank); - - incr = (count*datatype_size)/adio_fh->etype_size; - - /* Use a message as a 'token' to order the operations */ - source = myrank - 1; - dest = myrank + 1; - if (source < 0) source = MPI_PROC_NULL; - if (dest >= nprocs) dest = MPI_PROC_NULL; - MPI_Recv(NULL, 0, MPI_BYTE, source, 0, adio_fh->comm, MPI_STATUS_IGNORE); - - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) { - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Send(NULL, 0, MPI_BYTE, dest, 0, adio_fh->comm); - - ADIO_ReadStridedColl(adio_fh, buf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - /* FIXME: Check for error code from ReadStridedColl? */ - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/read_ordb.c b/3rd-party/romio321/mpi-io/read_ordb.c deleted file mode 100644 index 050934b731f..00000000000 --- a/3rd-party/romio321/mpi-io/read_ordb.c +++ /dev/null @@ -1,137 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_ordered_begin = PMPI_File_read_ordered_begin -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_ordered_begin MPI_File_read_ordered_begin -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_ordered_begin as PMPI_File_read_ordered_begin -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) - __attribute__((weak,alias("PMPI_File_read_ordered_begin"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_read_ordered_begin - Begin a split collective read using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) - -.N fortran -@*/ -int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) -{ - int error_code, nprocs, myrank; - MPI_Count datatype_size; - int source, dest; - ADIO_Offset shared_fp, incr; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_READ_ORDERED_BEGIN"; - void *xbuf=NULL, *e32_buf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (adio_fh->split_coll_count) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcoll", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - adio_fh->split_coll_count = 1; - - - MPI_Type_size_x(datatype, &datatype_size); - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - MPI_Comm_size(adio_fh->comm, &nprocs); - MPI_Comm_rank(adio_fh->comm, &myrank); - - incr = (count*datatype_size)/adio_fh->etype_size; - /* Use a message as a 'token' to order the operations */ - source = myrank - 1; - dest = myrank + 1; - if (source < 0) source = MPI_PROC_NULL; - if (dest >= nprocs) dest = MPI_PROC_NULL; - MPI_Recv(NULL, 0, MPI_BYTE, source, 0, adio_fh->comm, MPI_STATUS_IGNORE); - - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Send(NULL, 0, MPI_BYTE, dest, 0, adio_fh->comm); - - xbuf = buf; - if (adio_fh->is_external32) - { - MPI_Aint e32_size = 0; - error_code = MPIU_datatype_full_size(datatype, &e32_size); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - e32_buf = ADIOI_Malloc(e32_size*count); - xbuf = e32_buf; - } - - - ADIO_ReadStridedColl(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, &adio_fh->split_status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(buf, datatype, - count, e32_buf); - ADIOI_Free(e32_buf); - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/read_orde.c b/3rd-party/romio321/mpi-io/read_orde.c deleted file mode 100644 index 542f687bc20..00000000000 --- a/3rd-party/romio321/mpi-io/read_orde.c +++ /dev/null @@ -1,75 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_ordered_end = PMPI_File_read_ordered_end -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_ordered_end MPI_File_read_ordered_end -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_ordered_end as PMPI_File_read_ordered_end -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) __attribute__((weak,alias("PMPI_File_read_ordered_end"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_read_ordered_end - Complete a split collective read using shared file pointer - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) -{ - int error_code=MPI_SUCCESS; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_READ_ORDERED_END"; - - MPIU_UNREFERENCED_ARG(buf); - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (!(adio_fh->split_coll_count)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcollnone", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - -#ifdef HAVE_STATUS_SET_BYTES - if (status != MPI_STATUS_IGNORE) - *status = adio_fh->split_status; -#endif - adio_fh->split_coll_count = 0; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/read_sh.c b/3rd-party/romio321/mpi-io/read_sh.c deleted file mode 100644 index 83c29daa7e9..00000000000 --- a/3rd-party/romio321/mpi-io/read_sh.c +++ /dev/null @@ -1,155 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_read_shared = PMPI_File_read_shared -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_read_shared MPI_File_read_shared -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_read_shared as PMPI_File_read_shared -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_read_shared"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_read_shared - Read using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_read_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code, buftype_is_contig, filetype_is_contig; - static char myname[] = "MPI_FILE_READ_SHARED"; - MPI_Count datatype_size; - ADIO_Offset off, shared_fp, incr, bufsize; - ADIO_File adio_fh; - void *xbuf=NULL, *e32_buf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - if (count*datatype_size == 0) - { -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, 0); -#endif - error_code = MPI_SUCCESS; - goto fn_exit; - } - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_READABLE(adio_fh, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - incr = (count*datatype_size)/adio_fh->etype_size; - - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - xbuf = buf; - if (adio_fh->is_external32) - { - MPI_Aint e32_size = 0; - error_code = MPIU_datatype_full_size(datatype, &e32_size); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - e32_buf = ADIOI_Malloc(e32_size*count); - xbuf = e32_buf; - } - - /* contiguous or strided? */ - if (buftype_is_contig && filetype_is_contig) - { - /* convert count and shared_fp to bytes */ - bufsize = datatype_size * count; - off = adio_fh->disp + adio_fh->etype_size * shared_fp; - - /* if atomic mode requested, lock (exclusive) the region, because there - could be a concurrent noncontiguous request. On NFS, locking - is done in the ADIO_ReadContig.*/ - - if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - - ADIO_ReadContig(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, status, &error_code); - - if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - else - { - ADIO_ReadStrided(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, status, &error_code); - /* For strided and atomic mode, locking is done in ADIO_ReadStrided */ - } - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - if (e32_buf != NULL) { - error_code = MPIU_read_external32_conversion_fn(buf, datatype, - count, e32_buf); - ADIOI_Free(e32_buf); - } -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/register_datarep.c b/3rd-party/romio321/mpi-io/register_datarep.c deleted file mode 100644 index 38958723327..00000000000 --- a/3rd-party/romio321/mpi-io/register_datarep.c +++ /dev/null @@ -1,145 +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 "mpioimpl.h" -#include "adio_extern.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Register_datarep = PMPI_Register_datarep -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Register_datarep MPI_Register_datarep -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Register_datarep as PMPI_Register_datarep -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, - MPI_Datarep_conversion_function *write_conversion_fn, - MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state) __attribute__((weak,alias("PMPI_Register_datarep"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Register_datarep - Register functions for user-defined data - representations - -Input Parameters: -+ datarep - data representation name (string) -. read_conversion_fn - function invoked to convert from file representation to - native representation (function) -. write_conversion_fn - function invoked to convert from native representation to - file representation (function) -. dtype_file_extent_fn - function invoked to get the exted of a datatype as represented - in the file (function) -- extra_state - pointer to extra state that is passed to each of the - three functions - - Notes: - This function allows the user to provide routines to convert data from - an external representation, used within a file, and the native representation, - used within the CPU. There is one predefined data representation, - 'external32'. Please consult the MPI-2 standard for details on this - function. - -.N fortran - - @*/ -int MPI_Register_datarep(ROMIO_CONST char *datarep, - MPI_Datarep_conversion_function *read_conversion_fn, - MPI_Datarep_conversion_function *write_conversion_fn, - MPI_Datarep_extent_function *dtype_file_extent_fn, - void *extra_state) -{ - int error_code; - ADIOI_Datarep *adio_datarep; - static char myname[] = "MPI_REGISTER_DATAREP"; - - ROMIO_THREAD_CS_ENTER(); - - /* --BEGIN ERROR HANDLING-- */ - /* check datarep name (use strlen instead of strnlen because - strnlen is not portable) */ - if (datarep == NULL || - strlen(datarep) < 1 || - strlen(datarep) > MPI_MAX_DATAREP_STRING) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "**datarepname", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPIR_MPIOInit(&error_code); - if (error_code != MPI_SUCCESS) goto fn_exit; - - /* --BEGIN ERROR HANDLING-- */ - /* check datarep isn't already registered */ - for (adio_datarep = ADIOI_Datarep_head; adio_datarep; adio_datarep = adio_datarep->next) { - if (!strncmp(datarep, adio_datarep->name, MPI_MAX_DATAREP_STRING)) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_DUP_DATAREP, - "**datarepused", - "**datarepused %s", - datarep); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - } - - /* Check Non-NULL Read and Write conversion function pointer */ - /* Read and Write conversions are currently not supported. */ - if ( (read_conversion_fn != NULL) || (write_conversion_fn != NULL) ) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_CONVERSION, - "**drconvnotsupported", 0); - - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - - /* check extent function pointer */ - if (dtype_file_extent_fn == NULL) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "**datarepextent", 0); - error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - adio_datarep = ADIOI_Malloc(sizeof(ADIOI_Datarep)); - adio_datarep->name = ADIOI_Strdup(datarep); - adio_datarep->state = extra_state; - adio_datarep->read_conv_fn = read_conversion_fn; - adio_datarep->write_conv_fn = write_conversion_fn; - adio_datarep->extent_fn = dtype_file_extent_fn; - adio_datarep->next = ADIOI_Datarep_head; - - ADIOI_Datarep_head = adio_datarep; - - error_code = MPI_SUCCESS; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/seek.c b/3rd-party/romio321/mpi-io/seek.c deleted file mode 100644 index c68394a18a8..00000000000 --- a/3rd-party/romio321/mpi-io/seek.c +++ /dev/null @@ -1,139 +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 "mpioimpl.h" -#include "adioi.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_seek = PMPI_File_seek -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_seek MPI_File_seek -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_seek as PMPI_File_seek -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) __attribute__((weak,alias("PMPI_File_seek"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_seek - Updates the individual file pointer - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (integer) -. whence - update mode (state) - -.N fortran -@*/ -int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_SEEK"; - MPI_Offset curr_offset, eof_offset; - -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILESEEK, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - switch(whence) { - case MPI_SEEK_SET: - /* --BEGIN ERROR HANDLING-- */ - if (offset < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - break; - case MPI_SEEK_CUR: - /* find offset corr. to current location of file pointer */ - ADIOI_Get_position(adio_fh, &curr_offset); - offset += curr_offset; - - /* --BEGIN ERROR HANDLING-- */ - if (offset < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_ARG, - "**ionegoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - break; - case MPI_SEEK_END: - /* we can in many cases do seeks w/o a file actually opened, but not in - * the MPI_SEEK_END case */ - ADIOI_TEST_DEFERRED(adio_fh, "MPI_File_seek", &error_code); - - /* find offset corr. to end of file */ - ADIOI_Get_eof_offset(adio_fh, &eof_offset); - offset += eof_offset; - - /* --BEGIN ERROR HANDLING-- */ - if (offset < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, myname, - __LINE__, MPI_ERR_ARG, - "**ionegoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - break; - default: - /* --BEGIN ERROR HANDLING-- */ - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadwhence", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - /* --END ERROR HANDLING-- */ - } - - ADIO_SeekIndividual(adio_fh, offset, ADIO_SEEK_SET, &error_code); - /* TODO: what do we do with this error? */ - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - error_code = MPI_SUCCESS; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/seek_sh.c b/3rd-party/romio321/mpi-io/seek_sh.c deleted file mode 100644 index d3ce1ab8aa9..00000000000 --- a/3rd-party/romio321/mpi-io/seek_sh.c +++ /dev/null @@ -1,184 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_seek_shared = PMPI_File_seek_shared -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_seek_shared MPI_File_seek_shared -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_seek_shared as PMPI_File_seek_shared -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) __attribute__((weak,alias("PMPI_File_seek_shared"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_seek_shared - Updates the shared file pointer - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (integer) -. whence - update mode (state) - -.N fortran -@*/ -int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) -{ - int error_code=MPI_SUCCESS, tmp_whence, myrank; - static char myname[] = "MPI_FILE_SEEK_SHARED"; - MPI_Offset curr_offset, eof_offset, tmp_offset; - ADIO_File adio_fh; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - tmp_offset = offset; - MPI_Bcast(&tmp_offset, 1, ADIO_OFFSET, 0, adio_fh->comm); - /* --BEGIN ERROR HANDLING-- */ - if (tmp_offset != offset) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**notsame", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - tmp_whence = whence; - MPI_Bcast(&tmp_whence, 1, MPI_INT, 0, adio_fh->comm); - /* --BEGIN ERROR HANDLING-- */ - if (tmp_whence != whence) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadwhence", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, "MPI_File_seek_shared", &error_code); - - MPI_Comm_rank(adio_fh->comm, &myrank); - - if (!myrank) - { - switch(whence) - { - case MPI_SEEK_SET: - /* --BEGIN ERROR HANDLING-- */ - if (offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - break; - case MPI_SEEK_CUR: - /* get current location of shared file pointer */ - ADIO_Get_shared_fp(adio_fh, 0, &curr_offset, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_FATAL, - myname, __LINE__, - MPI_ERR_INTERN, - "**iosharedfailed", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - offset += curr_offset; - /* --BEGIN ERROR HANDLING-- */ - if (offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "**ionegoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - break; - case MPI_SEEK_END: - /* find offset corr. to end of file */ - ADIOI_Get_eof_offset(adio_fh, &eof_offset); - offset += eof_offset; - /* --BEGIN ERROR HANDLING-- */ - if (offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_ARG, - "**ionegoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - break; - default: - /* --BEGIN ERROR HANDLING-- */ - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadwhence", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - /* --END ERROR HANDLING-- */ - } - - ADIO_Set_shared_fp(adio_fh, offset, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_FATAL, - myname, __LINE__, - MPI_ERR_INTERN, - "**iosharedfailed", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - } - - /* FIXME: explain why the barrier is necessary */ - MPI_Barrier(adio_fh->comm); - - error_code = MPI_SUCCESS; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/set_atom.c b/3rd-party/romio321/mpi-io/set_atom.c deleted file mode 100644 index 00be9fc35b3..00000000000 --- a/3rd-party/romio321/mpi-io/set_atom.c +++ /dev/null @@ -1,91 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_set_atomicity = PMPI_File_set_atomicity -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_set_atomicity MPI_File_set_atomicity -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_set_atomicity as PMPI_File_set_atomicity -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_set_atomicity(MPI_File fh, int flag) __attribute__((weak,alias("PMPI_File_set_atomicity"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_set_atomicity - Sets the atomicity mode - -Input Parameters: -. fh - file handle (handle) -. flag - true to set atomic mode, false to set nonatomic mode (logical) - -.N fortran -@*/ -int MPI_File_set_atomicity(MPI_File fh, int flag) -{ - int error_code, tmp_flag; - static char myname[] = "MPI_FILE_SET_ATOMICITY"; - ADIO_Fcntl_t *fcntl_struct; - ADIO_File adio_fh; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - if (flag) flag = 1; /* take care of non-one values! */ - -/* check if flag is the same on all processes */ - tmp_flag = flag; - MPI_Bcast(&tmp_flag, 1, MPI_INT, 0, adio_fh->comm); - - /* --BEGIN ERROR HANDLING-- */ - if (tmp_flag != flag) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**notsame", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - if (adio_fh->atomicity == flag){ - error_code = MPI_SUCCESS; - goto fn_exit; - } - - - fcntl_struct = (ADIO_Fcntl_t *) ADIOI_Malloc(sizeof(ADIO_Fcntl_t)); - fcntl_struct->atomicity = flag; - ADIO_Fcntl(adio_fh, ADIO_FCNTL_SET_ATOMICITY, fcntl_struct, &error_code); - /* TODO: what do we do with this error code? */ - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Free(fcntl_struct); - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/set_errh.c b/3rd-party/romio321/mpi-io/set_errh.c deleted file mode 100644 index d943787e358..00000000000 --- a/3rd-party/romio321/mpi-io/set_errh.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 "mpioimpl.h" -#include "adio_extern.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_set_errhandler = PMPI_File_set_errhandler -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_set_errhandler MPI_File_set_errhandler -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_set_errhandler as PMPI_File_set_errhandler -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler) __attribute__((weak,alias("PMPI_File_set_errhandler"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_set_errhandler - Sets the error handler for a file - -Input Parameters: -. fh - file handle (handle) -. errhandler - error handler (handle) - -.N fortran -@*/ -int MPI_File_set_errhandler(MPI_File mpi_fh, MPI_Errhandler errhandler) -{ - int error_code = MPI_SUCCESS; - static char myname[] = "MPI_FILE_SET_ERRHANDLER"; - ADIO_File fh; - MPID_THREADPRIV_DECL; - - ROMIO_THREAD_CS_ENTER(); - - if (mpi_fh == MPI_FILE_NULL) { - ADIOI_DFLT_ERR_HANDLER = errhandler; - } - else { - fh = MPIO_File_resolve(mpi_fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - if ((errhandler != MPI_ERRORS_RETURN) && - (errhandler != MPI_ERRORS_ARE_FATAL)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_UNSUPPORTED_OPERATION, - "**fileopunsupported", - 0); - error_code = MPIO_Err_return_file(fh, error_code); - goto fn_exit; - } - - fh->err_handler = errhandler; - } - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/set_info.c b/3rd-party/romio321/mpi-io/set_info.c deleted file mode 100644 index 2c898fe85ac..00000000000 --- a/3rd-party/romio321/mpi-io/set_info.c +++ /dev/null @@ -1,66 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_set_info = PMPI_File_set_info -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_set_info MPI_File_set_info -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_set_info as PMPI_File_set_info -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_set_info(MPI_File fh, MPI_Info info) __attribute__((weak,alias("PMPI_File_set_info"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_set_info - Sets new values for the hints associated with a file - -Input Parameters: -. fh - file handle (handle) -. info - info object (handle) - -.N fortran -@*/ -int MPI_File_set_info(MPI_File fh, MPI_Info info) -{ - int error_code; - static char myname[] = "MPI_FILE_SET_INFO"; - ADIO_File adio_fh; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_INFO_ALL(info, error_code, fh->comm); - /* --END ERROR HANDLING-- */ - - /* set new info */ - ADIO_SetInfo(adio_fh, info, &error_code); - -fn_exit: - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - - ROMIO_THREAD_CS_EXIT(); - - return error_code; -fn_fail: - goto fn_exit; -} diff --git a/3rd-party/romio321/mpi-io/set_size.c b/3rd-party/romio321/mpi-io/set_size.c deleted file mode 100644 index b658929576d..00000000000 --- a/3rd-party/romio321/mpi-io/set_size.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_set_size = PMPI_File_set_size -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_set_size MPI_File_set_size -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_set_size as PMPI_File_set_size -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_set_size(MPI_File fh, MPI_Offset size) __attribute__((weak,alias("PMPI_File_set_size"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_set_size - Sets the file size - -Input Parameters: -. fh - file handle (handle) -. size - size to truncate or expand file (nonnegative integer) - -.N fortran -@*/ -int MPI_File_set_size(MPI_File fh, MPI_Offset size) -{ - int error_code; - ADIO_File adio_fh; - static char myname[] = "MPI_FILE_SET_SIZE"; - MPI_Offset tmp_sz, max_sz, min_sz; - -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILESETSIZE, TRDTBLOCK, adio_fh, - MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - - if (size < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadsize", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - MPIO_CHECK_WRITABLE(fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - tmp_sz = size; - MPI_Allreduce(&tmp_sz, &max_sz, 1, ADIO_OFFSET, MPI_MAX, adio_fh->comm); - MPI_Allreduce(&tmp_sz, &min_sz, 1, ADIO_OFFSET, MPI_MIN, adio_fh->comm); - - /* --BEGIN ERROR HANDLING-- */ - if (max_sz != min_sz) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**notsame", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - if (!ADIO_Feature(adio_fh, ADIO_SCALABLE_RESIZE)) { - /* rare stupid file systems (like NFS) need to carry out resize on all - * processes */ - ADIOI_TEST_DEFERRED(adio_fh, "MPI_File_set_size", &error_code); - } - - ADIO_Resize(adio_fh, size, &error_code); - /* TODO: what to do with error code? */ - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1); -#endif /* MPI_hpux */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/set_view.c b/3rd-party/romio321/mpi-io/set_view.c deleted file mode 100644 index 4d98fdd1844..00000000000 --- a/3rd-party/romio321/mpi-io/set_view.c +++ /dev/null @@ -1,204 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_set_view = PMPI_File_set_view -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_set_view MPI_File_set_view -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_set_view as PMPI_File_set_view -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, - const char *datarep, MPI_Info info) __attribute__((weak,alias("PMPI_File_set_view"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_set_view - Sets the file view - -Input Parameters: -. fh - file handle (handle) -. disp - displacement (nonnegative integer) -. etype - elementary datatype (handle) -. filetype - filetype (handle) -. datarep - data representation (string) -. info - info object (handle) - -.N fortran -@*/ -int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, ROMIO_CONST char *datarep, MPI_Info info) -{ - int error_code; - MPI_Count filetype_size, etype_size; - static char myname[] = "MPI_FILE_SET_VIEW"; - ADIO_Offset shared_fp, byte_off; - ADIO_File adio_fh; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if ((disp < 0) && (disp != MPI_DISPLACEMENT_CURRENT)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobaddisp", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - /* rudimentary checks for incorrect etype/filetype.*/ - if (etype == MPI_DATATYPE_NULL) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**ioetype", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - MPIO_DATATYPE_ISCOMMITTED(etype, error_code); - if (error_code != MPI_SUCCESS) { - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - if (filetype == MPI_DATATYPE_NULL) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iofiletype", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - MPIO_DATATYPE_ISCOMMITTED(filetype, error_code); - if (error_code != MPI_SUCCESS) { - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - if ((adio_fh->access_mode & MPI_MODE_SEQUENTIAL) && - (disp != MPI_DISPLACEMENT_CURRENT)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iodispifseq", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - if ((disp == MPI_DISPLACEMENT_CURRENT) && - !(adio_fh->access_mode & MPI_MODE_SEQUENTIAL)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iodispifseq", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - MPIO_CHECK_INFO_ALL(info, error_code, adio_fh->comm); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(filetype, &filetype_size); - MPI_Type_size_x(etype, &etype_size); - - /* --BEGIN ERROR HANDLING-- */ - if (etype_size != 0 && filetype_size % etype_size != 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iofiletype", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - if ((datarep == NULL) || (strcmp(datarep, "native") && - strcmp(datarep, "NATIVE") && - strcmp(datarep, "external32") && - strcmp(datarep, "EXTERNAL32") && - strcmp(datarep, "internal") && - strcmp(datarep, "INTERNAL")) ) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, - MPI_ERR_UNSUPPORTED_DATAREP, - "**unsupporteddatarep",0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - if (disp == MPI_DISPLACEMENT_CURRENT) { - MPI_Barrier(adio_fh->comm); - ADIO_Get_shared_fp(adio_fh, 0, &shared_fp, &error_code); - /* TODO: check error code */ - - MPI_Barrier(adio_fh->comm); - ADIOI_Get_byte_offset(adio_fh, shared_fp, &byte_off); - /* TODO: check error code */ - - disp = byte_off; - } - - ADIO_Set_view(adio_fh, disp, etype, filetype, info, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) { - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - /* reset shared file pointer to zero */ - if (ADIO_Feature(adio_fh, ADIO_SHARED_FP) && - (adio_fh->shared_fp_fd != ADIO_FILE_NULL)) - { - /* only one process needs to set it to zero, but I don't want to - create the shared-file-pointer file if shared file pointers have - not been used so far. Therefore, every process that has already - opened the shared-file-pointer file sets the shared file pointer - to zero. If the file was not opened, the value is automatically - zero. Note that shared file pointer is stored as no. of etypes - relative to the current view, whereas indiv. file pointer is - stored in bytes. */ - - ADIO_Set_shared_fp(adio_fh, 0, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - } - - if (ADIO_Feature(adio_fh, ADIO_SHARED_FP)) - { - MPI_Barrier(adio_fh->comm); /* for above to work correctly */ - } - if (strcmp(datarep, "external32") && strcmp(datarep, "EXTERNAL32")) - adio_fh->is_external32 = 0; - else - adio_fh->is_external32 = 1; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -fn_fail: - /* --BEGIN ERROR HANDLING-- */ - error_code = MPIO_Err_return_file(fh, error_code); - goto fn_exit; - /* --END ERROR HANDLING-- */ -} diff --git a/3rd-party/romio321/mpi-io/wr_atallb.c b/3rd-party/romio321/mpi-io/wr_atallb.c deleted file mode 100644 index 83eb28bc886..00000000000 --- a/3rd-party/romio321/mpi-io/wr_atallb.c +++ /dev/null @@ -1,53 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_at_all_begin = PMPI_File_write_at_all_begin -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_at_all_begin MPI_File_write_at_all_begin -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_at_all_begin as PMPI_File_write_at_all_begin -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype) __attribute__((weak,alias("PMPI_File_write_at_all_begin"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_write_at_all_begin - Begin a split collective write using - explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -.N fortran -@*/ -int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_AT_ALL_BEGIN"; - - error_code = MPIOI_File_write_all_begin(fh, offset, - ADIO_EXPLICIT_OFFSET, - buf, count, datatype, myname); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/wr_atalle.c b/3rd-party/romio321/mpi-io/wr_atalle.c deleted file mode 100644 index fa2ab514231..00000000000 --- a/3rd-party/romio321/mpi-io/wr_atalle.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_at_all_end = PMPI_File_write_at_all_end -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_at_all_end MPI_File_write_at_all_end -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_at_all_end as PMPI_File_write_at_all_end -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status) __attribute__((weak,alias("PMPI_File_write_at_all_end"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_write_at_all_end - Complete a split collective write using explicit offset - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_at_all_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_AT_ALL_END"; - - error_code = MPIOI_File_write_all_end(fh, buf, myname, status); - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/write.c b/3rd-party/romio321/mpi-io/write.c deleted file mode 100644 index eb9a77fb82d..00000000000 --- a/3rd-party/romio321/mpi-io/write.c +++ /dev/null @@ -1,186 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write = PMPI_File_write -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write MPI_File_write -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write as PMPI_File_write -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_write"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_write - Write using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEWRITE, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_write(fh, (MPI_Offset) 0, ADIO_INDIVIDUAL, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_write(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status) -{ - int error_code, buftype_is_contig, filetype_is_contig; - MPI_Count datatype_size; - ADIO_Offset off, bufsize; - ADIO_File adio_fh; - void *e32buf=NULL; - const void *xbuf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - if (count*datatype_size == 0) - { -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, 0); -#endif - error_code = MPI_SUCCESS; - goto fn_exit; - } - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_WRITABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - - if (buftype_is_contig && filetype_is_contig) - { - /* convert bufcount and offset to bytes */ - bufsize = datatype_size * count; - if (file_ptr_type == ADIO_EXPLICIT_OFFSET) { - off = adio_fh->disp + adio_fh->etype_size * offset; - } - else /* ADIO_INDIVIDUAL */ { - off = adio_fh->fp_ind; - } - - /* if atomic mode requested, lock (exclusive) the region, because - there could be a concurrent noncontiguous request. Locking doesn't - work on PIOFS and PVFS, and on NFS it is done in the - ADIO_WriteContig. - */ - - if ((adio_fh->atomicity) && ADIO_Feature(adio_fh, ADIO_LOCKS)) - { - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - } - - ADIO_WriteContig(adio_fh, xbuf, count, datatype, file_ptr_type, - off, status, &error_code); - - if ((adio_fh->atomicity) && ADIO_Feature(adio_fh, ADIO_LOCKS)) - { - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - } - else - { - /* For strided and atomic mode, locking is done in ADIO_WriteStrided */ - ADIO_WriteStrided(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, status, &error_code); - } - - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - if (e32buf!= NULL) ADIOI_Free(e32buf); - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/write_all.c b/3rd-party/romio321/mpi-io/write_all.c deleted file mode 100644 index 6f17cc30ad9..00000000000 --- a/3rd-party/romio321/mpi-io/write_all.c +++ /dev/null @@ -1,134 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_all = PMPI_File_write_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_all MPI_File_write_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_all as PMPI_File_write_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_write_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_write_all - Collective write using individual file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_all(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEWRITEALL, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_write_all(fh, (MPI_Offset) 0, - ADIO_INDIVIDUAL, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_write_all(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname, - MPI_Status *status) -{ - int error_code; - MPI_Count datatype_size; - ADIO_File adio_fh; - void *e32buf=NULL; - const void *xbuf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_WRITABLE(adio_fh, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - ADIO_WriteStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - if (e32buf != NULL) ADIOI_Free(e32buf); - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/write_allb.c b/3rd-party/romio321/mpi-io/write_allb.c deleted file mode 100644 index e184723a876..00000000000 --- a/3rd-party/romio321/mpi-io/write_allb.c +++ /dev/null @@ -1,132 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_all_begin = PMPI_File_write_all_begin -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_all_begin MPI_File_write_all_begin -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_all_begin as PMPI_File_write_all_begin -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype) - __attribute__((weak,alias("PMPI_File_write_all_begin"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_write_all_begin - Begin a split collective write using - individual file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -.N fortran -@*/ -int MPI_File_write_all_begin(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_ALL_BEGIN"; - - error_code = MPIOI_File_write_all_begin(fh, (MPI_Offset) 0, - ADIO_INDIVIDUAL, buf, count, - datatype, myname); - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_write_all_begin(MPI_File fh, - MPI_Offset offset, - int file_ptr_type, - const void *buf, - int count, - MPI_Datatype datatype, - char *myname) -{ - int error_code; - MPI_Count datatype_size; - ADIO_File adio_fh; - void *e32buf=NULL; - const void *xbuf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code); - - if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "**iobadoffset", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - - if (adio_fh->split_coll_count) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcoll", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - adio_fh->split_coll_count = 1; - - MPI_Type_size_x(datatype, &datatype_size); - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - - adio_fh->split_datatype = datatype; - ADIO_WriteStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type, - offset, &adio_fh->split_status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - if ( e32buf != NULL) ADIOI_Free(e32buf); - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/write_alle.c b/3rd-party/romio321/mpi-io/write_alle.c deleted file mode 100644 index 6dc7f6d1566..00000000000 --- a/3rd-party/romio321/mpi-io/write_alle.c +++ /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. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_all_end = PMPI_File_write_all_end -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_all_end MPI_File_write_all_end -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_all_end as PMPI_File_write_all_end -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status) __attribute__((weak,alias("PMPI_File_write_all_end"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_write_all_end - Complete a split collective write using individual file pointer - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_all_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_ALL_END"; - - error_code = MPIOI_File_write_all_end(fh, buf, myname, status); - - return error_code; -} - -/* prevent multiple definitions of this routine */ -#ifdef MPIO_BUILD_PROFILING -int MPIOI_File_write_all_end(MPI_File fh, - const void *buf, - char *myname, - MPI_Status *status) -{ - int error_code; - ADIO_File adio_fh; - - MPIU_UNREFERENCED_ARG(buf); - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (!(adio_fh->split_coll_count)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcollnone", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - -#ifdef HAVE_STATUS_SET_BYTES - /* FIXME - we should really ensure that the split_datatype remains - valid by incrementing the ref count in the write_allb.c routine - and decrement it here after setting the bytes */ - if (status != MPI_STATUS_IGNORE) - *status = adio_fh->split_status; -#endif - adio_fh->split_coll_count = 0; - - error_code = MPI_SUCCESS; - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - return error_code; -} -#endif diff --git a/3rd-party/romio321/mpi-io/write_at.c b/3rd-party/romio321/mpi-io/write_at.c deleted file mode 100644 index 4362322b67b..00000000000 --- a/3rd-party/romio321/mpi-io/write_at.c +++ /dev/null @@ -1,66 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_at = PMPI_File_write_at -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_at MPI_File_write_at -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_at as PMPI_File_write_at -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void * buf, int count, - MPI_Datatype datatype, MPI_Status *status) - __attribute__((weak,alias("PMPI_File_write_at"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_write_at - Write using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_at(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_AT"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEWRITEAT, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - /* MPIOI_File_write() defined in mpi-io/write.c */ - error_code = MPIOI_File_write(fh, offset, ADIO_EXPLICIT_OFFSET, buf, - count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/write_atall.c b/3rd-party/romio321/mpi-io/write_atall.c deleted file mode 100644 index 6f815cdd4cb..00000000000 --- a/3rd-party/romio321/mpi-io/write_atall.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_at_all = PMPI_File_write_at_all -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_at_all MPI_File_write_at_all -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_at_all as PMPI_File_write_at_all -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) - __attribute__((weak,alias("PMPI_File_write_at_all"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_write_at_all - Collective write using explicit offset - -Input Parameters: -. fh - file handle (handle) -. offset - file offset (nonnegative integer) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_AT_ALL"; -#ifdef MPI_hpux - int fl_xmpi; - - HPMP_IO_START(fl_xmpi, BLKMPIFILEWRITEATALL, TRDTBLOCK, fh, datatype, count); -#endif /* MPI_hpux */ - - error_code = MPIOI_File_write_all(fh, offset, ADIO_EXPLICIT_OFFSET, - buf, count, datatype, myname, status); - -#ifdef MPI_hpux - HPMP_IO_END(fl_xmpi, fh, datatype, count); -#endif /* MPI_hpux */ - return error_code; -} - diff --git a/3rd-party/romio321/mpi-io/write_ord.c b/3rd-party/romio321/mpi-io/write_ord.c deleted file mode 100644 index eb72734e9c5..00000000000 --- a/3rd-party/romio321/mpi-io/write_ord.c +++ /dev/null @@ -1,128 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_ordered = PMPI_File_write_ordered -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_ordered MPI_File_write_ordered -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_ordered as PMPI_File_write_ordered -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_write_ordered"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_write_ordered - Collective write using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code, nprocs, myrank; - ADIO_Offset incr; - MPI_Count datatype_size; - int source, dest; - static char myname[] = "MPI_FILE_WRITE_ORDERED"; - ADIO_Offset shared_fp; - ADIO_File adio_fh; - void *e32buf=NULL; - const void *xbuf; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - MPI_Comm_size(adio_fh->comm, &nprocs); - MPI_Comm_rank(adio_fh->comm, &myrank); - - incr = (count*datatype_size)/adio_fh->etype_size; - /* Use a message as a 'token' to order the operations */ - source = myrank - 1; - dest = myrank + 1; - if (source < 0) source = MPI_PROC_NULL; - if (dest >= nprocs) dest = MPI_PROC_NULL; - MPI_Recv(NULL, 0, MPI_BYTE, source, 0, adio_fh->comm, MPI_STATUS_IGNORE); - - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - myname, __LINE__, MPI_ERR_INTERN, - "**iosharedfailed", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Send(NULL, 0, MPI_BYTE, dest, 0, adio_fh->comm); - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - - ADIO_WriteStridedColl(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - if (e32buf != NULL) ADIOI_Free(e32buf); - ROMIO_THREAD_CS_EXIT(); - - /* FIXME: Check for error code from WriteStridedColl? */ - return error_code; -} - diff --git a/3rd-party/romio321/mpi-io/write_ordb.c b/3rd-party/romio321/mpi-io/write_ordb.c deleted file mode 100644 index 8b5a3023660..00000000000 --- a/3rd-party/romio321/mpi-io/write_ordb.c +++ /dev/null @@ -1,132 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_ordered_begin = PMPI_File_write_ordered_begin -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_ordered_begin MPI_File_write_ordered_begin -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_ordered_begin as PMPI_File_write_ordered_begin -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype) - __attribute__((weak,alias("PMPI_File_write_ordered_begin"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_write_ordered_begin - Begin a split collective write using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. buf - initial address of buffer (choice) - -.N fortran -@*/ -int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype) -{ - int error_code, nprocs, myrank; - ADIO_Offset incr; - MPI_Count datatype_size; - int source, dest; - static char myname[] = "MPI_FILE_WRITE_ORDERED_BEGIN"; - ADIO_Offset shared_fp; - ADIO_File adio_fh; - void *e32buf = NULL; - const void *xbuf=NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - - if (adio_fh->split_coll_count) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcoll", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - adio_fh->split_coll_count = 1; - - MPI_Type_size_x(datatype, &datatype_size); - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - MPI_Comm_size(adio_fh->comm, &nprocs); - MPI_Comm_rank(adio_fh->comm, &myrank); - - incr = (count*datatype_size)/adio_fh->etype_size; - /* Use a message as a 'token' to order the operations */ - source = myrank - 1; - dest = myrank + 1; - if (source < 0) source = MPI_PROC_NULL; - if (dest >= nprocs) dest = MPI_PROC_NULL; - MPI_Recv(NULL, 0, MPI_BYTE, source, 0, adio_fh->comm, MPI_STATUS_IGNORE); - - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - myname, __LINE__, MPI_ERR_INTERN, - "**iosharedfailed", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - MPI_Send(NULL, 0, MPI_BYTE, dest, 0, adio_fh->comm); - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - - ADIO_WriteStridedColl(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, &adio_fh->split_status, &error_code); - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - - /* FIXME: Check for error code from WriteStridedColl? */ - return error_code; -} diff --git a/3rd-party/romio321/mpi-io/write_orde.c b/3rd-party/romio321/mpi-io/write_orde.c deleted file mode 100644 index 8cfdba2ecf6..00000000000 --- a/3rd-party/romio321/mpi-io/write_orde.c +++ /dev/null @@ -1,75 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_ordered_end = PMPI_File_write_ordered_end -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_ordered_end MPI_File_write_ordered_end -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_ordered_end as PMPI_File_write_ordered_end -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status) __attribute__((weak,alias("PMPI_File_write_ordered_end"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_File_write_ordered_end - Complete a split collective write using shared file pointer - -Input Parameters: -. fh - file handle (handle) - -Output Parameters: -. buf - initial address of buffer (choice) -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_ordered_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *status) -{ - int error_code; - static char myname[] = "MPI_FILE_WRITE_ORDERED_END"; - ADIO_File adio_fh; - - MPIU_UNREFERENCED_ARG(buf); - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - - if (!(adio_fh->split_coll_count)) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_IO, - "**iosplitcollnone", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - -#ifdef HAVE_STATUS_SET_BYTES - if (status != MPI_STATUS_IGNORE) - *status = adio_fh->split_status; -#endif - adio_fh->split_coll_count = 0; - - -fn_exit: - ROMIO_THREAD_CS_EXIT(); - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi-io/write_sh.c b/3rd-party/romio321/mpi-io/write_sh.c deleted file mode 100644 index ed8e1c198bb..00000000000 --- a/3rd-party/romio321/mpi-io/write_sh.c +++ /dev/null @@ -1,149 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_File_write_shared = PMPI_File_write_shared -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_File_write_shared MPI_File_write_shared -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_File_write_shared as PMPI_File_write_shared -/* end of weak pragmas */ -#elif defined(HAVE_WEAK_ATTRIBUTE) -int MPI_File_write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) __attribute__((weak,alias("PMPI_File_write_shared"))); -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/* status object not filled currently */ - -/*@ - MPI_File_write_shared - Write using shared file pointer - -Input Parameters: -. fh - file handle (handle) -. buf - initial address of buffer (choice) -. count - number of elements in buffer (nonnegative integer) -. datatype - datatype of each buffer element (handle) - -Output Parameters: -. status - status object (Status) - -.N fortran -@*/ -int MPI_File_write_shared(MPI_File fh, ROMIO_CONST void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) -{ - int error_code, buftype_is_contig, filetype_is_contig; - ADIO_Offset bufsize; - static char myname[] = "MPI_FILE_READ_SHARED"; - MPI_Count datatype_size, incr; - ADIO_Offset off, shared_fp; - ADIO_File adio_fh; - void *e32buf = NULL; - const void *xbuf = NULL; - - ROMIO_THREAD_CS_ENTER(); - - adio_fh = MPIO_File_resolve(fh); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code); - MPIO_CHECK_COUNT(adio_fh, count, myname, error_code); - MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code); - /* --END ERROR HANDLING-- */ - - MPI_Type_size_x(datatype, &datatype_size); - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code); - /* --END ERROR HANDLING-- */ - - if (count*datatype_size == 0) { -#ifdef HAVE_STATUS_SET_BYTES - MPIR_Status_set_bytes(status, datatype, 0); -#endif - error_code = MPI_SUCCESS; - goto fn_exit; - } - - /* --BEGIN ERROR HANDLING-- */ - MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code); - MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code); - /* --END ERROR HANDLING-- */ - - ADIOI_Datatype_iscontig(datatype, &buftype_is_contig); - ADIOI_Datatype_iscontig(adio_fh->filetype, &filetype_is_contig); - - ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code); - - incr = (count*datatype_size)/adio_fh->etype_size; - - ADIO_Get_shared_fp(adio_fh, incr, &shared_fp, &error_code); - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - myname, __LINE__, MPI_ERR_INTERN, - "**iosharedfailed", 0); - error_code = MPIO_Err_return_file(adio_fh, error_code); - goto fn_exit; - } - /* --END ERROR HANDLING-- */ - - xbuf = buf; - if (adio_fh->is_external32) { - error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf); - if (error_code != MPI_SUCCESS) - goto fn_exit; - - xbuf = e32buf; - } - - if (buftype_is_contig && filetype_is_contig) - { - /* convert bufocunt and shared_fp to bytes */ - bufsize = datatype_size * count; - off = adio_fh->disp + adio_fh->etype_size * shared_fp; - - /* if atomic mode requested, lock (exclusive) the region, because there - could be a concurrent noncontiguous request. On NFS, locking is - done in the ADIO_WriteContig.*/ - - if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) - ADIOI_WRITE_LOCK(adio_fh, off, SEEK_SET, bufsize); - - ADIO_WriteContig(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - off, status, &error_code); - - if ((adio_fh->atomicity) && (adio_fh->file_system != ADIO_NFS)) - ADIOI_UNLOCK(adio_fh, off, SEEK_SET, bufsize); - } - else - { - ADIO_WriteStrided(adio_fh, xbuf, count, datatype, ADIO_EXPLICIT_OFFSET, - shared_fp, status, &error_code); - /* For strided and atomic mode, locking is done in ADIO_WriteStrided */ - } - - /* --BEGIN ERROR HANDLING-- */ - if (error_code != MPI_SUCCESS) - error_code = MPIO_Err_return_file(adio_fh, error_code); - /* --END ERROR HANDLING-- */ - -fn_exit: - if (e32buf != NULL) ADIOI_Free(e32buf); - ROMIO_THREAD_CS_EXIT(); - return error_code; -} diff --git a/3rd-party/romio321/mpi2-other/array/Makefile.in b/3rd-party/romio321/mpi2-other/array/Makefile.in deleted file mode 100644 index 41a366e398b..00000000000 --- a/3rd-party/romio321/mpi2-other/array/Makefile.in +++ /dev/null @@ -1,80 +0,0 @@ -CC = @CC@ -AR = @AR@ -LIBNAME = @LIBNAME@ -RANLIB = @RANLIB@ -srcdir = @srcdir@ -CC_SHL = @CC_SHL@ -SHLIBNAME = @SHLIBNAME@ - -INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I../../include -I${srcdir}/../../mpi-io -I${srcdir}/../../adio/include -I../../adio/include -CFLAGS = @CPPFLAGS@ @CFLAGS@ $(MPIOPROFILE) $(INCLUDE_DIR) - -top_builddir = @master_topbuild_dir@ -LIBTOOL = @LIBTOOL@ -C_COMPILE_SHL = $(CC_SHL) - -@VPATH@ - -MPIO_OBJECTS = subarray.o darray.o - -MPIO_TMP_POBJECTS = subarray.p darray.p - -MPIO_REAL_POBJECTS = _subarray.o _darray.o - -all: $(LIBNAME) - @if [ "@ENABLE_SHLIB@" != "none" ] ; then \ - $(MAKE) $(SHLIBNAME).la ;\ - fi - -.SUFFIXES: $(SUFFIXES) .p .sp .lo - -.c.o: - $(CC) $(CFLAGS) -c $< -.c.lo: - $(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o - @mv -f _s$*.o $*.lo - -.c.p: - @cp $(srcdir)/$*.c _$*.c - $(CC) $(CFLAGS) -c _$*.c - @rm -f _$*.c - -.c.sp: - $(C_COMPILE_SHL) $(CFLAGS) -c $< -o _$*.lo - -profile: $(MPIO_REAL_POBJECTS) - $(AR) $(LIBNAME) $(MPIO_REAL_POBJECTS) - $(RANLIB) $(LIBNAME) - @if [ "@ENABLE_SHLIB@" != "none" ] ; then \ - $(MAKE) P$(SHLIBNAME).la ;\ - fi - @rm -f _*.o - -$(LIBNAME): $(MPIO_OBJECTS) - $(AR) $(LIBNAME) $(MPIO_OBJECTS) - $(RANLIB) $(LIBNAME) - -MPIO_LOOBJECTS = $(MPIO_OBJECTS:.o=.lo) -$(SHLIBNAME).la: $(MPIO_LOOBJECTS) - $(AR) $(SHLIBNAME).la $(MPIO_LOOBJECTS) - -# -------------------------------------------------------------------------- -# We use P$(SHLBNAME) simply to distinguish the regular lib build from the -# profiling library build -MPIO_LOPOBJECTS = $(MPIO_REAL_POBJECTS:.o=.lo) -MPIO_TMP_LOPOBJECTS = ${MPIO_TMP_POBJECTS:.p=.sp} -P$(SHLIBNAME).la: $(MPIO_TMP_LOPOBJECTS) - $(AR) $(SHLIBNAME).la $(MPIO_LOPOBJECTS) -# -------------------------------------------------------------------------- - -clean: - @rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg - @rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda - @rm -f ${srcdir}/*.bb ${srcdir}/*.bbg - -# Rules for the profiling objects -_subarray.o: subarray.c - $(CC) $(CFLAGS) -c $(srcdir)/subarray.c -o _subarray.o -_darray.o: darray.c - $(CC) $(CFLAGS) -c $(srcdir)/darray.c -o _darray.o - diff --git a/3rd-party/romio321/mpi2-other/array/darray.c b/3rd-party/romio321/mpi2-other/array/darray.c deleted file mode 100644 index 17ee2a1fce6..00000000000 --- a/3rd-party/romio321/mpi2-other/array/darray.c +++ /dev/null @@ -1,209 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Type_create_darray = PMPI_Type_create_darray -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Type_create_darray MPI_Type_create_darray -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Type_create_darray as PMPI_Type_create_darray -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ -MPI_Type_create_darray - Creates a datatype corresponding to a distributed, multidimensional array - -Input Parameters: -. size - size of process group (positive integer) -. rank - rank in process group (nonnegative integer) -. ndims - number of array dimensions as well as process grid dimensions (positive integer) -. array_of_gsizes - number of elements of type oldtype in each dimension of global array (array of positive integers) -. array_of_distribs - distribution of array in each dimension (array of state) -. array_of_dargs - distribution argument in each dimension (array of positive integers) -. array_of_psizes - size of process grid in each dimension (array of positive integers) -. order - array storage order flag (state) -. oldtype - old datatype (handle) - -Output Parameters: -. newtype - new datatype (handle) - -.N fortran -@*/ -int MPI_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) -{ - int err, error_code; - int i; - MPI_Aint orig_extent, orig_lb, size_with_aint; - MPI_Offset size_with_offset; - static char myname[] = "MPI_TYPE_CREATE_DARRAY"; - - /* --BEGIN ERROR HANDLING-- */ - if (size <= 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid size argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (rank < 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid rank argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (ndims <= 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid ndoms argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_gsizes <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_gsizes argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_distribs <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_distribs argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_dargs <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_dargs argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_psizes <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_psizes argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - - for (i=0; iPMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_type_create_darray_ PMPI_TYPE_CREATE_DARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_type_create_darray_ pmpi_type_create_darray__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_type_create_darray pmpi_type_create_darray_ -#endif -#define mpi_type_create_darray_ pmpi_type_create_darray -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_type_create_darray_ pmpi_type_create_darray -#endif -#define mpi_type_create_darray_ pmpi_type_create_darray_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_type_create_darray_ MPI_TYPE_CREATE_DARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_type_create_darray_ mpi_type_create_darray__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_type_create_darray mpi_type_create_darray_ -#endif -#define mpi_type_create_darray_ mpi_type_create_darray -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_type_create_darray_ mpi_type_create_darray -#endif -#endif -#endif - -#ifdef MPIHP -/* Prototype to keep compiler happy */ -void mpi_type_create_darray_(int *size,int *rank,int *ndims, - int *array_of_gsizes,int *array_of_distribs, - int *array_of_dargs,int *array_of_psizes, - int *order, MPI_Fint *oldtype, - MPI_Fint *newtype, int *ierr ); - -void mpi_type_create_darray_(int *size,int *rank,int *ndims, - int *array_of_gsizes,int *array_of_distribs, - int *array_of_dargs,int *array_of_psizes, - int *order, MPI_Fint *oldtype, - MPI_Fint *newtype, int *ierr ) -{ - MPI_Datatype oldtype_c, newtype_c; - - oldtype_c = MPI_Type_f2c(*oldtype); - - *ierr = MPI_Type_create_darray(*size,*rank,*ndims,array_of_gsizes,array_of_distribs,array_of_dargs,array_of_psizes,*order,oldtype_c,&newtype_c); - - *newtype = MPI_Type_c2f(newtype_c); -} - -#else -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL void mpi_type_create_darray_(MPI_Fint *size,MPI_Fint *rank,MPI_Fint *ndims, - MPI_Fint *array_of_gsizes,MPI_Fint *array_of_distribs, - MPI_Fint *array_of_dargs,MPI_Fint *array_of_psizes, - MPI_Fint *order,MPI_Fint *oldtype, - MPI_Fint *newtype, MPI_Fint *ierr); - -FORTRAN_API void FORT_CALL void mpi_type_create_darray_(MPI_Fint *size,MPI_Fint *rank,MPI_Fint *ndims, - MPI_Fint *array_of_gsizes,MPI_Fint *array_of_distribs, - MPI_Fint *array_of_dargs,MPI_Fint *array_of_psizes, - MPI_Fint *order,MPI_Fint *oldtype, - MPI_Fint *newtype, MPI_Fint *ierr ) -{ - *ierr = MPI_Type_create_darray(*size,*rank,*ndims,array_of_gsizes,array_of_distribs,array_of_dargs,array_of_psizes,*order,*oldtype,newtype); -} -#endif diff --git a/3rd-party/romio321/mpi2-other/array/fortran/subarrayf.c b/3rd-party/romio321/mpi2-other/array/fortran/subarrayf.c deleted file mode 100644 index 7a2e54a530b..00000000000 --- a/3rd-party/romio321/mpi2-other/array/fortran/subarrayf.c +++ /dev/null @@ -1,127 +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 "mpio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -extern FORTRAN_API void FORT_CALL MPI_TYPE_CREATE_SUBARRAY(MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *); -#pragma weak MPI_TYPE_CREATE_SUBARRAY = PMPI_TYPE_CREATE_SUBARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_type_create_subarray__(MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *); -#pragma weak mpi_type_create_subarray__ = pmpi_type_create_subarray__ -#elif !defined(FORTRANUNDERSCORE) -extern FORTRAN_API void FORT_CALL mpi_type_create_subarray(MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *); -#pragma weak mpi_type_create_subarray = pmpi_type_create_subarray -#else -extern FORTRAN_API void FORT_CALL mpi_type_create_subarray_(MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *); -#pragma weak mpi_type_create_subarray_ = pmpi_type_create_subarray_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_TYPE_CREATE_SUBARRAY MPI_TYPE_CREATE_SUBARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_type_create_subarray__ mpi_type_create_subarray__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_type_create_subarray mpi_type_create_subarray -#else -#pragma _HP_SECONDARY_DEF pmpi_type_create_subarray_ mpi_type_create_subarray_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_TYPE_CREATE_SUBARRAY as PMPI_TYPE_CREATE_SUBARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_type_create_subarray__ as pmpi_type_create_subarray__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_type_create_subarray as pmpi_type_create_subarray -#else -#pragma _CRI duplicate mpi_type_create_subarray_ as pmpi_type_create_subarray_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#ifdef FORTRANCAPS -#define mpi_type_create_subarray_ PMPI_TYPE_CREATE_SUBARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_type_create_subarray_ pmpi_type_create_subarray__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_type_create_subarray pmpi_type_create_subarray_ -#endif -#define mpi_type_create_subarray_ pmpi_type_create_subarray -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_type_create_subarray_ pmpi_type_create_subarray -#endif -#define mpi_type_create_subarray_ pmpi_type_create_subarray_ -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_type_create_subarray_ MPI_TYPE_CREATE_SUBARRAY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_type_create_subarray_ mpi_type_create_subarray__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_type_create_subarray mpi_type_create_subarray_ -#endif -#define mpi_type_create_subarray_ mpi_type_create_subarray -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_type_create_subarray_ mpi_type_create_subarray -#endif -#endif -#endif - -#ifdef MPIHP -/* Prototype to keep compiler happy */ -void mpi_type_create_subarray_(int *ndims,int *array_of_sizes, - int *array_of_subsizes,int *array_of_starts, - int *order,MPI_Fint *oldtype, - MPI_Fint *newtype, int *ierr ); - -void mpi_type_create_subarray_(int *ndims,int *array_of_sizes, - int *array_of_subsizes,int *array_of_starts, - int *order,MPI_Fint *oldtype, - MPI_Fint *newtype, int *ierr ) -{ - MPI_Datatype oldtype_c, newtype_c; - - oldtype_c = MPI_Type_f2c(*oldtype); - - *ierr = MPI_Type_create_subarray(*ndims,array_of_sizes,array_of_subsizes,array_of_starts,*order,oldtype_c,&newtype_c); - *newtype = MPI_Type_c2f(newtype_c); -} - -#else - -/* Prototype to keep compiler happy */ -FORTRAN_API void FORT_CALL void mpi_type_create_subarray_(MPI_Fint *ndims,MPI_Fint *array_of_sizes, - MPI_Fint *array_of_subsizes,MPI_Fint *array_of_starts, - MPI_Fint *order,MPI_Fint *oldtype, - MPI_Fint *newtype, MPI_Fint *ierr ); - -FORTRAN_API void FORT_CALL void mpi_type_create_subarray_(MPI_Fint *ndims,MPI_Fint *array_of_sizes, - MPI_Fint *array_of_subsizes,MPI_Fint *array_of_starts, - MPI_Fint *order,MPI_Fint *oldtype, - MPI_Fint *newtype, MPI_Fint *ierr ) -{ -*ierr = MPI_Type_create_subarray(*ndims,array_of_sizes,array_of_subsizes,array_of_starts,*order,*oldtype,newtype); -} -#endif diff --git a/3rd-party/romio321/mpi2-other/array/subarray.c b/3rd-party/romio321/mpi2-other/array/subarray.c deleted file mode 100644 index 006abce19c8..00000000000 --- a/3rd-party/romio321/mpi2-other/array/subarray.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Type_create_subarray = PMPI_Type_create_subarray -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Type_create_subarray MPI_Type_create_subarray -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Type_create_subarray as PMPI_Type_create_subarray -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ -MPI_Type_create_subarray - Creates a datatype describing a subarray of a multidimensional array - -Input Parameters: -. ndims - number of array dimensions (positive integer) -. array_of_sizes - number of elements of type oldtype in each dimension of the full array (array of positive integers) -. array_of_subsizes - number of elements of type oldtype in each dimension of the subarray (array of positive integers) -. array_of_starts - starting coordinates of the subarray in each dimension (array of nonnegative integers) -. order - array storage order flag (state) -. oldtype - old datatype (handle) - -Output Parameters: -. newtype - new datatype (handle) - -.N fortran -@*/ -int MPI_Type_create_subarray(int ndims, int *array_of_sizes, - int *array_of_subsizes, int *array_of_starts, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) -{ - MPI_Aint extent, lb, size_with_aint; - int i, err, error_code; - MPI_Offset size_with_offset; - - /* --BEGIN ERROR HANDLING-- */ - if (ndims <= 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid ndims argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_sizes <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_sizes argument", - 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_subsizes <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_subsizes argument", - 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_starts <= (int *) 0) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid array_of_starts argument", - 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - - for (i=0; i array_of_sizes[i]) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid subsize argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - if (array_of_starts[i] > (array_of_sizes[i] - array_of_subsizes[i])) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid start argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - } - - /* order argument checked below */ - - if (oldtype == MPI_DATATYPE_NULL) { - error_code = MPIO_Err_create_code(MPI_SUCCESS, - MPIR_ERR_RECOVERABLE, - myname, __LINE__, MPI_ERR_ARG, - "Invalid type argument", 0); - return MPIO_Err_return_comm(MPI_COMM_SELF, error_code); - } - - MPI_Type_get_extent(oldtype, &lb, &extent); - -/* check if MPI_Aint is large enough for size of global array. - if not, complain. */ - - size_with_aint = extent; - for (i=0; iPMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_create_ MPI_INFO_CREATE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_create_ mpi_info_create__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_create mpi_info_create_ -#endif -#define mpi_info_create_ mpi_info_create -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_create_ mpi_info_create -#endif -#endif -#endif - -void mpi_info_create_(MPI_Fint *info, int *ierr ) -{ - MPI_Info info_c; - - *ierr = MPI_Info_create(&info_c); - *info = MPI_Info_c2f(info_c); -} diff --git a/3rd-party/romio321/mpi2-other/info/fortran/info_deletef.c b/3rd-party/romio321/mpi2-other/info/fortran/info_deletef.c deleted file mode 100644 index f7a7bb4d58e..00000000000 --- a/3rd-party/romio321/mpi2-other/info/fortran/info_deletef.c +++ /dev/null @@ -1,120 +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 "mpio.h" -#include "adio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) -#ifdef FORTRANCAPS -#define mpi_info_delete_ PMPI_INFO_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_delete_ pmpi_info_delete__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_delete pmpi_info_delete_ -#endif -#define mpi_info_delete_ pmpi_info_delete -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_delete_ pmpi_info_delete -#endif -#define mpi_info_delete_ pmpi_info_delete_ -#endif - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -#pragma weak MPI_INFO_DELETE = PMPI_INFO_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma weak mpi_info_delete__ = pmpi_info_delete__ -#elif !defined(FORTRANUNDERSCORE) -#pragma weak mpi_info_delete = pmpi_info_delete -#else -#pragma weak mpi_info_delete_ = pmpi_info_delete_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_INFO_DELETE MPI_INFO_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_delete__ mpi_info_delete__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_delete mpi_info_delete -#else -#pragma _HP_SECONDARY_DEF pmpi_info_delete_ mpi_info_delete_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_INFO_DELETE as PMPI_INFO_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_info_delete__ as pmpi_info_delete__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_info_delete as pmpi_info_delete -#else -#pragma _CRI duplicate mpi_info_delete_ as pmpi_info_delete_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_delete_ MPI_INFO_DELETE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_delete_ mpi_info_delete__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_delete mpi_info_delete_ -#endif -#define mpi_info_delete_ mpi_info_delete -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_delete_ mpi_info_delete -#endif -#endif -#endif - -void mpi_info_delete_(MPI_Fint *info, char *key, int *ierr, int keylen) -{ - MPI_Info info_c; - char *newkey; - int new_keylen, lead_blanks, i; - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_delete: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - /* strip leading and trailing blanks in key */ - lead_blanks = 0; - for (i=0; i=0; i--) if (key[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_Info_delete: key is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - new_keylen = i + 1 - lead_blanks; - key += lead_blanks; - - newkey = (char *) ADIOI_Malloc((new_keylen+1)*sizeof(char)); - ADIOI_Strncpy(newkey, key, new_keylen); - newkey[new_keylen] = '\0'; - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_delete(info_c, newkey); - ADIOI_Free(newkey); -} - diff --git a/3rd-party/romio321/mpi2-other/info/fortran/info_dupf.c b/3rd-party/romio321/mpi2-other/info/fortran/info_dupf.c deleted file mode 100644 index 87162005ab6..00000000000 --- a/3rd-party/romio321/mpi2-other/info/fortran/info_dupf.c +++ /dev/null @@ -1,94 +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 "mpio.h" -#include "adio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) -#ifdef FORTRANCAPS -#define mpi_info_dup_ PMPI_INFO_DUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_dup_ pmpi_info_dup__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_dup pmpi_info_dup_ -#endif -#define mpi_info_dup_ pmpi_info_dup -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_dup_ pmpi_info_dup -#endif -#define mpi_info_dup_ pmpi_info_dup_ -#endif - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -#pragma weak MPI_INFO_DUP = PMPI_INFO_DUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma weak mpi_info_dup__ = pmpi_info_dup__ -#elif !defined(FORTRANUNDERSCORE) -#pragma weak mpi_info_dup = pmpi_info_dup -#else -#pragma weak mpi_info_dup_ = pmpi_info_dup_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_INFO_DUP MPI_INFO_DUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_dup__ mpi_info_dup__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_dup mpi_info_dup -#else -#pragma _HP_SECONDARY_DEF pmpi_info_dup_ mpi_info_dup_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_INFO_DUP as PMPI_INFO_DUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_info_dup__ as pmpi_info_dup__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_info_dup as pmpi_info_dup -#else -#pragma _CRI duplicate mpi_info_dup_ as pmpi_info_dup_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_dup_ MPI_INFO_DUP -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_dup_ mpi_info_dup__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_dup mpi_info_dup_ -#endif -#define mpi_info_dup_ mpi_info_dup -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_dup_ mpi_info_dup -#endif -#endif -#endif - -void mpi_info_dup_(MPI_Fint *info, MPI_Fint *newinfo, int *ierr ) -{ - MPI_Info info_c, newinfo_c; - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_dup(info_c, &newinfo_c); - *newinfo = MPI_Info_c2f(newinfo_c); -} diff --git a/3rd-party/romio321/mpi2-other/info/fortran/info_freef.c b/3rd-party/romio321/mpi2-other/info/fortran/info_freef.c deleted file mode 100644 index 5f200c96227..00000000000 --- a/3rd-party/romio321/mpi2-other/info/fortran/info_freef.c +++ /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. - */ - -#include "mpio.h" -#include "adio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) -#ifdef FORTRANCAPS -#define mpi_info_free_ PMPI_INFO_FREE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_free_ pmpi_info_free__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_free pmpi_info_free_ -#endif -#define mpi_info_free_ pmpi_info_free -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_free_ pmpi_info_free -#endif -#define mpi_info_free_ pmpi_info_free_ -#endif - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -#pragma weak MPI_INFO_FREE = PMPI_INFO_FREE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma weak mpi_info_free__ = pmpi_info_free__ -#elif !defined(FORTRANUNDERSCORE) -#pragma weak mpi_info_free = pmpi_info_free -#else -#pragma weak mpi_info_free_ = pmpi_info_free_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_INFO_FREE MPI_INFO_FREE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_free__ mpi_info_free__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_free mpi_info_free -#else -#pragma _HP_SECONDARY_DEF pmpi_info_free_ mpi_info_free_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_INFO_FREE as PMPI_INFO_FREE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_info_free__ as pmpi_info_free__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_info_free as pmpi_info_free -#else -#pragma _CRI duplicate mpi_info_free_ as pmpi_info_free_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_free_ MPI_INFO_FREE -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_free_ mpi_info_free__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_free mpi_info_free_ -#endif -#define mpi_info_free_ mpi_info_free -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_free_ mpi_info_free -#endif -#endif -#endif - -void mpi_info_free_(MPI_Fint *info, int *ierr ) -{ - MPI_Info info_c; - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_free(&info_c); - *info = MPI_Info_c2f(info_c); -} - diff --git a/3rd-party/romio321/mpi2-other/info/fortran/info_getf.c b/3rd-party/romio321/mpi2-other/info/fortran/info_getf.c deleted file mode 100644 index ae60cc22b07..00000000000 --- a/3rd-party/romio321/mpi2-other/info/fortran/info_getf.c +++ /dev/null @@ -1,144 +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 "mpio.h" -#include "adio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) -#ifdef FORTRANCAPS -#define mpi_info_get_ PMPI_INFO_GET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_get_ pmpi_info_get__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_get pmpi_info_get_ -#endif -#define mpi_info_get_ pmpi_info_get -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_get_ pmpi_info_get -#endif -#define mpi_info_get_ pmpi_info_get_ -#endif - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -#pragma weak MPI_INFO_GET = PMPI_INFO_GET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma weak mpi_info_get__ = pmpi_info_get__ -#elif !defined(FORTRANUNDERSCORE) -#pragma weak mpi_info_get = pmpi_info_get -#else -#pragma weak mpi_info_get_ = pmpi_info_get_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_INFO_GET MPI_INFO_GET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_get__ mpi_info_get__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_get mpi_info_get -#else -#pragma _HP_SECONDARY_DEF pmpi_info_get_ mpi_info_get_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_INFO_GET as PMPI_INFO_GET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_info_get__ as pmpi_info_get__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_info_get as pmpi_info_get -#else -#pragma _CRI duplicate mpi_info_get_ as pmpi_info_get_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_get_ MPI_INFO_GET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_get_ mpi_info_get__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get mpi_info_get_ -#endif -#define mpi_info_get_ mpi_info_get -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_ mpi_info_get -#endif -#endif -#endif - -void mpi_info_get_(MPI_Fint *info, char *key, int *valuelen, char *value, - int *flag, int *ierr, int keylen, int valspace) -{ - MPI_Info info_c; - char *newkey, *tmpvalue; - int new_keylen, lead_blanks, i, tmpvaluelen; - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - /* strip leading and trailing blanks in key */ - lead_blanks = 0; - for (i=0; i=0; i--) if (key[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_Info_get: key is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - new_keylen = i + 1 - lead_blanks; - key += lead_blanks; - - newkey = (char *) ADIOI_Malloc((new_keylen+1)*sizeof(char)); - ADIOI_Strncpy(newkey, key, new_keylen); - newkey[new_keylen] = '\0'; - - if (value <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get: value is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - if (*valuelen <= 0) { - FPRINTF(stderr, "MPI_Info_get: Invalid valuelen argument\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - if (*valuelen > valspace) { - FPRINTF(stderr, "MPI_Info_get: valuelen is greater than the amount of memory available in value\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - tmpvalue = (char *) ADIOI_Malloc((*valuelen + 1)*sizeof(char)); - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_get(info_c, newkey, *valuelen, tmpvalue, flag); - - if (*flag) { - tmpvaluelen = strlen(tmpvalue); - ADIOI_Strncpy(value, tmpvalue, tmpvaluelen); - /* blank pad the remaining space */ - for (i=tmpvaluelen; iPMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_get_nkeys_ MPI_INFO_GET_NKEYS -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_get_nkeys_ mpi_info_get_nkeys__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_nkeys mpi_info_get_nkeys_ -#endif -#define mpi_info_get_nkeys_ mpi_info_get_nkeys -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_nkeys_ mpi_info_get_nkeys -#endif -#endif -#endif - -void mpi_info_get_nkeys_(MPI_Fint *info, int *nkeys, int *ierr ) -{ - MPI_Info info_c; - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_get_nkeys(info_c, nkeys); -} diff --git a/3rd-party/romio321/mpi2-other/info/fortran/info_getnthf.c b/3rd-party/romio321/mpi2-other/info/fortran/info_getnthf.c deleted file mode 100644 index 5434fe3dd3e..00000000000 --- a/3rd-party/romio321/mpi2-other/info/fortran/info_getnthf.c +++ /dev/null @@ -1,120 +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 "mpio.h" -#include "adio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) -#ifdef FORTRANCAPS -#define mpi_info_get_nthkey_ PMPI_INFO_GET_NTHKEY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_get_nthkey_ pmpi_info_get_nthkey__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_get_nthkey pmpi_info_get_nthkey_ -#endif -#define mpi_info_get_nthkey_ pmpi_info_get_nthkey -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_get_nthkey_ pmpi_info_get_nthkey -#endif -#define mpi_info_get_nthkey_ pmpi_info_get_nthkey_ -#endif - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -#pragma weak MPI_INFO_GET_NTHKEY = PMPI_INFO_GET_NTHKEY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma weak mpi_info_get_nthkey__ = pmpi_info_get_nthkey__ -#elif !defined(FORTRANUNDERSCORE) -#pragma weak mpi_info_get_nthkey = pmpi_info_get_nthkey -#else -#pragma weak mpi_info_get_nthkey_ = pmpi_info_get_nthkey_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_INFO_GET_NTHKEY MPI_INFO_GET_NTHKEY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_get_nthkey__ mpi_info_get_nthkey__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_get_nthkey mpi_info_get_nthkey -#else -#pragma _HP_SECONDARY_DEF pmpi_info_get_nthkey_ mpi_info_get_nthkey_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_INFO_GET_NTHKEY as PMPI_INFO_GET_NTHKEY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_info_get_nthkey__ as pmpi_info_get_nthkey__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_info_get_nthkey as pmpi_info_get_nthkey -#else -#pragma _CRI duplicate mpi_info_get_nthkey_ as pmpi_info_get_nthkey_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_get_nthkey_ MPI_INFO_GET_NTHKEY -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_get_nthkey_ mpi_info_get_nthkey__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_nthkey mpi_info_get_nthkey_ -#endif -#define mpi_info_get_nthkey_ mpi_info_get_nthkey -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_nthkey_ mpi_info_get_nthkey -#endif -#endif -#endif - -void mpi_info_get_nthkey_(MPI_Fint *info, int *n, char *key, int *ierr, - int keylen) -{ - MPI_Info info_c; - int i, tmpkeylen; - char *tmpkey; - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get_nthkey: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - tmpkey = (char *) ADIOI_Malloc((MPI_MAX_INFO_KEY+1) * sizeof(char)); - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_get_nthkey(info_c, *n, tmpkey); - - tmpkeylen = strlen(tmpkey); - - if (tmpkeylen <= keylen) { - ADIOI_Strncpy(key, tmpkey, tmpkeylen); - - /* blank pad the remaining space */ - for (i=tmpkeylen; iPMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_get_valuelen_ MPI_INFO_GET_VALUELEN -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_get_valuelen_ mpi_info_get_valuelen__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_valuelen mpi_info_get_valuelen_ -#endif -#define mpi_info_get_valuelen_ mpi_info_get_valuelen -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_get_valuelen_ mpi_info_get_valuelen -#endif -#endif -#endif - -void mpi_info_get_valuelen_(MPI_Fint *info, char *key, int *valuelen, - int *flag, int *ierr, int keylen ) -{ - MPI_Info info_c; - char *newkey; - int new_keylen, lead_blanks, i; - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get_valuelen: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - /* strip leading and trailing blanks in key */ - lead_blanks = 0; - for (i=0; i=0; i--) if (key[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_Info_get_valuelen: key is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - new_keylen = i + 1 - lead_blanks; - key += lead_blanks; - - newkey = (char *) ADIOI_Malloc((new_keylen+1)*sizeof(char)); - ADIOI_Strncpy(newkey, key, new_keylen); - newkey[new_keylen] = '\0'; - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_get_valuelen(info_c, newkey, valuelen, flag); - ADIOI_Free(newkey); -} diff --git a/3rd-party/romio321/mpi2-other/info/fortran/info_setf.c b/3rd-party/romio321/mpi2-other/info/fortran/info_setf.c deleted file mode 100644 index 6b6458d2611..00000000000 --- a/3rd-party/romio321/mpi2-other/info/fortran/info_setf.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 "mpio.h" -#include "adio.h" - - -#if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) -#ifdef FORTRANCAPS -#define mpi_info_set_ PMPI_INFO_SET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_set_ pmpi_info_set__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_set pmpi_info_set_ -#endif -#define mpi_info_set_ pmpi_info_set -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF pmpi_info_set_ pmpi_info_set -#endif -#define mpi_info_set_ pmpi_info_set_ -#endif - -#if defined(HAVE_WEAK_SYMBOLS) -#if defined(HAVE_PRAGMA_WEAK) -#if defined(FORTRANCAPS) -#pragma weak MPI_INFO_SET = PMPI_INFO_SET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma weak mpi_info_set__ = pmpi_info_set__ -#elif !defined(FORTRANUNDERSCORE) -#pragma weak mpi_info_set = pmpi_info_set -#else -#pragma weak mpi_info_set_ = pmpi_info_set_ -#endif - -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#if defined(FORTRANCAPS) -#pragma _HP_SECONDARY_DEF PMPI_INFO_SET MPI_INFO_SET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_set__ mpi_info_set__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _HP_SECONDARY_DEF pmpi_info_set mpi_info_set -#else -#pragma _HP_SECONDARY_DEF pmpi_info_set_ mpi_info_set_ -#endif - -#elif defined(HAVE_PRAGMA_CRI_DUP) -#if defined(FORTRANCAPS) -#pragma _CRI duplicate MPI_INFO_SET as PMPI_INFO_SET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#pragma _CRI duplicate mpi_info_set__ as pmpi_info_set__ -#elif !defined(FORTRANUNDERSCORE) -#pragma _CRI duplicate mpi_info_set as pmpi_info_set -#else -#pragma _CRI duplicate mpi_info_set_ as pmpi_info_set_ -#endif - -/* end of weak pragmas */ -#endif -/* Include mapping from MPI->PMPI */ -#include "mpioprof.h" -#endif - -#else - -#ifdef FORTRANCAPS -#define mpi_info_set_ MPI_INFO_SET -#elif defined(FORTRANDOUBLEUNDERSCORE) -#define mpi_info_set_ mpi_info_set__ -#elif !defined(FORTRANUNDERSCORE) -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_set mpi_info_set_ -#endif -#define mpi_info_set_ mpi_info_set -#else -#if defined(HPUX) || defined(SPPUX) -#pragma _HP_SECONDARY_DEF mpi_info_set_ mpi_info_set -#endif -#endif -#endif - - -void mpi_info_set_(MPI_Fint *info, char *key, char *value, int *ierr, - int keylen, int vallen) -{ - MPI_Info info_c; - char *newkey, *newvalue; - int new_keylen, new_vallen, lead_blanks, i; - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_set: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - if (value <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_set: value is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - /* strip leading and trailing blanks in key */ - lead_blanks = 0; - for (i=0; i=0; i--) if (key[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_Info_set: key is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - new_keylen = i + 1 - lead_blanks; - key += lead_blanks; - - newkey = (char *) ADIOI_Malloc((new_keylen+1)*sizeof(char)); - ADIOI_Strncpy(newkey, key, new_keylen); - newkey[new_keylen] = '\0'; - - - /* strip leading and trailing blanks in value */ - lead_blanks = 0; - for (i=0; i=0; i--) if (value[i] != ' ') break; - if (i < 0) { - FPRINTF(stderr, "MPI_Info_set: value is a blank string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - new_vallen = i + 1 - lead_blanks; - value += lead_blanks; - - newvalue = (char *) ADIOI_Malloc((new_vallen+1)*sizeof(char)); - ADIOI_Strncpy(newvalue, value, new_vallen); - newvalue[new_vallen] = '\0'; - - - info_c = MPI_Info_f2c(*info); - *ierr = MPI_Info_set(info_c, newkey, newvalue); - ADIOI_Free(newkey); - ADIOI_Free(newvalue); -} diff --git a/3rd-party/romio321/mpi2-other/info/info_c2f.c b/3rd-party/romio321/mpi2-other/info/info_c2f.c deleted file mode 100644 index 4486887b545..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_c2f.c +++ /dev/null @@ -1,64 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_c2f = PMPI_Info_c2f -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_c2f MPI_Info_c2f -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_c2f as PMPI_Info_c2f -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#include "adio_extern.h" - -/*@ - MPI_Info_c2f - Translates a C info handle to a Fortran info handle - -Input Parameters: -. info - C info handle (integer) - -Return Value: - Fortran info handle (handle) -@*/ -MPI_Fint MPI_Info_c2f(MPI_Info info) -{ -#ifndef INT_LT_POINTER - return (MPI_Fint) info; -#else - int i; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) - return (MPI_Fint) 0; - if (!MPIR_Infotable) { - MPIR_Infotable_max = 1024; - MPIR_Infotable = (MPI_Info *) - ADIOI_Malloc(MPIR_Infotable_max*sizeof(MPI_Info)); - MPIR_Infotable_ptr = 0; /* 0 can't be used though, because - MPI_INFO_NULL=0 */ - for (i=0; iPMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_create - Creates a new info object - -Output Parameters: -. info - info object (handle) - -.N fortran -@*/ -int MPI_Info_create(MPI_Info *info) -{ - int error_code; - - MPIR_MPIOInit(&error_code); - if (error_code != MPI_SUCCESS) goto fn_exit; - - *info = (MPI_Info) ADIOI_Malloc(sizeof(struct MPIR_Info)); - (*info)->cookie = MPIR_INFO_COOKIE; - (*info)->key = 0; - (*info)->value = 0; - (*info)->next = 0; - /* this is the first structure in this linked list. it is - always kept empty. new (key,value) pairs are added after it. */ - -fn_exit: - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_delete.c b/3rd-party/romio321/mpi2-other/info/info_delete.c deleted file mode 100644 index 06ec27ee8dd..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_delete.c +++ /dev/null @@ -1,83 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_delete = PMPI_Info_delete -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_delete MPI_Info_delete -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_delete as PMPI_Info_delete -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_delete - Deletes a (key,value) pair from info - -Input Parameters: -. info - info object (handle) -. key - key (string) - -.N fortran -@*/ -int MPI_Info_delete(MPI_Info info, char *key) -{ - MPI_Info prev, curr; - int done; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_delete: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_delete: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (strlen(key) > MPI_MAX_INFO_KEY) { - FPRINTF(stderr, "MPI_Info_delete: key is longer than MPI_MAX_INFO_KEY\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (!strlen(key)) { - FPRINTF(stderr, "MPI_Info_delete: key is a null string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - prev = info; - curr = info->next; - done = 0; - - while (curr) { - if (!strcmp(curr->key, key)) { - ADIOI_Free(curr->key); - ADIOI_Free(curr->value); - prev->next = curr->next; - ADIOI_Free(curr); - done = 1; - break; - } - prev = curr; - curr = curr->next; - } - - if (!done) { - FPRINTF(stderr, "MPI_Info_delete: key not defined in info\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_dup.c b/3rd-party/romio321/mpi2-other/info/info_dup.c deleted file mode 100644 index a1c1a9969fc..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_dup.c +++ /dev/null @@ -1,66 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_dup = PMPI_Info_dup -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_dup MPI_Info_dup -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_dup as PMPI_Info_dup -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_dup - Returns a duplicate of the info object - -Input Parameters: -. info - info object (handle) - -Output Parameters: -. newinfo - duplicate of info object (handle) - -.N fortran -@*/ -int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) -{ - MPI_Info curr_old, curr_new; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_dup: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - *newinfo = (MPI_Info) ADIOI_Malloc(sizeof(struct MPIR_Info)); - curr_new = *newinfo; - curr_new->cookie = MPIR_INFO_COOKIE; - curr_new->key = 0; - curr_new->value = 0; - curr_new->next = 0; - - curr_old = info->next; - while (curr_old) { - curr_new->next = (MPI_Info) ADIOI_Malloc(sizeof(struct MPIR_Info)); - curr_new = curr_new->next; - curr_new->cookie = 0; /* cookie not set on purpose */ - curr_new->key = ADIOI_Strdup(curr_old->key); - curr_new->value = ADIOI_Strdup(curr_old->value); - curr_new->next = 0; - - curr_old = curr_old->next; - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_f2c.c b/3rd-party/romio321/mpi2-other/info/info_f2c.c deleted file mode 100644 index 49d8ae5eec2..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_f2c.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_f2c = PMPI_Info_f2c -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_f2c MPI_Info_f2c -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_f2c as PMPI_Info_f2c -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif -#include "adio_extern.h" - -/*@ - MPI_Info_f2c - Translates a Fortran info handle to a C info handle - -Input Parameters: -. info - Fortran info handle (integer) - -Return Value: - C info handle (handle) -@*/ -MPI_Info MPI_Info_f2c(MPI_Fint info) -{ - -#ifndef INT_LT_POINTER - return (MPI_Info) info; -#else - if (!info) return MPI_INFO_NULL; - if ((info < 0) || (info > MPIR_Infotable_ptr)) { - FPRINTF(stderr, "MPI_Info_f2c: Invalid info handle\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - return MPIR_Infotable[info]; -#endif -} diff --git a/3rd-party/romio321/mpi2-other/info/info_free.c b/3rd-party/romio321/mpi2-other/info/info_free.c deleted file mode 100644 index e682ce0cd58..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_free.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_free = PMPI_Info_free -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_free MPI_Info_free -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_free as PMPI_Info_free -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_free - Frees an info object - -Input Parameters: -. info - info object (handle) - -.N fortran -@*/ -int MPI_Info_free(MPI_Info *info) -{ - MPI_Info curr, next; - - if ((*info <= (MPI_Info) 0) || ((*info)->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_free: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - curr = (*info)->next; - ADIOI_Free(*info); - *info = MPI_INFO_NULL; - - while (curr) { - next = curr->next; - ADIOI_Free(curr->key); - ADIOI_Free(curr->value); - ADIOI_Free(curr); - curr = next; - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_get.c b/3rd-party/romio321/mpi2-other/info/info_get.c deleted file mode 100644 index ca4274672b5..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_get.c +++ /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. - */ - -#include "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_get = PMPI_Info_get -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_get MPI_Info_get -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_get as PMPI_Info_get -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_get - Retrieves the value associated with a key - -Input Parameters: -. info - info object (handle) -. key - key (string) -. valuelen - length of value argument (integer) - -Output Parameters: -. value - value (string) -. flag - true if key defined, false if not (boolean) - -.N fortran -@*/ -int MPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag) -{ - MPI_Info curr; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_get: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (strlen(key) > MPI_MAX_INFO_KEY) { - FPRINTF(stderr, "MPI_Info_get: key is longer than MPI_MAX_INFO_KEY\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (!strlen(key)) { - FPRINTF(stderr, "MPI_Info_get: key is a null string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (valuelen <= 0) { - FPRINTF(stderr, "MPI_Info_get: Invalid valuelen argument\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (value <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get: value is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - curr = info->next; - *flag = 0; - - while (curr) { - if (!strcmp(curr->key, key)) { - ADIOI_Strncpy(value, curr->value, valuelen); - value[valuelen] = '\0'; - *flag = 1; - break; - } - curr = curr->next; - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_getnks.c b/3rd-party/romio321/mpi2-other/info/info_getnks.c deleted file mode 100644 index fd20826950f..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_getnks.c +++ /dev/null @@ -1,55 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_get_nkeys = PMPI_Info_get_nkeys -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_get_nkeys MPI_Info_get_nkeys -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_get_nkeys as PMPI_Info_get_nkeys -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_get_nkeys - Returns the number of currently defined keys in info - -Input Parameters: -. info - info object (handle) - -Output Parameters: -. nkeys - number of defined keys (integer) - -.N fortran -@*/ -int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) -{ - MPI_Info curr; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_get_nkeys: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - curr = info->next; - *nkeys = 0; - - while (curr) { - curr = curr->next; - (*nkeys)++; - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_getnth.c b/3rd-party/romio321/mpi2-other/info/info_getnth.c deleted file mode 100644 index fa325c41cc0..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_getnth.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_get_nthkey = PMPI_Info_get_nthkey -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_get_nthkey MPI_Info_get_nthkey -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_get_nthkey as PMPI_Info_get_nthkey -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_get_nthkey - Returns the nth defined key in info - -Input Parameters: -. info - info object (handle) -. n - key number (integer) - -Output Parameters: -. keys - key (string) - -.N fortran -@*/ -int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) -{ - MPI_Info curr; - int nkeys, i; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_get_nthkey: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - curr = info->next; - nkeys = 0; - while (curr) { - curr = curr->next; - nkeys++; - } - - if ((n < 0) || (n >= nkeys)) { - FPRINTF(stderr, "MPI_Info_get_nthkey: n is an invalid number\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - curr = info->next; - i = 0; - while (i < n) { - curr = curr->next; - i++; - } - ADIOI_Strncpy(key, curr->key, MPI_MAX_INFO_KEY); - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_getvln.c b/3rd-party/romio321/mpi2-other/info/info_getvln.c deleted file mode 100644 index b484929b720..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_getvln.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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_get_valuelen = PMPI_Info_get_valuelen -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_get_valuelen MPI_Info_get_valuelen -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_get_valuelen as PMPI_Info_get_valuelen -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_get_valuelen - Retrieves the length of the value associated with a key - -Input Parameters: -. info - info object (handle) -. key - key (string) - -Output Parameters: -. valuelen - length of value argument (integer) -. flag - true if key defined, false if not (boolean) - -.N fortran -@*/ -int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag) -{ - MPI_Info curr; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_get_valuelen: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_get_valuelen: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (strlen(key) > MPI_MAX_INFO_KEY) { - FPRINTF(stderr, "MPI_Info_get_valuelen: key is longer than MPI_MAX_INFO_KEY\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (!strlen(key)) { - FPRINTF(stderr, "MPI_Info_get_valuelen: key is a null string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - curr = info->next; - *flag = 0; - - while (curr) { - if (!strcmp(curr->key, key)) { - *valuelen = strlen(curr->value); - *flag = 1; - break; - } - curr = curr->next; - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/mpi2-other/info/info_set.c b/3rd-party/romio321/mpi2-other/info/info_set.c deleted file mode 100644 index e60d89d79e5..00000000000 --- a/3rd-party/romio321/mpi2-other/info/info_set.c +++ /dev/null @@ -1,98 +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 "mpioimpl.h" - -#ifdef HAVE_WEAK_SYMBOLS - -#if defined(HAVE_PRAGMA_WEAK) -#pragma weak MPI_Info_set = PMPI_Info_set -#elif defined(HAVE_PRAGMA_HP_SEC_DEF) -#pragma _HP_SECONDARY_DEF PMPI_Info_set MPI_Info_set -#elif defined(HAVE_PRAGMA_CRI_DUP) -#pragma _CRI duplicate MPI_Info_set as PMPI_Info_set -/* end of weak pragmas */ -#endif - -/* Include mapping from MPI->PMPI */ -#define MPIO_BUILD_PROFILING -#include "mpioprof.h" -#endif - -/*@ - MPI_Info_set - Adds a (key,value) pair to info - -Input Parameters: -. info - info object (handle) -. key - key (string) -. value - value (string) - -.N fortran -@*/ -int MPI_Info_set(MPI_Info info, char *key, char *value) -{ - MPI_Info prev, curr; - - if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) { - FPRINTF(stderr, "MPI_Info_set: Invalid info object\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (key <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_set: key is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (value <= (char *) 0) { - FPRINTF(stderr, "MPI_Info_set: value is an invalid address\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (strlen(key) > MPI_MAX_INFO_KEY) { - FPRINTF(stderr, "MPI_Info_set: key is longer than MPI_MAX_INFO_KEY\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (strlen(value) > MPI_MAX_INFO_VAL) { - FPRINTF(stderr, "MPI_Info_set: value is longer than MPI_MAX_INFO_VAL\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (!strlen(key)) { - FPRINTF(stderr, "MPI_Info_set: key is a null string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if (!strlen(value)) { - FPRINTF(stderr, "MPI_Info_set: value is a null string\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - prev = info; - curr = info->next; - - while (curr) { - if (!strcmp(curr->key, key)) { - ADIOI_Free(curr->value); - curr->value = ADIOI_Strdup(value); - break; - } - prev = curr; - curr = curr->next; - } - - if (!curr) { - prev->next = (MPI_Info) ADIOI_Malloc(sizeof(struct MPIR_Info)); - curr = prev->next; - curr->cookie = 0; /* cookie not set on purpose */ - curr->key = ADIOI_Strdup(key); - curr->value = ADIOI_Strdup(value); - curr->next = 0; - } - - return MPI_SUCCESS; -} diff --git a/3rd-party/romio321/test-internal/Makefile.am b/3rd-party/romio321/test-internal/Makefile.am deleted file mode 100644 index ec7c7eb0ef5..00000000000 --- a/3rd-party/romio321/test-internal/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# -*- Mode: Makefile; -*- -# -# (C) 2011 by Argonne National Laboratory. -# See COPYRIGHT in top-level directory. -# - -# This directory is only listed in DIST_SUBDIRS, not SUBDIRS, so its contents -# will not be built by default, but it will participate in "make distclean" and -# friends. - -# override the normal compilers for the tests -CC = $(TEST_CC) - -# because := is not universally avalible, we have to play games to use the -# user-specified LDFLAGS and OUR_LIBS env. variables (if set) -OUR_LIBS = $(TEST_LIBNAME) $(MPI_LIB) $(ROMIO_LIBLIST) - -LDADD = $(OUR_LIBS) - -AM_CPPFLAGS = $(ROMIO_INCLUDE) -AM_CFLAGS = $(USER_CFLAGS) - -CTESTS = file_realms_test io_bounds_test heap_test - -noinst_PROGRAMS = $(CTESTS) - diff --git a/3rd-party/romio321/test-internal/file_realms_test.c b/3rd-party/romio321/test-internal/file_realms_test.c deleted file mode 100644 index b848259e0ef..00000000000 --- a/3rd-party/romio321/test-internal/file_realms_test.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "../adio/include/adio.h" -#include "../adio/include/adio_extern.h" -#include "mpi.h" - -int main (int argc, char **argv) -{ - int i; - ADIO_File fd; - ADIO_Offset min_st_offset, max_end_offset; - int rank; - int nprocs_for_coll; - int lb; - MPI_Count size, extent; - - MPI_Init (&argc, &argv); - MPI_Comm_rank (MPI_COMM_WORLD, &rank); - - if (argc != 4) { - if (!rank) - printf ("Usage: file_realms_test \n" - " simulates file_realm calculation\n"); - MPI_Finalize(); - return 1; - } - - nprocs_for_coll = atoi (argv[1]); - - min_st_offset = atoi (argv[2]); - max_end_offset = atoi (argv[3]); - - if (max_end_offset < min_st_offset){ - if (!rank) - printf ("end offset %lld is less then start offset %lld\n", - max_end_offset, min_st_offset); - MPI_Finalize(); - return 1; - } - - printf ("min_st_offset = %lld\nmax_end_offset = %lld\n", - min_st_offset, max_end_offset); - - fd = (ADIO_File) ADIOI_Malloc (sizeof (struct ADIOI_FileD)); - fd->hints = (ADIOI_Hints *) - ADIOI_Malloc (sizeof(struct ADIOI_Hints_struct)); - fd->hints->cb_nodes = nprocs_for_coll; - ADIOI_Calc_file_realms (fd, min_st_offset, max_end_offset); - - for (i=0; i < nprocs_for_coll; i++) { - printf ("file_realm_st_offs[%d] = %lld\n", i, fd->file_realm_st_offs[i]); - } - for (i=0; i < nprocs_for_coll; i++) { - MPI_Type_size_x (fd->file_realm_types[i], &size); - printf ("file_realm [%d] size = %d\n", i, size); - } - for (i=0; i < nprocs_for_coll; i++) { - MPI_Type_get_extent (fd->file_realm_types[i], &lb, &extent); - printf ("file_realm [%d] extent = %d\n", i, extent); - } - - for (i=0; i < nprocs_for_coll; i++) - MPI_Type_free (&fd->file_realm_types[i]); - ADIOI_Free (fd->file_realm_st_offs); - ADIOI_Free (fd->file_realm_types); - ADIOI_Free (fd->hints); - ADIOI_Free (fd); - - MPI_Finalize(); - - return 0; -} diff --git a/3rd-party/romio321/test-internal/heap_test.c b/3rd-party/romio321/test-internal/heap_test.c deleted file mode 100644 index 2f0041df368..00000000000 --- a/3rd-party/romio321/test-internal/heap_test.c +++ /dev/null @@ -1,459 +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/include/heap-sort.h" -#include -#include -#include -#include - -#define PREDEF_TESTS 2 -/* test types */ -#define ALL 0 -#define RANDOM -1 -#define CUSTOM -2 - -/* ACTIONS */ -#define BUILD 0 -#define INSERT 1 -#define EXTRACT 2 -#define EXTRACT_INSERT 3 - -typedef struct { - char name[64]; - int heap_size; - int print; - int verify; - int action_arr_sz; - int *action_arr; - int *action_count_arr; - ADIO_Offset *offsets; - ADIO_Offset *correct_order; -} test_params_t; - -void print_usage(); -void print_keys(ADIO_Offset* offsets, int size); -void print_params(test_params_t *params); -int run_test(test_params_t *test); -void fill_random_test(test_params_t *params); -void init_predefined_test(test_params_t *params, int index); -void dumb_sort(test_params_t *params); - -int main(int argc, char **argv) { - int i, print = 1, verify = 1; - int adding_elements; - int curr_add_idx; - int test_type = RANDOM; - test_params_t predefined_tests[PREDEF_TESTS]; - test_params_t test; - - /* parse args */ - adding_elements = 0; - curr_add_idx = 0; - if (argc == 1) { - print_usage(); - return 1; - } - i = 1; - while (i < argc) { - if (!strcmp("-A", argv[i])) { - adding_elements = 0; - test_type = ALL; - i++; - } - else if (!strcmp("-T", argv[i])) { - adding_elements = 0; - test_type = atoi(argv[i+1]); - i += 2; - } - else if (!strcmp("-r", argv[i])) { - adding_elements = 0; - test.heap_size = atoi(argv[i+1]); - if (test.heap_size <= 0) { - printf("heap size should be a positive integer\n"); - return 1; - } - test.offsets = (ADIO_Offset *) malloc(test.heap_size*sizeof(ADIO_Offset)); - test_type = RANDOM; - i += 2; - } - else if (!strcmp("-e", argv[i])) { - test.heap_size = argc - 2; - if (test.heap_size <= 0) { - printf("need at least one key\n"); - return 1; - } - test.offsets = (ADIO_Offset *) malloc(test.heap_size*sizeof(ADIO_Offset)); - adding_elements = 1; - test_type = CUSTOM; - i++; - } - else if (!strcmp("-v", argv[i])) { - verify = 1; - i++; - } - else if (!strcmp("-p", argv[i])) { - print = 1; - i++; - } - else if (!strcmp("-V", argv[i])) { - verify = 0; - i++; - } - else if (!strcmp("-P", argv[i])) { - print = 0; - i++; - } - else if (adding_elements) { - test.offsets[curr_add_idx] = atoi(argv[i]); - curr_add_idx++; - i++; - } - else { - printf("Illegal argument: %s", argv[i]); - print_usage(); - return 1; - } - } - - if (test_type == RANDOM) { - fill_random_test(&test); - strcpy(test.name, "RANDOMIZED TEST"); - } - else if (test_type == CUSTOM) - strcpy(test.name, "CUSTOM TEST"); - if ((test_type == CUSTOM) || (test_type == RANDOM)) { - test.print = print; - test.verify = verify; - test.action_arr_sz = 2; - test.action_arr = (int *) malloc(test.action_arr_sz*sizeof(int)); - test.action_count_arr = (int *) malloc(test.action_arr_sz*sizeof(int)); - /* build the entire heap */ - /* test.action_arr[0] = BUILD; - test.action_count_arr[0] = 1; */ - /* insert keys one at a time */ - test.action_arr[0] = INSERT; - test.action_count_arr[0] = test.heap_size; - /* extract all the keys */ - test.action_arr[1] = EXTRACT; - test.action_count_arr[1] = test.heap_size; - - if (verify) { - test.correct_order = (ADIO_Offset *)malloc(test.heap_size*sizeof(ADIO_Offset)); - dumb_sort(&test); - } - if (print) - print_params(&test); - run_test(&test); - } - else { - if (test_type == ALL) { - for (i=0; i\n" - " -r Create a random test and verify of size \n" - " -e test with the space delimited list of keys\n" - " -p print parameters and keys (default)\n" - " -P do not print parameters and keys\n" - " -v verify keys (default)\n" - " -V do not verify keys\n" - ); -} - -void print_keys(ADIO_Offset *offsets, int size) { - int i; - for (i=0; i < size; i++) - printf("%lld ", offsets[i]); -} - -void print_params(test_params_t *params) { - int i; - static char action_map[3][8] = {"BUILD", "INSERT", "EXTRACT"}; - - printf("----------------Test Parameters---------------\n"); - printf("Actions:\n"); - for (i=0; iaction_arr_sz; i++) { - printf("%sx%d\n", action_map[params->action_arr[i]], - params->action_count_arr[i]); - } - - printf("Initial order :\n"); - print_keys(params->offsets, params->heap_size); - printf("\n"); - - if (params->verify) { - printf("Expected order:\n"); - print_keys(params->correct_order, params->heap_size); - printf("\n"); - } - printf("----------------------------------------------\n"); -} - -void fill_random_test(test_params_t *params) { - int i; - int max_key; - time_t seed; - int order = 0; - - time(&seed); - srand(seed); - - order = 0; - max_key = 1; - while (order < 25) { - max_key *= 10; - if (!((int) (params->heap_size / max_key))) - break; - order++; - } - for (i=0; i < params->heap_size; i++) - params->offsets[i] = (rand() % max_key); -} - -void dumb_sort(test_params_t *params) { - ADIO_Offset *offsets, tmp_offset; - int i, j; - - offsets = params->correct_order; - memcpy(offsets, params->offsets, params->heap_size*sizeof(ADIO_Offset)); - for (i=0; i < params->heap_size; i++) { - for (j=i; j < params->heap_size; j++) { - if (offsets[j] < offsets[i]) { - tmp_offset = offsets[i]; - offsets[i] = offsets[j]; - offsets[j] = tmp_offset; - } - } - } -} - -int run_test(test_params_t *test) { - heap_t myheap; - ADIO_Offset *extracted; - int stored_proc; - ADIO_Offset stored_reg_max_len; - int i, j, k, err_flag = 0; - int curr_insert_idx = 0; - int curr_extract_idx = 0; - - create_heap(&myheap, test->heap_size); - myheap.size = 0; - - extracted = (ADIO_Offset *) malloc(test->heap_size * sizeof(ADIO_Offset)); - for (i=0; i < test->action_arr_sz; i++) { - for (j=0; jaction_count_arr[i]; j++) { - switch (test->action_arr[i]) - { - case BUILD: - myheap.size = test->heap_size; - for (k=0; k < test->heap_size; k++) { - myheap.nodes[k].offset = test->offsets[k]; - myheap.nodes[k].proc = k; - } - build_heap(&myheap); - break; - case INSERT: - ADIOI_Heap_insert(&myheap, test->offsets[curr_insert_idx], - curr_insert_idx, curr_insert_idx); - curr_insert_idx++; - break; - case EXTRACT: - heap_extract_min(&myheap, &extracted[curr_extract_idx], - &stored_proc, &stored_reg_max_len); - if (test->verify && (extracted[curr_extract_idx] != - test->correct_order[curr_extract_idx])) - err_flag++; - curr_extract_idx++; - break; - case EXTRACT_INSERT: - heap_extract_min(&myheap, &extracted[curr_extract_idx], - &stored_proc, &stored_reg_max_len); - if (test->verify &&(extracted[curr_extract_idx] != - test->correct_order[curr_extract_idx])) - err_flag++; - curr_extract_idx++; - - ADIOI_Heap_insert(&myheap, test->offsets[curr_insert_idx], - curr_insert_idx, curr_insert_idx); - curr_insert_idx++; - break; - default: - break; - } - } - } - - if (test->verify) { - if (err_flag) { - printf("***%s FAILED***\n", test->name); - if (test->print) { - printf("Min extraction:\n"); - print_keys(extracted, test->heap_size); - printf("\n"); - } - } - else - printf("***%s PASSED***\n", test->name); - } - - free_heap(&myheap); - free(extracted); - /* clean up test params */ - free(test->offsets); - if (test->verify) - free(test->correct_order); - free(test->action_arr); - free(test->action_count_arr); - - return err_flag; -} - -void init_predefined_test(test_params_t *params, int index) { - - switch (index) - { - case 0: - strcpy(params->name, "TEST 1"); - params->heap_size = 15; - params->action_arr_sz = 3; - - /* allocate space */ - params->action_arr = - (int *) malloc (params->action_arr_sz*sizeof(int)); - params->action_count_arr = - (int *) malloc (params->action_arr_sz*sizeof(int)); - params->offsets = (ADIO_Offset *) malloc(params->heap_size*sizeof(ADIO_Offset)); - if (params->verify) - params->correct_order = - (ADIO_Offset *) malloc(params->heap_size*sizeof(ADIO_Offset)); - - /* Set procs */ - params->offsets[0] = 65; - params->offsets[1] = 53; - params->offsets[2] = 51; - params->offsets[3] = 74; - params->offsets[4] = 1; - params->offsets[5] = 3; - params->offsets[6] = 86; - params->offsets[7] = 82; - params->offsets[8] = 42; - params->offsets[9] = 62; - params->offsets[10] = 33; - params->offsets[11] = 12; - params->offsets[12] = 79; - params->offsets[13] = 13; - params->offsets[14] = 28; - - if (params->verify) { - params->correct_order[0] = 1; - params->correct_order[1] = 3; - params->correct_order[2] = 12; - params->correct_order[3] = 33; - params->correct_order[4] = 13; - params->correct_order[5] = 28; - params->correct_order[6] = 42; - params->correct_order[7] = 51; - params->correct_order[8] = 53; - params->correct_order[9] = 62; - params->correct_order[10] = 65; - params->correct_order[11] = 74; - params->correct_order[12] = 79; - params->correct_order[13] = 82; - params->correct_order[14] = 86; - } - - params->action_arr[0] = INSERT; - params->action_arr[1] = EXTRACT_INSERT; - params->action_arr[11] = EXTRACT; - - params->action_count_arr[0] = 10; - params->action_count_arr[1] = 5; - params->action_count_arr[11] = 10; - break; - case 1: - strcpy(params->name, "TEST 1"); - params->heap_size = 15; - params->action_arr_sz = 3; - - /* allocate space */ - params->action_arr = - (int *) malloc (params->action_arr_sz*sizeof(int)); - params->action_count_arr = - (int *) malloc (params->action_arr_sz*sizeof(int)); - params->offsets = (ADIO_Offset *) malloc(params->heap_size*sizeof(ADIO_Offset)); - if (params->verify) - params->correct_order = - (ADIO_Offset *) malloc(params->heap_size*sizeof(ADIO_Offset)); - - /* Set values */ - params->offsets[0] = 65; - params->offsets[1] = 53; - params->offsets[2] = 51; - params->offsets[3] = 74; - params->offsets[4] = 1; - params->offsets[5] = 3; - params->offsets[6] = 86; - params->offsets[7] = 82; - params->offsets[8] = 42; - params->offsets[9] = 62; - params->offsets[10] = 33; - params->offsets[11] = 12; - params->offsets[12] = 79; - params->offsets[13] = 13; - params->offsets[14] = 28; - - if (params->verify) { - params->correct_order[0] = 1; - params->correct_order[1] = 3; - params->correct_order[2] = 12; - params->correct_order[3] = 33; - params->correct_order[4] = 13; - params->correct_order[5] = 28; - params->correct_order[6] = 42; - params->correct_order[7] = 51; - params->correct_order[8] = 53; - params->correct_order[9] = 62; - params->correct_order[10] = 65; - params->correct_order[11] = 74; - params->correct_order[12] = 79; - params->correct_order[13] = 82; - params->correct_order[14] = 86; - } - - params->action_arr[0] = INSERT; - params->action_arr[1] = EXTRACT_INSERT; - params->action_arr[11] = EXTRACT; - - params->action_count_arr[0] = 10; - params->action_count_arr[1] = 5; - params->action_count_arr[11] = 10; - break; - default: - break; - } -} diff --git a/3rd-party/romio321/test-internal/io_bounds_test.c b/3rd-party/romio321/test-internal/io_bounds_test.c deleted file mode 100644 index f7514764e42..00000000000 --- a/3rd-party/romio321/test-internal/io_bounds_test.c +++ /dev/null @@ -1,302 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * Copyright (C) 2008 University of Chicago. - * See COPYRIGHT notice in top-level directory. - */ - -#include "../adio/include/adio.h" -#include "../adio/include/adioi.h" -#include "../adio/include/adio_extern.h" -#include "mpi.h" - -#define PREDEF_TESTS 5 -#define MAX_OFF_LENS 4 - -typedef struct { - ADIO_Offset offset; - int count; - int type_blocklens[MAX_OFF_LENS]; - int type_indices[MAX_OFF_LENS]; - MPI_Datatype type_oldtypes[MAX_OFF_LENS]; - int type_count; - - ADIO_Offset correct_st_offset; - ADIO_Offset correct_end_offset; -} test_param_t; - -int run_test (test_param_t *test); -int setup_predefined (test_param_t *tests_arr, int count); -int print_usage (void); -int print_test_params (test_param_t *test); - -int main (int argc, char **argv) { - int rank; - int run_test_number = 0; - int failed; - int while_condition; - int i; - - test_param_t predefined_tests[PREDEF_TESTS]; - - MPI_Init (&argc, &argv); - MPI_Comm_rank (MPI_COMM_WORLD, &rank); - - if (argc != 1) { - if (!rank) { - printf ("Use only one process\n"); - print_usage (); - } - MPI_Finalize(); - return 1; - } - i = 1; - while (i < argc) { - if (!strcmp (argv[i], "-A")) { - run_test_number = 0; - i++; - } - else if (!strcmp (argv[i], "-T")) { - run_test_number = atoi (argv[i+1]); - if ((run_test_number > PREDEF_TESTS) || (run_test_number < 1)) { - if (!rank) - printf ("Invalid test number, only %d tests\n", - PREDEF_TESTS); - MPI_Finalize (); - return 1; - } - i += 2; - } - else { - if (!rank) { - printf ("Invalid Argument: %s\n", argv[i]); - print_usage (); - } - i++; - } - } - - setup_predefined (predefined_tests, PREDEF_TESTS); - - if (!run_test_number) { - i = 0; - while_condition = PREDEF_TESTS; - } - else { - i = run_test_number - 1; - while_condition = run_test_number; - } - while (i < while_condition) { - printf ("***** Test %d *****\n", i+1); - failed = run_test (&predefined_tests[i]); - printf ("******************\n"); - i++; - } - - MPI_Finalize (); - - return 0; -} - -int run_test (test_param_t *test) { - ADIO_Offset st_offset, end_offset; - MPI_File fh; - int is_contig; - int ind_err = 0, exp_err = 0; - - MPI_Datatype filetype; - - MPI_Type_struct (test->type_count, test->type_blocklens, - test->type_indices, test->type_oldtypes, &filetype); - MPI_Type_commit (&filetype); - - MPI_File_open (MPI_COMM_WORLD, "test_file.txt" , MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - - MPI_File_set_view (fh, 0, MPI_BYTE, filetype, "native", MPI_INFO_NULL); - - MPI_File_seek (fh, test->offset, MPI_SEEK_SET); - ADIOI_Calc_bounds ((ADIO_File) fh, test->count, MPI_BYTE, ADIO_INDIVIDUAL, - test->offset, &st_offset, &end_offset); - - ind_err = 0; - if (st_offset != test->correct_st_offset) { - printf ("Individual st_offset = %lld end_offset = %lld\n", - st_offset, end_offset); - ind_err = 1; - } - if (end_offset != test->correct_end_offset) { - printf ("Individual st_offset = %lld end_offset = %lld\n", - st_offset, end_offset); - ind_err = 1; - } - MPI_File_close (&fh); - if (ind_err) - printf ("Individual Calc FAILED\n"); - - MPI_File_open (MPI_COMM_WORLD, "test_file.txt" , MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - - if (!is_contig) - MPI_File_set_view (fh, 0, MPI_BYTE, filetype, "native", MPI_INFO_NULL); - - MPI_File_seek (fh, 0, MPI_SEEK_SET); - ADIOI_Calc_bounds ((ADIO_File) fh, test->count, MPI_BYTE, - ADIO_EXPLICIT_OFFSET, test->offset, &st_offset, - &end_offset); - - exp_err = 0; - if (st_offset != test->correct_st_offset) { - printf ("Explicit st_offset = %lld end_offset = %lld\n", - st_offset, end_offset); - exp_err = 1; - } - if (end_offset != test->correct_end_offset) { - printf ("Explicit st_offset = %lld end_offset = %lld\n", - st_offset, end_offset); - exp_err = 1; - } - if (exp_err) - printf ("Explicit Calc FAILED\n"); - - MPI_File_close (&fh); - - if (!is_contig) - MPI_Type_free (&filetype); - - return (exp_err || ind_err); -} - -int print_usage () -{ - printf ( - "Usage:\n" - " io_bounds_test -A -T \n"); -} - -int print_test_params (test_param_t *test) -{ - int i; - printf ( - "I/O offset: %lld\n" - "bytes: %d\n" - "Filetype [n](disp, lens, type):\n", - test->offset, test->count); - - for (i=0; itype_count; i++) { - printf ( - " [%d](%lld, %d, ", - i, - test->type_blocklens[i], - test->type_indices[i]); - if (test->type_oldtypes[i] == MPI_BYTE) { - printf ( "%s)\n", "MPI_BYTE"); - } - else if (test->type_oldtypes[i] == MPI_UB) { - printf ( "%s)\n", "MPI_UB"); - } - else if (test->type_oldtypes[i] == MPI_LB) { - printf ( "%s)\n", "MPI_LB"); - } - } - printf ( - "Expected Start offset: %lld\n" - "Expected End offset: %lld\n", - test->correct_st_offset, - test->correct_end_offset); -} - -int setup_predefined (test_param_t *tests_arr, int count) -{ - int i; - for (i=0; i < PREDEF_TESTS; i++) { - switch (i) - { - case 0: - tests_arr[i].offset = 0; - tests_arr[i].count = 0; - tests_arr[i].type_count = 0; - tests_arr[i].type_indices[0] = 0; - tests_arr[i].type_blocklens[0] = 0; - tests_arr[i].type_oldtypes[0] = MPI_BYTE; - tests_arr[i].type_indices[1] = 0; - tests_arr[i].type_blocklens[1] = 0; - tests_arr[i].type_oldtypes[1] = MPI_BYTE; - tests_arr[i].type_indices[2] = 0; - tests_arr[i].type_blocklens[2] = 0; - tests_arr[i].type_oldtypes[2] = MPI_BYTE; - tests_arr[i].type_indices[3] = 0; - tests_arr[i].type_blocklens[3] = 0; - tests_arr[i].type_oldtypes[3] = MPI_BYTE; - break; - case 1: - tests_arr[i].offset = 0; - tests_arr[i].count = 0; - tests_arr[i].type_count = 0; - tests_arr[i].type_indices[0] = 0; - tests_arr[i].type_blocklens[0] = 0; - tests_arr[i].type_oldtypes[0] = MPI_BYTE; - tests_arr[i].type_indices[1] = 0; - tests_arr[i].type_blocklens[1] = 0; - tests_arr[i].type_oldtypes[1] = MPI_BYTE; - tests_arr[i].type_indices[2] = 0; - tests_arr[i].type_blocklens[2] = 0; - tests_arr[i].type_oldtypes[2] = MPI_BYTE; - tests_arr[i].type_indices[3] = 0; - tests_arr[i].type_blocklens[3] = 0; - tests_arr[i].type_oldtypes[3] = MPI_BYTE; - break; - case 2: - tests_arr[i].offset = 0; - tests_arr[i].count = 0; - tests_arr[i].type_count = 0; - tests_arr[i].type_indices[0] = 0; - tests_arr[i].type_blocklens[0] = 0; - tests_arr[i].type_oldtypes[0] = MPI_BYTE; - tests_arr[i].type_indices[1] = 0; - tests_arr[i].type_blocklens[1] = 0; - tests_arr[i].type_oldtypes[1] = MPI_BYTE; - tests_arr[i].type_indices[2] = 0; - tests_arr[i].type_blocklens[2] = 0; - tests_arr[i].type_oldtypes[2] = MPI_BYTE; - tests_arr[i].type_indices[3] = 0; - tests_arr[i].type_blocklens[3] = 0; - tests_arr[i].type_oldtypes[3] = MPI_BYTE; - break; - case 3: - tests_arr[i].offset = 0; - tests_arr[i].count = 0; - tests_arr[i].type_count = 0; - tests_arr[i].type_indices[0] = 0; - tests_arr[i].type_blocklens[0] = 0; - tests_arr[i].type_oldtypes[0] = MPI_BYTE; - tests_arr[i].type_indices[1] = 0; - tests_arr[i].type_blocklens[1] = 0; - tests_arr[i].type_oldtypes[1] = MPI_BYTE; - tests_arr[i].type_indices[2] = 0; - tests_arr[i].type_blocklens[2] = 0; - tests_arr[i].type_oldtypes[2] = MPI_BYTE; - tests_arr[i].type_indices[3] = 0; - tests_arr[i].type_blocklens[3] = 0; - tests_arr[i].type_oldtypes[3] = MPI_BYTE; - break; - case 4: - tests_arr[i].offset = 0; - tests_arr[i].count = 0; - tests_arr[i].type_count = 0; - tests_arr[i].type_indices[0] = 0; - tests_arr[i].type_blocklens[0] = 0; - tests_arr[i].type_oldtypes[0] = MPI_BYTE; - tests_arr[i].type_indices[1] = 0; - tests_arr[i].type_blocklens[1] = 0; - tests_arr[i].type_oldtypes[1] = MPI_BYTE; - tests_arr[i].type_indices[2] = 0; - tests_arr[i].type_blocklens[2] = 0; - tests_arr[i].type_oldtypes[2] = MPI_BYTE; - tests_arr[i].type_indices[3] = 0; - tests_arr[i].type_blocklens[3] = 0; - tests_arr[i].type_oldtypes[3] = MPI_BYTE; - break; - } - } - return 0; -} diff --git a/3rd-party/romio321/test/.codingcheck b/3rd-party/romio321/test/.codingcheck deleted file mode 100644 index 0d0a655fa81..00000000000 --- a/3rd-party/romio321/test/.codingcheck +++ /dev/null @@ -1,13 +0,0 @@ -# -# We allow these routines for the romio test programs -%romioTestRoutines = ( - 'printf' => sys, 'fprintf' => sys , 'sprintf' => sys, 'vprintf' => sys, - 'strcpy' => sys, 'strncpy' => sys, 'strcat' => sys, - 'malloc' => sys, 'free' => sys, 'calloc' => sys, 'strdup' => sys, - 'assert' => sys, 'snprintf' => sys, - ); -if (defined(&PushAllowFuncNames)) { - &PushAllowFuncNames( "romioTestRoutines", "tree", "add" ); -} - -1; diff --git a/3rd-party/romio321/test/Makefile.am b/3rd-party/romio321/test/Makefile.am deleted file mode 100644 index 5e2e0240856..00000000000 --- a/3rd-party/romio321/test/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -# -*- Mode: Makefile; -*- -# -# (C) 2011 by Argonne National Laboratory. -# See COPYRIGHT in top-level directory. -# - -# This directory is only listed in DIST_SUBDIRS, not SUBDIRS, so its contents -# will not be built by default, but it will participate in "make distclean" and -# friends. - -# override the normal compilers for the tests -CC = $(TEST_CC) -F77 = $(TEST_F77) - -# because := is not universally avalible, we have to play games to use the -# user-specified LDFLAGS and OUR_LIBS env. variables (if set) -OUR_LIBS = $(TEST_LIBNAME) $(MPI_LIB) - -LDADD = $(OUR_LIBS) - -AM_CPPFLAGS = $(ROMIO_INCLUDE) -AM_CFLAGS = $(USER_CFLAGS) -AM_FFLAGS = $(USER_FFLAGS) - -CTESTS = simple perf async coll_test coll_perf misc file_info excl large_array \ - atomicity noncontig i_noncontig noncontig_coll split_coll shared_fp \ - large_file psimple error status noncontig_coll2 aggregation1 aggregation2 \ - async-multiple ordered_fp hindexed external32 types_with_zeros darray_read -FTESTS = fcoll_test fperf fmisc pfcoll_test - - -noinst_PROGRAMS = $(CTESTS) - -if BUILD_F77_TESTS - -noinst_PROGRAMS += $(FTESTS) -fperf_SOURCES = fperf.f -fcoll_test_SOURCES = fcoll_test.f -fmisc_SOURCES = fmisc.f -pfcoll_test_SOURCES = pfcoll_test.f - -endif BUILD_F77_TESTS diff --git a/3rd-party/romio321/test/Mfile.in b/3rd-party/romio321/test/Mfile.in deleted file mode 100644 index c2e1c298259..00000000000 --- a/3rd-party/romio321/test/Mfile.in +++ /dev/null @@ -1,84 +0,0 @@ -ALL: default - -# This is a special Makefile.in source for use by the test suite (see the -# configure in examples/test) -##### User configurable options ##### - -MPIR_HOME = @MPIR_HOME@ -CC = @MPICC@ -CLINKER = @MPICC@ -CCC = @MPICPLUSPLUS@ -CCLINKER = $(CCC) -F77 = @MPIF77@ -F90BASE = @MPIF90BASE@ -F90 = @MPIF90@ -FLINKER = @MPIF77@ -OPTFLAGS = @OPTFLAGS@ -MPIFDEP = @MPIFDEP@ -### End User configurable options ### - -SHELL = /bin/sh -prefix = @prefix@ -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ -@VPATH@ - -PROFLIB = -CFLAGS = @CFLAGS@ @DEFS@ $(OPTFLAGS) -CCFLAGS = $(CFLAGS) -FFLAGS = $(OPTFLAGS) @FFLAGS@ -# Use LIBS to add any special libraries for C programs -LIBS = @LIB_PATH@ @LIB_LIST@ -# Use FLIBS to add any special libraries for Fortran programs -FLIBS = @FLIB_PATH@ @LIB_LIST@ @F77EXTRALIBS@ -EXECS = $(CTESTS) $(FTESTS) -OTHEREXECS = -CTESTS = simple perf async coll_test coll_perf misc file_info excl \ - large_array \ - atomicity noncontig i_noncontig noncontig_coll split_coll shared_fp \ - large_file psimple error status noncontig_coll2 -FTESTS = fcoll_test fperf fmisc pfcoll_test - -default: $(EXECS) - -# -# Note that runtests builds the executables as required -testing: - -./runtests $(TESTARGS) - -all: testing - -fortran_tests: $(FTESTS) -# -# The Fortran tests must be built with the Fortran linker -fperf: fperf.f - $(F77) $(USER_FFLAGS) -o $@ $< $(FLIBS) - -# Some of the Fortran tests must be derived, so their code will be in the -# LOCAL directory -fcoll_test: fcoll_test.f - $(F77) $(USER_FFLAGS) -o fcoll_test fcoll_test.f $(FLIBS) - -fmisc: fmisc.f - $(F77) $(USER_FFLAGS) -o fmisc fmisc.f $(FLIBS) - -pfcoll_test: pfcoll_test.f - $(F77) $(USER_FFLAGS) -o pfcoll_test pfcoll_test.f $(FLIBS) - -# -# Make sure that we remove executables for specific architectures -clean: - @-rm -f *.o *~ PI* $(EXECS) *.out core pt2pt.diff $(OTHEREXECS) \ - *.trace rdb.* startup.* mpif.h ${srcdir}/*.o *.stdo - @-rm -f work.pc work.pcl - @-for file in $(EXECS) Makefile ; do \ - rm -f $$file.sun4 $$file.alpha $$file.IRIX $$file.freebsd ;\ - done -.c: - $(CC) $(CFLAGS) -o $* $< $(LIBS) -.c.o: - $(CC) $(CFLAGS) -c $< -.o: - ${CLINKER} $(OPTFLAGS) -o $* $*.o $(LIBS) -.f.o: - $(F77) $(FFLAGS) -c $< diff --git a/3rd-party/romio321/test/README b/3rd-party/romio321/test/README deleted file mode 100644 index dbab8e393d4..00000000000 --- a/3rd-party/romio321/test/README +++ /dev/null @@ -1,84 +0,0 @@ -This directory contains a few example programs. - -Each program takes the filename as a command-line argument -"-fname filename". - -If you are using "mpirun" to run an MPI program, you can run the -program "simple" with two processes as follows: - mpirun -np 2 simple -fname test - - -simple.c: Each process creates its own file, writes to it, reads it - back, and checks the data read. - -psimple.c: Same as simple.c but uses the PMPI versions of all MPI routines - -error.c: Tests if error messages are printed correctly - -status.c: Tests if the status object is filled correctly by I/O functions - -perf.c: A simple read and write performance test. Each process writes - 4Mbytes to a file at a location determined by its rank and - reads it back. For a different access size, change the value - of SIZE in the code. The bandwidth is reported for two cases: - (1) without including MPI_File_sync and (2) including - MPI_File_sync. - -async.c: This program is the same as simple.c, except that it uses - asynchronous I/O. - -coll_test.c: This program tests the use of collective I/O. It writes - a 3D block-distributed array to a file corresponding to the - global array in row-major (C) order, reads it back, and checks - that the data read is correct. The global array size has been - set to 32^3. If you are running it on NFS, which is very slow, - you may want to reduce that size to 16^3. - -coll_perf.c: Measures the I/O bandwidth for writing/reading a 3D - block-distributed array to a file corresponding to the global array - in row-major (C) order. The global array size has been - set to 128^3. If you are running it on NFS, which is very slow, - you may want to reduce that size to 16^3. - -misc.c: Tests various miscellaneous MPI-IO functions - -atomicity.c: Tests whether atomicity semantics are satisfied for - overlapping accesses in atomic mode. The probability of detecting - errors is higher if you run it on 8 or more processes. - -large_file.c: Tests access to large files. Writes a 4-Gbyte file and - reads it back. Run it only on one process and on a file system - on which ROMIO supports large files. - -large_array.c: Tests writing and reading a 4-Gbyte distributed array using - the distributed array datatype constructor. Works only on file - systems that support 64-bit file sizes and MPI implementations - that support 64-bit MPI_Aint. - -file_info.c: Tests the setting and retrieval of hints via - MPI_File_set_info and MPI_File_get_info - -excl.c: Tests MPI_File_open with MPI_MODE_EXCL - -noncontig.c: Tests noncontiguous accesses in memory and file using - independent I/O. Run it on two processes only. - -noncontig_coll.c: Same as noncontig.c, but uses collective I/O - -noncontig_coll2.c: Same as noncontig_coll.c, but exercises the - cb_config_list hint and aggregation handling more. - -i_noncontig.c: Same as noncontig.c, but uses nonblocking I/O - -shared_fp.c: Tests the shared file pointer functions - -split_coll.c: Tests the split collective I/O functions - -fperf.f: Fortran version of perf.c - -fcoll_test.f: Fortran version of coll_test.c - -pfcoll_test.f: Same as fcoll_test.f but uses the PMPI versions of - all MPI routines - -fmisc.f: Fortran version of misc.c diff --git a/3rd-party/romio321/test/aggregation1.c b/3rd-party/romio321/test/aggregation1.c deleted file mode 100644 index dee42d60a5c..00000000000 --- a/3rd-party/romio321/test/aggregation1.c +++ /dev/null @@ -1,266 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2007 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -/* Test case from John Bent (ROMIO req #835) - * Aggregation code was not handling certain access patterns when collective - * buffering forced */ -#define _XOPEN_SOURCE 500 /* strdup not in string.h otherwsie */ -#include -#include -#include -#include -#include - -#define NUM_OBJS 4 -#define OBJ_SIZE 1048576 - -extern char *optarg; -extern int optind, opterr, optopt; - - -char *prog = NULL; -int debug = 0; - -static void -Usage( int line ) { - int rank; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - if ( rank == 0 ) { - fprintf( stderr, - "Usage (line %d): %s [-d] [-h] -f filename\n" - "\t-d for debugging\n" - "\t-h to turn on the hints to force collective aggregation\n", - line, prog ); - } - exit( 0 ); -} - -static void -fatal_error( int mpi_ret, MPI_Status *mpi_stat, const char *msg ) { - fprintf( stderr, "Fatal error %s: %d\n", msg, mpi_ret ); - MPI_Abort( MPI_COMM_WORLD, -1 ); -} - -static void -print_hints( int rank, MPI_File *mfh ) { - MPI_Info info; - int nkeys; - int i, dummy_int; - char key[1024]; - char value[1024]; - - MPI_Barrier( MPI_COMM_WORLD ); - if ( rank == 0 ) { - MPI_File_get_info( *mfh, &info ); - MPI_Info_get_nkeys( info, &nkeys ); - - printf( "HINTS:\n" ); - for( i = 0; i < nkeys; i++ ) { - MPI_Info_get_nthkey( info, i, key ); - printf( "%35s -> ", key ); - MPI_Info_get( info, key, 1024, value, &dummy_int ); - printf( "%s\n", value ); - } - MPI_Info_free(&info); - } - MPI_Barrier( MPI_COMM_WORLD ); -} - -static void -fill_buffer( char *buffer, int bufsize, int rank, MPI_Offset offset ) { - memset( (void*)buffer, 0, bufsize ); - snprintf( buffer, bufsize, "Hello from %d at %lld\n", rank, offset ); -} - -static MPI_Offset -get_offset( int rank, int num_objs, int obj_size, int which_obj ) { - MPI_Offset offset; - offset = (MPI_Offset)rank * num_objs * obj_size + which_obj * obj_size; - return offset; -} - -static void -write_file( char *target, int rank, MPI_Info *info ) { - MPI_File wfh; - MPI_Status mpi_stat; - int mpi_ret; - int i; - char *buffer; - - buffer = malloc(OBJ_SIZE); - - if ( debug ) printf( "%d writing file %s\n", rank, target ); - - if( (mpi_ret = MPI_File_open(MPI_COMM_WORLD, target, - MPI_MODE_WRONLY | MPI_MODE_CREATE, *info, &wfh ) ) - != MPI_SUCCESS ) - { - fatal_error( mpi_ret, NULL, "open for write" ); - } - - for( i = 0; i < NUM_OBJS; i++ ) { - MPI_Offset offset = get_offset( rank, NUM_OBJS, OBJ_SIZE, i ); - fill_buffer( buffer, OBJ_SIZE, rank, offset ); - if ( debug ) printf( "%s", buffer ); - if ( (mpi_ret = MPI_File_write_at_all( wfh, offset, buffer, OBJ_SIZE, - MPI_CHAR, &mpi_stat ) ) != MPI_SUCCESS ) - { - fatal_error( mpi_ret, &mpi_stat, "write" ); - } - } - - if ( debug ) print_hints( rank, &wfh ); - - if( (mpi_ret = MPI_File_close( &wfh ) ) != MPI_SUCCESS ) { - fatal_error( mpi_ret, NULL, "close for write" ); - } - if ( debug ) printf( "%d wrote file %s\n", rank, target ); - free(buffer); -} - -static int -reduce_corruptions( int corrupt_blocks ) { - int mpi_ret; - int sum; - if ( ( mpi_ret = MPI_Reduce( &corrupt_blocks, &sum, 1, - MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD ) ) != MPI_SUCCESS ) - { - fatal_error( mpi_ret, NULL, "MPI_Reduce" ); - } - return sum; -} - -static void -read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) { - MPI_File rfh; - MPI_Status mpi_stat; - int mpi_ret; - int i; - char *buffer; - char *verify_buf = NULL; - buffer = malloc(OBJ_SIZE); - verify_buf = (char *)malloc(OBJ_SIZE); - - if ( debug ) printf( "%d reading file %s\n", rank, target ); - - if( (mpi_ret = MPI_File_open(MPI_COMM_WORLD, target, - MPI_MODE_RDONLY, *info, &rfh ) ) != MPI_SUCCESS ) - { - fatal_error( mpi_ret, NULL, "open for read" ); - } - - for( i = 0; i < NUM_OBJS; i++ ) { - MPI_Offset offset = get_offset( rank, NUM_OBJS, OBJ_SIZE, i ); - fill_buffer( verify_buf, OBJ_SIZE, rank, offset ); - if ( debug ) printf( "Expecting %s", buffer ); - if ( (mpi_ret = MPI_File_read_at_all( rfh, offset, buffer, OBJ_SIZE, - MPI_CHAR, &mpi_stat ) ) != MPI_SUCCESS ) - { - fatal_error( mpi_ret, &mpi_stat, "read" ); - } - if ( memcmp( verify_buf, buffer, OBJ_SIZE ) != 0 ) { - (*corrupt_blocks)++; - printf( "Corruption at %lld\n", offset ); - if ( debug ) { - printf( "\tExpecting %s\n" - "\tRecieved %s\n", - verify_buf, buffer ); - } - } - } - - if( (mpi_ret = MPI_File_close( &rfh ) ) != MPI_SUCCESS ) { - fatal_error( mpi_ret, NULL, "close for read" ); - } - free (buffer); - free(verify_buf); - -} - -static void -set_hints( MPI_Info *info ) { - MPI_Info_set( *info, "romio_cb_write", "enable" ); - MPI_Info_set( *info, "romio_no_indep_rw", "1" ); - MPI_Info_set( *info, "cb_nodes", "1" ); - MPI_Info_set( *info, "cb_buffer_size", "4194304" ); -} - -/* -void -set_hints( MPI_Info *info, char *hints ) { - char *delimiter = " "; - char *hints_cp = strdup( hints ); - char *key = strtok( hints_cp, delimiter ); - char *val; - while( key ) { - val = strtok( NULL, delimiter ); - if ( debug ) printf( "HINT: %s = %s\n", key, val ); - if ( ! val ) { - Usage( __LINE__ ); - } - MPI_Info_set( *info, key, val ); - key = strtok( NULL, delimiter ); - } - free( hints_cp ); -} -*/ - -int -main( int argc, char *argv[] ) { - int nproc = 1, rank = 0; - char *target = NULL; - int c; - MPI_Info info; - int mpi_ret; - int corrupt_blocks = 0; - - MPI_Init( &argc, &argv ); - MPI_Comm_size(MPI_COMM_WORLD, &nproc); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - if( (mpi_ret = MPI_Info_create(&info)) != MPI_SUCCESS) { - if(rank == 0) fatal_error( mpi_ret, NULL, "MPI_info_create.\n"); - } - - prog = strdup( argv[0] ); - - while( ( c = getopt( argc, argv, "df:h" ) ) != EOF ) { - switch( c ) { - case 'd': - debug = 1; - break; - case 'f': - target = strdup( optarg ); - break; - case 'h': - set_hints( &info ); - break; - default: - Usage( __LINE__ ); - } - } - if ( ! target ) { - Usage( __LINE__ ); - } - - write_file( target, rank, &info ); - read_file( target, rank, &info, &corrupt_blocks ); - - corrupt_blocks = reduce_corruptions( corrupt_blocks ); - if ( rank == 0 ) { - if (corrupt_blocks == 0) { - fprintf(stdout, " No Errors\n"); - } else { - fprintf(stdout, "%d/%d blocks corrupt\n", - corrupt_blocks, nproc * NUM_OBJS ); - } - } - MPI_Info_free(&info); - - MPI_Finalize(); - free(prog); - exit( 0 ); -} diff --git a/3rd-party/romio321/test/aggregation2.c b/3rd-party/romio321/test/aggregation2.c deleted file mode 100644 index a35ebe0caf5..00000000000 --- a/3rd-party/romio321/test/aggregation2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2007 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -/* Look for regressions in aggregator code. A more simple access pattern than - * aggregation1 */ - -#include - -#include -#include -#include - -#include -#include - -#include - -#define BUFSIZE 512 - -static void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -int main(int argc, char ** argv) -{ - MPI_Info info = MPI_INFO_NULL; - MPI_File fh; - MPI_Offset off=0; - MPI_Status status; - int errcode; - int i, rank, errs=0, toterrs, buffer[BUFSIZE], buf2[BUFSIZE]; - - MPI_Init(&argc, &argv); - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - MPI_Info_create(&info); - MPI_Info_set(info, "romio_cb_write", "enable"); - MPI_Info_set(info, "cb_nodes", "1"); - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - MPI_Info_free(&info); - MPI_Finalize(); - - return 0; -} diff --git a/3rd-party/romio321/test/async-multiple.c b/3rd-party/romio321/test/async-multiple.c deleted file mode 100644 index ec9726ce55d..00000000000 --- a/3rd-party/romio321/test/async-multiple.c +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- - * vim: ts=8 sts=4 sw=4 noexpandtab - * - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -#define SIZE (65536) -#define NR_NBOPS (32) - -/* Uses asynchronous I/O. Each process writes to separate files and - reads them back. The file name is taken as a command-line argument, - and the process rank is appended to it.*/ - -void handle_error(int errcode, const char *str); - -void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} -int main(int argc, char **argv) -{ - int *buf, i, rank, nints, len; - char *filename, *tmp; - int errs=0, toterrs; - MPI_File fh; - MPI_Status status[NR_NBOPS]; - MPI_Request request[NR_NBOPS]; - int errcode = 0; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: async -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - buf = (int *) malloc(SIZE); - nints = SIZE/sizeof(int); - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - free(buf); - free(filename); - free(tmp); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/async.c b/3rd-party/romio321/test/async.c deleted file mode 100644 index 8882716dfed..00000000000 --- a/3rd-party/romio321/test/async.c +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -#define SIZE (65536) - -/* Uses asynchronous I/O. Each process writes to separate files and - reads them back. The file name is taken as a command-line argument, - and the process rank is appended to it.*/ - -void handle_error(int errcode, const char *str); - -void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} -int main(int argc, char **argv) -{ - int *buf, i, rank, nints, len; - char *filename, *tmp; - int errs=0, toterrs; - MPI_File fh; - MPI_Status status; - MPIO_Request request; - int errcode = 0; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: async -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - buf = (int *) malloc(SIZE); - nints = SIZE/sizeof(int); - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - free(buf); - free(filename); - free(tmp); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/atomicity.c b/3rd-party/romio321/test/atomicity.c deleted file mode 100644 index 7797075ed95..00000000000 --- a/3rd-party/romio321/test/atomicity.c +++ /dev/null @@ -1,210 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* tests whether atomicity semantics are satisfied for overlapping accesses - in atomic mode. The probability of detecting errors is higher if you run - it on 8 or more processes. */ - -/* The file name is taken as a command-line argument. */ - -#define BUFSIZE 10000 /* no. of integers */ -#define VERBOSE 0 -int main(int argc, char **argv) -{ - int *writebuf, *readbuf, i, mynod, nprocs, len, err; - char *filename; - int errs=0, toterrs; - MPI_Datatype newtype; - MPI_File fh; - MPI_Status status; - MPI_Info info; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: coll_test -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - writebuf = (int *) malloc(BUFSIZE*sizeof(int)); - readbuf = (int *) malloc(BUFSIZE*sizeof(int)); - -/* test atomicity of contiguous accesses */ - -/* initialize file to all zeros */ - if (!mynod) { - MPI_File_delete(filename, MPI_INFO_NULL); - MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE | - MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - MPI_Type_free(&newtype); - MPI_Info_free(&info); - free(writebuf); - free(readbuf); - free(filename); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/big_extents.c b/3rd-party/romio321/test/big_extents.c deleted file mode 100644 index a1a9e5ff68b..00000000000 --- a/3rd-party/romio321/test/big_extents.c +++ /dev/null @@ -1,212 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2007 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -/* a test to exercise very large extents: on most platforms with 32 bit - * integers, we'd expect these tests to give unexpected values. On platforms - * with 64 bit integers, these tests will be fine. On BlueGene we're not sure - * yet :> - */ - - -#include -#include -#include -#include - -#define CHECK(fn) {int errcode; errcode = (fn); if (errcode != MPI_SUCCESS) handle_error(errcode, NULL); } - - -static void handle_error(int errcode, char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -static void typestats(MPI_Datatype type) -{ - MPI_Aint lb, extent; - MPI_Count size; - - MPI_Type_get_extent(type, &lb, &extent); - MPI_Type_size_x(type, &size); - - printf("dtype %d: lb = %ld extent = %ld size = %ld...", - type, (long)lb, (long)extent, size); - -} - -static int verify_type(char *filename, MPI_Datatype type, - int64_t expected_extent, int do_coll) -{ - int rank, canary; - MPI_Count tsize; - int compare=-1; - int errs=0, toterrs=0; - MPI_Status status; - MPI_File fh; - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - CHECK( MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_CREATE|MPI_MODE_RDWR, MPI_INFO_NULL, &fh)); - CHECK( MPI_File_set_view(fh, rank*sizeof(int), - MPI_BYTE, type, "native", MPI_INFO_NULL)); - - MPI_Type_size_x(type, &tsize); - - canary=rank+1000000; - - /* skip over first instance of type */ - if (do_coll) { - CHECK( MPI_File_write_at_all(fh, tsize, &canary, 1, MPI_INT, &status)); - } else { - CHECK( MPI_File_write_at(fh, tsize, &canary, 1, MPI_INT, &status)); - } - - CHECK( MPI_File_set_view(fh, 0, MPI_INT, MPI_INT, "native", - MPI_INFO_NULL)); - - if (do_coll) { - CHECK( MPI_File_read_at_all(fh, expected_extent/sizeof(int)+rank, - &compare, 1, MPI_INT, &status)); - } else { - CHECK( MPI_File_read_at(fh, expected_extent/sizeof(int)+rank, - &compare, 1, MPI_INT, &status)); - } - - if (compare != canary) - errs=1; - MPI_Allreduce(&errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - - MPI_File_close(&fh); - - if (toterrs) { - printf("%d: got %d expected %d\n", rank, compare, canary); - /* keep file if there's an error */ - } else { - if (rank == 0) MPI_File_delete(filename, MPI_INFO_NULL); - } - - return (toterrs); - -} - -static int testtype(char *filename, MPI_Datatype type, int64_t expected_extent) -{ - int rank, ret, errs=0; - int collective=1, nocollective=0; - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - if (!rank) typestats(type); - - ret = verify_type(filename, type, expected_extent, nocollective); - if (ret) { - errs++; - fprintf(stderr, "type %d failed indep\n", type); - } else - if (!rank) printf("indep: OK "); - - ret = verify_type(filename, type, expected_extent, collective); - if (ret) { - errs++; - fprintf(stderr, "type %d failed collective\n", type); - } else - if (!rank) printf("coll: OK\n"); - - return errs; -} - -int main(int argc, char **argv) -{ - int count=2; - int blocks[2]; - int disps[2]; - - int ndims=2; - int sizes[2]; - int subs[2]; - int starts[2]; - - MPI_Datatype baseindex, indexed1G, indexed3G, indexed6G; - MPI_Datatype subarray1G, subarray3G, subarray6G; - int ret, rank; - - MPI_Init(&argc, &argv); - - if (argc != 2) { - fprintf(stderr, "usage: %s \n", argv[0]); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - /* base type: 1MB indexed type of ints*/ - count = 2; - blocks[0] = 1; - disps[0] = 0; - blocks[1] = 1; - disps[1] = 1024*256-1; - - MPI_Type_indexed(count, blocks, disps, MPI_INT, &baseindex); - /* simple case: 1GB extent */ - MPI_Type_contiguous(1024, baseindex, &indexed1G); - MPI_Type_commit(&indexed1G); - - /* a little trickier: 3Gb extent */ - MPI_Type_contiguous(3072, baseindex, &indexed3G); - MPI_Type_commit(&indexed3G); - - /* and finally 6GB extent */ - MPI_Type_contiguous(6144, baseindex, &indexed6G); - MPI_Type_commit(&indexed6G); - - /* TODO: - * - add a darray test - * - add a test with crazy extents */ - sizes[0] = 1024*16; - sizes[1] = 1024*16; - subs[0] = subs[1] = 256; - starts[0] = starts[1] = 0; - - MPI_Type_create_subarray(ndims, sizes, subs, starts, - MPI_ORDER_C, MPI_INT, &subarray1G); - MPI_Type_commit(&subarray1G); - - sizes[1] = 1024*16*3; - MPI_Type_create_subarray(ndims, sizes, subs, starts, - MPI_ORDER_C, MPI_INT, &subarray3G); - MPI_Type_commit(&subarray3G); - - sizes[1] = 1024*16*6; - MPI_Type_create_subarray(ndims, sizes, subs, starts, - MPI_ORDER_C, MPI_INT, &subarray6G); - MPI_Type_commit(&subarray6G); - - /* assume command line arguments make it out to all processes */ - ret = testtype(argv[1], indexed1G, (int64_t)1024*1024*1024); - - ret = testtype(argv[1], indexed3G, (int64_t)1024*1024*1024*3); - - ret = testtype(argv[1], indexed6G, (int64_t)1024*1024*1024*6); - - ret = testtype(argv[1], subarray1G, (int64_t)1024*1024*1024); - - ret = testtype(argv[1], subarray3G, (int64_t)1024*1024*1024*3); - - ret = testtype(argv[1], subarray6G, (int64_t)1024*1024*1024*6); - - if(!ret && !rank) fprintf(stderr, " No Errors\n"); - - MPI_Finalize(); - return (-ret); - -} -/* - * vim: ts=8 sts=4 sw=4 noexpandtab - */ diff --git a/3rd-party/romio321/test/coll_perf.c b/3rd-party/romio321/test/coll_perf.c deleted file mode 100644 index 0f9042d5ff5..00000000000 --- a/3rd-party/romio321/test/coll_perf.c +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* The file name is taken as a command-line argument. */ - -/* Measures the I/O bandwidth for writing/reading a 3D - block-distributed array to a file corresponding to the global array - in row-major (C) order. - Note that the file access pattern is noncontiguous. - - Array size 128^3. For other array sizes, change array_of_gsizes below.*/ - - -int main(int argc, char **argv) -{ - MPI_Datatype newtype; - int i, ndims, array_of_gsizes[3], array_of_distribs[3]; - int order, nprocs, len, *buf, mynod; - MPI_Count bufcount; - int array_of_dargs[3], array_of_psizes[3]; - MPI_File fh; - MPI_Status status; - double stim, write_tim, new_write_tim, write_bw; - double read_tim, new_read_tim, read_bw; - char *filename; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: coll_perf -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - ndims = 3; - order = MPI_ORDER_C; - - array_of_gsizes[0] = 128*17; - array_of_gsizes[1] = 128*9; - array_of_gsizes[2] = 128*11; - - array_of_distribs[0] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[1] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[2] = MPI_DISTRIBUTE_BLOCK; - - array_of_dargs[0] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[1] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[2] = MPI_DISTRIBUTE_DFLT_DARG; - - for (i=0; i -#include -#include - -/* A 32^3 array. For other array sizes, change array_of_gsizes below. */ - -/* Uses collective I/O. Writes a 3D block-distributed array to a file - corresponding to the global array in row-major (C) order, reads it - back, and checks that the data read is correct. */ - -/* The file name is taken as a command-line argument. */ - -/* Note that the file access pattern is noncontiguous. */ - -void handle_error(int errcode, const char *str); - -void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -int main(int argc, char **argv) -{ - MPI_Datatype newtype; - int i, ndims, array_of_gsizes[3], array_of_distribs[3]; - int order, nprocs, j, len; - int array_of_dargs[3], array_of_psizes[3]; - int *readbuf, *writebuf, mynod, *tmpbuf, array_size; - MPI_Count bufcount; - char *filename; - int errs=0, toterrs; - MPI_File fh; - MPI_Status status; - MPI_Request request; - MPI_Info info = MPI_INFO_NULL; - int errcode; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: coll_test -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - -/* create the distributed array filetype */ - ndims = 3; - order = MPI_ORDER_C; - - array_of_gsizes[0] = 32; - array_of_gsizes[1] = 32; - array_of_gsizes[2] = 32; - - array_of_distribs[0] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[1] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[2] = MPI_DISTRIBUTE_BLOCK; - - array_of_dargs[0] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[1] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[2] = MPI_DISTRIBUTE_DFLT_DARG; - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - MPI_Type_free(&newtype); - free(readbuf); - free(writebuf); - free(filename); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/creat_excl.c b/3rd-party/romio321/test/creat_excl.c deleted file mode 100644 index 858df00e8a1..00000000000 --- a/3rd-party/romio321/test/creat_excl.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include -/* - * the new defered open code made some changes to the way we manage CREAT|EXCL, - * so test out that code path */ - -struct options { - char *fname; - int verbose; - int do_aggregation; -}; -typedef struct options options; - - -void handle_error(int errcode, char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -void parse_args(int argc, char ** argv, int rank, options *opts) -{ - int i, len=0; - if (rank == 0) { - i = 1; - while (i < argc) { - if (strcmp("-fname", argv[i]) == 0) { - len = strlen(argv[i+1]); - opts->fname = (char *) malloc(len + 1); - strcpy(opts->fname, argv[i+1]); - i+=2;/* option and argument */ - continue; - } - if (strcmp("-aggregate", argv[i]) == 0) { - opts->do_aggregation = 1; - i++; - continue; - } - if (strcmp("-verbose", argv[i]) == 0) { - opts->verbose = 1; - i++; - continue; - } - } - if (opts->fname == NULL) { /* didn't get a filename */ - fprintf(stderr, "Usage: %s -fname filename [-aggregate] [-verbose]\n", argv[0]); - MPI_Abort(MPI_COMM_WORLD, 1); - } - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(opts->fname, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - MPI_Bcast(&(opts->do_aggregation), 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&(opts->verbose), 1, MPI_INT, 0, MPI_COMM_WORLD); - } else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - opts->fname = (char *) malloc(len + 1); - MPI_Bcast(opts->fname, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - MPI_Bcast(&(opts->do_aggregation), 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&(opts->verbose), 1, MPI_INT, 0, MPI_COMM_WORLD); - } - -} - -int main(int argc, char ** argv) { - int nprocs, mynod, errcode; - options my_options = {NULL, 0, 0}; - MPI_File fh; - MPI_Status status; - MPI_Info info; - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - parse_args(argc, argv, mynod, &my_options); - - if (my_options.do_aggregation) { - MPI_Info_create(&info); - MPI_Info_set(info, "romio_no_indep_rw", "true"); - MPI_Info_set(info, "cb_config_list", "leela.mcs.anl.gov:1"); - } else { - info = MPI_INFO_NULL; - } - - /* create the file w/o EXCL: this must not fail */ - errcode = MPI_File_open(MPI_COMM_WORLD, my_options.fname, - MPI_MODE_CREATE|MPI_MODE_RDWR, info, &fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_open"); - } - - errcode = MPI_File_close(&fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_close"); - } - - /* now try to open w/ CREAT|EXCL: this must fail */ - errcode = MPI_File_open(MPI_COMM_WORLD, my_options.fname, - MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_RDWR, info, &fh); - if (errcode == MPI_SUCCESS) { - handle_error(errcode, "MPI_File_open: expected an error: got"); - } - - /* ignore the error: File_delete is not aggregator-aware */ - MPI_File_delete(my_options.fname, info); - - /* this must succeed: the file no longer exists */ - errcode = MPI_File_open(MPI_COMM_WORLD, my_options.fname, - MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_RDWR, info, &fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_open"); - } - - errcode = MPI_File_close(&fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_close"); - } - - if (mynod == 0) { - printf(" No Errors\n"); - } - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/darray_read.c b/3rd-party/romio321/test/darray_read.c deleted file mode 100644 index 7b8e4c59e8c..00000000000 --- a/3rd-party/romio321/test/darray_read.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include -#include -#include - -#define NSIDE 5 -#define NBLOCK 3 -#define NPROC 2 - -#define CHECK(fn) {int errcode; errcode = (fn); if (errcode != MPI_SUCCESS) handle_error(errcode, #fn);} - -static void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - - -int main(int argc, char *argv[]) -{ - int i, j, nerrors=0, total_errors=0; - - int rank, size; - int bpos; - - MPI_Datatype darray; - MPI_Status status; - MPI_File mpi_fh; - - /* Define array distribution - A 2x2 block size works with ROMIO, a 3x3 block size breaks it. */ - int distrib[2] = { MPI_DISTRIBUTE_CYCLIC, MPI_DISTRIBUTE_CYCLIC }; - int bsize[2] = { NBLOCK, NBLOCK }; - int gsize[2] = { NSIDE, NSIDE }; - int psize[2] = { NPROC, NPROC }; - - double data[NSIDE*NSIDE]; - double *ldata, *pdata; - - int tsize, nelem; - - MPI_File dfile; - - MPI_Init(&argc, &argv); - - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - /* Set up type */ - CHECK(MPI_Type_create_darray(size, rank, 2, gsize, distrib, - bsize, psize, MPI_ORDER_FORTRAN, MPI_DOUBLE, &darray)); - CHECK(MPI_Type_commit(&darray)); - CHECK(MPI_Type_size(darray, &tsize)); - nelem = tsize / sizeof(double); - - for(i = 0; i < (NSIDE*NSIDE); i++) data[i] = i; - - if (rank == 0) { - CHECK(MPI_File_open(MPI_COMM_SELF, argv[1], - MPI_MODE_CREATE|MPI_MODE_WRONLY, MPI_INFO_NULL, &dfile)); - CHECK(MPI_File_write(dfile, data, NSIDE*NSIDE, MPI_DOUBLE, &status)); - CHECK(MPI_File_close(&dfile)); - } - MPI_Barrier(MPI_COMM_WORLD); - - /* Allocate buffer */ - ldata = (double *)malloc(tsize); - pdata = (double *)malloc(tsize); - - /* Use Pack to pull out array */ - bpos = 0; - CHECK(MPI_Pack(data, 1, darray, pdata, tsize, &bpos, MPI_COMM_WORLD)); - - MPI_Barrier(MPI_COMM_WORLD); - - /* Read in array from file. */ - CHECK(MPI_File_open(MPI_COMM_WORLD, argv[1], MPI_MODE_RDONLY, MPI_INFO_NULL, &mpi_fh)); - CHECK(MPI_File_set_view(mpi_fh, 0, MPI_DOUBLE, darray, "native", MPI_INFO_NULL)); - CHECK(MPI_File_read_all(mpi_fh, ldata, nelem, MPI_DOUBLE, &status)); - CHECK(MPI_File_close(&mpi_fh)); - - for(i = 0; i < size; i++) { -#ifdef VERBOSE - MPI_Barrier(MPI_COMM_WORLD); - if(rank == i) { - printf("=== Rank %i === (%i elements) \nPacked: ", rank, nelem); - for(j = 0; j < nelem; j++) { - printf("%4.1f ", pdata[j]); - fflush(stdout); - } - printf("\nRead: "); - for(j = 0; j < nelem; j++) { - printf("%4.1f ", ldata[j]); - fflush(stdout); - } - printf("\n\n"); - fflush(stdout); - } -#endif - if(rank == i) { - for (j=0; j< nelem; j++) { - if (pdata[j] != ldata[j]) { - fprintf(stderr, "rank %d at index %d: packbuf %4.1f filebuf %4.1f\n", - rank, j, pdata[j], ldata[j]); - nerrors++; - } - } - } - } - MPI_Allreduce(&nerrors, &total_errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - if (rank == 0 && total_errors == 0) - printf(" No Errors\n"); - - free(ldata); - free(pdata); - MPI_Type_free(&darray); - MPI_Finalize(); - - exit(total_errors); - -} diff --git a/3rd-party/romio321/test/error.c b/3rd-party/romio321/test/error.c deleted file mode 100644 index ee24e964596..00000000000 --- a/3rd-party/romio321/test/error.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -#define VERBOSE 0 -/* tests if error message is printed correctly */ - -int main(int argc, char **argv) -{ - int i, rank, len, err; - int errs = 0; - char *filename, *tmp; - MPI_File fh; - char string[MPI_MAX_ERROR_STRING]; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -#if VERBOSE - if (!rank) { - fprintf(stderr, "Tests if errors are reported correctly...\n"); - fprintf(stderr, "Should say \"Invalid displacement argument\"\n\n"); - } -#endif - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: simple -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - /* each process opens a separate file called filename.'myrank' */ - tmp = (char *) malloc(len+10); - strcpy(tmp, filename); - sprintf(filename, "%s.%d", tmp, rank); - - err = MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE+MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - err = MPI_File_set_view(fh, -1, MPI_BYTE, MPI_BYTE, "native", - MPI_INFO_NULL); - /* disp is deliberately passed as -1 */ - - /* This test is designed for ROMIO specifically and tests for a - specific error message */ - if (err != MPI_SUCCESS) { - MPI_Error_string(err, string, &len); - if (!rank) { -#if VERBOSE - fprintf(stderr, "%s\n", string); -#else - /* check for the word "displacement" in the message. - This allows other formatting of the message */ - if (strstr( string, "displacement" ) == 0) { - fprintf( stderr, "Unexpected error message %s\n", string ); - errs++; - } -#endif - } - } - else { - errs++; - fprintf( stderr, "File set view did not return an error\n" ); - } - - MPI_File_close(&fh); - - free(filename); - free(tmp); - - if (!rank) { - if (errs == 0) { - printf( " No Errors\n" ); - } - else { - printf( " Found %d errors\n", errs ); - } - } - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/excl.c b/3rd-party/romio321/test/excl.c deleted file mode 100644 index e48bb3deee5..00000000000 --- a/3rd-party/romio321/test/excl.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* tests MPI_MODE_EXCL */ - -int main(int argc, char **argv) -{ - MPI_File fh; - int rank, len, err, i; - int errs=0, toterrs; - char *filename; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: excl -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - if (!rank) MPI_File_delete(filename, MPI_INFO_NULL); - MPI_Barrier(MPI_COMM_WORLD); - - /* this open should succeed */ - err = MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_CREATE | MPI_MODE_EXCL | MPI_MODE_RDWR, MPI_INFO_NULL , &fh); - if (err != MPI_SUCCESS) { - errs++; - fprintf(stderr, "Process %d: open failed when it should have succeeded\n", rank); - } - else MPI_File_close(&fh); - - MPI_Barrier(MPI_COMM_WORLD); - - /* this open should fail */ - err = MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_CREATE | MPI_MODE_EXCL | MPI_MODE_RDWR, MPI_INFO_NULL , &fh); - if (err == MPI_SUCCESS) { - errs++; - fprintf(stderr, "Process %d: open succeeded when it should have failed\n", rank); - } - - MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); - if (rank == 0) { - if( toterrs > 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - free(filename); - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/external32.c b/3rd-party/romio321/test/external32.c deleted file mode 100644 index bca3555ae86..00000000000 --- a/3rd-party/romio321/test/external32.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This code was written by Intel Corporation. Copyright (C) 2011-2012 Intel Corporation. - * Intel provides this material to Argonne National Laboratory subject to - * Software Grant and Corporate Contributor License Agreement dated February 8, 2012. - * - * See COPYRIGHT in top-level directory. - */ - -#include -#include -#include "mpi.h" - -#define TEST_LE 0x1 -#define TEST_BE 0x2 -#define TEST_FILENAME "test.datarep" - -#define CHECK(fn) {int errcode; errcode = (fn); if (errcode != MPI_SUCCESS) handle_error(errcode, NULL); } - -static void handle_error(int errcode, char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: (%d) %s\n", str, errcode, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - - - -static void is_little_or_big_endian( const char* datarep, char* c, char* c_le, int len ) { - int i, is_le = 1, is_be = 1; - for( i = 0; i < len; i++ ) { - is_le = is_le && ( c[i] == c_le[i] ); - is_be = is_be && ( c[i] == c_le[len-1-i] ); - } - printf( "%s datarep is ", datarep ); - switch ((is_le ? TEST_LE : 0x0) | (is_be ? TEST_BE : 0x0) ) { - case TEST_LE: printf( "LITTLE ENDIAN\n" ); break; - case TEST_BE: printf( "BIG ENDIAN\n" ); break; - case TEST_LE | TEST_BE: printf( "LITTLE or BIG ENDIAN\n" ); break; - default: printf( "unknown\n" ); break; - } -} - -/* This test checks if datareps given are little- or big-endian */ -int main( int argc, char* argv[] ) { - int sample_i = 123456789, i, j; - char sample_i_le[4] = {0x15,0xcd,0x5b,0x07}, c[4]; - const char* datarep[3] = { "native", "external32", "internal" }; - MPI_File fileh; - int rank; - FILE* fileh_std; - - if( sizeof(int) != 4 ) { printf( "non-supported sizeof(int)=%ld\n", sizeof(int) ); return (-1); } - - MPI_Init( &argc, &argv ); - MPI_Comm_rank( MPI_COMM_WORLD, &rank ); - - /* For each datarep */ - for( i = 0; i < 3; i++ ) { - - /* Open file */ - CHECK(MPI_File_open( MPI_COMM_WORLD, TEST_FILENAME, - MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fileh ) ); - - /* Set view */ - CHECK(MPI_File_set_view( fileh, 0, MPI_INT, MPI_INT, datarep[i], MPI_INFO_NULL )); - - /* Write into file */ - CHECK(MPI_File_write_at( fileh, (MPI_Offset)rank, (void*)&sample_i, 1, - MPI_INT, MPI_STATUS_IGNORE )); - - /* Close file */ - CHECK(MPI_File_close( &fileh )); - - /* Check if your datarep is little or big endian */ - MPI_Barrier( MPI_COMM_WORLD ); - if( rank == 0 ) { - fileh_std = fopen( TEST_FILENAME, "r" ); - for( j = 0; j < 4; j++ ) { - if( feof( fileh_std ) ) { printf( "unexpected eof, aborted\n" ); return (-1); } - fscanf( fileh_std, "%c", &c[j] ); - } - is_little_or_big_endian( datarep[i], c, sample_i_le, 4 ); - fclose( fileh_std ); - } - - /* Delete file */ - if( rank == 0 ) { - CHECK(MPI_File_delete( TEST_FILENAME, MPI_INFO_NULL )); - } - } - - MPI_Finalize(); - - return 0; -} diff --git a/3rd-party/romio321/test/fcoll_test.f.in b/3rd-party/romio321/test/fcoll_test.f.in deleted file mode 100644 index d6bae7446c5..00000000000 --- a/3rd-party/romio321/test/fcoll_test.f.in +++ /dev/null @@ -1,175 +0,0 @@ -! -*- Mode: Fortran; -*- -! -! (C) 2001 by Argonne National Laboratory. -! See COPYRIGHT in top-level directory. -! - program main - implicit none - - include 'mpif.h' - @F77MPIOINC@ - -! Fortran equivalent of coll_test.c - - integer FILESIZE - parameter (FILESIZE=32*32*32*4) - -! A 32^3 array. For other array sizes, change FILESIZE above and -! array_of_gsizes below. - -! Uses collective I/O. Writes a 3D block-distributed array to a file -! corresponding to the global array in row-major (C) order, reads it -! back, and checks that the data read is correct. - -! Note that the file access pattern is noncontiguous. - - integer newtype, i, ndims, array_of_gsizes(3) - integer order, intsize, nprocs, j, array_of_distribs(3) - integer array_of_dargs(3), array_of_psizes(3) - integer readbuf(FILESIZE), writebuf(FILESIZE), bufcount - integer mynod, tmpbuf(FILESIZE), array_size, argc, iargc - integer fh, status(MPI_STATUS_SIZE), request, ierr - character*1024 str ! used to store the filename - integer errs, toterrs - @FORTRAN_MPI_OFFSET@ disp - @FTESTDEFINE@ - - errs = 0 - call MPI_INIT(ierr) - call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, ierr) - call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr) - -! process 0 takes the file name as a command-line argument and -! broadcasts it to other processes - - if (mynod .eq. 0) then - argc = @F77IARGC@ - i = 0 - @F77GETARG@ - do while ((i .lt. argc) .and. (str .ne. '-fname')) - i = i + 1 - @F77GETARG@ - end do - if (i .ge. argc) then - print * - print *, '*# Usage: fcoll_test -fname filename' - print * - call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) - end if - - i = i + 1 - @F77GETARG@ - call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & - & MPI_COMM_WORLD, ierr) - else - call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & - & MPI_COMM_WORLD, ierr) - end if - - -! create the distributed array filetype - - ndims = 3 - order = MPI_ORDER_FORTRAN - - array_of_gsizes(1) = 32 - array_of_gsizes(2) = 32 - array_of_gsizes(3) = 32 - - array_of_distribs(1) = MPI_DISTRIBUTE_BLOCK - array_of_distribs(2) = MPI_DISTRIBUTE_BLOCK - array_of_distribs(3) = MPI_DISTRIBUTE_BLOCK - - array_of_dargs(1) = MPI_DISTRIBUTE_DFLT_DARG - array_of_dargs(2) = MPI_DISTRIBUTE_DFLT_DARG - array_of_dargs(3) = MPI_DISTRIBUTE_DFLT_DARG - - do i=1, ndims - array_of_psizes(i) = 0 - end do - - call MPI_DIMS_CREATE(nprocs, ndims, array_of_psizes, ierr) - - call MPI_TYPE_CREATE_DARRAY(nprocs, mynod, ndims, & - & array_of_gsizes, array_of_distribs, array_of_dargs, & - & array_of_psizes, order, MPI_INTEGER, newtype, ierr) - - call MPI_TYPE_COMMIT(newtype, ierr) - -! initialize writebuf - - call MPI_TYPE_SIZE(newtype, bufcount, ierr) - call MPI_TYPE_SIZE(MPI_INTEGER, intsize, ierr) - bufcount = bufcount/intsize - do i=1, bufcount - writebuf(i) = 1 - end do - - do i=1, FILESIZE - tmpbuf(i) = 0 - end do - - call MPI_IRECV(tmpbuf, 1, newtype, mynod, 10, MPI_COMM_WORLD, & - & request, ierr) - call MPI_SEND(writebuf, bufcount, MPI_INTEGER, mynod, 10, & - & MPI_COMM_WORLD, ierr) - call MPI_WAIT(request, status, ierr) - - j = 1 - array_size = array_of_gsizes(1) * array_of_gsizes(2) * & - & array_of_gsizes(3) - do i=1, array_size - if (tmpbuf(i) .ne. 0) then - writebuf(j) = i - j = j + 1 - end if - end do - -! end of initialization - -! write the array to the file - - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - disp = 0 - call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, "native", & - & MPI_INFO_NULL, ierr) - call MPI_FILE_WRITE_ALL(fh, writebuf, bufcount, MPI_INTEGER, & - & status, ierr) - call MPI_FILE_CLOSE(fh, ierr) - -! now read it back - - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, "native", & - & MPI_INFO_NULL, ierr) - call MPI_FILE_READ_ALL(fh, readbuf, bufcount, MPI_INTEGER, & - & status, ierr) - call MPI_FILE_CLOSE(fh, ierr) - -! check the data read - do i=1, bufcount - if (readbuf(i) .ne. writebuf(i)) then - errs = errs + 1 - print *, 'Node ', mynod, ' readbuf ', readbuf(i), & - & ' writebuf ', writebuf(i), ' i', i - end if - end do - - call MPI_TYPE_FREE(newtype, ierr) - call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, & - $ MPI_COMM_WORLD, ierr ) - if (mynod .eq. 0) then - if( toterrs .gt. 0 ) then - print *, 'Found ', toterrs, ' errors' - else - print *, ' No Errors' - endif - endif - - call MPI_FINALIZE(ierr) - - end diff --git a/3rd-party/romio321/test/file_info.c b/3rd-party/romio321/test/file_info.c deleted file mode 100644 index fba618974fc..00000000000 --- a/3rd-party/romio321/test/file_info.c +++ /dev/null @@ -1,421 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -/* Change for BG/L made by Hao Yu, yuh@us.ibm.com - */ - -#include "mpi.h" -#include -#include -#include - -static void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} -/* this test wants to compare the hints it gets from a file with a set of - * default hints. These hints are specific to the MPI-IO implementation, so if - * you want to test something besides the default you'll have to use a command - * line argument */ - -typedef struct hint_defaults { - int cb_buffer_size; - int ind_rd_buffer_size; - int ind_wr_buffer_size; - const char *romio_cb_read; - const char *romio_cb_write; - const char *cb_config_list; -} hint_defaults; - -hint_defaults UFS_DEFAULTS = { - .cb_buffer_size = 16777216, - .ind_rd_buffer_size = 4194304, - .ind_wr_buffer_size = 524288, - .romio_cb_read = "automatic", - .romio_cb_write = "automatic", - .cb_config_list = "*:1" -}; - -hint_defaults BLUEGENE_DEFAULTS = { - .cb_buffer_size = 16777216, - .ind_rd_buffer_size = 4194304, - .ind_wr_buffer_size = 4194304, - .romio_cb_read = "enable", - .romio_cb_write = "enable", - .cb_config_list = NULL}; - -/* #undef INFO_DEBUG */ - -/* Test will print out information about unexpected hint keys or values that - * differ from the default. Since this is often interesting but rarely an - * error, default will be to increment errror cound for true error conditions - * but not print out these "interesting" non-error cases. */ - -static int verbose = 0; -static int test_ufs = 0; -static int test_bluegene = 0; - -int main(int argc, char **argv) -{ - int i, len, nkeys, flag, mynod, default_striping_factor=0, nprocs, errs = 0; - MPI_File fh; - MPI_Info info, info_used; - char *filename, key[MPI_MAX_INFO_KEY], value[MPI_MAX_INFO_VAL]; - hint_defaults *defaults; - int ret; - - MPI_Init(&argc,&argv); - - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - if (!strcmp("-v", *argv)) verbose = 1; - else if (!strcmp("-u", *argv)) test_ufs = 1; - else if (!strcmp("-b", *argv)) test_bluegene = 1; - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: file_info [-v] -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - MPI_Bcast(&verbose, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&test_ufs, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&test_bluegene, 1, MPI_INT, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - MPI_Bcast(&verbose, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&test_ufs, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&test_bluegene, 1, MPI_INT, 0, MPI_COMM_WORLD); - } - if (test_ufs) { - defaults = &UFS_DEFAULTS; - } else if (test_bluegene) { - defaults = &BLUEGENE_DEFAULTS; - } else { - defaults = NULL; - } - - -/* open the file with MPI_INFO_NULL */ - ret = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - if (ret != MPI_SUCCESS) handle_error(ret, "MPI_File_open"); - -/* check the default values set by ROMIO */ - MPI_File_get_info(fh, &info_used); - MPI_Info_get_nkeys(info_used, &nkeys); - - if (defaults != NULL) { - for (i=0; icb_buffer_size) { - errs++; - if (verbose) fprintf(stderr, "cb_buffer_size is %d; should be %d\n", - atoi(value), defaults->cb_buffer_size); - } - } - else if (!strcmp("romio_cb_read", key)) { - if (strcmp(defaults->romio_cb_read, value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_read is set to %s; should be %s\n", - value, defaults->romio_cb_read); - } - } - else if (!strcmp("romio_cb_write", key)) { - if (strcmp(defaults->romio_cb_write, value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_write is set to %s; should be %s\n", - value, defaults->romio_cb_write); - } - } - else if (!strcmp("cb_nodes", key)) { - /* unreliable test -- just ignore value */ - } - else if (!strcmp("romio_no_indep_rw", key)) { - if (strcmp("false", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_no_indep_rw is set to %s; should be %s\n", - value, "false"); - } - } - else if (!strcmp("ind_rd_buffer_size", key)) { - if (atoi(value) != defaults->ind_rd_buffer_size) { - errs++; - if (verbose) fprintf(stderr, "ind_rd_buffer_size is %d; should be %d\n", - atoi(value), defaults->ind_rd_buffer_size); - } - } - else if (!strcmp("ind_wr_buffer_size", key)) { - if (atoi(value) != defaults->ind_wr_buffer_size) { - errs++; - if (verbose) fprintf(stderr, "ind_wr_buffer_size is %d; should be %d\n", - atoi(value), defaults->ind_wr_buffer_size); - } - } - else if (!strcmp("romio_ds_read", key)) { - if (strcmp("automatic", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_ds_read is set to %s; should be %s\n", - value, "automatic"); - } - } - else if (!strcmp("romio_ds_write", key)) { - /* Unreliable test -- value is file system dependent. Ignore. */ - } - else if (!strcmp("cb_config_list", key)) { -#ifndef SKIP_CB_CONFIG_LIST_TEST - if (strcmp(defaults->cb_config_list, value)) { - errs++; - if (verbose) fprintf(stderr, "cb_config_list is set to %s; should be %s\n", - value, defaults->cb_config_list); - } -#endif - } - /* don't care about the defaults for these keys */ - else if (!strcmp("romio_cb_pfr", key)) { - } - else if (!strcmp("romio_cb_fr_types", key)) { - } - else if (!strcmp("romio_cb_fr_alignment", key)) { - } - else if (!strcmp("romio_cb_ds_threshold", key)) { - } - else if (!strcmp("romio_cb_alltoall", key)) { - } - else { - if (verbose) fprintf(stderr, "unexpected key %s (not counted as an error)\n", key); - } - } - } - MPI_Info_free(&info_used); - - MPI_File_close(&fh); - - /* delete the file */ - if (!mynod) MPI_File_delete(filename, MPI_INFO_NULL); - MPI_Barrier(MPI_COMM_WORLD); - -/* set new info values. */ - - MPI_Info_create(&info); - -/* The following four hints are accepted on all machines. They can - be specified at file-open time or later (any number of times). */ - - /* buffer size for collective I/O */ - MPI_Info_set(info, "cb_buffer_size", "8388608"); - - /* number of processes that actually perform I/O in collective I/O */ - sprintf(value, "%d", nprocs/2); - MPI_Info_set(info, "cb_nodes", value); - - /* buffer size for data sieving in independent reads */ - MPI_Info_set(info, "ind_rd_buffer_size", "2097152"); - - /* buffer size for data sieving in independent writes */ - MPI_Info_set(info, "ind_wr_buffer_size", "1048576"); - - -/* The following three hints related to file striping are accepted only - on Intel PFS and IBM PIOFS file systems and are ignored elsewhere. - They can be specified only at file-creation time; if specified later - they will be ignored. */ - - /* number of I/O devices across which the file will be striped. - accepted only if 0 < value < default_striping_factor; - ignored otherwise */ - if (default_striping_factor - 1 > 0) { - sprintf(value, "%d", default_striping_factor-1); - MPI_Info_set(info, "striping_factor", value); - } - else { - sprintf(value, "%d", default_striping_factor); - MPI_Info_set(info, "striping_factor", value); - } - - /* the striping unit in bytes */ - MPI_Info_set(info, "striping_unit", "131072"); - -#ifndef SKIP_CB_CONFIG_LIST_TEST - /* set the cb_config_list so we'll get deterministic cb_nodes output */ - MPI_Info_set(info, "cb_config_list", "*:*"); -#endif - - /* the I/O device number from which to start striping the file. - accepted only if 0 <= value < default_striping_factor; - ignored otherwise */ - sprintf(value, "%d", default_striping_factor-2); - MPI_Info_set(info, "start_iodevice", value); - - -/* The following hint about PFS server buffering is accepted only on - Intel PFS. It can be specified anytime. */ - MPI_Info_set(info, "pfs_svr_buf", "true"); - -/* open the file and set new info */ - ret = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - info, &fh); - if (ret != MPI_SUCCESS) handle_error(ret, "MPI_File_open"); - -/* check the values set */ - ret = MPI_File_get_info(fh, &info_used); - if (ret != MPI_SUCCESS) handle_error(ret, "MPI_File_get_info"); - MPI_Info_get_nkeys(info_used, &nkeys); - - for (i=0; i 0) && (atoi(value) != default_striping_factor-1)) { - errs++; - if (verbose) fprintf(stderr, "striping_factor is %d; should be %d\n", - atoi(value), default_striping_factor-1); - } - else if (atoi(value) != default_striping_factor) { - errs++; - if (verbose) fprintf(stderr, "striping_factor is %d; should be %d\n", - atoi(value), default_striping_factor); - } - } - else if (!strcmp("cb_buffer_size", key)) { - if (atoi(value) != 8388608) { - errs++; - if (verbose) fprintf(stderr, "cb_buffer_size is %d; should be %d\n", - atoi(value), 8388608); - } - } - /* only check the hints we set */ - else if (!strcmp("cb_nodes", key)) { - /* unreliable test: just skip */ - } - else if (!strcmp("romio_no_indep_rw", key)) { - if (strcmp("false", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_no_indep_rw is set to %s; should be %s\n", - value, "false"); - } - } - else if (!strcmp("ind_rd_buffer_size", key)) { - if (atoi(value) != 2097152) { - errs++; - if (verbose) fprintf(stderr, "ind_rd_buffer_size is %d; should be %d\n", - atoi(value), 2097152); - } - } - else if (!strcmp("ind_wr_buffer_size", key)) { - if (atoi(value) != 1048576) { - errs++; - if (verbose) fprintf(stderr, "ind_wr_buffer_size is %d; should be %d\n", - atoi(value), 1048576); - } - } - else if (!strcmp("romio_ds_read", key)) { - if (strcmp("automatic", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_ds_read is set to %s; should be %s\n", - value, "automatic"); - } - } - else if (!strcmp("romio_ds_write", key)) { - /* Unreliable test -- value is file system dependent. Ignore. */ - } - else if (!strcmp("cb_config_list", key)) { -#ifndef SKIP_CB_CONFIG_LIST_TEST - if (strcmp("*:*", value)) { - errs++; - if (verbose) fprintf(stderr, "cb_config_list is set to %s; should be %s\n", - value, "*:*"); - } -#endif - } - else if (!strcmp("romio_cb_pfr", key)) { - if(strcmp("disable", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_pfr is set to %s; should be %s\n", - value, "automatic"); - } - } - else if (!strcmp("romio_cb_fr_types", key)) { - if(strcmp("aar", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_fr_types is set to %s; should be %s\n", - value, "aar"); - } - } - else if (!strcmp("romio_cb_fr_alignment", key)) { - if(strcmp("1", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_fr_alignment is set to %s; should be %s\n", - value, "1"); - } - } - else if (!strcmp("romio_cb_ds_threshold", key)) { - if(strcmp("0", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_ds_threshold is set to %s; should be %s\n", - value, "0"); - } - } - else if (!strcmp("romio_cb_alltoall", key)) { - if(strcmp("automatic", value)) { - errs++; - if (verbose) fprintf(stderr, "romio_cb_alltoall is set to %s; should be %s\n", - value, "automatic"); - } - } - - else { - if (verbose) fprintf(stderr, "unexpected key %s (not counted as an error)\n", key); - } - } - - /* Q: SHOULD WE BOTHER LOOKING AT THE OTHER PROCESSES? */ - if (!mynod) { - if (errs) fprintf(stderr, "Found %d errors.\n", errs); - else printf(" No Errors\n"); - } - - MPI_File_close(&fh); - free(filename); - MPI_Info_free(&info_used); - MPI_Info_free(&info); - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/fmisc.f.in b/3rd-party/romio321/test/fmisc.f.in deleted file mode 100644 index a75c4ee16ed..00000000000 --- a/3rd-party/romio321/test/fmisc.f.in +++ /dev/null @@ -1,204 +0,0 @@ -! -*- Mode: Fortran; -*- -! -! (C) 2001 by Argonne National Laboratory. -! See COPYRIGHT in top-level directory. -! - program main - implicit none - - include 'mpif.h' - @F77MPIOINC@ - -! Fortran equivalent of misc.c -! tests various miscellaneous functions. - - integer buf(1024), amode, fh, status(MPI_STATUS_SIZE) - logical flag - integer ierr, newtype, i, group - integer etype, filetype, mynod, argc, iargc - integer errs, toterrs - logical verbose - character*7 datarep - character*1024 str ! used to store the filename - @FORTRAN_MPI_OFFSET@ disp, offset, filesize - @FTESTDEFINE@ - - errs = 0 - verbose = .false. - call MPI_INIT(ierr) - call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr) - -! process 0 takes the file name as a command-line argument and -! broadcasts it to other processes - - if (mynod .eq. 0) then - argc = @F77IARGC@ - i = 0 - @F77GETARG@ - do while ((i .lt. argc) .and. (str .ne. '-fname')) - i = i + 1 - @F77GETARG@ - end do - if (i .ge. argc) then - print * - print *, '*# Usage: fmisc -fname filename' - print * - call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) - end if - - i = i + 1 - @F77GETARG@ - call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & - & MPI_COMM_WORLD, ierr) - else - call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & - & MPI_COMM_WORLD, ierr) - end if - - - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE + MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - call MPI_FILE_WRITE(fh, buf, 1024, MPI_INTEGER, status, ierr) - - call MPI_FILE_SYNC(fh, ierr) - - call MPI_FILE_GET_AMODE(fh, amode, ierr) - if (mynod .eq. 0 .and. verbose) then - print *, ' testing MPI_FILE_GET_AMODE' - end if - if (amode .ne. (MPI_MODE_CREATE + MPI_MODE_RDWR)) then - errs = errs + 1 - print *, 'amode is ', amode, ', should be ', MPI_MODE_CREATE & - & + MPI_MODE_RDWR - end if - - call MPI_FILE_GET_ATOMICITY(fh, flag, ierr) - if (flag) then - errs = errs + 1 - print *, 'atomicity is ', flag, ', should be .FALSE.' - end if - if (mynod .eq. 0 .and. verbose) then - print *, ' setting atomic mode' - end if - call MPI_FILE_SET_ATOMICITY(fh, .TRUE., ierr) - call MPI_FILE_GET_ATOMICITY(fh, flag, ierr) - if (.not. flag) then - errs = errs + 1 - print *, 'atomicity is ', flag, ', should be .TRUE.' - end if - call MPI_FILE_SET_ATOMICITY(fh, .FALSE., ierr) - if (mynod .eq. 0 .and. verbose) then - print *, ' reverting back to nonatomic mode' - end if - - call MPI_TYPE_VECTOR(10, 10, 20, MPI_INTEGER, newtype, ierr) - call MPI_TYPE_COMMIT(newtype, ierr) - - disp = 1000 - call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, 'native', & - & MPI_INFO_NULL, ierr) - if (mynod .eq. 0 .and. verbose) then - print *, ' testing MPI_FILE_GET_VIEW' - end if - - disp = 0 - call MPI_FILE_GET_VIEW(fh, disp, etype, filetype, datarep, ierr) - if ((disp .ne. 1000) .or. (datarep .ne. 'native')) then - errs = errs + 1 - print *, 'disp = ', disp, ', datarep = ', datarep, & - & ', should be 1000, native' - end if - - if (mynod .eq. 0 .and. verbose) then - print *, ' testing MPI_FILE_GET_BYTE_OFFSET' - end if - offset = 10 - call MPI_FILE_GET_BYTE_OFFSET(fh, offset, disp, ierr) - if (disp .ne. 1080) then - errs = errs + 1 - print *, 'byte offset = ', disp, ', should be 1080' - end if - - call MPI_FILE_GET_GROUP(fh, group, ierr) - - if (mynod .eq. 0 .and. verbose) then - print *, ' setting file size to 1060 bytes' - end if - filesize = 1060 - call MPI_FILE_SET_SIZE(fh, filesize, ierr) - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - call MPI_FILE_SYNC(fh, ierr) - filesize = 0 - call MPI_FILE_GET_SIZE(fh, filesize, ierr) - if (filesize .ne. 1060) then - errs = errs + 1 - print *, 'file size = ', filesize, ', should be 1060' - end if - - if (mynod .eq. 0 .and. verbose) then - print *, ' seeking to eof and testing MPI_FILE_GET_POSITION' - end if - offset = 0 - call MPI_FILE_SEEK(fh, offset, MPI_SEEK_END, ierr) - call MPI_FILE_GET_POSITION(fh, offset, ierr) - if (offset .ne. 10) then - errs = errs + 1 - print *, 'file pointer posn = ', offset, ', should be 10' - end if - - if (mynod .eq. 0 .and. verbose) then - print *, ' testing MPI_FILE_GET_BYTE_OFFSET' - end if - call MPI_FILE_GET_BYTE_OFFSET(fh, offset, disp, ierr) - if (disp .ne. 1080) then - errs = errs + 1 - print *, 'byte offset = ', disp, ', should be 1080' - end if - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - - if (mynod .eq. 0 .and. verbose) then - print *, ' testing MPI_FILE_SEEK with MPI_SEEK_CUR' - end if - offset = -10 - call MPI_FILE_SEEK(fh, offset, MPI_SEEK_CUR, ierr) - call MPI_FILE_GET_POSITION(fh, offset, ierr) - call MPI_FILE_GET_BYTE_OFFSET(fh, offset, disp, ierr) - if (disp .ne. 1000) then - errs = errs + 1 - print *, 'file pointer posn in bytes = ', disp, & - & ', should be 1000' - end if - - if (mynod .eq. 0 .and. verbose) then - print *, ' preallocating disk space up to 8192 bytes' - end if - filesize = 8192 - call MPI_FILE_PREALLOCATE(fh, filesize, ierr) - - if (mynod .eq. 0 .and. verbose) then - print *, ' closing the file and deleting it' - end if - call MPI_FILE_CLOSE(fh, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (mynod .eq. 0) then - call MPI_FILE_DELETE(str, MPI_INFO_NULL, ierr) - end if - - call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, & - $ MPI_COMM_WORLD, ierr ) - if (mynod .eq. 0) then - if( toterrs .gt. 0 ) then - print *, 'Found ', toterrs, ' errors' - else - print *, ' No Errors' - endif - endif - - call MPI_TYPE_FREE(newtype, ierr) - call MPI_TYPE_FREE(filetype, ierr) - call MPI_GROUP_FREE(group, ierr) - call MPI_FINALIZE(ierr) - - end diff --git a/3rd-party/romio321/test/fperf.f.in b/3rd-party/romio321/test/fperf.f.in deleted file mode 100644 index 627794955cf..00000000000 --- a/3rd-party/romio321/test/fperf.f.in +++ /dev/null @@ -1,179 +0,0 @@ -! -*- Mode: Fortran; -*- -! -! (C) 2001 by Argonne National Laboratory. -! See COPYRIGHT in top-level directory. -! - program main - implicit none - - include 'mpif.h' - @F77MPIOINC@ - -! Fortran equivalent of perf.c - - integer SIZE - parameter (SIZE=1048576*4) -! read/write size per node in bytes - - integer buf(SIZE/4), j, mynod, nprocs, ntimes, flag - double precision stim, read_tim, write_tim, new_read_tim - double precision new_write_tim, min_read_tim, min_write_tim - double precision read_bw, write_bw - integer fh, status(MPI_STATUS_SIZE), ierr, argc, iargc, i - character*1024 str ! used to store the filename - @FORTRAN_MPI_OFFSET@ offset - @FTESTDEFINE@ - - ntimes = 5 - min_read_tim = 10000000.0D0 - min_write_tim = 10000000.0D0 - - call MPI_INIT(ierr) - call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, ierr) - call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr) - -! process 0 takes the file name as a command-line argument and -! broadcasts it to other processes - - if (mynod .eq. 0) then - argc = @F77IARGC@ - i = 0 - @F77GETARG@ - do while ((i .lt. argc) .and. (str .ne. '-fname')) - i = i + 1 - @F77GETARG@ - end do - if (i .ge. argc) then - print * - print *, '*# Usage: fperf -fname filename' - print * - call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) - end if - - i = i + 1 - @F77GETARG@ - call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & - & MPI_COMM_WORLD, ierr) - print *, 'Access size per process = ', SIZE, ' bytes', & - & ', ntimes = ', ntimes - else - call MPI_BCAST(str, 1024, MPI_CHARACTER, 0, & - & MPI_COMM_WORLD, ierr) - end if - - - offset = mynod*SIZE - do j=1, ntimes - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - call MPI_FILE_SEEK(fh, offset, MPI_SEEK_SET, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - stim = MPI_WTIME() - call MPI_FILE_WRITE(fh, buf, SIZE, MPI_BYTE, status, ierr) - write_tim = MPI_WTIME() - stim - - call MPI_FILE_CLOSE(fh, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - call MPI_FILE_SEEK(fh, offset, MPI_SEEK_SET, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - stim = MPI_WTIME() - call MPI_FILE_READ(fh, buf, SIZE, MPI_BYTE, status, ierr) - read_tim = MPI_WTIME() - stim - - call MPI_FILE_CLOSE(fh, ierr) - - call MPI_ALLREDUCE(write_tim, new_write_tim, 1, & - & MPI_DOUBLE_PRECISION, MPI_MAX, MPI_COMM_WORLD, ierr) - call MPI_ALLREDUCE(read_tim, new_read_tim, 1, & - & MPI_DOUBLE_PRECISION, MPI_MAX, MPI_COMM_WORLD, ierr) - - if (new_read_tim .lt. min_read_tim) then - min_read_tim = new_read_tim - end if - if (new_write_tim .lt. min_write_tim) then - min_write_tim = new_write_tim - end if - end do - - if (mynod .eq. 0) then - read_bw = (SIZE*nprocs*1.0D0)/(min_read_tim*1000000.0D0) - write_bw = (SIZE*nprocs*1.0D0)/(min_write_tim*1000000.0D0) - print *, 'Write bandwidth without file sync = ', & - & write_bw, ' Mbytes/sec' - print *, 'Read bandwidth without prior file sync = ', & - & read_bw, ' Mbytes/sec' - end if - - min_read_tim = 10000000.0D0 - min_write_tim = 10000000.0D0 - - flag = 0 - do j=1, ntimes - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - call MPI_FILE_SEEK(fh, offset, MPI_SEEK_SET, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - stim = MPI_WTIME() - call MPI_FILE_WRITE(fh, buf, SIZE, MPI_BYTE, status, ierr) - call MPI_FILE_SYNC(fh, ierr) - write_tim = MPI_WTIME() - stim - if (ierr .eq. MPI_ERR_UNKNOWN) then - flag = 1 - end if - - call MPI_FILE_CLOSE(fh, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - - call MPI_FILE_OPEN(MPI_COMM_WORLD, str, & - & MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr) - - call MPI_FILE_SEEK(fh, offset, MPI_SEEK_SET, ierr) - - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - stim = MPI_WTIME() - call MPI_FILE_READ(fh, buf, SIZE, MPI_BYTE, status, ierr) - read_tim = MPI_WTIME() - stim - - call MPI_FILE_CLOSE(fh, ierr) - - call MPI_ALLREDUCE(write_tim, new_write_tim, 1, & - & MPI_DOUBLE_PRECISION, MPI_MAX, MPI_COMM_WORLD, ierr) - call MPI_ALLREDUCE(read_tim, new_read_tim, 1, & - & MPI_DOUBLE_PRECISION, MPI_MAX, MPI_COMM_WORLD, ierr) - - if (new_read_tim .lt. min_read_tim) then - min_read_tim = new_read_tim - end if - if (new_write_tim .lt. min_write_tim) then - min_write_tim = new_write_tim - end if - - end do - - if (mynod .eq. 0) then - if (flag .eq. 1) then - print *, 'MPI_FILE_SYNC returns error.' - else - read_bw = (SIZE*nprocs*1.0D0)/(min_read_tim*1000000.0D0) - write_bw = (SIZE*nprocs*1.0D0)/(min_write_tim*1000000.0D0) - print *, 'Write bandwidth including file sync = ', & - & write_bw, ' Mbytes/sec' - print *, 'Read bandwidth after file sync = ', & - & read_bw, ' Mbytes/sec' - end if - end if - - call MPI_FINALIZE(ierr) - - end diff --git a/3rd-party/romio321/test/hindexed.c b/3rd-party/romio321/test/hindexed.c deleted file mode 100644 index ebc0ae81c65..00000000000 --- a/3rd-party/romio321/test/hindexed.c +++ /dev/null @@ -1,260 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * - * (C) 2008 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -/* Wei-keng Liao (wkliao@ece.northwestern.edu) September 8, 2008 */ -#include -#include -#include -#include - -#define YLEN 5 -#define XLEN 10 -#define SUB_XLEN 3 - -/* rjl: I was just too lazy to compute this at run-time */ -char compare_buf[XLEN*4][YLEN*4] = { - {'0','1','2',0,0,'3','4','5',0,0,'D','E','F',0,0,'G','H','I'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'6','7','8',0,0,'9',':',';',0,0,'J','K','L',0,0,'M','N','O'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'X','Y','Z',0,0,'[','\\',']',0,0,'l','m','n',0,0,'o','p','q'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'^','_','`',0,0,'a','b','c',0,0,'r','s','t',0,0,'u','v','w'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'0','1','2',0,0,'3','4','5',0,0,'D','E','F',0,0,'G','H','I'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'6','7','8',0,0,'9',':',';',0,0,'J','K','L',0,0,'M','N','O'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'X','Y','Z',0,0,'[','\\',']',0,0,'l','m','n',0,0,'o','p','q'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {'^','_','`',0,0,'a','b','c',0,0,'r','s','t',0,0,'u','v','w'}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -}; - - -/* set this if you want a dump of the global array -#define VERBOSE 1 -*/ - -/*----< main() >------------------------------------------------------------*/ -int main(int argc, char **argv) { - int i, j, err, rank, np, num_io; - char *buf, *filename; - int rank_dim[2], array_of_sizes[2]; - int array_of_subsizes[2]; - int count, *blocklengths, global_array_size; - MPI_Count ftype_size; - MPI_Aint *displacements; - MPI_File fh; - MPI_Datatype ftype; - MPI_Status status; - MPI_Offset offset=0; - int nr_errors=0; -#ifdef VERBOSE - int k; -#endif - - MPI_Init(&argc, &argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &np); - - if (np != 4) { - if (!rank) printf("Please run with 4 processes. Exiting ...\n\n"); - MPI_Finalize(); - return 1; - } - - filename = argv[1]; - - num_io = 2; - - /*-----------------------------------------------------------------------*/ - /* process rank in each dimension */ - rank_dim[0] = rank / 2; - rank_dim[1] = rank % 2; - - /* global 2D array size */ - array_of_sizes[0] = YLEN * 2; - array_of_sizes[1] = XLEN * 2; - - global_array_size = array_of_sizes[0] * array_of_sizes[1]; - - array_of_subsizes[0] = YLEN / 2; - array_of_subsizes[1] = XLEN * SUB_XLEN / 5; - - offset = rank_dim[0] * YLEN * array_of_sizes[1] + - rank_dim[1] * XLEN; - - /* define data type for file view */ - count = array_of_subsizes[0] * 2; /* 2 is the no. blocks along X */ - blocklengths = (int*) malloc(count*sizeof(int)); - displacements = (MPI_Aint*)malloc(count*sizeof(MPI_Aint)); - for (i=0; i0 && j%XLEN==0) printf(" "); - if (*ptr != 0) - printf(" %c",*ptr); - else - printf(" "); - ptr++; - } - printf("\n"); - } - printf("\n"); - } -#endif - ptr = rd_buf; - for(i=0; i<2*YLEN*num_io; i++) { - for(j=0; j<2*XLEN; j++) { - if( *ptr != compare_buf[i][j]) { - fprintf(stderr, "expected %d got %d at [%d][%d]\n", - *ptr, compare_buf[i][j], i, j); - nr_errors++; - } - ptr++; - } - } - free(rd_buf); - - if (nr_errors == 0) - fprintf(stdout, " No Errors\n"); - else - fprintf(stderr, "Found %d errors\n", nr_errors); - } - - free(blocklengths); - free(displacements); - free(buf); - MPI_Type_free(&ftype); - MPI_Finalize(); - return 0; -} - -/* command-line outputs are: (the global array is written twice) - -% mpiexec -n 4 wkl_subarray -------------------------------------------------------- - [ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 ] - -[ 0] 0 1 2 3 4 5 D E F G H I -[ 1] -[ 2] 6 7 8 9 : ; J K L M N O -[ 3] -[ 4] -[ 5] X Y Z [ \ ] l m n o p q -[ 6] -[ 7] ^ _ ` a b c r s t u v w -[ 8] -[ 9] - -[10] 0 1 2 3 4 5 D E F G H I -[11] -[12] 6 7 8 9 : ; J K L M N O -[13] -[14] -[15] X Y Z [ \ ] l m n o p q -[16] -[17] ^ _ ` a b c r s t u v w -[18] -[19] - -*/ - diff --git a/3rd-party/romio321/test/i_noncontig.c b/3rd-party/romio321/test/i_noncontig.c deleted file mode 100644 index db5bd36f0f9..00000000000 --- a/3rd-party/romio321/test/i_noncontig.c +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* tests noncontiguous reads/writes using nonblocking I/O */ - -#define SIZE 5000 - -#define VERBOSE 0 - -int main(int argc, char **argv) -{ - int *buf, i, mynod, nprocs, len, b[3]; - int errs=0, toterrs; - MPI_Aint d[3]; - MPI_File fh; - MPI_Status status; - char *filename; - MPI_Datatype typevec, newtype, t[3]; - MPIO_Request req; - - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - if (nprocs != 2) { - fprintf(stderr, "Run this program on two processes\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: i_noncontig -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - buf = (int *) malloc(SIZE*sizeof(int)); - - MPI_Type_vector(SIZE/2, 1, 2, MPI_INT, &typevec); - - b[0] = b[1] = b[2] = 1; - d[0] = 0; - d[1] = mynod*sizeof(int); - d[2] = SIZE*sizeof(int); - t[0] = MPI_LB; - t[1] = typevec; - t[2] = MPI_UB; - - MPI_Type_struct(3, b, d, t, &newtype); - MPI_Type_commit(&newtype); - MPI_Type_free(&typevec); - - if (!mynod) { -#if VERBOSE - fprintf(stderr, "\ntesting noncontiguous in memory, noncontiguous in file using nonblocking I/O\n"); -#endif - MPI_File_delete(filename, MPI_INFO_NULL); - } - MPI_Barrier(MPI_COMM_WORLD); - - MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | - MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - - MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", MPI_INFO_NULL); - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - MPI_Type_free(&newtype); - free(buf); - free(filename); - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/large_array.c b/3rd-party/romio321/test/large_array.c deleted file mode 100644 index 617c895dc9b..00000000000 --- a/3rd-party/romio321/test/large_array.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* Writes a 4-Gbyte distributed array, reads it back, and then deletes the - file. Uses collective I/O. */ -/* The file name is taken as a command-line argument. */ -/* Run it only on a machine with sufficient memory and a file system - on which ROMIO supports large files, i.e., PIOFS, XFS, SFS, and HFS */ - -/* This program will work only if the MPI implementation defines MPI_Aint - as a 64-bit integer. */ - -int main(int argc, char **argv) -{ - MPI_Datatype newtype; - int i, ndims, array_of_gsizes[3], array_of_distribs[3]; - int order, nprocs, len, flag, err; - int array_of_dargs[3], array_of_psizes[3]; - int *readbuf, *writebuf, mynod; - MPI_Count bufcount; - char filename[1024]; - MPI_File fh; - MPI_Status status; - MPI_Aint size_with_aint; - MPI_Offset size_with_offset; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: large_array -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - fprintf(stderr, "This program creates a 4 Gbyte file. Don't run it if you don't have that much disk space!\n"); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - -/* create the distributed array filetype */ - ndims = 3; - order = MPI_ORDER_C; - - array_of_gsizes[0] = 1024; - array_of_gsizes[1] = 1024; - array_of_gsizes[2] = 4*1024/sizeof(int); - - array_of_distribs[0] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[1] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[2] = MPI_DISTRIBUTE_BLOCK; - - array_of_dargs[0] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[1] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[2] = MPI_DISTRIBUTE_DFLT_DARG; - - for (i=0; i -#include -#include - -/* writes a file of size 4 Gbytes and reads it back. - should be run on one process only*/ -/* The file name is taken as a command-line argument. */ -/* Can be used only on file systems on which ROMIO supports large files, - i.e., PIOFS, XFS, SFS, and HFS. */ - -#define SIZE 1048576*4 /* no. of long longs in each write/read */ -#define NTIMES 128 /* no. of writes/reads */ - -int main(int argc, char **argv) -{ - MPI_File fh; - MPI_Status status; - MPI_Offset size; - long long *buf, i; - char *filename; - int j, mynod, nprocs, len, flag, err; - - MPI_Init(&argc,&argv); - - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - - if (nprocs != 1) { - fprintf(stderr, "Run this program on one process only\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: large -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - fprintf(stderr, "This program creates an 4 Gbyte file. Don't run it if you don't have that much disk space!\n"); - - buf = (long long *) malloc(SIZE * sizeof(long long)); - if (!buf) { - fprintf(stderr, "not enough memory to allocate buffer\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - - for (i=0; i -#include -#include - -/* tests various miscellaneous functions. */ -#define VERBOSE 0 - -static void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); -} - -int main(int argc, char **argv) -{ - int buf[1024], amode, flag, mynod, len, i; - int errs = 0, toterrs; - MPI_File fh; - MPI_Status status; - MPI_Datatype newtype; - MPI_Offset disp, offset; - MPI_Group group; - MPI_Datatype etype, filetype; - char datarep[25], *filename; - int errcode=0; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: misc -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - errcode = MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_open"); - } - - errcode = MPI_File_write(fh, buf, 1024, MPI_INT, &status); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_write"); - } - - errcode = MPI_File_sync(fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_sync"); - } - - errcode = MPI_File_get_amode(fh, &amode); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_amode"); - } -#if VERBOSE - if (!mynod) fprintf(stderr, "testing MPI_File_get_amode\n"); -#endif - if (amode != (MPI_MODE_CREATE | MPI_MODE_RDWR)) { - errs++; - fprintf(stderr, "amode is %d, should be %d\n\n", - amode, MPI_MODE_CREATE | MPI_MODE_RDWR); - } - - errcode = MPI_File_get_atomicity(fh, &flag); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_atomicity"); - } - if (flag) { - errs++; - fprintf(stderr, "atomicity is %d, should be 0\n", flag); - } -#if VERBOSE - if (!mynod) fprintf(stderr, "setting atomic mode\n"); -#endif - errcode = MPI_File_set_atomicity(fh, 1); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_set_atomicity"); - } - errcode = MPI_File_get_atomicity(fh, &flag); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_atomicity"); - } - if (!flag) { - errs++; - fprintf(stderr, "atomicity is %d, should be 1\n", flag); - } - errcode = MPI_File_set_atomicity(fh, 0); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_set_atomicity"); - } -#if VERBOSE - if (!mynod) fprintf(stderr, "reverting back to nonatomic mode\n"); -#endif - - MPI_Type_vector(10, 10, 20, MPI_INT, &newtype); - MPI_Type_commit(&newtype); - - errcode = MPI_File_set_view(fh, 1000, MPI_INT, newtype, "native", MPI_INFO_NULL); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_set_view"); - } -#if VERBOSE - if (!mynod) fprintf(stderr, "testing MPI_File_get_view\n"); -#endif - errcode = MPI_File_get_view(fh, &disp, &etype, &filetype, datarep); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_view"); - } - if ((disp != 1000) || strcmp(datarep, "native")) { - errs++; - fprintf(stderr, "disp = %@LL@, datarep = %s, should be 1000, native\n\n", disp, datarep); - } -#if VERBOSE - if (!mynod) fprintf(stderr, "testing MPI_File_get_byte_offset\n"); -#endif - errcode = MPI_File_get_byte_offset(fh, 10, &disp); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_byte_offset"); - } - if (disp != (1000+20*sizeof(int))) { - errs++; - fprintf(stderr, "byte offset = %@LL@, should be %d\n\n", - disp, (int) (1000+20*sizeof(int))); - } - - errcode = MPI_File_get_group(fh, &group); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_group"); - } - -#if VERBOSE - if (!mynod) fprintf(stderr, "testing MPI_File_set_size\n"); -#endif - errcode = MPI_File_set_size(fh, 1000+15*sizeof(int)); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_set_size"); - } - MPI_Barrier(MPI_COMM_WORLD); - errcode = MPI_File_sync(fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_sync"); - } - errcode = MPI_File_get_size(fh, &disp); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_size"); - } - if (disp != 1000+15*sizeof(int)) { - errs++; - fprintf(stderr, "file size = %@LL@, should be %d\n\n", - disp, (int) (1000+15*sizeof(int))); - } - -#if VERBOSE - if (!mynod) fprintf(stderr, "seeking to eof and testing MPI_File_get_position\n"); -#endif - errcode = MPI_File_seek(fh, 0, MPI_SEEK_END); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_seek"); - } - errcode = MPI_File_get_position(fh, &disp); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_position"); - } - if (disp != 10) { - errs++; - fprintf(stderr, "file pointer posn = %@LL@, should be 10\n\n", disp); - } - -#if VERBOSE - if (!mynod) fprintf(stderr, "testing MPI_File_get_byte_offset\n"); -#endif - errcode = MPI_File_get_byte_offset(fh, disp, &offset); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_byte_offset"); - } - if (offset != (1000+20*sizeof(int))) { - errs++; - fprintf(stderr, "byte offset = %@LL@, should be %d\n\n", - offset, (int) (1000+20*sizeof(int))); - } - MPI_Barrier(MPI_COMM_WORLD); - -#if VERBOSE - if (!mynod) fprintf(stderr, "testing MPI_File_seek with MPI_SEEK_CUR\n"); -#endif - errcode = MPI_File_seek(fh, -10, MPI_SEEK_CUR); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_seek"); - } - errcode = MPI_File_get_position(fh, &disp); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_position"); - } - errcode = MPI_File_get_byte_offset(fh, disp, &offset); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_get_byte_offset"); - } - if (offset != 1000) { - errs++; - fprintf(stderr, "file pointer posn in bytes = %@LL@, should be 1000\n\n", offset); - } - -#if VERBOSE - if (!mynod) fprintf(stderr, "preallocating disk space up to 8192 bytes\n"); -#endif - errcode = MPI_File_preallocate(fh, 8192); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_Preallocate"); - } - -#if VERBOSE - if (!mynod) fprintf(stderr, "closing the file and deleting it\n"); -#endif - MPI_File_close(&fh); - - MPI_Barrier(MPI_COMM_WORLD); - if (!mynod) MPI_File_delete(filename, MPI_INFO_NULL); - - MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); - if (mynod == 0) { - if( toterrs > 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - MPI_Type_free(&newtype); - MPI_Type_free(&filetype); - MPI_Group_free(&group); - free(filename); - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/noncontig.c b/3rd-party/romio321/test/noncontig.c deleted file mode 100644 index 8be18dc6703..00000000000 --- a/3rd-party/romio321/test/noncontig.c +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* tests noncontiguous reads/writes using independent I/O */ - -#define SIZE 5000 - -#define VERBOSE 0 -int main(int argc, char **argv) -{ - int *buf, i, mynod, nprocs, len, b[3]; - int errs=0, toterrs; - MPI_Aint d[3]; - MPI_File fh; - MPI_Status status; - char *filename; - MPI_Datatype typevec, newtype, t[3]; - MPI_Info info; - - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - if (nprocs != 2) { - fprintf(stderr, "Run this program on two processes\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes (length first, then string) */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: noncontig -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - buf = (int *) malloc(SIZE*sizeof(int)); - - MPI_Type_vector(SIZE/2, 1, 2, MPI_INT, &typevec); - - /* create a struct type with explicitly set LB and UB; displacements - * of typevec are such that the types for the two processes won't - * overlap. - */ - b[0] = b[1] = b[2] = 1; - d[0] = 0; - d[1] = mynod*sizeof(int); - d[2] = SIZE*sizeof(int); - t[0] = MPI_LB; - t[1] = typevec; - t[2] = MPI_UB; - - /* keep the struct, ditch the vector */ - MPI_Type_struct(3, b, d, t, &newtype); - MPI_Type_commit(&newtype); - MPI_Type_free(&typevec); - - MPI_Info_create(&info); - /* I am setting these info values for testing purposes only. It is - better to use the default values in practice. */ - MPI_Info_set(info, "ind_rd_buffer_size", "1209"); - MPI_Info_set(info, "ind_wr_buffer_size", "1107"); - - if (!mynod) { -#if VERBOSE - fprintf(stderr, "\ntesting noncontiguous in memory, noncontiguous in file using independent I/O\n"); -#endif - MPI_File_delete(filename, MPI_INFO_NULL); - } - MPI_Barrier(MPI_COMM_WORLD); - - MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - info, &fh); - - /* set the file view for each process -- now writes go into the non- - * overlapping but interleaved region defined by the struct type up above - */ - MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", info); - - /* fill our buffer with a pattern and write, using our type again */ - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - MPI_Type_free(&newtype); - MPI_Info_free(&info); - free(buf); - free(filename); - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/noncontig_coll.c b/3rd-party/romio321/test/noncontig_coll.c deleted file mode 100644 index 2916776a63c..00000000000 --- a/3rd-party/romio321/test/noncontig_coll.c +++ /dev/null @@ -1,236 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* tests noncontiguous reads/writes using collective I/O */ - -#define SIZE 5000 - -#define VERBOSE 0 -int main(int argc, char **argv) -{ - int *buf, i, mynod, nprocs, len, b[3]; - int errs=0, toterrs; - MPI_Aint d[3]; - MPI_File fh; - MPI_Status status; - char *filename; - MPI_Datatype typevec, newtype, t[3]; - - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - if (nprocs != 2) { - fprintf(stderr, "Run this program on two processes\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: noncontig_coll -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - buf = (int *) malloc(SIZE*sizeof(int)); - - MPI_Type_vector(SIZE/2, 1, 2, MPI_INT, &typevec); - - b[0] = b[1] = b[2] = 1; - d[0] = 0; - d[1] = mynod*sizeof(int); - d[2] = SIZE*sizeof(int); - t[0] = MPI_LB; - t[1] = typevec; - t[2] = MPI_UB; - - MPI_Type_struct(3, b, d, t, &newtype); - MPI_Type_commit(&newtype); - MPI_Type_free(&typevec); - - if (!mynod) { -#if VERBOSE - fprintf(stderr, "\ntesting noncontiguous in memory, noncontiguous in file using collective I/O\n"); -#endif - MPI_File_delete(filename, MPI_INFO_NULL); - } - MPI_Barrier(MPI_COMM_WORLD); - - MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - - MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", MPI_INFO_NULL); - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - MPI_Type_free(&newtype); - free(buf); - free(filename); - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/noncontig_coll2.c b/3rd-party/romio321/test/noncontig_coll2.c deleted file mode 100644 index 4699da89aca..00000000000 --- a/3rd-party/romio321/test/noncontig_coll2.c +++ /dev/null @@ -1,539 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* tests noncontiguous reads/writes using collective I/O */ - -/* this test is almost exactly like noncontig_coll.c with the following changes: - * - * . generalized file writing/reading to handle arbitrary number of processors - * . provides the "cb_config_list" hint with several permutations of the - * avaliable processors. - * [ makes use of code copied from ROMIO's ADIO code to collect the names of - * the processors ] - */ - -/* we are going to muck with this later to make it evenly divisible by however many compute nodes we have */ -#define STARTING_SIZE 5000 - -int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, - const char *msg, int verbose); - -#define ADIOI_Free free -#define ADIOI_Malloc malloc -#define FPRINTF fprintf -/* I have no idea what the "D" stands for; it's how things are done in adio.h - */ -struct ADIO_cb_name_arrayD { - int refct; - int namect; - char **names; -}; -typedef struct ADIO_cb_name_arrayD *ADIO_cb_name_array; - -void handle_error(int errcode, const char *str); -int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp); -void default_str(int mynod, int len, ADIO_cb_name_array array, char *dest); -void reverse_str(int mynod, int len, ADIO_cb_name_array array, char *dest); -void reverse_alternating_str(int mynod, int len, ADIO_cb_name_array array, char *dest); -void simple_shuffle_str(int mynod, int len, ADIO_cb_name_array array, char *dest); - - -void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - - -/* cb_gather_name_array() - gather a list of processor names from all processes - * in a communicator and store them on rank 0. - * - * This is a collective call on the communicator(s) passed in. - * - * Obtains a rank-ordered list of processor names from the processes in - * "dupcomm". - * - * Returns 0 on success, -1 on failure. - * - * NOTE: Needs some work to cleanly handle out of memory cases! - */ -int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array *arrayp) -{ - /* this is copied from ROMIO, but since this test is for correctness, - * not performance, note that we have removed the parts where ROMIO - * uses a keyval to cache the name array. We'll just rebuild it if we - * need to */ - - char my_procname[MPI_MAX_PROCESSOR_NAME], **procname = 0; - int *procname_len = NULL, my_procname_len, *disp = NULL, i; - int commsize, commrank; - ADIO_cb_name_array array = NULL; - - MPI_Comm_size(comm, &commsize); - MPI_Comm_rank(comm, &commrank); - - MPI_Get_processor_name(my_procname, &my_procname_len); - - /* allocate space for everything */ - array = (ADIO_cb_name_array) malloc(sizeof(*array)); - if (array == NULL) { - return -1; - } - array->refct = 1; - - if (commrank == 0) { - /* process 0 keeps the real list */ - array->namect = commsize; - - array->names = (char **) ADIOI_Malloc(sizeof(char *) * commsize); - if (array->names == NULL) { - return -1; - } - procname = array->names; /* simpler to read */ - - procname_len = (int *) ADIOI_Malloc(commsize * sizeof(int)); - if (procname_len == NULL) { - return -1; - } - } - else { - /* everyone else just keeps an empty list as a placeholder */ - array->namect = 0; - array->names = NULL; - } - /* gather lengths first */ - MPI_Gather(&my_procname_len, 1, MPI_INT, - procname_len, 1, MPI_INT, 0, comm); - - if (commrank == 0) { -#ifdef CB_CONFIG_LIST_DEBUG - for (i=0; i < commsize; i++) { - FPRINTF(stderr, "len[%d] = %d\n", i, procname_len[i]); - } -#endif - - for (i=0; i < commsize; i++) { - /* add one to the lengths because we need to count the - * terminator, and we are going to use this list of lengths - * again in the gatherv. - */ - procname_len[i]++; - procname[i] = malloc(procname_len[i]); - if (procname[i] == NULL) { - return -1; - } - } - - /* create our list of displacements for the gatherv. we're going - * to do everything relative to the start of the region allocated - * for procname[0] - * - * I suppose it is theoretically possible that the distance between - * malloc'd regions could be more than will fit in an int. We don't - * cover that case. - */ - disp = malloc(commsize * sizeof(int)); - disp[0] = 0; - for (i=1; i < commsize; i++) { - disp[i] = (int) (procname[i] - procname[0]); - } - - } - - /* now gather strings */ - if (commrank == 0) { - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, - procname[0], procname_len, disp, MPI_CHAR, - 0, comm); - } - else { - /* if we didn't do this, we would need to allocate procname[] - * on all processes...which seems a little silly. - */ - MPI_Gatherv(my_procname, my_procname_len + 1, MPI_CHAR, - NULL, NULL, NULL, MPI_CHAR, 0, comm); - } - - if (commrank == 0) { - /* no longer need the displacements or lengths */ - free(disp); - free(procname_len); - -#ifdef CB_CONFIG_LIST_DEBUG - for (i=0; i < commsize; i++) { - fprintf(stderr, "name[%d] = %s\n", i, procname[i]); - } -#endif - } - - *arrayp = array; - return 0; -} - -void default_str(int mynod, int len, ADIO_cb_name_array array, char *dest) -{ - char *ptr; - int i, p; - if (!mynod) { - ptr = dest; - for (i=0; inamect; i++ ) { - p = snprintf(ptr, len, "%s,", array->names[i]); - ptr += p; - } - /* chop off that last comma */ - dest[strlen(dest) - 1] = '\0'; - } - MPI_Bcast(dest, len, MPI_CHAR, 0, MPI_COMM_WORLD); -} -void reverse_str(int mynod, int len, ADIO_cb_name_array array, char *dest) -{ - char *ptr; - int i, p; - if (!mynod) { - ptr = dest; - for (i=(array->namect - 1); i >= 0; i-- ) { - p = snprintf(ptr, len, "%s,", array->names[i]); - ptr += p; - } - dest[strlen(dest) - 1] = '\0'; - } - MPI_Bcast(dest, len, MPI_CHAR, 0, MPI_COMM_WORLD); -} - -void reverse_alternating_str(int mynod, int len, ADIO_cb_name_array array, char *dest) -{ - char *ptr; - int i, p; - if (!mynod) { - ptr = dest; - /* evens */ - for (i=(array->namect - 1); i>= 0; i-=2 ) { - p = snprintf(ptr, len, "%s,", array->names[i]); - ptr += p; - } - /* odds */ - for (i=(array->namect - 2); i > 0; i-=2 ) { - p = snprintf(ptr, len, "%s,", array->names[i]); - ptr += p; - } - dest[strlen(dest) - 1] = '\0'; - } - MPI_Bcast(dest, len, MPI_CHAR, 0, MPI_COMM_WORLD); -} - -void simple_shuffle_str(int mynod, int len, ADIO_cb_name_array array, char *dest) -{ - char *ptr; - int i, p; - if (!mynod) { - ptr = dest; - for (i=(array->namect / 2 ); i < array->namect; i++) { - p = snprintf(ptr, len, "%s,", array->names[i]); - ptr += p; - } - for (i=0; i < (array->namect / 2); i++ ) { - p = snprintf(ptr, len, "%s,", array->names[i]); - ptr += p; - } - dest[strlen(dest) - 1] = '\0'; - } - MPI_Bcast(dest, len, MPI_CHAR, 0, MPI_COMM_WORLD); -} - -int main(int argc, char **argv) -{ - int i, mynod, nprocs, len, errs=0, sum_errs=0, verbose=0; - char *filename; - char * cb_config_string; - int cb_config_len; - ADIO_cb_name_array array; - - - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - - /* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - /* TODO: at some point, accept -v for verbose */ - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: noncontig_coll -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - /* want to hint the cb_config_list, but do so in a non-sequential way */ - cb_gather_name_array(MPI_COMM_WORLD, &array); - - /* sanity check */ - if (!mynod) { - if (array->namect < 2 ) { - fprintf(stderr, "Run this test on two or more hosts\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - } - /* get space for the permuted cb_config_string */ - if (!mynod) { - cb_config_len = 0; - for (i=0; i < array->namect; i++) { - /* +1: space for either a , or \0 if last */ - cb_config_len += strlen(array->names[i]) + 1; - } - ++cb_config_len; - } - MPI_Bcast(&cb_config_len, 1, MPI_INT, 0, MPI_COMM_WORLD); - if ( (cb_config_string = malloc(cb_config_len)) == NULL ) { - perror("malloc"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - /* first, no hinting */ - errs += test_file(filename, mynod, nprocs, NULL, "collective w/o hinting", verbose); - - /* hint, but no change in order */ - default_str(mynod, cb_config_len, array, cb_config_string); - errs += test_file(filename, mynod, nprocs, cb_config_string, "collective w/ hinting: default order", verbose); - - /* reverse order */ - reverse_str(mynod, cb_config_len, array, cb_config_string); - errs += test_file(filename, mynod, nprocs, cb_config_string, "collective w/ hinting: reverse order", verbose); - - /* reverse, every other */ - reverse_alternating_str(mynod, cb_config_len, array, cb_config_string); - errs += test_file(filename, mynod, nprocs, cb_config_string,"collective w/ hinting: permutation1", verbose); - - /* second half, first half */ - simple_shuffle_str(mynod, cb_config_len, array, cb_config_string); - errs += test_file(filename, mynod, nprocs, cb_config_string, "collective w/ hinting: permutation2", verbose); - - MPI_Allreduce(&errs, &sum_errs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - - if (!mynod) { - if (sum_errs) fprintf(stderr, "Found %d error cases\n", sum_errs); - else printf(" No Errors\n"); - } - free(filename); - free(cb_config_string); - MPI_Finalize(); - return 0; -} - -#define SEEDER(x,y,z) ((x)*1000000 + (y) + (x)*(z)) - -int test_file(char *filename, int mynod, int nprocs, char * cb_hosts, const char *msg, int verbose) -{ - MPI_Datatype typevec, newtype, t[3]; - int *buf, i, b[3], errcode, errors=0; - MPI_File fh; - MPI_Aint d[3]; - MPI_Status status; - int SIZE = (STARTING_SIZE/nprocs)*nprocs; - MPI_Info info; - - if (mynod==0 && verbose) fprintf(stderr, "%s\n", msg); - - buf = (int *) malloc(SIZE*sizeof(int)); - if (buf == NULL) { - perror("test_file"); - MPI_Abort(MPI_COMM_WORLD, -1); - } - - - if (cb_hosts != NULL ) { - MPI_Info_create(&info); - MPI_Info_set(info, "cb_config_list", cb_hosts); - } else { - info = MPI_INFO_NULL; - } - - MPI_Type_vector(SIZE/nprocs, 1, nprocs, MPI_INT, &typevec); - - b[0] = b[1] = b[2] = 1; - d[0] = 0; - d[1] = mynod*sizeof(int); - d[2] = SIZE*sizeof(int); - t[0] = MPI_LB; - t[1] = typevec; - t[2] = MPI_UB; - - MPI_Type_struct(3, b, d, t, &newtype); - MPI_Type_commit(&newtype); - MPI_Type_free(&typevec); - - if (!mynod) { - if(verbose) fprintf(stderr, "\ntesting noncontiguous in memory, noncontiguous in file using collective I/O\n"); - MPI_File_delete(filename, info); - } - MPI_Barrier(MPI_COMM_WORLD); - - errcode = MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_CREATE | MPI_MODE_RDWR, info, &fh); - if (errcode != MPI_SUCCESS) { - handle_error(errcode, "MPI_File_open"); - } - - MPI_File_set_view(fh, 0, MPI_INT, newtype, "native", info); - - for (i=0; i -#include -#include - -#define COUNT (200) -#undef TIMING - -void handle_error(int errcode, const char *str); - -void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -/* tests shared file pointer functions */ - -int main(int argc, char **argv) -{ - int *buf, i, rank, nprocs, len, sum; - int global_sum; - int errs=0, toterrs, errcode; - char *filename; - MPI_File fh; - MPI_Status status; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - double wr_stime, wr_etime, wr_time, wr_sumtime; - double rd_stime, rd_etime, rd_time, rd_sumtime; - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: shared_fp -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - buf = (int *) malloc(COUNT * sizeof(int)); - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); -#ifdef TIMING - fprintf( stderr, "nprocs: %d bytes: %d write: %f read %f\n", - nprocs, COUNT*sizeof(int), wr_sumtime, rd_sumtime); -#endif - } - } - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/perf.c b/3rd-party/romio321/test/perf.c deleted file mode 100644 index b72cf145f8c..00000000000 --- a/3rd-party/romio321/test/perf.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* A simple performance test. The file name is taken as a - command-line argument. */ - -#define SIZE (1048576*4) /* read/write size per node in bytes */ - -int main(int argc, char **argv) -{ - int *buf, i, j, mynod, nprocs, ntimes=5, len, err, flag; - double stim, read_tim, write_tim, new_read_tim, new_write_tim; - double min_read_tim=10000000.0, min_write_tim=10000000.0, read_bw, write_bw; - MPI_File fh; - MPI_Status status; - char *filename; - - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: perf -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - fprintf(stderr, "Access size per process = %d bytes, ntimes = %d\n", SIZE, ntimes); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - buf = (int *) malloc(SIZE); - - for (j=0; j -#include -#include - -#define SIZE (65536) - -/* This is the same as simple.c, but uses the PMPI versions of all - MPI functions in order to test the profiling interface. */ - -/* Each process writes to separate files and reads them back. - The file name is taken as a command-line argument, and the process rank - is appended to it. */ - -int main(int argc, char **argv) -{ - int *buf, i, rank, nints, len; - char *filename, *tmp; - int errs=0, toterrs; - MPI_File fh; - MPI_Status status; - - PMPI_Init(&argc,&argv); - PMPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: simple -fname filename\n\n"); - PMPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - PMPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - PMPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - PMPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - PMPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - buf = (int *) malloc(SIZE); - nints = SIZE/sizeof(int); - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - free(buf); - free(filename); - free(tmp); - - PMPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/rtest.in b/3rd-party/romio321/test/rtest.in deleted file mode 100644 index c6fd3058435..00000000000 --- a/3rd-party/romio321/test/rtest.in +++ /dev/null @@ -1,131 +0,0 @@ -#! /bin/sh -# -# Run some of the tests. If any arguments are provided, pass them to the -# test programs. -# -# -mvhome is needed for the ANL SP, and is ignored by others -args=@MPIRUNARGS@ -device=@DEVICE@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ -MPICH_VERSION=@MPICH_VERSION@ -STOPFILE=$HOME/.stopmpichtests -mpirun=${MPIRUN:-"@MPIRUN@"} -MAKE="@MAKE@" -FILENAME=test -# -# Load basic procedures -. ${top_srcdir}/runbase -# -# Set mpirun to the name/path of the mpirun program -FindMPIRUN -# -# -test_mpi2=@HAS_MPI2@ -runtests=1 -quiet=0 -makeeach=0 -writesummaryfile=no -MAKE="@MAKE@" -for arg in "$@" ; do - case $arg in - -checkonly ) - runtests=0 - ;; - -margs=*) - margs=`echo $arg | sed 's/-margs=//'` - args="$args $margs" - ;; - -summaryfile=*) - writesummaryfile=yes - summaryfile=`echo A$arg | sed 's/A-summaryfile=//'` - ;; - -small) - makeeach=1 - ;; - -fname=*) - FILENAME=`echo $arg|sed 's/-*fname=//'` - ;; - -quiet) - shift - quiet=1 - ;; - -help|-u) - echo "runtests [-checkonly] [-margs='...']" - echo "run tests in this directory. If -checkonly set, just run" - echo "the differences check (do NO rerun the test programs)." - echo "If -margs is used, these options are passed to mpirun." - echo "If -small is used, the examples are built, run, and deleted." - exit 1 - ;; - *) - if test -n "$arg" ; then - echo "runtests: Unknown argument ($arg)" - exit 1 - fi - ;; - esac -done - -# If the programs are not available, run make. -if [ ! -x simple -a $makeeach = 0 -a $runtests = 1 ] ; then - $MAKE default -fi - -testfiles="" -if [ $runtests = 1 ] ; then - - -RunTest simple 4 "**** Testing simple.c ****" "-fname $FILENAME" - -RunTest async 4 "**** Testing async.c ****" "-fname $FILENAME" - -RunTest atomicity 4 "**** Testing atomicity.out ****" "-fname $FILENAME" - -RunTest coll_test 4 "**** Testing coll_test.out ****" "-fname $FILENAME" - -RunTest excl 4 "**** Testing excl.c ****" "-fname $FILENAME" - -RunTest file_info 4 "**** Testing file_info.c ****" "-fname $FILENAME" - -RunTest i_noncontig 2 "**** Testing i_noncontig.c ****" "-fname $FILENAME" - -RunTest noncontig 2 "**** Testing noncontig.c ****" "-fname $FILENAME" - -RunTest noncontig_coll 2 "**** Testing noncontig_coll.c ****" "-fname $FILENAME" - -RunTest noncontig_coll2 4 "**** Testing noncontig_coll2.c ****" "-fname $FILENAME" - -RunTest misc 4 "**** Testing misc.c ****" "-fname $FILENAME" - -RunTest shared_fp 4 "**** Testing shared_fp.c ****" "-fname $FILENAME" - -RunTest split_coll 4 "**** Testing split_coll.c ****" "-fname $FILENAME" - -RunTest psimple 4 "**** Testing psimple.c ****" "-fname $FILENAME" - -RunTest error 1 "**** Testing error.c ****" "-fname $FILENAME" - -RunTest status 1 "**** Testing status.c ****" "-fname $FILENAME" - -# -# Run Fortran tests ONLY if Fortran available -if [ @HAS_FORTRAN@ = 1 ] ; then - RunTest fmisc 4 "**** Testing fmisc.f ****" "-fname $FILENAME" - - RunTest fcoll_test 4 "**** Testing fcoll_test.f ****" "-fname $FILENAME" - - RunTest pfcoll_test 4 "**** Testing pfcoll_test.f ****" "-fname $FILENAME" -fi - -else - # Just run checks - testfiles=`echo *.out` -fi - -echo '*** Checking for differences from expected output ***' -CheckAllOutput context.diff -exit 0 - - - diff --git a/3rd-party/romio321/test/runtests.in b/3rd-party/romio321/test/runtests.in deleted file mode 100644 index 0e5e58fcd92..00000000000 --- a/3rd-party/romio321/test/runtests.in +++ /dev/null @@ -1,484 +0,0 @@ -#! /bin/sh -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -mpirun="@MPIRUN@" -STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"} -# -# If the programs are not available, run make. -runtests=1 -makeeach=0 -check_at_once=1 -quiet=0 -MAKE="@MAKE@" -srcdir=@srcdir@ -check_canrun=0 -subset_only=0 -FILENAME=test -# Using shifts should remove args from the list. -for arg in "$@" ; do - case $arg in - -checkonly) - shift - runtests=0 - ;; - -margs=*) - shift - margs=`echo $arg | sed 's/-margs=//'` - args="$args $margs" - ;; - -echo) - shift - set -x - ;; - -check) - check_canrun=1 - ;; - -quiet) - shift - quiet=1 - ;; - -small) - shift - makeeach=1 - ;; - -subset) - shift - subset_only=1 - ;; - -fname=*) - FILENAME=`echo $arg|sed 's/-*fname=//'` - ;; - -atend) - shift - check_at_once=0 - ;; - -help|-u) - shift - echo "runtests [-fname=FILENAME] [-checkonly] [-atend] [-check]" - echo "run tests in this directory. If -checkonly set, just run" - echo "the differences check (do NOT rerun the test programs)." - echo "If -small is used, the examples are built, run, and deleted." - echo "If -atend is used, the success of the tests is checked only" - echo "at the end of the test rather than also after each test." - echo "If -check is used, only a single simple test is run; this" - echo "is used to check that mpirun can run an MPI program." - echo "If -subset is used, we skip tests for atomicity and shared" - echo "file pointers which can fail on some distributed file systems" - exit 1 - ;; - *) - if test -n "$arg" ; then - echo "Passing remaining arguments to programs ($*)" - break - fi - ;; - esac -done - -# MakeExe program-name -MakeExe() { - if [ -s $STOPFILE ] ; then - echo "Found stopfile; exiting" - exit 0 - fi - if [ ! -x $1 ] ; then - $MAKE $1 - if [ ! -x $1 ] ; then - echo "Could not build executable $1; aborting tests" - exit 1 - fi - fi -} -# CleanExe program-name -CleanExe() { - if [ $makeeach = 1 ] ; then - rm -f $1 $1.o - fi -} -# Output marker -OutTime() { - if [ $quiet = 0 ] ; then - if [ -z "$hostname" ] ; then - hostname=`hostname` - fi - d=`date` - echo "$hostname : $d" - fi -} - -# Do an "on the fly" check for problems. -CheckOutput() { - bfile=$1 - if [ $check_at_once = 1 ] ; then - stdfile=${srcdir}/std/$bfile.std - if [ ! -s $bfile.out ] ; then - echo "No output file $bfile.out!" - elif [ -s $stdfile ] ; then - stdfile2=${stdfile}2 - # Handle Fortran systems that generate stop statements - rm -f ${bfile}.tout - grep -v 'FORTRAN STOP' ${bfile}.out > ${bfile}.tout - if diff -b $bfile.tout $stdfile > /dev/null ; then - true - elif [ -s $stdfile2 ] ; then - # check for alternate in case configuration has fewer datatypes - if diff -b $bfile.tout $stdfile2 > /dev/null ; then - true - else - echo "Differences in $bfile.out" - diff -b $bfile.tout $stdfile - nodiff=0 - fi - else - echo "Differences in $bfile.out" - diff -b $bfile.tout $stdfile - fi - rm -f ${bfile}.tout - else - echo "Can not find file $stdfile to compare against for test $bfile" - fi - fi -} - -# nothing uses this function yet... just toying with the concept -RunTest() { - OutTime - testfiles="$testfiles ${1}.out" - rm -rf ${1}.out - MakeExe simple - rm -rf $FILENAME* - echo "**** Testing ${1}.c ****" - mpirun -np 4 ./${1} -fname $FILENAME "$@" >>${1}.out 2>1 - CheckOutput ${1} - CleanExe ${1} -} - -# If the programs are not available, run make. -if [ ! -x simple -a $makeeach = 0 ] ; then - $MAKE default -fi -# -testfiles="" -if [ $runtests = 1 ] ; then -echo '**** Testing I/O functions ****' -# -OutTime -testfiles="$testfiles simple.out" -\rm -f simple.out -MakeExe simple -\rm -f $FILENAME* -echo '**** Testing simple.c ****' -$mpirun -np 4 ./simple -fname $FILENAME -# CheckOutput simple -CleanExe simple -# -OutTime -testfiles="$testfiles async.out" -\rm -f async.out -MakeExe async -\rm -f $FILENAME* -echo '**** Testing async.c ****' -$mpirun -np 4 ./async -fname $FILENAME -# CheckOutput async -CleanExe async -# -OutTime -testfiles="$testfiles async-multi.out" -\rm -f async-multi.out -MakeExe async-multiple -\rm -f $FILENAME* -echo '**** Testing async-multiple.c ****' -$mpirun -np 4 ./async-multiple -fname $FILENAME -# CheckOutput async-multiple -CleanExe async-multiple -# -OutTime -if [ $subset_only -eq 0 ] ; then - testfiles="$testfiles atomicity.out" - \rm -f atomicity.out - MakeExe atomicity - \rm -f $FILENAME* - echo '**** Testing atomicity.c ****' - # Atomicity test recommends at least 8 processes (separate processors - # even better) - $mpirun -np 4 ./atomicity -fname $FILENAME - # CheckOutput atomicity - CleanExe atomicity - # - OutTime -fi -testfiles="$testfiles coll_test.out" -\rm -f coll_test.out -MakeExe coll_test -\rm -f $FILENAME* -echo '**** Testing coll_test.c ****' -$mpirun -np 4 ./coll_test -fname $FILENAME -# CheckOutput coll_test -CleanExe coll_test -# -OutTime -testfiles="$testfiles excl.out" -\rm -f excl.out -MakeExe excl -\rm -f $FILENAME* -echo '**** Testing excl.c ****' -$mpirun -np 4 ./excl -fname $FILENAME -# CheckOutput excl -CleanExe excl -# -OutTime -testfiles="$testfiles file_info.out" -\rm -f file_info.out -MakeExe file_info -\rm -f $FILENAME* -echo '**** Testing file_info.c ****' -$mpirun -np 4 ./file_info -fname $FILENAME -# CheckOutput file_info -CleanExe file_info -# -OutTime -testfiles="$testfiles i_noncontig.out" -\rm -f i_noncontig.out -MakeExe i_noncontig -\rm -f $FILENAME* -echo '**** Testing i_noncontig.c ****' -$mpirun -np 2 ./i_noncontig -fname $FILENAME -# CheckOutput i_noncontig -CleanExe i_noncontig -# -OutTime -testfiles="$testfiles noncontig.out" -\rm -f noncontig.out -MakeExe noncontig -\rm -f $FILENAME* -echo '**** Testing noncontig.c ****' -$mpirun -np 2 ./noncontig -fname $FILENAME -# CheckOutput noncontig -CleanExe noncontig -# -OutTime -testfiles="$testfiles noncontig_coll.out" -\rm -f noncontig_coll.out -MakeExe noncontig_coll -\rm -f $FILENAME* -echo '**** Testing noncontig_coll.c ****' -$mpirun -np 2 ./noncontig_coll -fname $FILENAME -# CheckOutput noncontig_coll -CleanExe noncontig_coll -# -OutTime -testfiles="$testfiles noncontig_coll2.out" -\rm -f noncontig_coll2.out -MakeExe noncontig_coll2 -\rm -f $FILENAME* -echo '**** Testing noncontig_coll2.c ****' -$mpirun -np 4 ./noncontig_coll2 -fname $FILENAME -# CheckOutput noncontig_coll2 -CleanExe noncontig_coll2 -MakeExe aggregation1 -echo '**** Testing aggregation1 ****' -$mpirun -np 4 ./aggregation1 -h -f $FILENAME -# CheckOutput aggregation1 -CleanExe aggregation1 -MakeExe aggregation2 -echo '**** Testing aggregation2 ****' -$mpirun -np 4 ./aggregation2 $FILENAME -# CheckOutput aggregation2 -CleanExe aggregation2 -MakeExe hindexed -echo '**** Testing hindexed ****' -$mpirun -np 4 ./hindexed $FILENAME -# CheckOutput hindexed -CleanExe hindexed -# -#echo '**** Testing write_all_test (run 1)****' -#$mpirun -np 4 ./write_all_test -nzp 2 -zplace 2 -nzw 2 -naw 2 -size 100 \ -# -offm 8 -hints romio_cb_write enable -fname $FILENAME -#echo '**** Testing write_all_test (run 2)****' -#$mpirun -np 4 ./write_all_test -nzp 2 -zplace 2 -nzw 2 -naw 2 -size 100 \ -# -offm 4 -hints romio_cb_write enable -fname $FILENAME -#CleanExe write_all_test -OutTime -if [ $subset_only -eq 0 ] ; then - testfiles="$testfiles misc.out" - \rm -f misc.out - MakeExe misc - \rm -f $FILENAME* - echo '**** Testing misc.c ****' - $mpirun -np 4 ./misc -fname $FILENAME - # CheckOutput misc - CleanExe misc - # - OutTime -fi -if [ $subset_only -eq 0 ] ; then - testfiles="$testfiles shared_fp.out" - \rm -f shared_fp.out - MakeExe shared_fp - \rm -f $FILENAME* - echo '**** Testing shared_fp.c ****' - $mpirun -np 4 ./shared_fp -fname $FILENAME - # CheckOutput shared_fp - CleanExe shared_fp - # - OutTime - testfiles="$testfiles ordered_fp.out" - \rm -f ordered_fp.out - MakeExe ordered_fp - \rm -f $FILENAME* - echo '**** Testing ordered_fp.c ****' - $mpirun -np 4 ./ordered_fp -fname $FILENAME - CleanExe ordered_fp - # - OutTime -fi -testfiles="$testfiles split_coll.out" -\rm -f split_coll.out -MakeExe split_coll -\rm -f $FILENAME* -echo '**** Testing split_coll.c ****' -$mpirun -np 4 ./split_coll -fname $FILENAME -# CheckOutput split_coll -CleanExe split_coll -# -OutTime -testfiles="$testfiles psimple.out" -\rm -f psimple.out -MakeExe psimple -\rm -f $FILENAME* -echo '**** Testing psimple.c ****' -$mpirun -np 4 ./psimple -fname $FILENAME -# CheckOutput psimple -CleanExe psimple -# -OutTime -testfiles="$testfiles error.out" -\rm -f error.out -MakeExe error -\rm -f $FILENAME* -echo '**** Testing error.c ****' -$mpirun -np 1 ./error -fname $FILENAME -# CheckOutput error -CleanExe error -# -OutTime -testfiles="$testfiles status.out" -\rm -f status.out -MakeExe status -\rm -f $FILENAME* -echo '**** Testing status.c ****' -# Some systems have a status program. -$mpirun -np 1 ./status -fname $FILENAME -# CheckOutput status -CleanExe status -testfiles="$testfiles types_with_zeros.out" -\rm -f types_with_zeros.out -MakeExe types_with_zeros -\rm -f $FILENAME* -echo '**** Testing types_with_zeros ****' -$mpirun -np 2 ./types_with_zeros $FILENAME -CleanExe types_with_zeros -testfiles="$testfiles darray_read.out" -\rm -f darray_read.out -MakeExe darray_read -\rm -f $FILENAME* -echo '**** Testing darray_read ****' -$mpirun -np 4 ./darray_read $FILENAME -CleanExe darray_read -MakeExe syshints -echo '**** Testing syshints ****' -$mpirun -np 1 ./syshints $srcdir/test_hintfile -CleanExe syshints - -# -if [ @NOF77@ = 0 ] ; then - echo "" - echo "FORTRAN TESTS" - OutTime - if [ $subset_only -eq 0 ] ; then - testfiles="$testfiles fmisc.out" - \rm -f fmisc.out - MakeExe fmisc - \rm -f $FILENAME* - echo '**** Testing fmisc.f ****' - $mpirun -np 4 ./fmisc -fname $FILENAME - # CheckOutput fmisc - CleanExe fmisc - # - OutTime - fi - testfiles="$testfiles fcoll_test.out" - \rm -f fcoll_test.out - MakeExe fcoll_test - \rm -f $FILENAME* - echo '**** Testing fcoll_test.f ****' - $mpirun -np 4 ./fcoll_test -fname $FILENAME - # CheckOutput fcoll_test - CleanExe fcoll_test -# - OutTime - testfiles="$testfiles pfcoll_test.out" - \rm -f pfcoll_test.out - MakeExe pfcoll_test - \rm -f $FILENAME* - echo '**** Testing pfcoll_test.f ****' - $mpirun -np 4 ./pfcoll_test -fname $FILENAME - # CheckOutput pfcoll_test - CleanExe pfcoll_test -# -echo "" -fi -# -else - # Just run checks - testfiles=`echo *.out` - if test "$testfiles" = "*.out" ; then - echo "No output files remain from previous test!" - exit 1 - fi -fi -# -# echo '*** Checking for differences from expected output ***' -# rm -f iotests.diff -# nodiff=1 -# for file in $testfiles ; do -# stdfile="${srcdir}/std/`basename $file .out`.std" -# # if basename is sendrecv or isndrcv, then we may want to test -# # with .std2 as well. We should really separate out the long double -# # tests ... -# if [ -s $stdfile ] ; then -# stdfile2=${stdfile}2 -# # Handle Fortran systems that generate stop statements -# bfile="`basename $file .out`.tout" -# rm -f ${bfile} -# grep -v 'FORTRAN STOP' ${file} > ${bfile} -# if diff -b $bfile $stdfile > /dev/null ; then -# true -# elif [ -s $stdfile2 ] ; then -# # check for alternate in case configuration has fewer datatypes -# if diff -b $bfile $stdfile2 > /dev/null ; then -# true -# else -# echo "Differences in `basename $file .out`" >> iotests.diff -# diff -b $bfile $stdfile >> iotests.diff -# nodiff=0 -# fi -# else -# echo "Differences in `basename $file .out`" >> iotests.diff -# diff -b $bfile $stdfile >> iotests.diff -# nodiff=0 -# fi -# rm -f ${bfile} -# else -# echo "Can not find file $stdfile to compare against for test `basename $file .out`" -# nodiff=0 -# fi -# done -# if [ -s iotests.diff ] ; then -# cat iotests.diff -# elif [ $nodiff = 1 ] ; then -# echo "-- No differences found; test successful" -# fi - exit 0 - diff --git a/3rd-party/romio321/test/shared_fp.c b/3rd-party/romio321/test/shared_fp.c deleted file mode 100644 index df41bdd818d..00000000000 --- a/3rd-party/romio321/test/shared_fp.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -#define COUNT 1024 - -void handle_error(int errcode, const char *str); - -void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -/* tests shared file pointer functions */ - -int main(int argc, char **argv) -{ - int *buf, i, rank, nprocs, len, sum, global_sum; - int errs=0, toterrs, errcode; - char *filename; - MPI_File fh; - MPI_Status status; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: shared_fp -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - buf = (int *) malloc(COUNT * sizeof(int)); - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/simple.c b/3rd-party/romio321/test/simple.c deleted file mode 100644 index 2e90c9dca99..00000000000 --- a/3rd-party/romio321/test/simple.c +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -#define SIZE (65536) - -static void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} -/* Each process writes to separate files and reads them back. - The file name is taken as a command-line argument, and the process rank - is appended to it. */ - -int main(int argc, char **argv) -{ - int *buf, i, rank, nints, len; - char *filename, *tmp; - int errs = 0, toterrs, errcode; - MPI_File fh; - MPI_Status status; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: simple -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - - buf = (int *) malloc(SIZE); - nints = SIZE/sizeof(int); - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - free(buf); - free(filename); - free(tmp); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/split_coll.c b/3rd-party/romio321/test/split_coll.c deleted file mode 100644 index cc3d039b569..00000000000 --- a/3rd-party/romio321/test/split_coll.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -/* A 32^3 array. For other array sizes, change array_of_gsizes below. */ - -/* Uses split collective I/O. Writes a 3D block-distributed array to a file - corresponding to the global array in row-major (C) order, reads it - back, and checks that the data read is correct. */ - -/* The file name is taken as a command-line argument. */ - -/* Note that the file access pattern is noncontiguous. */ - -int main(int argc, char **argv) -{ - MPI_Datatype newtype; - int i, ndims, array_of_gsizes[3], array_of_distribs[3]; - int order, nprocs, j, len; - int array_of_dargs[3], array_of_psizes[3]; - int *readbuf, *writebuf, mynod, *tmpbuf, array_size; - MPI_Count bufcount; - int errs=0, toterrs; - char *filename; - MPI_File fh; - MPI_Status status; - MPI_Request request; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!mynod) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: coll_test -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+1); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+1); - MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - -/* create the distributed array filetype */ - ndims = 3; - order = MPI_ORDER_C; - - array_of_gsizes[0] = 32; - array_of_gsizes[1] = 32; - array_of_gsizes[2] = 32; - - array_of_distribs[0] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[1] = MPI_DISTRIBUTE_BLOCK; - array_of_distribs[2] = MPI_DISTRIBUTE_BLOCK; - - array_of_dargs[0] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[1] = MPI_DISTRIBUTE_DFLT_DARG; - array_of_dargs[2] = MPI_DISTRIBUTE_DFLT_DARG; - - for (i=0; i 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - - MPI_Type_free(&newtype); - free(readbuf); - free(writebuf); - free(filename); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/status.c b/3rd-party/romio321/test/status.c deleted file mode 100644 index d64d5b2b0e0..00000000000 --- a/3rd-party/romio321/test/status.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2001 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ -#include "mpi.h" -#include -#include -#include - -#define SIZE (65536) - -/* Checks if the status objects is filled correctly by I/O functions */ - -int main(int argc, char **argv) -{ - int *buf, i, rank, nints, len, count, elements; - char *filename, *tmp; - int errs=0, toterrs; - MPI_File fh; - MPI_Status status; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - -/* process 0 takes the file name as a command-line argument and - broadcasts it to other processes */ - if (!rank) { - i = 1; - while ((i < argc) && strcmp("-fname", *argv)) { - i++; - argv++; - } - if (i >= argc) { - fprintf(stderr, "\n*# Usage: simple -fname filename\n\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - argv++; - len = strlen(*argv); - filename = (char *) malloc(len+10); - strcpy(filename, *argv); - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - else { - MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD); - filename = (char *) malloc(len+10); - MPI_Bcast(filename, len+10, MPI_CHAR, 0, MPI_COMM_WORLD); - } - - buf = (int *) malloc(SIZE); - nints = SIZE/sizeof(int); - - /* each process opens a separate file called filename.'myrank' */ - tmp = (char *) malloc(len+10); - strcpy(tmp, filename); - sprintf(filename, "%s.%d", tmp, rank); - - MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_CREATE | MPI_MODE_RDWR, - MPI_INFO_NULL, &fh); - MPI_File_write(fh, buf, nints, MPI_INT, &status); - - MPI_Get_count(&status, MPI_INT, &count); - MPI_Get_elements(&status, MPI_INT, &elements); - if (!rank) { - if (count != nints) { - errs++; - printf("count = %d, should be %d\n", count, nints); - } - if (elements != nints) { - errs++; - printf("elements = %d, should be %d\n", elements, nints); - } - } - - MPI_File_close(&fh); - - MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); - if (rank == 0) { - if( toterrs > 0) { - fprintf( stderr, "Found %d errors\n", toterrs ); - } - else { - fprintf( stdout, " No Errors\n" ); - } - } - free(buf); - free(filename); - free(tmp); - - MPI_Finalize(); - return 0; -} diff --git a/3rd-party/romio321/test/test_hintfile b/3rd-party/romio321/test/test_hintfile deleted file mode 100644 index edb72b0d6cb..00000000000 --- a/3rd-party/romio321/test/test_hintfile +++ /dev/null @@ -1,6 +0,0 @@ -romio_cb_read enable -# multiple info keys are strage but not an error. Note only the first one will -# be processed -ind_rd_buffer_size 49 -ind_rd_buffer_size 60 -romio_no_indep_rw true diff --git a/3rd-party/romio321/test/types_with_zeros.c b/3rd-party/romio321/test/types_with_zeros.c deleted file mode 100644 index e2f7799605b..00000000000 --- a/3rd-party/romio321/test/types_with_zeros.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ -/* - * (C) 2014 by Argonne National Laboratory. - * See COPYRIGHT in top-level directory. - */ - -#include -#include -#include -#include -#include -#include - -#include - -#define MAXLEN 9 - -static void handle_error(int errcode, const char *str) -{ - char msg[MPI_MAX_ERROR_STRING]; - int resultlen; - MPI_Error_string(errcode, msg, &resultlen); - fprintf(stderr, "%s: %s\n", str, msg); - MPI_Abort(MPI_COMM_WORLD, 1); -} - -enum { - INDEXED, - HINDEXED, - STRUCT -} testcases; - -static int test_indexed_with_zeros(char *filename, int testcase) -{ - int i, rank, np, buflen, num, err, nr_errors=0; - int nelms[MAXLEN], buf[MAXLEN], indices[MAXLEN], blocklen[MAXLEN]; - MPI_File fh; - MPI_Status status; - MPI_Datatype filetype; - MPI_Datatype types[MAXLEN]; - MPI_Aint addrs[MAXLEN]; - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &np); - - /* set up the number of integers to write in each iteration */ - for (i=0; i -#include -#include -#include - -/* - * This program tests to see if fcntl returns success when asked to - * establish a file lock. This test is intended for use on file systems - * such as NFS that may not implement file locks. ROMIO makes use - * of file locks to implement certain operations, and may not work - * properly if file locks are not available. - * - * This is a simple test and has at least two limitations: - * - * 1. Some implementations of NFS are known to return success for - * setting a file lock when in fact no lock has been set. This - * test will not detect such erroneous implementations of NFS - * - * 2. Some implementations will hang (enter and wait indefinitately) - * within the fcntl call. This program will also hang in that case. - * Under normal conditions, this program should only take a few seconds to - * run. - * - * The program prints a message showing the success or failure of - * setting the file lock and sets the return status to 0 on success and - * non-zero on failure. If there is a failure, the system routine - * perror is also called to explain the reason. - */ - -/* style: allow:printf:2 sig:0 */ - -int main( int argc, char *argv[] ) -{ - struct flock lock; - int fd, err; - char *filename; - - /* Set the filename. Either arg[1] or conftest.dat */ - if (argc > 1 && argv[1]) { - filename = argv[1]; - } - else { - filename = "conftest.dat"; - } - - - lock.l_type = F_WRLCK; - lock.l_start = 0; - lock.l_whence = SEEK_SET; - lock.l_len = 100; - - fd = open(filename, O_RDWR | O_CREAT, 0644); - - err = fcntl(fd, F_SETLKW, &lock); - - if (err) { - printf( "Failed to set a file lock on %s\n", filename ); - perror( "Reason " ); - } - else { - printf( "fcntl claims success in setting a file lock on %s\n", filename ); - } - /* printf("err = %d, errno = %d\n", err, errno); */ - close(fd); - unlink( filename ); - return err; -} diff --git a/3rd-party/romio321/util/romioinstall.in b/3rd-party/romio321/util/romioinstall.in deleted file mode 100644 index 95a63092315..00000000000 --- a/3rd-party/romio321/util/romioinstall.in +++ /dev/null @@ -1,220 +0,0 @@ -#!/bin/sh -# -# This script needs to be built by configure. -# -# This is a script to install ROMIO. It can be invoked with -# make install -# -# (if you used -prefix at configure time) or, -# -# make install prefix=/usr/local/romio (or whatever directory you like) -# -# in the top-level romio directory -# -PREFIX=@prefix@ -ROMIO_HOME=@ROMIO_HOME@ -ARCH=@ARCH@ -RANLIB=@RANLIB@ -TOP_BUILD_DIR=@top_build_dir@ -# LAM Do we want to install or uninstall? -WANT_INSTALL=1 -# -# Default paths (set at configure time) -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -includedir=@includedir@ -#sysconfdir=@sysconfdir@ -libdir=@libdir@ -#sharedlib_dir=@sharedlib_dir@ -mandir=@mandir@ -htmldir=@htmldir@ -# datarootdir required as of autoconf 2.60 -datarootdir=@datatrootdir@ -#datadir=@datadir@ -docdir=@docdir@ -## Location of sources -#top_srcdir=@top_srcdir@ -# -# File access mode -MODE=0644 -XMODE=0755 -replace=1 -verbose=0 - -failmode=soft - -# Shell procedures to copy files and create directories -# -# We could use install, but install is too different and too hard to -# test. So here are the routines to copy file, make directories, and -# replace #...# and @...@ in files -CP=cp -# -MkDir() { - if [ ! -e $1 ]; then mkdir $1 ; fi -} -CopyFile() { -if [ -z "$3" ] ; then -mode=$MODE -else -mode=$3 -fi -if [ -d $2 ] ; then -dest=$2/`basename $1` -else - dest=$2 -fi -if [ $replace = 0 -a -f $dest ] ; then - if [ $verbose = 1 ] ; then echo "$dest exists; not changed" ; fi -elif [ -d $1 ] ; then - echo ">>> $1 is a directory; not copied <<<" - errs=`expr $errs + 1` - if [ $failmode = "hard" ] ; then exit 1 ; fi -elif [ ! -f $1 ] ; then - echo "**File $1 does not exist (or is not a regular file)!" - errs=`expr $errs + 1` - if [ $failmode = "hard" ] ; then exit 1 ; fi -else - if [ $verbose = 1 ] ; then echo "Copying $1 to $dest" ; fi - # We don't delete the file in the event that we are copying the - # file over itself (we SHOULD check for that separately, by checking - # that directories are distinct) - #if [ -f $dest ] ; then $Show rm -f $dest ; fi - $Show $CP $1 $dest - rc=$? - if [ $rc != 0 ] ; then - echo "**Error copying file $1 to $dest **" - errs=`expr $errs + 1` - if [ $failmode = "hard" ] ; then exit $rc ; fi - else - echo "rm -f $dest" >> $UNINSTALLFILE - fi - $Show chmod $mode $dest - rc=$? - if [ $rc != 0 ] ; then - echo "**Error setting mode on file $dest**" - errs=`expr $errs + 1` - if [ $chmodefailmode = "hard" ] ; then exit $rc ; fi - fi -fi -} - -# -# A version of copy file that preserves file dates -CopyFileP() { - CP="cp -p" - CopyFile $1 $2 $3 - CP=cp -} - -# -for arg in "$@" ; do - case "$arg" in - -prefix=*) - PREFIX=`echo $arg | sed -e 's/-prefix=//'` - prefix=$PREFIX - ;; -# LAM Added -uninstall option - -uninstall) - WANT_INSTALL=0 - ;; - *) - echo "romioinstall: Unrecognized argument $arg ." - exit 1 - ;; - esac -done -if test -z "$prefix" ; then - echo "Usage: make install prefix=/usr/local/romio (or whatever directory you like)" - echo "in the top-level romio directory" -fi - -# Uninstall filename -if [ -z "$UNINSTALLFILE" ] ; then - UNINSTALLFILE="$sbindir/romiouninstall" - MkDir `dirname $UNINSTALLFILE` -fi - -# LAM top-level switch to install or uninstall -if test "$WANT_INSTALL" = "1"; then - -# Directories - -# Files - MkDir $prefix - - echo "copying directory $ROMIO_HOME/doc to $docdir" - MkDir $docdir - for file in COPYRIGHT README users-guide.ps.gz ; do - CopyFile $ROMIO_HOME/$file $docdir - done - - echo "copying directory include to $includedir" - MkDir $includedir - for file in include/*.h ; do - CopyFile $file $includedir - done - - MkDir $libdir - echo "copying directory $TOP_BUILD_DIR/lib to $libdir" - #cp -r $ROMIO_HOME/lib $PREFIX - #chmod 755 $PREFIX/lib - for file in $TOP_BUILD_DIR/lib/* ; do - if [ -f $file ] ; then - CopyFileP $file $libdir - fi - done - # Romio also copies directories in the lib directory. - - if [ -z "$mandir" ] ; then - mandir=$PREFIX/man - fi - echo "copying directory $ROMIO_HOME/man to $mandir" - MkDir $mandir - MkDir $mandir/man3 - for file in $ROMIO_HOME/man/man3/* ; do - CopyFile $file $mandir/man3 - done - - if [ -z "$exampledir" ] ; then exampledir=$PREFIX/examples ; fi - echo "copying directory $ROMIO_HOME/test to $exampledir" - MkDir $exampledir - MkDir $exampledir/std - for file in $ROMIO_HOME/test/std/* ; do - CopyFile $file $exampledir/std - done - CopyFile test/Makefile $exampledir - CopyFile test/README $exampledir - for file in test/*.c test/*.f test/runtests ; do - CopyFile $file $exampledir - done - # Ranlib should not be necessary if cp -p is used - #$RANLIB $PREFIX/lib/$ARCH/libmpio.a - # change the include and lib paths in Makefile in the test directory - - echo "updating paths in $exampledir/Makefile" - TMPNEWINC=-I$includedir - TMPNEWLIB=$libdir/$ARCH/libmpio.a - NEWINC=`echo $TMPNEWINC | sed 's/\//\\\\\//g'` - NEWLIB=`echo $TMPNEWLIB | sed 's/\//\\\\\//g'` - sed -e 5s/INCLUDE_DIR[\ ]*=\ [/a-z0-9.A-Z_-]*/INCLUDE_DIR\ =\ $NEWINC/ \ - -e 6s/LIBS[\ ]*=\ [/a-z0-9.A-Z_-]*/LIBS\ =\ $NEWLIB/ $exampledir/Makefile\ - > $exampledir/.romiotmp - mv $exampledir/.romiotmp $exampledir/Makefile - - # - MkDir $sbindir - echo "rm -f $UNINSTALLFILE" >> $UNINSTALLFILE - # Add the directory removes to the UNINSTALL file - for dir in $dirlist ; do - echo "if [ -d $dir ] ; then rmdir $dir ; fi" >> $UNINSTALLFILE - done -else - -# LAM do all the things for uninstall -- do the opposite of above. -# This whole section is new. - $sbindir/romiouninstall - echo "ROMIO uninstalled" -fi diff --git a/3rd-party/romio321/util/tarch b/3rd-party/romio321/util/tarch deleted file mode 100755 index ccccf4d514a..00000000000 --- a/3rd-party/romio321/util/tarch +++ /dev/null @@ -1,120 +0,0 @@ -#! /bin/sh -# set -x -# -# Returns the arch of the machine. This file is from MPICH. -# -# First, try some special cases: -if [ -d "/dev/elan" ] ; then - FARCH="meiko" -elif [ -f /usr/bin/uxpm ] && /usr/bin/uxpm ; then - FARCH="UXPM" -elif [ -f /usr/bin/uxpv ] && /usr/bin/uxpv ; then - FARCH="uxpv" -fi -if [ -n "$FARCH" ] ; then - echo $FARCH - exit 0 -fi -# -# Try to find uname -for dir in /bin /usr/bin /usr/local/bin ; do - if [ -x $dir/uname ] ; then - UNAME="$dir/uname" - break - fi -done -# -# Get uname -s, uname -m, and arch values -# -if [ -n "$UNAME" ] ; then - ARCHLIST="`uname -s`" - ARCHLIST="$ARCHLIST `uname -m`" -fi -# -# Get ARCH variable name -if [ -n "$ARCH" ] ; then - ARCHLIST="$ARCHLIST $ARCH" -fi -# -# Get arch command -if [ -x /bin/arch ] ; then - ARCHLIST="$ARCHLIST `/bin/arch`" -elif [ -x /usr/local/bin/arch ] ; then - ARCHLIST="$ARCHLIST `/usr/local/bin/arch`" -fi -# -# GARCH is a guess if we don't find something better -GARCH= -# Now, weed through all of these values until we find something useful. -for LARCH in $ARCHLIST ; do - # Remove blanks - LARCH=`echo $LARCH | sed 's/ //g'` - # Get the first 4 characters (you'd be surprised) - # LARCH4=`expr "$LARCH" : "\(....\)"` - # LARCH6=`expr "$LARCH" : "\(......\)"` - case $LARCH in - SUPER-UX) FARCH=SX4; break ;; - AIX|RIOS) FARCH=rs6000; break ;; - HP-UX) - if [ -a /dev/kmem ] ; then - FARCH=hpux ; - else - FARCH=sppux ; - fi - break ;; - IRIX64|IRIX) FARCH=$LARCH ; break ;; - Linux) FARCH=LINUX ; break ;; - i586|i486|i86pc) - GARCH=$LARCH ;; - sun4*) - Version=`$UNAME -r` - # In "improving" SunOS, the useful feature of "substr" was withdrawn - # from expr. Can't let the users have life too easy, can we? This - # means that we can't just use - # set MajorVersion = `expr substr $Version 1 1` - # because it won't work on Solaris systems. The following should work - # on both: - MajorVersion=`expr "$Version" : "\(.\)"` - if [ "$MajorVersion" -ge 5 ] ; then - FARCH=solaris - else - FARCH=sun4 - fi - break ;; - hp9000*|hp7000*) - if [ -a /dev/kmem ] ; then - FARCH=hpux ; - else - FARCH=sppux ; - fi - break ;; - Darwin*) - FARCH=Darwin - break ;; - - mips|dec-5000) FARCH=dec5000 ; break ;; - next) FARCH=NeXT ; break ;; - KSR1|KSR2) FARCH=ksr ; break ;; - FreeBSD) FARCH=freebsd ; break ;; - OpenBSD) FARCH=openbsd ; break ;; - NetBSD) FARCH=netbsd ; break ;; - - # The following are guesses - IP12|iris-4d) GARCH=IRIX ;; - cray|CRAY*) GARCH=CRAY ;; - i386) GARCH=ipsc2 ;; - ULTRIX|RISC) GARCH=dec5000 ;; - esac - LLARCH=$LARCH -done -if [ -z "$FARCH" ] ; then - FARCH=$GARCH - if [ -z "$FARCH" ] ; then - FARCH=$LLARCH - fi - if [ -z "$FARCH" ] ; then - FARCH=unknown - fi -fi -echo $FARCH -exit 0 diff --git a/3rd-party/treematch/IntConstantInitializedVector.c b/3rd-party/treematch/IntConstantInitializedVector.c index 25a6708b2c9..8b5961df7df 100644 --- a/3rd-party/treematch/IntConstantInitializedVector.c +++ b/3rd-party/treematch/IntConstantInitializedVector.c @@ -2,7 +2,7 @@ #include #include "IntConstantInitializedVector.h" -int intCIV_isInitialized(int_CIVector * v, int i) +int tm_intCIV_isInitialized(int_CIVector * v, int i) { if(v->top == 0) return 0; @@ -14,7 +14,7 @@ int intCIV_isInitialized(int_CIVector * v, int i) -void intCIV_init(int_CIVector * v, int size, int init_value) +void tm_intCIV_init(int_CIVector * v, int size, int init_value) { v->init_value = init_value; v->size = size; @@ -24,20 +24,20 @@ void intCIV_init(int_CIVector * v, int size, int init_value) v->vec = malloc(sizeof(int)*size); } -void intCIV_exit(int_CIVector * v) +static inline void intCIV_exit(int_CIVector * v) { free(v->to); free(v->from); free(v->vec); } -int intCIV_set(int_CIVector * v, int i, int val) +int tm_intCIV_set(int_CIVector * v, int i, int val) { if(v == NULL) return -1; if(i < 0 || i >= v->size) return -1; - if(!intCIV_isInitialized(v,i)) + if(!tm_intCIV_isInitialized(v,i)) { v->from[i] = v->top; v->to[v->top] = i; @@ -47,13 +47,13 @@ int intCIV_set(int_CIVector * v, int i, int val) return 0; } -int intCIV_get(int_CIVector * v, int i) +int tm_intCIV_get(int_CIVector * v, int i) { if(v == NULL) return -1; if(i < 0 || i >= v->size) return -1; - if(intCIV_isInitialized(v,i)) + if(tm_intCIV_isInitialized(v,i)) return v->vec[i]; return v->init_value; } diff --git a/3rd-party/treematch/IntConstantInitializedVector.h b/3rd-party/treematch/IntConstantInitializedVector.h index 25e5a1d759f..0906f8cf05a 100644 --- a/3rd-party/treematch/IntConstantInitializedVector.h +++ b/3rd-party/treematch/IntConstantInitializedVector.h @@ -1,15 +1,16 @@ #ifndef INTEGER_CONSTANT_INITIALIZED_VECTOR #define INTEGER_CONSTANT_INITIALIZED_VECTOR +#include "ompi_config.h" + typedef struct int_CIVector_ { int init_value, size, top, *to, *from, *vec; } int_CIVector; -int intCIV_isInitialized(int_CIVector * v, int i); -void intCIV_init(int_CIVector * v, int size, int init_value); -void intCIV_exit(int_CIVector * v); -int intCIV_set(int_CIVector * v, int i, int val); -int intCIV_get(int_CIVector * v, int i); +OMPI_HIDDEN int tm_intCIV_isInitialized(int_CIVector * v, int i); +OMPI_HIDDEN void tm_intCIV_init(int_CIVector * v, int size, int init_value); +OMPI_HIDDEN int tm_intCIV_set(int_CIVector * v, int i, int val); +OMPI_HIDDEN int tm_intCIV_get(int_CIVector * v, int i); #endif /*INTEGER_CONSTANT_INITIALIZED_VECTOR*/ diff --git a/3rd-party/treematch/Makefile.am b/3rd-party/treematch/Makefile.am index ef84755ebf9..42baa2f63d9 100644 --- a/3rd-party/treematch/Makefile.am +++ b/3rd-party/treematch/Makefile.am @@ -1,3 +1,12 @@ +# +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + sources = tm_bucket.h \ tm_mapping.h \ tm_timings.h tm_tree.h \ @@ -21,7 +30,7 @@ EXTRA_DIST = COPYING LICENSE noinst_LTLIBRARIES = libtreematch.la libtreematch_la_SOURCES = $(sources) -libtreematch_la_LDFLAGS = -static +libtreematch_la_LDFLAGS = distclean-local: rm config.h diff --git a/3rd-party/treematch/PriorityQueue.c b/3rd-party/treematch/PriorityQueue.c index 83e08ad2f2d..2b8fc387ec4 100644 --- a/3rd-party/treematch/PriorityQueue.c +++ b/3rd-party/treematch/PriorityQueue.c @@ -21,7 +21,7 @@ int PQ_init(PriorityQueue * const q, int size) q->elements = malloc(sizeof(QueueElement *) * size); for(i=0; i < size; i++) q->elements[i]=NULL; - return fiboTreeInit((FiboTree *)q, compFunc); + return tm_fiboTreeInit((FiboTree *)q, compFunc); } void PQ_exit(PriorityQueue * const q) @@ -35,7 +35,7 @@ void PQ_exit(PriorityQueue * const q) } if(q->elements != NULL) free(q->elements); - fiboTreeExit((FiboTree *)q); + tm_fiboTreeExit((FiboTree *)q); } void PQ_free(PriorityQueue * const q) { @@ -45,7 +45,7 @@ void PQ_free(PriorityQueue * const q) if(q->elements[i] != NULL) free(q->elements[i]); } - fiboTreeFree((FiboTree *)q); + tm_fiboTreeFree((FiboTree *)q); } int PQ_isEmpty(PriorityQueue * const q) @@ -68,7 +68,7 @@ void PQ_insertElement(PriorityQueue * const q, QueueElement * const e) } void PQ_deleteElement(PriorityQueue * const q, QueueElement * const e) { - fiboTreeDel((FiboTree *)q, (FiboNode *)(e)); + tm_fiboTreeDel((FiboTree *)q, (FiboNode *)(e)); q->elements[e->value] = NULL; e->isInQueue = 0; } @@ -93,12 +93,12 @@ void PQ_delete(PriorityQueue * const q, int val) QueueElement * PQ_findMaxElement(PriorityQueue * const q) { - QueueElement * e = (QueueElement *)(fiboTreeMin((FiboTree *)q)); + QueueElement * e = (QueueElement *)(tm_fiboTreeMin((FiboTree *)q)); return e; } QueueElement * PQ_deleteMaxElement(PriorityQueue * const q) { - QueueElement * e = (QueueElement *)(fiboTreeMin((FiboTree *)q)); + QueueElement * e = (QueueElement *)(tm_fiboTreeMin((FiboTree *)q)); if(e != NULL) { PQ_deleteElement(q, e); diff --git a/3rd-party/treematch/fibo.c b/3rd-party/treematch/fibo.c index 97070e7273a..81ddac82a75 100644 --- a/3rd-party/treematch/fibo.c +++ b/3rd-party/treematch/fibo.c @@ -28,6 +28,7 @@ ** ** The fact that you are presently reading this means that you have had ** knowledge of the CeCILL-B license and that you accept its terms. +** */ /************************************************************/ /** **/ @@ -69,6 +70,8 @@ #define memFree free #endif /* memAlloc */ +static FiboNode *fiboTreeConsolidate (FiboTree * const); + /*********************************************/ /* */ /* These routines deal with Fibonacci trees. */ @@ -83,7 +86,7 @@ */ int -fiboTreeInit ( +tm_fiboTreeInit ( FiboTree * const treeptr, int (* cmpfptr) (const FiboNode * const, const FiboNode * const)) { @@ -106,7 +109,7 @@ int (* cmpfptr) (const FiboNode * const, const FiboNode * c */ void -fiboTreeExit ( +tm_fiboTreeExit ( FiboTree * const treeptr) { if (treeptr->degrtab != NULL) @@ -122,7 +125,7 @@ FiboTree * const treeptr) */ void -fiboTreeFree ( +tm_fiboTreeFree ( FiboTree * const treeptr) { treeptr->rootdat.linkdat.prevptr = /* Link root node to itself */ @@ -138,7 +141,7 @@ FiboTree * const treeptr) ** - NULL : Fibonacci tree is empty. */ -FiboNode * +static FiboNode * fiboTreeConsolidate ( FiboTree * const treeptr) { @@ -229,7 +232,7 @@ FiboTree * const treeptr) #ifndef fiboTreeMin FiboNode * -fiboTreeMin ( +tm_fiboTreeMin ( FiboTree * const treeptr) { FiboNode * bestptr; @@ -279,7 +282,7 @@ FiboNode * const nodeptr) #ifndef fiboTreeDel void -fiboTreeDel ( +tm_fiboTreeDel ( FiboTree * const treeptr, FiboNode * const nodeptr) { diff --git a/3rd-party/treematch/fibo.h b/3rd-party/treematch/fibo.h index 32e0a7c0824..52d587a4f99 100644 --- a/3rd-party/treematch/fibo.h +++ b/3rd-party/treematch/fibo.h @@ -28,6 +28,7 @@ ** ** The fact that you are presently reading this means that you have had ** knowledge of the CeCILL-B license and that you accept its terms. +** */ /************************************************************/ /** **/ @@ -56,6 +57,8 @@ /** **/ /************************************************************/ +#include "ompi_config.h" + /* ** The type and structure definitions. */ @@ -101,13 +104,13 @@ typedef struct FiboTree_ { the algorithms have been de-recursived and written as macros. */ -#define fiboTreeLinkAfter(o,n) do { \ - FiboNode * nextptr; \ - nextptr = (o)->linkdat.nextptr; \ - (n)->linkdat.nextptr = nextptr; \ - (n)->linkdat.prevptr = (o); \ - nextptr->linkdat.prevptr = (n); \ - (o)->linkdat.nextptr = (n); \ +#define fiboTreeLinkAfter(o,n) do { \ + FiboNode * nextptr_loc; \ + nextptr_loc = (o)->linkdat.nextptr; \ + (n)->linkdat.nextptr = nextptr_loc; \ + (n)->linkdat.prevptr = (o); \ + nextptr_loc->linkdat.prevptr = (n); \ + (o)->linkdat.nextptr = (n); \ } while (0) #define fiboTreeUnlink(n) do { \ @@ -184,19 +187,18 @@ typedef struct FiboTree_ { #define static #endif -int fiboTreeInit (FiboTree * const, int (*) (const FiboNode * const, const FiboNode * const)); -void fiboTreeExit (FiboTree * const); -void fiboTreeFree (FiboTree * const); -FiboNode * fiboTreeConsolidate (FiboTree * const); +OMPI_HIDDEN int tm_fiboTreeInit (FiboTree * const, int (*) (const FiboNode * const, const FiboNode * const)); +OMPI_HIDDEN void tm_fiboTreeExit (FiboTree * const); +OMPI_HIDDEN void tm_fiboTreeFree (FiboTree * const); #ifndef fiboTreeAdd void fiboTreeAdd (FiboTree * const, FiboNode * const); #endif /* fiboTreeAdd */ #ifndef fiboTreeDel -void fiboTreeDel (FiboTree * const, FiboNode * const); +OMPI_HIDDEN void tm_fiboTreeDel (FiboTree * const, FiboNode * const); #endif /* fiboTreeDel */ -#ifndef fiboTreeMin -FiboNode * fiboTreeMin (FiboTree * const); -#endif /* fiboTreeMin */ +#ifndef treematch_fiboTreeMin +OMPI_HIDDEN FiboNode * tm_fiboTreeMin (FiboTree * const); +#endif /* treematch_fiboTreeMin */ #ifdef FIBO_DEBUG int fiboTreeCheck (const FiboTree * const); static int fiboTreeCheck2 (const FiboNode * const); diff --git a/3rd-party/treematch/k-partitioning.c b/3rd-party/treematch/k-partitioning.c index f035ffa24a1..567a69ae2e5 100644 --- a/3rd-party/treematch/k-partitioning.c +++ b/3rd-party/treematch/k-partitioning.c @@ -4,19 +4,19 @@ #include "tm_mt.h" #include "tm_verbose.h" -void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k); -void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus); -void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus); -double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus); -void balancing(int n, int deficit, int surplus, double ** const D, int * const part); -void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k); - -void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size); -double eval_cost2(int *,int,double **); -int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *constraints, int nb_constraints); -int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints); - -int* kPartitioning(double ** comm, int n, int k, int * constraints, int nb_constraints, int greedy_trials) +static void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k); +static void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus); +static void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus); +static double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus); +static void balancing(int n, int deficit, int surplus, double ** const D, int * const part); +static void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k); + +static void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size); +static double eval_cost2(int *,int,double **); +static int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *constraints, int nb_constraints); +static int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints); + +int* tm_kPartitioning(double ** comm, int n, int k, int * constraints, int nb_constraints, int greedy_trials) { /* ##### declarations & allocations ##### */ @@ -48,7 +48,7 @@ int* kPartitioning(double ** comm, int n, int k, int * constraints, int nb_const return part; } -void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k) +static void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k) { int i; *Q = calloc(k, sizeof(PriorityQueue)); /*one Q for each partition*/ @@ -58,7 +58,7 @@ void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, (*D)[i] = calloc(k, sizeof(double)); } -void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus) +static void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus) { int i,j; @@ -103,7 +103,7 @@ void initialization(int * const part, double ** const matrice, PriorityQueue * c *surplus = *deficit = 0; } -void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus) +static void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus) { int p,u,v,j; double d; @@ -149,7 +149,7 @@ void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart PQ_adjustKey(Qpart, part[u], d); /*we update the new highest possible gain in u's subset*/ } -double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus) +static double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus) { double res; if(*deficit == *surplus) /*if the current partition is balanced*/ @@ -159,7 +159,7 @@ double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * cons return res; } -void balancing(int n, int deficit, int surplus, double ** const D, int * const part) +static void balancing(int n, int deficit, int surplus, double ** const D, int * const part) { if(surplus != deficit) /*if the current partition is not balanced*/ { @@ -176,7 +176,7 @@ void balancing(int n, int deficit, int surplus, double ** const D, int * const p } } -void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k) +static void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k) { int i; PQ_exit(Qpart); @@ -195,7 +195,7 @@ void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst } -int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *constraints, int nb_constraints) +static int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *constraints, int nb_constraints) { int *res = NULL, *best_res=NULL, *size = NULL; int i,j,nb_trials; @@ -229,7 +229,7 @@ int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *const /* find a vertex not already partitionned*/ do{ /* call the mersenne twister PRNG of tm_mt.c*/ - j = genrand_int32() % n; + j = tm_genrand_int32() % n; } while ( res[j] != -1 ); /* allocate and update size of partition*/ res[j] = i; @@ -261,7 +261,7 @@ int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *const return best_res; } -void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size) +static void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size) { int i,best_part = -1; double cost, best_cost = -1; @@ -285,7 +285,7 @@ void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_ size[best_part]++; } -double eval_cost2(int *partition, int n, double **comm) +static double eval_cost2(int *partition, int n, double **comm) { double cost = 0; int i,j; @@ -298,7 +298,7 @@ double eval_cost2(int *partition, int n, double **comm) return cost; } -int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints) +static int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints) { int * part = NULL; if(greedy_trials>0) /*if greedy_trials > 0 then we use kpartition_greedy with greedy_trials trials*/ diff --git a/3rd-party/treematch/k-partitioning.h b/3rd-party/treematch/k-partitioning.h index 8db2392e1a5..6af695eb5c3 100644 --- a/3rd-party/treematch/k-partitioning.h +++ b/3rd-party/treematch/k-partitioning.h @@ -1,6 +1,8 @@ #ifndef K_PARTITIONING #define K_PARTITIONING +#include "ompi_config.h" + #include "PriorityQueue.h" /* @@ -14,7 +16,7 @@ - 0 : cyclic distribution of vertices - > 0 : use of kpartition_greedy with greedy_trials number of trials */ - -int* kPartitioning(double ** comm, int n, int k, int * const constraints, int nb_constraints, int greedy_trials); + +OMPI_HIDDEN int* tm_kPartitioning(double ** comm, int n, int k, int * const constraints, int nb_constraints, int greedy_trials); #endif /*K_PARTITIONING*/ diff --git a/3rd-party/treematch/tm_bucket.c b/3rd-party/treematch/tm_bucket.c index 2389aa4fc4e..73cc8017341 100644 --- a/3rd-party/treematch/tm_bucket.c +++ b/3rd-party/treematch/tm_bucket.c @@ -33,27 +33,28 @@ static int verbose_level = ERROR; static bucket_list_t global_bl = {0}; -int tab_cmp(const void*,const void*); -int old_bucket_id(int,int,bucket_list_t); -int bucket_id(int,int,bucket_list_t); -void display_bucket(bucket_t *); -void check_bucket(bucket_t *,double **,double, double); -void display_pivots(bucket_list_t); -void display_bucket_list(bucket_list_t); -void add_to_bucket(int,int,int,bucket_list_t); -void dfs(int,int,int,double *,double *,int,int); -void built_pivot_tree(bucket_list_t); -void fill_buckets(bucket_list_t); -int is_power_of_2(int); -void partial_sort(bucket_list_t *,double **,int); -void next_bucket_elem(bucket_list_t,int *,int *); -int add_edge_3(tm_tree_t *,tm_tree_t *,int,int,int *); -void free_bucket(bucket_t *); -void free_tab_bucket(bucket_t **,int); -void free_bucket_list(bucket_list_t); -void partial_update_val (int nb_args, void **args, int thread_id); -double bucket_grouping(tm_affinity_mat_t *,tm_tree_t *, tm_tree_t *, int ,int); -int tab_cmp(const void* x1,const void* x2) +static int tab_cmp(const void*,const void*); +static int old_bucket_id(int,int,bucket_list_t); +static int bucket_id(int,int,bucket_list_t); +static void display_bucket(bucket_t *); +static void check_bucket(bucket_t *,double **,double, double); +static void display_pivots(bucket_list_t); +static void display_bucket_list(bucket_list_t); +static void add_to_bucket(int,int,int,bucket_list_t); +static void dfs(int,int,int,double *,double *,int,int); +static void built_pivot_tree(bucket_list_t); +static void fill_buckets(bucket_list_t); +static int is_power_of_2(int); +static void partial_sort(bucket_list_t *,double **,int); +static void next_bucket_elem(bucket_list_t,int *,int *); +static int add_edge_3(tm_tree_t *,tm_tree_t *,int,int,int *); +static void free_bucket(bucket_t *); +static void free_tab_bucket(bucket_t **,int); +static void free_bucket_list(bucket_list_t); +static void partial_update_val (int nb_args, void **args, int thread_id); +double tm_bucket_grouping(tm_affinity_mat_t *,tm_tree_t *, tm_tree_t *, int ,int); + +static int tab_cmp(const void* x1,const void* x2) { int *e1 = NULL,*e2 = NULL,i1,i2,j1,j2; double **tab = NULL; @@ -82,7 +83,7 @@ int tab_cmp(const void* x1,const void* x2) } -int old_bucket_id(int i,int j,bucket_list_t bucket_list) +static inline int old_bucket_id(int i,int j,bucket_list_t bucket_list) { double *pivot = NULL,val; int n,sup,inf,p; @@ -111,7 +112,7 @@ int old_bucket_id(int i,int j,bucket_list_t bucket_list) return sup; } -int bucket_id(int i,int j,bucket_list_t bucket_list) +static int bucket_id(int i,int j,bucket_list_t bucket_list) { double *pivot_tree = NULL,val; int p,k; @@ -131,14 +132,14 @@ int bucket_id(int i,int j,bucket_list_t bucket_list) return (int)pivot_tree[p]; } -void display_bucket(bucket_t *b) +static void display_bucket(bucket_t *b) { printf("\tb.bucket=%p\n",(void *)b->bucket); printf("\tb.bucket_len=%d\n",(int)b->bucket_len); printf("\tb.nb_elem=%d\n",(int)b->nb_elem); } -void check_bucket(bucket_t *b,double **tab,double inf, double sup) +static void check_bucket(bucket_t *b,double **tab,double inf, double sup) { int i,j,k; for( k = 0 ; k < b->nb_elem ; k++ ){ @@ -152,7 +153,7 @@ void check_bucket(bucket_t *b,double **tab,double inf, double sup) } } -void display_pivots(bucket_list_t bucket_list) +static void display_pivots(bucket_list_t bucket_list) { int i; for( i = 0 ; i < bucket_list->nb_buckets-1 ; i++) @@ -160,7 +161,7 @@ void display_pivots(bucket_list_t bucket_list) printf("\n"); } -void display_bucket_list(bucket_list_t bucket_list) +static inline void display_bucket_list(bucket_list_t bucket_list) { int i; double inf,sup; @@ -184,7 +185,7 @@ void display_bucket_list(bucket_list_t bucket_list) } -void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list) +static void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list) { bucket_t *bucket = NULL; int N,n,size; @@ -222,7 +223,7 @@ void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list) /* exit(-1); */ } -void dfs(int i,int inf,int sup,double *pivot,double *pivot_tree,int depth,int max_depth) +static void dfs(int i,int inf,int sup,double *pivot,double *pivot_tree,int depth,int max_depth) { int p; if( depth == max_depth ) @@ -235,7 +236,7 @@ void dfs(int i,int inf,int sup,double *pivot,double *pivot_tree,int depth,int ma dfs(2*i+1,p+1,sup,pivot,pivot_tree,depth+1,max_depth); } -void built_pivot_tree(bucket_list_t bucket_list) +static void built_pivot_tree(bucket_list_t bucket_list) { double *pivot_tree = NULL,*pivot = NULL; int n,i,k; @@ -261,7 +262,7 @@ void built_pivot_tree(bucket_list_t bucket_list) } } -void fill_buckets(bucket_list_t bucket_list) +static void fill_buckets(bucket_list_t bucket_list) { int N,i,j,id; @@ -274,7 +275,7 @@ void fill_buckets(bucket_list_t bucket_list) } } -int is_power_of_2(int val) +static int is_power_of_2(int val) { int n = 1; do{ @@ -286,7 +287,7 @@ int is_power_of_2(int val) } -void partial_sort(bucket_list_t *bl,double **tab,int N) +static void partial_sort(bucket_list_t *bl,double **tab,int N) { double *pivot = NULL; int *sample = NULL; @@ -325,11 +326,11 @@ void partial_sort(bucket_list_t *bl,double **tab,int N) sample = (int*)MALLOC(2*sizeof(int)*n); for( k = 0 ; k < n ; k++ ){ - i = genrand_int32()%(N-2)+1; + i = tm_genrand_int32()%(N-2)+1; if( i == N-2 ) j = N-1; else - j = genrand_int32()%(N-i-2)+i+1; + j = tm_genrand_int32()%(N-i-2)+i+1; if(verbose_level >= DEBUG) printf("i=%d, j=%d\n",i,j); assert( i != j ); @@ -386,7 +387,7 @@ void partial_sort(bucket_list_t *bl,double **tab,int N) *bl = bucket_list; } -void next_bucket_elem(bucket_list_t bucket_list,int *i,int *j) +static void next_bucket_elem(bucket_list_t bucket_list,int *i,int *j) { bucket_t *bucket = bucket_list->bucket_tab[bucket_list->cur_bucket]; @@ -415,7 +416,7 @@ void next_bucket_elem(bucket_list_t bucket_list,int *i,int *j) } -int add_edge_3(tm_tree_t *tab_node, tm_tree_t *parent,int i,int j,int *nb_groups) +static int add_edge_3(tm_tree_t *tab_node, tm_tree_t *parent,int i,int j,int *nb_groups) { /* printf("%d <-> %d ?\n",tab_node[i].id,tab_node[j].id); */ if((!tab_node[i].parent) && (!tab_node[j].parent)){ @@ -464,7 +465,7 @@ int add_edge_3(tm_tree_t *tab_node, tm_tree_t *parent,int i,int j,int *nb_groups return 0; } -int try_add_edge(tm_tree_t *tab_node, tm_tree_t *parent,int arity,int i,int j,int *nb_groups) +int tm_try_add_edge(tm_tree_t *tab_node, tm_tree_t *parent,int arity,int i,int j,int *nb_groups) { assert( i != j ); @@ -492,13 +493,13 @@ int try_add_edge(tm_tree_t *tab_node, tm_tree_t *parent,int arity,int i,int j,in } } -void free_bucket(bucket_t *bucket) +static void free_bucket(bucket_t *bucket) { FREE(bucket->bucket); FREE(bucket); } -void free_tab_bucket(bucket_t **bucket_tab,int N) +static void free_tab_bucket(bucket_t **bucket_tab,int N) { int i; for( i = 0 ; i < N ; i++ ) @@ -506,7 +507,7 @@ void free_tab_bucket(bucket_t **bucket_tab,int N) FREE(bucket_tab); } -void free_bucket_list(bucket_list_t bucket_list) +static void free_bucket_list(bucket_list_t bucket_list) { /* Do not free the tab field it is used elsewhere */ free_tab_bucket(bucket_list->bucket_tab,bucket_list->nb_buckets); @@ -515,7 +516,7 @@ void free_bucket_list(bucket_list_t bucket_list) FREE(bucket_list); } -void partial_update_val (int nb_args, void **args, int thread_id){ +static void partial_update_val (int nb_args, void **args, int thread_id){ int inf = *(int*)args[0]; int sup = *(int*)args[1]; tm_affinity_mat_t *aff_mat = (tm_affinity_mat_t*)args[2]; @@ -530,12 +531,12 @@ void partial_update_val (int nb_args, void **args, int thread_id){ } for( l = inf ; l < sup ; l++ ){ - update_val(aff_mat,&new_tab_node[l]); + tm_update_val(aff_mat,&new_tab_node[l]); *res += new_tab_node[l].val; } } -double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t *new_tab_node, +double tm_bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity,int M) { bucket_list_t bucket_list; @@ -576,7 +577,7 @@ double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t printf("elem[%d][%d]=%f ",i,j,mat[i][j]); gr1_1 += TOC; TIC; - if(try_add_edge(tab_node,&new_tab_node[l],arity,i,j,&nb_groups)){ + if(tm_try_add_edge(tab_node,&new_tab_node[l],arity,i,j,&nb_groups)){ l++; } gr1_2 += TOC; @@ -584,7 +585,7 @@ double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t }else{ while( l < M ){ next_bucket_elem(bucket_list,&i,&j); - if(try_add_edge(tab_node,&new_tab_node[l],arity,i,j,&nb_groups)){ + if(tm_try_add_edge(tab_node,&new_tab_node[l],arity,i,j,&nb_groups)){ l++; } } @@ -600,7 +601,7 @@ double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t TIC; while( nb_groups < M ){ next_bucket_elem(bucket_list,&i,&j); - try_add_edge(tab_node,NULL,arity,i,j,&nb_groups); + tm_try_add_edge(tab_node,NULL,arity,i,j,&nb_groups); } gr2=TOC; @@ -621,7 +622,7 @@ double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t int *sup; double *tab_val; - nb_threads = get_nb_threads(); + nb_threads = tm_get_nb_threads(); works = (work_t**)MALLOC(sizeof(work_t*)*nb_threads); inf = (int*)MALLOC(sizeof(int)*nb_threads); sup = (int*)MALLOC(sizeof(int)*nb_threads); @@ -637,18 +638,18 @@ double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t args[3]=(void*)new_tab_node; args[4]=(void*)(tab_val+id); - works[id]= create_work(5,args,partial_update_val); + works[id]= tm_create_work(5,args,partial_update_val); if(verbose_level >= DEBUG) printf("Executing %p\n",(void *)works[id]); - submit_work( works[id], id); + tm_submit_work( works[id], id); } for(id=0;idargs); - destroy_work(works[id]); + tm_destroy_work(works[id]); } @@ -659,7 +660,7 @@ double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t }else{ for( l = 0 ; l < M ; l++ ){ - update_val(aff_mat,&new_tab_node[l]); + tm_update_val(aff_mat,&new_tab_node[l]); val += new_tab_node[l].val; } } diff --git a/3rd-party/treematch/tm_bucket.h b/3rd-party/treematch/tm_bucket.h index 433d4816466..b9ff10f0c39 100644 --- a/3rd-party/treematch/tm_bucket.h +++ b/3rd-party/treematch/tm_bucket.h @@ -1,6 +1,8 @@ #ifndef __BUCKET_H__ #define __BUCKET_H__ +#include "ompi_config.h" + typedef struct{ int i; int j; @@ -28,8 +30,8 @@ typedef struct{ typedef _bucket_list_t *bucket_list_t; -double bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t *new_tab_node, +OMPI_HIDDEN double tm_bucket_grouping(tm_affinity_mat_t *aff_mat,tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity,int M); -int try_add_edge(tm_tree_t *tab_node, tm_tree_t *parent,int arity,int i,int j,int *nb_groups); +OMPI_HIDDEN int tm_try_add_edge(tm_tree_t *tab_node, tm_tree_t *parent,int arity,int i,int j,int *nb_groups); #endif diff --git a/3rd-party/treematch/tm_kpartitioning.c b/3rd-party/treematch/tm_kpartitioning.c index 09cb35add50..278c76880a0 100644 --- a/3rd-party/treematch/tm_kpartitioning.c +++ b/3rd-party/treematch/tm_kpartitioning.c @@ -5,6 +5,7 @@ #include #include #include "config.h" +#include "ompi_config.h" #if defined(HAVE_LIBSCOTCH) #include @@ -20,22 +21,22 @@ static int verbose_level = ERROR; #define USE_KL_STRATEGY 1 -#define MIN(a,b) ((a)<(b)?(a):(b)) +#define TM_MIN(a,b) ((a)<(b)?(a):(b)) -int fill_tab(int **,int *,int,int,int,int); -void complete_obj_weight(double **,int,int); +OMPI_HIDDEN int tm_fill_tab(int **,int *,int,int,int,int); +OMPI_HIDDEN void tm_complete_obj_weight(double **,int,int); -void allocate_vertex(int,int *,com_mat_t *,int,int *,int); -double eval_cost(int *, com_mat_t *); -int *kpartition_greedy(int, com_mat_t *,int,int *,int); -constraint_t *split_constraints (int *,int,int,tm_topology_t *,int, int); -com_mat_t **split_com_mat(com_mat_t *,int,int,int *); -int **split_vertices(int *,int,int,int *); -void free_tab_com_mat(com_mat_t **,int); -void free_tab_local_vertices(int **,int); -void free_const_tab(constraint_t *,int); -void kpartition_build_level_topology(tm_tree_t *,com_mat_t *,int,int,tm_topology_t *, +static void allocate_vertex(int,int *,com_mat_t *,int,int *,int); +static double eval_cost(int *, com_mat_t *); +static int *kpartition_greedy(int, com_mat_t *,int,int *,int); +static constraint_t *split_constraints (int *,int,int,tm_topology_t *,int, int); +static com_mat_t **split_com_mat(com_mat_t *,int,int,int *); +static int **split_vertices(int *,int,int,int *); +static void free_tab_com_mat(com_mat_t **,int); +static void free_tab_local_vertices(int **,int); +static void free_const_tab(constraint_t *,int); +static void kpartition_build_level_topology(tm_tree_t *,com_mat_t *,int,int,tm_topology_t *, int *,int *,int,double *,double *); static int greedy_flag = 0; @@ -287,7 +288,7 @@ int *kpartition_scotch(int k, com_mat_t *com_mat, int n, int *constraints, int #endif /* defined(HAVE_LIBSCOTCH) */ -void allocate_vertex(int u, int *res, com_mat_t *com_mat, int n, int *size, int max_size) +static void allocate_vertex(int u, int *res, com_mat_t *com_mat, int n, int *size, int max_size) { int i,best_part=0; double cost, best_cost = -1; @@ -324,7 +325,7 @@ void allocate_vertex(int u, int *res, com_mat_t *com_mat, int n, int *size, int size[best_part]++; } -double eval_cost(int *partition, com_mat_t *com_mat) +static double eval_cost(int *partition, com_mat_t *com_mat) { double cost = 0; int i,j; @@ -337,7 +338,7 @@ double eval_cost(int *partition, com_mat_t *com_mat) return cost; } -int *kpartition_greedy(int k, com_mat_t *com_mat, int n, int *constraints, int nb_constraints) +static int *kpartition_greedy(int k, com_mat_t *com_mat, int n, int *constraints, int nb_constraints) { int *partition = NULL, *best_partition=NULL, *size = NULL; int i,j,nb_trials; @@ -362,7 +363,8 @@ int *kpartition_greedy(int k, com_mat_t *com_mat, int n, int *constraints, int printf("nb_constraints = %d\n",nb_constraints); if(n<=16){ - printf("Constraints: ");print_1D_tab(constraints,nb_constraints); + printf("Constraints: "); + tm_print_1D_tab(constraints,nb_constraints); } } /* if(com_mat->n){ */ @@ -424,7 +426,7 @@ int *kpartition_greedy(int k, com_mat_t *com_mat, int n, int *constraints, int /* find a vertex not allready partitionned*/ do{ /* call the mersenne twister PRNG of tm_mt.c*/ - j = genrand_int32() % n; + j = tm_genrand_int32() % n; } while ( partition[j] != -1 ); /* allocate and update size of partition*/ partition[j] = i; @@ -460,7 +462,7 @@ int *kpartition_greedy(int k, com_mat_t *com_mat, int n, int *constraints, int return best_partition; } -int *kpartition(int k, com_mat_t *com_mat, int n, int *constraints, int nb_constraints) +int *tm_kpartition(int k, com_mat_t *com_mat, int n, int *constraints, int nb_constraints) { int *res= NULL; @@ -493,7 +495,7 @@ int *kpartition(int k, com_mat_t *com_mat, int n, int *constraints, int nb_const return res; } -constraint_t *split_constraints (int *constraints, int nb_constraints, int k, tm_topology_t *topology, int depth, int N) +static constraint_t *split_constraints (int *constraints, int nb_constraints, int k, tm_topology_t *topology, int depth, int N) { constraint_t *const_tab = NULL; int nb_leaves, start, end; @@ -505,7 +507,7 @@ constraint_t *split_constraints (int *constraints, int nb_constraints, int k, tm /* nb_leaves is the number of leaves of the current subtree this will help to determine where to split constraints and how to shift values */ - nb_leaves = compute_nb_leaves_from_level( depth + 1, topology ); + nb_leaves = tm_compute_nb_leaves_from_level( depth + 1, topology ); /* split the constraints into k sub-constraints each sub-contraints 'i' contains constraints of value in [i*nb_leaves,(i+1)*nb_leaves[ @@ -515,12 +517,12 @@ constraint_t *split_constraints (int *constraints, int nb_constraints, int k, tm for( i = 0; i < k; i++ ){ /*returns the indice in constraints that contains the smallest value not copied end is used to compute the number of copied elements (end-size) and is used as the next staring indices*/ - end = fill_tab(&(const_tab[i].constraints), constraints, nb_constraints,start, (i+1) * nb_leaves, i * nb_leaves); + end = tm_fill_tab(&(const_tab[i].constraints), constraints, nb_constraints,start, (i+1) * nb_leaves, i * nb_leaves); const_tab[i].length = end-start; if(vl>=DEBUG){ printf("Step %d\n",i); - printf("\tConstraint: "); print_1D_tab(constraints, nb_constraints); - printf("\tSub constraint: "); print_1D_tab(const_tab[i].constraints, end-start); + printf("\tConstraint: "); tm_print_1D_tab(constraints, nb_constraints); + printf("\tSub constraint: "); tm_print_1D_tab(const_tab[i].constraints, end-start); } if(end-start > N/k){ @@ -539,7 +541,7 @@ constraint_t *split_constraints (int *constraints, int nb_constraints, int k, tm /* split the com_mat of order n in k partiton according to parmutition table*/ -com_mat_t **split_com_mat(com_mat_t *com_mat, int n, int k, int *partition) +static com_mat_t **split_com_mat(com_mat_t *com_mat, int n, int k, int *partition) { com_mat_t **res = NULL, *sub_com_mat; double **sub_mat = NULL; @@ -550,8 +552,8 @@ com_mat_t **split_com_mat(com_mat_t *com_mat, int n, int k, int *partition) if(verbose_level >= DEBUG){ - printf("Partition: "); print_1D_tab(partition,n); - display_tab(com_mat->comm,com_mat->n); + printf("Partition: "); tm_print_1D_tab(partition,n); + tm_display_tab(com_mat->comm,com_mat->n); printf("m=%d,n=%d,k=%d\n",m,n,k); printf("perm=%p\n", (void *)perm); } @@ -571,8 +573,8 @@ com_mat_t **split_com_mat(com_mat_t *com_mat, int n, int k, int *partition) if(s>m){ if(verbose_level >= CRITICAL){ - fprintf(stderr,"Partition: "); print_1D_tab(partition,n); - display_tab(com_mat->comm,com_mat->n); + fprintf(stderr,"Partition: "); tm_print_1D_tab(partition,n); + tm_display_tab(com_mat->comm,com_mat->n); fprintf(stderr,"too many elements of the partition for the permuation (s=%d>%d=m). n=%d, k=%d, cur_part= %d\n",s,m,n,k, cur_part); } exit(-1); @@ -609,7 +611,7 @@ com_mat_t **split_com_mat(com_mat_t *com_mat, int n, int k, int *partition) return res; } -int **split_vertices( int *vertices, int n, int k, int *partition) +static int **split_vertices( int *vertices, int n, int k, int *partition) { int **res = NULL, *sub_vertices = NULL; int m = n/k; @@ -620,8 +622,8 @@ int **split_vertices( int *vertices, int n, int k, int *partition) if(verbose_level >= DEBUG){ - printf("Partition: ");print_1D_tab(partition,n); - printf("Vertices id: ");print_1D_tab(vertices,n); + printf("Partition: ");tm_print_1D_tab(partition,n); + printf("Vertices id: ");tm_print_1D_tab(vertices,n); } /*split the vertices tab of the partition cur_part to the sub_vertices tab*/ @@ -633,14 +635,14 @@ int **split_vertices( int *vertices, int n, int k, int *partition) sub_vertices[i++] = vertices[j]; res[cur_part] = sub_vertices; if(verbose_level >= DEBUG){ - printf("partition %d: ",cur_part);print_1D_tab(sub_vertices,m); + printf("partition %d: ",cur_part);tm_print_1D_tab(sub_vertices,m); } } /*exit(-1);*/ return res; } -void free_tab_com_mat(com_mat_t **mat,int k) +static void free_tab_com_mat(com_mat_t **mat,int k) { int i,j; if( !mat ) @@ -656,7 +658,7 @@ void free_tab_com_mat(com_mat_t **mat,int k) FREE(mat); } -void free_tab_local_vertices(int **mat, int k) +static void free_tab_local_vertices(int **mat, int k) { int i; /* m=n/k; */ if( !mat ) @@ -669,7 +671,7 @@ void free_tab_local_vertices(int **mat, int k) } -void free_const_tab(constraint_t *const_tab, int k) +static void free_const_tab(constraint_t *const_tab, int k) { int i; @@ -717,7 +719,7 @@ static void display_partition(int *partition, int *local_vertices, int n, int de } } -void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, int N, int depth, +static void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, int N, int depth, tm_topology_t *topology, int *local_vertices, int *constraints, int nb_constraints, double *obj_weight, double *comm_speed) @@ -736,7 +738,7 @@ void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, in if ( depth == topology->nb_levels - 1 ){ if(verbose_level>=DEBUG) printf("id : %d, com_mat= %p\n",local_vertices[0], (void *)com_mat->comm); - set_node(cur_node,NULL, 0, NULL, local_vertices[0], 0, NULL, depth); + tm_set_node(cur_node,NULL, 0, NULL, local_vertices[0], 0, NULL, depth); return; } @@ -748,7 +750,7 @@ void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, in /* check_com_mat(com_mat); */ /* partition the com_matrix in k partitions*/ - partition = kpartition(k, com_mat, N, constraints, nb_constraints); + partition = tm_kpartition(k, com_mat, N, constraints, nb_constraints); if(verbose_level>=INFO) display_partition(partition, local_vertices, N, depth, k); @@ -780,7 +782,7 @@ void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, in } /* link the node with its child */ - set_node( cur_node, tab_child, k, NULL, cur_node->id, 0, NULL, depth); + tm_set_node( cur_node, tab_child, k, NULL, cur_node->id, 0, NULL, depth); /* free local data*/ FREE(partition); @@ -790,7 +792,7 @@ void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, in } -tm_tree_t *kpartition_build_tree_from_topology(tm_topology_t *topology,double **comm,int N, int *constraints, int nb_constraints, double *obj_weight, double *com_speed) +tm_tree_t *tm_kpartition_build_tree_from_topology(tm_topology_t *topology,double **comm,int N, int *constraints, int nb_constraints, double *obj_weight, double *com_speed) { int depth,i, K; tm_tree_t *root = NULL; @@ -801,7 +803,7 @@ tm_tree_t *kpartition_build_tree_from_topology(tm_topology_t *topology,double ** verbose_level = tm_get_verbose_level(); - nb_cores=nb_processing_units(topology)*topology->oversub_fact; + nb_cores=tm_nb_processing_units(topology)*topology->oversub_fact; if(verbose_level>=INFO) @@ -824,7 +826,7 @@ tm_tree_t *kpartition_build_tree_from_topology(tm_topology_t *topology,double ** /* if we have more cores than processes add new dumb process to the com matrix*/ if((K=nb_cores - N)>0){ /* add K element to the object weight*/ - complete_obj_weight(&obj_weight,N,K); + tm_complete_obj_weight(&obj_weight,N,K); } else if( K < 0){ if(verbose_level>=ERROR) fprintf(stderr,"Not enough cores!\n"); @@ -847,9 +849,9 @@ tm_tree_t *kpartition_build_tree_from_topology(tm_topology_t *topology,double ** local_vertices = (int*) MALLOC (sizeof(int) * (K+N)); - for( i = 0 ; i < MIN(N,nb_constraints) ; i++) + for( i = 0 ; i < TM_MIN(N,nb_constraints) ; i++) local_vertices[i] = i; - for( i = MIN(N,nb_constraints) ;i < N + K ; i++) + for( i = TM_MIN(N,nb_constraints) ;i < N + K ; i++) local_vertices[i] = -1; /* we assume all objects have the same arity*/ diff --git a/3rd-party/treematch/tm_kpartitioning.h b/3rd-party/treematch/tm_kpartitioning.h index 09c2227c066..766a3c9cfc3 100644 --- a/3rd-party/treematch/tm_kpartitioning.h +++ b/3rd-party/treematch/tm_kpartitioning.h @@ -1,3 +1,5 @@ +#include "ompi_config.h" + typedef struct _com_mat_t{ double **comm; int n; /*comm is of size n by n the other element are zeroes*/ @@ -5,5 +7,5 @@ typedef struct _com_mat_t{ } com_mat_t; -int *kpartition(int, com_mat_t*, int, int *, int); -tm_tree_t * kpartition_build_tree_from_topology(tm_topology_t *topology,double **com_mat,int N, int *constraints, int nb_constraints, double *obj_weight, double *com_speed); +OMPI_HIDDEN int *tm_kpartition(int, com_mat_t*, int, int *, int); +OMPI_HIDDEN tm_tree_t * tm_kpartition_build_tree_from_topology(tm_topology_t *topology,double **com_mat,int N, int *constraints, int nb_constraints, double *obj_weight, double *com_speed); diff --git a/3rd-party/treematch/tm_malloc.c b/3rd-party/treematch/tm_malloc.c index b0eaa9e7030..422c94c28bf 100644 --- a/3rd-party/treematch/tm_malloc.c +++ b/3rd-party/treematch/tm_malloc.c @@ -10,7 +10,7 @@ #include "tm_mt.h" -#define MIN(a,b) ((a)<(b)?(a):(b)) +#define TM_MIN(a,b) ((a)<(b)?(a):(b)) #define EXTRA_BYTE 100 @@ -102,10 +102,10 @@ void init_extra_data(void){ if(done) return; - init_genrand(0); + tm_init_genrand(0); for( i = 0 ; i < EXTRA_BYTE; i++) - extra_data[i] = (char) genrand_int32() % 256; + extra_data[i] = (char) tm_genrand_int32() % 256; done = 1; } @@ -182,7 +182,7 @@ void *tm_realloc(void *old_ptr, size_t size, char *file, int line){ byte *original_ptr = ((byte *)old_ptr) - EXTRA_BYTE; size_t old_ptr_size = retreive_size(original_ptr); - memcpy(ptr + EXTRA_BYTE, old_ptr, MIN(old_ptr_size - 2 * EXTRA_BYTE, size)); + memcpy(ptr + EXTRA_BYTE, old_ptr, TM_MIN(old_ptr_size - 2 * EXTRA_BYTE, size)); if((bcmp(original_ptr ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){ fprintf(stderr,"Realloc: cannot find special string ***before*** %p!\n", (void *)original_ptr); diff --git a/3rd-party/treematch/tm_malloc.h b/3rd-party/treematch/tm_malloc.h index f74cd3db6af..79754c6c70d 100644 --- a/3rd-party/treematch/tm_malloc.h +++ b/3rd-party/treematch/tm_malloc.h @@ -2,11 +2,13 @@ #define _TM_MALLOC_H_ #include -void *tm_malloc(size_t size, char *, int); -void *tm_calloc(size_t count, size_t size, char *, int); -void *tm_realloc(void *ptr, size_t size, char *, int); -void tm_free(void *ptr); -void tm_mem_check(void); +#include "ompi_config.h" + +OMPI_HIDDEN void *tm_malloc(size_t size, char *, int); +OMPI_HIDDEN void *tm_calloc(size_t count, size_t size, char *, int); +OMPI_HIDDEN void *tm_realloc(void *ptr, size_t size, char *, int); +OMPI_HIDDEN void tm_free(void *ptr); +OMPI_HIDDEN void tm_mem_check(void); /* for debugging malloc */ /* #define __DEBUG_TM_MALLOC__ */ diff --git a/3rd-party/treematch/tm_mapping.c b/3rd-party/treematch/tm_mapping.c index b30846c0ccd..6de0d6bcc7d 100644 --- a/3rd-party/treematch/tm_mapping.c +++ b/3rd-party/treematch/tm_mapping.c @@ -28,9 +28,6 @@ #include - -#define MIN(a,b) (a)<(b)?(a):(b) - #define TEST_ERROR(n) do{ \ if( (n) != 0 ){ \ fprintf(stderr,"Error %d Line %d\n",n,__LINE__); \ @@ -47,25 +44,25 @@ typedef struct { } hash2_t; -tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz); -int compute_nb_leaves_from_level(int depth,tm_topology_t *topology); -void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i); -int fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift); -long int init_mat(char *filename,int N, double **mat, double *sum_row); -void map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, +OMPI_HIDDEN tm_affinity_mat_t * tm_new_affinity_mat(double **mat, double *sum_row, int order, long int nnz); +OMPI_HIDDEN int tm_compute_nb_leaves_from_level(int depth,tm_topology_t *topology); +static void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i); +OMPI_HIDDEN int tm_fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift); +static long int init_mat(char *filename,int N, double **mat, double *sum_row); +OMPI_HIDDEN void tm_map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, int *sigma, int nb_processes, int **k, int nb_compute_units); -int nb_leaves(tm_tree_t *comm_tree); -int nb_lines(char *filename); -void print_1D_tab(int *tab,int N); +static int nb_leaves(tm_tree_t *comm_tree); +static int nb_lines(char *filename); +OMPI_HIDDEN void tm_print_1D_tab(int *tab,int N); tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree); void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat); -tm_affinity_mat_t *tm_load_aff_mat(char *filename); -void update_comm_speed(double **comm_speed,int old_size,int new_size); +OMPI_HIDDEN tm_affinity_mat_t *tm_load_aff_mat(char *filename); +static void update_comm_speed(double **comm_speed,int old_size,int new_size); tm_affinity_mat_t * tm_build_affinity_mat(double **mat, int order); /* compute the number of leaves of any subtree starting froma node of depth depth*/ -int compute_nb_leaves_from_level(int depth,tm_topology_t *topology) +int tm_compute_nb_leaves_from_level(int depth,tm_topology_t *topology) { int res = 1; @@ -76,13 +73,13 @@ int compute_nb_leaves_from_level(int depth,tm_topology_t *topology) } void tm_finalize(){ - terminate_thread_pool(); + tm_terminate_thread_pool(); tm_mem_check(); } -void print_1D_tab(int *tab,int N) +void tm_print_1D_tab(int *tab,int N) { int i; for (i = 0; i < N; i++) { @@ -93,7 +90,7 @@ void print_1D_tab(int *tab,int N) printf("\n"); } -int nb_lines(char *filename) +static int nb_lines(char *filename) { FILE *pf = NULL; char line[LINE_SIZE]; @@ -117,7 +114,7 @@ int nb_lines(char *filename) -long int init_mat(char *filename,int N, double **mat, double *sum_row){ +static inline long int init_mat(char *filename,int N, double **mat, double *sum_row){ FILE *pf = NULL; char *ptr= NULL; char line[LINE_SIZE]; @@ -275,7 +272,7 @@ static long int init_mat_long(char *filename,int N, double **mat, double *sum_ro } #endif -tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz){ +tm_affinity_mat_t * tm_new_affinity_mat(double **mat, double *sum_row, int order, long int nnz){ tm_affinity_mat_t * aff_mat; aff_mat = (tm_affinity_mat_t *) MALLOC(sizeof(tm_affinity_mat_t)); @@ -304,7 +301,7 @@ tm_affinity_mat_t * tm_build_affinity_mat(double **mat, int order){ } } - return new_affinity_mat(mat, sum_row, order, nnz); + return tm_new_affinity_mat(mat, sum_row, order, nnz); } @@ -368,7 +365,7 @@ tm_affinity_mat_t *tm_load_aff_mat(char *filename) if(tm_get_verbose_level() >= INFO) printf("Affinity matrix built from %s!\n",filename); - return new_affinity_mat(mat, sum_row, order, nnz); + return tm_new_affinity_mat(mat, sum_row, order, nnz); } @@ -396,7 +393,7 @@ tm_affinity_mat_t *tm_load_aff_mat(char *filename) }*/ /* } */ -void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i) +static void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i) { int j; if(!comm_tree->child){ @@ -408,7 +405,7 @@ void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i) depth_first(comm_tree->child[j],proc_list,i); } -int nb_leaves(tm_tree_t *comm_tree) +static int nb_leaves(tm_tree_t *comm_tree) { int j,n=0; @@ -452,7 +449,7 @@ static void set_val(int *tab, int val, int n){ k_i =-1 if no process is mapped on core i */ -void map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, +void tm_map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, int *sigma, int nb_processes, int **k, int nb_compute_units) { int *nodes_id = NULL; @@ -482,7 +479,7 @@ void map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, if(k){/*if we need the k vector*/ if(vl >= INFO) printf("M=%d, N=%d, BS=%d\n",M,N,block_size); - for( i = 0 ; i < nb_processing_units(topology) ; i++ ) + for( i = 0 ; i < tm_nb_processing_units(topology) ; i++ ) for(j = 0 ; j < topology->oversub_fact ; j++){ k[i][j] = -1; } @@ -511,7 +508,7 @@ void map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, if((vl >= DEBUG) && (k)){ printf("k: "); - for( i = 0 ; i < nb_processing_units(topology) ; i++ ){ + for( i = 0 ; i < tm_nb_processing_units(topology) ; i++ ){ printf("Procesing unit %d: ",i); for (j = 0 ; joversub_fact; j++){ if( k[i][j] == -1) @@ -531,7 +528,7 @@ tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree) tm_solution_t *solution; int *sigma, **k; size_t sigma_length = comm_tree->nb_processes; - size_t k_length = nb_processing_units(topology); + size_t k_length = tm_nb_processing_units(topology); solution = (tm_solution_t *)MALLOC(sizeof(tm_solution_t)); sigma = (int*) MALLOC(sizeof(int) * sigma_length); @@ -540,7 +537,7 @@ tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree) k[i] = (int*) MALLOC(sizeof(int) * topology->oversub_fact); } - map_topology(topology, comm_tree, topology->nb_levels-1, sigma, sigma_length ,k, k_length); + tm_map_topology(topology, comm_tree, topology->nb_levels-1, sigma, sigma_length ,k, k_length); solution->sigma = sigma; solution->sigma_length = sigma_length; @@ -553,7 +550,7 @@ tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree) -void update_comm_speed(double **comm_speed,int old_size,int new_size) +static inline void update_comm_speed(double **comm_speed,int old_size,int new_size) { double *old_tab = NULL,*new_tab= NULL; int i; @@ -588,7 +585,7 @@ void update_comm_speed(double **comm_speed,int old_size,int new_size) copy element of tab in *new_tab from start to end and shift negativeley them allocates *new_tab */ -int fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift) +int tm_fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift) { int *res = NULL,i,j,end; diff --git a/3rd-party/treematch/tm_mapping.h b/3rd-party/treematch/tm_mapping.h index 8e8c1985535..c19681eda7a 100644 --- a/3rd-party/treematch/tm_mapping.h +++ b/3rd-party/treematch/tm_mapping.h @@ -4,24 +4,19 @@ #include "tm_topology.h" #include "tm_timings.h" #include "tm_verbose.h" +#include "ompi_config.h" -tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz); -void build_synthetic_proc_id(tm_topology_t *topology); -tm_topology_t *build_synthetic_topology(int *arity, int nb_levels, int *core_numbering, int nb_core_per_nodes); -int compute_nb_leaves_from_level(int depth,tm_topology_t *topology); -void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i); -int fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift); -long int init_mat(char *filename,int N, double **mat, double *sum_row); -void map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, +OMPI_HIDDEN tm_affinity_mat_t * tm_new_affinity_mat(double **mat, double *sum_row, int order, long int nnz); +OMPI_HIDDEN tm_topology_t *build_synthetic_topology(int *arity, int nb_levels, int *core_numbering, int nb_core_per_nodes); +OMPI_HIDDEN int tm_compute_nb_leaves_from_level(int depth,tm_topology_t *topology); +OMPI_HIDDEN int tm_fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift); +OMPI_HIDDEN void tm_map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level, int *sigma, int nb_processes, int **k, int nb_compute_units); -int nb_leaves(tm_tree_t *comm_tree); -int nb_lines(char *filename); -int nb_processing_units(tm_topology_t *topology); -void print_1D_tab(int *tab,int N); -tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree); -void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat); -tm_affinity_mat_t *tm_load_aff_mat(char *filename); -void update_comm_speed(double **comm_speed,int old_size,int new_size); +OMPI_HIDDEN int tm_nb_processing_units(tm_topology_t *topology); +OMPI_HIDDEN void tm_print_1D_tab(int *tab,int N); +OMPI_HIDDEN tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree); +OMPI_HIDDEN void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat); +OMPI_HIDDEN tm_affinity_mat_t *tm_load_aff_mat(char *filename); /* use to split a constaint into subconstraint according the tree*/ typedef struct{ diff --git a/3rd-party/treematch/tm_mt.c b/3rd-party/treematch/tm_mt.c index 55c8f7bd905..791f5325c28 100644 --- a/3rd-party/treematch/tm_mt.c +++ b/3rd-party/treematch/tm_mt.c @@ -50,6 +50,8 @@ #include "tm_mt.h" +#include "ompi_config.h" + /* Period parameters */ #define N 624 #define M 397 @@ -60,6 +62,13 @@ static unsigned long x[N]; /* the array for the state vector */ static unsigned long *p0, *p1, *pm; +OMPI_HIDDEN long tm_genrand_int31(void); +OMPI_HIDDEN double tm_genrand_real1(void); +OMPI_HIDDEN double tm_genrand_real2(void); +OMPI_HIDDEN double tm_genrand_real3(void); +OMPI_HIDDEN double tm_genrand_res53(void); +OMPI_HIDDEN void init_by_array(unsigned long init_key[], int key_length); + /* initialize with a seed @@ -71,7 +80,7 @@ static unsigned long *p0, *p1, *pm; 2002-01-09 modified by Makoto Matsumoto */ void -init_genrand(unsigned long s) +tm_init_genrand(unsigned long s) { int i; @@ -99,7 +108,7 @@ init_by_array(unsigned long init_key[], int key_length) { int i, j, k; - init_genrand(19650218UL); + tm_init_genrand(19650218UL); i = 1; j = 0; for (k = (N > key_length ? N : key_length); k; --k) { @@ -128,13 +137,13 @@ init_by_array(unsigned long init_key[], int key_length) /* generates a random number on the interval [0,0xffffffff] */ unsigned long -genrand_int32(void) +tm_genrand_int32(void) { unsigned long y; if (!p0) { /* Default seed */ - init_genrand(5489UL); + tm_init_genrand(5489UL); } /* Twisted feedback */ y = *p0 = *pm++ ^ (((*p0 & UPPER_MASK) | (*p1 & LOWER_MASK)) >> 1) @@ -156,40 +165,40 @@ genrand_int32(void) /* generates a random number on the interval [0,0x7fffffff] */ long -genrand_int31(void) +tm_genrand_int31(void) { - return (long) (genrand_int32() >> 1); + return (long) (tm_genrand_int32() >> 1); } /* generates a random number on the real interval [0,1] */ double -genrand_real1(void) +tm_genrand_real1(void) { - return genrand_int32() * (1.0 / 4294967295.0); + return tm_genrand_int32() * (1.0 / 4294967295.0); /* divided by 2^32-1 */ } /* generates a random number on the real interval [0,1) */ double -genrand_real2(void) +tm_genrand_real2(void) { - return genrand_int32() * (1.0 / 4294967296.0); + return tm_genrand_int32() * (1.0 / 4294967296.0); /* divided by 2^32 */ } /* generates a random number on the real interval (0,1) */ double -genrand_real3(void) +tm_genrand_real3(void) { - return (((double) genrand_int32()) + 0.5) * (1.0 / 4294967296.0); + return (((double) tm_genrand_int32()) + 0.5) * (1.0 / 4294967296.0); /* divided by 2^32 */ } /* generates a 53-bit random number on the real interval [0,1) */ double -genrand_res53(void) +tm_genrand_res53(void) { - unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6; + unsigned long a = tm_genrand_int32() >> 5, b = tm_genrand_int32() >> 6; return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0); } diff --git a/3rd-party/treematch/tm_mt.h b/3rd-party/treematch/tm_mt.h index 58f50d8f509..a0044b2c7ce 100644 --- a/3rd-party/treematch/tm_mt.h +++ b/3rd-party/treematch/tm_mt.h @@ -1,10 +1,6 @@ -void init_genrand(unsigned long s); -void init_by_array(unsigned long init_key[], int key_length); +#include "ompi_config.h" + +OMPI_HIDDEN void tm_init_genrand(unsigned long s); /* generates a random number on the interval [0,0x7fffffff] */ -unsigned long genrand_int32(void); -long genrand_int31(void); -double genrand_real1(void); -double genrand_real2(void); -double genrand_real3(void); -double genrand_res53(void); +OMPI_HIDDEN unsigned long tm_genrand_int32(void); diff --git a/3rd-party/treematch/tm_solution.c b/3rd-party/treematch/tm_solution.c index 4205c0d9d9a..a6cfc36a815 100644 --- a/3rd-party/treematch/tm_solution.c +++ b/3rd-party/treematch/tm_solution.c @@ -11,24 +11,25 @@ typedef struct { -void tm_free_solution(tm_solution_t *sol); -int distance(tm_topology_t *topology,int i, int j); -double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma); - double display_sol(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma, tm_metric_t metric); -double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol, +OMPI_HIDDEN void tm_free_solution(tm_solution_t *sol); +static int distance(tm_topology_t *topology,int i, int j); +static double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma); +static double display_sol(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma, tm_metric_t metric); +OMPI_HIDDEN double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol, tm_metric_t metric); -void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric); -int in_tab(int *tab, int n, int val); -void map_Packed(tm_topology_t *topology, int N, int *sigma); -void map_RR(tm_topology_t * topology, int N, int *sigma); -int hash_asc(const void* x1,const void* x2); -int *generate_random_sol(tm_topology_t *topology,int N, int seed); -double eval_sol(int *sol,int N,double **comm, double **arch); -void exchange(int *sol,int i,int j); -double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, double **arch); -void select_max(int *l,int *m,double **gain,int N,int *state); -void compute_gain(int *sol,int N,double **gain,double **comm, double **arch); -void map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch); +OMPI_HIDDEN void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric); +OMPI_HIDDEN int tm_in_tab(int *tab, int n, int val); +OMPI_HIDDEN void tm_map_Packed(tm_topology_t *topology, int N, int *sigma); +OMPI_HIDDEN void tm_map_RR(tm_topology_t * topology, int N, int *sigma); +static int hash_asc(const void* x1,const void* x2); +static int *generate_random_sol(tm_topology_t *topology,int N, int seed); +static double eval_sol(int *sol,int N,double **comm, double **arch); +static void exchange(int *sol,int i,int j); +static double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, double **arch); +static void select_max(int *l,int *m,double **gain,int N,int *state); +static void compute_gain(int *sol,int N,double **gain,double **comm, double **arch); +OMPI_HIDDEN void tm_map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch); +static void compute_gain(int *sol,int N,double **gain,double **comm, double **arch); void tm_free_solution(tm_solution_t *sol){ @@ -54,7 +55,7 @@ void tm_free_solution(tm_solution_t *sol){ for which node i and j are still in the same subtree. This is done by iteratively dividing their numbering by the arity of the levels */ -int distance(tm_topology_t *topology,int i, int j) +static int distance(tm_topology_t *topology,int i, int j) { int level = 0; int arity; @@ -84,7 +85,7 @@ int distance(tm_topology_t *topology,int i, int j) return level; } -double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma) +static double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma) { double a,c,sol; int i,j; @@ -186,7 +187,7 @@ static double display_sol_hop_byte(tm_topology_t *topology, tm_affinity_mat_t *a -double display_sol(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma, tm_metric_t metric){ +static double display_sol(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma, tm_metric_t metric){ switch (metric){ case TM_METRIC_SUM_COM: return display_sol_sum_com(topology, aff_mat, sigma); @@ -212,7 +213,7 @@ double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, if(tm_get_verbose_level() >= DEBUG){ printf("k: \n"); - for( i = 0 ; i < nb_processing_units(topology) ; i++ ){ + for( i = 0 ; i < tm_nb_processing_units(topology) ; i++ ){ if(k[i][0] != -1){ printf("\tProcessing unit %d: ",i); for (j = 0 ; joversub_fact; j++){ @@ -236,11 +237,11 @@ void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff sigma = (int*)MALLOC(sizeof(int)*N); - map_Packed(topology, N, sigma); + tm_map_Packed(topology, N, sigma); printf("Packed: "); display_sol(topology, aff_mat, sigma, metric); - map_RR(topology, N, sigma); + tm_map_RR(topology, N, sigma); printf("RR: "); display_sol(topology, aff_mat, sigma, metric); @@ -272,7 +273,7 @@ void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff } -int in_tab(int *tab, int n, int val){ +int tm_in_tab(int *tab, int n, int val){ int i; for( i = 0; i < n ; i++) if(tab[i] == val) @@ -281,7 +282,7 @@ int in_tab(int *tab, int n, int val){ return 0; } -void map_Packed(tm_topology_t *topology, int N, int *sigma) +void tm_map_Packed(tm_topology_t *topology, int N, int *sigma) { size_t i; int j = 0,depth; @@ -291,7 +292,7 @@ void map_Packed(tm_topology_t *topology, int N, int *sigma) for( i = 0 ; i < topology->nb_nodes[depth] ; i++){ /* printf ("%d -> %d\n",objs[i]->os_index,i); */ - if((!topology->constraints) || (in_tab(topology->constraints, topology->nb_constraints, topology->node_id[i]))){ + if((!topology->constraints) || (tm_in_tab(topology->constraints, topology->nb_constraints, topology->node_id[i]))){ if(vl >= DEBUG) printf ("%lu: %d -> %d\n", i, j, topology->node_id[i]); sigma[j++]=topology->node_id[i]; @@ -301,7 +302,7 @@ void map_Packed(tm_topology_t *topology, int N, int *sigma) } } -void map_RR(tm_topology_t *topology, int N,int *sigma) +void tm_map_RR(tm_topology_t *topology, int N,int *sigma) { int i; int vl = tm_get_verbose_level(); @@ -316,7 +317,7 @@ void map_RR(tm_topology_t *topology, int N,int *sigma) } } -int hash_asc(const void* x1,const void* x2) +static int hash_asc(const void* x1,const void* x2) { hash_t *e1 = NULL,*e2 = NULL; @@ -327,7 +328,7 @@ int hash_asc(const void* x1,const void* x2) } -int *generate_random_sol(tm_topology_t *topology,int N, int seed) +static int *generate_random_sol(tm_topology_t *topology,int N, int seed) { hash_t *hash_tab = NULL; int *sol = NULL; @@ -339,11 +340,11 @@ int *generate_random_sol(tm_topology_t *topology,int N, int seed) hash_tab = (hash_t*)MALLOC(sizeof(hash_t)*N); sol = (int*)MALLOC(sizeof(int)*N); - init_genrand(seed); + tm_init_genrand(seed); for( i = 0 ; i < N ; i++ ){ hash_tab[i].val = nodes_id[i]; - hash_tab[i].key = genrand_int32(); + hash_tab[i].key = tm_genrand_int32(); } qsort(hash_tab,N,sizeof(hash_t),hash_asc); @@ -355,7 +356,7 @@ int *generate_random_sol(tm_topology_t *topology,int N, int seed) } -double eval_sol(int *sol,int N,double **comm, double **arch) +static double eval_sol(int *sol,int N,double **comm, double **arch) { double a,c,res; int i,j; @@ -371,7 +372,7 @@ double eval_sol(int *sol,int N,double **comm, double **arch) return res; } -void exchange(int *sol,int i,int j) +static void exchange(int *sol,int i,int j) { int tmp; tmp = sol[i]; @@ -379,7 +380,7 @@ void exchange(int *sol,int i,int j) sol[j] = tmp; } -double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, double **arch) +static double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, double **arch) { double eval2; if( l == m ) @@ -391,7 +392,7 @@ double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, doub return eval1-eval2; } -void select_max(int *l,int *m,double **gain,int N,int *state) +static void select_max(int *l,int *m,double **gain,int N,int *state) { double max; int i,j; @@ -411,7 +412,7 @@ void select_max(int *l,int *m,double **gain,int N,int *state) } -void compute_gain(int *sol,int N,double **gain,double **comm, double **arch) +static void compute_gain(int *sol,int N,double **gain,double **comm, double **arch) { double eval1; int i,j; @@ -429,7 +430,7 @@ parallel process placement toolset for smp clusters and multiclusters. In Gregory K. Egan and Yoichi Muraoka, editors, ICS, pages 353-360. ACM, 2006. */ -void map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch) +void tm_map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch) { int *sol = NULL; int *state = NULL; diff --git a/3rd-party/treematch/tm_solution.h b/3rd-party/treematch/tm_solution.h index 8cc38a87558..ab5a061d37b 100644 --- a/3rd-party/treematch/tm_solution.h +++ b/3rd-party/treematch/tm_solution.h @@ -1,26 +1,16 @@ #ifndef TM_SOLUION_H #define TM_SOLUION_H +#include "ompi_config.h" #include "treematch.h" -void tm_free_solution(tm_solution_t *sol); -int distance(tm_topology_t *topology,int i, int j); -double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma); - double display_sol(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma, tm_metric_t metric); -double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol, - tm_metric_t metric); -void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric); -int in_tab(int *tab, int n, int val); -void map_Packed(tm_topology_t *topology, int N, int *sigma); -void map_RR(tm_topology_t *topology, int N, int *sigma); -int hash_asc(const void* x1,const void* x2); -int *generate_random_sol(tm_topology_t *topology,int N, int seed); -double eval_sol(int *sol,int N,double **comm, double **arch); -void exchange(int *sol,int i,int j); -double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, double **arch); -void select_max(int *l,int *m,double **gain,int N,int *state); -void compute_gain(int *sol,int N,double **gain,double **comm, double **arch); -void map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch); +OMPI_HIDDEN void tm_free_solution(tm_solution_t *sol); +OMPI_HIDDEN double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol, tm_metric_t metric); +OMPI_HIDDEN void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric); +int tm_in_tab(int *tab, int n, int val); +OMPI_HIDDEN void tm_map_Packed(tm_topology_t *topology, int N, int *sigma); +OMPI_HIDDEN void tm_map_RR(tm_topology_t *topology, int N, int *sigma); +OMPI_HIDDEN void tm_map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch); #endif diff --git a/3rd-party/treematch/tm_thread_pool.c b/3rd-party/treematch/tm_thread_pool.c index 6617d2c6d55..52a737da55c 100644 --- a/3rd-party/treematch/tm_thread_pool.c +++ b/3rd-party/treematch/tm_thread_pool.c @@ -24,8 +24,8 @@ static thread_pool_t *create_threads(void); static void f1 (int nb_args, void **args, int thread_id); static void f2 (int nb_args, void **args, int thread_id); -#define MIN(a, b) ((a)<(b)?(a):(b)) -#define MAX(a, b) ((a)>(b)?(a):(b)) +#define TM_MIN(a, b) ((a)<(b)?(a):(b)) +#define TM_MAX(a, b) ((a)>(b)?(a):(b)) @@ -45,7 +45,7 @@ int bind_myself_to_core(hwloc_topology_t topology, int id){ int depth = hwloc_topology_get_depth(topology); int nb_cores = hwloc_get_nbobjs_by_depth(topology, depth-1); int my_core; - int nb_threads = get_nb_threads(); + int nb_threads = tm_get_nb_threads(); /* printf("depth=%d\n",depth); */ switch (mapping_policy){ @@ -156,7 +156,7 @@ void add_work(pthread_mutex_t *list_lock, pthread_cond_t *cond_var, work_t *work } -void wait_work_completion(work_t *work){ +void tm_wait_work_completion(work_t *work){ pthread_mutex_lock(&work->mutex); while(!work->done) pthread_cond_wait(&work->work_done, &work->mutex); @@ -164,7 +164,7 @@ void wait_work_completion(work_t *work){ } -int submit_work(work_t *work, int thread_id){ +int tm_submit_work(work_t *work, int thread_id){ if( (thread_id>=0) && (thread_id< pool->nb_threads)){ work->thread_id = thread_id; add_work(&pool->list_lock[thread_id], &pool->cond_var[thread_id], &pool->working_list[thread_id], work); @@ -201,7 +201,7 @@ thread_pool_t *create_threads(){ /* at depth 'depth' it is necessary a PU/core where we can execute things*/ nb_cores = hwloc_get_nbobjs_by_depth(topology, depth-1); - nb_threads = MIN(nb_cores, max_nb_threads); + nb_threads = TM_MIN(nb_cores, max_nb_threads); if(verbose_level>=INFO) printf("nb_threads = %d\n",nb_threads); @@ -241,7 +241,7 @@ thread_pool_t *get_thread_pool(){; return pool; } -void terminate_thread_pool(){ +void tm_terminate_thread_pool(){ int id; int *ret=NULL; work_t work; @@ -249,7 +249,7 @@ void terminate_thread_pool(){ if(pool){ work.task=NULL; for (id=0;idnb_threads;id++){ - submit_work(&work,id); + tm_submit_work(&work,id); } @@ -277,13 +277,13 @@ void terminate_thread_pool(){ -int get_nb_threads(){ +int tm_get_nb_threads(){ pool = get_thread_pool(); return pool -> nb_threads; } -work_t *create_work(int nb_args, void **args, void (*task) (int, void **, int)){ +work_t *tm_create_work(int nb_args, void **args, void (*task) (int, void **, int)){ work_t *work; work = MALLOC(sizeof(work_t)); work -> nb_args = nb_args; @@ -298,7 +298,7 @@ work_t *create_work(int nb_args, void **args, void (*task) (int, void **, int)){ } -void destroy_work(work_t *work){ +void tm_destroy_work(work_t *work){ pthread_cond_destroy(&work->work_done); pthread_mutex_destroy(&work->mutex); FREE(work); @@ -333,7 +333,7 @@ void f2 (int nb_args, void **args, int thread_id){ -int test_main(void){ +int tm_test_main(void){ int a=3, c; int b=-5; @@ -342,7 +342,7 @@ int test_main(void){ int tab[100]; int i,res; work_t *work1,*work2,*work3,*work4; - int nb_threads = get_nb_threads(); + int nb_threads = tm_get_nb_threads(); printf("nb_threads= %d\n", nb_threads); @@ -350,7 +350,7 @@ int test_main(void){ args1[0] = &a; args1[1] = &b; - work1 = create_work(2,args1,f1); + work1 = tm_create_work(2,args1,f1); for (i=0;i<100;i++) @@ -361,28 +361,28 @@ int test_main(void){ args2[1] = tab; args2[2] = &res; - work2 = create_work(3, args2, f2); - work3 = create_work(4, args2, f2); - work4 = create_work(5, args2, f2); + work2 = tm_create_work(3, args2, f2); + work3 = tm_create_work(4, args2, f2); + work4 = tm_create_work(5, args2, f2); - submit_work(work1,0); - submit_work(work2,1); - submit_work(work3,1); - submit_work(work4,1); + tm_submit_work(work1,0); + tm_submit_work(work2,1); + tm_submit_work(work3,1); + tm_submit_work(work4,1); - terminate_thread_pool(); - wait_work_completion(work1); - wait_work_completion(work2); - wait_work_completion(work3); - wait_work_completion(work4); + tm_terminate_thread_pool(); + tm_wait_work_completion(work1); + tm_wait_work_completion(work2); + tm_wait_work_completion(work3); + tm_wait_work_completion(work4); printf("res=%d\n",res); - destroy_work(work1); - destroy_work(work2); - destroy_work(work3); - destroy_work(work4); + tm_destroy_work(work1); + tm_destroy_work(work2); + tm_destroy_work(work3); + tm_destroy_work(work4); return 0; } diff --git a/3rd-party/treematch/tm_thread_pool.h b/3rd-party/treematch/tm_thread_pool.h index 3499d261c0b..811b173d57b 100644 --- a/3rd-party/treematch/tm_thread_pool.h +++ b/3rd-party/treematch/tm_thread_pool.h @@ -3,6 +3,7 @@ #include #include +#include "ompi_config.h" typedef struct _work_t{ @@ -35,13 +36,13 @@ typedef struct _thread_pool_t{ hwloc_topology_t topology; }thread_pool_t; -int get_nb_threads(void); -int submit_work(work_t *work, int thread_id); -void wait_work_completion(work_t *work); -void terminate_thread_pool(void); -work_t *create_work(int nb_args, void **args, void (int, void **, int)); -int test_main(void); -void destroy_work(work_t *work); +OMPI_HIDDEN int tm_get_nb_threads(void); +OMPI_HIDDEN int tm_submit_work(work_t *work, int thread_id); +OMPI_HIDDEN void tm_wait_work_completion(work_t *work); +OMPI_HIDDEN void tm_terminate_thread_pool(void); +OMPI_HIDDEN work_t *tm_create_work(int nb_args, void **args, void (int, void **, int)); +OMPI_HIDDEN int tm_test_main(void); +OMPI_HIDDEN void tm_destroy_work(work_t *work); diff --git a/3rd-party/treematch/tm_timings.c b/3rd-party/treematch/tm_timings.c index b20747370e5..abebabbe656 100644 --- a/3rd-party/treematch/tm_timings.c +++ b/3rd-party/treematch/tm_timings.c @@ -3,7 +3,7 @@ static CLOCK_T time_tab[MAX_CLOCK]; static int clock_num = -1; -void get_time(void) +void tm_get_time(void) { clock_num++; @@ -13,7 +13,7 @@ void get_time(void) CLOCK(time_tab[clock_num]); } -double time_diff(void) +double tm_time_diff(void) { CLOCK_T t2,t1; diff --git a/3rd-party/treematch/tm_timings.h b/3rd-party/treematch/tm_timings.h index 377a1cd46ef..8bc3760b7e0 100644 --- a/3rd-party/treematch/tm_timings.h +++ b/3rd-party/treematch/tm_timings.h @@ -2,6 +2,8 @@ #define TIMINGS_H #include +#include "ompi_config.h" + #ifndef _WIN32 #include #else @@ -36,11 +38,11 @@ typedef struct _timeb CLOCK_T; #endif -double time_diff(void); -void get_time(void); +OMPI_HIDDEN double tm_time_diff(void); +OMPI_HIDDEN void tm_get_time(void); -#define TIC get_time() -#define TOC time_diff() +#define TIC tm_get_time() +#define TOC tm_time_diff() #endif /*TIMINGS_H*/ diff --git a/3rd-party/treematch/tm_topology.c b/3rd-party/treematch/tm_topology.c index 2c05c91dccb..8a3c8ab04fa 100644 --- a/3rd-party/treematch/tm_topology.c +++ b/3rd-party/treematch/tm_topology.c @@ -8,26 +8,27 @@ tm_topology_t* tm_get_local_topo_with_hwloc(void); -tm_topology_t* hwloc_to_tm(char *filename); -int int_cmp_inc(const void* x1,const void* x2); -void optimize_arity(int **arity, double **cost, int *nb_levels,int n); -int symetric(hwloc_topology_t topology); -tm_topology_t * tgt_to_tm(char *filename); -void tm_display_arity(tm_topology_t *topology); -void tm_display_topology(tm_topology_t *topology); -void tm_free_topology(tm_topology_t *topology); -tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_type); -void tm_optimize_topology(tm_topology_t **topology); -int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology_t *topology); -int topo_nb_proc(hwloc_topology_t topology,int N); -void topology_arity_cpy(tm_topology_t *topology,int **arity,int *nb_levels); -void topology_constraints_cpy(tm_topology_t *topology,int **constraints,int *nb_constraints); -void topology_cost_cpy(tm_topology_t *topology,double **cost); -void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_nodes); -double ** topology_to_arch(hwloc_topology_t topology); -void build_synthetic_proc_id(tm_topology_t *topology); +static tm_topology_t* hwloc_to_tm(char *filename); +OMPI_HIDDEN int tm_int_cmp_inc(const void* x1,const void* x2); +static void optimize_arity(int **arity, double **cost, int *nb_levels,int n); +static int symetric(hwloc_topology_t topology); +static tm_topology_t * tgt_to_tm(char *filename); +OMPI_HIDDEN void tm_display_arity(tm_topology_t *topology); +OMPI_HIDDEN void tm_display_topology(tm_topology_t *topology); +OMPI_HIDDEN void tm_free_topology(tm_topology_t *topology); +OMPI_HIDDEN tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_type); +OMPI_HIDDEN void tm_optimize_topology(tm_topology_t **topology); +OMPI_HIDDEN int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology_t *topology); +static int topo_nb_proc(hwloc_topology_t topology,int N); +static void topology_arity_cpy(tm_topology_t *topology,int **arity,int *nb_levels); +static void topology_constraints_cpy(tm_topology_t *topology,int **constraints,int *nb_constraints); +static void topology_cost_cpy(tm_topology_t *topology,double **cost); +static void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_nodes); +static double ** topology_to_arch(hwloc_topology_t topology); +static void build_synthetic_proc_id(tm_topology_t *topology); tm_topology_t *tm_build_synthetic_topology(int *arity, double *cost, int nb_levels, int *core_numbering, int nb_core_per_nodes); -void tm_set_numbering(tm_numbering_t new_val); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */ +OMPI_HIDDEN void tm_set_numbering(tm_numbering_t new_val); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */ +void build_synthetic_proc_id(tm_topology_t *topology); #define LINE_SIZE (1000000) @@ -46,7 +47,7 @@ tm_numbering_t tm_get_numbering(){ /* transform a tgt scotch file into a topology file*/ -tm_topology_t * tgt_to_tm(char *filename) +static tm_topology_t * tgt_to_tm(char *filename) { tm_topology_t *topology = NULL; FILE *pf = NULL; @@ -68,7 +69,13 @@ tm_topology_t * tgt_to_tm(char *filename) printf("Reading TGT file: %s\n",filename); - fgets(line,1024,pf); + if (NULL == fgets(line,1024,pf)) { + /* either an error has occurred (and is in an unknown state) or + we hit EOF and line is empty. Either way, make line the + empty string to avoid errors later */ + line[0] = '\0'; + } + fclose(pf); s = strstr(line,"tleaf"); @@ -116,12 +123,12 @@ tm_topology_t * tgt_to_tm(char *filename) -int nb_processing_units(tm_topology_t *topology) +int tm_nb_processing_units(tm_topology_t *topology) { return topology->nb_proc_units; } -int topo_nb_proc(hwloc_topology_t topology,int N) +static inline int topo_nb_proc(hwloc_topology_t topology,int N) { hwloc_obj_t *objs = NULL; int nb_proc; @@ -152,14 +159,20 @@ static double link_cost(int depth) */ } -double ** topology_to_arch(hwloc_topology_t topology) +static inline double ** topology_to_arch(hwloc_topology_t topology) { int nb_proc,i,j; hwloc_obj_t obj_proc1,obj_proc2,obj_res; double **arch = NULL; nb_proc = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PU); - arch = (double**)MALLOC(sizeof(double*)*nb_proc); + if (nb_proc < 0) { + return NULL; + } + arch = (double**)malloc(sizeof(double*)*nb_proc); + if (NULL == arch) { + return NULL; + } for( i = 0 ; i < nb_proc ; i++ ){ obj_proc1 = hwloc_get_obj_by_type(topology,HWLOC_OBJ_PU,i); arch[obj_proc1->os_index] = (double*)MALLOC(sizeof(double)*nb_proc); @@ -173,7 +186,7 @@ double ** topology_to_arch(hwloc_topology_t topology) return arch; } -int symetric(hwloc_topology_t topology) +static int symetric(hwloc_topology_t topology) { int depth,i,topodepth = hwloc_topology_get_depth(topology); unsigned int arity; @@ -235,7 +248,7 @@ static void build_process_tab_id(tm_topology_t *topology, hwloc_obj_t *objs, ch } -tm_topology_t* hwloc_to_tm(char *filename) +static tm_topology_t* hwloc_to_tm(char *filename) { hwloc_topology_t topology; tm_topology_t *res = NULL; @@ -473,7 +486,7 @@ void tm_display_arity(tm_topology_t *topology){ printf("\n"); } -int int_cmp_inc(const void* x1,const void* x2) +int tm_int_cmp_inc(const void* x1,const void* x2) { return *((int *)x1) < *((int *)x2) ? -1 : 1; } @@ -484,7 +497,7 @@ static int topo_check_constraints(tm_topology_t *topology){ int i; int depth = topology->nb_levels-1; for (i=0;inode_id, topology->nb_nodes[depth], topology->constraints[i])){ + if(!tm_in_tab(topology->node_id, topology->nb_nodes[depth], topology->constraints[i])){ if(tm_get_verbose_level() >= CRITICAL){ fprintf(stderr,"Error! Incompatible constraint with the topology: rank %d in the constraints is not a valid id of any nodes of the topology.\n",topology->constraints[i]); } @@ -534,7 +547,9 @@ int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology /* compute the size of the array to store the constraints*/ n = 0; - fgets(line, LINE_SIZE, pf); + if (NULL == fgets(line, LINE_SIZE, pf)) { + line[0] = '\0'; + } l = line; while((ptr=strtok(l," \t"))){ l = NULL; @@ -545,7 +560,9 @@ int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology tab = (int*)MALLOC(n*sizeof(int)); rewind(pf); - fgets(line, LINE_SIZE, pf); + if (NULL == fgets(line, LINE_SIZE, pf)) { + line[0] = '\0'; + } fclose(pf); l = line; i = 0; @@ -569,13 +586,13 @@ int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology exit(-1); } - qsort(tab,n,sizeof(int),int_cmp_inc); + qsort(tab,n,sizeof(int),tm_int_cmp_inc); return tm_topology_set_binding_constraints_cpy(tab, n, topology, 0); } -void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_nodes) +static void topology_numbering_cpy(tm_topology_t *topology,int **numbering_loc,int *nb_nodes) { int nb_levels; unsigned int vl = tm_get_verbose_level(); @@ -584,18 +601,18 @@ void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_node *nb_nodes = topology->nb_nodes[nb_levels-1]; if(vl >= INFO) printf("nb_nodes=%d\n",*nb_nodes); - *numbering = (int*)MALLOC(sizeof(int)*(*nb_nodes)); - memcpy(*numbering,topology->node_id,sizeof(int)*(*nb_nodes)); + *numbering_loc = (int*)MALLOC(sizeof(int)*(*nb_nodes)); + memcpy(*numbering_loc,topology->node_id,sizeof(int)*(*nb_nodes)); } -void topology_arity_cpy(tm_topology_t *topology,int **arity,int *nb_levels) +static void topology_arity_cpy(tm_topology_t *topology,int **arity,int *nb_levels) { *nb_levels = topology->nb_levels; *arity = (int*)MALLOC(sizeof(int)*(*nb_levels)); memcpy(*arity,topology->arity,sizeof(int)*(*nb_levels)); } -void topology_constraints_cpy(tm_topology_t *topology,int **constraints,int *nb_constraints) +static void topology_constraints_cpy(tm_topology_t *topology,int **constraints,int *nb_constraints) { *nb_constraints = topology->nb_constraints; if(topology->constraints){ @@ -606,13 +623,13 @@ void topology_constraints_cpy(tm_topology_t *topology,int **constraints,int *nb_ } } -void topology_cost_cpy(tm_topology_t *topology,double **cost) +static void topology_cost_cpy(tm_topology_t *topology,double **cost) { *cost = (double*)MALLOC(sizeof(double)*(topology->nb_levels)); memcpy(*cost,topology->cost,sizeof(double)*(topology->nb_levels)); } -void optimize_arity(int **arity, double **cost, int *nb_levels,int n) +static void optimize_arity(int **arity, double **cost, int *nb_levels,int n) { int a,i; int *new_arity = NULL; @@ -699,7 +716,7 @@ void optimize_arity(int **arity, double **cost, int *nb_levels,int n) void tm_optimize_topology(tm_topology_t **topology){ int *arity = NULL,nb_levels; - int *numbering = NULL,nb_nodes; + int *numbering_loc = NULL,nb_nodes; tm_topology_t *new_topo; double *cost; unsigned int vl = tm_get_verbose_level(); @@ -710,13 +727,13 @@ void tm_optimize_topology(tm_topology_t **topology){ tm_display_arity(*topology); topology_arity_cpy(*topology,&arity,&nb_levels); - topology_numbering_cpy(*topology,&numbering,&nb_nodes); + topology_numbering_cpy(*topology,&numbering_loc,&nb_nodes); topology_constraints_cpy(*topology,&constraints,&nb_constraints); topology_cost_cpy(*topology,&cost); optimize_arity(&arity,&cost,&nb_levels,nb_levels-2); - new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering,nb_nodes); + new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering_loc,nb_nodes); new_topo->cost = cost; new_topo->constraints = constraints; new_topo->nb_constraints = nb_constraints; @@ -736,7 +753,7 @@ void tm_optimize_topology(tm_topology_t **topology){ tm_display_arity(new_topo); } FREE(arity); - FREE(numbering); + FREE(numbering_loc); tm_free_topology(*topology); *topology = new_topo; @@ -811,7 +828,7 @@ tm_topology_t *tm_build_synthetic_topology(int *arity, double *cost, int nb_lev } -void build_synthetic_proc_id(tm_topology_t *topology) +static void build_synthetic_proc_id(tm_topology_t *topology) { int i; size_t j,n = 1; diff --git a/3rd-party/treematch/tm_topology.h b/3rd-party/treematch/tm_topology.h index a7b04dee745..2eb742954f4 100644 --- a/3rd-party/treematch/tm_topology.h +++ b/3rd-party/treematch/tm_topology.h @@ -2,22 +2,16 @@ #include "tm_tree.h" tm_topology_t* get_local_topo_with_hwloc(void); -tm_topology_t* hwloc_to_tm(char *filename); -int int_cmp_inc(const void* x1,const void* x2); -void optimize_arity(int **arity, double **cost, int *nb_levels,int n); -int symetric(hwloc_topology_t topology); -tm_topology_t * tgt_to_tm(char *filename); -void tm_display_arity(tm_topology_t *topology); -void tm_display_topology(tm_topology_t *topology); -void tm_free_topology(tm_topology_t *topology); -tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_type); -void tm_optimize_topology(tm_topology_t **topology); -int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology_t *topology); -int topo_nb_proc(hwloc_topology_t topology,int N); +OMPI_HIDDEN int tm_int_cmp_inc(const void* x1,const void* x2); +OMPI_HIDDEN void tm_display_arity(tm_topology_t *topology); +OMPI_HIDDEN void tm_display_topology(tm_topology_t *topology); +OMPI_HIDDEN void tm_free_topology(tm_topology_t *topology); +OMPI_HIDDEN tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_type); +OMPI_HIDDEN void tm_optimize_topology(tm_topology_t **topology); +OMPI_HIDDEN int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology_t *topology); void topology_arity(tm_topology_t *topology,int **arity,int *nb_levels); void topology_constraints(tm_topology_t *topology,int **constraints,int *nb_constraints); void topology_cost(tm_topology_t *topology,double **cost); void topology_numbering(tm_topology_t *topology,int **numbering,int *nb_nodes); -double ** topology_to_arch(hwloc_topology_t topology); -int nb_processing_units(tm_topology_t *topology); +OMPI_HIDDEN int tm_nb_processing_units(tm_topology_t *topology); diff --git a/3rd-party/treematch/tm_tree.c b/3rd-party/treematch/tm_tree.c index 11d3e46a2db..06a369e1d8d 100644 --- a/3rd-party/treematch/tm_tree.c +++ b/3rd-party/treematch/tm_tree.c @@ -5,6 +5,7 @@ #include #include +#include "ompi_config.h" #include "tm_tree.h" #include "tm_mapping.h" #include "tm_timings.h" @@ -14,8 +15,8 @@ #include "tm_thread_pool.h" -#define MIN(a, b) ((a)<(b)?(a):(b)) -#define MAX(a, b) ((a)>(b)?(a):(b)) +#define TM_MIN(a, b) ((a)<(b)?(a):(b)) +#define TM_MAX(a, b) ((a)>(b)?(a):(b)) #ifndef __CHARMC__ #define __CHARMC__ 0 @@ -32,62 +33,63 @@ static int verbose_level = ERROR; static int exhaustive_search_flag = 0; -void free_list_child(tm_tree_t *);void free_tab_child(tm_tree_t *); -double choose (long, long);void display_node(tm_tree_t *); -void clone_tree(tm_tree_t *, tm_tree_t *); -double *aggregate_obj_weight(tm_tree_t *, double *, int); +static void free_list_child(tm_tree_t *); +static void free_tab_child(tm_tree_t *); +static double choose (long, long);void display_node(tm_tree_t *); +static void clone_tree(tm_tree_t *, tm_tree_t *); +static double *aggregate_obj_weight(tm_tree_t *, double *, int); tm_affinity_mat_t *aggregate_com_mat(tm_tree_t *, tm_affinity_mat_t *, int); -double eval_grouping(tm_affinity_mat_t *, tm_tree_t **, int); -group_list_t *new_group_list(tm_tree_t **, double, group_list_t *); -void add_to_list(group_list_t *, tm_tree_t **, int, double); -void list_all_possible_groups(tm_affinity_mat_t *, tm_tree_t *, int, int, int, tm_tree_t **, group_list_t *); -int independent_groups(group_list_t **, int, group_list_t *, int); -void display_selection (group_list_t**, int, int, double); -void display_grouping (tm_tree_t *, int, int, double); -int recurs_select_independent_groups(group_list_t **, int, int, int, int, - int, double, double *, group_list_t **, group_list_t **); -int test_independent_groups(group_list_t **, int, int, int, int, int, double, double *, - group_list_t **, group_list_t **); -void delete_group_list(group_list_t *); -int group_list_id(const void*, const void*); -int group_list_asc(const void*, const void*); -int group_list_dsc(const void*, const void*); -int weighted_degree_asc(const void*, const void*); -int weighted_degree_dsc(const void*, const void*); -int select_independent_groups(group_list_t **, int, int, int, double *, group_list_t **, int, double); -int select_independent_groups_by_largest_index(group_list_t **, int, int, int, double *, - group_list_t **, int, double); -void list_to_tab(group_list_t *, group_list_t **, int); -void display_tab_group(group_list_t **, int, int); -int independent_tab(tm_tree_t **, tm_tree_t **, int); -void compute_weighted_degree(group_list_t **, int, int); +static double eval_grouping(tm_affinity_mat_t *, tm_tree_t **, int); +static group_list_t *new_group_list(tm_tree_t **, double, group_list_t *); +static void add_to_list(group_list_t *, tm_tree_t **, int, double); +static void list_all_possible_groups(tm_affinity_mat_t *, tm_tree_t *, int, int, int, tm_tree_t **, group_list_t *); +static int independent_groups(group_list_t **, int, group_list_t *, int); +static void display_selection (group_list_t**, int, int, double); +static void display_grouping (tm_tree_t *, int, int, double); +static int recurs_select_independent_groups(group_list_t **, int, int, int, int, + int, double, double *, group_list_t **, group_list_t **); +static int test_independent_groups(group_list_t **, int, int, int, int, int, double, double *, + group_list_t **, group_list_t **); +static void delete_group_list(group_list_t *); +static int group_list_id(const void*, const void*); +static int group_list_asc(const void*, const void*); +static int group_list_dsc(const void*, const void*); +static int weighted_degree_asc(const void*, const void*); +static int weighted_degree_dsc(const void*, const void*); +static int select_independent_groups(group_list_t **, int, int, int, double *, group_list_t **, int, double); +static int select_independent_groups_by_largest_index(group_list_t **, int, int, int, double *, + group_list_t **, int, double); +static void list_to_tab(group_list_t *, group_list_t **, int); +static void display_tab_group(group_list_t **, int, int); +static int independent_tab(tm_tree_t **, tm_tree_t **, int); +static void compute_weighted_degree(group_list_t **, int, int); void group(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int, int, double *, tm_tree_t **); -void fast_group(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int, int, double *, tm_tree_t **, int *, int); -int adjacency_asc(const void*, const void*); -int adjacency_dsc(const void*, const void*); - void super_fast_grouping(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int); -tm_affinity_mat_t *build_cost_matrix(tm_affinity_mat_t *, double *, double); -void group_nodes(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int , int, double*, double); -double fast_grouping(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int, double); -void complete_aff_mat(tm_affinity_mat_t **, int, int); -void complete_obj_weight(double **, int, int); -void create_dumb_tree(tm_tree_t *, int, tm_topology_t *); -void complete_tab_node(tm_tree_t **, int, int, int, tm_topology_t *); -void set_deb_tab_child(tm_tree_t *, tm_tree_t *, int); -tm_tree_t *build_level_topology(tm_tree_t *, tm_affinity_mat_t *, int, int, tm_topology_t *, double *, double *); -int check_constraints(tm_topology_t *, int **); -tm_tree_t *bottom_up_build_tree_from_topology(tm_topology_t *, tm_affinity_mat_t *, double *, double *); -void free_non_constraint_tree(tm_tree_t *); -void free_constraint_tree(tm_tree_t *); -void free_tab_double(double**, int); -void free_tab_int(int**, int ); +static void fast_group(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int, int, double *, tm_tree_t **, int *, int); +static int adjacency_asc(const void*, const void*); +static int adjacency_dsc(const void*, const void*); +static void super_fast_grouping(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int); +static tm_affinity_mat_t *build_cost_matrix(tm_affinity_mat_t *, double *, double); +static void group_nodes(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int , int, double*, double); +static double fast_grouping(tm_affinity_mat_t *, tm_tree_t *, tm_tree_t *, int, int, double); +static void complete_aff_mat(tm_affinity_mat_t **, int, int); +OMPI_HIDDEN void tm_complete_obj_weight(double **, int, int); +static void create_dumb_tree(tm_tree_t *, int, tm_topology_t *); +static void complete_tab_node(tm_tree_t **, int, int, int, tm_topology_t *); +static void set_deb_tab_child(tm_tree_t *, tm_tree_t *, int); +static tm_tree_t *build_level_topology(tm_tree_t *, tm_affinity_mat_t *, int, int, tm_topology_t *, double *, double *); +static int check_constraints(tm_topology_t *, int **); +static tm_tree_t *bottom_up_build_tree_from_topology(tm_topology_t *, tm_affinity_mat_t *, double *, double *); +static void free_non_constraint_tree(tm_tree_t *); +static void free_constraint_tree(tm_tree_t *); +static void free_tab_double(double**, int); +static void free_tab_int(int**, int ); static void partial_aggregate_aff_mat (int, void **, int); -void free_affinity_mat(tm_affinity_mat_t *aff_mat); -int int_cmp_inc(const void* x1, const void* x2); +static void free_affinity_mat(tm_affinity_mat_t *aff_mat); +OMPI_HIDDEN int tm_int_cmp_inc(const void* x1, const void* x2); -double choose (long n, long k) +static double choose (long n, long k) { /* compute C_n_k */ double res = 1; @@ -109,13 +111,13 @@ int tm_get_exhaustive_search_flag(){ } -void free_affinity_mat(tm_affinity_mat_t *aff_mat){ +static void free_affinity_mat(tm_affinity_mat_t *aff_mat){ free_tab_double(aff_mat->mat, aff_mat->order); FREE(aff_mat->sum_row); FREE(aff_mat); } -void free_list_child(tm_tree_t *tree) +static void free_list_child(tm_tree_t *tree) { int i; @@ -128,7 +130,7 @@ void free_list_child(tm_tree_t *tree) FREE(tree); } } -void free_tab_child(tm_tree_t *tree) +static void free_tab_child(tm_tree_t *tree) { if(tree){ /*in a non constaint tree internal node are allocated in an array an stored ib tab_child : they are freed globaly here */ @@ -137,7 +139,7 @@ void free_tab_child(tm_tree_t *tree) } } -void free_non_constraint_tree(tm_tree_t *tree) +static void free_non_constraint_tree(tm_tree_t *tree) { if(tree->dumb){ if(tm_get_verbose_level() <= CRITICAL){ @@ -151,7 +153,7 @@ void free_non_constraint_tree(tm_tree_t *tree) FREE(tree); } -void free_constraint_tree(tm_tree_t *tree) +static void free_constraint_tree(tm_tree_t *tree) { int i; @@ -174,7 +176,7 @@ void tm_free_tree(tm_tree_t *tree) } -void set_node(tm_tree_t *node, tm_tree_t ** child, int arity, tm_tree_t *parent, +void tm_set_node(tm_tree_t *node, tm_tree_t ** child, int arity, tm_tree_t *parent, int id, double val, tm_tree_t *tab_child, int depth) { static int uniq = 0; @@ -189,14 +191,7 @@ void set_node(tm_tree_t *node, tm_tree_t ** child, int arity, tm_tree_t *parent, node->dumb = 0; } -void display_node(tm_tree_t *node) -{ - if (verbose_level >= DEBUG) - printf("child : %p\narity : %d\nparent : %p\nid : %d\nval : %f\nuniq : %d\n\n", - (void *)(node->child), node->arity, (void *)(node->parent), node->id, node->val, node->uniq); -} - -void clone_tree(tm_tree_t *new, tm_tree_t *old) +static void clone_tree(tm_tree_t *new, tm_tree_t *old) { int i; new->child = old->child; @@ -213,7 +208,7 @@ void clone_tree(tm_tree_t *new, tm_tree_t *old) } -double *aggregate_obj_weight(tm_tree_t *new_tab_node, double *tab, int M) +static double *aggregate_obj_weight(tm_tree_t *new_tab_node, double *tab, int M) { int i, i1, id1; double *res = NULL; @@ -298,7 +293,7 @@ static tm_affinity_mat_t *aggregate_aff_mat(tm_tree_t *tab_node, tm_affinity_mat int *sup; long int *nnz_tab; - nb_threads = MIN(M/512, get_nb_threads()); + nb_threads = TM_MIN(M/512, tm_get_nb_threads()); works = (work_t**)MALLOC(sizeof(work_t*)*nb_threads); inf = (int*)MALLOC(sizeof(int)*nb_threads); sup = (int*)MALLOC(sizeof(int)*nb_threads); @@ -318,18 +313,18 @@ static tm_affinity_mat_t *aggregate_aff_mat(tm_tree_t *tab_node, tm_affinity_mat args[6]=(void*)sum_row; args[7]=(void*)(nnz_tab+id); - works[id]= create_work(8, args, partial_aggregate_aff_mat); + works[id]= tm_create_work(8, args, partial_aggregate_aff_mat); if(verbose_level >= DEBUG) printf("Executing %p\n", (void *)works[id]); - submit_work( works[id], id); + tm_submit_work( works[id], id); } for(id=0;idargs); nnz += nnz_tab[id]; - destroy_work(works[id]); + tm_destroy_work(works[id]); } FREE(inf); @@ -358,10 +353,10 @@ static tm_affinity_mat_t *aggregate_aff_mat(tm_tree_t *tab_node, tm_affinity_mat } } - return new_affinity_mat(new_mat, sum_row, M, nnz); + return tm_new_affinity_mat(new_mat, sum_row, M, nnz); } -void free_tab_double(double**tab, int mat_order) +static void free_tab_double(double**tab, int mat_order) { int i; for( i = 0 ; i < mat_order ; i++ ) @@ -369,7 +364,7 @@ void free_tab_double(double**tab, int mat_order) FREE(tab); } -void free_tab_int(int**tab, int mat_order) +static inline void free_tab_int(int**tab, int mat_order) { int i; for( i = 0 ; i < mat_order ; i++ ) @@ -377,7 +372,7 @@ void free_tab_int(int**tab, int mat_order) FREE(tab); } -void display_tab(double **tab, int mat_order) +void tm_display_tab(double **tab, int mat_order) { int i, j; double line, total = 0; @@ -402,8 +397,7 @@ void display_tab(double **tab, int mat_order) /* printf("Total: %.2f\n", total);*/ } - -double eval_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t **cur_group, int arity) +static double eval_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t **cur_group, int arity) { double res = 0; int i, j, id, id1, id2; @@ -430,7 +424,7 @@ double eval_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t **cur_group, int arit } -group_list_t *new_group_list(tm_tree_t **tab, double val, group_list_t *next) +static group_list_t *new_group_list(tm_tree_t **tab, double val, group_list_t *next) { group_list_t *res = NULL; @@ -443,7 +437,7 @@ group_list_t *new_group_list(tm_tree_t **tab, double val, group_list_t *next) } -void add_to_list(group_list_t *list, tm_tree_t **cur_group, int arity, double val) +static void add_to_list(group_list_t *list, tm_tree_t **cur_group, int arity, double val) { group_list_t *elem = NULL; tm_tree_t **tab = NULL; @@ -466,7 +460,7 @@ void add_to_list(group_list_t *list, tm_tree_t **cur_group, int arity, double va } -void list_all_possible_groups(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, int id, int arity, int depth, +static void list_all_possible_groups(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, int id, int arity, int depth, tm_tree_t **cur_group, group_list_t *list) { double val; @@ -490,7 +484,7 @@ void list_all_possible_groups(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, } } -void update_val(tm_affinity_mat_t *aff_mat, tm_tree_t *parent) +void tm_update_val(tm_affinity_mat_t *aff_mat, tm_tree_t *parent) { /* int i; */ @@ -508,7 +502,7 @@ void update_val(tm_affinity_mat_t *aff_mat, tm_tree_t *parent) /*printf(": %f\n", parent->val);*/ } -int independent_groups(group_list_t **selection, int d, group_list_t *elem, int arity) +static int independent_groups(group_list_t **selection, int d, group_list_t *elem, int arity) { int i, j, k; @@ -525,7 +519,7 @@ int independent_groups(group_list_t **selection, int d, group_list_t *elem, int -void display_selection (group_list_t** selection, int M, int arity, double val) +static void display_selection (group_list_t** selection, int M, int arity, double val) { int i, j; double local_val = 0; @@ -544,7 +538,7 @@ void display_selection (group_list_t** selection, int M, int arity, double val) } -void display_grouping (tm_tree_t *father, int M, int arity, double val) +static void display_grouping (tm_tree_t *father, int M, int arity, double val) { int i, j; @@ -561,7 +555,7 @@ void display_grouping (tm_tree_t *father, int M, int arity, double val) } -int recurs_select_independent_groups(group_list_t **tab, int i, int n, int arity, int d, int M, double val, double *best_val, group_list_t **selection, group_list_t **best_selection) +static int recurs_select_independent_groups(group_list_t **tab, int i, int n, int arity, int d, int M, double val, double *best_val, group_list_t **selection, group_list_t **best_selection) { group_list_t *elem = NULL; /* @@ -597,7 +591,7 @@ int recurs_select_independent_groups(group_list_t **tab, int i, int n, int arity -int test_independent_groups(group_list_t **tab, int i, int n, int arity, int d, int M, double val, double *best_val, group_list_t **selection, group_list_t **best_selection) +static int test_independent_groups(group_list_t **tab, int i, int n, int arity, int d, int M, double val, double *best_val, group_list_t **selection, group_list_t **best_selection) { group_list_t *elem = NULL; @@ -619,7 +613,7 @@ int test_independent_groups(group_list_t **tab, int i, int n, int arity, int d, return 0; } -void delete_group_list(group_list_t *list) +static void delete_group_list(group_list_t *list) { if(list){ @@ -629,7 +623,7 @@ void delete_group_list(group_list_t *list) } } -int group_list_id(const void* x1, const void* x2) +static int group_list_id(const void* x1, const void* x2) { group_list_t *e1 = NULL, *e2= NULL; @@ -639,7 +633,7 @@ int group_list_id(const void* x1, const void* x2) return (e1->tab[0]->id < e2->tab[0]->id) ? - 1 : 1; } -int group_list_asc(const void* x1, const void* x2) +static int group_list_asc(const void* x1, const void* x2) { group_list_t *e1 = NULL, *e2 = NULL; @@ -649,7 +643,7 @@ int group_list_asc(const void* x1, const void* x2) return (e1->val < e2->val) ? - 1 : 1; } -int group_list_dsc(const void* x1, const void* x2) +static int group_list_dsc(const void* x1, const void* x2) { group_list_t *e1 = NULL, *e2 = NULL; @@ -659,7 +653,7 @@ int group_list_dsc(const void* x1, const void* x2) return (e1->val > e2->val) ? -1 : 1; } -int weighted_degree_asc(const void* x1, const void* x2) +static inline int weighted_degree_asc(const void* x1, const void* x2) { group_list_t *e1= NULL, *e2 = NULL; @@ -669,7 +663,7 @@ int weighted_degree_asc(const void* x1, const void* x2) return (e1->wg > e2->wg) ? 1 : -1; } -int weighted_degree_dsc(const void* x1, const void* x2) +static int weighted_degree_dsc(const void* x1, const void* x2) { group_list_t *e1 = NULL, *e2 = NULL; @@ -679,8 +673,8 @@ int weighted_degree_dsc(const void* x1, const void* x2) return (e1->wg > e2->wg) ? - 1 : 1; } -int select_independent_groups(group_list_t **tab_group, int n, int arity, int M, double *best_val, - group_list_t **best_selection, int bound, double max_duration) +static int select_independent_groups(group_list_t **tab_group, int n, int arity, int M, double *best_val, + group_list_t **best_selection, int bound, double max_duration) { int i, j; group_list_t **selection = NULL; @@ -700,8 +694,8 @@ int select_independent_groups(group_list_t **tab_group, int n, int arity, int M selection = (group_list_t **)MALLOC(sizeof(group_list_t*)*M); CLOCK(time0); - for( i = 0 ; i < MIN(bound, n) ; i++ ){ - /* if(!(i%100)) {printf("%d/%d ", i, MIN(bound, n)); fflush(stdout);} */ + for( i = 0 ; i < TM_MIN(bound, n) ; i++ ){ + /* if(!(i%100)) {printf("%d/%d ", i, TM_MIN(bound, n)); fflush(stdout);} */ selection[0] = tab_group[i]; val = tab_group[i]->val; recurs_select_independent_groups(tab_group, i+1, n, arity, 1, M, val, best_val, selection, best_selection); @@ -1138,7 +1132,7 @@ static int thread_exhaustive_search(group_list_t **tab_group, int nb_groups, int TIC; pthread_mutex_init(&lock, NULL); - nb_threads = get_nb_threads(); + nb_threads = tm_get_nb_threads(); nb_threads = 4; works = (work_t**)MALLOC(sizeof(work_t*)*nb_threads); @@ -1186,17 +1180,17 @@ static int thread_exhaustive_search(group_list_t **tab_group, int nb_groups, int args[6]=(void*)indep_mat; args[7]=(void*)work_list; args[8]=(void*)&lock; - works[id]= create_work(9, args, partial_exhaustive_search); + works[id]= tm_create_work(9, args, partial_exhaustive_search); if(verbose_level >= DEBUG) printf("Executing %p\n", (void *)works[id]); - submit_work( works[id], id); + tm_submit_work( works[id], id); } for(id=0;idargs); - destroy_work(works[id]); + tm_destroy_work(works[id]); } exit(-1); @@ -1385,7 +1379,7 @@ static int exhaustive_search(group_list_t **tab_group, int n, int arity, int so #endif -int select_independent_groups_by_largest_index(group_list_t **tab_group, int n, int arity, int solution_size, double *best_val, group_list_t **best_selection, int bound, double max_duration) +static int select_independent_groups_by_largest_index(group_list_t **tab_group, int n, int arity, int solution_size, double *best_val, group_list_t **best_selection, int bound, double max_duration) { int i, dec, nb_groups=0; group_list_t **selection = NULL; @@ -1395,7 +1389,7 @@ int select_independent_groups_by_largest_index(group_list_t **tab_group, int n, selection = (group_list_t **)MALLOC(sizeof(group_list_t*)*solution_size); CLOCK(time0); - dec = MAX(n/10000, 2); + dec = TM_MAX(n/10000, 2); for( i = n-1 ; i >= 0 ; i -= dec*dec){ selection[0] = tab_group[i]; val = tab_group[i]->val; @@ -1425,7 +1419,7 @@ int select_independent_groups_by_largest_index(group_list_t **tab_group, int n, return 0; } -void list_to_tab(group_list_t *list, group_list_t **tab, int n) +static void list_to_tab(group_list_t *list, group_list_t **tab, int n) { int i; for( i = 0 ; i < n ; i++ ){ @@ -1445,7 +1439,7 @@ void list_to_tab(group_list_t *list, group_list_t **tab, int n) } } -void display_tab_group(group_list_t **tab, int n, int arity) +static inline void display_tab_group(group_list_t **tab, int n, int arity) { int i, j; if(verbose_levelparent=&new_tab_node[l]; - update_val(aff_mat, &new_tab_node[l]); + tm_update_val(aff_mat, &new_tab_node[l]); if(new_tab_node[l].val != best_val){ if(verbose_level>=CRITICAL) printf("Error: best_val = %f, new_tab_node[%d].val = %f\n", best_val, l, new_tab_node[l].val); @@ -1596,7 +1590,7 @@ static double k_partition_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_no if(verbose_level>=DEBUG) printf("K-Partitionning: n=%d, solution_size=%d, arity=%d\n",n, solution_size,arity); - partition = kpartition(solution_size, &com_mat, n, NULL, 0); + partition = tm_kpartition(solution_size, &com_mat, n, NULL, 0); /* new_tab_node[i]->child[j] = &tab_node[k] where 0<=i< solution size, 0<=jval < e2->val) ? - 1 : 1; } -int adjacency_dsc(const void* x1, const void* x2) +static int adjacency_dsc(const void* x1, const void* x2) { adjacency_t *e1 = NULL, *e2 = NULL; @@ -1644,7 +1638,7 @@ int adjacency_dsc(const void* x1, const void* x2) return (e1->val > e2->val) ? -1 : 1; } -void super_fast_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity, int solution_size) +static inline void super_fast_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity, int solution_size) { double val = 0, duration; adjacency_t *graph; @@ -1683,11 +1677,11 @@ TIC; l = 0; nb_groups = 0; for( i = 0 ; (i < e) && (l < solution_size) ; i++ ) - if(try_add_edge(tab_node, &new_tab_node[l], arity, graph[i].i, graph[i].j, &nb_groups)) + if(tm_try_add_edge(tab_node, &new_tab_node[l], arity, graph[i].i, graph[i].j, &nb_groups)) l++; for( l = 0 ; l < solution_size ; l++ ){ - update_val(aff_mat, &new_tab_node[l]); + tm_update_val(aff_mat, &new_tab_node[l]); val += new_tab_node[l].val; } @@ -1706,7 +1700,7 @@ TIC; } -tm_affinity_mat_t *build_cost_matrix(tm_affinity_mat_t *aff_mat, double* obj_weight, double comm_speed) +static tm_affinity_mat_t *build_cost_matrix(tm_affinity_mat_t *aff_mat, double* obj_weight, double comm_speed) { double **mat = NULL, *sum_row; double **old_mat; @@ -1747,7 +1741,7 @@ tm_affinity_mat_t *build_cost_matrix(tm_affinity_mat_t *aff_mat, double* obj_wei } if(mat[i][j]) nnz++; } - return new_affinity_mat(mat, sum_row, mat_order,nnz); + return tm_new_affinity_mat(mat, sum_row, mat_order,nnz); } @@ -1759,7 +1753,7 @@ tm_affinity_mat_t *build_cost_matrix(tm_affinity_mat_t *aff_mat, double* obj_wei arity: number of children of parent (i.e.) size of the group to compute solution_size: size of new_tab_node (i.e) the number of parents */ -void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new_tab_node, +static void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity, int solution_size, double* obj_weigth, double comm_speed){ /* @@ -1793,14 +1787,14 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new /* if(nb_groups>30000||depth>5){*/ if( nbg > 30000 ){ - double duration; + double duration_loc; TIC; if( arity <= 2 ){ /*super_fast_grouping(tab, tab_node, new_tab_node, arity, mat_order, solution_size, k);*/ if(verbose_level >= INFO ) printf("Bucket Grouping...\n"); - val = bucket_grouping(cost_mat, tab_node, new_tab_node, arity, solution_size); + val = tm_bucket_grouping(cost_mat, tab_node, new_tab_node, arity, solution_size); }else if( arity <= 5){ if(verbose_level >= INFO) printf("Fast Grouping...\n"); @@ -1811,9 +1805,9 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new val = k_partition_grouping(cost_mat, tab_node, new_tab_node, arity, solution_size); } - duration = TOC; + duration_loc = TOC; if(verbose_level >= INFO) - printf("Fast grouping duration=%f\n", duration); + printf("Fast grouping duration=%f\n", duration_loc); if(verbose_level >= INFO) display_grouping(new_tab_node, solution_size, arity, val); @@ -1932,7 +1926,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new new_tab_node[l].arity = arity; /* printf("arity=%d\n", new_tab_node[l].arity); */ - update_val(cost_mat, &new_tab_node[l]); + tm_update_val(cost_mat, &new_tab_node[l]); } delete_group_list((&list)->next); @@ -1952,7 +1946,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new printf("Grouping done in %.4fs!\n", duration); } -void complete_aff_mat(tm_affinity_mat_t **aff_mat , int mat_order, int K) +static void complete_aff_mat(tm_affinity_mat_t **aff_mat , int mat_order, int K) { double **old_mat = NULL, **new_mat = NULL; double *sum_row; int M, i; @@ -1971,10 +1965,10 @@ void complete_aff_mat(tm_affinity_mat_t **aff_mat , int mat_order, int K) sum_row[i] = (*aff_mat)->sum_row[i]; } - *aff_mat = new_affinity_mat(new_mat, sum_row, M, (*aff_mat)->nnz); + *aff_mat = tm_new_affinity_mat(new_mat, sum_row, M, (*aff_mat)->nnz); } -void complete_obj_weight(double **tab, int mat_order, int K) +void tm_complete_obj_weight(double **tab, int mat_order, int K) { double *old_tab = NULL, *new_tab = NULL, avg; int M, i; @@ -2000,13 +1994,13 @@ void complete_obj_weight(double **tab, int mat_order, int K) new_tab[i] = avg; } -void create_dumb_tree(tm_tree_t *node, int depth, tm_topology_t *topology) +static void create_dumb_tree(tm_tree_t *node, int depth, tm_topology_t *topology) { tm_tree_t **list_child = NULL; int arity, i; if( depth == topology->nb_levels-1) { - set_node(node, NULL, 0, NULL, -1, 0, NULL, depth); + tm_set_node(node, NULL, 0, NULL, -1, 0, NULL, depth); return; } @@ -2022,9 +2016,9 @@ void create_dumb_tree(tm_tree_t *node, int depth, tm_topology_t *topology) /* list_child => node->child ; list_child[0] => node->tab_child */ /* printf("list_child[0] = %p\n",list_child[0]); */ - set_node(node, list_child, arity, NULL, -1, 0, NULL, depth); + tm_set_node(node, list_child, arity, NULL, -1, 0, NULL, depth); } -void complete_tab_node(tm_tree_t **tab, int mat_order, int K, int depth, tm_topology_t *topology) +static void complete_tab_node(tm_tree_t **tab, int mat_order, int K, int depth, tm_topology_t *topology) { tm_tree_t *old_tab = NULL, *new_tab = NULL; int M, i; @@ -2050,7 +2044,7 @@ void complete_tab_node(tm_tree_t **tab, int mat_order, int K, int depth, tm_topo FREE(old_tab); } -void set_deb_tab_child(tm_tree_t *tree, tm_tree_t *child, int depth) +static void set_deb_tab_child(tm_tree_t *tree, tm_tree_t *child, int depth) { /* printf("depth=%d\t%p\t%p\n", depth, child, tree);*/ if( depth > 0 ) @@ -2071,7 +2065,7 @@ depth: current depth of the algorithm toplogy: description of the hardware topology. constraints: set of constraints: core ids where to bind the processes */ -tm_tree_t *build_level_topology(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, int arity, int depth, tm_topology_t *topology, +static tm_tree_t *build_level_topology(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, int arity, int depth, tm_topology_t *topology, double *obj_weight, double *comm_speed) { @@ -2107,7 +2101,7 @@ tm_tree_t *build_level_topology(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, /* add K rows and columns to comm_matrix*/ complete_aff_mat(&aff_mat, mat_order, K); /* add K element to the object weight*/ - complete_obj_weight(&obj_weight, mat_order, K); + tm_complete_obj_weight(&obj_weight, mat_order, K); /*display_tab(tab, mat_order+K);*/ /* add a dumb tree to the K new "virtual nodes"*/ complete_tab_node(&tab_node, mat_order, K, depth, topology); @@ -2129,7 +2123,7 @@ tm_tree_t *build_level_topology(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, for( i = 0 ; i < M ; i++ ){ tm_tree_t **list_child = NULL; list_child = (tm_tree_t**)CALLOC(arity, sizeof(tm_tree_t*)); - set_node(&new_tab_node[i], list_child, arity, NULL, i, 0, tab_node, depth); + tm_set_node(&new_tab_node[i], list_child, arity, NULL, i, 0, tab_node, depth); } duration = TOC; if(verbose_level >= INFO) @@ -2192,7 +2186,7 @@ tm_tree_t *build_level_topology(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, -tm_tree_t *bottom_up_build_tree_from_topology(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, +static tm_tree_t *bottom_up_build_tree_from_topology(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, double *obj_weight, double *comm_speed){ int depth, i; tm_tree_t *res = NULL, *tab_node = NULL; @@ -2201,7 +2195,7 @@ tm_tree_t *bottom_up_build_tree_from_topology(tm_topology_t *topology, tm_affini tab_node = (tm_tree_t*)MALLOC(sizeof(tm_tree_t)*mat_order); depth = topology->nb_levels; for( i = 0 ; i < mat_order ; i++ ) - set_node(&tab_node[i], NULL, 0, NULL, i, 0, NULL, depth); + tm_set_node(&tab_node[i], NULL, 0, NULL, i, 0, NULL, depth); if(verbose_level >= INFO) @@ -2229,7 +2223,7 @@ tm_tree_t *bottom_up_build_tree_from_topology(tm_topology_t *topology, tm_affini */ -int check_constraints(tm_topology_t *topology, int **constraints) +static int check_constraints(tm_topology_t *topology, int **constraints) { int sorted = 1; @@ -2254,7 +2248,7 @@ int check_constraints(tm_topology_t *topology, int **constraints) } if(!sorted){ - qsort(*constraints, nb_constraints , sizeof(int), int_cmp_inc); + qsort(*constraints, nb_constraints , sizeof(int), tm_int_cmp_inc); } }else{ @@ -2280,14 +2274,14 @@ tm_tree_t * tm_build_tree_from_topology(tm_topology_t *topology, tm_affinity_mat /* Here constraints expended to take into account the oversuscribing factor */ nb_constraints = check_constraints (topology, &constraints); nb_processes = aff_mat->order; - npu = nb_processing_units(topology); + npu = tm_nb_processing_units(topology); nb_slots = npu * oversub_fact; if(verbose_level >= INFO){ printf("Com matrix size : %d\n", nb_processes); printf("nb_constraints : %d\n", nb_constraints); if(constraints) - print_1D_tab(constraints, nb_constraints); + tm_print_1D_tab(constraints, nb_constraints); printf("nb_processing units : %d\n", npu); printf("Oversubscrbing factor: %d\n", oversub_fact); printf("Nb of slots : %d\n", nb_slots); @@ -2315,7 +2309,7 @@ tm_tree_t * tm_build_tree_from_topology(tm_topology_t *topology, tm_affinity_mat if(verbose_level >= INFO){ printf("Partitionning with constraints\n"); } - result = kpartition_build_tree_from_topology(topology, aff_mat->mat, nb_processes, constraints, nb_constraints, + result = tm_kpartition_build_tree_from_topology(topology, aff_mat->mat, nb_processes, constraints, nb_constraints, obj_weight, com_speed); result->nb_processes = aff_mat->order; FREE(constraints); diff --git a/3rd-party/treematch/tm_tree.h b/3rd-party/treematch/tm_tree.h index 6168f501618..4a472abdd2e 100644 --- a/3rd-party/treematch/tm_tree.h +++ b/3rd-party/treematch/tm_tree.h @@ -3,9 +3,9 @@ #include #include "treematch.h" -void update_val(tm_affinity_mat_t *aff_mat,tm_tree_t *parent); -void display_tab(double **tab,int N); -void set_node(tm_tree_t *node,tm_tree_t ** child, int arity,tm_tree_t *parent, +OMPI_HIDDEN void tm_update_val(tm_affinity_mat_t *aff_mat,tm_tree_t *parent); +OMPI_HIDDEN void tm_display_tab(double **tab,int N); +OMPI_HIDDEN void tm_set_node(tm_tree_t *node,tm_tree_t ** child, int arity,tm_tree_t *parent, int id,double val,tm_tree_t *tab_child,int depth); diff --git a/3rd-party/treematch/tm_verbose.h b/3rd-party/treematch/tm_verbose.h index e16cbbc6c00..0a533d32e03 100644 --- a/3rd-party/treematch/tm_verbose.h +++ b/3rd-party/treematch/tm_verbose.h @@ -1,4 +1,5 @@ #include +#include "ompi_config.h" #define NONE 0 /* output in stderr*/ @@ -12,11 +13,11 @@ /* return 0 on errror and 1 on success */ -int tm_open_verbose_file(char *filename); -int tm_close_verbose_file(void); -void tm_set_verbose_level(unsigned int level); -unsigned int tm_get_verbose_level(void); -FILE * tm_get_verbose_output(void); +OMPI_HIDDEN int tm_open_verbose_file(char *filename); +OMPI_HIDDEN int tm_close_verbose_file(void); +OMPI_HIDDEN void tm_set_verbose_level(unsigned int level); +OMPI_HIDDEN unsigned int tm_get_verbose_level(void); +OMPI_HIDDEN FILE * tm_get_verbose_output(void); #define tm_verbose_printf(level, ...) level <= tm_get_verbose_level()?fprintf(tm_get_verbose_output(),__VA_ARGS__):0 diff --git a/3rd-party/treematch/treematch.h b/3rd-party/treematch/treematch.h index e15e9ab5a4a..9d4c943b1ad 100644 --- a/3rd-party/treematch/treematch.h +++ b/3rd-party/treematch/treematch.h @@ -4,6 +4,7 @@ /* size_t definition */ #include #include "tm_verbose.h" +#include "ompi_config.h" /********* TreeMatch Public Enum **********/ @@ -105,10 +106,10 @@ typedef struct { /************ TreeMatch Public API ************/ /* construct topology from local one using hwloc */ -tm_topology_t* tm_get_local_topology_with_hwloc(void); +OMPI_HIDDEN tm_topology_t* tm_get_local_topology_with_hwloc(void); /* Aletrnatively, load XML or TGT topology */ -tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_type); +OMPI_HIDDEN tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_type); /* Alternatively, build a synthetic balanced topology. @@ -136,74 +137,74 @@ tm_topology_t *tm_load_topology(char *arch_filename, tm_file_type_t arch_file_ty topology = tm_build_synthetic_topology(arity,cost,5,cn,2); */ -tm_topology_t *tm_build_synthetic_topology(int *arity, double *cost, int nb_levels, int *core_numbering, int nb_core_per_nodes); +OMPI_HIDDEN tm_topology_t *tm_build_synthetic_topology(int *arity, double *cost, int nb_levels, int *core_numbering, int nb_core_per_nodes); /* load affinity matrix */ -tm_affinity_mat_t *tm_load_aff_mat(char *com_filename); +OMPI_HIDDEN tm_affinity_mat_t *tm_load_aff_mat(char *com_filename); /* Alternativelly, build the affinity matrix from a array of array of matrix of size order by order For performance reason mat is not copied. */ -tm_affinity_mat_t * tm_build_affinity_mat(double **mat, int order); +OMPI_HIDDEN tm_affinity_mat_t * tm_build_affinity_mat(double **mat, int order); /* Add constraints to toplogy Return 1 on success and 0 if the constari,ts id are not compatible withe nodes id */ -int tm_topology_add_binding_constraints(char *bind_filename, tm_topology_t *topology); +OMPI_HIDDEN int tm_topology_add_binding_constraints(char *bind_filename, tm_topology_t *topology); /* Alternatively, set the constraints from an array. Return 1 on success and 0 if the constari,ts id are not compatible withe nodes id The array constraints is copied inside tm_topology_set_binding_constraints */ -int tm_topology_set_binding_constraints(int *constraints, int nb_constraints, tm_topology_t *topology); +OMPI_HIDDEN int tm_topology_set_binding_constraints(int *constraints, int nb_constraints, tm_topology_t *topology); /* display arity of the topology */ -void tm_display_arity(tm_topology_t *topology); +OMPI_HIDDEN void tm_display_arity(tm_topology_t *topology); /* display the full topology */ -void tm_display_topology(tm_topology_t *topology); +OMPI_HIDDEN void tm_display_topology(tm_topology_t *topology); /* Optimize the topology by decomposing arities */ -void tm_optimize_topology(tm_topology_t **topology); +OMPI_HIDDEN void tm_optimize_topology(tm_topology_t **topology); /* Manage oversubscribing */ -void tm_enable_oversubscribing(tm_topology_t *topology, unsigned int oversub_fact); +OMPI_HIDDEN void tm_enable_oversubscribing(tm_topology_t *topology, unsigned int oversub_fact); /* core of the treematch: compute the solution tree */ -tm_tree_t *tm_build_tree_from_topology(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, double *obj_weight, double *com_speed); +OMPI_HIDDEN tm_tree_t *tm_build_tree_from_topology(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, double *obj_weight, double *com_speed); /* compute the mapping according to the tree and the core numbering*/ -tm_solution_t *tm_compute_mapping(tm_topology_t *topology, tm_tree_t *comm_tree); +OMPI_HIDDEN tm_solution_t *tm_compute_mapping(tm_topology_t *topology, tm_tree_t *comm_tree); /* display the solution*/ -double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol, tm_metric_t metric); +OMPI_HIDDEN double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol, tm_metric_t metric); /* display RR, packed, MPIPP*/ -void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric); +OMPI_HIDDEN void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric); /* free TM strutures*/ -void tm_free_topology(tm_topology_t *topology); -void tm_free_tree(tm_tree_t *comm_tree); -void tm_free_solution(tm_solution_t *sol); -void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat); +OMPI_HIDDEN void tm_free_topology(tm_topology_t *topology); +OMPI_HIDDEN void tm_free_tree(tm_tree_t *comm_tree); +OMPI_HIDDEN void tm_free_solution(tm_solution_t *sol); +OMPI_HIDDEN void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat); /* manage verbosity of TM*/ void tm_set_verbose_level(unsigned int level); unsigned int tm_get_verbose_level(void); /* finalize treematch :check memory if necessary, and free internal variables (thread pool)*/ -void tm_finalize(void); +OMPI_HIDDEN void tm_finalize(void); /* Ask for exhaustive search: may be very long new_val == 0 : no exhuative search new_val != 0 : exhuative search */ -void tm_set_exhaustive_search_flag(int new_val); -int tm_get_exhaustive_search_flag(void); +OMPI_HIDDEN void tm_set_exhaustive_search_flag(int new_val); +OMPI_HIDDEN int tm_get_exhaustive_search_flag(void); /* Ask for greedy k-partitionning even if scotch is available new_val == 0 : no greedy k-partitionning new_val != 0 : greedy k-partitionning */ -void tm_set_greedy_flag(int new_val); -int tm_get_greedy_flag(void); +OMPI_HIDDEN void tm_set_greedy_flag(int new_val); +OMPI_HIDDEN int tm_get_greedy_flag(void); /* Setting the maximum number of threads you want to use in parallel parts of TreeMatch */ -void tm_set_max_nb_threads(unsigned int val); +OMPI_HIDDEN void tm_set_max_nb_threads(unsigned int val); /* managing the usage of physical vs. logical core numbering when using hwloc/xml files */ -void tm_set_numbering(tm_numbering_t new_val); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */ -tm_numbering_t tm_get_numbering(void); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */ +OMPI_HIDDEN void tm_set_numbering(tm_numbering_t new_val); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */ +OMPI_HIDDEN tm_numbering_t tm_get_numbering(void); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */ #include "tm_malloc.h" diff --git a/Doxyfile b/Doxyfile index 1f19f0ad769..e8c88d33574 100644 --- a/Doxyfile +++ b/Doxyfile @@ -401,7 +401,7 @@ RECURSIVE = YES # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = opal/event ompi/mca/io/romio +EXCLUDE = opal/event # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are diff --git a/HACKING.md b/HACKING.md index fe045ecf0e4..1c55040a98e 100644 --- a/HACKING.md +++ b/HACKING.md @@ -6,253 +6,11 @@ This file is here for those who are building/exploring OMPI in its source code form, most likely through a developer's tree (i.e., a Git clone). +## This file has moved -## Developer Builds: Compiler Pickyness by Default +Please see the content of this file in its new location: +https://docs.open-mpi.org/en/main/developers/ -If you are building Open MPI from a Git clone (i.e., there is a `.git` -directory in your build tree), the default build includes extra -compiler pickyness, which will result in more compiler warnings than -in non-developer builds. Getting these extra compiler warnings is -helpful to Open MPI developers in making the code base as clean as -possible. - -Developers can disable this picky-by-default behavior by using the -`--disable-picky` configure option. Also note that extra-picky compiles -do *not* happen automatically when you do a VPATH build (e.g., if -`.git` is in your source tree, but not in your build tree). - -Prior versions of Open MPI would automatically activate a lot of -(performance-reducing) debugging code by default if `.git` was found -in your build tree. This is no longer true. You can manually enable -these (performance-reducing) debugging features in the Open MPI code -base with these configure options: - -* `--enable-debug` -* `--enable-mem-debug` -* `--enable-mem-profile` - -***NOTE:*** These options are really only relevant to those who are -developing Open MPI itself. They are not generally helpful for -debugging general MPI applications. - - -## Use of GNU Autoconf, Automake, and Libtool (and m4) - -You need to read/care about this section *ONLY* if you are building -from a developer's tree (i.e., a Git clone of the Open MPI source -tree). If you have an Open MPI distribution tarball, the contents of -this section are optional -- you can (and probably should) skip -reading this section. - -If you are building Open MPI from a developer's tree, you must first -install fairly recent versions of the GNU tools Autoconf, Automake, -and Libtool (and possibly GNU m4, because recent versions of Autoconf -have specific GNU m4 version requirements). The specific versions -required depend on if you are using the Git master branch or a release -branch (and which release branch you are using). [The specific -versions can be found -here](https://www.open-mpi.org/source/building.php). - -You can check what versions of the autotools you have installed with -the following: - -``` -shell$ m4 --version -shell$ autoconf --version -shell$ automake --version -shell$ libtoolize --version -``` - -[Required version levels for all the OMPI releases can be found -here](https://www.open-mpi.org/source/building.php). - -To strengthen the above point: the core Open MPI developers typically -use very, very recent versions of the GNU tools. There are known bugs -in older versions of the GNU tools that Open MPI no longer compensates -for (it seemed senseless to indefinitely support patches for ancient -versions of Autoconf, for example). You *WILL* have problems if you -do not use recent versions of the GNU tools. - -***NOTE:*** On MacOS/X, the default `libtool` program is different -than the GNU libtool. You must download and install the GNU version -(e.g., via MacPorts, Homebrew, or some other mechanism). - -If you need newer versions, you are *strongly* encouraged to heed the -following advice: - -1. Unless your OS distribution has easy-to-use binary installations, - the sources can be can be downloaded from: - * https://ftp.gnu.org/gnu/autoconf/ - * https://ftp.gnu.org/gnu/automake/ - * https://ftp.gnu.org/gnu/libtool/ - * And if you need it: https://ftp.gnu.org/gnu/m4/ - - ***NOTE:*** It is certainly easiest to download/build/install all - four of these tools together. But note that Open MPI has no - specific m4 requirements; it is only listed here because Autoconf - requires minimum versions of GNU m4. Hence, you may or may not - *need* to actually install a new version of GNU m4. That being - said, if you are confused or don't know, just install the latest - GNU m4 with the rest of the GNU Autotools and everything will work - out fine. - -1. Build and install the tools in the following order: - 1. m4 - 1. Autoconf - 1. Automake - 1. Libtool - -1. You MUST install the last three tools (Autoconf, Automake, Libtool) - into the same prefix directory. These three tools are somewhat - inter-related, and if they're going to be used together, they MUST - share a common installation prefix. - - You can install m4 anywhere as long as it can be found in the path; - it may be convenient to install it in the same prefix as the other - three. Or you can use any recent-enough m4 that is in your path. - - 1. It is *strongly* encouraged that you do not install your new - versions over the OS-installed versions. This could cause - other things on your system to break. Instead, install into - `$HOME/local`, or `/usr/local`, or wherever else you tend to - install "local" kinds of software. - 1. In doing so, be sure to prefix your $path with the directory - where they are installed. For example, if you install into - `$HOME/local`, you may want to edit your shell startup file - (`.bashrc`, `.cshrc`, `.tcshrc`, etc.) to have something like: - - ```sh - # For bash/sh: - export PATH=$HOME/local/bin:$PATH - # For csh/tcsh: - set path = ($HOME/local/bin $path) - ``` - - 1. Ensure to set your `$PATH` *BEFORE* you configure/build/install - the four packages. - -1. All four packages require two simple commands to build and - install (where PREFIX is the prefix discussed in 3, above). - - ``` - shell$ cd - shell$ ./configure --prefix=PREFIX - shell$ make; make install - ``` - - ***NOTE:*** If you are using the `csh` or `tcsh` shells, be sure to - run the `rehash` command after you install each package. - - ``` - shell$ cd - shell$ ./configure --prefix=PREFIX - shell$ make; make install - ``` - - ***NOTE:*** If you are using the `csh` or `tcsh` shells, be sure to - run the `rehash` command after you install each package. - - ``` - shell$ cd - shell$ ./configure --prefix=PREFIX - shell$ make; make install - ``` - - ***NOTE:*** If you are using the `csh` or `tcsh` shells, be sure to - run the `rehash` command after you install each package. - - ``` - shell$ cd - shell$ ./configure --prefix=PREFIX - shell$ make; make install - ``` - - ***NOTE:*** If you are using the `csh` or `tcsh` shells, be sure to - run the `rehash` command after you install each package. - - m4, Autoconf and Automake build and install very quickly; Libtool - will take a minute or two. - -1. You can now run OMPI's top-level `autogen.pl` script. This script - will invoke the GNU Autoconf, Automake, and Libtool commands in the - proper order and setup to run OMPI's top-level `configure` script. - - Running `autogen.pl` may take a few minutes, depending on your - system. It's not very exciting to watch. :smile: - - If you have a multi-processor system, enabling the multi-threaded - behavior in Automake 1.11 (or newer) can result in `autogen.pl` - running faster. Do this by setting the `AUTOMAKE_JOBS` environment - variable to the number of processors (threads) that you want it to - use before invoking `autogen`.pl. For example (you can again put - this in your shell startup files): - - ```sh - # For bash/sh: - export AUTOMAKE_JOBS=4 - # For csh/tcsh: - set AUTOMAKE_JOBS 4 - ``` - - 1. You generally need to run autogen.pl whenever the top-level file - `configure.ac` changes, or any files in the `config/` or - `/config/` directories change (these directories are - where a lot of "include" files for Open MPI's `configure` script - live). - - 1. You do *NOT* need to re-run `autogen.pl` if you modify a - `Makefile.am`. - -## Use of Flex - -Flex is used during the compilation of a developer's checkout (it is -not used to build official distribution tarballs). Other flavors of -lex are *not* supported: given the choice of making parsing code -portable between all flavors of lex and doing more interesting work on -Open MPI, we greatly prefer the latter. - -Note that no testing has been performed to see what the minimum -version of Flex is required by Open MPI. We suggest that you use -v2.5.35 at the earliest. - -***NOTE:*** Windows developer builds of Open MPI *require* Flex version -2.5.35. Specifically, we know that v2.5.35 works and 2.5.4a does not. -We have not tested to figure out exactly what the minimum required -flex version is on Windows; we suggest that you use 2.5.35 at the -earliest. It is for this reason that the -`contrib/dist/make_dist_tarball` script checks for a Windows-friendly -version of Flex before continuing. - -For now, Open MPI will allow developer builds with Flex 2.5.4. This -is primarily motivated by the fact that RedHat/Centos 5 ships with -Flex 2.5.4. It is likely that someday Open MPI developer builds will -require Flex version >=2.5.35. - -Note that the `flex`-generated code generates some compiler warnings -on some platforms, but the warnings do not seem to be consistent or -uniform on all platforms, compilers, and flex versions. As such, we -have done little to try to remove those warnings. - -If you do not have Flex installed, see [the Flex Github -repository](https://github.com/westes/flex). - -## Use of Pandoc - -Similar to prior sections, you need to read/care about this section -*ONLY* if you are building from a developer's tree (i.e., a Git clone -of the Open MPI source tree). If you have an Open MPI distribution -tarball, the contents of this section are optional -- you can (and -probably should) skip reading this section. - -The Pandoc tool is used to generate Open MPI's man pages. -Specifically: Open MPI's man pages are written in Markdown; Pandoc is -the tool that converts that Markdown to nroff (i.e., the format of man -pages). - -You must have Pandoc >=v1.12 when building Open MPI from a developer's -tree. If configure cannot find Pandoc >=v1.12, it will abort. - -If you need to install Pandoc, check your operating system-provided -packages (to include MacOS Homebrew and MacPorts). [The Pandoc -project web site](https://pandoc.org/) itself also offers binaries for -their releases. +Additionally, see +https://docs.open-mpi.org/en/main/developers/prerequisites.html#sphinx-and-therefore-python +if you want to edit and build the documentation locally. diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 33a6bb554b5..00000000000 --- a/INSTALL +++ /dev/null @@ -1,101 +0,0 @@ -Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. -Copyright (c) 2004-2005 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. -Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. -Copyright (c) 2004-2005 The Regents of the University of California. - All rights reserved. -Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved. -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - - -For More Information -==================== - -This file is a *very* short overview of building and installing Open -MPI, and building MPI applications. Much more information is -available on the Open MPI web site (e.g., see the FAQ section): - - https://www.open-mpi.org/ - - -Developer Builds -================ - -If you have checked out a DEVELOPER'S COPY of Open MPI (i.e., you -cloned from Git), you should read the HACKING file before attempting -to build Open MPI. You must then run: - -shell$ ./autogen.pl - -You will need very recent versions of GNU Autoconf, Automake, and -Libtool. If autogen.pl fails, read the HACKING file. If anything -else fails, read the HACKING file. Finally, we suggest reading the -HACKING file. - -*** NOTE: Developer's copies of Open MPI typically include a large -performance penalty at run-time because of extra debugging overhead. - - -User Builds -=========== - -Building Open MPI is typically a combination of running "configure" -and "make". Execute the following commands to install the Open MPI -system from within the directory at the top of the tree: - -shell$ ./configure --prefix=/where/to/install -[...lots of output...] -shell$ make all install - -If you need special access to install, then you can execute "make -all" as a user with write permissions in the build tree, and a -separate "make install" as a user with write permissions to the -install tree. - -Compiling support for various networks or other specific hardware may -require additional command ling flags when running configure. See the -README file for more details. Note that VPATH builds are fully -supported. For example: - -shell$ tar xf openmpi-X.Y.Z.tar.gz -shell$ cd openmpi-X.Y.Z -shell$ mkdir build -shell$ cd build -shell$ ../configure ...your options... -[...lots of output...] -shell$ make all install - -Parallel builds are also supported (although some versions of "make", -such as GNU make, will only use the first target listed on the command -line when executable parallel builds). For example (assume GNU make): - -shell$ make -j 4 all -[...lots of output...] -shell$ make install - -Parallel make is generally only helpful in the build phase (i.e., -"make all"); the installation process (i.e., "make install") is mostly -serial and does not benefit much from parallelization. - - -Compiling MPI Applications -========================== - -MPI applications should be compiled using the Open MPI "wrapper" -compilers: - -C programs: mpicc your-code.c -C++ programs: mpiCC your-code.cc or - mpic++ your-code.cc (for case-insensitive filesystems) -Fortran programs: mpifort your-code.f90 - -These compilers simply add various command line flags (such as -lmpi) -and invoke a back-end compiler; they are not compilers in themselves. diff --git a/LICENSE b/LICENSE index 4ed90b0f879..679847e168b 100644 --- a/LICENSE +++ b/LICENSE @@ -5,37 +5,37 @@ team who have contributed code to this release. The copyrights for code used under license from other parties are included in the corresponding files. -Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana +Copyright (c) 2004-2012 The Trustees of Indiana University and Indiana University Research and Technology Corporation. All rights reserved. -Copyright (c) 2004-2017 The University of Tennessee and The University +Copyright (c) 2004-2021 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. -Copyright (c) 2004-2010 High Performance Computing Center Stuttgart, +Copyright (c) 2004-2018 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved. Copyright (c) 2004-2008 The Regents of the University of California. All rights reserved. Copyright (c) 2006-2018 Los Alamos National Security, LLC. All rights reserved. -Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved. +Copyright (c) 2006-2021 Cisco Systems, Inc. All rights reserved. Copyright (c) 2006-2010 Voltaire, Inc. All rights reserved. -Copyright (c) 2006-2017 Sandia National Laboratories. All rights reserved. +Copyright (c) 2006-2021 Sandia National Laboratories. All rights reserved. Copyright (c) 2006-2010 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. -Copyright (c) 2006-2017 The University of Houston. All rights reserved. +Copyright (c) 2006-2021 The University of Houston. All rights reserved. Copyright (c) 2006-2009 Myricom, Inc. All rights reserved. Copyright (c) 2007-2017 UT-Battelle, LLC. All rights reserved. -Copyright (c) 2007-2020 IBM Corporation. All rights reserved. +Copyright (c) 2007-2021 IBM Corporation. All rights reserved. Copyright (c) 1998-2005 Forschungszentrum Juelich, Juelich Supercomputing Centre, Federal Republic of Germany Copyright (c) 2005-2008 ZIH, TU Dresden, Federal Republic of Germany Copyright (c) 2007 Evergrid, Inc. All rights reserved. -Copyright (c) 2008 Chelsio, Inc. All rights reserved. +Copyright (c) 2008-2016 Chelsio, Inc. All rights reserved. Copyright (c) 2008-2009 Institut National de Recherche en Informatique. All rights reserved. Copyright (c) 2007 Lawrence Livermore National Security, LLC. All rights reserved. -Copyright (c) 2007-2017 Mellanox Technologies. All rights reserved. +Copyright (c) 2007-2019 Mellanox Technologies. All rights reserved. Copyright (c) 2006-2010 QLogic Corporation. All rights reserved. Copyright (c) 2008-2017 Oak Ridge National Labs. All rights reserved. Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved. @@ -43,23 +43,28 @@ Copyright (c) 2009-2015 Bull SAS. All rights reserved. Copyright (c) 2010 ARM ltd. All rights reserved. Copyright (c) 2016 ARM, Inc. All rights reserved. Copyright (c) 2010-2011 Alex Brick . All rights reserved. -Copyright (c) 2012 The University of Wisconsin-La Crosse. All rights - reserved. +Copyright (c) 2012 The University of Wisconsin-La Crosse. All rights reserved. Copyright (c) 2013-2020 Intel, Inc. All rights reserved. -Copyright (c) 2011-2017 NVIDIA Corporation. All rights reserved. -Copyright (c) 2016 Broadcom Limited. All rights reserved. -Copyright (c) 2011-2017 Fujitsu Limited. All rights reserved. +Copyright (c) 2011-2021 NVIDIA Corporation. All rights reserved. +Copyright (c) 2016-2018 Broadcom Limited. All rights reserved. +Copyright (c) 2011-2021 Fujitsu Limited. All rights reserved. Copyright (c) 2014-2015 Hewlett-Packard Development Company, LP. All rights reserved. -Copyright (c) 2013-2017 Research Organization for Information Science (RIST). +Copyright (c) 2013-2021 Research Organization for Information Science (RIST). All rights reserved. -Copyright (c) 2017-2020 Amazon.com, Inc. or its affiliates. All Rights +Copyright (c) 2017-2021 Amazon.com, Inc. or its affiliates. All Rights reserved. Copyright (c) 2018 DataDirect Networks. All rights reserved. -Copyright (c) 2018-2020 Triad National Security, LLC. All rights reserved. -Copyright (c) 2020 Google, LLC. All rights reserved. +Copyright (c) 2018-2021 Triad National Security, LLC. All rights reserved. +Copyright (c) 2019-2021 Hewlett Packard Enterprise Development, LP. +Copyright (c) 2020-2021 Google, LLC. All rights reserved. Copyright (c) 2002 University of Chicago Copyright (c) 2001 Argonne National Laboratory +Copyright (c) 2020-2021 Cornelis Networks, Inc. All rights reserved. +Copyright (c) 2021 Nanook Consulting +Copyright (c) 2017-2019 Iowa State University Research Foundation, Inc. + All rights reserved. +Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. $COPYRIGHT$ diff --git a/Makefile.am b/Makefile.am index 63613685ffb..bff3c79c64f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,10 +9,10 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights reserved. # Copyright (c) 2014-2019 Intel, Inc. All rights reserved. -# Copyright (c) 2017-2020 Amazon.com, Inc. or its affiliates. +# Copyright (c) 2017-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # All Rights reserved. # Copyright (c) 2020 IBM Corporation. All rights reserved. # $COPYRIGHT$ @@ -22,9 +22,12 @@ # $HEADER$ # -SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_SUBDIRS) test -DIST_SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_DIST_SUBDIRS) test -EXTRA_DIST = README.md INSTALL VERSION Doxyfile LICENSE autogen.pl README.JAVA.md AUTHORS +# There is an assumption in config/Makefile.am that config is the first +# subdirectory in the DIST_SUBDIRS list. If that changes, work may +# be required. +SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_SUBDIRS) test docs +DIST_SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_DIST_SUBDIRS) test docs +EXTRA_DIST = README.md VERSION Doxyfile LICENSE autogen.pl AUTHORS include examples/Makefile.include diff --git a/Makefile.ompi-rules b/Makefile.ompi-rules index d8aefcb8f3d..d18d49c4978 100644 --- a/Makefile.ompi-rules +++ b/Makefile.ompi-rules @@ -1,7 +1,8 @@ # -*- makefile -*- -# Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2008-2022 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. # Copyright (c) 2020 Intel, Inc. All rights reserved. +# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -9,72 +10,6 @@ # $HEADER$ # -MD2NROFF = $(OMPI_TOP_SRCDIR)/config/md2nroff.pl - -TRIM_OPTIONS= -if ! MAN_PAGE_BUILD_MPIFH_BINDINGS - TRIM_OPTIONS += --nofortran -endif -if ! MAN_PAGE_BUILD_USEMPIF08_BINDINGS - TRIM_OPTIONS += --nof08 -endif - -# JMS This rule can be deleted once all man pages have been converted -# to markdown. -.1in.1: - $(OMPI_V_GEN) $(top_srcdir)/config/make_manpage.pl \ - --package-name='@PACKAGE_NAME@' \ - --package-version='@PACKAGE_VERSION@' \ - --ompi-date='@OMPI_RELEASE_DATE@' \ - --opal-date='@OPAL_RELEASE_DATE@' \ - --input=$< \ - --output=$@ - -# JMS This rule can be deleted once all man pages have been converted -# to markdown. -.3in.3: - $(OMPI_V_GEN) $(top_srcdir)/config/make_manpage.pl \ - --package-name='@PACKAGE_NAME@' \ - --package-version='@PACKAGE_VERSION@' \ - --ompi-date='@OMPI_RELEASE_DATE@' \ - --opal-date='@OPAL_RELEASE_DATE@' \ - $(TRIM_OPTIONS) \ - --input=$< \ - --output=$@ - -# JMS This rule can be deleted once all man pages have been converted -# to markdown. -.7in.7: - $(OMPI_V_GEN) $(top_srcdir)/config/make_manpage.pl \ - --package-name='@PACKAGE_NAME@' \ - --package-version='@PACKAGE_VERSION@' \ - --ompi-date='@OMPI_RELEASE_DATE@' \ - --opal-date='@OPAL_RELEASE_DATE@' \ - --input=$< \ - --output=$@ - -%.1: %.1.md - $(OMPI_V_GEN) $(MD2NROFF) --source=$< --dest=$@ --pandoc=$(PANDOC) - -%.3: %.3.md - $(OMPI_V_GEN) $(MD2NROFF) --source=$< --dest=$@ --pandoc=$(PANDOC) - -%.5: %.5.md - $(OMPI_V_GEN) $(MD2NROFF) --source=$< --dest=$@ --pandoc=$(PANDOC) - -%.7: %.7.md - $(OMPI_V_GEN) $(MD2NROFF) --source=$< --dest=$@ --pandoc=$(PANDOC) - -# It is an error to "configure --disable-man-pages" and then try to -# "make dist". -if !OPAL_ENABLE_MAN_PAGES -dist-hook: - @echo "************************************************************************************" - @echo "ERROR: 'make dist' inoperable when Open MPI is configured with --disable-man-pages" - @echo "************************************************************************************" - @/bin/false -endif - # A little verbosity magic; "make" will show the terse output. "make # V=1" will show the actual commands used (just like the other # Automake-generated compilation/linker rules). @@ -91,3 +26,19 @@ ompi__v_MKDIR_0 = @echo " MKDIR " $@; OMPI_V_GEN = $(ompi__v_GEN_$V) ompi__v_GEN_ = $(ompi__v_GEN_$AM_DEFAULT_VERBOSITY) ompi__v_GEN_0 = @echo " GENERATE" $@; + +OMPI_V_COPYALL = $(ompi__v_COPYALL_$V) +ompi__v_COPYALL_ = $(ompi__v_COPYALL_$AM_DEFAULT_VERBOSITY) +ompi__v_COPYALL_0 = @echo " COPY tree $@"; + +OMPI_V_SPHINX_COPYRST = $(ompi__v_SPHINX_COPYRST_$V) +ompi__v_SPHINX_COPYRST_ = $(ompi__v_SPHINX_COPYRST_$AM_DEFAULT_VERBOSITY) +ompi__v_SPHINX_COPYRST_0 = @echo " COPY RST source files"; + +OMPI_V_SPHINX_HTML = $(ompi__v_SPHINX_HTML_$V) +ompi__v_SPHINX_HTML_ = $(ompi__v_SPHINX_HTML_$AM_DEFAULT_VERBOSITY) +ompi__v_SPHINX_HTML_0 = @echo " GENERATE HTML docs"; + +OMPI_V_SPHINX_MAN = $(ompi__v_SPHINX_MAN_$V) +ompi__v_SPHINX_MAN_ = $(ompi__v_SPHINX_MAN_$AM_DEFAULT_VERBOSITY) +ompi__v_SPHINX_MAN_0 = @echo " GENERATE man pages"; diff --git a/NEWS b/NEWS deleted file mode 100644 index fe089b84f87..00000000000 --- a/NEWS +++ /dev/null @@ -1,4638 +0,0 @@ -Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. -Copyright (c) 2004-2006 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. -Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. -Copyright (c) 2004-2006 The Regents of the University of California. - All rights reserved. -Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved. -Copyright (c) 2006 Voltaire, Inc. All rights reserved. -Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. -Copyright (c) 2006-2017 Los Alamos National Security, LLC. All rights - reserved. -Copyright (c) 2010-2017 IBM Corporation. All rights reserved. -Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. -Copyright (c) 2012 Sandia National Laboratories. All rights reserved. -Copyright (c) 2012 University of Houston. All rights reserved. -Copyright (c) 2013 NVIDIA Corporation. All rights reserved. -Copyright (c) 2013-2018 Intel, Inc. All rights reserved. -Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights - reserved. -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - -=========================================================================== - -This file contains the main features as well as overviews of specific -bug fixes (and other actions) for each version of Open MPI since -version 1.0. - -As more fully described in the "Software Version Number" section in -the README file, Open MPI typically releases two separate version -series simultaneously. Since these series have different goals and -are semi-independent of each other, a single NEWS-worthy item may be -introduced into different series at different times. For example, -feature F was introduced in the vA.B series at version vA.B.C, and was -later introduced into the vX.Y series at vX.Y.Z. - -The first time feature F is released, the item will be listed in the -vA.B.C section, denoted as: - - (** also to appear: X.Y.Z) -- indicating that this item is also - likely to be included in future release - version vX.Y.Z. - -When vX.Y.Z is later released, the same NEWS-worthy item will also be -included in the vX.Y.Z section and be denoted as: - - (** also appeared: A.B.C) -- indicating that this item was previously - included in release version vA.B.C. - -Master (not on release branches yet) ------------------------------------- - -********************************************************************** -* PRE-DEPRECATION WARNING: MPIR Support -* -* As was announced in summer 2017, Open MPI is deprecating support for -* MPIR-based tools beginning with the future release of OMPI v5.0, with -* full removal of that support tentatively planned for OMPI v6.0. -* -* This serves as a pre-deprecation warning to provide tools developers -* with sufficient time to migrate to PMIx. Support for PMIx-based -* tools will be rolled out during the OMPI v4.x series. No runtime -* deprecation warnings will be output during this time. -* -* Runtime deprecation warnings will be output beginning with the OMPI v5.0 -* release whenever MPIR-based tools connect to Open MPI's mpirun/mpiexec -* launcher. -********************************************************************** - -- Fix rank-by algorithms to properly rank by object and span -- Do not build Open SHMEM layer when there are no SPMLs available. - Currently, this means the Open SHMEM layer will only build if - a MXM or UCX library is found. -- Remove all vestiges of the C/R support - -4.0.5 -- August, 2020 ---------------------- - -- Fix a problem with MPI RMA compare and swap operations. Thanks - to Wojciech Chlapek for reporting. -- Disable binding of MPI processes to system resources by Open MPI - if an application is launched using SLURM's srun command. -- Disable building of the Fortran mpi_f08 module when configuring - Open MPI with default 8 byte Fortran integer size. Thanks to - @ahcien for reporting. -- Fix a problem with mpirun when the --map-by option is used. - Thanks to Wenbin Lyu for reporting. -- Fix some issues with MPI one-sided operations uncovered using Global - Arrays regression test-suite. Thanks to @bjpalmer for reporting. -- Fix a problem with make check when using the PGI compiler. Thanks to - Carl Ponder for reporting. -- Fix a problem with MPI_FILE_READ_AT_ALL that could lead to application - hangs under certain circumstances. Thanks to Scot Breitenfeld for - reporting. -- Fix a problem building C++ applications with newer versions of GCC. - Thanks to Constantine Khrulev for reporting. - -4.0.4 -- June, 2020 -------------------- - -- Fix a memory patcher issue intercepting shmat and shmdt. This was - observed on RHEL 8.x ppc64le (see README for more info). -- Fix an illegal access issue caught using gcc's address sanitizer. - Thanks to Georg Geiser for reporting. -- Add checks to avoid conflicts with a libevent library shipped with LSF. -- Switch to linking against libevent_core rather than libevent, if present. -- Add improved support for UCX 1.9 and later. -- Fix an ABI compatibility issue with the Fortran 2008 bindings. - Thanks to Alastair McKinstry for reporting. -- Fix an issue with rpath of /usr/lib64 when building OMPI on - systems with Lustre. Thanks to David Shrader for reporting. -- Fix a memory leak occurring with certain MPI RMA operations. -- Fix an issue with ORTE's mapping of MPI processes to resources. - Thanks to Alex Margolin for reporting and providing a fix. -- Correct a problem with incorrect error codes being returned - by OMPI MPI_T functions. -- Fix an issue with debugger tools not being able to attach - to mpirun more than once. Thanks to Gregory Lee for reporting. -- Fix an issue with the Fortran compiler wrappers when using - NAG compilers. Thanks to Peter Brady for reporting. -- Fix an issue with the ORTE ssh based process launcher at scale. - Thanks to Benjamín Hernández for reporting. -- Address an issue when using shared MPI I/O operations. OMPIO will - now successfully return from the file open statement but will - raise an error if the file system does not supported shared I/O - operations. Thanks to Romain Hild for reporting. -- Fix an issue with MPI_WIN_DETACH. Thanks to Thomas Naughton for reporting. - -4.0.3 -- March, 2020 ------------------------ - -- Update embedded PMIx to 3.1.5 -- Add support for Mellanox ConnectX-6. -- Fix an issue in OpenMPI IO when using shared file pointers. - Thanks to Romain Hild for reporting. -- Fix a problem with Open MPI using a previously installed - Fortran mpi module during compilation. Thanks to Marcin - Mielniczuk for reporting -- Fix a problem with Fortran compiler wrappers ignoring use of - disable-wrapper-runpath configure option. Thanks to David - Shrader for reporting. -- Fixed an issue with trying to use mpirun on systems where neither - ssh nor rsh is installed. -- Address some problems found when using XPMEM for intra-node message - transport. -- Improve dimensions returned by MPI_Dims_create for certain - cases. Thanks to @aw32 for reporting. -- Fix an issue when sending messages larger than 4GB. Thanks to - Philip Salzmann for reporting this issue. -- Add ability to specify alternative module file path using - Open MPI's RPM spec file. Thanks to @jschwartz-cray for reporting. -- Clarify use of --with-hwloc configuration option in the README. - Thanks to Marcin Mielniczuk for raising this documentation issue. -- Fix an issue with shmem_atomic_set. Thanks to Sameh Sharkawi for reporting. -- Fix a problem with MPI_Neighbor_alltoall(v,w) for cartesian communicators - with cyclic boundary conditions. Thanks to Ralph Rabenseifner and - Tony Skjellum for reporting. -- Fix an issue using Open MPIO on 32 bit systems. Thanks to - Orion Poplawski for reporting. -- Fix an issue with NetCDF test deadlocking when using the vulcan - Open MPIO component. Thanks to Orion Poplawski for reporting. -- Fix an issue with the mpi_yield_when_idle parameter being ignored - when set in the Open MPI MCA parameter configuration file. - Thanks to @iassiour for reporting. -- Address an issue with Open MPIO when writing/reading more than 2GB - in an operation. Thanks to Richard Warren for reporting. - -4.0.2 -- September, 2019 ------------------------- - -- Update embedded PMIx to 3.1.4 -- Enhance Open MPI to detect when processes are running in - different name spaces on the same node, in which case the - vader CMA single copy mechanism is disabled. Thanks - to Adrian Reber for reporting and providing a fix. -- Fix an issue with ORTE job tree launch mechanism. Thanks - to @lanyangyang for reporting. -- Fix an issue with env processing when running as root. - Thanks to Simon Byrne for reporting and providing a fix. -- Fix Fortran MPI_FILE_GET_POSITION return code bug. - Thanks to Wei-Keng Liao for reporting. -- Fix user defined datatypes/ops leak in nonblocking base collective - component. Thanks to Andrey Maslennikov for verifying fix. -- Fixed shared memory not working with spawned processes. - Thanks to @rodarima for reporting. -- Fix data corruption of overlapping datatypes on sends. - Thanks to DKRZ for reporting. -- Fix segfault in oob_tcp component on close with active listeners. - Thanks to Orivej Desh for reporting and providing a fix. -- Fix divide by zero segfault in ompio. - Thanks to @haraldkl for reporting and providing a fix. -- Fix finalize of flux compnents. - Thanks to Stephen Herbein and Jim Garlick for providing a fix. -- Fix osc_rdma_acc_single_intrinsic regression. - Thanks to Joseph Schuchart for reporting and providing a fix. -- Fix hostnames with large integers. - Thanks to @perrynzhou for reporting and providing a fix. -- Fix Deadlock in MPI_Fetch_and_op when using UCX - Thanks to Joseph Schuchart for reporting. -- Fix the SLURM plm for mpirun-based launching. - Thanks to Jordon Hayes for reporting and providing a fix. -- Prevent grep failure in rpmbuild from aborting. - Thanks to Daniel Letai for reporting. -- Fix btl/vader finalize sequence. - Thanks to Daniel Vollmer for reporting. -- Fix pml/ob1 local handle sent during PUT control message. - Thanks to @EmmanuelBRELLE for reporting and providing a fix. -- Fix Memory leak with persistent MPI sends and the ob1 "get" protocol. - Thanks to @s-kuberski for reporting. -- v4.0.x: mpi: mark MPI_COMBINER_{HVECTOR,HINDEXED,STRUCT}_INTEGER - removed unless configured with --enable-mpi1-compatibility -- Fix make-authors.pl when run in a git submodule. - Thanks to Michael Heinz for reporting and providing a fix. -- Fix deadlock with mpi_assert_allow_overtaking in MPI_Issend. - Thanks to Joseph Schuchart and George Bosilca for reporting. -- Add compilation flag to allow unwinding through files that are - present in the stack when attaching with MPIR. - Thanks to James A Clark for reporting and providing a fix. - -Known issues: - -- There is a known issue with the OFI libfabric and PSM2 MTLs when trying to send - very long (> 4 GBytes) messages. In this release, these MTLs will catch - this case and abort the transfer. A future release will provide a - better solution to this issue. - -4.0.1 -- March, 2019 --------------------- - -- Update embedded PMIx to 3.1.2. -- Fix an issue with Vader (shared-memory) transport on OS-X. Thanks - to Daniel Vollmer for reporting. -- Fix a problem with the usNIC BTL Makefile. Thanks to George Marselis - for reporting. -- Fix an issue when using --enable-visibility configure option - and older versions of hwloc. Thanks to Ben Menadue for reporting - and providing a fix. -- Fix an issue with MPI_WIN_CREATE_DYNAMIC and MPI_GET from self. - Thanks to Bart Janssens for reporting. -- Fix an issue of excessive compiler warning messages from mpi.h - when using newer C++ compilers. Thanks to @Shadow-fax for - reporting. -- Fix a problem when building Open MPI using clang 5.0. -- Fix a problem with MPI_WIN_CREATE when using UCX. Thanks - to Adam Simpson for reporting. -- Fix a memory leak encountered for certain MPI datatype - destructor operations. Thanks to Axel Huebl for reporting. -- Fix several problems with MPI RMA accumulate operations. - Thanks to Jeff Hammond for reporting. -- Fix possible race condition in closing some file descriptors - during job launch using mpirun. Thanks to Jason Williams - for reporting and providing a fix. -- Fix a problem in OMPIO for large individual write operations. - Thanks to Axel Huebl for reporting. -- Fix a problem with parsing of map-by ppr options to mpirun. - Thanks to David Rich for reporting. -- Fix a problem observed when using the mpool hugepage component. Thanks - to Hunter Easterday for reporting and fixing. -- Fix valgrind warning generated when invoking certain MPI Fortran - data type creation functions. Thanks to @rtoijala for reporting. -- Fix a problem when trying to build with a PMIX 3.1 or newer - release. Thanks to Alastair McKinstry for reporting. -- Fix a problem encountered with building MPI F08 module files. - Thanks to Igor Andriyash and Axel Huebl for reporting. -- Fix two memory leaks encountered for certain MPI-RMA usage patterns. - Thanks to Joseph Schuchart for reporting and fixing. -- Fix a problem with the ORTE rmaps_base_oversubscribe MCA paramater. - Thanks to @iassiour for reporting. -- Fix a problem with UCX PML default error handler for MPI communicators. - Thanks to Marcin Krotkiewski for reporting. -- Fix various issues with OMPIO uncovered by the testmpio test suite. - -4.0.0 -- September, 2018 ------------------------- - -- OSHMEM updated to the OpenSHMEM 1.4 API. -- Do not build OpenSHMEM layer when there are no SPMLs available. - Currently, this means the OpenSHMEM layer will only build if - a MXM or UCX library is found. -- A UCX BTL was added for enhanced MPI RMA support using UCX -- With this release, OpenIB BTL now only supports iWarp and RoCE by default. -- Updated internal HWLOC to 2.0.2 -- Updated internal PMIx to 3.0.2 -- Change the priority for selecting external verses internal HWLOC - and PMIx packages to build. Starting with this release, configure - by default selects available external HWLOC and PMIx packages over - the internal ones. -- Updated internal ROMIO to 3.2.1. -- Removed support for the MXM MTL. -- Removed support for SCIF. -- Improved CUDA support when using UCX. -- Enable use of CUDA allocated buffers for OMPIO. -- Improved support for two phase MPI I/O operations when using OMPIO. -- Added support for Software-based Performance Counters, see - https://github.com/davideberius/ompi/wiki/How-to-Use-Software-Based-Performance-Counters-(SPCs)-in-Open-MPI -- Change MTL OFI from opting-IN on "psm,psm2,gni" to opting-OUT on - "shm,sockets,tcp,udp,rstream" -- Various improvements to MPI RMA performance when using RDMA - capable interconnects. -- Update memkind component to use the memkind 1.6 public API. -- Fix a problem with javadoc builds using OpenJDK 11. Thanks to - Siegmar Gross for reporting. -- Fix a memory leak using UCX. Thanks to Charles Taylor for reporting. -- Fix hangs in MPI_FINALIZE when using UCX. -- Fix a problem with building Open MPI using an external PMIx 2.1.2 - library. Thanks to Marcin Krotkiewski for reporting. -- Fix race conditions in Vader (shared memory) transport. -- Fix problems with use of newer map-by mpirun options. Thanks to - Tony Reina for reporting. -- Fix rank-by algorithms to properly rank by object and span -- Allow for running as root of two environment variables are set. - Requested by Axel Huebl. -- Fix a problem with building the Java bindings when using Java 10. - Thanks to Bryce Glover for reporting. -- Fix a problem with ORTE not reporting error messages if an application - terminated normally but exited with non-zero error code. Thanks to - Emre Brookes for reporting. - -3.1.6 -- March, 2020 --------------------- - -- Fix one-sided shared memory window configuration bug. -- Fix support for PGI'18 compiler. -- Fix issue with zero-length blockLength in MPI_TYPE_INDEXED. -- Fix run-time linker issues with OMPIO on newer Linux distros. -- Fix PMIX dstore locking compilation issue. Thanks to Marco Atzeri - for reporting the issue. -- Allow the user to override modulefile_path in the Open MPI SRPM, - even if install_in_opt is set to 1. -- Properly detect ConnectX-6 HCAs in the openib BTL. -- Fix segfault in the MTL/OFI initialization for large jobs. -- Fix issue to guarantee to properly release MPI one-sided lock when - using UCX transports to avoid a deadlock. -- Fix potential deadlock when processing outstanding transfers with - uGNI transports. -- Fix various portals4 control flow bugs. -- Fix communications ordering for alltoall and Cartesian neighborhood - collectives. -- Fix an infinite recursion crash in the memory patcher on systems - with glibc v2.26 or later (e.g., Ubuntu 18.04) when using certain - OS-bypass interconnects. - -3.1.5 -- November, 2019 ------------------------ - -- Fix OMPIO issue limiting file reads/writes to 2GB. Thanks to - Richard Warren for reporting the issue. -- At run time, automatically disable Linux cross-memory attach (CMA) - for vader BTL (shared memory) copies when running in user namespaces - (i.e., containers). Many thanks to Adrian Reber for raising the - issue and providing the fix. -- Sending very large MPI messages using the ofi MTL will fail with - some of the underlying Libfabric transports (e.g., PSM2 with - messages >=4GB, verbs with messages >=2GB). Prior version of Open - MPI failed silently; this version of Open MPI invokes the - appropriate MPI error handler upon failure. See - https://github.com/open-mpi/ompi/issues/7058 for more details. - Thanks to Emmanuel Thomé for raising the issue. -- Fix case where 0-extent datatypes might be eliminated during - optimization. Thanks to Github user @tjahns for raising the issue. -- Ensure that the MPIR_Breakpoint symbol is not optimized out on - problematic platforms. -- Fix MPI one-sided 32 bit atomic support. -- Fix OMPIO offset calculations with SEEK_END and SEEK_CUR in - MPI_FILE_GET_POSITION. Thanks to Wei-keng Liao for raising the - issue. -- Add "naive" regx component that will never fail, no matter how - esoteric the hostnames are. -- Fix corner case for datatype extent computations. Thanks to David - Dickenson for raising the issue. -- Allow individual jobs to set their map/rank/bind policies when - running LSF. Thanks to Nick R. Papior for assistance in solving the - issue. -- Fix MPI buffered sends with the "cm" PML. -- Properly propagate errors to avoid deadlocks in MPI one-sided operations. -- Update to PMIx v2.2.3. -- Fix data corruption in non-contiguous MPI accumulates over UCX. -- Fix ssh-based tree-based spawning at scale. Many thanks to Github - user @zrss for the report and diagnosis. -- Fix the Open MPI RPM spec file to not abort when grep fails. Thanks - to Daniel Letai for bringing this to our attention. -- Handle new SLURM CLI options (SLURM 19 deprecated some options that - Open MPI was using). Thanks to Jordan Hayes for the report and the - initial fix. -- OMPI: fix division by zero with an empty file view. -- Also handle shmat()/shmdt() memory patching with OS-bypass networks. -- Add support for unwinding info to all files that are present in the - stack starting from MPI_Init, which is helpful with parallel - debuggers. Thanks to James Clark for the report and initial fix. -- Fixed inadvertant use of bitwise operators in the MPI C++ bindings - header files. Thanks to Bert Wesarg for the report and the fix. - -3.1.4 -- April, 2019 --------------------- - -- Fix compile error when configured with --enable-mpi-java and - --with-devel-headers. Thanks to @g-raffy for reporting the issue - (** also appeared: v3.0.4). -- Only use hugepages with appropriate permissions. Thanks to Hunter - Easterday for the fix. -- Fix possible floating point rounding and division issues in OMPIO - which led to crashes and/or data corruption with very large data. - Thanks to Axel Huebl and René Widera for identifing the issue, - supplying and testing the fix (** also appeared: v3.0.4). -- Use static_cast<> in mpi.h where appropriate. Thanks to @shadow-fx - for identifying the issue (** also appeared: v3.0.4). -- Fix RMA accumulate of non-predefined datatypes with predefined - operators. Thanks to Jeff Hammond for raising the issue (** also - appeared: v3.0.4). -- Fix race condition when closing open file descriptors when launching - MPI processes. Thanks to Jason Williams for identifying the issue and - supplying the fix (** also appeared: v3.0.4). -- Fix support for external PMIx v3.1.x. -- Fix Valgrind warnings for some MPI_TYPE_CREATE_* functions. Thanks - to Risto Toijala for identifying the issue and supplying the fix (** - also appeared: v3.0.4). -- Fix MPI_TYPE_CREATE_F90_{REAL,COMPLEX} for r=38 and r=308 (** also - appeared: v3.0.4). -- Fix assembly issues with old versions of gcc (<6.0.0) that affected - the stability of shared memory communications (e.g., with the vader - BTL) (** also appeared: v3.0.4). -- Fix MPI_Allreduce crashes with some cases in the coll/spacc module. -- Fix the OFI MTL handling of MPI_ANY_SOURCE (** also appeared: - v3.0.4). -- Fix noisy errors in the openib BTL with regards to - ibv_exp_query_device(). Thanks to Angel Beltre and others who - reported the issue (** also appeared: v3.0.4). -- Fix zero-size MPI one-sided windows with UCX. - -3.1.3 -- October, 2018 ----------------------- - -- Fix race condition in MPI_THREAD_MULTIPLE support of non-blocking - send/receive path. -- Fix error handling SIGCHLD forwarding. -- Add support for CHARACTER and LOGICAL Fortran datatypes for MPI_SIZEOF. -- Fix compile error when using OpenJDK 11 to compile the Java bindings. -- Fix crash when using a hostfile with a 'user@host' line. -- Numerous Fortran '08 interface fixes. -- TCP BTL error message fixes. -- OFI MTL now will use any provider other than shm, sockets, tcp, udp, or - rstream, rather than only supporting gni, psm, and psm2. -- Disable async receive of CUDA buffers by default, fixing a hang - on large transfers. -- Support the BCM57XXX and BCM58XXX Broadcomm adapters. -- Fix minmax datatype support in ROMIO. -- Bug fixes in vader shared memory transport. -- Support very large buffers with MPI_TYPE_VECTOR. -- Fix hang when launching with mpirun on Cray systems. - -3.1.2 -- August, 2018 ------------------------- - -- A subtle race condition bug was discovered in the "vader" BTL - (shared memory communications) that, in rare instances, can cause - MPI processes to crash or incorrectly classify (or effectively drop) - an MPI message sent via shared memory. If you are using the "ob1" - PML with "vader" for shared memory communication (note that vader is - the default for shared memory communication with ob1), you need to - upgrade to v3.1.2 or later to fix this issue. You may also upgrade - to the following versions to fix this issue: - - Open MPI v2.1.5 (expected end of August, 2018) or later in the - v2.1.x series - - Open MPI v3.0.1 (released March, 2018) or later in the v3.0.x - series -- Assorted Portals 4.0 bug fixes. -- Fix for possible data corruption in MPI_BSEND. -- Move shared memory file for vader btl into /dev/shm on Linux. -- Fix for MPI_ISCATTER/MPI_ISCATTERV Fortran interfaces with MPI_IN_PLACE. -- Upgrade PMIx to v2.1.3. -- Numerous One-sided bug fixes. -- Fix for race condition in uGNI BTL. -- Improve handling of large number of interfaces with TCP BTL. -- Numerous UCX bug fixes. - -3.1.1 -- June, 2018 -------------------- - -- Fix potential hang in UCX PML during MPI_FINALIZE -- Update internal PMIx to v2.1.2rc2 to fix forward version compatibility. -- Add new MCA parameter osc_sm_backing_store to allow users to specify - where in the filesystem the backing file for the shared memory - one-sided component should live. Defaults to /dev/shm on Linux. -- Fix potential hang on non-x86 platforms when using builds with - optimization flags turned off. -- Disable osc/pt2pt when using MPI_THREAD_MULTIPLE due to numerous - race conditions in the component. -- Fix dummy variable names for the mpi and mpi_f08 Fortran bindings to - match the MPI standard. This may break applications which use - name-based parameters in Fortran which used our internal names - rather than those documented in the MPI standard. -- Revamp Java detection to properly handle new Java versions which do - not provide a javah wrapper. -- Fix RMA function signatures for use-mpi-f08 bindings to have the - asynchonous property on all buffers. -- Improved configure logic for finding the UCX library. - -3.1.0 -- May, 2018 ------------------- - -- Various OpenSHMEM bug fixes. -- Properly handle array_of_commands argument to Fortran version of - MPI_COMM_SPAWN_MULTIPLE. -- Fix bug with MODE_SEQUENTIAL and the sharedfp MPI-IO component. -- Use "javac -h" instead of "javah" when building the Java bindings - with a recent version of Java. -- Fix mis-handling of jostepid under SLURM that could cause problems - with PathScale/OmniPath NICs. -- Disable the POWER 7/BE block in configure. Note that POWER 7/BE is - still not a supported platform, but it is no longer automatically - disabled. See - https://github.com/open-mpi/ompi/issues/4349#issuecomment-374970982 - for more information. -- The output-filename option for mpirun is now converted to an - absolute path before being passed to other nodes. -- Add monitoring component for PML, OSC, and COLL to track data - movement of MPI applications. See - ompi/mca/commmon/monitoring/HowTo_pml_monitoring.tex for more - information about the monitoring framework. -- Add support for communicator assertions: mpi_assert_no_any_tag, - mpi_assert_no_any_source, mpi_assert_exact_length, and - mpi_assert_allow_overtaking. -- Update PMIx to version 2.1.1. -- Update hwloc to 1.11.7. -- Many one-sided behavior fixes. -- Improved performance for Reduce and Allreduce using Rabenseifner's algorithm. -- Revamped mpirun --help output to make it a bit more manageable. -- Portals4 MTL improvements: Fix race condition in rendezvous protocol and - retry logic. -- UCX OSC: initial implementation. -- UCX PML improvements: add multi-threading support. -- Yalla PML improvements: Fix error with irregular contiguous datatypes. -- Openib BTL: disable XRC support by default. -- TCP BTL: Add check to detect and ignore connections from processes - that aren't MPI (such as IDS probes) and verify that source and - destination are using the same version of Open MPI, fix issue with very - large message transfer. -- ompi_info parsable output now escapes double quotes in values, and - also quotes values can contains colons. Thanks to Lev Givon for the - suggestion. -- CUDA-aware support can now handle GPUs within a node that do not - support CUDA IPC. Earlier versions would get error and abort. -- Add a mca parameter ras_base_launch_orted_on_hn to allow for launching - MPI processes on the same node where mpirun is executing using a separate - orte daemon, rather than the mpirun process. This may be useful to set to - true when using SLURM, as it improves interoperability with SLURM's signal - propagation tools. By default it is set to false, except for Cray XC systems. -- Remove LoadLeveler RAS support. -- Remove IB XRC support from the OpenIB BTL due to lack of support. -- Add functionality for IBM s390 platforms. Note that regular - regression testing does not occur on the s390 and it is not - considered a supported platform. -- Remove support for big endian PowerPC. -- Remove support for XL compilers older than v13.1. -- Remove support for atomic operations using MacOS atomics library. - -3.0.6 -- March, 2020 --------------------- - -- Fix one-sided shared memory window configuration bug. -- Fix support for PGI'18 compiler. -- Fix run-time linker issues with OMPIO on newer Linux distros. -- Allow the user to override modulefile_path in the Open MPI SRPM, - even if install_in_opt is set to 1. -- Properly detect ConnectX-6 HCAs in the openib BTL. -- Fix segfault in the MTL/OFI initialization for large jobs. -- Fix various portals4 control flow bugs. -- Fix communications ordering for alltoall and Cartesian neighborhood - collectives. -- Fix an infinite recursion crash in the memory patcher on systems - with glibc v2.26 or later (e.g., Ubuntu 18.04) when using certain - OS-bypass interconnects. - -3.0.5 -- November, 2019 ------------------------ - -- Fix OMPIO issue limiting file reads/writes to 2GB. Thanks to - Richard Warren for reporting the issue. -- At run time, automatically disable Linux cross-memory attach (CMA) - for vader BTL (shared memory) copies when running in user namespaces - (i.e., containers). Many thanks to Adrian Reber for raising the - issue and providing the fix. -- Sending very large MPI messages using the ofi MTL will fail with - some of the underlying Libfabric transports (e.g., PSM2 with - messages >=4GB, verbs with messages >=2GB). Prior version of Open - MPI failed silently; this version of Open MPI invokes the - appropriate MPI error handler upon failure. See - https://github.com/open-mpi/ompi/issues/7058 for more details. - Thanks to Emmanuel Thomé for raising the issue. -- Fix case where 0-extent datatypes might be eliminated during - optimization. Thanks to Github user @tjahns for raising the issue. -- Ensure that the MPIR_Breakpoint symbol is not optimized out on - problematic platforms. -- Fix OMPIO offset calculations with SEEK_END and SEEK_CUR in - MPI_FILE_GET_POSITION. Thanks to Wei-keng Liao for raising the - issue. -- Fix corner case for datatype extent computations. Thanks to David - Dickenson for raising the issue. -- Fix MPI buffered sends with the "cm" PML. -- Update to PMIx v2.2.3. -- Fix ssh-based tree-based spawning at scale. Many thanks to Github - user @zrss for the report and diagnosis. -- Fix the Open MPI RPM spec file to not abort when grep fails. Thanks - to Daniel Letai for bringing this to our attention. -- Handle new SLURM CLI options (SLURM 19 deprecated some options that - Open MPI was using). Thanks to Jordan Hayes for the report and the - initial fix. -- OMPI: fix division by zero with an empty file view. -- Also handle shmat()/shmdt() memory patching with OS-bypass networks. -- Add support for unwinding info to all files that are present in the - stack starting from MPI_Init, which is helpful with parallel - debuggers. Thanks to James Clark for the report and initial fix. -- Fixed inadvertant use of bitwise operators in the MPI C++ bindings - header files. Thanks to Bert Wesarg for the report and the fix. -- Added configure option --disable-wrappers-runpath (alongside the - already-existing --disable-wrappers-rpath option) to prevent Open - MPI's configure script from automatically adding runpath CLI options - to the wrapper compilers. - -3.0.4 -- April, 2019 --------------------- - -- Fix compile error when configured with --enable-mpi-java and - --with-devel-headers. Thanks to @g-raffy for reporting the issue. -- Fix possible floating point rounding and division issues in OMPIO - which led to crashes and/or data corruption with very large data. - Thanks to Axel Huebl and René Widera for identifing the issue, - supplying and testing the fix (** also appeared: v3.0.4). -- Use static_cast<> in mpi.h where appropriate. Thanks to @shadow-fx - for identifying the issue. -- Fix datatype issue with RMA accumulate. Thanks to Jeff Hammond for - raising the issue. -- Fix RMA accumulate of non-predefined datatypes with predefined - operators. Thanks to Jeff Hammond for raising the issue. -- Fix race condition when closing open file descriptors when launching - MPI processes. Thanks to Jason Williams for identifying the issue and - supplying the fix. -- Fix Valgrind warnings for some MPI_TYPE_CREATE_* functions. Thanks - to Risto Toijala for identifying the issue and supplying the fix. -- Fix MPI_TYPE_CREATE_F90_{REAL,COMPLEX} for r=38 and r=308. -- Fix assembly issues with old versions of gcc (<6.0.0) that affected - the stability of shared memory communications (e.g., with the vader - BTL). -- Fix the OFI MTL handling of MPI_ANY_SOURCE. -- Fix noisy errors in the openib BTL with regards to - ibv_exp_query_device(). Thanks to Angel Beltre and others who - reported the issue. - -3.0.3 -- October, 2018 ----------------------- - -- Fix race condition in MPI_THREAD_MULTIPLE support of non-blocking - send/receive path. -- Fix error handling SIGCHLD forwarding. -- Add support for CHARACTER and LOGICAL Fortran datatypes for MPI_SIZEOF. -- Fix compile error when using OpenJDK 11 to compile the Java bindings. -- Fix crash when using a hostfile with a 'user@host' line. -- Numerous Fortran '08 interface fixes. -- TCP BTL error message fixes. -- OFI MTL now will use any provider other than shm, sockets, tcp, udp, or - rstream, rather than only supporting gni, psm, and psm2. -- Disable async receive of CUDA buffers by default, fixing a hang - on large transfers. -- Support the BCM57XXX and BCM58XXX Broadcomm adapters. -- Fix minmax datatype support in ROMIO. -- Bug fixes in vader shared memory transport. -- Support very large buffers with MPI_TYPE_VECTOR. -- Fix hang when launching with mpirun on Cray systems. -- Bug fixes in OFI MTL. -- Assorted Portals 4.0 bug fixes. -- Fix for possible data corruption in MPI_BSEND. -- Move shared memory file for vader btl into /dev/shm on Linux. -- Fix for MPI_ISCATTER/MPI_ISCATTERV Fortran interfaces with MPI_IN_PLACE. -- Upgrade PMIx to v2.1.4. -- Fix for Power9 built-in atomics. -- Numerous One-sided bug fixes. -- Fix for race condition in uGNI BTL. -- Improve handling of large number of interfaces with TCP BTL. -- Numerous UCX bug fixes. -- Add support for QLogic and Broadcom Cumulus RoCE HCAs to Open IB BTL. -- Add patcher support for aarch64. -- Fix hang on Power and ARM when Open MPI was built with low compiler - optimization settings. - -3.0.2 -- June, 2018 -------------------- - -- Disable osc/pt2pt when using MPI_THREAD_MULTIPLE due to numerous - race conditions in the component. -- Fix dummy variable names for the mpi and mpi_f08 Fortran bindings to - match the MPI standard. This may break applications which use - name-based parameters in Fortran which used our internal names - rather than those documented in the MPI standard. -- Fixed MPI_SIZEOF in the "mpi" Fortran module for the NAG compiler. -- Fix RMA function signatures for use-mpi-f08 bindings to have the - asynchonous property on all buffers. -- Fix Fortran MPI_COMM_SPAWN_MULTIPLE to properly follow the count - length argument when parsing the array_of_commands variable. -- Revamp Java detection to properly handle new Java versions which do - not provide a javah wrapper. -- Improved configure logic for finding the UCX library. -- Add support for HDR InfiniBand link speeds. -- Disable the POWER 7/BE block in configure. Note that POWER 7/BE is - still not a supported platform, but it is no longer automatically - disabled. See - https://github.com/open-mpi/ompi/issues/4349#issuecomment-374970982 - for more information. - -3.0.1 -- March, 2018 ----------------------- - -- Fix ability to attach parallel debuggers to MPI processes. -- Fix a number of issues in MPI I/O found by the HDF5 test suite. -- Fix (extremely) large message transfers with shared memory. -- Fix out of sequence bug in multi-NIC configurations. -- Fix stdin redirection bug that could result in lost input. -- Disable the LSF launcher if CSM is detected. -- Plug a memory leak in MPI_Mem_free(). Thanks to Philip Blakely for reporting. -- Fix the tree spawn operation when the number of nodes is larger than the radix. - Thanks to Carlos Eduardo de Andrade for reporting. -- Fix Fortran 2008 macro in MPI extensions. Thanks to Nathan T. Weeks for - reporting. -- Add UCX to list of interfaces that OpenSHMEM will use by default. -- Add --{enable|disable}-show-load-errors-by-default to control - default behavior of the load errors option. -- OFI MTL improvements: handle empty completion queues properly, fix - incorrect error message around fi_getinfo(), use default progress - option for provider by default, Add support for reading multiple - CQ events in ofi_progress. -- PSM2 MTL improvements: Allow use of GPU buffers, thread fixes. -- Numerous corrections to memchecker behavior. -- Add a mca parameter ras_base_launch_orted_on_hn to allow for launching - MPI processes on the same node where mpirun is executing using a separate - orte daemon, rather than the mpirun process. This may be useful to set to - true when using SLURM, as it improves interoperability with SLURM's signal - propagation tools. By default it is set to false, except for Cray XC systems. -- Fix a problem reported on the mailing separately by Kevin McGrattan and Stephen - Guzik about consistency issues on NFS file systems when using OMPIO. This fix - also introduces a new mca parameter fs_ufs_lock_algorithm which allows to - control the locking algorithm used by ompio for read/write operations. By - default, ompio does not perfom locking on local UNIX file systems, locks the - entire file per operation on NFS file systems, and selective byte-range - locking on other distributed file systems. -- Add an mca parameter pmix_server_usock_connections to allow mpirun to - support applications statically built against the Open MPI v2.x release, - or installed in a container along with the Open MPI v2.x libraries. It is - set to false by default. - -3.0.0 -- September, 2017 ------------------------- - -Major new features: - -- Use UCX allocator for OSHMEM symmetric heap allocations to optimize intra-node - data transfers. UCX SPML only. -- Use UCX multi-threaded API in the UCX PML. Requires UCX 1.0 or later. -- Added support for Flux PMI -- Update embedded PMIx to version 2.1.0 -- Update embedded hwloc to version 1.11.7 - -Changes in behavior compared to prior versions: - -- Per Open MPI's versioning scheme (see the README), increasing the - major version number to 3 indicates that this version is not - ABI-compatible with prior versions of Open MPI. In addition, there may - be differences in MCA parameter names and defaults from previous releases. - Command line options for mpirun and other commands may also differ from - previous versions. You will need to recompile MPI and OpenSHMEM applications - to work with this version of Open MPI. -- With this release, Open MPI supports MPI_THREAD_MULTIPLE by default. -- New configure options have been added to specify the locations of libnl - and zlib. -- A new configure option has been added to request Flux PMI support. -- The help menu for mpirun and related commands is now context based. - "mpirun --help compatibility" generates the help menu in the same format - as previous releases. - -Removed legacy support: -- AIX is no longer supported. -- Loadlever is no longer supported. -- OpenSHMEM currently supports the UCX and MXM transports via the ucx and ikrit - SPMLs respectively. -- Remove IB XRC support from the OpenIB BTL due to lack of support. -- Remove support for big endian PowerPC. -- Remove support for XL compilers older than v13.1 - -Known issues: - -- MPI_Connect/accept between applications started by different mpirun - commands will fail, even if ompi-server is running. - -2.1.5 -- August 2018 --------------------- - -- A subtle race condition bug was discovered in the "vader" BTL - (shared memory communications) that, in rare instances, can cause - MPI processes to crash or incorrectly classify (or effectively drop) - an MPI message sent via shared memory. If you are using the "ob1" - PML with "vader" for shared memory communication (note that vader is - the default for shared memory communication with ob1), you need to - upgrade to v2.1.5 to fix this issue. You may also upgrade to the - following versions to fix this issue: - - Open MPI v3.0.1 (released March, 2018) or later in the v3.0.x - series - - Open MPI v3.1.2 (expected end of August, 2018) or later -- A link issue was fixed when the UCX library was not located in the - linker-default search paths. - -2.1.4 -- August, 2018 ---------------------- - -Bug fixes/minor improvements: -- Disable the POWER 7/BE block in configure. Note that POWER 7/BE is - still not a supported platform, but it is no longer automatically - disabled. See - https://github.com/open-mpi/ompi/issues/4349#issuecomment-374970982 - for more information. -- Fix bug with request-based one-sided MPI operations when using the - "rdma" component. -- Fix issue with large data structure in the TCP BTL causing problems - in some environments. Thanks to @lgarithm for reporting the issue. -- Minor Cygwin build fixes. -- Minor fixes for the openib BTL: - - Support for the QLogic RoCE HCA - - Support for the Boradcom Cumulus RoCE HCA - - Enable support for HDR link speeds -- Fix MPI_FINALIZED hang if invoked from an attribute destructor - during the MPI_COMM_SELF destruction in MPI_FINALIZE. Thanks to - @AndrewGaspar for reporting the issue. -- Java fixes: - - Modernize Java framework detection, especially on OS X/MacOS. - Thanks to Bryce Glover for reporting and submitting the fixes. - - Prefer "javac -h" to "javah" to support newer Java frameworks. -- Fortran fixes: - - Use conformant dummy parameter names for Fortran bindings. Thanks - to Themos Tsikas for reporting and submitting the fixes. - - Build the MPI_SIZEOF() interfaces in the "TKR"-style "mpi" module - whenever possible. Thanks to Themos Tsikas for reporting the - issue. - - Fix array of argv handling for the Fortran bindings of - MPI_COMM_SPAWN_MULTIPLE (and its associated man page). - - Make NAG Fortran compiler support more robust in configure. -- Disable the "pt2pt" one-sided MPI component when MPI_THREAD_MULTIPLE - is used. This component is simply not safe in MPI_THREAD_MULTIPLE - scenarios, and will not be fixed in the v2.1.x series. -- Make the "external" hwloc component fail gracefully if it is tries - to use an hwloc v2.x.y installation. hwloc v2.x.y will not be - supported in the Open MPI v2.1.x series. -- Fix "vader" shared memory support for messages larger than 2GB. - Thanks to Heiko Bauke for the bug report. -- Configure fixes for external PMI directory detection. Thanks to - Davide Vanzo for the report. - -2.1.3 -- March, 2018 --------------------- - -Bug fixes/minor improvements: -- Update internal PMIx version to 1.2.5. -- Fix a problem with ompi_info reporting using param option. - Thanks to Alexander Pozdneev for reporting. -- Correct PMPI_Aint_{add|diff} to be functions (not subroutines) - in the Fortran mpi_f08 module. -- Fix a problem when doing MPI I/O using data types with large - extents in conjunction with MPI_TYPE_CREATE_SUBARRAY. Thanks to - Christopher Brady for reporting. -- Fix a problem when opening many files using MPI_FILE_OPEN. - Thanks to William Dawson for reporting. -- Fix a problem with debuggers failing to attach to a running job. - Thanks to Dirk Schubert for reporting. -- Fix a problem when using madvise and the OpenIB BTL. Thanks to - Timo Bingmann for reporting. -- Fix a problem in the Vader BTL that resulted in failures of - IMB under certain circumstances. Thanks to Nicolas Morey- - Chaisemartin for reporting. -- Fix a problem preventing Open MPI from working under Cygwin. - Thanks to Marco Atzeri for reporting. -- Reduce some verbosity being emitted by the USNIC BTL under certain - circumstances. Thanks to Peter Forai for reporting. -- Fix a problem with misdirection of SIGKILL. Thanks to Michael Fern - for reporting. -- Replace use of posix_memalign with malloc for small allocations. Thanks - to Ben Menaude for reporting. -- Fix a problem with Open MPI's out of band TCP network for file descriptors - greater than 32767. Thanks to Wojtek Wasko for reporting and fixing. -- Plug a memory leak in MPI_Mem_free(). Thanks to Philip Blakely for reporting. - -2.1.2 -- September, 2017 ------------------------- - -Bug fixes/minor improvements: -- Update internal PMIx version to 1.2.3. -- Fix some problems when using the NAG Fortran compiler to build Open MPI - and when using the compiler wrappers. Thanks to Neil Carlson for reporting. -- Fix a compilation problem with the SM BTL. Thanks to Paul Hargrove for - reporting. -- Fix a problem with MPI_IALLTOALLW when using zero-length messages. - Thanks to Dahai Guo for reporting. -- Fix a problem with C11 generic type interface for SHMEM_G. Thanks - to Nick Park for reporting. -- Switch to using the lustreapi.h include file when building Open MPI - with Lustre support. -- Fix a problem in the OB1 PML that led to hangs with OSU collective tests. -- Fix a progression issue with MPI_WIN_FLUSH_LOCAL. Thanks to - Joseph Schuchart for reporting. -- Fix an issue with recent versions of PBSPro requiring libcrypto. - Thanks to Petr Hanousek for reporting. -- Fix a problem when using MPI_ANY_SOURCE with MPI_SENDRECV. -- Fix an issue that prevented signals from being propagated to ORTE - daemons. -- Ensure that signals are forwarded from ORTE daemons to all processes - in the process group created by the daemons. Thanks to Ted Sussman - for reporting. -- Fix a problem with launching a job under a debugger. Thanks to - Greg Lee for reporting. -- Fix a problem with Open MPI native I/O MPI_FILE_OPEN when using - a communicator having an associated topology. Thanks to - Wei-keng Liao for reporting. -- Fix an issue when using MPI_ACCUMULATE with derived datatypes. -- Fix a problem with Fortran bindings that led to compilation errors - for user defined reduction operations. Thanks to Nathan Weeks for - reporting. -- Fix ROMIO issues with large writes/reads when using NFS file systems. -- Fix definition of Fortran MPI_ARGV_NULL and MPI_ARGVS_NULL. -- Enable use of the head node of a SLURM allocation on Cray XC systems. -- Fix a problem with synchronous sends when using the UCX PML. -- Use default socket buffer size to improve TCP BTL performance. -- Add a mca parameter ras_base_launch_orted_on_hn to allow for launching - MPI processes on the same node where mpirun is executing using a separate - orte daemon, rather than the mpirun process. This may be useful to set to - true when using SLURM, as it improves interoperability with SLURM's signal - propagation tools. By default it is set to false, except for Cray XC systems. -- Fix --without-lsf when lsf is installed in the default search path. -- Remove support for big endian PowerPC. -- Remove support for XL compilers older than v13.1 -- Remove IB XRC support from the OpenIB BTL due to loss of maintainer. - -2.1.1 -- April, 2017 --------------------- - -Bug fixes/minor improvements: - -- Fix a problem with one of Open MPI's fifo data structures which led to - hangs in a make check test. Thanks to Nicolas Morey-Chaisemartin for - reporting. -- Add missing MPI_AINT_ADD/MPI_AINT_DIFF function definitions to mpif.h. - Thanks to Aboorva Devarajan for reporting. -- Fix the error return from MPI_WIN_LOCK when rank argument is invalid. - Thanks to Jeff Hammond for reporting and fixing this issue. -- Fix a problem with mpirun/orterun when started under a debugger. Thanks - to Gregory Leff for reporting. -- Add configury option to disable use of CMA by the vader BTL. Thanks - to Sascha Hunold for reporting. -- Add configury check for MPI_DOUBLE_COMPLEX datatype support. - Thanks to Alexander Klein for reporting. -- Fix memory allocated by MPI_WIN_ALLOCATE_SHARED to - be 64 bit aligned. Thanks to Joseph Schuchart for - reporting. -- Update MPI_WTICK man page to reflect possibly higher - resolution than 10e-6. Thanks to Mark Dixon for - reporting -- Add missing MPI_T_PVAR_SESSION_NULL definition to mpi.h - include file. Thanks to Omri Mor for this contribution. -- Enhance the Open MPI spec file to install modulefile in /opt - if installed in a non-default location. Thanks to Kevin - Buckley for reporting and supplying a fix. -- Fix a problem with conflicting PMI symbols when linking statically. - Thanks to Kilian Cavalotti for reporting. - -Known issues (to be addressed in v2.1.2): - -- See the list of fixes slated for v2.1.2 here: - https://github.com/open-mpi/ompi/milestone/28 - -2.1.0 -- March, 2017 --------------------- - -Major new features: - -- The main focus of the Open MPI v2.1.0 release was to update to PMIx - v1.2.1. When using PMIx (e.g., via mpirun-based launches, or via - direct launches with recent versions of popular resource managers), - launch time scalability is improved, and the run time memory - footprint is greatly decreased when launching large numbers of MPI / - OpenSHMEM processes. -- Update OpenSHMEM API conformance to v1.3. -- The usnic BTL now supports MPI_THREAD_MULTIPLE. -- General/overall performance improvements to MPI_THREAD_MULTIPLE. -- Add a summary message at the bottom of configure that tells you many - of the configuration options specified and/or discovered by Open - MPI. - -Changes in behavior compared to prior versions: - -- None. - -Removed legacy support: - -- The ptmalloc2 hooks have been removed from the Open MPI code base. - This is not really a user-noticable change; it is only mentioned - here because there was much rejoycing in the Open MPI developer - community. - -Bug fixes/minor improvements: - -- New MCA parameters: - - iof_base_redirect_app_stderr_to_stdout: as its name implies, it - combines MPI / OpenSHMEM applications' stderr into its stdout - stream. - - opal_event_include: allow the user to specify which FD selection - mechanism is used by the underlying event engine. - - opal_stacktrace_output: indicate where stacktraces should be sent - upon MPI / OpenSHMEM process crashes ("none", "stdout", "stderr", - "file:filename"). - - orte_timeout_for_stack_trace: number of seconds to wait for stack - traces to be reported (or <=0 to wait forever). - - mtl_ofi_control_prog_type/mtl_ofi_data_prog_type: specify libfabric - progress model to be used for control and data. -- Fix MPI_WTICK regression where the time reported may be inaccurate - on systems with processor frequency scalaing enabled. -- Fix regression that lowered the memory maximum message bandwidth for - large messages on some BTL network transports, such as openib, sm, - and vader. -- Fix a name collision in the shared file pointer MPI IO file locking - scheme. Thanks to Nicolas Joly for reporting the issue. -- Fix datatype extent/offset errors in MPI_PUT and MPI_RACCUMULATE - when using the Portals 4 one-sided component. -- Add support for non-contiguous datatypes to the Portals 4 one-sided - component. -- Various updates for the UCX PML. -- Updates to the following man pages: - - mpirun(1) - - MPI_COMM_CONNECT(3) - - MPI_WIN_GET_NAME(3). Thanks to Nicolas Joly for reporting the - typo. - - MPI_INFO_GET_[NKEYS|NTHKEY](3). Thanks to Nicolas Joly for - reporting the typo. -- Fixed a problem in the TCP BTL when using MPI_THREAD_MULTIPLE. - Thanks to Evgueni Petrov for reporting. -- Fixed external32 representation in the romio314 module. Note that - for now, external32 representation is not correctly supported by the - ompio module. Thanks to Thomas Gastine for bringing this to our - attention. -- Add note how to disable a warning message about when a high-speed - MPI transport is not found. Thanks to Susan Schwarz for reporting - the issue. -- Ensure that sending SIGINT when using the rsh/ssh launcher does not - orphan children nodes in the launch tree. -- Fix the help message when showing deprecated MCA param names to show - the correct (i.e., deprecated) name. -- Enable support for the openib BTL to use multiple different - InfiniBand subnets. -- Fix a minor error in MPI_AINT_DIFF. -- Fix bugs with MPI_IN_PLACE handling in: - - MPI_ALLGATHER[V] - - MPI_[I][GATHER|SCATTER][V] - - MPI_IREDUCE[_SCATTER] - - Thanks to all the users who helped diagnose these issues. -- Allow qrsh to tree spawn (if the back-end system supports it). -- Fix MPI_T_PVAR_GET_INDEX to return the correct index. -- Correctly position the shared file pointer in append mode in the - OMPIO component. -- Add some deprecated names into shmem.h for backwards compatibility - with legacy codes. -- Fix MPI_MODE_NOCHECK support. -- Fix a regression in PowerPC atomics support. Thanks to Orion - Poplawski for reporting the issue. -- Fixes for assembly code with aggressively-optimized compilers on - x86_64/AMD64 platforms. -- Fix one more place where configure was mangling custom CFLAGS. - Thanks to Phil Tooley (@Telemin) for reporting the issue. -- Better handle builds with external installations of hwloc. -- Fixed a hang with MPI_PUT and MPI_WIN_LOCK_ALL. -- Fixed a bug when using MPI_GET on non-contiguous datatypes and - MPI_LOCK/MPI_UNLOCK. -- Fixed a bug when using POST/START/COMPLETE/WAIT after a fence. -- Fix configure portability by cleaning up a few uses of "==" with - "test". Thanks to Kevin Buckley for pointing out the issue. -- Fix bug when using darrays with lib and extent of darray datatypes. -- Updates to make Open MPI binary builds more bit-for-bit - reproducable. Thanks to Alastair McKinstry for the suggestion. -- Fix issues regarding persistent request handling. -- Ensure that shmemx.h is a standalone OpenSHMEM header file. Thanks - to Nick Park (@nspark) for the report. -- Ensure that we always send SIGTERM prior to SIGKILL. Thanks to Noel - Rycroft for the report. -- Added ConnectX-5 and Chelsio T6 device defaults for the openib BTL. -- OpenSHMEM no longer supports MXM less than v2.0. -- Plug a memory leak in ompi_osc_sm_free. Thanks to Joseph Schuchart - for the report. -- The "self" BTL now uses less memory. -- The vader BTL is now more efficient in terms of memory usage when - using XPMEM. -- Removed the --enable-openib-failover configure option. This is not - considered backwards-incompatible because this option was stale and - had long-since stopped working, anyway. -- Allow jobs launched under Cray aprun to use hyperthreads if - opal_hwloc_base_hwthreads_as_cpus MCA parameter is set. -- Add support for 32-bit and floating point Cray Aries atomic - operations. -- Add support for network AMOs for MPI_ACCUMULATE, MPI_FETCH_AND_OP, - and MPI_COMPARE_AND_SWAP if the "ompi_single_intrinsic" info key is - set on the window or the "acc_single_intrinsic" MCA param is set. -- Automatically disqualify RDMA CM support in the openib BTL if - MPI_THREAD_MULTIPLE is used. -- Make configure smarter/better about auto-detecting Linux CMA - support. -- Improve the scalability of MPI_COMM_SPLIT_TYPE. -- Fix the mixing of C99 and C++ header files with the MPI C++ - bindings. Thanks to Alastair McKinstry for the bug report. -- Add support for ARM v8. -- Several MCA parameters now directly support MPI_T enumerator - semantics (i.e., they accept a limited set of values -- e.g., MCA - parameters that accept boolean values). -- Added --with-libmpi-name=STRING configure option for vendor releases - of Open MPI. See the README for more detail. -- Fix a problem with Open MPI's internal memory checker. Thanks to Yvan - Fournier for reporting. -- Fix a multi-threaded issue with MPI_WAIT. Thanks to Pascal Deveze for - reporting. - -Known issues (to be addressed in v2.1.1): - -- See the list of fixes slated for v2.1.1 here: - https://github.com/open-mpi/ompi/milestone/26 - -2.0.4 -- November, 2017 ------------------------ - -Bug fixes/minor improvements: -- Fix an issue with visibility of functions defined in the built-in PMIx. - Thanks to Siegmar Gross for reporting this issue. -- Add configure check to prevent trying to build this release of - Open MPI with an external hwloc 2.0 or newer release. -- Add ability to specify layered providers for OFI MTL. -- Fix a correctness issue with Open MPI's memory manager code - that could result in corrupted message data. Thanks to - Valentin Petrov for reporting. -- Fix issues encountered when using newer versions of PBS Pro. - Thanks to Petr Hanousek for reporting. -- Fix a problem with MPI_GET when using the vader BTL. Thanks - to Dahai Guo for reporting. -- Fix a problem when using MPI_ANY_SOURCE with MPI_SENDRECV_REPLACE. - Thanks to Dahai Guo for reporting. -- Fix a problem using MPI_FILE_OPEN with a communicator with an - attached cartesian topology. Thanks to Wei-keng Liao for reporting. -- Remove IB XRC support from the OpenIB BTL due to lack of support. -- Remove support for big endian PowerPC. -- Remove support for XL compilers older than v13.1 - -2.0.3 -- June 2017 ------------------- - -Bug fixes/minor improvements: - - - Fix a problem with MPI_IALLTOALLW when zero size messages are present. - Thanks to @mathbird for reporting. - - Add missing MPI_USER_FUNCTION definition to the mpi_f08 module. - Thanks to Nathan Weeks for reporting this issue. - - Fix a problem with MPI_WIN_LOCK not returning an error code when - a negative rank is supplied. Thanks to Jeff Hammond for reporting and - providing a fix. - - Fix a problem with make check that could lead to hangs. Thanks to - Nicolas Morey-Chaisemartin for reporting. - - Resolve a symbol conflict problem with PMI-1 and PMI-2 PMIx components. - Thanks to Kilian Cavalotti for reporting this issue. - - Insure that memory allocations returned from MPI_WIN_ALLOCATE_SHARED are - 64 byte aligned. Thanks to Joseph Schuchart for reporting this issue. - - Make use of DOUBLE_COMPLEX, if available, for Fortran bindings. Thanks - to Alexander Klein for reporting this issue. - - Add missing MPI_T_PVAR_SESSION_NULL definition to Open MPI mpi.h include - file. Thanks to Omri Mor for reporting and fixing. - - Fix a problem with use of MPI shared file pointers when accessing - a file from independent jobs. Thanks to Nicolas Joly for reporting - this issue. - - Optimize zero size MPI_IALLTOALL{V,W} with MPI_IN_PLACE. Thanks to - Lisandro Dalcín for the report. - - Fix a ROMIO buffer overflow problem for large transfers when using NFS - filesystems. - - Fix type of MPI_ARGV[S]_NULL which prevented it from being used - properly with MPI_COMM_SPAWN[_MULTIPLE] in the mpi_f08 module. - - Ensure to add proper linker flags to the wrapper compilers for - dynamic libraries on platforms that need it (e.g., RHEL 7.3 and - later). - - Get better performance on TCP-based networks 10Gbps and higher by - using OS defaults for buffer sizing. - - Fix a bug with MPI_[R][GET_]ACCUMULATE when using DARRAY datatypes. - - Fix handling of --with-lustre configure command line argument. - Thanks to Prentice Bisbal and Tim Mattox for reporting the issue. - - Added MPI_AINT_ADD and MPI_AINT_DIFF declarations to mpif.h. Thanks - to Aboorva Devarajan (@AboorvaDevarajan) for the bug report. - - Fix a problem in the TCP BTL when Open MPI is initialized with - MPI_THREAD_MULTIPLE support. Thanks to Evgueni Petro for analyzing and - reporting this issue. - - Fix yalla PML to properly handle underflow errors, and fixed a - memory leak with blocking non-contiguous sends. - - Restored ability to run autogen.pl on official distribution tarballs - (although this is still not recommended for most users!). - - Fix accuracy problems with MPI_WTIME on some systems by always using - either clock_gettime(3) or gettimeofday(3). - - Fix a problem where MPI_WTICK was not returning a higher time resolution - when available. Thanks to Mark Dixon for reporting this issue. - - Restore SGE functionality. Thanks to Kevin Buckley for the initial - report. - - Fix external hwloc compilation issues, and extend support to allow - using external hwloc installations as far back as v1.5.0. Thanks to - Orion Poplawski for raising the issue. - - Added latest Mellanox Connect-X and Chelsio T-6 adapter part IDs to - the openib list of default values. - - Do a better job of cleaning up session directories (e.g., in /tmp). - - Update a help message to indicate how to suppress a warning about - no high performance networks being detected by Open MPI. Thanks to - Susan Schwarz for reporting this issue. - - Fix a problem with mangling of custom CFLAGS when configuring Open MPI. - Thanks to Phil Tooley for reporting. - - Fix some minor memory leaks and remove some unused variables. - Thanks to Joshua Gerrard for reporting. - - Fix MPI_ALLGATHERV bug with MPI_IN_PLACE. - -Known issues (to be addressed in v2.0.4): - -- See the list of fixes slated for v2.0.4 here: - https://github.com/open-mpi/ompi/milestone/29 - -2.0.2 -- 26 January 2017 -------------------------- - -Bug fixes/minor improvements: - -- Fix a problem with MPI_FILE_WRITE_SHARED when using MPI_MODE_APPEND and - Open MPI's native MPI-IO implementation. Thanks to Nicolas Joly for - reporting. -- Fix a typo in the MPI_WIN_GET_NAME man page. Thanks to Nicolas Joly - for reporting. -- Fix a race condition with ORTE's session directory setup. Thanks to - @tbj900 for reporting this issue. -- Fix a deadlock issue arising from Open MPI's approach to catching calls to - munmap. Thanks to Paul Hargrove for reporting and helping to analyze this - problem. -- Fix a problem with PPC atomics which caused make check to fail unless builtin - atomics configure option was enabled. Thanks to Orion Poplawski for reporting. -- Fix a problem with use of x86_64 cpuid instruction which led to segmentation - faults when Open MPI was configured with -O3 optimization. Thanks to Mark - Santcroos for reporting this problem. -- Fix a problem when using built in atomics configure options on PPC platforms - when building 32 bit applications. Thanks to Paul Hargrove for reporting. -- Fix a problem with building Open MPI against an external hwloc installation. - Thanks to Orion Poplawski for reporting this issue. -- Remove use of DATE in the message queue version string reported to debuggers to - insure bit-wise reproducibility of binaries. Thanks to Alastair McKinstry - for help in fixing this problem. -- Fix a problem with early exit of a MPI process without calling MPI_FINALIZE - or MPI_ABORT that could lead to job hangs. Thanks to Christof Koehler for - reporting. -- Fix a problem with forwarding of SIGTERM signal from mpirun to MPI processes - in a job. Thanks to Noel Rycroft for reporting this problem -- Plug some memory leaks in MPI_WIN_FREE discovered using Valgrind. Thanks - to Joseph Schuchart for reporting. -- Fix a problems MPI_NEIGHOR_ALLTOALL when using a communicator with an empty topology - graph. Thanks to Daniel Ibanez for reporting. -- Fix a typo in a PMIx component help file. Thanks to @njoly for reporting this. -- Fix a problem with Valgrind false positives when using Open MPI's internal memchecker. - Thanks to Yvan Fournier for reporting. -- Fix a problem with MPI_FILE_DELETE returning MPI_SUCCESS when - deleting a non-existent file. Thanks to Wei-keng Liao for reporting. -- Fix a problem with MPI_IMPROBE that could lead to hangs in subsequent MPI - point to point or collective calls. Thanks to Chris Pattison for reporting. -- Fix a problem when configure Open MPI for powerpc with --enable-mpi-cxx - enabled. Thanks to Alastair McKinstry for reporting. -- Fix a problem using MPI_IALLTOALL with MPI_IN_PLACE argument. Thanks to - Chris Ward for reporting. -- Fix a problem using MPI_RACCUMULATE with the Portals4 transport. Thanks to - @PDeveze for reporting. -- Fix an issue with static linking and duplicate symbols arising from PMIx - Slurm components. Thanks to Limin Gu for reporting. -- Fix a problem when using MPI dynamic memory windows. Thanks to - Christoph Niethammer for reporting. -- Fix a problem with Open MPI's pkgconfig files. Thanks to Alastair McKinstry - for reporting. -- Fix a problem with MPI_IREDUCE when the same buffer is supplied for the - send and recv buffer arguments. Thanks to Valentin Petrov for reporting. -- Fix a problem with atomic operations on PowerPC. Thanks to Paul - Hargrove for reporting. - -Known issues (to be addressed in v2.0.3): - -- See the list of fixes slated for v2.0.3 here: - https://github.com/open-mpi/ompi/milestone/23 - -2.0.1 -- 2 September 2016 ------------------------ - -Bug fixes/minor improvements: - -- Short message latency and message rate performance improvements for - all transports. -- Fix shared memory performance when using RDMA-capable networks. - Thanks to Tetsuya Mishima and Christoph Niethammer for reporting. -- Fix bandwith performance degredation in the yalla (MXM) PML. Thanks - to Andreas Kempf for reporting the issue. -- Fix OpenSHMEM crash when running on non-Mellanox MXM-based networks. - Thanks to Debendra Das for reporting the issue. -- Fix a crash occuring after repeated calls to MPI_FILE_SET_VIEW with - predefined datatypes. Thanks to Eric Chamberland and Matthew - Knepley for reporting and helping chase down this issue. -- Fix stdin propagation to MPI processes. Thanks to Jingchao Zhang - for reporting the issue. -- Fix various runtime and portability issues by updating the PMIx - internal component to v1.1.5. -- Fix process startup failures on Intel MIC platforms due to very - large entries in /proc/mounts. -- Fix a problem with use of relative path for specifing executables to - mpirun/oshrun. Thanks to David Schneider for reporting. -- Various improvements when running over portals-based networks. -- Fix thread-based race conditions with GNI-based networks. -- Fix a problem with MPI_FILE_CLOSE and MPI_FILE_SET_SIZE. Thanks - to Cihan Altinay for reporting. -- Remove all use of rand(3) from within Open MPI so as not to perturb - applications use of it. Thanks to Matias Cabral and Noel Rycroft - for reporting. -- Fix crash in MPI_COMM_SPAWN. -- Fix types for MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY. Thanks to - Lisandro Dalcín for reporting. -- Correctly report the name of MPI_INTEGER16. -- Add some missing MPI constants to the Fortran bindings. -- Fixed compile error when configuring Open MPI with --enable-timing. -- Correctly set the shared library version of libompitrace.so. Thanks - to Alastair McKinstry for reporting. -- Fix errors in the MPI_RPUT, MPI_RGET, MPI_RACCUMULATE, and - MPI_RGET_ACCUMULATE Fortran bindings. Thanks to Alfio Lazzaro and - Joost VandeVondele for tracking this down. -- Fix problems with use of derived datatypes in non-blocking - collectives. Thanks to Yuki Matsumoto for reporting. -- Fix problems with OpenSHMEM header files when using CMake. Thanks to - Paul Kapinos for reporting the issue. -- Fix problem with use use of non-zero lower bound datatypes in - collectives. Thanks to Hristo Iliev for reporting. -- Fix a problem with memory allocation within MPI_GROUP_INTERSECTION. - Thanks to Lisandro Dalcín for reporting. -- Fix an issue with MPI_ALLGATHER for communicators that don't consist - of two ranks. Thanks to David Love for reporting. -- Various fixes for collectives when used with esoteric MPI datatypes. -- Fixed corner cases of handling DARRAY and HINDEXED_BLOCK datatypes. -- Fix a problem with filesystem type check for OpenBSD. - Thanks to Paul Hargrove for reporting. -- Fix some debug input within Open MPI internal functions. Thanks to - Durga Choudhury for reporting. -- Fix a typo in a configury help message. Thanks to Paul Hargrove for - reporting. -- Correctly support MPI_IN_PLACE in MPI_[I]ALLTOALL[V|W] and - MPI_[I]EXSCAN. -- Fix alignment issues on SPARC platforms. - -Known issues (to be addressed in v2.0.2): - -- See the list of fixes slated for v2.0.2 here: - https://github.com/open-mpi/ompi/milestone/20, and - https://github.com/open-mpi/ompi-release/milestone/19 - (note that the "ompi-release" Github repo will be folded/absorbed - into the "ompi" Github repo at some point in the future) - - -2.0.0 -- 12 July 2016 ---------------------- - - ********************************************************************** - * Open MPI is now fully MPI-3.1 compliant - ********************************************************************** - -Major new features: - -- Many enhancements to MPI RMA. Open MPI now maps MPI RMA operations - on to native RMA operations for those networks which support this - capability. -- Greatly improved support for MPI_THREAD_MULTIPLE (when configured - with --enable-mpi-thread-multiple). -- Enhancements to reduce the memory footprint for jobs at scale. A - new MCA parameter, "mpi_add_procs_cutoff", is available to set the - threshold for using this feature. -- Completely revamped support for memory registration hooks when using - OS-bypass network transports. -- Significant OMPIO performance improvements and many bug fixes. -- Add support for PMIx - Process Management Interface for Exascale. - Version 1.1.2 of PMIx is included internally in this release. -- Add support for PLFS file systems in Open MPI I/O. -- Add support for UCX transport. -- Simplify build process for Cray XC systems. Add support for - using native SLURM. -- Add a --tune mpirun command line option to simplify setting many - environment variables and MCA parameters. -- Add a new MCA parameter "orte_default_dash_host" to offer an analogue - to the existing "orte_default_hostfile" MCA parameter. -- Add the ability to specify the number of desired slots in the mpirun - --host option. - -Changes in behavior compared to prior versions: - -- In environments where mpirun cannot automatically determine the - number of slots available (e.g., when using a hostfile that does not - specify "slots", or when using --host without specifying a ":N" - suffix to hostnames), mpirun now requires the use of "-np N" to - specify how many MPI processes to launch. -- The MPI C++ bindings -- which were removed from the MPI standard in - v3.0 -- are no longer built by default and will be removed in some - future version of Open MPI. Use the --enable-mpi-cxx-bindings - configure option to build the deprecated/removed MPI C++ bindings. -- ompi_info now shows all components, even if they do not have MCA - parameters. The prettyprint output now separates groups with a - dashed line. -- OMPIO is now the default implementation of parallel I/O, with the - exception for Lustre parallel filesystems (where ROMIO is still the - default). The default selection of OMPI vs. ROMIO can be controlled - via the "--mca io ompi|romio" command line switch to mpirun. -- Per Open MPI's versioning scheme (see the README), increasing the - major version number to 2 indicates that this version is not - ABI-compatible with prior versions of Open MPI. You will need to - recompile MPI and OpenSHMEM applications to work with this version - of Open MPI. -- Removed checkpoint/restart code due to loss of maintainer. :-( -- Change the behavior for handling certain signals when using PSM and - PSM2 libraries. Previously, the PSM and PSM2 libraries would trap - certain signals in order to generate tracebacks. The mechanism was - found to cause issues with Open MPI's own error reporting mechanism. - If not already set, Open MPI now sets the IPATH_NO_BACKTRACE and - HFI_NO_BACKTRACE environment variables to disable PSM/PSM2's - handling these signals. - -Removed legacy support: - -- Removed support for OS X Leopard. -- Removed support for Cray XT systems. -- Removed VampirTrace. -- Removed support for Myrinet/MX. -- Removed legacy collective module:ML. -- Removed support for Alpha processors. -- Removed --enable-mpi-profiling configure option. - -Known issues (to be addressed in v2.0.1): - -- See the list of fixes slated for v2.0.1 here: - https://github.com/open-mpi/ompi/milestone/16, and - https://github.com/open-mpi/ompi-release/milestone/16 - (note that the "ompi-release" Github repo will be folded/absorbed - into the "ompi" Github repo at some point in the future) - -- ompi-release#986: Fix data size counter for large ops with fcoll/static -- ompi-release#987: Fix OMPIO performance on Lustre -- ompi-release#1013: Fix potential inconsistency in btl/openib default settings -- ompi-release#1014: Do not return MPI_ERR_PENDING from collectives -- ompi-release#1056: Remove dead profile code from oshmem -- ompi-release#1081: Fix MPI_IN_PLACE checking for IALLTOALL{V|W} -- ompi-release#1081: Fix memchecker in MPI_IALLTOALLW -- ompi-release#1081: Support MPI_IN_PLACE in MPI_(I)ALLTOALLW and MPI_(I)EXSCAN -- ompi-release#1107: Allow future PMIx support for RM spawn limits -- ompi-release#1108: Fix sparse group process reference counting -- ompi-release#1109: If specified to be oversubcribed, disable binding -- ompi-release#1122: Allow NULL arrays for empty datatypes -- ompi-release#1123: Fix signed vs. unsigned compiler warnings -- ompi-release#1123: Make max hostname length uniform across code base -- ompi-release#1127: Fix MPI_Compare_and_swap -- ompi-release#1127: Fix MPI_Win_lock when used with MPI_Win_fence -- ompi-release#1132: Fix typo in help message for --enable-mca-no-build -- ompi-release#1154: Ensure pairwise coll algorithms disqualify themselves properly -- ompi-release#1165: Fix typos in debugging/verbose message output -- ompi-release#1178: Fix ROMIO filesystem check on OpenBSD 5.7 -- ompi-release#1197: Fix Fortran pthread configure check -- ompi-release#1205: Allow using external PMIx 1.1.4 and 2.0 -- ompi-release#1215: Fix configure to support the NAG Fortran compiler -- ompi-release#1220: Fix combiner args for MPI_HINDEXED_BLOCK -- ompi-release#1225: Fix combiner args for MPI_DARRAY -- ompi-release#1226: Disable old memory hooks with recent gcc versions -- ompi-release#1231: Fix new "patcher" support for some XLC platforms -- ompi-release#1244: Fix Java error handling -- ompi-release#1250: Ensure TCP is not selected for RDMA operations -- ompi-release#1252: Fix verbose output in coll selection -- ompi-release#1253: Set a default name for user-defined MPI_Op -- ompi-release#1254: Add count==0 checks in some non-blocking colls -- ompi-release#1258: Fix "make distclean" when using external pmix/hwloc/libevent -- ompi-release#1260: Clean up/uniform mca/coll/base memory management -- ompi-release#1261: Remove "patcher" warning message for static builds -- ompi-release#1263: Fix IO MPI_Request for 0-size read/write -- ompi-release#1264: Add blocking fence for SLURM operations - -Bug fixes / minor enhancements: - -- Updated internal/embedded copies of third-party software: - - Update the internal copy of ROMIO to that which shipped in MPICH - 3.1.4. - - Update internal copy of libevent to v2.0.22. - - Update internal copy of hwloc to v1.11.2. -- Notable new MCA parameters: - - opal_progress_lp_call_ration: Control how often low-priority - callbacks are made during Open MPI's main progress loop. - - opal_common_verbs_want_fork_support: This replaces the - btl_openib_want_fork_support parameter. -- Add --with-platform-patches-dir configure option. -- Add --with-pmi-libdir configure option for environments that install - PMI libs in a non-default location. -- Various configure-related compatibility updates for newer versions - of libibverbs and OFED. -- Numerous fixes/improvements to orte-dvm. Special thanks to Mark - Santcroos for his help. -- Fix a problem with timer code on ia32 platforms. Thanks to - Paul Hargrove for reporting this and providing a patch. -- Fix a problem with use of a 64 bit atomic counter. Thanks to - Paul Hargrove for reporting. -- Fix a problem with singleton job launching. Thanks to Lisandro - Dalcín for reporting. -- Fix a problem with use of MPI_UNDEFINED with MPI_COMM_SPLIT_TYPE. - Thanks to Lisandro Dalcín for reporting. -- Silence a compiler warning in PSM MTL. Thanks to Adrian Reber for - reporting this. -- Properly detect Intel TrueScale and OmniPath devices in the ACTIVE - state. Thanks to Durga Choudhury for reporting the issue. -- Fix detection and use of Solaris Studio 12.5 (beta) compilers. - Thanks to Paul Hargrove for reporting and debugging. -- Fix various small memory leaks. -- Allow NULL arrays when creating empty MPI datatypes. -- Replace use of alloca with malloc for certain datatype creation - functions. Thanks to Bogdan Sataric for reporting this. -- Fix use of MPI_LB and MPI_UB in creation of of certain MPI datatypes. - Thanks to Gus Correa for helping to fix this. -- Implement a workaround for a GNU Libtool problem. Thanks to Eric - Schnetter for reporting and fixing. -- Improve hcoll library detection in configure. Thanks to David - Shrader and Åke Sandgren for reporting this. -- Miscellaneous minor bug fixes in the hcoll component. -- Miscellaneous minor bug fixes in the ugni component. -- Fix problems with XRC detection in OFED 3.12 and older releases. - Thanks to Paul Hargrove for his analysis of this problem. -- Update (non-standard/experimental) Java MPI interfaces to support - MPI-3.1 functionality. -- Fix an issue with MCA parameters for Java bindings. Thanks to - Takahiro Kawashima and Siegmar Gross for reporting this issue. -- Fix a problem when using persistent requests in the Java bindings. - Thanks to Nate Chambers for reporting. -- Fix problem with Java bindings on OX X 10.11. Thanks to Alexander - Daryin for reporting this issue. -- Fix a performance problem for large messages for Cray XC systems. - Thanks to Jerome Vienne for reporting this. -- Fix an issue with MPI_WIN_LOCK_ALL. Thanks to Thomas Jahns for - reporting. -- Fix an issue with passing a parameter to configure multiple times. - Thanks to QuesarVII for reporting and supplying a fix. -- Add support for ALPS resource allocation system on Cray CLE 5.2 and - later. Thanks to Mark Santcroos. -- Corrections to the HACKING file. Thanks to Maximilien Levesque. -- Fix an issue with user supplied reduction operator functions. - Thanks to Rupert Nash for reporting this. -- Fix an issue with an internal list management function. Thanks to - Adrian Reber for reporting this. -- Fix a problem with MPI-RMA PSCW epochs. Thanks to Berk Hess for - reporting this. -- Fix a problem in neighborhood collectives. Thanks to Lisandro - Dalcín for reporting. -- Fix MPI_IREDUCE_SCATTER_BLOCK for a one-process communicator. Thanks - to Lisandro Dalcín for reporting. -- Add (Open MPI-specific) additional flavors to MPI_COMM_SPLIT_TYPE. - See MPI_Comm_split_type(3) for details. Thanks to Nick Andersen for - supplying this enhancement. -- Improve closing of file descriptors during the job launch phase. - Thanks to Piotr Lesnicki for reporting and providing this - enhancement. -- Fix a problem in MPI_GET_ACCUMULATE and MPI_RGET_ACCUMULATE when - using Portals4. Thanks to Nicolas Chevalier for reporting. -- Use correct include file for lstat prototype in ROMIO. Thanks to - William Throwe for finding and providing a fix. -- Add missing Fortran bindings for MPI_WIN_ALLOCATE. Thanks to Christoph - Niethammer for reporting and fixing. -- Fortran related fixes to handle Intel 2016 compiler. Thanks to - Fabrice Roy for reporting this. -- Fix a Fortran linkage issue. Thanks to Macro Atzeri for finding and - suggesting a fix. -- Fix problem with using BIND(C) for Fortran bindings with logical - parameters. Thanks to Paul Romano for reporting. -- Fix an issue with use of DL-related macros in opal library. Thanks to - Scott Atchley for finding this. -- Fix an issue with parsing mpirun command line options which contain - colons. Thanks to Lev Given for reporting. -- Fix a problem with Open MPI's package configury files. Thanks to - Christoph Junghans for reporting. -- Fix a typo in the MPI_INTERCOMM_MERGE man page. Thanks To Harald - Servat for reporting and correcting. -- Update man pages for non-blocking sends per MPI 3.1 standard. - Thanks to Alexander Pozdneev for reporting. -- Fix problem when compiling against PVFS2. Thanks to Dave Love for - reporting. -- Fix problems with MPI_NEIGHBOR_ALLTOALL{V,W}. Thanks to Willem - Vermin for reporting this issue. -- Fix various compilation problems on Cygwin. Thanks to Marco Atzeri - for supplying these fixes. -- Fix problem with resizing of subarray and darray data types. Thanks - to Keith Bennett and Dan Garmann for reporting. -- Fix a problem with MPI_COMBINER_RESIZED. Thanks to James Ramsey for - the report. -- Fix an hwloc binding issue. Thanks to Ben Menadue for reporting. -- Fix a problem with the shared memory (sm) BTL. Thanks to Peter Wind - for the report. -- Fixes for heterogeneous support. Thanks to Siegmar Gross for reporting. -- Fix a problem with memchecker. Thanks to Clinton Simpson for reporting. -- Fix a problem with MPI_UNWEIGHTED in topology functions. Thanks to - Jun Kudo for reporting. -- Fix problem with a MCA parameter base filesystem types. Thanks to - Siegmar Gross for reporting. -- Fix a problem with some windows info argument types. Thanks to - Alastair McKinstry for reporting. - - -1.10.7 - 16 May 2017 ------- -- Fix bug in TCP BTL that impacted performance on 10GbE (and faster) - networks by not adjusting the TCP send/recv buffer sizes and using - system default values -- Add missing MPI_AINT_ADD and MPI_AINT_DIFF function delcarations in - mpif.h -- Fixed time reported by MPI_WTIME; it was previously reported as - dependent upon the CPU frequency. -- Fix platform detection on FreeBSD -- Fix a bug in the handling of MPI_TYPE_CREATE_DARRAY in - MPI_(R)(GET_)ACCUMULATE -- Fix openib memory registration limit calculation -- Add missing MPI_T_PVAR_SESSION_NULL in mpi.h -- Fix "make distcheck" when using external hwloc and/or libevent packages -- Add latest ConnectX-5 vendor part id to OpenIB device params -- Fix race condition in the UCX PML -- Fix signal handling for rsh launcher -- Fix Fortran compilation errors by removing MPI_SIZEOF in the Fortran - interfaces when the compiler does not support it -- Fixes for the pre-ignore-TKR "mpi" Fortran module implementation - (i.e., for older Fortran compilers -- these problems did not exist - in the "mpi" module implementation for modern Fortran compilers): - - Add PMPI_* interfaces - - Fix typo in MPI_FILE_WRITE_AT_ALL_BEGIN interface name - - Fix typo in MPI_FILE_READ_ORDERED_BEGIN interface name -- Fixed the type of MPI_DISPLACEMENT_CURRENT in all Fortran interfaces - to be an INTEGER(KIND=MPI_OFFSET_KIND). -- Fixed typos in MPI_INFO_GET_* man pages. Thanks to Nicolas Joly for - the patch -- Fix typo bugs in wrapper compiler script - - -1.10.6 - 17 Feb 2017 ------- -- Fix bug in timer code that caused problems at optimization settings - greater than 2 -- OSHMEM: make mmap allocator the default instead of sysv or verbs -- Support MPI_Dims_create with dimension zero -- Update USNIC support -- Prevent 64-bit overflow on timer counter -- Add support for forwarding signals -- Fix bug that caused truncated messages on large sends over TCP BTL -- Fix potential infinite loop when printing a stacktrace - - -1.10.5 - 19 Dec 2016 ------- -- Update UCX APIs -- Fix bug in darray that caused MPI/IO failures -- Use a MPI_Get_library_version() like string to tag the debugger DLL. - Thanks to Alastair McKinstry for the report -- Fix multi-threaded race condition in coll/libnbc -- Several fixes to OSHMEM -- Fix bug in UCX support due to uninitialized field -- Fix MPI_Ialltoallv with MPI_IN_PLACE and without MPI param check -- Correctly reset receive request type before init. Thanks Chris Pattison - for the report and test case. -- Fix bug in iallgather[v] -- Fix concurrency issue with MPI_Comm_accept. Thanks to Pieter Noordhuis - for the patch -- Fix ompi_coll_base_{gather,scatter}_intra_binomial -- Fixed an issue with MPI_Type_get_extent returning the wrong extent - for distributed array datatypes. -- Re-enable use of rtdtsc instruction as a monotonic clock source if - the processor has a core-invariant tsc. This is a partial fix for a - performance regression introduced in Open MPI v1.10.3. - - -1.10.4 - 01 Sept 2016 ------- - -- Fix assembler support for MIPS -- Improve memory handling for temp buffers in collectives -- Fix [all]reduce with non-zero lower bound datatypes - Thanks Hristo Iliev for the report -- Fix non-standard ddt handling. Thanks Yuki Matsumoto for the report -- Various libnbc fixes. Thanks Yuki Matsumoto for the report -- Fix typos in request RMA bindings for Fortran. Thanks to @alazzaro - and @vondele for the assist -- Various bug fixes and enhancements to collective support -- Fix predefined types mapping in hcoll -- Revive the coll/sync component to resolve unexpected message issues - during tight loops across collectives -- Fix typo in wrapper compiler for Fortran static builds - - -1.10.3 - 15 June 2016 ------- - -- Fix zero-length datatypes. Thanks to Wei-keng Liao for reporting - the issue. -- Minor manpage cleanups -- Implement atomic support in OSHMEM/UCX -- Fix support of MPI_COMBINER_RESIZED. Thanks to James Ramsey - for the report -- Fix computation of #cpus when --use-hwthread-cpus is used -- Add entry points for Allgatherv, iAllgatherv, Reduce, and iReduce - for the HCOLL library -- Fix an HCOLL integration bug that could signal completion of request - while still being worked -- Fix computation of cores when SMT is enabled. Thanks to Ben Menadue - for the report -- Various USNIC fixes -- Create a datafile in the per-proc directory in order to make it - unique per communicator. Thanks to Peter Wind for the report -- Fix zero-size malloc in one-sided pt-to-pt code. Thanks to Lisandro - Dalcín for the report -- Fix MPI_Get_address when passed MPI_BOTTOM to not return an error. - Thanks to Lisandro Dalcín for the report -- Fix MPI_TYPE_SET_ATTR with NULL value. Thanks to Lisandro Dalcín for - the report -- Fix various Fortran08 binding issues -- Fix memchecker no-data case. Thanks to Clinton Stimpson for the report -- Fix CUDA support under OS-X -- Fix various OFI/MTL integration issues -- Add MPI_T man pages -- Fix one-sided pt-to-pt issue by preventing communication from happening - before a target enters a fence, even in the no-precede case -- Fix a bug that disabled Totalview for MPMD use-case -- Correctly support MPI_UNWEIGHTED in topo-graph-neighbors. Thanks to - Jun Kudo for the report -- Fix singleton operations under SLURM when PMI2 is enabled -- Do not use MPI_IN_PLACE in neighborhood collectives for non-blocking - collectives (libnbc). Thanks to Jun Kudo for the report -- Silence autogen deprecation warnings for newer versions of Perl -- Do not return MPI_ERR_PENDING from collectives -- Use type int* for MPI_WIN_DISP_UNIT, MPI_WIN_CREATE_FLAVOR, and MPI_WIN_MODEL. - Thanks to Alastair McKinstry for the report -- Fix register_datarep stub function in IO/OMPIO. Thanks to Eric - Chamberland for the report -- Fix a bus error on MPI_WIN_[POST,START] in the shared memory one-sided component -- Add several missing MPI_WIN_FLAVOR constants to the Fortran support -- Enable connecting processes from different subnets using the openib BTL -- Fix bug in basic/barrier algorithm in OSHMEM -- Correct process binding for the --map-by node case -- Include support for subnet-to-subnet routing over InfiniBand networks -- Fix usnic resource check -- AUTHORS: Fix an errant reference to Subversion IDs -- Fix affinity for MPMD jobs running under LSF -- Fix many Fortran binding bugs -- Fix `MPI_IN_PLACE`-related bugs -- Fix PSM/PSM2 support for singleton operations -- Ensure MPI transports continue to progress during RTE barriers -- Update HWLOC to 1.9.1 end-of-series -- Fix a bug in the Java command line parser when the - -Djava.library.path options was given by the user -- Update the MTL/OFI provider selection behavior -- Add support for clock_gettime on Linux. -- Correctly detect and configure for Solaris Studio 12.5 - beta compilers -- Correctly compute #slots when -host is used for MPMD case -- Fix a bug in the hcoll collectives due to an uninitialized field -- Do not set a binding policy when oversubscribing a node -- Fix hang in intercommunicator operations when oversubscribed -- Speed up process termination during MPI_Abort -- Disable backtrace support by default in the PSM/PSM2 libraries to - prevent unintentional conflicting behavior. - - - -1.10.2: 26 Jan 2016 -------------------- - - ********************************************************************** - * OSHMEM is now 1.2 compliant - ********************************************************************** - -- Fix NBC_Copy for legitimate zero-size messages -- Fix multiple bugs in OSHMEM -- Correctly handle mpirun --host @ -- Centralize two MCA params to avoid duplication between OMPI and - OSHMEM layers: opal_abort_delay and opal_abort_print_stack -- Add support for Fujitsu compilers -- Add UCX support for OMPI and OSHMEM -- Correctly handle oversubscription when not given directives - to permit it. Thanks to @ammore1 for reporting it -- Fix rpm spec file to not include the /usr directory -- Add Intel HFI1 default parameters for the openib BTL -- Resolve symbol conflicts in the PSM2 library -- Add ability to empty the rgpusm cache when full if requested -- Fix another libtool bug when -L requires a space between it - and the path. Thanks to Eric Schnetter for the patch. -- Add support for OSHMEM v1.2 APIs -- Improve efficiency of oshmem_preconnect_all algorithm -- Fix bug in buffered sends support -- Fix double free in edge case of mpirun. Thanks to @jsharpe for - the patch -- Multiple one-sided support fixes -- Fix integer overflow in the tuned "reduce" collective when - using buffers larger than INT_MAX in size -- Fix parse of user environment variables in mpirun. Thanks to - Stefano Garzarella for the patch -- Performance improvements in PSM2 support -- Fix NBS iBarrier for inter-communicators -- Fix bug in vader BTL during finalize -- Improved configure support for Fortran compilers -- Fix rank_file mapper to support default --slot-set. Thanks - to Matt Thompson for reporting it -- Update MPI_Testsome man page. Thanks to Eric Schnetter for - the suggestion -- Fix missing resize of the returned type for subarray and - darray types. Thanks to Keith Bennett and Dan Garmann for - reporting it -- Fix Java support on OSX 10.11. Thanks to Alexander Daryin - for reporting the problem -- Fix some compilation issues on Solaris 11.2. Thanks to - Paul Hargrove for his continued help in such areas - - -1.10.1: 4 Nov 2015 ------------------- - -- Workaround an optimization problem with gcc compilers >= 4.9.2 that - causes problems with memory registration, and forced - mpi_leave_pinned to default to 0 (i.e., off). Thanks to @oere for - the fix. -- Fix use of MPI_LB and MPI_UB in subarray and darray datatypes. - Thanks to Gus Correa and Dimitar Pashov for pointing out the issue. -- Minor updates to mpi_show_mpi_alloc_mem_leaks and - ompi_debug_show_handle_leaks functionality. -- Fix segv when invoking non-blocking reductions with a user-defined - operation. Thanks to Rupert Nash and Georg Geiser for identifying - the issue. -- No longer probe for PCI topology on Solaris (unless running as root). -- Fix for Intel Parallel Studio 2016 ifort partial support of the - !GCC$ pragma. Thanks to Fabrice Roy for reporting the problem. -- Bunches of Coverity / static analysis fixes. -- Fixed ROMIO to look for lstat in . Thanks to William - Throwe for submitting the patch both upstream and to Open MPI. -- Fixed minor memory leak when attempting to open plugins. -- Fixed type in MPI_IBARRIER C prototype. Thanks to Harald Servat for - reporting the issue. -- Add missing man pages for MPI_WIN_CREATE_DYNAMIC, MPI_WIN_ATTACH, - MPI_WIN_DETACH, MPI_WIN_ALLOCATE, MPI_WIN_ALLOCATE_SHARED. -- When mpirun-launching new applications, only close file descriptors - that are actually open (resulting in a faster launch in some - environments). -- Fix "test ==" issues in Open MPI's configure script. Thank to Kevin - Buckley for pointing out the issue. -- Fix performance issue in usnic BTL: ensure progress thread is - throttled back to not aggressively steal CPU cycles. -- Fix cache line size detection on POWER architectures. -- Add missing #include in a few places. Thanks to Orion Poplawski for - supplying the patch. -- When OpenSHMEM building is disabled, no longer install its header - files, help files, or man pages. Add man pages for oshrun, oshcc, - and oshfort. -- Fix mpi_f08 implementations of MPI_COMM_SET_INFO, and profiling - versions of MPI_BUFFER_DETACH, MPI_WIN_ALLOCATE, - MPI_WIN_ALLOCATE_SHARED, MPI_WTICK, and MPI_WTIME. -- Add orte_rmaps_dist_device MCA param, allowing users to map near a - specific device. -- Various updates/fixes to the openib BTL. -- Add missing defaults for the Mellanox ConnectX 3 card to the openib BTL. -- Minor bug fixes in the OFI MTL. -- Various updates to Mellanox's MXM, hcoll, and FCA components. -- Add OpenSHMEM man pages. Thanks to Tony Curtis for sharing the man - pages files from openshmem.org. -- Add missing "const" attributes to MPI_COMPARE_AND_SWAP, - MPI_FETCH_AND_OP, MPI_RACCUMULATE, and MPI_WIN_DETACH prototypes. - Thanks to Michael Knobloch and Takahiro Kawashima for bringing this - to our attention. -- Fix linking issues on some platforms (e.g., SLES 12). -- Fix hang on some corner cases when MPI applications abort. -- Add missing options to mpirun man page. Thanks to Daniel Letai - for bringing this to our attention. -- Add new --with-platform-patches-dir configure option -- Adjust relative selection priorities to ensure that MTL - support is favored over BTL support when both are available -- Use CUDA IPC for all sized messages for performance - - -1.10.0: 25 Aug 2015 -------------------- - -** NOTE: The v1.10.0 release marks the transition to Open MPI's new -** version numbering scheme. The v1.10.x release series is based on -** the v1.8.x series, but with a few new features. v2.x will be the -** next series after the v1.10.x series, and complete the transition -** to the new version numbering scheme. See README for more details -** on the new versioning scheme. -** -** NOTE: In accordance with OMPI version numbering, the v1.10 is *not* -** API compatible with the v1.8 release series. - -- Added libfabric support (see README for more details): - - usNIC BTL updated to use libfabric. - - Added OFI MTL (usable with PSM in libfabric v1.1.0). -- Added Intel Omni-Path support via new PSM2 MTL. -- Added "yalla" PML for faster MXM support. -- Removed support for MX -- Added persistent distributed virtual machine (pDVM) support for fast - workflow executions. -- Fixed typo in GCC inline assembly introduced in Open MPI v1.8.8. - Thanks to Paul Hargrove for pointing out the issue. -- Add missing man pages for MPI_Win_get|set_info(3). -- Ensure that session directories are cleaned up at the end of a run. -- Fixed linking issues on some OSs where symbols of dependent - libraries are not automatically publicly available. -- Improve hcoll and fca configury library detection. Thanks to David - Shrader for helping track down the issue. -- Removed the LAMA mapper (for use in setting affinity). Its - functionality has been largely superseded by other mpirun CLI - options. -- CUDA: Made the asynchronous copy mode be the default. -- Fix a malloc(0) warning in MPI_IREDUCE_SCATTER_BLOCK. Thanks to - Lisandro Dalcín for reporting the issue. -- Fix typo in MPI_Scatter(3) man page. Thanks to Akshay Venkatesh for - noticing the mistake. -- Add rudimentary protection from TCP port scanners. -- Fix typo in Open MPI error handling. Thanks to Åke Sandgren for - pointing out the error. -- Increased the performance of the CM PML (i.e., the Portals, PSM, - PSM2, MXM, and OFI transports). -- Restored visibility of blocking send requests in message queue - debuggers (e.g., TotalView, DDT). -- Fixed obscure IPv6-related bug in the TCP BTL. -- Add support for the "no_locks" MPI_Info key for one-sided - functionality. -- Fixed ibv_fork support for verbs-based networks. -- Fixed a variety of small bugs in OpenSHMEM. -- Fixed MXM configure with additional CPPFLAGS and LDFLAGS. Thanks to - David Shrader for the patch. -- Fixed incorrect memalign threshhold in the openib BTL. Thanks to - Xavier Besseron for pointing out the issue. - - -1.8.8: 5 Aug 2015 ------------------ - -- Fix a segfault in MPI_FINALIZE with the PSM MTL. -- Fix mpi_f08 sentinels (e.g., MPI_STATUS_IGNORE) handling. -- Set some additional MXM default values for OSHMEM. -- Fix an invalid memory access in MPI_MRECV and MPI_IMRECV. -- Include two fixes that were mistakenly left out of the official - v1.8.7 tarball: - - Fixed MPI_WIN_POST and MPI_WIN_START for zero-size messages - - Protect the OOB TCP ports from segfaulting when accessed by port - scanners - - -1.8.7: 15 Jul 2015 ------------------- - -** NOTE: v1.8.7 technically breaks ABI with prior versions -** in the 1.8 series because it repairs two incorrect API -** signatures. However, users will only need to recompile -** if they were using those functions - which they couldn't -** have been, because the signatures were wrong :-) - -- Plugged a memory leak that impacted blocking sends -- Fixed incorrect declaration for MPI_T_pvar_get_index and added - missing return code MPI_T_INVALID_NAME. -- Fixed an uninitialized variable in PMI2 support -- Added new vendor part id for Mellanox ConnectX4-LX -- Fixed NBC_Copy for legitimate zero-size messages -- Fixed MPI_Win_post and MPI_Win_start for zero-size messages -- Protect the OOB ports from segfaulting when accessed by port scanners -- Fixed several Fortran typos -- Fixed configure detection of XRC support -- Fixed support for highly heterogeneous systems to avoid - memory corruption when printing out the bindings - -1.8.6: 17 Jun 2015 ------------------- - -- Fixed memory leak on Mac OS-X exposed by TCP keepalive -- Fixed keepalive support to ensure that daemon/node failure - results in complete job cleanup -- Update Java binding support -- Fixed MPI_THREAD_MULTIPLE bug in vader shared memory BTL -- Fixed issue during shutdown when CUDA initialization wasn't complete -- Fixed orted environment when no prefix given -- Fixed trivial typo in MPI_Neighbor_allgather manpage -- Fixed tree-spawn support for sh and ksh shells -- Several data type fixes -- Fixed IPv6 support bug -- Cleaned up an unlikely build issue -- Fixed PMI2 process map parsing for cyclic mappings -- Fixed memalign threshold in openib BTL -- Fixed debugger access to message queues for blocking send/recv - - -1.8.5: 5 May 2015 ------------------ - -- Fixed configure problems in some cases when using an external hwloc - installation. Thanks to Erick Schnetter for reporting the error and - helping track down the source of the problem. -- Fixed linker error on OS X when using the clang compiler. Thanks to - Erick Schnetter for reporting the error and helping track down the - source of the problem. -- Fixed MPI_THREAD_MULTIPLE deadlock error in the vader BTL. Thanks - to Thomas Klimpel for reporting the issue. -- Fixed several Valgrind warnings. Thanks for Lisandro Dalcín for - contributing a patch fixing some one-sided code paths. -- Fixed version compatibility test in OOB that broke ABI within the - 1.8 series. NOTE: this will not resolve the problem between pre-1.8.5 - versions, but will fix it going forward. -- Fix some issues related to running on Intel Xeon Phi coprocessors. -- Opportunistically switch away from using GNU Libtool's libltdl - library when possible (by default). -- Fix some VampirTrace errors. Thanks to Paul Hargrove for reporting - the issues. -- Correct default binding patterns when --use-hwthread-cpus was - specified and nprocs <= 2. -- Fix warnings about -finline-functions when compiling with clang. -- Updated the embedded hwloc with several bug fixes, including the - "duplicate Lhwloc1 symbol" that multiple users reported on some - platforms. -- Do not error when mpirun is invoked with with default bindings - (i.e., no binding was specified), and one or more nodes do not - support bindings. Thanks to Annu Desari for pointing out the - problem. -- Let root invoke "mpirun --version" to check the version without - printing the "Don't run as root!" warnings. Thanks to Robert McLay - for the suggestion. -- Fixed several bugs in OpenSHMEM support. -- Extended vader shared memory support to 32-bit architectures. -- Fix handling of very large datatypes. Thanks to Bogdan Sataric for - the bug report. -- Fixed a bug in handling subarray MPI datatypes, and a bug when using - MPI_LB and MPI_UB. Thanks to Gus Correa for pointing out the issue. -- Restore user-settable bandwidth and latency PML MCA variables. -- Multiple bug fixes for cleanup during MPI_FINALIZE in unusual - situations. -- Added support for TCP keepalive signals to ensure timely termination - when sockets between daemons cannot be created (e.g., due to a - firewall). -- Added MCA parameter to allow full use of a SLURM allocation when - started from a tool (supports LLNL debugger). -- Fixed several bugs in the configure logic for PMI and hwloc. -- Fixed incorrect interface index in TCP communications setup. Thanks - to Mark Kettenis for spotting the problem and providing a patch. -- Fixed MPI_IREDUCE_SCATTER with single-process communicators when - MPI_IN_PLACE was not used. -- Added XRC support for OFED v3.12 and higher. -- Various updates and bug fixes to the Mellanox hcoll collective - support. -- Fix problems with Fortran compilers that did not support - REAL*16/COMPLEX*32 types. Thanks to Orion Poplawski for identifying - the issue. -- Fixed problem with rpath/runpath support in pkg-config files. - Thanks to Christoph Junghans for notifying us of the issue. -- Man page fixes: - - Removed erroneous "color" discussion from MPI_COMM_SPLIT_TYPE. - Thanks to Erick Schnetter for spotting the outdated text. - - Fixed prototypes for MPI_IBARRIER. Thanks to Maximilian for - finding the issue. - - Updated docs about buffer usage in non-blocking communications. - Thanks to Alexander Pozdneev for citing the outdated text. - - Added documentation about the 'ompi_unique' MPI_Info key with - MPI_PUBLISH_NAME. - - Fixed typo in MPI_INTERCOMM_MERGE. Thanks to Harald Servat for - noticing and sending a patch. - - Updated configure paths in HACKING. Thanks to Maximilien Levesque - for the fix. - - Fixed Fortran typo in MPI_WIN_LOCK_ALL. Thanks to Thomas Jahns - for pointing out the issue. -- Fixed a number of MPI one-sided bugs. -- Fixed MPI_COMM_SPAWN when invoked from a singleton job. -- Fixed a number of minor issues with CUDA support, including - registering of shared memory and supporting reduction support for - GPU buffers. -- Improved support for building OMPI on Cray platforms. -- Fixed performance regression introduced by the inadvertent default - enabling of MPI_THREAD_MULTIPLE support. - - -1.8.4: 19 Dec 2014 ------------------- - -- Fix MPI_SIZEOF; now available in mpif.h for modern Fortran compilers - (see README for more details). Also fixed various compiler/linker - errors. -- Fixed inadvertant Fortran ABI break between v1.8.1 and v1.8.2 in the - mpi interface module when compiled with gfortran >= v4.9. -- Fix various MPI_THREAD_MULTIPLE issues in the TCP BTL. -- mpirun no longer requires the --hetero-nodes switch; it will - automatically detect when running in heterogeneous scenarios. -- Update LSF support, to include revamped affinity functionality. -- Update embedded hwloc to v1.9.1. -- Fixed max registerable memory computation in the openib BTL. -- Updated error message when debuggers are unable to find various - symbols/types to be more clear. Thanks to Dave Love for raising the - issue. -- Added proper support for LSF and PBS/Torque libraries in static builds. -- Rankfiles now support physical processor IDs. -- Fixed potential hang in MPI_ABORT. -- Fixed problems with the PSM MTL and "re-connect" scenarios, such as - MPI_INTERCOMM_CREATE. -- Fix MPI_IREDUCE_SCATTER with a single process. -- Fix (rare) race condition in stdout/stderr funneling to mpirun where - some trailing output could get lost when a process terminated. -- Removed inadvertent change that set --enable-mpi-thread-multiple "on" - by default, thus impacting performance for non-threaded apps. -- Significantly reduced startup time by optimizing internal hash table - implementation. -- Fixed OS X linking with the Fortran mpi module when used with - gfortran >= 4.9. Thanks to Github user yafshar for raising the - issue. -- Fixed memory leak on Cygwin platforms. Thanks for Marco Atzeri for - reporting the issue. -- Fixed seg fault in neighborhood collectives when the degree of the - topology is higher than the communicator size. Thanks to Lisandro - Dalcín for reporting the issue. -- Fixed segfault in neighborhood collectives under certain use-cases. -- Fixed various issues regarding Solaris support. Thanks to Siegmar - Gross for patiently identifying all the issues. -- Fixed PMI configure tests for certain Slurm installation patterns. -- Fixed param registration issue in Java bindings. Thanks to Takahiro - Kawashima and Siegmar Gross for identifying the issue. -- Several man page fixes. -- Silence several warnings and close some memory leaks (more remain, - but it's better than it was). -- Re-enabled the use of CMA and knem in the shared memory BTL. -- Updated mpirun manpage to correctly explain new map/rank/binding options. -- Fixed MPI_IALLGATHER problem with intercommunicators. Thanks for - Takahiro Kawashima for the patch. -- Numerous updates and performance improvements to OpenSHMEM. -- Turned off message coalescing in the openib BTL until a proper fix - for that capability can be provided (tentatively expected for 1.8.5) -- Fix a bug in iof output that dates back to the dinosaurs which would - output extra bytes if the system was very heavily loaded -- Fix a bug where specifying mca_component_show_load_errors=0 could - cause ompi_info to segfault -- Updated valgrind suppression file - - -1.8.3: 26 Sep 2014 ------------------- - -- Fixed application abort bug to ensure that MPI_Abort exits appropriately - and returns the provided exit status -- Fixed some alignment (not all) issues identified by Clang -- Allow CUDA-aware to work with nonblocking collectives. Forces packing to - happen when using GPU buffers. -- Fixed configure test issue with Intel 2015 Fortran compiler -- Fixed some PGI-related errors -- Provide better help message when encountering a firewall -- Fixed MCA parameter quoting to protect multi-word params and params - that contain special characters -- Improved the bind-to help message to clarify the defaults -- Add new MPI-3.1 tools interface -- Several performance optimizations and memory leak cleanups -- Turn off the coll/ml plugin unless specifically requested as it - remains in an experimental state -- Fix LSF support by adding required libraries for the latest LSF - releases. Thanks to Joshua Randal for supplying the initial - patches. - - -1.8.2: 25 Aug 2014 ------------------- - -- Fix auto-wireup of OOB, allowing ORTE to automatically - test all available NICs -- "Un-deprecate" pernode, npernode, and npersocket options - by popular demand -- Add missing Fortran bindings for MPI_WIN_LOCK_ALL, - MPI_WIN_UNLOCK_ALL, and MPI_WIN_SYNC. -- Fix cascading/over-quoting in some cases with the rsh/ssh-based - launcher. Thanks to multiple users for raising the issue. -- Properly add support for gfortran 4.9 ignore TKR pragma (it was - erroneously only partially added in v1.7.5). Thanks to Marcus - Daniels for raising the issue. -- Update/improve help messages in the usnic BTL. -- Resolve a race condition in MPI_Abort. -- Fix obscure cases where static linking from wrapper compilers would - fail. -- Clarify the configure --help message about when OpenSHMEM is - enabled/disabled by default. Thanks to Paul Hargrove for the - suggestion. -- Align pages properly where relevant. Thanks to Paul Hargrove for - identifying the issue. -- Various compiler warning and minor fixes for OpenBSD, FreeBSD, and - Solaris/SPARC. Thanks to Paul Hargrove for the patches. -- Properly pass function pointers from Fortran to C in the mpi_f08 - module, thereby now supporting gfortran 4.9. Thanks to Tobias - Burnus for assistance and testing with this issue. -- Improve support for Cray CLE 5. -- Fix mpirun regression: ensure exit status is non-zero if mpirun is - terminated due to signal. -- Improved CUDA efficiency of asynchronous copies. -- Fix to parameter type in MPI_Type_indexed.3. Thanks to Bastian - Beischer for reporting the mistake. -- Fix NUMA distance calculations in the openib BTL. -- Decrease time required to shut down mpirun at the end of a job. -- More RMA fixes. -- More hostfile fixes from Tetsuya Mishima. -- Fix darray issue where UB was not computed correctly. -- Fix mpi_f08 parameter name for MPI_GET_LIBRARY_VERSION. Thanks to - Junchao Zhang for pointing out the issue. -- Ensure mpirun aborts properly when unable to map processes in - scheduled environments. -- Ensure that MPI RMA error codes show up properly. Thanks to - Lisandro Dalcín for reporting the issue. -- Minor bug fixes and improvements to the bash and zsh mpirun - autocompletion scripts. -- Fix sequential mpirun process mapper. Thanks to Bill Chen for - reporting the issue. -- Correct SLURM stdout/stderr redirection. -- Added missing portals 4 files. -- Performance improvements for blocking sends and receives. -- Lots of cleanup to the ml collective component -- Added new Java methods to provide full MPI coverage -- Many OSHMEM cleanups -- Prevent comm_spawn from automatically launching a VM across - all available nodes -- Close many memory leaks to achieve valgrind-clean operation -- Better handling of TCP connection discovery for mismatched networks - where we don't have a direct 1:1 subnet match between nodes -- Prevent segfault when OMPI info tools are used in pipes and user - exits one step of that pipe before completing output - - -1.8.1: 23 Apr 2014 ------------------- - -- Fix for critical bug: mpirun removed files (but not directories) - from / when run as root. Thanks to Jay Fenlason and Orion Poplawski - for bringing the issue to our attention and helping identify the - fix. - - -1.8: 31 Mar 2014 ----------------- - -- Commit upstream ROMIO fix for mixed NFS+local filesystem environments. -- Several fixes for MPI-3 one-sided support. For example, - arbitrary-length datatypes are now supported. -- Add config support for the Mellanox ConnectX 4 card. -- Add missing MPI_COMM_GET|SET_INFO functions, and missing - MPI_WEIGHTS_EMPTY and MPI_ERR_RMA_SHARED constants. Thanks to - Lisandro Dalcín for pointing out the issue. -- Update some help messages in OSHMEM, the usnic BTL, the TCP BTL, and - ORTE, and update documentation about ompi_info's --level option. -- Fix some compiler warnings. -- Ensure that ORTE daemons are not bound to a single processor - if TaskAffinity is set on by default in Slurm. Thanks to Artem Polyakov - for identifying the problem and providing a patch - - -1.7.5 20 Mar 2014 ------------------ - - ********************************************************************** - * Open MPI is now fully MPI-3.0 compliant - ********************************************************************** - -- Add Linux OpenSHMEM support built on top of Open MPI's MPI - layer. Thanks to Mellanox for contributing this new feature. -- Allow restricting ORTE daemons to specific cores using the - orte_daemon_cores MCA param. -- Ensure to properly set "locality" flags for processes launched via - MPI dynamic functions such as MPI_COMM_SPAWN. -- Fix MPI_GRAPH_CREATE when nnodes is smaller than the size of the old - communicator. -- usnic BTL now supports underlying UDP transport. -- usnic BTL now checks for common connectivty errors at first send to - a remote server. -- Minor scalability improvements in the usnic BTL. -- ompi_info now lists whether the Java MPI bindings are available or not. -- MPI-3: mpi.h and the Fortran interfaces now report MPI_VERSION==3 - and MPI_SUBVERSION==0. -- MPI-3: Added support for new RMA functions and functionality. -- Fix MPI_Info "const buglet. Thanks to Orion Poplawski for - identifying the issue. -- Multiple fixes to mapping/binding options. Thanks to Tetsuya Mishima - for his assistance. -- Multiple fixes for normal and abnormal process termination, - including singleton MPI_Abort and ensuring to kill entire process - groups when abnormally terminating a job. -- Fix DESTDIR install for javadocs. Thanks to Orion Poplawski for - pointing out the issue. -- Various performance improvements for the MPI Java bindings. -- OMPI now uses its own internal random number generator and will not - perturb srand() and friends. -- Some cleanups for Cygwin builds. Thanks to Marco Atzeri for the - patches. -- Add a new collective component (coll/ml) that provides substantially - improved performance. It is still experimental, and requires - setting coll_ml_priority > 0 to become active. -- Add version check during startup to ensure you are using the same - version of Open MPI on all nodes in a job. -- Significantly improved the performance of MPI_DIMS_CREATE for large - values. Thanks to Andreas Schäfer for the contribution. -- Removed ASYNCHRONOUS keyword from the "ignore TKR" mpi_f08 module. -- Deprecated the following mpirun options: - --bynode, --bycore, --byslot: replaced with --map-by node|core|slot. - --npernode, --npersocket: replaced with --map-by ppr:N:node and - --map-by ppr:N:socket, respectively -- Pick NFS "infinitely stale" fix from ROMIO upstream. -- Various PMI2 fixes and extension to support broader range of mappings. -- Improve launch performance at large scale. -- Add support for PBS/Torque environments that set environment - variables to indicate the number of slots available on each nodes. - Set the ras_tm_smp MCA parameter to "1" to enable this mode. -- Add new, more scalable endpoint exchange (commonly called "modex") - method that only exchanges endpoint data on a per-peer basis - on first message. Not all transports have been updated to use - this feature. Set the rte_orte_direct_modex parameter to "1" - to enable this mode. - - -1.7.4: 5 Feb 2014 ------------------ - - ********************************************************************** - * CRITICAL CHANGE - * - * As of release 1.7.4, OpenMPI's default mapping, ranking, and binding - * settings have changed: - * - * Mapping: - * if #procs <= 2, default to map-by core - * if #procs > 2, default to map-by socket - * Ranking: - * if default mapping is used, then default to rank-by slot - * if map-by is given, then default to rank-by , - * where is whatever object we mapped against - * Binding: - * default to bind-to core - * - * Users can override any of these settings individually using the - * corresponding MCA parameter. Note that multi-threaded applications - * in particular may want to override at least the binding default - * to allow threads to use multiple cores. - ********************************************************************** - -- Restore version number output in "ompi_info --all". -- Various bug fixes for the mpi_f08 Fortran bindings. -- Fix ROMIO compile error with Lustre 2.4. Thanks to Adam Moody for - reporting the issue. -- Various fixes for 32 bit platforms. -- Add ability to selectively disable building the mpi or mpi_f08 - module. See the README file for details. -- Fix MX MTL finalization issue. -- Fix ROMIO issue when opening a file with MPI_MODE_EXCL. -- Fix PowerPC and MIPS assembly issues. -- Various fixes to the hcoll and FCA collective offload modules. -- Prevent integer overflow when creating datatypes. Thanks to - original patch from Gilles Gouaillardet. -- Port some upstream hwloc fixes to Open MPI's embedded copy for - working around buggy NUMA node cpusets and including mising header - files. Thanks to Jeff Becker and Paul Hargrove for reporting the - issues. -- Fix recursive invocation issues in the MXM MTL. -- Various bug fixes to the new MCA parameter back-end system. -- Have the posix fbtl module link against -laio on NetBSD platforms. - Thanks to Paul Hargrove for noticing the issue. -- Various updates and fixes to network filesystem detection to support - more operating systems. -- Add gfortran v4.9 "ignore TKR" syntax to the mpi Fortran module. -- Various compiler fixes for several BSD-based platforms. Thanks to - Paul Hargrove for reporting the issues. -- Fix when MPI_COMM_SPAWN[_MULTIPLE] is used on oversubscribed - systems. -- Change the output from --report bindings to simply state that a - process is not bound, instead of reporting that it is bound to all - processors. -- Per MPI-3.0 guidance, remove support for all MPI subroutines with - choice buffers from the TKR-based mpi Fortran module. Thanks to Jed - Brown for raising the issue. -- Only allow the usnic BTL to build on 64 bit platforms. -- Various bug fixes to SLURM support, to include ensuring proper - exiting on abnormal termination. -- Ensure that MPI_COMM_SPAWN[_MULTIPLE] jobs get the same mapping - directives that were used with mpirun. -- Fixed the application of TCP_NODELAY. -- Change the TCP BTL to not warn if a non-existent interface is - ignored. -- Restored the "--bycore" mpirun option for backwards compatibility. -- Fixed debugger attach functionality. Thanks to Ashley Pittman for - reporting the issue and suggesting the fix. -- Fixed faulty MPI_IBCAST when invoked on a communicator with only - one process. -- Add new Mellanox device IDs to the openib BTL. -- Progress towards cleaning up various internal memory leaks as - reported by Valgrind. -- Fixed some annoying flex-generated warnings that have been there for - years. Thanks to Tom Fogal for the initial patch. -- Support user-provided environment variables via the "env" info key - to MPI_COMM_SPAWN[_MULTIPLE]. Thanks to Tom Fogal for the feature - request. -- Fix uninitialized variable in MPI_DIST_GRAPH_CREATE. -- Fix a variety of memory errors on SPARC platforms. Thanks to - Siegmar Gross for reporting and testing all the issues. -- Remove Solaris threads support. When building on Solaris, pthreads - will be used. -- Correctly handle the convertor internal stack for persistent - receives. Thanks to Guillaume Gouaillardet for identifying the - problem. -- Add support for using an external libevent via --with-libevent. See - the README for more details. -- Various OMPIO updates and fixes. -- Add support for the MPIEXEC_TIMEOUT environment variable. If set, - mpirun will terminate the job after this many seconds. -- Update the internal copy of ROMIO to that which shipped in MPICH - 3.0.4. -- Various performance tweaks and improvements in the usnic BTL, - including now reporting MPI_T performance variables for each usnic - device. -- Fix to not access send datatypes for non-root processes with - MPI_ISCATTER[V] and MPI_IGATHER[V]. Thanks to Pierre Jolivet for - supplying the initial patch. -- Update VampirTrace to 5.14.4.9. -- Fix ptmalloc2 hook disable when used with ummunotify. -- Change the default connection manager for the openib BTL to be based - on UD verbs data exchanges instead of ORTE OOB data exchanges. -- Fix Fortran compile error when compiling with 8-byte INTEGERs and - 4-byte ints. -- Fix C++11 issue identified by Jeremiah Willcock. -- Many changes, updates, and bug fixes to the ORTE run-time layer. -- Correctly handle MPI_REDUCE_SCATTER with recvcounts of 0. -- Update man pages for MPI-3, and add some missing man pages for - MPI-2.x functions. -- Updated mpi_f08 module in accordance with post-MPI-3.0 errata which - basically removed BIND(C) from all interfaces. -- Fixed MPI_IN_PLACE detection for MPI_SCATTER[V] in Fortran - routines. Thanks to Charles Gerlach for identifying the issue. -- Added support for routable RoCE to the openib BTL. -- Update embedded hwloc to v1.7.2. -- ErrMgr framework redesigned to better support fault tolerance development - activities. See the following RFC for details: - https://www.open-mpi.org/community/lists/devel/2010/03/7589.php -- Added database framework to OPAL and changed all modex operations - to flow thru it, also included additional system info in the - available data -- Added staged state machine to support sequential work flows -- Added distributed file system support for accessing files across - nodes that do not have networked file systems -- Extended filem framework to support scalable pre-positioning of - files for use by applications, adding new "raw" component that - transmits files across the daemon network -- Native Windows support has been removed. A cygwin package is - available from that group for Windows-based use. -- Added new MPI Java bindings. See the Javadocs for more details on - the API. -- Wrapper compilers now add rpath support by default to generated - executables on systems that support it. This behavior can be - disabled via --disable-wrapper-rpath. See note in README about ABI - issues when using rpath in MPI applications. -- Added a new parallel I/O component and multiple new frameworks to - support parallel I/O operations. -- Fixed MPI_STATUS_SIZE Fortran issue when used with 8-byte Fortran - INTEGERs and 4-byte C ints. Since this issue affects ABI, it is - only enabled if Open MPI is configured with - --enable-abi-breaking-fortran-status-i8-fix. Thanks to Jim Parker - for supplying the initial patch. -- Add support for Intel Phi SCIF transport. -- For CUDA-aware MPI configured with CUDA 6.0, use new pointer - attribute to avoid extra synchronization in stream 0 when using - CUDA IPC between GPUs on the same node. -- For CUDA-aware MPI configured with CUDA 6.0, compile in support - of GPU Direct RDMA in openib BTL to improve small message latency. -- Updated ROMIO from MPICH v3.0.4. -- MPI-3: Added support for remaining non-blocking collectives. -- MPI-3: Added support for neighborhood collectives. -- MPI-3: Updated C bindings with consistent use of []. -- MPI-3: Added the const keyword to read-only buffers. -- MPI-3: Added support for non-blocking communicator duplication. -- MPI-3: Added support for non-collective communicator creation. - - -1.7.3: 17 Oct 2013 ------------------- - -- Make CUDA-aware support dynamically load libcuda.so so CUDA-aware - MPI library can run on systems without CUDA software. -- Fix various issues with dynamic processes and intercommunicator - operations under Torque. Thanks to Suraj Prabhakaran for reporting - the problem. -- Enable support for the Mellanox MXM2 library by default. -- Improve support for Portals 4. -- Various Solaris fixes. Many thanks to Siegmar Gross for his - incredible patience in reporting all the issues. -- MPI-2.2: Add reduction support for MPI_C_*COMPLEX and MPI::*COMPLEX. -- Fixed internal accounting when openpty() fails. Thanks to Michal - Peclo for reporting the issue and providing a patch. -- Fixed too-large memory consumption in XRC mode of the openib BTL. - Thanks to Alexey Ryzhikh for the patch. -- Add bozo check for negative np values to mpirun to prevent a - deadlock. Thanks to Upinder Malhi for identifying the issue. -- Fixed MPI_IS_THREAD_MAIN behavior. Thanks to Lisandro Dalcín for - pointing out the problem. -- Various rankfile fixes. -- Fix functionality over iWARP devices. -- Various memory and performance optimizations and tweaks. -- Fix MPI_Cancel issue identified by Fujitsu. -- Add missing support for MPI_Get_address in the "use mpi" TKR - implementation. Thanks to Hugo Gagnon for identifying the issue. -- MPI-3: Add support for MPI_Count. -- MPI-2.2: Add missing MPI_IN_PLACE support for MPI_ALLTOALL. -- Added new usnic BTL to support the Cisco usNIC device. -- Minor VampirTrace update to 5.14.4.4. -- Removed support for ancient OS X systems (i.e., prior to 10.5). -- Fixed obscure packing/unpacking datatype bug. Thanks to Takahiro - Kawashima for identifying the issue. -- Add run-time support for PMI2 environments. -- Update openib BTL default parameters to include support for Mellanox - ConnectX3-Pro devices. -- Update libevent to v2.0.21. -- "ompi_info --param TYPE PLUGIN" now only shows a small number of MCA - parameters by default. Add "--level 9" or "--all" to see *all* MCA - parameters. See README for more details. -- Add support for asynchronous CUDA-aware copies. -- Add support for Mellanox MPI collective operation offload via the - "hcoll" library. -- MPI-3: Add support for the MPI_T interface. Open MPI's MCA - parameters are now accessible via the MPI_T control variable - interface. Support has been added for a small number of MPI_T - performance variables. -- Add Gentoo memory hooks override. Thanks to Justin Bronder for the - patch. -- Added new "mindist" process mapper, allowing placement of processes - via PCI locality information reported by the BIOS. -- MPI-2.2: Add support for MPI_Dist_graph functionality. -- Enable generic, client-side support for PMI2 implementations. Can - be leveraged by any resource manager that implements PMI2; e.g. SLURM, - versions 2.6 and higher. - -1.7.2: 26 Jun 2013 ------------------- - -- Major VampirTrace update to 5.14.4.2. - (** also appeared: 1.6.5) -- Fix to set flag==1 when MPI_IPROBE is called with MPI_PROC_NULL. - (** also appeared: 1.6.5) -- Set the Intel Phi device to be ignored by default by the openib BTL. - (** also appeared: 1.6.5) -- Decrease the internal memory storage used by intrinsic MPI datatypes - for Fortran types. Thanks to Takahiro Kawashima for the initial - patch. - (** also appeared: 1.6.5) -- Fix total registered memory calculation for Mellanox ConnectIB and - OFED 2.0. - (** also appeared: 1.6.5) -- Fix possible data corruption in the MXM MTL component. - (** also appeared: 1.6.5) -- Remove extraneous -L from hwloc's embedding. Thanks to Stefan - Friedel for reporting the issue. - (** also appeared: 1.6.5) -- Fix contiguous datatype memory check. Thanks to Eric Chamberland - for reporting the issue. - (** also appeared: 1.6.5) -- Make the openib BTL more friendly to ignoring verbs devices that are - not RC-capable. - (** also appeared: 1.6.5) -- Fix some MPI datatype engine issues. Thanks to Thomas Jahns for - reporting the issue. - (** also appeared: 1.6.5) -- Add INI information for Chelsio T5 device. - (** also appeared: 1.6.5) -- Integrate MXM STREAM support for MPI_ISEND and MPI_IRECV, and other - minor MXM fixes. - (** also appeared: 1.6.5) -- Fix to not show amorphous "MPI was already finalized" error when - failing to MPI_File_close an open file. Thanks to Brian Smith for - reporting the issue. - (** also appeared: 1.6.5) -- Add a distance-based mapping component to find the socket "closest" - to the PCI bus. -- Fix an error that caused epoll to automatically be disabled - in libevent. -- Upgrade hwloc to 1.5.2. -- *Really* fixed XRC compile issue in Open Fabrics support. -- Fix MXM connection establishment flow. -- Fixed parallel debugger ability to attach to MPI jobs. -- Fixed some minor memory leaks. -- Fixed datatype corruption issue when combining datatypes of specific - formats. -- Added Location Aware Mapping Algorithm (LAMA) mapping component. -- Fixes for MPI_STATUS handling in corner cases. -- Add a distance-based mapping component to find the socket "closest" - to the PCI bus. - - -1.7.1: 16 Apr 2013 ------------------- - -- Fixed compile error when --without-memory-manager was specified - on Linux -- Fixed XRC compile issue in Open Fabrics support. - - -1.7: 1 Apr 2013 ---------------- - -- Added MPI-3 functionality: - - MPI_GET_LIBRARY_VERSION - - Matched probe - - MPI_TYPE_CREATE_HINDEXED_BLOCK - - Non-blocking collectives - - MPI_INFO_ENV support - - Fortran '08 bindings (see below) -- Dropped support for checkpoint/restart due to loss of maintainer :-( -- Enabled compile-time warning of deprecated MPI functions by default - (in supported compilers). -- Revamped Fortran MPI bindings (see the README for details): - - "mpifort" is now the preferred wrapper compiler for Fortran - - Added "use mpi_f08" bindings (for compilers that support it) - - Added better "use mpi" support (for compilers that support it) - - Removed incorrect MPI_SCATTERV interface from "mpi" module that - was added in the 1.5.x series for ABI reasons. -- Lots of VampirTrace upgrades and fixes; upgrade to v5.14.3. -- Modified process affinity system to provide warning when bindings - result in being "bound to all", which is equivalent to not being - bound. -- Removed maffinity, paffinity, and carto frameworks (and associated - MCA params). -- Upgraded to hwloc v1.5.1. -- Added performance improvements to the OpenIB (OpenFabrics) BTL. -- Made malloc hooks more friendly to IO interprosers. Thanks to the - bug report and suggested fix from Darshan maintainer Phil Carns. -- Added support for the DMTCP checkpoint/restart system. -- Added support for the Cray uGNI interconnect. -- Fixed header file problems on OpenBSD. -- Fixed issue with MPI_TYPE_CREATE_F90_REAL. -- Wrapper compilers now explicitly list/link all Open MPI libraries if - they detect static linking CLI arguments. -- Open MPI now requires a C99 compiler to build. Please upgrade your - C compiler if you do not have a C99-compliant compiler. -- Fix MPI_GET_PROCESSOR_NAME Fortran binding to set ierr properly. - Thanks to LANL for spotting the error. -- Many MXM and FCA updates. -- Fixed erroneous free of putenv'ed string that showed up in Valgrind - reports. -- Fixed MPI_IN_PLACE case for MPI_ALLGATHER. -- Fixed a bug that prevented MCA params from being forwarded to - daemons upon launch. -- Fixed issues with VT and CUDA --with-cuda[-libdir] configuration CLI - parameters. -- Entirely new implementation of many MPI collective routines focused - on better performance. -- Revamped autogen / build system. -- Add new sensor framework to ORTE that includes modules for detecting - stalled applications and processes that consume too much memory. -- Added new state machine framework to ORTE that converts ORTE into an - event-driven state machine using the event library. -- Added a new MCA parameter (ess_base_stream_buffering) that allows the user - to override the system default for buffering of stdout/stderr streams - (via setvbuf). Parameter is not visible via ompi_info. -- Revamped the launch system to allow consideration of node hardware - in assigning process locations and bindings. -- Added the -novm option to preserve the prior launch behavior. -- Revamped the process mapping system to utilize node hardware by adding - new map-by, rank-by, and bind-to cmd line options. -- Added new MCA parameter to provide protection against IO forwarding - backlog. -- Dropped support for native Windows due to loss of maintainers. :-( -- Added a new parallel I/O component and multiple new frameworks to - support parallel I/O operations. -- Fix typo in orte_setup_hadoop.m4. Thanks to Aleksej Saushev for - reporting it -- Fix a very old error in opal_path_access(). Thanks to Marco Atzeri - for chasing it down. - - -1.6.6: Not released -------------------- - -- Prevent integer overflow in datatype creation. Thanks to Gilles - Gouaillardet for identifying the problem and providing a preliminary - version of the patch. -- Ensure help-opal-hwloc-base.txt is included in distribution - tarballs. Thanks to Gilles Gouaillardet for supplying the patch. -- Correctly handle the invalid status for NULL and inactive requests. - Thanks to KAWASHIMA Takahiro for submitting the initial patch. -- Fixed MPI_STATUS_SIZE Fortran issue when used with 8-byte Fortran - INTEGERs and 4-byte C ints. Since this issue affects ABI, it is - only enabled if Open MPI is configured with - --enable-abi-breaking-fortran-status-i8-fix. Thanks to Jim Parker - for supplying the initial patch. -- Fix datatype issue for sending from the middle of non-contiguous - data. -- Fixed failure error with pty support. Thanks to Michal Pecio for - the patch. -- Fixed debugger support for direct-launched jobs. -- Fix MPI_IS_THREAD_MAIN to return the correct value. Thanks to - Lisandro Dalcín for pointing out the issue. -- Update VT to 5.14.4.4: - - Fix C++-11 issue. - - Fix support for building RPMs on Fedora with CUDA libraries. -- Add openib part number for ConnectX3-Pro HCA. -- Ensure to check that all resolved IP addresses are local. -- Fix MPI_COMM_SPAWN via rsh when mpirun is on a different server. -- Add Gentoo "sandbox" memory hooks override. - - -1.6.5: 26 Jun 2013 ------------------- - -- Updated default SRQ parameters for the openib BTL. - (** also to appear: 1.7.2) -- Major VampirTrace update to 5.14.4.2. - (** also to appear: 1.7.2) -- Fix to set flag==1 when MPI_IPROBE is called with MPI_PROC_NULL. - (** also to appear: 1.7.2) -- Set the Intel Phi device to be ignored by default by the openib BTL. - (** also to appear: 1.7.2) -- Decrease the internal memory storage used by intrinsic MPI datatypes - for Fortran types. Thanks to Takahiro Kawashima for the initial - patch. - (** also to appear: 1.7.2) -- Fix total registered memory calculation for Mellanox ConnectIB and - OFED 2.0. - (** also to appear: 1.7.2) -- Fix possible data corruption in the MXM MTL component. - (** also to appear: 1.7.2) -- Remove extraneous -L from hwloc's embedding. Thanks to Stefan - Friedel for reporting the issue. - (** also to appear: 1.7.2) -- Fix contiguous datatype memory check. Thanks to Eric Chamberland - for reporting the issue. - (** also to appear: 1.7.2) -- Make the openib BTL more friendly to ignoring verbs devices that are - not RC-capable. - (** also to appear: 1.7.2) -- Fix some MPI datatype engine issues. Thanks to Thomas Jahns for - reporting the issue. - (** also to appear: 1.7.2) -- Add INI information for Chelsio T5 device. - (** also to appear: 1.7.2) -- Integrate MXM STREAM support for MPI_ISEND and MPI_IRECV, and other - minor MXM fixes. - (** also to appear: 1.7.2) -- Improved alignment for OpenFabrics buffers. -- Fix to not show amorphous "MPI was already finalized" error when - failing to MPI_File_close an open file. Thanks to Brian Smith for - reporting the issue. - (** also to appear: 1.7.2) - - -1.6.4: 21 Feb 2013 ------------------- - -- Fix Cygwin shared memory and debugger plugin support. Thanks to - Marco Atzeri for reporting the issue and providing initial patches. -- Fix to obtaining the correct available nodes when a rankfile is - providing the allocation. Thanks to Siegmar Gross for reporting the - problem. -- Fix process binding issue on Solaris. Thanks to Siegmar Gross for - reporting the problem. -- Updates for MXM 2.0. -- Major VT update to 5.14.2.3. -- Fixed F77 constants for Cygwin/Cmake build. -- Fix a linker error when configuring --without-hwloc. -- Automatically provide compiler flags that compile properly on some - types of ARM systems. -- Fix slot_list behavior when multiple sockets are specified. Thanks - to Siegmar Gross for reporting the problem. -- Fixed memory leak in one-sided operations. Thanks to Victor - Vysotskiy for letting us know about this one. -- Added performance improvements to the OpenIB (OpenFabrics) BTL. -- Improved error message when process affinity fails. -- Fixed MPI_MINLOC on man pages for MPI_REDUCE(_LOCAL). Thanks to Jed - Brown for noticing the problem and supplying a fix. -- Made malloc hooks more friendly to IO interprosers. Thanks to the - bug report and suggested fix from Darshan maintainer Phil Carns. -- Restored ability to direct launch under SLURM without PMI support. -- Fixed MPI datatype issues on OpenBSD. -- Major VT update to 5.14.2.3. -- Support FCA v3.0+. -- Fixed header file problems on OpenBSD. -- Fixed issue with MPI_TYPE_CREATE_F90_REAL. -- Fix an issue with using external libltdl installations. Thanks to - opolawski for identifying the problem. -- Fixed MPI_IN_PLACE case for MPI_ALLGATHER for FCA. -- Allow SLURM PMI support to look in lib64 directories. Thanks to - Guillaume Papaure for the patch. -- Restore "use mpi" ABI compatibility with the rest of the 1.5/1.6 - series (except for v1.6.3, where it was accidentally broken). -- Fix a very old error in opal_path_access(). Thanks to Marco Atzeri - for chasing it down. - - -1.6.3: 30 Oct 2012 ------------------- - -- Fix mpirun --launch-agent behavior when a prefix is specified. - Thanks to Reuti for identifying the issue. -- Fixed memchecker configury. -- Brought over some compiler warning squashes from the development trunk. -- Fix spawning from a singleton to multiple hosts when the "add-host" - MPI_Info key is used. Thanks to Brian Budge for pointing out the - problem. -- Add Mellanox ConnextIB IDs and max inline value. -- Fix rankfile when no -np is given. -- FreeBSD detection improvement. Thanks to Brooks Davis for the - patch. -- Removed TCP warnings on Windows. -- Improved collective algorithm selection for very large messages. -- Fix PSM MTL affinity settings. -- Fix issue with MPI_OP_COMMUTATIVE in the mpif.h bindings. Thanks to - Åke Sandgren for providing a patch to fix the issue. -- Fix issue with MPI_SIZEOF when using CHARACTER and LOGICAL types in - the mpi module. Thanks to Åke Sandgren for providing a patch to fix - the issue. - - -1.6.2: 25 Sep 2012 ------------------- - -- Fix issue with MX MTL. Thanks to Doug Eadline for raising the issue. -- Fix singleton MPI_COMM_SPAWN when the result job spans multiple nodes. -- Fix MXM hang, and update for latest version of MXM. -- Update to support Mellanox FCA 2.5. -- Fix startup hang for large jobs. -- Ensure MPI_TESTANY / MPI_WAITANY properly set the empty status when - count==0. -- Fix MPI_CART_SUB behavior of not copying periods to the new - communicator properly. Thanks to John Craske for the bug report. -- Add btl_openib_abort_not_enough_reg_mem MCA parameter to cause Open - MPI to abort MPI jobs if there is not enough registered memory - available on the system (vs. just printing a warning). Thanks to - Brock Palen for raising the issue. -- Minor fix to Fortran MPI_INFO_GET: only copy a value back to the - user's buffer if the flag is .TRUE. -- Fix VampirTrace compilation issue with the PGI compiler suite. - - -1.6.1: 22 Aug 2012 ------------------- - -- A bunch of changes to eliminate hangs on OpenFabrics-based networks. - Users with Mellanox hardware are ***STRONGLY ENCOURAGED*** to check - their registered memory kernel module settings to ensure that the OS - will allow registering more than 8GB of memory. See this FAQ item - for details: - - https://www.open-mpi.org/faq/?category=openfabrics#ib-low-reg-mem - - - Fall back to send/receive semantics if registered memory is - unavilable for RDMA. - - Fix two fragment leaks when registered memory is exhausted. - - Hueristically determine how much registered memory is available - and warn if it's significantly less than all of RAM. - - Artifically limit the amount of registered memory each MPI process - can use to about 1/Nth to total registered memory available. - - Improve error messages when events occur that are likely due to - unexpected registered memory exhaustion. - -- Fix double semicolon error in the C++ in . Thanks to John - Foster for pointing out the issue. -- Allow -Xclang to be specified multiple times in CFLAGS. Thanks to - P. Martin for raising the issue. -- Break up a giant "print *" statement in the ABI-preserving incorrect - MPI_SCATTER interface in the "large" Fortran "mpi" module. Thanks - to Juan Escobar for the initial patch. -- Switch the MPI_ALLTOALLV default algorithm to a pairwise exchange. -- Increase the openib BTL default CQ length to handle more types of - OpenFabrics devices. -- Lots of VampirTrace fixes; upgrade to v5.13.0.4. -- Map MPI_2INTEGER to underlying MPI_INTEGERs, not MPI_INTs. -- Ensure that the OMPI version number is toleant of handling spaces. - Thanks to dragonboy for identifying the issue. -- Fixed IN parameter marking on Fortran "mpi" module - MPI_COMM_TEST_INTER interface. -- Various MXM improvements. -- Make the output of "mpirun --report-bindings" much more friendly / - human-readable. -- Properly handle MPI_COMPLEX8|16|32. -- More fixes for mpirun's processor affinity options (--bind-to-core - and friends). -- Use aligned memory for OpenFabrics registered memory. -- Multiple fixes for parameter checking in MPI_ALLGATHERV, - MPI_REDUCE_SCATTER, MPI_SCATTERV, and MPI_GATHERV. Thanks to the - mpi4py community (Bennet Fauber, Lisandro Dalcín, Jonathan Dursi). -- Fixed file positioning overflows in MPI_FILE_GET_POSITION, - MPI_FILE_GET_POSITION_SHARED, FILE_GET_SIZE, FILE_GET_VIEW. -- Removed the broken --cpu-set mpirun option. -- Fix cleanup of MPI errorcodes. Thanks to Alexey Bayduraev for the - patch. -- Fix default hostfile location. Thanks to Götz Waschk for noticing - the issue. -- Improve several error messages. - - -1.6: 14 May 2012 ----------------- - -- Fix some process affinity issues. When binding a process, Open MPI - will now bind to all available hyperthreads in a core (or socket, - depending on the binding options specified). - --> Note that "mpirun --bind-to-socket ..." does not work on POWER6- - and POWER7-based systems with some Linux kernel versions. See - the FAQ on the Open MPI web site for more information. -- Add support for ARM5 and ARM6 (in addition to the existing ARM7 - support). Thanks to Evan Clinton for the patch. -- Minor Mellanox MXM fixes. -- Properly detect FDR10, FDR, and EDR OpenFabrics devices. -- Minor fixes to the mpirun(1) and MPI_Comm_create(3) man pages. -- Prevent segv if COMM_SPAWN_MULTIPLE fails. Thanks to Fujitsu for - the patch. -- Disable interposed memory management in fakeroot environments. This - fixes a problem in some build environments. -- Minor hwloc updates. -- Array versions of MPI_TEST and MPI_WAIT with a count==0 will now - return immediately with MPI_SUCCESS. Thanks to Jeremiah Willcock - for the suggestion. -- Update VampirTrace to v5.12.2. -- Properly handle forwarding stdin to all processes when "mpirun - --stdin all" is used. -- Workaround XLC assembly bug. -- OS X Tiger (10.4) has not been supported for a while, so forcibly - abort configure if we detect it. -- Fix segv in the openib BTL when running on SPARC 64 systems. -- Fix some include file ordering issues on some BSD-based platforms. - Thanks to Paul Hargove for this (and many, many other) fixes. -- Properly handle .FALSE. return parameter value to attribute copy - callback functions. -- Fix a bunch of minor C++ API issues; thanks to Fujitsu for the patch. -- Fixed the default hostfile MCA parameter behavior. -- Per the MPI spec, ensure not to touch the port_name parameter to - MPI_CLOSE_PORT (it's an IN parameter). - - -1.5.5: 27 Mar 2012 ------------------- - -- Many, many portability configure/build fixes courtesy of Paul - Hargrove. Thanks, Paul! -- Fixed shared memory fault tolerance support compiler errors. -- Removed not-production-quality rshd and tmd PLM launchers. -- Minor updates to the Open MPI SRPM spec file. -- Fixed mpirun's --bind-to-socket option. -- A few MPI_THREAD_MULTIPLE fixes in the shared memory BTL. -- Upgrade the GNU Autotools used to bootstrap the 1.5/1.6 series to - all the latest versions at the time of this release. -- Categorically state in the README that if you're having a problem - with Open MPI with the Linux Intel 12.1 compilers, *upgrade your - Intel Compiler Suite to the latest patch version*, and the problems - will go away. :-) -- Fix the --without-memory-manager configure option. -- Fixes for Totalview/DDT MPI-capable debuggers. -- Update rsh/ssh support to properly handle the Mac OS X library path - (i.e., DYLD_LIBRARY_PATH). -- Make warning about shared memory backing files on a networked file - system be optional (i.e., can be disabled via MCA parameter). -- Several fixes to processor and memory affinity. -- Various shared memory infrastructure improvements. -- Various checkpoint/restart fixes. -- Fix MPI_IN_PLACE (and other MPI sentinel values) on OS X. Thanks to - Dave Goodell for providing the magic OS X gcc linker flags necessary. -- Various man page corrections and typo fixes. Thanks to Fujitsu for - the patch. -- Updated wrapper compiler man pages to list the various --showme - options that are available. -- Add PMI direct-launch support (e.g., "srun mpi_application" under - SLURM). -- Correctly compute the aligned address when packing the - datatype description. Thanks to Fujitsu for the patch. -- Fix MPI obscure corner case handling in packing MPI datatypes. - Thanks to Fujitsu for providing the patch. -- Workaround an Intel compiler v12.1.0 2011.6.233 vector optimization - bug. -- Output the MPI API in ompi_info output. -- Major VT update to 5.12.1.4. -- Upgrade embedded Hardware Locality (hwloc) v1.3.2, plus some - post-1.3.2-release bug fixes. All processor and memory binding is - now done through hwloc. Woo hoo! Note that this fixes core binding - on AMD Opteron 6200 and 4200 series-based systems (sometimes known - as Interlagos, Valencia, or other Bulldozer-based chips). -- New MCA parameters to control process-wide memory binding policy: - hwloc_base_mem_alloc_policy, hwloc_base_mem_bind_failure_action (see - ompi_info --param hwloc base). -- Removed direct support for libnuma. Libnuma support may now be - picked up through hwloc. -- Added MPI_IN_PLACE support to MPI_EXSCAN. -- Various fixes for building on Windows, including MinGW support. -- Removed support for the OpenFabrics IBCM connection manager. -- Updated Chelsio T4 and Intel NE OpenFabrics default buffer settings. -- Increased the default RDMA CM timeout to 30 seconds. -- Issue a warning if both btl_tcp_if_include and btl_tcp_if_exclude - are specified. -- Many fixes to the Mellanox MXM transport. - - -1.5.4: 18 Aug 2011 ------------------- - -- Add support for the (as yet unreleased) Mellanox MXM transport. -- Add support for dynamic service levels (SLs) in the openib BTL. -- Fixed C++ bindings cosmetic/warnings issue with - MPI::Comm::NULL_COPY_FN and MPI::Comm::NULL_DELETE_FN. Thanks to - Júlio Hoffimann for identifying the issues. -- Also allow the word "slots" in rankfiles (i.e., not just "slot"). - (** also to appear in 1.4.4) -- Add Mellanox ConnectX 3 device IDs to the openib BTL defaults. - (** also to appear in 1.4.4) -- Various FCA updates. -- Fix 32 bit SIGBUS errors on Solaris SPARC platforms. -- Add missing ARM assembly code files. -- Update to allow more than 128 entries in an appfile. - (** also to appear in 1.4.4) -- Various VT updates and bug fixes. -- Update description of btl_openib_cq_size to be more accurate. - (** also to appear in 1.4.4) -- Various assembly "clobber" fixes. -- Fix a hang in carto selection in obscure situations. -- Guard the inclusion of execinfo.h since not all platforms have it. Thanks - to Aleksej Saushev for identifying this issue. - (** also to appear in 1.4.4) -- Support Solaris legacy munmap prototype changes. - (** also to appear in 1.4.4) -- Updated to Automake 1.11.1 per - https://www.open-mpi.org/community/lists/devel/2011/07/9492.php. -- Fix compilation of LSF support. -- Update MPI_Comm_spawn_multiple.3 man page to reflect what it - actually does. -- Fix for possible corruption of the environment. Thanks to Peter - Thompson for the suggestion. (** also to appear in 1.4.4) -- Enable use of PSM on direct-launch SLURM jobs. -- Update paffinity hwloc to v1.2, and to fix minor bugs affinity - assignment bugs on PPC64/Linux platforms. -- Let the openib BTL auto-detect its bandwidth. -- Support new MPI-2.2 datatypes. -- Updates to support more datatypes in MPI one-sided communication. -- Fix recursive locking bug when MPI-IO was used with - MPI_THREAD_MULTIPLE. (** also to appear in 1.4.4) -- Fix mpirun handling of prefix conflicts. -- Ensure mpirun's --xterm options leaves sessions attached. - (** also to appear in 1.4.4) -- Fixed type of sendcounts and displs in the "use mpi" F90 module. - ABI is preserved, but applications may well be broken. See the - README for more details. Thanks to Stanislav Sazykin for - identifying the issue. (** also to appear in 1.4.4) -- Fix indexed datatype leaks. Thanks to Pascal Deveze for supplying - the initial patch. (** also to appear in 1.4.4) -- Fix debugger mapping when mpirun's -npernode option is used. -- Fixed support for configure's --disable-dlopen option when used with - "make distclean". -- Fix segv associated with MPI_Comm_create with MPI_GROUP_EMPTY. - Thanks to Dominik Goeddeke for finding this. - (** also to appear in 1.4.4) -- Improved LoadLeveler ORTE support. -- Add new WinVerbs BTL plugin, supporting native OpenFabrics verbs on - Windows (the "wv" BTL). -- Add new btl_openib_gid_index MCA parameter to allow selecting which - GID to use on an OpenFabrics device's GID table. -- Add support for PCI relaxed ordering in the OpenFabrics BTL (when - available). -- Update rsh logic to allow correct SGE operation. -- Ensure that the mca_paffinity_alone MCA parameter only appears once - in the ompi_info output. Thanks to Gus Correa for identifying the - issue. -- Fixed return codes from MPI_PROBE and MPI_IPROBE. - (** also to appear in 1.4.4) -- Remove --enable-progress-thread configure option; it doesn't work on - the v1.5 branch. Rename --enable-mpi-threads to - --enable-mpi-thread-multiple. Add new --enable-opal-multi-threads - option. -- Updates for Intel Fortran compiler version 12. -- Remove bproc support. Farewell bproc! -- If something goes wrong during MPI_INIT, fix the error - message to say that it's illegal to invoke MPI_INIT before - MPI_INIT. - - -1.5.3: 16 Mar 2011 ------------------- - -- Add missing "affinity" MPI extension (i.e., the OMPI_Affinity_str() - API) that was accidentally left out of the 1.5.2 release. - - -1.5.2: 9 Mar 2011 ------------------ - -- Replaced all custom topology / affinity code with initial support - for hwloc v1.1.1 (PLPA has been removed -- long live hwloc!). Note - that hwloc is bundled with Open MPI, but an external hwloc can be - used, if desired. See README for more details. -- Many CMake updates for Windows builds. -- Updated opal_cr_thread_sleep_wait MCA param default value to make it - less aggressive. -- Updated debugger support to allow Totalview attaching from jobs - launched directly via srun (not mpirun). Thanks to Nikolay Piskun - for the patch. -- Added more FTB/CIFTS support. -- Fixed compile error with the PGI compiler. -- Portability fixes to allow the openib BTL to run on the Solaris - verbs stack. -- Fixed multi-token command-line issues when using the mpirun - --debug switch. For example: - mpirun --debug -np 2 a.out "foo bar" - Thanks to Gabriele Fatigati for reporting the issue. -- Added ARM support. -- Added the MPI_ROOT environment variable in the Open MPI Linux SRPM - for customers who use the BPS and LSF batch managers. -- Updated ROMIO from MPICH v1.3.1 (plus one additional patch). -- Fixed some deprecated MPI API function notification messages. -- Added new "bfo" PML that provides failover on OpenFabrics networks. -- Fixed some buffer memcheck issues in MPI_*_init. -- Added Solaris-specific chip detection and performance improvements. -- Fix some compile errors on Solaris. -- Updated the "rmcast" framework with bug fixes, new functionality. -- Updated the Voltaire FCA component with bug fixes, new - functionality. Support for FCA version 2.1. -- Fix gcc 4.4.x and 4.5.x over-aggressive warning notifications on - possibly freeing stack variables. Thanks to the Gentoo packagers - for reporting the issue. -- Make the openib component be verbose when it disqualifies itself due - to MPI_THREAD_MULTIPLE. -- Minor man page fixes. -- Various checkpoint / restart fixes. -- Fix race condition in the one-sided unlock code. Thanks to - Guillaume Thouvenin for finding the issue. -- Improve help message aggregation. -- Add OMPI_Affinity_str() optional user-level API function (i.e., the - "affinity" MPI extension). See README for more details. -- Added btl_tcp_if_seq MCA parameter to select a different ethernet - interface for each MPI process on a node. This parameter is only - useful when used with virtual ethernet interfaces on a single - network card (e.g., when using virtual interfaces give dedicated - hardware resources on the NIC to each process). -- Changed behavior of mpirun to terminate if it receives 10 (or more) - SIGPIPEs. -- Fixed oversubscription detection. -- Added new mtl_mx_board and mtl_mx_endpoint MCA parameters. -- Added ummunotify support for OpenFabrics-based transports. See the - README for more details. - - -1.5.1: 15 Dec 2010 ------------------- - -- Fixes for the Oracle Studio 12.2 Fortran compiler. -- Fix SPARC and SPARCv9 atomics. Thanks to Nicola Stange for the - initial patch. -- Fix Libtool issues with the IBM XL compiler in 64-bit mode. -- Restore the reset of the libevent progress counter to avoid - over-sampling the event library. -- Update memory barrier support. -- Use memmove (instead of memcpy) when necessary (e.g., source and - destination overlap). -- Fixed ompi-top crash. -- Fix to handle Autoconf --program-transforms properly and other - m4/configury updates. Thanks to the GASNet project for the - --program transforms fix. -- Allow hostfiles to specify usernames on a per-host basis. -- Update wrapper compiler scripts to search for perl during configure, - per request from the BSD maintainers. -- Minor man page fixes. -- Added --with-libltdl option to allow building Open MPI with an - external installation of libltdl. -- Fixed various issues with -D_FORTIFY_SOURCE=2. -- Various VT fixes and updates. - - -1.5: 10 Oct 2010 ----------------- - -- Added "knem" support: direct process-to-process copying for shared - memory message passing. See https://runtime.bordeaux.inria.fr/knem/ - and the README file for more details. -- Updated shared library versioning scheme and linking style of MPI - applications. The MPI application ABI has been broken from the - v1.3/v1.4 series. MPI applications compiled against any prior - version of Open MPI will need to, at a minimum, re-link. See the - README file for more details. -- Added "fca" collective component, enabling MPI collective offload - support for Voltaire switches. -- Fixed MPI one-sided operations with large target displacements. - Thanks to Brian Price and Jed Brown for reporting the issue. -- Fixed MPI_GET_COUNT when used with large counts. Thanks to Jed - Brown for reporting the issue. -- Made the openib BTL safer if extremely low SRQ settings are used. -- Fixed handling of the array_of_argv parameter in the Fortran - binding of MPI_COMM_SPAWN_MULTIPLE (** also to appear: 1.4.3). -- Fixed malloc(0) warnings in some collectives. -- Fixed a problem with the Fortran binding for - MPI_FILE_CREATE_ERRHANDLER. Thanks to Secretan Yves for identifying - the issue (** also to appear: 1.4.3). -- Updates to the LSF PLM to ensure that the path is correctly passed. - Thanks to Teng Lin for the patch (** also to appear: 1.4.3). -- Fixes for the F90 MPI_COMM_SET_ERRHANDLER and MPI_WIN_SET_ERRHANDLER - bindings. Thanks to Paul Kapinos for pointing out the issue - (** also to appear: 1.4.3). -- Fixed extra_state parameter types in F90 prototypes for - MPI_COMM_CREATE_KEYVAL, MPI_GREQUEST_START, MPI_REGISTER_DATAREP, - MPI_TYPE_CREATE_KEYVAL, and MPI_WIN_CREATE_KEYVAL. -- Fixes for Solaris oversubscription detection. -- If the PML determines it can't reach a peer process, print a - slightly more helpful message. Thanks to Nick Edmonds for the - suggestion. -- Make btl_openib_if_include/exclude function the same way - btl_tcp_if_include/exclude works (i.e., supplying an _include list - overrides supplying an _exclude list). -- Apply more scalable reachability algorithm on platforms with more - than 8 TCP interfaces. -- Various assembly code updates for more modern platforms / compilers. -- Relax restrictions on using certain kinds of MPI datatypes with - one-sided operations. Users beware; not all MPI datatypes are valid - for use with one-sided operations! -- Improve behavior of MPI_COMM_SPAWN with regards to --bynode. -- Various threading fixes in the openib BTL and other core pieces of - Open MPI. -- Various help file and man pages updates. -- Various FreeBSD and NetBSD updates and fixes. Thanks to Kevin - Buckley and Aleksej Saushev for their work. -- Fix case where freeing communicators in MPI_FINALIZE could cause - process failures. -- Print warnings if shared memory state files are opened on what look - like networked filesystems. -- Update libevent to v1.4.13. -- Allow propagating signals to processes that call fork(). -- Fix bug where MPI_GATHER was sometimes incorrectly examining the - datatype on non-root processes. Thanks to Michael Hofmann for - investigating the issue. -- Various Microsoft Windows fixes. -- Various Catamount fixes. -- Various checkpoint / restart fixes. -- Xgrid support has been removed until it can be fixed (patches - would be welcome). -- Added simplistic "libompitrace" contrib package. Using the MPI - profiling interface, it essentially prints out to stderr when select - MPI functions are invoked. -- Update bundled VampirTrace to v5.8.2. -- Add pkg-config(1) configuration files for ompi, ompi-c, ompi-cxx, - ompi-f77, ompi-f90. See the README for more details. -- Removed the libopenmpi_malloc library (added in the v1.3 series) - since it is no longer necessary -- Add several notifier plugins (generally used when Open MPI detects - system/network administrator-worthy problems); each have their own - MCA parameters to govern their usage. See "ompi_info --param - notifier " for more details. - - command to execute arbitrary commands (e.g., run a script). - - file to send output to a file. - - ftb to send output to the Fault Tolerant Backplane (see - https://wiki.mcs.anl.gov/cifts/index.php/CIFTS) - - hnp to send the output to mpirun. - - smtp (requires libesmtp) to send an email. - -1.4.5: 12 Feb 2012 ------------------- - -- Fixed the --disable-memory-manager configure switch. - (** also to appear in 1.5.5) -- Fix typos in code and man pages. Thanks to Fujitsu for these fixes. - (** also to appear in 1.5.5) -- Improve management of the registration cache; when full, try freeing - old entries and attempt to re-register. -- Fixed a data packing pointer alignment issue. Thanks to Fujitsu - for the patch. - (** also to appear in 1.5.5) -- Add ability to turn off warning about having the shared memory backing - store over a networked filesystem. Thanks to Chris Samuel for this - suggestion. - (** also to appear in 1.5.5) -- Removed an unnecessary memmove() and plugged a couple of small memory leaks - in the openib OOB connection setup code. -- Fixed some QLogic bugs. Thanks to Mark Debbage from QLogic for the patches. -- Fixed problem with MPI_IN_PLACE and other sentinel Fortran constants - on OS X. - (** also to appear in 1.5.5) -- Fix SLURM cpus-per-task allocation. - (** also to appear in 1.5.5) -- Fix the datatype engine for when data left over from the previous - pack was larger than the allowed space in the pack buffer. Thanks to - Yuki Matsumoto and Takahiro Kawashima for the bug report and the - patch. -- Fix Fortran value for MPI_MAX_PORT_NAME. Thanks to Enzo Dari for - raising the issue. -- Workaround an Intel compiler v12.1.0 2011.6.233 vector optimization - bug. -- Fix issues on Solaris with the openib BTL. -- Fixes for the Oracle Studio 12.2 Fortran compiler. -- Update iWARP parameters for the Intel NICs. - (** also to appear in 1.5.5) -- Fix obscure cases where MPI_ALLGATHER could crash. Thanks to Andrew - Senin for reporting the problem. - (** also to appear in 1.5.5) - - -1.4.4: 11 Oct 2011 ------------------- - -- Modified a memcpy() call in the openib btl connection setup to use - memmove() instead because of the possibility of an overlapping - copy (as identified by valgrind). -- Changed use of sys_timer_get_cycles() to the more appropriate - wrapper: opal_timer_base_get_cycles(). Thanks to Jani Monoses - for this fix. -- Corrected the reported default value of btl_openib_ib_timeout - in the "IB retries exceeded" error message. Thanks to Kevin Buckley - for this correction. -- Increased rdmacm address resolution timeout from 1s to 30s & - updated Chelsio T4 openib BTL defaults. Thanks to Steve Wise - for these updates. - (** also to appear in 1.5.5) -- Ensure that MPI_Accumulate error return in 1.4 is consistent with - 1.5.x and trunk. -- Allow the word "slots" in rankfiles (i.e., not just "slot"). - (** also appeared in 1.5.4) -- Add Mellanox ConnectX 3 device IDs to the openib BTL defaults. - (** also appeared in 1.5.4) -- Update description of btl_openib_cq_size to be more accurate. -- Ensure mpirun's --xterm options leaves sessions attached. - (** also appeared in 1.5.4) -- Update to allow more than 128 entries in an appfile. - (** also appeared in 1.5.4) -- Update description of btl_openib_cq_size to be more accurate. - (** also appeared in 1.5.4) -- Fix for deadlock when handling recursive attribute keyval deletions - (e.g., when using ROMIO with MPI_THREAD_MULTIPLE). -- Fix indexed datatype leaks. Thanks to Pascal Deveze for supplying - the initial patch. (** also appeared in 1.5.4) -- Fixed the F90 types of the sendcounts and displs parameters to - MPI_SCATTERV. Thanks to Stanislav Sazykin for identifying the issue. - (** also appeared in 1.5.4) -- Exclude opal/libltdl from "make distclean" when --disable-dlopen is - used. Thanks to David Gunter for reporting the issue. -- Fixed a segv in MPI_Comm_create when called with GROUP_EMPTY. - Thanks to Dominik Goeddeke for finding this. - (** also appeared in 1.5.4) -- Fixed return codes from MPI_PROBE and MPI_IPROBE. - (** also appeared in 1.5.4) -- Fixed undefined symbol error when using the vtf90 profiling tool. -- Fix for referencing an uninitialized variable in DPM ORTE. Thanks - to Avinash Malik for reporting the issue. -- Fix for correctly handling multi-token args when using debuggers. -- Eliminated the unneeded u_int*_t datatype definitions. -- Change in ORTE DPM to get around gcc 4.[45].x compiler wanrings - about possibly calling free() on a non-heap variable, even though it - will never happen because the refcount will never go to zero. -- Fixed incorrect text in MPI_File_set_view man page. -- Fix in MPI_Init_thread for checkpoint/restart. -- Fix for libtool issue when using pgcc to compile ompi in conjunction - with the -tp option. -- Fixed a race condition in osc_rdma_sync. Thanks to Guillaume - Thouvenin for finding this issue. -- Clarification of MPI_Init_thread man page. -- Fixed an indexing problem in precondition_transports. -- Fixed a problem in which duplicated libs were being specified for - linking. Thanks to Hicham Mouline for noticing it. -- Various autogen.sh fixes. -- Fix for memchecking buffers during MPI_*INIT. -- Man page cleanups. Thanks to Jeremiah Willcock and Jed Brown. -- Fix for VT rpmbuild on RHEL5. -- Support Solaris legacy munmap prototype changes. - (** also appeared in 1.5.4) -- Expands app_idx to int32_t to allow more than 127 app_contexts. -- Guard the inclusion of execinfo.h since not all platforms have it. Thanks - to Aleksej Saushev for identifying this issue. - (** also appeared in 1.5.4) -- Fix to avoid possible environment corruption. Thanks to Peter Thompson - for identifying the issue and supplying a patch. - (** also appeared in 1.5.4) -- Fixed paffinity base MCA duplicate registrations. Thanks to Gus - Correa for bringing this to our attention. -- Fix recursive locking bug when MPI-IO was used with - MPI_THREAD_MULTIPLE. (** also appeared in 1.5.4) -- F90 MPI API fixes. -- Fixed a misleading MPI_Bcast error message. Thanks to Jeremiah - Willcock for reporting this. -- Added to ptmalloc's hooks.c (it's not always included - by default on some systems). -- Libtool patch to get around a build problem when using the IBM XL - compilers. -- Fix to detect and avoid overlapping memcpy(). Thanks to - Francis Pellegrini for identifying the issue. -- Fix to allow ompi to work on top of RoCE vLANs. -- Restored a missing debugger flag to support TotalView. Thanks to - David Turner and the TV folks for supplying the fix. -- Updated SLURM support to 1.5.1. -- Removed an extraneous #include from the TCP BTL. -- When specifying OOB ports, fix to convert the ports into network - byte order before binding. -- Fixed use of memory barriers in the SM BTL. This fixed segv's when - compiling with Intel 10.0.025 or PGI 9.0-3. -- Fix to prevent the SM BTL from creating its mmap'd file in - directories that are remotely mounted. - - -1.4.3: 6 Sep 2010 ------------------ - -- Fixed handling of the array_of_argv parameter in the Fortran - binding of MPI_COMM_SPAWN_MULTIPLE (** also to appear: 1.5). -- Fixed a problem with the Fortran binding for - MPI_FILE_CREATE_ERRHANDLER. Thanks to Secretan Yves for identifying - the issue (** also to appear: 1.5). -- Updates to the LSF PLM to ensure that the path is correctly passed. - Thanks to Teng Lin for the patch (** also to appear: 1.5). -- Fixes for the F90 MPI_COMM_SET_ERRHANDLER and MPI_WIN_SET_ERRHANDLER - bindings. Thanks to Paul Kapinos for pointing out the issue. - (** also to appear: 1.5). -- Fixed various MPI_THREAD_MULTIPLE race conditions. -- Fixed an issue with an undeclared variable from ptmalloc2 munmap on - BSD systems. -- Fixes for BSD interface detection. -- Various other BSD fixes. Thanks to Kevin Buckley helping to track. - all of this down. -- Fixed issues with the use of the -nper* mpirun command line arguments. -- Fixed an issue with coll tuned dynamic rules. -- Fixed an issue with the use of OPAL_DESTDIR being applied too aggressively. -- Fixed an issue with one-sided xfers when the displacement exceeds 2GBytes. -- Change to ensure TotalView works properly on Darwin. -- Added support for Visual Studio 2010. -- Fix to ensure proper placement of VampirTrace header files. -- Needed to add volatile keyword to a varialbe used in debugging - (MPIR_being_debugged). -- Fixed a bug in inter-allgather. -- Fixed malloc(0) warnings. -- Corrected a typo the MPI_Comm_size man page (intra -> inter). Thanks - to Simon number.cruncher for pointing this out. -- Fixed a SegV in orted when given more than 127 app_contexts. -- Removed xgrid source code from the 1.4 branch since it is no longer - supported in the 1.4 series. -- Removed the --enable-opal-progress-threads config option since - opal progress thread support does not work in 1.4.x. -- Fixed a defect in VampirTrace's vtfilter. -- Fixed wrong Windows path in hnp_contact. -- Removed the requirement for a paffinity component. -- Removed a hardcoded limit of 64 interconnected jobs. -- Fix to allow singletons to use ompi-server for rendezvous. -- Fixed bug in output-filename option. -- Fix to correctly handle failures in mx_init(). -- Fixed a potential Fortran memory leak. -- Fixed an incorrect branch in some ppc32 assembly code. Thanks - to Matthew Clark for this fix. -- Remove use of undocumented AS_VAR_GET macro during configuration. -- Fixed an issue with VampirTrace's wrapper for MPI_init_thread. -- Updated mca-btl-openib-device-params.ini file with various new vendor id's. -- Configuration fixes to ensure CPPFLAGS in handled properly if a non-standard - valgrind location was specified. -- Various man page updates - - -1.4.2: 4 May 2010 ------------------ - -- Fixed problem when running in heterogeneous environments. Thanks to - Timur Magomedov for helping to track down this issue. -- Update LSF support to ensure that the path is passed correctly. - Thanks to Teng Lin for submitting a patch. -- Fixed some miscellaneous oversubscription detection bugs. -- IBM re-licensed its LoadLeveler code to be BSD-compliant. -- Various OpenBSD and NetBSD build and run-time fixes. Many thanks to - the OpenBSD community for their time, expertise, and patience - getting these fixes incorporated into Open MPI's main line. -- Various fixes for multithreading deadlocks, race conditions, and - other nefarious things. -- Fixed ROMIO's handling of "nearly" contiguous issues (e.g., with - non-zero true_lb). Thanks for Pascal Deveze for the patch. -- Bunches of Windows build fixes. Many thanks to several Windows - users for their help in improving our support on Windows. -- Now allow the graceful failover from MTLs to BTLs if no MTLs can - initialize successfully. -- Added "clobber" information to various atomic operations, fixing - erroneous behavior in some newer versions of the GNU compiler suite. -- Update various iWARP and InfiniBand device specifications in the - OpenFabrics .ini support file. -- Fix the use of hostfiles when a username is supplied. -- Various fixes for rankfile support. -- Updated the internal version of VampirTrace to 5.4.12. -- Fixed OS X TCP wireup issues having to do with IPv4/IPv6 confusion - (see https://svn.open-mpi.org/trac/ompi/changeset/22788 for more - details). -- Fixed some problems in processor affinity support, including when - there are "holes" in the processor namespace (e.g., offline - processors). -- Ensure that Open MPI's "session directory" (usually located in /tmp) - is cleaned up after process termination. -- Fixed some problems with the collective "hierarch" implementation - that could occur in some obscure conditions. -- Various MPI_REQUEST_NULL, API parameter checking, and attribute - error handling fixes. Thanks to Lisandro Dalcín for reporting the - issues. -- Fix case where MPI_GATHER erroneously used datatypes on non-root - nodes. Thanks to Michael Hofmann for investigating the issue. -- Patched ROMIO support for PVFS2 > v2.7 (patch taken from MPICH2 - version of ROMIO). -- Fixed "mpirun --report-bindings" behavior when used with - mpi_paffinity_alone=1. Also fixed mpi_paffinity_alone=1 behavior - with non-MPI applications. Thanks to Brice Goglin for noticing the - problem. -- Ensure that all OpenFabrics devices have compatible receive_queues - specifications before allowing them to communicate. See the lengthy - comment in https://svn.open-mpi.org/trac/ompi/changeset/22592 for - more details. -- Fix some issues with checkpoint/restart. -- Improve the pre-MPI_INIT/post-MPI_FINALIZE error messages. -- Ensure that loopback addresses are never advertised to peer - processes for RDMA/OpenFabrics support. -- Fixed a CSUM PML false positive. -- Various fixes for Catamount support. -- Minor update to wrapper compilers in how user-specific argv is - ordered on the final command line. Thanks to Jed Brown for the - suggestions. -- Removed flex.exe binary from Open MPI tarballs; now generate flex - code from a newer (Windows-friendly) flex when we make official - tarballs. - - -1.4.1: 15 Jan 2010 ------------------- - -- Update to PLPA v1.3.2, addressing a licensing issue identified by - the Fedora project. See - https://svn.open-mpi.org/trac/plpa/changeset/262 for details. -- Add check for malformed checkpoint metadata files (Ticket #2141). -- Fix error path in ompi-checkpoint when not able to checkpoint - (Ticket #2138). -- Cleanup component release logic when selecting checkpoint/restart - enabled components (Ticket #2135). -- Fixed VT node name detection for Cray XT platforms, and fixed some - broken VT documentation files. -- Fix a possible race condition in tearing down RDMA CM-based - connections. -- Relax error checking on MPI_GRAPH_CREATE. Thanks to David Singleton - for pointing out the issue. -- Fix a shared memory "hang" problem that occurred on x86/x86_64 - platforms when used with the GNU >=4.4.x compiler series. -- Add fix for Libtool 2.2.6b's problems with the PGI 10.x compiler - suite. Inspired directly from the upstream Libtool patches that fix - the issue (but we need something working before the next Libtool - release). - - -1.4: 8 Dec 2009 ---------------- - -The *only* change in the Open MPI v1.4 release (as compared to v1.3.4) -was to update the embedded version of Libtool's libltdl to address a -potential security vulnerability. Specifically: Open MPI v1.3.4 was -created with GNU Libtool 2.2.6a; Open MPI v1.4 was created with GNU -Libtool 2.2.6b. There are no other changes between Open MPI v1.3.4 -and v1.4. - - -1.3.4: 13 Feb 2010 ------------------- - -- Fix some issues in OMPI's SRPM with regard to shell_scripts_basename - and its use with mpi-selector. Thanks to Bill Johnstone for - pointing out the problem. -- Added many new MPI job process affinity options to mpirun. See the - newly-updated mpirun(1) man page for details. -- Several updates to mpirun's XML output. -- Update to fix a few Valgrind warnings with regards to the ptmalloc2 - allocator and Open MPI's use of PLPA. -- Many updates and fixes to the (non-default) "sm" collective - component (i.e., native shared memory MPI collective operations). -- Updates and fixes to some MPI_COMM_SPAWN_MULTIPLE corner cases. -- Fix some internal copying functions in Open MPI's use of PLPA. -- Correct some SLURM nodelist parsing logic that may have interfered - with large jobs. Additionally, per advice from the SLURM team, - change the environment variable that we use for obtaining the job's - allocation. -- Revert to an older, safer (but slower) communicator ID allocation - algorithm. -- Fixed minimum distance finding for OpenFabrics devices in the openib - BTL. -- Relax the parameter checking MPI_CART_CREATE a bit. -- Fix MPI_COMM_SPAWN[_MULTIPLE] to only error-check the info arguments - on the root process. Thanks to Federico Golfre Andreasi for - reporting the problem. -- Fixed some BLCR configure issues. -- Fixed a potential deadlock when the openib BTL was used with - MPI_THREAD_MULTIPLE. -- Fixed dynamic rules selection for the "tuned" coll component. -- Added a launch progress meter to mpirun (useful for large jobs; set - the orte_report_launch_progress MCA parameter to 1 to see it). -- Reduced the number of file descriptors consumed by each MPI process. -- Add new device IDs for Chelsio T3 RNICs to the openib BTL config file. -- Fix some CRS self component issues. -- Added some MCA parameters to the PSM MTL to tune its run-time - behavior. -- Fix some VT issues with MPI_BOTTOM/MPI_IN_PLACE. -- Man page updates from the Debain Open MPI package maintainers. -- Add cycle counter support for the Alpha and Sparc platforms. -- Pass visibility flags to libltdl's configure script, resulting in - those symbols being hidden. This appears to mainly solve the - problem of applications attempting to use different versions of - libltdl from that used to build Open MPI. - - -1.3.3: 14 Jul 2009 ------------------- - -- Fix a number of issues with the openib BTL (OpenFabrics) RDMA CM, - including a memory corruption bug, a shutdown deadlock, and a route - timeout. Thanks to David McMillen and Hal Rosenstock for help in - tracking down the issues. -- Change the behavior of the EXTRA_STATE parameter that is passed to - Fortran attribute callback functions: this value is now stored - internally in MPI -- it no longer references the original value - passed by MPI_*_CREATE_KEYVAL. -- Allow the overriding RFC1918 and RFC3330 for the specification of - "private" networks, thereby influencing Open MPI's TCP - "reachability" computations. -- Improve flow control issues in the sm btl, by both tweaking the - shared memory progression rules and by enabling the "sync" collective - to barrier every 1,000th collective. -- Various fixes for the IBM XL C/C++ v10.1 compiler. -- Allow explicit disabling of ptmalloc2 hooks at runtime (e.g., enable - support for Debian's builtroot system). Thanks to Manuel Prinz and - the rest of the Debian crew for helping identify and fix this issue. -- Various minor fixes for the I/O forwarding subsystem. -- Big endian iWARP fixes in the Open Fabrics RDMA CM support. -- Update support for various OpenFabrics devices in the openib BTL's - .ini file. -- Fixed undefined symbol issue with Open MPI's parallel debugger - message queue support so it can be compiled by Sun Studio compilers. -- Update MPI_SUBVERSION to 1 in the Fortran bindings. -- Fix MPI_GRAPH_CREATE Fortran 90 binding. -- Fix MPI_GROUP_COMPARE behavior with regards to MPI_IDENT. Thanks to - Geoffrey Irving for identifying the problem and supplying the fix. -- Silence gcc 4.1 compiler warnings about type punning. Thanks to - Number Cruncher for the fix. -- Added more Valgrind and other memory-cleanup fixes. Thanks to - various Open MPI users for help with these issues. -- Miscellaneous VampirTrace fixes. -- More fixes for openib credits in heavy-congestion scenarios. -- Slightly decrease the latency in the openib BTL in some conditions - (add "send immediate" support to the openib BTL). -- Ensure to allow MPI_REQUEST_GET_STATUS to accept an - MPI_STATUS_IGNORE parameter. Thanks to Shaun Jackman for the bug - report. -- Added Microsoft Windows support. See README.WINDOWS file for - details. - - -1.3.2: 22 Apr 2009 ------------------- - -- Fixed a potential infinite loop in the openib BTL that could occur - in senders in some frequent-communication scenarios. Thanks to Don - Wood for reporting the problem. -- Add a new checksum PML variation on ob1 (main MPI point-to-point - communication engine) to detect memory corruption in node-to-node - messages -- Add a new configuration option to add padding to the openib - header so the data is aligned -- Add a new configuration option to use an alternative checksum algo - when using the checksum PML -- Fixed a problem reported by multiple users on the mailing list that - the LSF support would fail to find the appropriate libraries at - run-time. -- Allow empty shell designations from getpwuid(). Thanks to Sergey - Koposov for the bug report. -- Ensure that mpirun exits with non-zero status when applications die - due to user signal. Thanks to Geoffroy Pignot for suggesting the - fix. -- Ensure that MPI_VERSION / MPI_SUBVERSION match what is returned by - MPI_GET_VERSION. Thanks to Rob Egan for reporting the error. -- Updated MPI_*KEYVAL_CREATE functions to properly handle Fortran - extra state. -- A variety of ob1 (main MPI point-to-point communication engine) bug - fixes that could have caused hangs or seg faults. -- Do not install Open MPI's signal handlers in MPI_INIT if there are - already signal handlers installed. Thanks to Kees Verstoep for - bringing the issue to our attention. -- Fix GM support to not seg fault in MPI_INIT. -- Various VampirTrace fixes. -- Various PLPA fixes. -- No longer create BTLs for invalid (TCP) devices. -- Various man page style and lint cleanups. -- Fix critical OpenFabrics-related bug noted here: - https://www.open-mpi.org/community/lists/announce/2009/03/0029.php. - Open MPI now uses a much more robust memory intercept scheme that is - quite similar to what is used by MX. The use of "-lopenmpi-malloc" - is no longer necessary, is deprecated, and is expected to disappear - in a future release. -lopenmpi-malloc will continue to work for the - duration of the Open MPI v1.3 and v1.4 series. -- Fix some OpenFabrics shutdown errors, both regarding iWARP and SRQ. -- Allow the udapl BTL to work on Solaris platforms that support - relaxed PCI ordering. -- Fix problem where the mpirun would sometimes use rsh/ssh to launch on - the localhost (instead of simply forking). -- Minor SLURM stdin fixes. -- Fix to run properly under SGE jobs. -- Scalability and latency improvements for shared memory jobs: convert - to using one message queue instead of N queues. -- Automatically size the shared-memory area (mmap file) to match - better what is needed; specifically, so that large-np jobs will start. -- Use fixed-length MPI predefined handles in order to provide ABI - compatibility between Open MPI releases. -- Fix building of the posix paffinity component to properly get the - number of processors in loosely tested environments (e.g., - FreeBSD). Thanks to Steve Kargl for reporting the issue. -- Fix --with-libnuma handling in configure. Thanks to Gus Correa for - reporting the problem. - - -1.3.1: 19 Mar 2009 ------------------- - -- Added "sync" coll component to allow users to synchronize every N - collective operations on a given communicator. -- Increased the default values of the IB and RNR timeout MCA parameters. -- Fix a compiler error noted by Mostyn Lewis with the PGI 8.0 compiler. -- Fix an error that prevented stdin from being forwarded if the - rsh launcher was in use. Thanks to Branden Moore for pointing out - the problem. -- Correct a case where the added datatype is considered as contiguous but - has gaps in the beginning. -- Fix an error that limited the number of comm_spawns that could - simultaneously be running in some environments -- Correct a corner case in OB1's GET protocol for long messages; the - error could sometimes cause MPI jobs using the openib BTL to hang. -- Fix a bunch of bugs in the IO forwarding (IOF) subsystem and add some - new options to output to files and redirect output to xterm. Thanks to - Jody Weissmann for helping test out many of the new fixes and - features. -- Fix SLURM race condition. -- Fix MPI_File_c2f(MPI_FILE_NULL) to return 0, not -1. Thanks to - Lisandro Dalcín for the bug report. -- Fix the DSO build of tm PLM. -- Various fixes for size disparity between C int's and Fortran - INTEGER's. Thanks to Christoph van Wullen for the bug report. -- Ensure that mpirun exits with a non-zero exit status when daemons or - processes abort or fail to launch. -- Various fixes to work around Intel (NetEffect) RNIC behavior. -- Various fixes for mpirun's --preload-files and --preload-binary - options. -- Fix the string name in MPI::ERRORS_THROW_EXCEPTIONS. -- Add ability to forward SIFTSTP and SIGCONT to MPI processes if you - set the MCA parameter orte_forward_job_control to 1. -- Allow the sm BTL to allocate larger amounts of shared memory if - desired (helpful for very large multi-core boxen). -- Fix a few places where we used PATH_MAX instead of OPAL_PATH_MAX, - leading to compile problems on some platforms. Thanks to Andrea Iob - for the bug report. -- Fix mca_btl_openib_warn_no_device_params_found MCA parameter; it - was accidentally being ignored. -- Fix some run-time issues with the sctp BTL. -- Ensure that RTLD_NEXT exists before trying to use it (e.g., it - doesn't exist on Cygwin). Thanks to Gustavo Seabra for reporting - the issue. -- Various fixes to VampirTrace, including fixing compile errors on - some platforms. -- Fixed missing MPI_Comm_accept.3 man page; fixed minor issue in - orterun.1 man page. Thanks to Dirk Eddelbuettel for identifying the - problem and submitting a patch. -- Implement the XML formatted output of stdout/stderr/stddiag. -- Fixed mpirun's -wdir switch to ensure that working directories for - multiple app contexts are properly handled. Thanks to Geoffroy - Pignot for reporting the problem. -- Improvements to the MPI C++ integer constants: - - Allow MPI::SEEK_* constants to be used as constants - - Allow other MPI C++ constants to be used as array sizes -- Fix minor problem with orte-restart's command line options. See - ticket #1761 for details. Thanks to Gregor Dschung for reporting - the problem. - - -1.3: 19 Jan 2009 ----------------- - -- Extended the OS X 10.5.x (Leopard) workaround for a problem when - assembly code is compiled with -g[0-9]. Thanks to Barry Smith for - reporting the problem. See ticket #1701. -- Disabled MPI_REAL16 and MPI_COMPLEX32 support on platforms where the - bit representation of REAL*16 is different than that of the C type - of the same size (usually long double). Thanks to Julien Devriendt - for reporting the issue. See ticket #1603. -- Increased the size of MPI_MAX_PORT_NAME to 1024 from 36. See ticket #1533. -- Added "notify debugger on abort" feature. See tickets #1509 and #1510. - Thanks to Seppo Sahrakropi for the bug report. -- Upgraded Open MPI tarballs to use Autoconf 2.63, Automake 1.10.1, - Libtool 2.2.6a. -- Added missing MPI::Comm::Call_errhandler() function. Thanks to Dave - Goodell for bringing this to our attention. -- Increased MPI_SUBVERSION value in mpi.h to 1 (i.e., MPI 2.1). -- Changed behavior of MPI_GRAPH_CREATE, MPI_TOPO_CREATE, and several - other topology functions per MPI-2.1. -- Fix the type of the C++ constant MPI::IN_PLACE. -- Various enhancements to the openib BTL: - - Added btl_openib_if_[in|ex]clude MCA parameters for - including/excluding comma-delimited lists of HCAs and ports. - - Added RDMA CM support, includng btl_openib_cpc_[in|ex]clude MCA - parameters - - Added NUMA support to only use "near" network adapters - - Added "Bucket SRQ" (BSRQ) support to better utilize registered - memory, including btl_openib_receive_queues MCA parameter - - Added ConnectX XRC support (and integrated with BSRQ) - - Added btl_openib_ib_max_inline_data MCA parameter - - Added iWARP support - - Revamped flow control mechansisms to be more efficient - - "mpi_leave_pinned=1" is now the default when possible, - automatically improving performance for large messages when - application buffers are re-used -- Elimiated duplicated error messages when multiple MPI processes fail - with the same error. -- Added NUMA support to the shared memory BTL. -- Add Valgrind-based memory checking for MPI-semantic checks. -- Add support for some optional Fortran datatypes (MPI_LOGICAL1, - MPI_LOGICAL2, MPI_LOGICAL4 and MPI_LOGICAL8). -- Remove the use of the STL from the C++ bindings. -- Added support for Platform/LSF job launchers. Must be Platform LSF - v7.0.2 or later. -- Updated ROMIO with the version from MPICH2 1.0.7. -- Added RDMA capable one-sided component (called rdma), which - can be used with BTL components that expose a full one-sided - interface. -- Added the optional datatype MPI_REAL2. As this is added to the "end of" - predefined datatypes in the fortran header files, there will not be - any compatibility issues. -- Added Portable Linux Processor Affinity (PLPA) for Linux. -- Addition of a finer symbols export control via the visibiliy feature - offered by some compilers. -- Added checkpoint/restart process fault tolerance support. Initially - support a LAM/MPI-like protocol. -- Removed "mvapi" BTL; all InfiniBand support now uses the OpenFabrics - driver stacks ("openib" BTL). -- Added more stringent MPI API parameter checking to help user-level - debugging. -- The ptmalloc2 memory manager component is now by default built as - a standalone library named libopenmpi-malloc. Users wanting to - use leave_pinned with ptmalloc2 will now need to link the library - into their application explicitly. All other users will use the - libc-provided allocator instead of Open MPI's ptmalloc2. This change - may be overriden with the configure option enable-ptmalloc2-internal -- The leave_pinned options will now default to using mallopt on - Linux in the cases where ptmalloc2 was not linked in. mallopt - will also only be available if munmap can be intercepted (the - default whenever Open MPI is not compiled with --without-memory- - manager. -- Open MPI will now complain and refuse to use leave_pinned if - no memory intercept / mallopt option is available. -- Add option of using Perl-based wrapper compilers instead of the - C-based wrapper compilers. The Perl-based version does not - have the features of the C-based version, but does work better - in cross-compile environments. - - -1.2.9: 14 Feb 2009 ------------------- - -- Fix a segfault when using one-sided communications on some forms of derived - datatypes. Thanks to Dorian Krause for reporting the bug. See #1715. -- Fix an alignment problem affecting one-sided communications on - some architectures (e.g., SPARC64). See #1738. -- Fix compilation on Solaris when thread support is enabled in Open MPI - (e.g., when using --with-threads). See #1736. -- Correctly take into account the MTU that an OpenFabrics device port - is using. See #1722 and - https://bugs.openfabrics.org/show_bug.cgi?id=1369. -- Fix two datatype engine bugs. See #1677. - Thanks to Peter Kjellstrom for the bugreport. -- Fix the bml r2 help filename so the help message can be found. See #1623. -- Fix a compilation problem on RHEL4U3 with the PGI 32 bit compiler - caused by . See ticket #1613. -- Fix the --enable-cxx-exceptions configure option. See ticket #1607. -- Properly handle when the MX BTL cannot open an endpoint. See ticket #1621. -- Fix a double free of events on the tcp_events list. See ticket #1631. -- Fix a buffer overun in opal_free_list_grow (called by MPI_Init). - Thanks to Patrick Farrell for the bugreport and Stephan Kramer for - the bugfix. See ticket #1583. -- Fix a problem setting OPAL_PREFIX for remote sh-based shells. - See ticket #1580. - - -1.2.8: 14 Oct 2008 ------------------- - -- Tweaked one memory barrier in the openib component to be more conservative. - May fix a problem observed on PPC machines. See ticket #1532. -- Fix OpenFabrics IB partition support. See ticket #1557. -- Restore v1.1 feature that sourced .profile on remote nodes if the default - shell will not do so (e.g. /bin/sh and /bin/ksh). See ticket #1560. -- Fix segfault in MPI_Init_thread() if ompi_mpi_init() fails. See ticket #1562. -- Adjust SLURM support to first look for $SLURM_JOB_CPUS_PER_NODE instead of - the deprecated $SLURM_TASKS_PER_NODE environment variable. This change - may be *required* when using SLURM v1.2 and above. See ticket #1536. -- Fix the MPIR_Proctable to be in process rank order. See ticket #1529. -- Fix a regression introduced in 1.2.6 for the IBM eHCA. See ticket #1526. - - -1.2.7: 28 Aug 2008 ------------------- - -- Add some Sun HCA vendor IDs. See ticket #1461. -- Fixed a memory leak in MPI_Alltoallw when called from Fortran. - Thanks to Dave Grote for the bugreport. See ticket #1457. -- Only link in libutil when it is needed/desired. Thanks to - Brian Barret for diagnosing and fixing the problem. See ticket #1455. -- Update some QLogic HCA vendor IDs. See ticket #1453. -- Fix F90 binding for MPI_CART_GET. Thanks to Scott Beardsley for - bringing it to our attention. See ticket #1429. -- Remove a spurious warning message generated in/by ROMIO. See ticket #1421. -- Fix a bug where command-line MCA parameters were not overriding - MCA parameters set from environment variables. See ticket #1380. -- Fix a bug in the AMD64 atomics assembly. Thanks to Gabriele Fatigati - for the bug report and bugfix. See ticket #1351. -- Fix a gather and scatter bug on intercommunicators when the datatype - being moved is 0 bytes. See ticket #1331. -- Some more man page fixes from the Debian maintainers. - See tickets #1324 and #1329. -- Have openib BTL (OpenFabrics support) check for the presence of - /sys/class/infiniband before allowing itself to be used. This check - prevents spurious "OMPI did not find RDMA hardware!" notices on - systems that have the software drivers installed, but no - corresponding hardware. See tickets #1321 and #1305. -- Added vendor IDs for some ConnectX openib HCAs. See ticket #1311. -- Fix some RPM specfile inconsistencies. See ticket #1308. - Thanks to Jim Kusznir for noticing the problem. -- Removed an unused function prototype that caused warnings on - some systems (e.g., OS X). See ticket #1274. -- Fix a deadlock in inter-communicator scatter/gather operations. - Thanks to Martin Audet for the bug report. See ticket #1268. - - -1.2.6: 7 Apr 2008 ------------------ - -- Fix a bug in the inter-allgather for asymmetric inter-communicators. - Thanks to Martin Audet for the bug report. See ticket #1247. -- Fix a bug in the openib BTL when setting the CQ depth. Thanks - to Jon Mason for the bug report and fix. See ticket #1245. -- On Mac OS X Leopard, the execinfo component will be used for - backtraces, making for a more durable solution. See ticket #1246. -- Added vendor IDs for some QLogic DDR openib HCAs. See ticket #1227. -- Updated the URL to get the latest config.guess and config.sub files. - Thanks to Ralf Wildenhues for the bug report. See ticket #1226. -- Added shared contexts support to PSM MTL. See ticket #1225. -- Added pml_ob1_use_early_completion MCA parameter to allow users - to turn off the OB1 early completion semantic and avoid "stall" - problems seen on InfiniBand in some cases. See ticket #1224. -- Sanitized some #define macros used in mpi.h to avoid compiler warnings - caused by MPI programs built with different autoconf versions. - Thanks to Ben Allan for reporting the problem, and thanks to - Brian Barrett for the fix. See ticket #1220. -- Some man page fixes from the Debian maintainers. See ticket #1219. -- Made the openib BTL a bit more resilient in the face of driver - errors. See ticket #1217. -- Fixed F90 interface for MPI_CART_CREATE. See ticket #1208. - Thanks to Michal Charemza for reporting the problem. -- Fixed some C++ compiler warnings. See ticket #1203. -- Fixed formatting of the orterun man page. See ticket #1202. - Thanks to Peter Breitenlohner for the patch. - - -1.2.5: 8 Jan 2008 ------------------ - -- Fixed compile issue with open() on Fedora 8 (and newer) platforms. - Thanks to Sebastian Schmitzdorff for noticing the problem. -- Added run-time warnings during MPI_INIT when MPI_THREAD_MULTIPLE - and/or progression threads are used (the OMPI v1.2 series does not - support these well at all). -- Better handling of ECONNABORTED from connect on Linux. Thanks to - Bob Soliday for noticing the problem; thanks to Brian Barrett for - submitting a patch. -- Reduce extraneous output from OOB when TCP connections must - be retried. Thanks to Brian Barrett for submitting a patch. -- Fix for ConnectX devices and OFED 1.3. See ticket #1190. -- Fixed a configure problem for Fortran 90 on Cray systems. Ticket #1189. -- Fix an uninitialized variable in the error case in opal_init.c. - Thanks to Åke Sandgren for pointing out the mistake. -- Fixed a hang in configure if $USER was not defined. Thanks to - Darrell Kresge for noticing the problem. See ticket #900. -- Added support for parallel debuggers even when we have an optimized build. - See ticket #1178. -- Worked around a bus error in the Mac OS X 10.5.X (Leopard) linker when - compiling Open MPI with -g. See ticket #1179. -- Removed some warnings about 'rm' from Mac OS X 10.5 (Leopard) builds. -- Fix the handling of mx_finalize(). See ticket #1177. - Thanks to Åke Sandgren for bringing this issue to our attention. -- Fixed minor file descriptor leak in the Altix timer code. Thanks to - Paul Hargrove for noticing the problem and supplying the fix. -- Fix a problem when using a different compiler for C and Objective C. - See ticket #1153. -- Fix segfault in MPI_COMM_SPAWN when the user specified a working - directory. Thanks to Murat Knecht for reporting this and suggesting - a fix. -- A few manpage fixes from the Debian Open MPI maintainers. Thanks to - Tilman Koschnick, Sylvestre Ledru, and Dirk Eddelbuettel. -- Fixed issue with pthread detection when compilers are not all - from the same vendor. Thanks to Åke Sandgren for the bug - report. See ticket #1150. -- Fixed vector collectives in the self module. See ticket #1166. -- Fixed some data-type engine bugs: an indexing bug, and an alignment bug. - See ticket #1165. -- Only set the MPI_APPNUM attribute if it is defined. See ticket - #1164. - - -1.2.4: 26 Sep 2007 ------------------- - -- Really added support for TotalView/DDT parallel debugger message queue - debugging (it was mistakenly listed as "added" in the 1.2 release). -- Fixed a build issue with GNU/kFreeBSD. Thanks to Petr Salinger for - the patch. -- Added missing MPI_FILE_NULL constant in Fortran. Thanks to - Bernd Schubert for bringing this to our attention. -- Change such that the UDAPL BTL is now only built in Linux when - explicitly specified via the --with-udapl configure command line - switch. -- Fixed an issue with umask not being propagated when using the TM - launcher. -- Fixed behavior if number of slots is not the same on all bproc nodes. -- Fixed a hang on systems without GPR support (ex. Cray XT3/4). -- Prevent users of 32-bit MPI apps from requesting >= 2GB of shared - memory. -- Added a Portals MTL. -- Fix 0 sized MPI_ALLOC_MEM requests. Thanks to Lisandro Dalcín for - pointing out the problem. -- Fixed a segfault crash on large SMPs when doing collectives. -- A variety of fixes for Cray XT3/4 class of machines. -- Fixed which error handler is used when MPI_COMM_SELF is passed - to MPI_COMM_FREE. Thanks to Lisandro Dalcín for the bug report. -- Fixed compilation on platforms that don't have hton/ntoh. -- Fixed a logic problem in the fortran binding for MPI_TYPE_MATCH_SIZE. - Thanks to Jeff Dusenberry for pointing out the problem and supplying - the fix. -- Fixed a problem with MPI_BOTTOM in various places of the f77-interface. - Thanks to Daniel Spangberg for bringing this up. -- Fixed problem where MPI-optional Fortran datatypes were not - correctly initialized. -- Fixed several problems with stdin/stdout forwarding. -- Fixed overflow problems with the sm mpool MCA parameters on large SMPs. -- Added support for the DDT parallel debugger via orterun's --debug - command line option. -- Added some sanity/error checks to the openib MCA parameter parsing - code. -- Updated the udapl BTL to use RDMA capabilities. -- Allow use of the BProc head node if it was allocated to the user. - Thanks to Sean Kelly for reporting the problem and helping debug it. -- Fixed a ROMIO problem where non-blocking I/O errors were not properly - reported to the user. -- Made remote process launch check the $SHELL environment variable if - a valid shell was not otherwise found for the user. - Thanks to Alf Wachsmann for the bugreport and suggested fix. -- Added/updated some vendor IDs for a few openib HCAs. -- Fixed a couple of failures that could occur when specifying devices - for use by the OOB. -- Removed dependency on sysfsutils from the openib BTL for - libibverbs >=v1.1 (i.e., OFED 1.2 and beyond). - - -1.2.3: 20 Jun 2007 ------------------- - -- Fix a regression in comm_spawn functionality that inadvertently - caused the mapping of child processes to always start at the same - place. Thanks to Prakash Velayutham for helping discover the - problem. -- Fix segfault when a user's home directory is unavailable on a remote - node. Thanks to Guillaume Thomas-Collignon for bringing the issue - to our attention. -- Fix MPI_IPROBE to properly handle MPI_STATUS_IGNORE on mx and psm - MTLs. Thanks to Sophia Corwell for finding this and supplying a - reproducer. -- Fix some error messages in the tcp BTL. -- Use _NSGetEnviron instead of environ on Mac OS X so that there - are no undefined symbols in the shared libraries. -- On OS X, when MACOSX_DEPLOYMENT_TARGET is 10.3 or higher, support - building the Fortran 90 bindings as a shared library. Thanks to - Jack Howarth for his advice on making this work. -- No longer require extra include flag for the C++ bindings. -- Fix detection of weak symbols support with Intel compilers. -- Fix issue found by Josh England: ompi_info would not show framework - MCA parameters set in the environment properly. -- Rename the oob_tcp_include/exclude MCA params to oob_tcp_if_include/exclude - so that they match the naming convention of the btl_tcp_if_include/exclude - params. The old names are depreciated, but will still work. -- Add -wd as a synonym for the -wdir orterun/mpirun option. -- Fix the mvapi BTL to compile properly with compilers that do not support - anonymous unions. Thanks to Luis Kornblueh for reporting the bug. - - -1.2.2: 16 May 2007 ------------------- - -- Fix regression in 1.2.1 regarding the handling of $CC with both - absolute and relative path names. -- Fix F90 array of status dimensions. Thanks to Randy Bramley for - noticing the problem. -- Add btl_openib_ib_pkey_value MCA parameter for controlling IB port selection. -- Fixed a variety of threading/locking bugs. -- Fixed some compiler warnings associated with ROMIO, OS X, and gridengine. -- If pbs-config can be found, use it to look for TM support. Thanks - to Bas van der Vlies for the inspiration and preliminary work. -- Fixed a deadlock in orterun when the rsh PLS encounters some errors. - - -1.2.1: 25 Apr 2007 ------------------- - -- Fixed a number of connection establishment errors in the TCP out- - of-band messaging system. -- Fixed a memory leak when using mpi_comm calls. - Thanks to Bas van der Vlies for reporting the problem. -- Fixed various memory leaks in OPAL and ORTE. -- Improved launch times when using TM (PBS Pro, Torque, Open PBS). -- Fixed mpi_leave_pinned to work for all datatypes. -- Fix functionality allowing users to disable sbrk() (the - mpool_base_disable_sbrk MCA parameter) on platforms that support it. -- Fixed a pair of problems with the TCP "listen_thread" mode for the - oob_tcp_listen_mode MCA parameter that would cause failures when - attempting to launch applications. -- Fixed a segfault if there was a failure opening a BTL MX endpoint. -- Fixed a problem with mpirun's --nolocal option introduced in 1.2. -- Re-enabled MPI_COMM_SPAWN_MULTIPLE from singletons. -- LoadLeveler and TM configure fixes, Thanks to Martin Audet for the - bug report. -- Various C++ MPI attributes fixes. -- Fixed issues with backtrace code on 64 bit Intel & PPC OS X builds. -- Fixed issues with multi-word CC variables and libtool. - Thanks to Bert Wesarg for the bug reports. -- Fix issue with non-uniform node naming schemes in SLURM. -- Fix file descriptor leak in the Grid Engine/N1GE support. -- Fix compile error on OS X 10.3.x introduced with Open MPI 1.1.5. -- Implement MPI_TYPE_CREATE_DARRAY function (was in 1.1.5 but not 1.2). -- Recognize zsh shell when using rsh/ssh for launching MPI jobs. -- Ability to set the OPAL_DESTDIR or OPAL_PREFIX environment - variables to "re-root" an existing Open MPI installation. -- Always include -I for Fortran compiles, even if the prefix is - /usr/local. -- Support for "fork()" in MPI applications that use the - OpenFabrics stack (OFED v1.2 or later). -- Support for setting specific limits on registered memory. - - -1.2: 15 Mar 2007 ----------------- - -- Fixed race condition in the shared memory fifo's, which led to - orphaned messages. -- Corrected the size of the shared memory file - subtracted out the - space the header was occupying. -- Add support for MPI_2COMPLEX and MPI_2DOUBLE_COMPLEX. -- Always ensure to create $(includedir)/openmpi, even if the C++ - bindings are disabled so that the wrapper compilers don't point to - a directory that doesn't exist. Thanks to Martin Audet for - identifying the problem. -- Fixes for endian handling in MPI process startup. -- Openib BTL initialization fixes for cases where MPI processes in the - same job has different numbers of active ports on the same physical - fabric. -- Print more descriptive information when displaying backtraces on - OS's that support this functionality, such as the hostname and PID - of the process in question. -- Fixes to properly handle MPI exceptions in C++ on communicators, - windows, and files. -- Much more reliable runtime support, particularly with regards to MPI - job startup scalability, BProc support, and cleanup in failure - scenarios (e.g., MPI_ABORT, MPI processes abnormally terminating, - etc.). -- Significant performance improvements for MPI collectives, - particularly on high-speed networks. -- Various fixes in the MX BTL component. -- Fix C++ typecast problems with MPI_ERRCODES_IGNORE. Thanks to - Satish Balay for bringing this to our attention. -- Allow run-time specification of the maximum amount of registered - memory for OpenFabrics and GM. -- Users who utilize the wrapper compilers (e.g., mpicc and mpif77) - will not notice, but the underlying library names for ORTE and OPAL - have changed to libopen-rte and libopen-pal, respectively (listed - here because there are undoubtedly some users who are not using the - wrapper compilers). -- Many bug fixes to MPI-2 one-sided support. -- Added support for TotalView message queue debugging. -- Fixes for MPI_STATUS_SET_ELEMENTS. -- Print better error messages when mpirun's "-nolocal" is used when - there is only one node available. -- Added man pages for several Open MPI executables and the MPI API - functions. -- A number of fixes for Alpha platforms. -- A variety of Fortran API fixes. -- Build the Fortran MPI API as a separate library to allow these - functions to be profiled properly. -- Add new --enable-mpirun-prefix-by-default configure option to always - imply the --prefix option to mpirun, preventing many rsh/ssh-based - users from needing to modify their shell startup files. -- Add a number of missing constants in the C++ bindings. -- Added tight integration with Sun N1 Grid Engine (N1GE) 6 and the - open source Grid Engine. -- Allow building the F90 MPI bindings as shared libraries for most - compilers / platforms. Explicitly disallow building the F90 - bindings as shared libraries on OS X because of complicated - situations with Fortran common blocks and lack of support for - unresolved common symbols in shared libraries. -- Added stacktrace support for Solaris and Mac OS X. -- Update event library to libevent-1.1b. -- Fixed standards conformance issues with MPI_ERR_TRUNCATED and - setting MPI_ERROR during MPI_TEST/MPI_WAIT. -- Addition of "cm" PML to better support library-level matching - interconnects, with support for Myrinet/MX, and QLogic PSM-based - networks. -- Addition of "udapl" BTL for transport across uDAPL interconnects. -- Really check that the $CXX given to configure is a C++ compiler - (not a C compiler that "sorta works" as a C++ compiler). -- Properly check for local host only addresses properly, looking - for 127.0.0.0/8, rather than just 127.0.0.1. - - -1.1.5: 19 Mar 2007 ------------------- - -- Implement MPI_TYPE_CREATE_DARRAY function. -- Fix race condition in shared memory BTL startup that could cause MPI - applications to hang in MPI_INIT. -- Fix syntax error in a corner case of the event library. Thanks to - Bert Wesarg for pointing this out. -- Add new MCA parameter (mpi_preconnect_oob) for pre-connecting the - "out of band" channels between all MPI processes. Most helpful for - MPI applications over InfiniBand where process A sends an initial - message to process B, but process B does not enter the MPI library - for a long time. -- Fix for a race condition in shared memory locking semantics. -- Add major, minor, and release version number of Open MPI to mpi.h. - Thanks to Martin Audet for the suggestion. -- Fix the "restrict" compiler check in configure. -- Fix a problem with argument checking in MPI_TYPE_CREATE_SUBARRAY. -- Fix a problem with compiling the XGrid components with non-gcc - compilers. - - -1.1.4: 30 Jan 2007 ------------------- - -- Fixed 64-bit alignment issues with TCP interface detection on - intel-based OS X machines. -- Adjusted TCP interface selection to automatically ignore Linux - channel-bonded slave interfaces. -- Fixed the type of the first parameter to the MPI F90 binding for - MPI_INITIALIZED. Thanks to Tim Campbell for pointing out the - problem. -- Fix a bunch of places in the Fortran MPI bindings where (MPI_Fint*) - was mistakenly being used instead of (MPI_Aint*). -- Fixes for fortran MPI_STARTALL, which could sometimes return - incorrect request values. Thanks to Tim Campbell for pointing out - the problem. -- Include both pre- and post-MPI-2 errata bindings for - MPI::Win::Get_attr. -- Fix math error on Intel OS X platforms that would greatly increase - shared memory latency. -- Fix type casting issue with MPI_ERRCODES_IGNORE that would cause - errors when using a C++ compiler. Thanks to Barry Smith for - bringing this to our attention. -- Fix possible segmentation fault during shutdown when using the - MX BTL. - - -1.1.3: 26 Jan 2007 ------------------- - -- Remove the "hierarch" coll component; it was not intended to be - included in stable releases yet. -- Fix a race condition with stdout/stderr not appearing properly from - all processes upon termination of an MPI job. -- Fix internal accounting errors with the self BTL. -- Fix typos in the code path for when sizeof(int) != sizeof(INTEGER) - in the MPI F77 bindings functions. Thanks to Pierre-Matthieu - Anglade for bringing this problem to our attention. -- Fix for a memory leak in the derived datatype function - ompi_ddt_duplicate(). Thanks to Andreas Schäfer for reporting, - diagnosing, and patching the leak. -- Used better performing basic algorithm for MPI_ALLGATHERV. -- Added a workaround for a bug in the Intel 9.1 C++ compiler (all - versions up to and including 20060925) in the MPI C++ bindings that - caused run-time failures. Thanks to Scott Weitzenkamp for reporting - this problem. -- Fix MPI_SIZEOF implementation in the F90 bindings for COMPLEX - variable types. -- Fixes for persistent requests involving MPI_PROC_NULL. Thanks to - Lisandro Dalcín for reporting the problem. -- Fixes to MPI_TEST* and MPI_WAIT* for proper MPI exception reporting. - Thanks to Lisandro Dalcín for finding the issue. -- Various fixes for MPI generalized request handling; addition of - missing MPI::Grequest functionality to the C++ bindings. -- Add "mpi_preconnect_all" MCA parameter to force wireup of all MPI - connections during MPI_INIT (vs. making connections lazily whenever - the first MPI communication occurs between a pair of peers). -- Fix a problem for when $FC and/or $F77 were specified as multiple - tokens. Thanks to Orion Poplawski for identifying the problem and - to Ralf Wildenhues for suggesting the fix. -- Fix several MPI_*ERRHANDLER* functions and MPI_GROUP_TRANSLATE_RANKS - with respect to what arguments they allowed and the behavior that - they effected. Thanks to Lisandro Dalcín for reporting the - problems. - - -1.1.2: 18 Oct 2006 ------------------- - -- Really fix Fortran status handling in MPI_WAITSOME and MPI_TESTSOME. -- Various datatype fixes, reported by several users as causing - failures in the BLACS testing suite. Thanks to Harald Forbert, Åke - Sandgren and, Michael Kluskens for reporting the problem. -- Correctness and performance fixes for heterogeneous environments. -- Fixed a error in command line parsing on some platforms (causing - mpirun to crash without doing anything). -- Fix for initialization hangs on 64 bit Mac OS X PowerPC systems. -- Fixed some memory allocation problems in mpirun that could cause - random problems if "-np" was not specified on the command line. -- Add Kerberos authentication support for XGrid. -- Added LoadLeveler support for jobs larger than 128 tasks. -- Fix for large-sized Fortran LOGICAL datatypes. -- Fix various error checking in MPI_INFO_GET_NTHKEY and - MPI_GROUP_TRANSLATE_RANKS, and some collective operations - (particularly with regards to MPI_IN_PLACE). Thanks to Lisandro - Dalcín for reporting the problems. -- Fix receiving messages to buffers allocated by MPI_ALLOC_MEM. -- Fix a number of race conditions with the MPI-2 Onesided - interface. -- Fix the "tuned" collective componenete where some cases where - MPI_BCAST could hang. -- Update TCP support to support non-uniform TCP environments. -- Allow the "poe" RAS component to be built on AIX or Linux. -- Only install mpif.h if the rest of the Fortran bindings are - installed. -- Fixes for BProc node selection. -- Add some missing Fortran MPI-2 IO constants. - - -1.1.1: 28 Aug 2006 ------------------- - -- Fix for Fortran string handling in various MPI API functions. -- Fix for Fortran status handling in MPI_WAITSOME and MPI_TESTSOME. -- Various fixes for the XL compilers. -- Automatically disable using mallot() on AIX. -- Memory fixes for 64 bit platforms with registering MCA parameters in - the self and MX BTL components. -- Fixes for BProc to support oversubscription and changes to the - mapping algorithm so that mapping processes "by slot" works as - expected. -- Fixes for various abort cases to not hang and clean up nicely. -- If using the Intel 9.0 v20051201 compiler on an IA64 platform, the - ptmalloc2 memory manager component will automatically disable - itself. Other versions of the Intel compiler on this platform seem - to work fine (e.g., 9.1). -- Added "host" MPI_Info key to MPI_COMM_SPAWN and - MPI_COMM_SPAWN_MULTIPLE. -- Add missing C++ methods: MPI::Datatype::Create_indexed_block, - MPI::Datatype::Create_resized, MPI::Datatype::Get_true_extent. -- Fix OSX linker issue with Fortran bindings. -- Fixed MPI_COMM_SPAWN to start spawning new processes in slots that - (according to Open MPI) are not already in use. -- Added capability to "mpirun a.out" (without specifying -np) that - will run on all currently-allocated resources (e.g., within a batch - job such as SLURM, Torque, etc.). -- Fix a bug with one particular case of MPI_BCAST. Thanks to Doug - Gregor for identifying the problem. -- Ensure that the shared memory mapped file is only created when there - is more than one process on a node. -- Fixed problems with BProc stdin forwarding. -- Fixed problem with MPI_TYPE_INDEXED datatypes. Thanks to Yven - Fournier for identifying this problem. -- Fix some thread safety issues in MPI attributes and the openib BTL. -- Fix the BProc allocator to not potentially use the same resources - across multiple ORTE universes. -- Fix gm resource leak. -- More latency reduction throughout the code base. -- Make the TM PLS (PBS Pro, Torque, Open PBS) more scalable, and fix - some latent bugs that crept in v1.1. Thanks to the Thunderbird crew - at Sandia National Laboratories and Martin Schaffoner for access to - testing facilities to make this happen. -- Added new command line options to mpirun: - --nolocal: Do not run any MPI processes on the same node as mpirun - (compatibility with the OSC mpiexec launcher) - --nooversubscribe: Abort if the number of processes requested would - cause oversubscription - --quiet / -q: do not show spurious status messages - --version / -V: show the version of Open MPI -- Fix bus error in XGrid process starter. Thanks to Frank from the - Open MPI user's list for identifying the problem. -- Fix data size mismatches that caused memory errors on PPC64 - platforms during the startup of the openib BTL. -- Allow propagation of SIGUSR1 and SIGUSR2 signals from mpirun to - back-end MPI processes. -- Add missing MPI::Is_finalized() function. - - -1.1: 23 Jun 2006 ----------------- - -- Various MPI datatype fixes, optimizations. -- Fixed various problems on the SPARC architecture (e.g., not - correctly aligning addresses within structs). -- Improvements in various run-time error messages to be more clear - about what they mean and where the errors are occurring. -- Various fixes to mpirun's handling of --prefix. -- Updates and fixes for Cray/Red Storm support. -- Major improvements to the Fortran 90 MPI bindings: - - General improvements in compile/linking time and portability - between different F90 compilers. - - Addition of "trivial", "small" (the default), and "medium" - Fortran 90 MPI module sizes (v1.0.x's F90 module was - equivalent to "medium"). See the README file for more - explanation. - - Fix various MPI F90 interface functions and constant types to - match. Thanks to Michael Kluskens for pointing out the problems - to us. -- Allow short messagees to use RDMA (vs. send/receive semantics) to a - limited number peers in both the mvapi and openib BTL components. - This reduces communication latency over IB channels. -- Numerous performance improvements throughout the entire code base. -- Many minor threading fixes. -- Add a define OMPI_SKIP_CXX to allow the user to skip the mpicxx.h from - being included in mpi.h. It allows the user to compile C code with a CXX - compiler without including the CXX bindings. -- PERUSE support has been added. In order to activate it add - --enable-peruse to the configure options. All events described in - the PERUSE 2.0 draft are supported, plus one Open MPI - extension. PERUSE_COMM_REQ_XFER_CONTINUE allow to see how the data - is segmented internally, using multiple interfaces or the pipeline - engine. However, this version only support one event of each type - simultaneously attached to a communicator. -- Add support for running jobs in heterogeneous environments. - Currently supports environments with different endianness and - different representations of C++ bool and Fortran LOGICAL. - Mismatched sizes for other datatypes is not supported. -- Open MPI now includes an implementation of the MPI-2 One-Sided - Communications specification. -- Open MPI is now configurable in cross-compilation environments. - Several Fortran 77 and Fortran 90 tests need to be pre-seeded with - results from a config.cache-like file. -- Add --debug option to mpirun to generically invoke a parallel debugger. - - -1.0.3: Not released (all fixes included in 1.1) ------------------------------------------------ - -- Fix a problem noted by Chris Hennes where MPI_INFO_SET incorrectly - disallowed long values. -- Fix a problem in the launch system that could cause inconsistent - launch behavior, particularly when launching large jobs. -- Require that the openib BTL find . Thanks to Josh - Aune for the suggestion. -- Include updates to support the upcoming Autoconf 2.60 and Libtool - 2.0. Thanks to Ralf Wildenhues for all the work! -- Fix bug with infinite loop in the "round robin" process mapper. - Thanks to Paul Donohue for reporting the problem. -- Enusre that memory hooks are removed properly during MPI_FINALIZE. - Thanks to Neil Ludban for reporting the problem. -- Various fixes to the included support for ROMIO. -- Fix to ensure that MPI_LONG_LONG and MPI_LONG_LONG_INT are actually - synonyms, as defined by the MPI standard. Thanks to Martin Audet - for reporting this. -- Fix Fortran 90 configure tests to properly utilize LDFLAGS and LIBS. - Thanks to Terry Reeves for reporting the problem. -- Fix shared memory progression in asynchronous progress scenarios. - Thanks to Mykael Bouquey for reporting the problem. -- Fixed back-end operations for predefined MPI_PROD for some - datatypes. Thanks to Bert Wesarg for reporting this. -- Adapted configure to be able to handle Torque 2.1.0p0's (and above) - new library name. Thanks to Brock Palen for pointing this out and - providing access to a Torque 2.1.0p0 cluster to test with. -- Fixed situation where mpirun could set a shell pipeline's stdout - to non-blocking, causing the shell pipeline to prematurely fail. - Thanks to Darrell Kresge for figuring out what was happening. -- Fixed problems with leave_pinned that could cause Badness with the - mvapi BTL. -- Fixed problems with MPI_FILE_OPEN and non-blocking MPI-2 IO access. -- Fixed various InfiniBand port matching issues during startup. - Thanks to Scott Weitzenkamp for identifying these problems. -- Fixed various configure, build and run-time issues with ROMIO. - Thanks to Dries Kimpe for bringing them to our attention. -- Fixed error in MPI_COMM_SPLIT when dealing with intercommunicators. - Thanks to Bert Wesarg for identifying the problem. -- Fixed backwards handling of "high" parameter in MPI_INTERCOMM_MERGE. - Thanks to Michael Kluskens for pointing this out to us. -- Fixed improper handling of string arguments in Fortran bindings - for MPI-IO functionality -- Fixed segmentation fault with 64 bit applications on Solaris when - using the shared memory transports. -- Fixed MPI_COMM_SELF attributes to free properly at the beginning of - MPI_FINALIZE. Thanks to Martin Audet for bringing this to our - attention. -- Fixed alignment tests for cross-compiling to not cause errors with - recent versions of GCC. - - -1.0.2: 7 Apr 2006 ------------------ - -- Fixed assembly race condition on AMD64 platforms. -- Fixed residual .TRUE. issue with copying MPI attributes set from - Fortran. -- Remove unnecessary logic from Solaris pty I/O forwarding. Thanks to - Francoise Roch for bringing this to our attention. -- Fixed error when count = 0 was given for multiple completion MPI - functions (MPI_TESTSOME, MPI_TESTANY, MPI_TESTALL, MPI_WAITSOME, - MPI_WAITANY, MPI_WAITALL). -- Better handling in MPI_ABORT for when peer processes have already - died, especially under some resource managers. -- Random updates to README file, to include notes about the Portland - compilers. -- Random, small threading fixes to prevent deadlock. -- Fixed a problem with handling long mpirun app files. Thanks to Ravi - Manumachu for identifying the problem. -- Fix handling of strings in several of the Fortran 77 bindings. -- Fix LinuxPPC assembly issues. Thanks to Julian Seward for reporting - the problem. -- Enable pty support for standard I/O forwarding on platforms that - have ptys but do not have openpty(). Thanks to Pierre Valiron for - bringing this to our attention. -- Disable inline assembly for PGI compilers to avoid compiler errors. - Thanks to Troy Telford for bringing this to our attention. -- Added MPI_UNSIGNED_CHAR and MPI_SIGNED_CHAR to the allowed reduction - types. -- Fix a segv in variable-length message displays on Opterons running - Solaris. Thanks to Pierre Valiron for reporting the issue. -- Added MPI_BOOL to the intrinsic reduction operations MPI_LAND, - MPI_LOR, MPI_LXOR. Thanks to Andy Selle for pointing this out to us. -- Fixed TCP BTL network matching logic during MPI_INIT; in some cases - on multi-NIC nodes, a NIC could get paired with a NIC on another - network (typically resulting in deadlock). Thanks to Ken Mighell - for pointing this out to us. -- Change the behavior of orterun (mpirun, mpirexec) to search for - argv[0] and the cwd on the target node (i.e., the node where the - executable will be running in all systems except BProc, where the - searches are run on the node where orterun is invoked). -- Fix race condition in shared memory transport that could cause - crashes on machines with weak memory consistency models (including - POWER/PowerPC machines). -- Fix warnings about setting read-only MCA parameters on bproc systems. -- Change the exit status set by mpirun when an application process is - killed by a signal. The exit status is now set to signo + 128, which - conforms with the behavior of (almost) all shells. -- Correct a datatype problem with the convertor when partially - unpacking data. Now we can position the convertor to any position - not only on the predefined types boundaries. Thanks to Yvan Fournier - for reporting this to us. -- Fix a number of standard I/O forwarding issues, including the - ability to background mpirun and a loss of data issue when - redirecting mpirun's standard input from a file. -- Fixed bug in ompi_info where rcache and bml MCA parameters would not - be displayed. -- Fixed umask issues in the session directory. Thanks to Glenn Morris - for reporting this to us. -- Fixed tcsh-based LD_LIBRARY_PATH issues with --prefix. Thanks to - Glen Morris for identifying the problem and suggesting the fix. -- Removed extraneous \n's when setting PATH and LD_LIBRARY_PATH in the - rsh startup. Thanks to Glen Morris for finding these typos. -- Fixed missing constants in MPI C++ bindings. -- Fixed some errors caused by threading issues. -- Fixed openib BTL flow control logic to not overrun the number of - send wqes available. -- Update to match newest OpenIB user-level library API. Thanks to - Roland Dreier for submitting this patch. -- Report errors properly when failing to register memory in the openib - BTL. -- Reduce memory footprint of openib BTL. -- Fix parsing problem with mpirun's "-tv" switch. Thanks to Chris - Gottbrath for supplying the fix. -- Fix Darwin net/if.h configure warning. -- The GNU assembler unbelievably defaults to making stacks executable. - So when using gas, add flags to explicitly tell it to not make - stacks executable (lame but necessary). -- Add missing MPI::Request::Get_status() methods. Thanks to Bill - Saphir for pointing this out to us. -- Improved error messages on memory registration errors (e.g., when - using high-speed networks). -- Open IB support now checks firmware for how many outstanding RDMA - requests are supported. Thanks to Mellanox for pointing this out to - us. -- Enable printing of stack traces in MPI processes upon SIGBUS, - SIGSEGV, and SIGFPE if the platform supports it. -- Fixed F90 compilation support for the Lahey compiler. -- Fixed issues with ROMIO shared library support. -- Fixed internal accounting problems with rsh support. -- Update to GNU Libtool 1.5.22. -- Fix error in configure script when setting CCAS to ias (the Intel - assembler). -- Added missing MPI::Intercomm collectives. -- Fixed MPI_IN_PLACE handling for Fortran collectives. -- Fixed some more C++ const_cast<> issues. Thanks for Martin Audet - (again) for bringing this to our attention. -- Updated ROMIO with the version from MPICH 1.2.7p1, marked as version - 2005-06-09. -- Fixes for some cases where the use of MPI_BOTTOM could cause - problems. -- Properly handle the case where an mVAPI does not have shared receive - queue support (such as the one shipped by SilverStorm / Infinicon - for OS X). - - -1.0.1: 12 Dec 2005 ------------------- - -- Fixed assembly on Solaris AMD platforms. Thanks to Pierre Valiron - for bringing this to our attention. -- Fixed long messages in the send-to-self case. -- Ensure that when the "leave_pinned" option is used, the memory hooks - are also enabled. Thanks to Gleb Natapov for pointing this out. -- Fixed compile errors for IRIX. -- Allow hostfiles to have integer host names (for BProc clusters). -- Fixed a problem with message matching of out-of-order fragments in - multiple network device scenarios. -- Converted all the C++ MPI bindings to use proper const_cast<>'s - instead of old C-style casts to get rid of const-ness. Thanks to - Martin Audet for raising the issue with us. -- Converted MPI_Offset to be a typedef instead of a #define because it - causes problems for some C++ parsers. Thanks to Martin Audet for - bringing this to our attention. -- Improved latency of TCP BTL. -- Fixed index value in MPI_TESTANY to be MPI_UNDEFINED if some - requests were not MPI_REQUEST_NULL, but no requests finished. -- Fixed several Fortran MPI API implementations that incorrectly used - integers instead of logicals or address-sized integers. -- Fix so that Open MPI correctly handles the Fortran value for .TRUE., - regardless of what the Fortran compiler's value for .TRUE. is. -- Improved scalability of MX startup. -- Fix datatype offset handling in the coll basic component's - MPI_SCATTERV implementation. -- Fix EOF handling on stdin. -- Fix missing MPI_F_STATUS_IGNORE and MPI_F_STATUSES_IGNORE - instanatiations. Thanks to Anthony Chan for pointing this out. -- Add a missing value for MPI_WIN_NULL in mpif.h. -- Bring over some fixes for the sm btl that somehow didn't make it - over from the trunk before v1.0. Thanks to Beth Tibbitts and Bill - Chung for helping identify this issue. -- Bring over some fixes for the iof that somehow didn't make it over - from the trunk before v1.0. -- Fix for --with-wrapper-ldflags handling. Thanks to Dries Kimpe for - pointing this out to us. - - -1.0: 17 Nov 2005 ----------------- - -Initial public release. diff --git a/README.FT.ULFM.md b/README.FT.ULFM.md deleted file mode 100644 index ae727a7f6a9..00000000000 --- a/README.FT.ULFM.md +++ /dev/null @@ -1,483 +0,0 @@ -ULFM Open MPI - -This README.md documents the features and options specific to the -**User Level Failure Mitigation (ULFM)** Open MPI implementation. -The upstream (i.e. non-resilient) Open MPI directions also apply to -this release, except when specified here, and can be found in its -README file. - -[TOC] - -Features -======== -This implementation conforms to the User Level Failure Mitigation (ULFM) -MPI Standard draft proposal. The ULFM proposal is developed by the MPI -Forum's Fault Tolerance Working Group to support the continued operation of -MPI programs after crash (node failures) have impacted the execution. The key -principle is that no MPI call (point-to-point, collective, RMA, IO, ...) can -block indefinitely after a failure, but must either succeed or raise an MPI -error. - -This implementation produces the three supplementary error codes and five -supplementary interfaces defined in the communicator section of the -[http://fault-tolerance.org/wp-content/uploads/2012/10/20170221-ft.pdf] -(ULFM chapter) standard draft document. - -+ `MPIX_ERR_PROC_FAILED` when a process failure prevents the completion of - an MPI operation. -+ `MPIX_ERR_PROC_FAILED_PENDING` when a potential sender matching a non-blocking - wildcard source receive has failed. -+ `MPIX_ERR_REVOKED` when one of the ranks in the application has invoked the - `MPI_Comm_revoke` operation on the communicator. -+ `MPIX_Comm_revoke(MPI_Comm comm)` Interrupts any communication pending on - the communicator at all ranks. -+ `MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm* newcomm)` creates a new - communicator where dead processes in comm were removed. -+ `MPIX_Comm_agree(MPI_Comm comm, int *flag)` performs a consensus (i.e. fault - tolerant allreduce operation) on flag (with the operation bitwise AND). -+ `MPIX_Comm_failure_get_acked(MPI_Comm, MPI_Group*)` obtains the group of - currently acknowledged failed processes. -+ `MPIX_Comm_failure_ack(MPI_Comm)` acknowledges that the application intends - to ignore the effect of currently known failures on wildcard receive - completions and agreement return values. - -## Supported Systems -There are several MPI engines available in Open MPI, -notably, PML "ob1", "cm", "ucx", and MTL "ofi", "portals4", "psm2". -At this point, only "ob1" is adapted to support fault tolerance. - -"ob1" uses BTL ("Byte Transfer Layer") components for each supported -network. "ob1" supports a variety of networks that can be used in -combination with each other. Collective operations (blocking and -non-blocking) use an optimized implementation on top of "ob1". - -- Loopback (send-to-self) -- TCP -- UCT (InfiniBand) -- uGNI (Cray Gemini, Aries) -- Shared Memory (FT supported w/CMA and XPmem; KNEM is untested) -- Tuned and non-blocking collective communications - -A full list of supported, untested and disabled components is provided -later in this document. - -## More Information -More information (tutorials, examples, build instructions for leading -top500 systems) is also available in the Fault Tolerance Research -Hub website: - - -## Bibliographic References -If you are looking for, or want to cite a general reference for ULFM, -please use - -_Wesley Bland, Aurelien Bouteiller, Thomas Herault, George Bosilca, Jack -J. Dongarra: Post-failure recovery of MPI communication capability: Design -and rationale. IJHPCA 27(3): 244-254 (2013)._ - -Available from: http://journals.sagepub.com/doi/10.1177/1094342013488238. -___________________________________________________________________________ - -Building ULFM Open MPI -====================== -```bash -./configure --with-ft [...options...] -# use --with-ft to enable building with ULFM (default), -# --without-ft to disable it -make [-j N] all install -# use an integer value of N for parallel builds -``` -There are many available configure options (see `./configure --help` -for a full list); a summary of the more commonly used ones is included -in the upstream Open MPI README file. The following paragraph gives a -summary of ULFM Open MPI specific options behavior. - -## Configure options -+ `--with-ft=TYPE` - Specify the type of fault tolerance to enable. Options: mpi (ULFM MPI - draft standard). Fault tolerance build support is **enabled by default**. - -+ `--enable-mca-no-build=LIST` - Comma-separated list of _-_ pairs that will not be built. - For example, `--enable-mca-no-build=btl-portals,oob-ud` will disable - building the _portals BTL_ and the _ud OOB_ component. You can use this - option to disable components that are known to prevent supporting failure - management __when built-in__. By default, this list is empty, as ulfm has - a separate mechanism to warn about, or disable loading a component that - are poorly tested or known to cause breakage when fault-tolerance is - selected at runtime. - -+ `--with-pmi` - `--with-slurm` - Force the building of SLURM scheduler support. - Slurm with fault tolerance is tested. **Do not use `srun`**, otherwise your - application gets killed by the scheduler upon the first failure. Instead, - **Use `mpirun` in an `salloc/sbatch`**. - -+ `-with-lsf` - This is untested with fault tolerance. - -+ `--with-alps` - `--with-tm` - Force the building of PBS/Torque scheduler support. - PBS is tested with fault tolerance. **Use `mpirun` in a `qsub` - allocation.** - -+ `--disable-oshmem` - Disable building the OpenSHMEM implementation (by default, it is - enabled). - ULFM Fault Tolerance does not apply to OpenSHMEM. -___________________________________________________________________________ - -## Modified, Untested and Disabled Components -Frameworks and components which are not listed in the following list are -unmodified and support fault tolerance. Listed frameworks may be **modified** -(and work after a failure), **untested** (and work before a failure, but may -malfunction after a failure), or **disabled** (they cause unspecified behavior -all around when FT is enabled). - -All runtime disabled components are listed in the `ft-mpi` aggregate MCA param file -`$installdir/share/openmpi/amca-param-sets/ft-mpi`. You can tune the runtime behavior -with ULFM by either setting or unsetting variables in this file (or by overiding -the variable on the command line (e.g., ``--omca btl ofi,self``). Note that if FT is -runtime disabled, these components will load normally (this may change observed -performance when comparing with and without fault tolerance). - -- **pml** MPI point-to-point management layer - - "ob1" modified to **handle errors** - - "monitoring", "v" unmodified, **untested** - - "cm", "crcpw", "ucx" **disabled** - -- **btl** Point-to-point Byte Transfer Layer - - "ugni", "uct", "tcp", "sm(+cma,+xpmem)" modified to **handle errors** (removed - unconditional abort on error, expect performance similar to upstream) - - "ofi", "portals4", "smcuda", "usnic", "sm(+knem)" unmodified, - **untested** (may work properly, please report) - -- **mtl** Matching transport layer Used for MPI point-to-point messages on - some types of networks - - All "mtl" components are **disabled** - -- **coll** MPI collective algorithms - - "base", "basic", "tuned", "nbc" modified to **handle errors** - - "cuda", "inter", "sync", "sm" unmodified, **untested** (expect correct post-failure behavior) - - "hcoll", "portals4" unmodified, **disabled** (expect - unspecified post-failure behavior) - -- **osc** MPI one-sided communications - - Unmodified, **untested** (expect unspecified post-failure behavior) - -- **io** MPI I/O and dependent components - - _fs_ File system functions for MPI I/O - - _fbtl_ File byte transfer layer: abstraction for individual read/write - operations for OMPIO - - _fcoll_ Collective read and write operations for MPI I/O - - _sharedfp_ Shared file pointer operations for MPI I/O - - All components in these frameworks are unmodified, **untested** - (expect clean post-failure abort) - -- **vprotocol** Checkpoint/Restart components - - unmodified **untested** - -- **threads** `wait-sync` Multithreaded wait-synchronization object - - "pthreads" modified to **handle errors** (added a global interrupt to - trigger all wait_sync objects) - - "argotbots", "qthreads" unmodified, **disabled** (expect post-failure - deadlock) - -___________________________________________________________________________ - -Running ULFM Open MPI -===================== - -## Building your application - -As ULFM is still an extension to the MPI standard, you will need to -`#include ` in C, or `use mpi_ext` in Fortran to access the -supplementary error codes and functions. - -Compile your application as usual, using the provided `mpicc`, `mpif90`, or -`mpicxx` wrappers. - -## Running your application - -You can launch your application with fault tolerance by simply using the -provided `mpiexec`. Beware that your distribution may already provide a -version of MPI, make sure to set your `PATH` and `LD_LIBRARY_PATH` properly. -Note that fault tolerance is disabled by default in ULFM Open MPI; you can -enable the fault tolerance components by launching your application with -`mpiexec --enable-recovery`. - -## Running under a batch scheduler - -ULFM can operate under a job/batch scheduler, and is tested routinely with -both ALPS, PBS and Slurm. One difficulty comes from the fact that many job -schedulers will "cleanup" the application as soon as a process fails. In -order to avoid this problem, it is preferred that you use `mpiexec` -within an allocation (e.g. `salloc`, `sbatch`, `qsub`) rather than -a direct launch (e.g. `srun`). - -## Run-time tuning knobs - -ULFM comes with a variety of knobs for controlling how it runs. The default -parameters are sane and should result in very good performance in most -cases. You can change the default settings with `--omca mpi_ft_foo ` -for OMPI options, and with `--prtemca errmgr_detector_bar ` for -PRTE options. - -### PRTE level options - -- `prrte_enable_recovery (default: false)` controls automatic - cleanup of apps with failed processes within mpirun. Enabling this option - also enable `mpi_ft_enable`. -- `errmgr_detector_priority (default 1005`) selects the prte-based - failure detector. Only available when `prte_enable_recovery` is `true`. You - can set this to `0` when using the (experimental) OMPI detector instead. -- err`mgr_detector_heartbeat_period (default: 5e0)` controls the - heartbeat period. Recommended value is 1/2 of the timeout. -- `errmgr_detector_heartbeat_timeout (default: 1e1 seconds)` heartbeat - timeout (i.e. failure detection speed). Recommended value is 2 times - the heartbeat period. The default setup is tuned for failure-free - performance at the expense of fault detection reactivity. In environments - where faults are expected to be common, less conservative values can be - used (e.g., 100ms); Values lower than the TCP poll rate (typically 10ms) - can cause false positive. - -### OMPI level options - -- `mpi_ft_enable (default: same as prrte_enable_recovery)` - permits turning on/off fault tolerance at runtime. When false, failure - detection is disabled; Interfaces defined by the fault tolerance extensions - are substituted with dummy non-fault tolerant implementations (e.g., - `MPIX_Comm_agree` is implemented with `MPI_Allreduce`); All other controls - below become irrelevant. -- `mpi_ft_verbose (default: 0)` increases the output of the fault - tolerance activities. A value of 1 will report detected failures. -- `mpi_ft_detector (default: false)`, EXPERIMENTAL, controls - the activation of the OMPI level failure detector. When this detector - is turned off, all failure detection is delegated to PRTE (see above). - The OMPI level fault detector is experimental. There is a tradeoff between - failure detection accuracy and performance with this detector. Users that - experience accuracy issues may enable a more precise mode. - See the tuning knobs below to adjust to taste; - The OMPI failure detector operates on MPI_COMM_WORLD exclusively. - Processes connected from MPI_COMM_CONNECT/ACCEPT and MPI_COMM_SPAWN may - occasionally not be detected when they fail. -- `mpi_ft_detector_thread (default: false)` controls the use - of a thread to emit and receive failure detector's heartbeats. _Setting - this value to "true" will also set `MPI_THREAD_MULTIPLE` support, which - has a noticeable effect on latency (typically 1us increase)._ You may - want to **enable this option if you experience false positive** - processes incorrectly reported as failed with the OMPI failure detector. -- `mpi_ft_detector_period (default: 3e0 seconds)` heartbeat - period. Recommended value is 1/3 of the timeout. _Values lower than - 100us may impart a noticeable effect on latency (typically a 3us - increase)._ -- `mpi_ft_detector_timeout (default: 1e1 seconds)` heartbeat - timeout (i.e. failure detection speed). Recommended value is 3 times - the heartbeat period. - -## Known Limitations in ULFM - -- Infiniband support is provided through the OpenIB or UCT BTL, fault - tolerant operation over the UCX PML is not yet supported. -- TOPO, FILE, RMA are not fault tolerant. They are expected to work properly - before the occurence of the first failure. - -___________________________________________________________________________ - - -Changelog -========= - -## ULFM Integrated in Open MPI -ULFM is now integrated in Open MPI. This text will be updated when a new -Open MPI release is made. - -## ULFM Standalone Release 4.0.2u1 -This is a stability and upstream parity upgrade. It is based on the most -current Open MPI Release (v4.0.2, October 2019). - -- This release is based on Open MPI release v4.0.2 (ompi #cb5f4e737a). -- This release is based on ULFM master (ulfm #0e249ca1). -- New features - - Support for the UCT BTL enters beta stage. -- Bugfixes - - High sensitivity to noise in the failure detector. - - Deadlocks when revoking while BTL progress threads are updating messages. - - A case where the failure detector would keep observing a dead process forever. - - Disable the use of external pmix/libevent by default (the internals are modified - to handle error cases). - - Clean error paths leaving some rdma registration dangling. - - Do not remove the orte job/proc session dir prematurely upon error. - -## ULFM Standalone Release 4.0.1u1 -This is a stability and upstream parity upgrade. It improves stability, -performance and is based on the most current Open MPI Release (v4.0.1, -May 2019). - -- This release is based on Open MPI release v4.0.1 (ompi #b780667). -- This release is based on ULFM master (ulfm #cf8dc43f). -- New features - - Addition of the `MPI_Comm_is_revoked` function - - Renamed `ftbasic` collective component to `ftagree` - - Restored the `pcollreq` extension -- Bugfixes - - Failures of node-local siblings were not always detected - - Failure propagation and detection was slowed down by trying to - notify known dead processes - - There were deadlocks in multithreaded programs - - There were issues with PMPI when compiling Fortran Interfaces - - There were deadlocks on OS-X - -## ULFM Standalone Release 2.1 -This release is a bugfix and upstream parity upgrade. It improves stability, -performance and is based on the most current Open MPI master (November 2018). - -- ULFM is now based upon Open MPI master branch (#37954b5f). -- ULFM tuning MCA parameters are exposed by `ompi_info`. -- Fortran 90 bindings have been updated -- Bugfixes: - - Correct the behavior of process placement during an MPI_COMM_SPAWN when - some slots were occcupied by failed processes. - - MPI_COMM_SPAWN accepts process placement directives in the Info object. - - Fixed deadlocks in some NBC collective operations. - - Crashes and deadlocks in MPI_FINALIZE have been resolved. - - Any-source requests that returned with an error status of - MPIX_PROC_FAILED_PENDING can now correctly complete during - later MPI_WAIT/TEST. - -## ULFM Standalone Release 2.0 -Focus has been toward integration with current Open MPI master (November 2017), -performance, and stability. - -- ULFM is now based upon Open MPI master branch (#689f1be9). It will be - regularly updated until it will eventually be merged. -- Fault Tolerance is enabled by default and is controlled with MCA variables. -- Added support for multithreaded modes (MPI_THREAD_MULTIPLE, etc.) -- Added support for non-blocking collective operations (NBC). -- Added support for CMA shared memory transport (Vader). -- Added support for advanced failure detection at the MPI level. - Implements the algorithm described in "Failure detection and - propagation in HPC systems." . -- Removed the need for special handling of CID allocation. -- Non-usable components are automatically removed from the build during configure -- RMA, FILES, and TOPO components are enabled by default, and usage in a fault - tolerant execution warns that they may cause undefined behavior after a failure. -- Bugfixes: - - Code cleanup and performance cleanup in non-FT builds; --without-ft at - configure time gives an almost stock Open MPI. - - Code cleanup and performance cleanup in FT builds with FT runtime disabled; - --mca ft_enable_mpi false thoroughly disables FT runtime activities. - - Some error cases would return ERR_PENDING instead of ERR_PROC_FAILED in - collective operations. - - Some test could set ERR_PENDING or ERR_PROC_FAILED instead of - ERR_PROC_FAILED_PENDING for ANY_SOURCE receptions. -___________________________________________________________________________ - -## ULFM Standalone Release 1.1 -Focus has been toward improving stability, feature coverage for intercomms, -and following the updated specification for MPI_ERR_PROC_FAILED_PENDING. - -- Forked from Open MPI 1.5.5 devel branch -- Addition of the MPI_ERR_PROC_FAILED_PENDING error code, as per newer specification - revision. Properly returned from point-to-point, non-blocking ANY_SOURCE operations. -- Alias MPI_ERR_PROC_FAILED, MPI_ERR_PROC_FAILED_PENDING and MPI_ERR_REVOKED to the - corresponding standard blessed -extension- names MPIX_ERR_xxx. -- Support for Intercommunicators: - - Support for the blocking version of the agreement, MPI_COMM_AGREE on Intercommunicators. - - MPI_COMM_REVOKE tested on intercommunicators. -- Disabled completely (.ompi_ignore) many untested components. -- Changed the default ORTE failure notification propagation aggregation delay from 1s to 25ms. -- Added an OMPI internal failure propagator; failure propagation between SM domains is now - immediate. -- Bugfixes: - - SendRecv would not always report MPI_ERR_PROC_FAILED correctly. - - SendRecv could incorrectly update the status with errors pertaining to the Send portion - of the Sendrecv. - - Revoked send operations are now always completed or remote cancelled and may not - deadlock anymore. - - Cancelled send operations to a dead peer will not trigger an assert when the BTL reports - that same failure. - - Repeat calls to operations returning MPI_ERR_PROC_FAILED will eventually return - MPI_ERR_REVOKED when another process revokes the communicator. -___________________________________________________________________________ - -## ULFM Standalone Release 1.0 -Focus has been toward improving performance, both before and after the occurence of failures. -The list of new features includes: - -- Support for the non-blocking version of the agreement, MPI_COMM_IAGREE. -- Compliance with the latest ULFM specification draft. In particular, the - MPI_COMM_(I)AGREE semantic has changed. -- New algorithm to perform agreements, with a truly logarithmic complexity in number of - ranks, which translates into huge performance boosts in MPI_COMM_(I)AGREE and - MPI_COMM_SHRINK. -- New algorithm to perform communicator revocation. MPI_COMM_REVOKE performs a reliable - broadcast with a fixed maximum output degree, which scales logarithmically with the - number of ranks. -- Improved support for our traditional network layer: - - TCP: fully tested - - SM: fully tested (with the exception of XPMEM, which remains unsupported) -- Added support for High Performance networks - - Open IB: reasonably tested - - uGNI: reasonably tested -- The tuned collective module is now enabled by default (reasonably tested), expect a - huge performance boost compared to the former basic default setting - - Back-ported PBS/ALPS fixes from Open MPI - - Back-ported OpenIB bug/performance fixes from Open MPI - - Improve Context ID allocation algorithm to reduce overheads of Shrink - - Miscellaneous bug fixes -___________________________________________________________________________ - -## Binary Compatibility -ULFM Open MPI is binary compatible with any version of Open MPI compatible -with the underlying Open MPI master branch or release (see -the binary compatibility and version number section in the upstream Open MPI -README). That is, applications compiled with a compatible Open MPI can run -with the ULFM Open MPI `mpirun` and MPI libraries. Conversely, _as long as -the application does not employ one of the MPIX functions_, which are -exclusively defined in ULFM Open MPI, an application compiled with -ULFM Open MPI can be launched with a compatible Open MPI `mpirun` and run -with the non-fault tolerant MPI library. -___________________________________________________________________________ - -Contacting the Authors -====================== -Found a bug? Got a question? Want to make a suggestion? Want to -contribute to ULFM Open MPI? Working on a cool use-case? -Please let us know! - -The best way to report bugs, send comments, or ask questions is to -sign up on the user's mailing list: - - -Because of spam, only subscribers are allowed to post to these lists -(ensure that you subscribe with and post from exactly the same e-mail -address -- joe@example.com is considered different than -joe@mycomputer.example.com!). Visit these pages to subscribe to the -lists: - - -When submitting questions and problems, be sure to include as much -extra information as possible. This web page details all the -information that we request in order to provide assistance: - - -Thanks for your time. -___________________________________________________________________________ - -Copyright -========= - -``` -Copyright (c) 2012-2020 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. - -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ -``` diff --git a/README.JAVA.md b/README.JAVA.md deleted file mode 100644 index 234c7a6a1c6..00000000000 --- a/README.JAVA.md +++ /dev/null @@ -1,281 +0,0 @@ -# Open MPI Java Bindings - -## Important node - -JAVA BINDINGS ARE PROVIDED ON A "PROVISIONAL" BASIS - I.E., THEY ARE -NOT PART OF THE CURRENT OR PROPOSED MPI STANDARDS. THUS, INCLUSION OF -JAVA SUPPORT IS NOT REQUIRED BY THE STANDARD. CONTINUED INCLUSION OF -THE JAVA BINDINGS IS CONTINGENT UPON ACTIVE USER INTEREST AND -CONTINUED DEVELOPER SUPPORT. - -## Overview - -This version of Open MPI provides support for Java-based -MPI applications. - -The rest of this document provides step-by-step instructions on -building OMPI with Java bindings, and compiling and running Java-based -MPI applications. Also, part of the functionality is explained with -examples. Further details about the design, implementation and usage -of Java bindings in Open MPI can be found in [1]. The bindings follow -a JNI approach, that is, we do not provide a pure Java implementation -of MPI primitives, but a thin layer on top of the C -implementation. This is the same approach as in mpiJava [2]; in fact, -mpiJava was taken as a starting point for Open MPI Java bindings, but -they were later totally rewritten. - -1. O. Vega-Gisbert, J. E. Roman, and J. M. Squyres. "Design and - implementation of Java bindings in Open MPI". Parallel Comput. - 59: 1-20 (2016). -2. M. Baker et al. "mpiJava: An object-oriented Java interface to - MPI". In Parallel and Distributed Processing, LNCS vol. 1586, - pp. 748-762, Springer (1999). - -## Building Java Bindings - -If this software was obtained as a developer-level checkout as opposed -to a tarball, you will need to start your build by running -`./autogen.pl`. This will also require that you have a fairly recent -version of GNU Autotools on your system - see the HACKING.md file for -details. - -Java support requires that Open MPI be built at least with shared libraries -(i.e., `--enable-shared`) - any additional options are fine and will not -conflict. Note that this is the default for Open MPI, so you don't -have to explicitly add the option. The Java bindings will build only -if `--enable-mpi-java` is specified, and a JDK is found in a typical -system default location. - -If the JDK is not in a place where we automatically find it, you can -specify the location. For example, this is required on the Mac -platform as the JDK headers are located in a non-typical location. Two -options are available for this purpose: - -1. `--with-jdk-bindir=`: the location of `javac` and `javah` -1. `--with-jdk-headers=`: the directory containing `jni.h` - -For simplicity, typical configurations are provided in platform files -under `contrib/platform/hadoop`. These will meet the needs of most -users, or at least provide a starting point for your own custom -configuration. - -In summary, therefore, you can configure the system using the -following Java-related options: - -``` -$ ./configure --with-platform=contrib/platform/hadoop/ ... - -```` - -or - -``` -$ ./configure --enable-mpi-java --with-jdk-bindir= --with-jdk-headers= ... -``` - -or simply - -``` -$ ./configure --enable-mpi-java ... -``` - -if JDK is in a "standard" place that we automatically find. - -## Running Java Applications - -For convenience, the `mpijavac` wrapper compiler has been provided for -compiling Java-based MPI applications. It ensures that all required MPI -libraries and class paths are defined. You can see the actual command -line using the `--showme` option, if you are interested. - -Once your application has been compiled, you can run it with the -standard `mpirun` command line: - -``` -$ mpirun java -``` - -For convenience, `mpirun` has been updated to detect the `java` command -and ensure that the required MPI libraries and class paths are defined -to support execution. You therefore do _NOT_ need to specify the Java -library path to the MPI installation, nor the MPI classpath. Any class -path definitions required for your application should be specified -either on the command line or via the `CLASSPATH` environment -variable. Note that the local directory will be added to the class -path if nothing is specified. - -As always, the `java` executable, all required libraries, and your -application classes must be available on all nodes. - -## Basic usage of Java bindings - -There is an MPI package that contains all classes of the MPI Java -bindings: `Comm`, `Datatype`, `Request`, etc. These classes have a -direct correspondence with classes defined by the MPI standard. MPI -primitives are just methods included in these classes. The convention -used for naming Java methods and classes is the usual camel-case -convention, e.g., the equivalent of `MPI_File_set_info(fh,info)` is -`fh.setInfo(info)`, where `fh` is an object of the class `File`. - -Apart from classes, the MPI package contains predefined public -attributes under a convenience class `MPI`. Examples are the -predefined communicator `MPI.COMM_WORLD` or predefined datatypes such -as `MPI.DOUBLE`. Also, MPI initialization and finalization are methods -of the `MPI` class and must be invoked by all MPI Java -applications. The following example illustrates these concepts: - -```java -import mpi.*; - -class ComputePi { - - public static void main(String args[]) throws MPIException { - - MPI.Init(args); - - int rank = MPI.COMM_WORLD.getRank(), - size = MPI.COMM_WORLD.getSize(), - nint = 100; // Intervals. - double h = 1.0/(double)nint, sum = 0.0; - - for(int i=rank+1; i<=nint; i+=size) { - double x = h * ((double)i - 0.5); - sum += (4.0 / (1.0 + x * x)); - } - - double sBuf[] = { h * sum }, - rBuf[] = new double[1]; - - MPI.COMM_WORLD.reduce(sBuf, rBuf, 1, MPI.DOUBLE, MPI.SUM, 0); - - if(rank == 0) System.out.println("PI: " + rBuf[0]); - MPI.Finalize(); - } -} -``` - -## Exception handling - -Java bindings in Open MPI support exception handling. By default, errors -are fatal, but this behavior can be changed. The Java API will throw -exceptions if the MPI.ERRORS_RETURN error handler is set: - -```java -MPI.COMM_WORLD.setErrhandler(MPI.ERRORS_RETURN); -``` - -If you add this statement to your program, it will show the line -where it breaks, instead of just crashing in case of an error. -Error-handling code can be separated from main application code by -means of try-catch blocks, for instance: - -```java -try -{ - File file = new File(MPI.COMM_SELF, "filename", MPI.MODE_RDONLY); -} -catch(MPIException ex) -{ - System.err.println("Error Message: "+ ex.getMessage()); - System.err.println(" Error Class: "+ ex.getErrorClass()); - ex.printStackTrace(); - System.exit(-1); -} -``` - -## How to specify buffers - -In MPI primitives that require a buffer (either send or receive) the -Java API admits a Java array. Since Java arrays can be relocated by -the Java runtime environment, the MPI Java bindings need to make a -copy of the contents of the array to a temporary buffer, then pass the -pointer to this buffer to the underlying C implementation. From the -practical point of view, this implies an overhead associated to all -buffers that are represented by Java arrays. The overhead is small -for small buffers but increases for large arrays. - -There is a pool of temporary buffers with a default capacity of 64K. -If a temporary buffer of 64K or less is needed, then the buffer will -be obtained from the pool. But if the buffer is larger, then it will -be necessary to allocate the buffer and free it later. - -The default capacity of pool buffers can be modified with an Open MPI -MCA parameter: - -``` -shell$ mpirun --mca mpi_java_eager size ... -``` - -Where `size` is the number of bytes, or kilobytes if it ends with 'k', -or megabytes if it ends with 'm'. - -An alternative is to use "direct buffers" provided by standard classes -available in the Java SDK such as `ByteBuffer`. For convenience we -provide a few static methods `new[Type]Buffer` in the `MPI` class to -create direct buffers for a number of basic datatypes. Elements of the -direct buffer can be accessed with methods `put()` and `get()`, and -the number of elements in the buffer can be obtained with the method -`capacity()`. This example illustrates its use: - -```java -int myself = MPI.COMM_WORLD.getRank(); -int tasks = MPI.COMM_WORLD.getSize(); - -IntBuffer in = MPI.newIntBuffer(MAXLEN * tasks), - out = MPI.newIntBuffer(MAXLEN); - -for(int i = 0; i < MAXLEN; i++) - out.put(i, myself); // fill the buffer with the rank - -Request request = MPI.COMM_WORLD.iAllGather( - out, MAXLEN, MPI.INT, in, MAXLEN, MPI.INT); -request.waitFor(); -request.free(); - -for(int i = 0; i < tasks; i++) -{ - for(int k = 0; k < MAXLEN; k++) - { - if(in.get(k + i * MAXLEN) != i) - throw new AssertionError("Unexpected value"); - } -} -``` - -Direct buffers are available for: `BYTE`, `CHAR`, `SHORT`, `INT`, -`LONG`, `FLOAT`, and `DOUBLE`. There is no direct buffer for booleans. - -Direct buffers are not a replacement for arrays, because they have -higher allocation and deallocation costs than arrays. In some -cases arrays will be a better choice. You can easily convert a -buffer into an array and vice versa. - -All non-blocking methods must use direct buffers and only -blocking methods can choose between arrays and direct buffers. - -The above example also illustrates that it is necessary to call -the `free()` method on objects whose class implements the `Freeable` -interface. Otherwise a memory leak is produced. - -## Specifying offsets in buffers - -In a C program, it is common to specify an offset in a array with -`&array[i]` or `array+i`, for instance to send data starting from -a given position in the array. The equivalent form in the Java bindings -is to `slice()` the buffer to start at an offset. Making a `slice()` -on a buffer is only necessary, when the offset is not zero. Slices -work for both arrays and direct buffers. - -```java -import static mpi.MPI.slice; -// ... -int numbers[] = new int[SIZE]; -// ... -MPI.COMM_WORLD.send(slice(numbers, offset), count, MPI.INT, 1, 0); -``` - -## Questions? Problems? - -If you have any problems, or find any bugs, please feel free to report -them to [Open MPI user's mailing -list](https://www.open-mpi.org/community/lists/ompi.php). diff --git a/README.md b/README.md index 572ee880d14..99f0124ebfb 100644 --- a/README.md +++ b/README.md @@ -1,2191 +1,31 @@ # Open MPI -The Open MPI Project is an open source Message Passing Interface (MPI) -implementation that is developed and maintained by a consortium of -academic, research, and industry partners. Open MPI is therefore able -to combine the expertise, technologies, and resources from all across -the High Performance Computing community in order to build the best -MPI library available. Open MPI offers advantages for system and -software vendors, application developers and computer science -researchers. - -See [the MPI Forum web site](https://mpi-forum.org/) for information -about the MPI API specification. - -## Quick start - -In many cases, Open MPI can be built and installed by simply -indicating the installation directory on the command line: - -``` -$ tar xf openmpi-.tar.bz2 -$ cd openmpi- -$ ./configure --prefix= |& tee config.out -...lots of output... -$ make -j 8 |& tee make.out -...lots of output... -$ make install |& tee install.out -...lots of output... -``` - -Note that there are many, many configuration options to the -`./configure` step. Some of them may be needed for your particular -environmnet; see below for desciptions of the options available. - -If your installation prefix path is not writable by a regular user, -you may need to use sudo or su to run the `make install` step. For -example: - -``` -$ sudo make install |& tee install.out -[sudo] password for jsquyres: -...lots of output... -``` - -Finally, note that VPATH builds are fully supported. For example: - -``` -$ tar xf openmpi-.tar.bz2 -$ cd openmpi- -$ mkdir build -$ cd build -$ ../configure --prefix= |& tee config.out -...etc. -``` - -## Table of contents - -The rest of this file contains: - -* [General release notes about Open MPI](#general-notes) - * [Platform-specific notes](#platform-notes) - * [Compiler-specific notes](#compiler-notes) - * [Run-time support notes](#general-run-time-support-notes) - * [MPI functionality and features](#mpi-functionality-and-features) - * [OpenSHMEM functionality and - features](#openshmem-functionality-and-features) - * [MPI collectives](#mpi-collectives) - * [OpenSHMEM collectives](#openshmem-collectives) - * [Network support](#network-support) - * [Open MPI extensions](#open-mpi-extensions) -* [Detailed information on building Open MPI](#building-open-mpi) - * [Installation options](#installation-options) - * [Networking support and options](#networking-support--options) - * [Run-time system support and options](#run-time-system-support) - * [Miscellaneous support - libraries](#miscellaneous-support-libraries) - * [MPI functionality options](#mpi-functionality) - * [OpenSHMEM functionality options](#openshmem-functionality) - * [Miscellaneous functionality - options](#miscellaneous-functionality) -* [Open MPI version and library numbering - policies](#open-mpi-version-numbers-and-binary-compatibility) - * [Backwards compatibility polices](#backwards-compatibility) - * [Software version numbering](#software-version-number) - * [Shared library version numbering](#shared-library-version-number) -* [Information on how to both query and validate your Open MPI - installation](#checking-your-open-mpi-installation) -* [Description of Open MPI extensions](#open-mpi-api-extensions) - * [Compiling the extensions](#compiling-the-extensions) - * [Using the extensions](#using-the-extensions) -* [Examples showing how to compile Open MPI applications](#compiling-open-mpi-applications) -* [Examples showing how to run Open MPI applications](#running-open-mpi-applications) -* [Summary information on the various plugin - frameworks](#the-modular-component-architecture-mca) - * [MPI layer frameworks](#mpi-layer-frameworks) - * [OpenSHMEM component frameworks](#openshmem-component-frameworks) - * [Run-time environment - frameworks](#back-end-run-time-environment-rte-component-frameworks) - * [Miscellaneous frameworks](#miscellaneous-frameworks) - * [Other notes about frameworks](#framework-notes) -* [How to get more help](#questions--problems) - -Also, note that much, much more information is also available [in the -Open MPI FAQ](https://www.open-mpi.org/faq/). - - -## General notes - -The following abbreviated list of release notes applies to this code -base as of this writing (April 2020): - -* Open MPI now includes two public software layers: MPI and OpenSHMEM. - Throughout this document, references to Open MPI implicitly include - both of these layers. When distinction between these two layers is - necessary, we will reference them as the "MPI" and "OpenSHMEM" - layers respectively. - -* OpenSHMEM is a collaborative effort between academia, industry, and - the U.S. Government to create a specification for a standardized API - for parallel programming in the Partitioned Global Address Space - (PGAS). For more information about the OpenSHMEM project, including - access to the current OpenSHMEM specification, please visit - http://openshmem.org/. - - This OpenSHMEM implementation will only work in Linux environments - with a restricted set of supported networks. - -* Open MPI includes support for a wide variety of supplemental - hardware and software package. When configuring Open MPI, you may - need to supply additional flags to the `configure` script in order - to tell Open MPI where the header files, libraries, and any other - required files are located. As such, running `configure` by itself - may not include support for all the devices (etc.) that you expect, - especially if their support headers / libraries are installed in - non-standard locations. Network interconnects are an easy example - to discuss -- Libfabric and OpenFabrics networks, for example, both - have supplemental headers and libraries that must be found before - Open MPI can build support for them. You must specify where these - files are with the appropriate options to configure. See the - listing of configure command-line switches, below, for more details. - -* The majority of Open MPI's documentation is here in this file, the - included man pages, and on [the web site - FAQ](https://www.open-mpi.org/). - -* Note that Open MPI documentation uses the word "component" - frequently; the word "plugin" is probably more familiar to most - users. As such, end users can probably completely substitute the - word "plugin" wherever you see "component" in our documentation. - For what it's worth, we use the word "component" for historical - reasons, mainly because it is part of our acronyms and internal API - function calls. - -* The run-time systems that are currently supported are: - * rsh / ssh - * PBS Pro, Torque - * Platform LSF (tested with v9.1.1 and later) - * SLURM - * Cray XE, XC, and XK - * Oracle Grid Engine (OGE) 6.1, 6.2 and open source Grid Engine - -* Systems that have been tested are: - * Linux (various flavors/distros), 64 bit (x86, ppc, aarch64), - with gcc (>=4.8.x+), clang (>=3.6.0), Absoft (fortran), Intel, - and Portland (*) - * macOS (10.14-10.15), 64 bit (x86_64) with XCode compilers - - (*) Be sure to read the Compiler Notes, below. - -* Other systems have been lightly (but not fully) tested: - * Linux (various flavors/distros), 32 bit, with gcc - * Cygwin 32 & 64 bit with gcc - * ARMv6, ARMv7 - * Other 64 bit platforms. - * OpenBSD. Requires configure options `--enable-mca-no-build=patcher` - and `--disable-dlopen` with this release. - * Problems have been reported when building Open MPI on FreeBSD 11.1 - using the clang-4.0 system compiler. A workaround is to build - Open MPI using the GNU compiler. - -* Open MPI has taken some steps towards [Reproducible - Builds](https://reproducible-builds.org/). Specifically, Open MPI's - `configure` and `make` process, by default, records the build date - and some system-specific information such as the hostname where Open - MPI was built and the username who built it. If you desire a - Reproducible Build, set the `$SOURCE_DATE_EPOCH`, `$USER` and - `$HOSTNAME` environment variables before invoking `configure` and - `make`, and Open MPI will use those values instead of invoking - `whoami` and/or `hostname`, respectively. See - https://reproducible-builds.org/docs/source-date-epoch/ for - information on the expected format and content of the - `$SOURCE_DATE_EPOCH` variable. - - -### Platform Notes - -- N/A - - -### Compiler Notes - -* Open MPI requires a C99-capable compiler to build. - -* On platforms other than x86-64, ARM, and PPC, Open MPI requires a - compiler that either supports C11 atomics or the GCC `__atomic` - atomics (e.g., GCC >= v4.7.2). - -* Mixing compilers from different vendors when building Open MPI - (e.g., using the C/C++ compiler from one vendor and the Fortran - compiler from a different vendor) has been successfully employed by - some Open MPI users (discussed on the Open MPI user's mailing list), - but such configurations are not tested and not documented. For - example, such configurations may require additional compiler / - linker flags to make Open MPI build properly. - - A not-uncommon case for this is when building on MacOS with the - system-default GCC compiler (i.e., `/usr/bin/gcc`), but a 3rd party - gfortran (e.g., provided by Homebrew, in `/usr/local/bin/gfortran`). - Since these compilers are provided by different organizations, they - have different default search paths. For example, if Homebrew has - also installed a local copy of Libevent (a 3rd party package that - Open MPI requires), the MacOS-default `gcc` linker will find it - without any additional command line flags, but the Homebrew-provided - gfortran linker will not. In this case, it may be necessary to - provide the following on the configure command line: - - ``` - $ ./configure FCFLAGS=-L/usr/local/lib ... - ``` - - This `-L` flag will then be passed to the Fortran linker when - creating Open MPI's Fortran libraries, and it will therefore be able - to find the installed Libevent. - -* In general, the latest versions of compilers of a given vendor's - series have the least bugs. We have seen cases where Vendor XYZ's - compiler version A.B fails to compile Open MPI, but version A.C - (where C>B) works just fine. If you run into a compile failure, you - might want to double check that you have the latest bug fixes and - patches for your compiler. - -* Users have reported issues with older versions of the Fortran PGI - compiler suite when using Open MPI's (non-default) `--enable-debug` - configure option. Per the above advice of using the most recent - version of a compiler series, the Open MPI team recommends using the - latest version of the PGI suite, and/or not using the `--enable-debug` - configure option. If it helps, here's what we have found with some - (not comprehensive) testing of various versions of the PGI compiler - suite: - - * pgi-8 : NO known good version with `--enable-debug` - * pgi-9 : 9.0-4 known GOOD - * pgi-10: 10.0-0 known GOOD - * pgi-11: NO known good version with `--enable-debug` - * pgi-12: 12.10 known BAD with `-m32`, but known GOOD without `-m32` - (and 12.8 and 12.9 both known BAD with `--enable-debug`) - * pgi-13: 13.9 known BAD with `-m32`, 13.10 known GOOD without `-m32` - * pgi-15: 15.10 known BAD with `-m32` - -* Similarly, there is a known Fortran PGI compiler issue with long - source directory path names that was resolved in 9.0-4 (9.0-3 is - known to be broken in this regard). - -* Open MPI does not support the PGI compiler suite on OS X or MacOS. - See issues below for more details: - * https://github.com/open-mpi/ompi/issues/2604 - * https://github.com/open-mpi/ompi/issues/2605 - -* OpenSHMEM Fortran bindings do not support the "no underscore" - Fortran symbol convention. IBM's `xlf` compilers build in that mode - by default. As such, IBM's `xlf` compilers cannot build/link the - OpenSHMEM Fortran bindings by default. A workaround is to pass - `FC="xlf -qextname"` at configure time to force a trailing - underscore. See [this - issue](https://github.com/open-mpi/ompi/issues/3612) for more - details. - -* MPI applications that use the mpi_f08 module on PowerPC platforms - (tested ppc64le) will likely experience runtime failures if: - * they are using a GNU linker (ld) version after v2.25.1 and before v2.28, - *and* - * they compiled with PGI (tested 17.5) or XL (tested v15.1.5) compilers. - This was noticed on Ubuntu 16.04 which uses the 2.26.1 version of - `ld` by default. However, this issue impacts any OS using a version - of `ld` noted above. This GNU linker regression will be fixed in - version 2.28. [Here is a link to the GNU bug on this - issue](https://sourceware.org/bugzilla/show_bug.cgi?id=21306). The - XL compiler will include a fix for this issue in a future release. - -* On NetBSD-6 (at least AMD64 and i386), and possibly on OpenBSD, - Libtool misidentifies properties of f95/g95, leading to obscure - compile-time failures if used to build Open MPI. You can work - around this issue by ensuring that libtool will not use f95/g95 - (e.g., by specifying `FC=`, or otherwise ensuring - a different Fortran compiler will be found earlier in the path than - `f95`/`g95`), or by disabling the Fortran MPI bindings with - `--disable-mpi-fortran`. - -* On OpenBSD/i386, if you configure with - `--enable-mca-no-build=patcher`, you will also need to add - `--disable-dlopen`. Otherwise, odd crashes can occur - nondeterministically. - -* Absoft 11.5.2 plus a service pack from September 2012 (which Absoft - says is available upon request), or a version later than 11.5.2 - (e.g., 11.5.3), is required to compile the Fortran `mpi_f08` - module. - -* Open MPI does not support the Sparc v8 CPU target. However, - as of Solaris Studio 12.1, and later compilers, one should not - specify `-xarch=v8plus` or `-xarch=v9`. The use of the options - `-m32` and `-m64` for producing 32 and 64 bit targets, respectively, - are now preferred by the Solaris Studio compilers. GCC may - require either `-m32` or `-mcpu=v9 -m32`, depending on GCC version. - -* If one tries to build OMPI on Ubuntu with Solaris Studio using the C++ - compiler and the `-m32` option, you might see a warning: - - ``` - CC: Warning: failed to detect system linker version, falling back to custom linker usage - ``` - - And the build will fail. One can overcome this error by either - setting `LD_LIBRARY_PATH` to the location of the 32 bit libraries - (most likely /lib32), or giving `LDFLAGS="-L/lib32 -R/lib32"` to the - `configure` command. Officially, Solaris Studio is not supported on - Ubuntu Linux distributions, so additional problems might be - incurred. - -* Open MPI does not support the `gccfss` compiler (GCC For SPARC - Systems; a now-defunct compiler project from Sun). - -* At least some versions of the Intel 8.1 compiler seg fault while - compiling certain Open MPI source code files. As such, it is not - supported. - -* It has been reported that the Intel 9.1 and 10.0 compilers fail to - compile Open MPI on IA64 platforms. As of 12 Sep 2012, there is - very little (if any) testing performed on IA64 platforms (with any - compiler). Support is "best effort" for these platforms, but it is - doubtful that any effort will be expended to fix the Intel 9.1 / - 10.0 compiler issuers on this platform. - -* Early versions of the Intel 12.1 Linux compiler suite on x86_64 seem - to have a bug that prevents Open MPI from working. Symptoms - including immediate segv of the wrapper compilers (e.g., `mpicc`) and - MPI applications. As of 1 Feb 2012, if you upgrade to the latest - version of the Intel 12.1 Linux compiler suite, the problem will go - away. - -* The Portland Group compilers prior to version 7.0 require the - `-Msignextend` compiler flag to extend the sign bit when converting - from a shorter to longer integer. This is is different than other - compilers (such as GNU). When compiling Open MPI with the Portland - compiler suite, the following flags should be passed to Open MPI's - `configure` script: - - ``` - shell$ ./configure CFLAGS=-Msignextend CXXFLAGS=-Msignextend \ - --with-wrapper-cflags=-Msignextend \ - --with-wrapper-cxxflags=-Msignextend ... - ``` - - This will both compile Open MPI with the proper compile flags and - also automatically add "-Msignextend" when the C and C++ MPI wrapper - compilers are used to compile user MPI applications. - -* It has been reported that Pathscale 5.0.5 and 6.0.527 compilers - give an internal compiler error when trying to build Open MPI. - -* As of July 2017, the Pathscale compiler suite apparently has no - further commercial support, and it does not look like there will be - further releases. Any issues discovered regarding building / - running Open MPI with the Pathscale compiler suite therefore may not - be able to be resolved. - -* Using the Absoft compiler to build the MPI Fortran bindings on Suse - 9.3 is known to fail due to a Libtool compatibility issue. - -* MPI Fortran API support has been completely overhauled since the - Open MPI v1.5/v1.6 series. - - There is now only a single Fortran MPI wrapper compiler and a - single Fortran OpenSHMEM wrapper compiler: `mpifort` and `oshfort`, - respectively. `mpif77` and `mpif90` still exist, but they are - symbolic links to `mpifort`. - - Similarly, Open MPI's `configure` script only recognizes the `FC` - and `FCFLAGS` environment variables (to specify the Fortran - compiler and compiler flags, respectively). The `F77` and `FFLAGS` - environment variables are ***IGNORED***. - - As a direct result, it is ***STRONGLY*** recommended that you - specify a Fortran compiler that uses file suffixes to determine - Fortran code layout (e.g., free form vs. fixed). For example, with - some versions of the IBM XLF compiler, it is preferable to use - `FC=xlf` instead of `FC=xlf90`, because `xlf` will automatically - determine the difference between free form and fixed Fortran source - code. - - However, many Fortran compilers allow specifying additional - command-line arguments to indicate which Fortran dialect to use. - For example, if `FC=xlf90`, you may need to use `mpifort --qfixed ...` - to compile fixed format Fortran source files. - - You can use either `ompi_info` or `oshmem_info` to see with which - Fortran compiler Open MPI was configured and compiled. - - There are up to three sets of Fortran MPI bindings that may be - provided (depending on your Fortran compiler): - - 1. `mpif.h`: This is the first MPI Fortran interface that was - defined in MPI-1. It is a file that is included in Fortran - source code. Open MPI's `mpif.h` does not declare any MPI - subroutines; they are all implicit. - - 1. `mpi` module: The `mpi` module file was added in MPI-2. It - provides strong compile-time parameter type checking for MPI - subroutines. - - 1. `mpi_f08` module: The `mpi_f08` module was added in MPI-3. It - provides many advantages over the `mpif.h` file and `mpi` module. - For example, MPI handles have distinct types (vs. all being - integers). See the MPI-3 document for more details. - - ***NOTE:*** The `mpi_f08` module is ***STRONGLY*** recommended for - all new MPI Fortran subroutines and applications. Note that the - `mpi_f08` module can be used in conjunction with the other two - Fortran MPI bindings in the same application (only one binding can - be used per subroutine/function, however). Full interoperability - between `mpif.h`/`mpi` module and `mpi_f08` module MPI handle types - is provided, allowing `mpi_f08` to be used in new subroutines in - legacy MPI applications. - - Per the OpenSHMEM specification, there is only one Fortran OpenSHMEM - binding provided: - - * `shmem.fh`: All Fortran OpenSHMEM programs should include - `shmem.f`, and Fortran OpenSHMEM programs that use constants - defined by OpenSHMEM ***MUST*** include `shmem.fh`. - - The following notes apply to the above-listed Fortran bindings: - - * All Fortran compilers support the `mpif.h`/`shmem.fh`-based - bindings, with one exception: the `MPI_SIZEOF` interfaces will - only be present when Open MPI is built with a Fortran compiler - that supports the `INTERFACE` keyword and `ISO_FORTRAN_ENV`. Most - notably, this excludes the GNU Fortran compiler suite before - version 4.9. - - * The level of support provided by the `mpi` module is based on your - Fortran compiler. - - If Open MPI is built with a non-GNU Fortran compiler, or if Open - MPI is built with the GNU Fortran compiler >= v4.9, all MPI - subroutines will be prototyped in the `mpi` module. All calls to - MPI subroutines will therefore have their parameter types checked - at compile time. - - If Open MPI is built with an old `gfortran` (i.e., < v4.9), a - limited `mpi` module will be built. Due to the limitations of - these compilers, and per guidance from the MPI-3 specification, - all MPI subroutines with "choice" buffers are specifically *not* - included in the `mpi` module, and their parameters will not be - checked at compile time. Specifically, all MPI subroutines with - no "choice" buffers are prototyped and will receive strong - parameter type checking at run-time (e.g., `MPI_INIT`, - `MPI_COMM_RANK`, etc.). - - Similar to the `mpif.h` interface, `MPI_SIZEOF` is only supported - on Fortran compilers that support `INTERFACE` and - `ISO_FORTRAN_ENV`. - - * The `mpi_f08` module has been tested with the Intel Fortran - compiler and gfortran >= 4.9. Other modern Fortran compilers - likely also work. - - Many older Fortran compilers do not provide enough modern Fortran - features to support the `mpi_f08` module. For example, `gfortran` - < v4.9 does provide enough support for the `mpi_f08` module. - - You can examine the output of the following command to see all - the Fortran features that are/are not enabled in your Open MPI - installation: - - ``` - shell$ ompi_info | grep -i fort - ``` - - -### General Run-Time Support Notes - -* The Open MPI installation must be in your `PATH` on all nodes (and - potentially `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH`, if - `libmpi`/`libshmem` is a shared library), unless using the - `--prefix` or `--enable-mpirun-prefix-by-default` functionality (see - below). - -* Open MPI's run-time behavior can be customized via Modular Component - Architecture (MCA) parameters (see below for more information on how - to get/set MCA parameter values). Some MCA parameters can be set in - a way that renders Open MPI inoperable (see notes about MCA - parameters later in this file). In particular, some parameters have - required options that must be included. - - * If specified, the `btl` parameter must include the `self` - component, or Open MPI will not be able to deliver messages to the - same rank as the sender. For example: `mpirun --mca btl tcp,self - ...` - * If specified, the `btl_tcp_if_exclude` parameter must include the - loopback device (`lo` on many Linux platforms), or Open MPI will - not be able to route MPI messages using the TCP BTL. For example: - `mpirun --mca btl_tcp_if_exclude lo,eth1 ...` - -* Running on nodes with different endian and/or different datatype - sizes within a single parallel job is supported in this release. - However, Open MPI does not resize data when datatypes differ in size - (for example, sending a 4 byte `MPI_DOUBLE` and receiving an 8 byte - `MPI_DOUBLE` will fail). - - -### MPI Functionality and Features - -* All MPI-3.1 functionality is supported. - -* Note that starting with Open MPI v4.0.0, prototypes for several - legacy MPI-1 symbols that were deleted in the MPI-3.0 specification - (which was published in 2012) are no longer available by default in - `mpi.h`. Specifically, several MPI-1 symbols were deprecated in the - 1996 publishing of the MPI-2.0 specification. These deprecated - symbols were eventually removed from the MPI-3.0 specification in - 2012. - - The symbols that now no longer appear by default in Open MPI's - `mpi.h` are: - - * `MPI_Address` (replaced by `MPI_Get_address`) - * `MPI_Errhandler_create` (replaced by `MPI_Comm_create_errhandler`) - * `MPI_Errhandler_get` (replaced by `MPI_Comm_get_errhandler`) - * `MPI_Errhandler_set` (replaced by `MPI_Comm_set_errhandler`) - * `MPI_Type_extent` (replaced by `MPI_Type_get_extent`) - * `MPI_Type_hindexed` (replaced by `MPI_Type_create_hindexed`) - * `MPI_Type_hvector` (replaced by `MPI_Type_create_hvector`) - * `MPI_Type_lb` (replaced by `MPI_Type_get_extent`) - * `MPI_Type_struct` (replaced by `MPI_Type_create_struct`) - * `MPI_Type_ub` (replaced by `MPI_Type_get_extent`) - * `MPI_LB` (replaced by `MPI_Type_create_resized`) - * `MPI_UB` (replaced by `MPI_Type_create_resized`) - * `MPI_COMBINER_HINDEXED_INTEGER` - * `MPI_COMBINER_HVECTOR_INTEGER` - * `MPI_COMBINER_STRUCT_INTEGER` - * `MPI_Handler_function` (replaced by `MPI_Comm_errhandler_function`) - - Although these symbols are no longer prototyped in `mpi.h`, they - are still present in the MPI library in Open MPI v4.0.x. This - enables legacy MPI applications to link and run successfully with - Open MPI v4.0.x, even though they will fail to compile. - - ***WARNING:*** Future releases of Open MPI beyond the v4.0.x series - may remove these symbols altogether. - - ***WARNING:*** The Open MPI team ***STRONGLY*** encourages all MPI - application developers to stop using these constructs that were - first deprecated over 20 years ago, and finally removed from the MPI - specification in MPI-3.0 (in 2012). - - ***WARNING:*** [The Open MPI - FAQ](https://www.open-mpi.org/faq/?category=mpi-removed) contains - examples of how to update legacy MPI applications using these - deleted symbols to use the "new" symbols. - - All that being said, if you are unable to immediately update your - application to stop using these legacy MPI-1 symbols, you can - re-enable them in `mpi.h` by configuring Open MPI with the - `--enable-mpi1-compatibility` flag. - -* Rank reordering support is available using the TreeMatch library. It - is activated for the graph and `dist_graph` communicator topologies. - -* When using MPI deprecated functions, some compilers will emit - warnings. For example: - - ``` - shell$ cat deprecated_example.c - #include - void foo(void) { - MPI_Datatype type; - MPI_Type_struct(1, NULL, NULL, NULL, &type); - } - shell$ mpicc -c deprecated_example.c - deprecated_example.c: In function 'foo': - deprecated_example.c:4: warning: 'MPI_Type_struct' is deprecated (declared at /opt/openmpi/include/mpi.h:1522) - shell$ - ``` - -* `MPI_THREAD_MULTIPLE` is supported with some exceptions. - - The following PMLs support `MPI_THREAD_MULTIPLE`: - 1. `cm` (see list (1) of supported MTLs, below) - 1. `ob1` (see list (2) of supported BTLs, below) - 1. `ucx` - - (1) The `cm` PML and the following MTLs support `MPI_THREAD_MULTIPLE`: - 1. `ofi` (Libfabric) - 1. `portals4` - - (2) The `ob1` PML and the following BTLs support `MPI_THREAD_MULTIPLE`: - 1. `self` - 1. `sm` - 1. `smcuda` - 1. `tcp` - 1. `ugni` - 1. `usnic` - - Currently, MPI File operations are not thread safe even if MPI is - initialized for `MPI_THREAD_MULTIPLE` support. - -* `MPI_REAL16` and `MPI_COMPLEX32` are only supported on platforms - where a portable C datatype can be found that matches the Fortran - type `REAL*16`, both in size and bit representation. - -* The "libompitrace" library is bundled in Open MPI and is installed - by default (it can be disabled via the `--disable-libompitrace` - flag). This library provides a simplistic tracing of select MPI - function calls via the MPI profiling interface. Linking it in to - your application via (e.g., via `-lompitrace`) will automatically - output to stderr when some MPI functions are invoked: - - ``` - shell$ cd examples/ - shell$ mpicc hello_c.c -o hello_c -lompitrace - shell$ mpirun -np 1 hello_c - MPI_INIT: argc 1 - Hello, world, I am 0 of 1 - MPI_BARRIER[0]: comm MPI_COMM_WORLD - MPI_FINALIZE[0] - shell$ - ``` - - Keep in mind that the output from the trace library is going to - `stderr`, so it may output in a slightly different order than the - `stdout` from your application. - - This library is being offered as a "proof of concept" / convenience - from Open MPI. If there is interest, it is trivially easy to extend - it to printf for other MPI functions. Pull requests on github.com - would be greatly appreciated. - - -### OpenSHMEM Functionality and Features - -All OpenSHMEM-1.3 functionality is supported. - - -### MPI Collectives - -* The `cuda` coll component provides CUDA-aware support for the - reduction type collectives with GPU buffers. This component is only - compiled into the library when the library has been configured with - CUDA-aware support. It intercepts calls to the reduction - collectives, copies the data to staging buffers if GPU buffers, then - calls underlying collectives to do the work. - - -### OpenSHMEM Collectives - -* The `fca` scoll component: the Mellanox Fabric Collective - Accelerator (FCA) is a solution for offloading collective operations - from the MPI process onto Mellanox QDR InfiniBand switch CPUs and - HCAs. - -* The `basic` scoll component: Reference implementation of all - OpenSHMEM collective operations. - - -### Network Support - -* There are several main MPI network models available: `ob1`, `cm`, - and `ucx`. `ob1` uses BTL ("Byte Transfer Layer") - components for each supported network. `cm` uses MTL ("Matching - Transport Layer") components for each supported network. `ucx` uses - the OpenUCX transport. - - * `ob1` supports a variety of networks that can be used in - combination with each other: - * OpenFabrics: InfiniBand, iWARP, and RoCE - * Loopback (send-to-self) - * Shared memory - * TCP - * SMCUDA - * Cisco usNIC - * uGNI (Cray Gemini, Aries) - * shared memory (XPMEM, Linux CMA, Linux KNEM, and - copy-in/copy-out shared memory) - - * `cm` supports a smaller number of networks (and they cannot be - used together), but may provide better overall MPI performance: - * Intel Omni-Path PSM2 (version 11.2.173 or later) - * Intel True Scale PSM (QLogic InfiniPath) - * OpenFabrics Interfaces ("libfabric" tag matching) - * Portals 4 - - * UCX is the [Unified Communication X (UCX) communication - library](https://www.openucx.org/). This is an open-source - project developed in collaboration between industry, laboratories, - and academia to create an open-source production grade - communication framework for data centric and high-performance - applications. The UCX library can be downloaded from repositories - (e.g., Fedora/RedHat yum repositories). The UCX library is also - part of Mellanox OFED and Mellanox HPC-X binary distributions. - - UCX currently supports: - - * OpenFabrics Verbs (including InfiniBand and RoCE) - * Cray's uGNI - * TCP - * Shared memory - * NVIDIA CUDA drivers - - While users can manually select any of the above transports at run - time, Open MPI will select a default transport as follows: - - 1. If InfiniBand devices are available, use the UCX PML. - 1. If PSM, PSM2, or other tag-matching-supporting Libfabric - transport devices are available (e.g., Cray uGNI), use the `cm` - PML and a single appropriate corresponding `mtl` module. - 1. Otherwise, use the `ob1` PML and one or more appropriate `btl` - modules. - - Users can override Open MPI's default selection algorithms and force - the use of a specific transport if desired by setting the `pml` MCA - parameter (and potentially the `btl` and/or `mtl` MCA parameters) at - run-time: - - ``` - shell$ mpirun --mca pml ob1 --mca btl [comma-delimted-BTLs] ... - or - shell$ mpirun --mca pml cm --mca mtl [MTL] ... - or - shell$ mpirun --mca pml ucx ... - ``` - - There is a known issue when using UCX with very old Mellanox - Infiniband HCAs, in particular HCAs preceding the introduction of - the ConnectX product line, which can result in Open MPI crashing in - MPI_Finalize. This issue is addressed by UCX release 1.9.0 and - newer. - -* The main OpenSHMEM network model is `ucx`; it interfaces directly - with UCX. - -* In prior versions of Open MPI, InfiniBand and RoCE support was - provided through the `openib` BTL and `ob1` PML plugins. Starting - with Open MPI 4.0.0, InfiniBand support through the `openib` plugin - is both deprecated and superseded by the `ucx` PML component. The - `openib` BTL was removed in Open MPI v5.0.0. - - While the `openib` BTL depended on `libibverbs`, the UCX PML depends - on the UCX library. - - Once installed, Open MPI can be built with UCX support by adding - `--with-ucx` to the Open MPI configure command. Once Open MPI is - configured to use UCX, the runtime will automatically select the - `ucx` PML if one of the supported networks is detected (e.g., - InfiniBand). It's possible to force using UCX in the `mpirun` or - `oshrun` command lines by specifying any or all of the following mca - parameters: `--mca pml ucx` for MPI point-to-point operations, - `--mca spml ucx` for OpenSHMEM support, and `--mca osc ucx` for MPI - RMA (one-sided) operations. - -* The `usnic` BTL is support for Cisco's usNIC device ("userspace NIC") - on Cisco UCS servers with the Virtualized Interface Card (VIC). - Although the usNIC is accessed via the OpenFabrics Libfabric API - stack, this BTL is specific to Cisco usNIC devices. - -* uGNI is a Cray library for communicating over the Gemini and Aries - interconnects. - -* The OpenFabrics Enterprise Distribution (OFED) software package v1.0 - will not work properly with Open MPI v1.2 (and later) due to how its - Mellanox InfiniBand plugin driver is created. The problem is fixed - with OFED v1.1 (and later). - -* The use of `fork()` with Libiverbs-based networks (i.e., the UCX - PML) is only partially supported, and only on Linux kernels >= - v2.6.15 with `libibverbs` v1.1 or later (first released as part of - OFED v1.2), per restrictions imposed by the OFED network stack. - -* Linux `knem` support is used when the `sm` (shared memory) BTL is - compiled with knem support (see the `--with-knem` configure option) - and the `knem` Linux module is loaded in the running kernel. If the - `knem` Linux kernel module is not loaded, the `knem` support is (by - default) silently deactivated during Open MPI jobs. - - See https://knem.gforge.inria.fr/ for details on Knem. - -* Linux Cross-Memory Attach (CMA) or XPMEM is used by the `sm` shared - memory BTL when the CMA/XPMEM libraries are installed, - respectively. Linux CMA and XPMEM are similar (but different) - mechanisms for Open MPI to utilize single-copy semantics for shared - memory. - - -### Open MPI Extensions - -An MPI "extensions" framework is included in Open MPI, but is not -enabled by default. See the "Open MPI API Extensions" section below -for more information on compiling and using MPI extensions. - -The following extensions are included in this version of Open MPI: - -1. `pcollreq`: Provides routines for persistent collective - communication operations and persistent neighborhood collective - communication operations, which are planned to be included in - MPI-4.0. The function names are prefixed with `MPIX_` instead of - `MPI_`, like `MPIX_Barrier_init`, because they are not - standardized yet. Future versions of Open MPI will switch to the - `MPI_` prefix once the MPI Standard which includes this feature is - published. See their man page for more details. -1. `shortfloat`: Provides MPI datatypes `MPIX_C_FLOAT16`, - `MPIX_SHORT_FLOAT`, `MPIX_SHORT_FLOAT`, and - `MPIX_CXX_SHORT_FLOAT_COMPLEX` if corresponding language types are - available. See `ompi/mpiext/shortfloat/README.txt` for details. -1. `affinity`: Provides the `OMPI_Affinity_str()` API, which returns - a string indicating the resources which a process is bound. For - more details, see its man page. -1. `cuda`: When the library is compiled with CUDA-aware support, it - provides two things. First, a macro - `MPIX_CUDA_AWARE_SUPPORT`. Secondly, the function - `MPIX_Query_cuda_support()` that can be used to query for support. -1. `example`: A non-functional extension; its only purpose is to - provide an example for how to create other extensions. - - -## Building Open MPI - -If you have checked out a ***developer's copy*** of Open MPI (i.e., -you cloned from Git), you really need to read the `HACKING` file -before attempting to build Open MPI. Really. - -If you have downloaded a tarball, then things are much simpler. -Open MPI uses a traditional `configure` script paired with `make` to -build. Typical installs can be of the pattern: - -``` -shell$ ./configure [...options...] -shell$ make [-j N] all install - (use an integer value of N for parallel builds) -``` - -There are many available `configure` options (see `./configure --help` -for a full list); a summary of the more commonly used ones is included -below. - -***NOTE:*** if you are building Open MPI on a network filesystem, the -machine you on which you are building *must* be time-synchronized with -the file server. Specifically: Open MPI's build system *requires* -accurate filesystem timestamps. If your `make` output includes -warning about timestamps in the future or runs GNU Automake, Autoconf, -and/or Libtool, this is *not normal*, and you may have an invalid -build. Ensure that the time on your build machine is synchronized -with the time on your file server, or build on a local filesystem. -Then remove the Open MPI source directory and start over (e.g., by -re-extracting the Open MPI tarball). - -Note that for many of Open MPI's `--with-FOO` options, Open MPI will, -by default, search for header files and/or libraries for `FOO`. If -the relevant files are found, Open MPI will built support for `FOO`; -if they are not found, Open MPI will skip building support for `FOO`. -However, if you specify `--with-FOO` on the configure command line and -Open MPI is unable to find relevant support for `FOO`, configure will -assume that it was unable to provide a feature that was specifically -requested and will abort so that a human can resolve out the issue. - -Additionally, if a search directory is specified in the form -`--with-FOO=DIR`, Open MPI will: - -1. Search for `FOO`'s header files in `DIR/include`. -2. Search for `FOO`'s library files: - 1. If `--with-FOO-libdir=` was specified, search in - ``. - 1. Otherwise, search in `DIR/lib`, and if they are not found - there, search again in `DIR/lib64`. -3. If both the relevant header files and libraries are found: - 1. Open MPI will build support for `FOO`. - 1. If the root path where the FOO libraries are found is neither - `/usr` nor `/usr/local`, Open MPI will compile itself with - RPATH flags pointing to the directory where FOO's libraries - are located. Open MPI does not RPATH `/usr/lib[64]` and - `/usr/local/lib[64]` because many systems already search these - directories for run-time libraries by default; adding RPATH for - them could have unintended consequences for the search path - ordering. - - -### Installation Options - -* `--prefix=DIR`: - Install Open MPI into the base directory named `DIR`. Hence, Open - MPI will place its executables in `DIR/bin`, its header files in - `DIR/include`, its libraries in `DIR/lib`, etc. - -* `--disable-shared`: - By default, Open MPI and OpenSHMEM build shared libraries, and all - components are built as dynamic shared objects (DSOs). This switch - disables this default; it is really only useful when used with - `--enable-static`. Specifically, this option does *not* imply - `--enable-static`; enabling static libraries and disabling shared - libraries are two independent options. - -* `--enable-static`: - Build MPI and OpenSHMEM as static libraries, and statically link in - all components. Note that this option does *not* imply - `--disable-shared`; enabling static libraries and disabling shared - libraries are two independent options. - - Be sure to read the description of `--without-memory-manager`, - below; it may have some effect on `--enable-static`. - -* `--disable-wrapper-rpath`: - By default, the wrapper compilers (e.g., `mpicc`) will enable - "rpath" support in generated executables on systems that support it. - That is, they will include a file reference to the location of Open - MPI's libraries in the application executable itself. This means - that the user does not have to set `LD_LIBRARY_PATH` to find Open - MPI's libraries (e.g., if they are installed in a location that the - run-time linker does not search by default). - - On systems that utilize the GNU `ld` linker, recent enough versions - will actually utilize "runpath" functionality, not "rpath". There - is an important difference between the two: - - 1. "rpath": the location of the Open MPI libraries is hard-coded into - the MPI/OpenSHMEM application and cannot be overridden at - run-time. - 1. "runpath": the location of the Open MPI libraries is hard-coded into - the MPI/OpenSHMEM application, but can be overridden at run-time - by setting the `LD_LIBRARY_PATH` environment variable. - - For example, consider that you install Open MPI vA.B.0 and - compile/link your MPI/OpenSHMEM application against it. Later, you - install Open MPI vA.B.1 to a different installation prefix (e.g., - `/opt/openmpi/A.B.1` vs. `/opt/openmpi/A.B.0`), and you leave the old - installation intact. - - In the rpath case, your MPI application will always use the - libraries from your A.B.0 installation. In the runpath case, you - can set the `LD_LIBRARY_PATH` environment variable to point to the - A.B.1 installation, and then your MPI application will use those - libraries. - - Note that in both cases, however, if you remove the original A.B.0 - installation and set `LD_LIBRARY_PATH` to point to the A.B.1 - installation, your application will use the A.B.1 libraries. - - This rpath/runpath behavior can be disabled via - `--disable-wrapper-rpath`. - - If you would like to keep the rpath option, but not enable runpath - a different configure option is avalabile - `--disable-wrapper-runpath`. - -* `--enable-dlopen`: - Build all of Open MPI's components as standalone Dynamic Shared - Objects (DSO's) that are loaded at run-time (this is the default). - The opposite of this option, `--disable-dlopen`, causes two things: - - 1. All of Open MPI's components will be built as part of Open MPI's - normal libraries (e.g., `libmpi`). - 1. Open MPI will not attempt to open any DSO's at run-time. - - Note that this option does *not* imply that OMPI's libraries will be - built as static objects (e.g., `libmpi.a`). It only specifies the - location of OMPI's components: standalone DSOs or folded into the - Open MPI libraries. You can control whether Open MPI's libraries - are build as static or dynamic via `--enable|disable-static` and - `--enable|disable-shared`. - -* `--disable-show-load-errors-by-default`: - Set the default value of the `mca_base_component_show_load_errors` - MCA variable: the `--enable` form of this option sets the MCA - variable to true, the `--disable` form sets the MCA variable to - false. The MCA `mca_base_component_show_load_errors` variable can - still be overridden at run time via the usual MCA-variable-setting - mechanisms; this configure option simply sets the default value. - - The `--disable` form of this option is intended for Open MPI - packagers who tend to enable support for many different types of - networks and systems in their packages. For example, consider a - packager who includes support for both the FOO and BAR networks in - their Open MPI package, both of which require support libraries - (`libFOO.so` and `libBAR.so`). If an end user only has BAR - hardware, they likely only have `libBAR.so` available on their - systems -- not `libFOO.so`. Disabling load errors by default will - prevent the user from seeing potentially confusing warnings about - the FOO components failing to load because `libFOO.so` is not - available on their systems. - - Conversely, system administrators tend to build an Open MPI that is - targeted at their specific environment, and contains few (if any) - components that are not needed. In such cases, they might want - their users to be warned that the FOO network components failed to - load (e.g., if `libFOO.so` was mistakenly unavailable), because Open - MPI may otherwise silently failover to a slower network path for MPI - traffic. - -* `--with-platform=FILE`: - Load configure options for the build from `FILE`. Options on the - command line that are not in `FILE` are also used. Options on the - command line and in `FILE` are replaced by what is in `FILE`. - -* `--with-libmpi-name=STRING`: - Replace `libmpi.*` and `libmpi_FOO.*` (where `FOO` is one of the - fortran supporting libraries installed in lib) with `libSTRING.*` - and `libSTRING_FOO.*`. This is provided as a convenience mechanism - for third-party packagers of Open MPI that might want to rename - these libraries for their own purposes. This option is *not* - intended for typical users of Open MPI. - -* `--enable-mca-no-build=LIST`: - Comma-separated list of `-` pairs that will not be - built. For example, `--enable-mca-no-build=btl-portals,oob-ud` will - disable building the portals BTL and the ud OOB component. - - -### Networking support / options - -* `--with-fca=DIR`: - Specify the directory where the Mellanox FCA library and - header files are located. - - FCA is the support library for Mellanox switches and HCAs. - -* `--with-hcoll=DIR`: - Specify the directory where the Mellanox hcoll library and header - files are located. This option is generally only necessary if the - hcoll headers and libraries are not in default compiler/linker - search paths. - - hcoll is the support library for MPI collective operation offload on - Mellanox ConnectX-3 HCAs (and later). - -* `--with-knem=DIR`: - Specify the directory where the knem libraries and header files are - located. This option is generally only necessary if the knem headers - and libraries are not in default compiler/linker search paths. - - knem is a Linux kernel module that allows direct process-to-process - memory copies (optionally using hardware offload), potentially - increasing bandwidth for large messages sent between messages on the - same server. See [the Knem web site](https://knem.gforge.inria.fr/) - for details. - -* `--with-libfabric=DIR`: - Specify the directory where the OpenFabrics Interfaces `libfabric` - library and header files are located. This option is generally only - necessary if the libfabric headers and libraries are not in default - compiler/linker search paths. - - Libfabric is the support library for OpenFabrics Interfaces-based - network adapters, such as Cisco usNIC, Intel True Scale PSM, Cray - uGNI, etc. - -* `--with-libfabric-libdir=DIR`: - Look in directory for the libfabric libraries. By default, Open MPI - will look in `DIR/lib` and `DIR/lib64`, which covers most cases. - This option is only needed for special configurations. - -* `--with-portals4=DIR`: - Specify the directory where the Portals4 libraries and header files - are located. This option is generally only necessary if the Portals4 - headers and libraries are not in default compiler/linker search - paths. - - Portals is a low-level network API for high-performance networking - on high-performance computing systems developed by Sandia National - Laboratories, Intel Corporation, and the University of New Mexico. - The Portals 4 Reference Implementation is a complete implementation - of Portals 4, with transport over InfiniBand verbs and UDP. - -* `--with-portals4-libdir=DIR`: - Location of libraries to link with for Portals4 support. - -* `--with-portals4-max-md-size=SIZE` and - `--with-portals4-max-va-size=SIZE`: - Set configuration values for Portals 4 - -* `--with-psm=`: - Specify the directory where the QLogic InfiniPath / Intel True Scale - PSM library and header files are located. This option is generally - only necessary if the PSM headers and libraries are not in default - compiler/linker search paths. - - PSM is the support library for QLogic InfiniPath and Intel TrueScale - network adapters. - -* `--with-psm-libdir=DIR`: - Look in directory for the PSM libraries. By default, Open MPI will - look in `DIR/lib` and `DIR/lib64`, which covers most cases. This - option is only needed for special configurations. - -* `--with-psm2=DIR`: - Specify the directory where the Intel Omni-Path PSM2 library and - header files are located. This option is generally only necessary - if the PSM2 headers and libraries are not in default compiler/linker - search paths. - - PSM is the support library for Intel Omni-Path network adapters. - -* `--with-psm2-libdir=DIR`: - Look in directory for the PSM2 libraries. By default, Open MPI will - look in `DIR/lib` and `DIR/lib64`, which covers most cases. This - option is only needed for special configurations. - -* `--with-ucx=DIR`: - Specify the directory where the UCX libraries and header files are - located. This option is generally only necessary if the UCX headers - and libraries are not in default compiler/linker search paths. - -* `--with-ucx-libdir=DIR`: - Look in directory for the UCX libraries. By default, Open MPI will - look in `DIR/lib` and `DIR/lib64`, which covers most cases. This - option is only needed for special configurations. - -* `--with-usnic`: - Abort configure if Cisco usNIC support cannot be built. - - -### Run-time system support - -* `--enable-mpirun-prefix-by-default`: - This option forces the `mpirun` command to always behave as if - `--prefix $prefix` was present on the command line (where `$prefix` - is the value given to the `--prefix` option to configure). This - prevents most `rsh`/`ssh`-based users from needing to modify their - shell startup files to set the `PATH` and/or `LD_LIBRARY_PATH` for - Open MPI on remote nodes. Note, however, that such users may still - desire to set `PATH` -- perhaps even in their shell startup files -- - so that executables such as `mpicc` and `mpirun` can be found - without needing to type long path names. - -* `--enable-orte-static-ports`: - Enable ORTE static ports for TCP OOB (default: enabled). - -* `--with-alps`: - Force the building of for the Cray Alps run-time environment. If - Alps support cannot be found, configure will abort. - -* `--with-lsf=DIR`: - Specify the directory where the LSF libraries and header files are - located. This option is generally only necessary if the LSF headers - and libraries are not in default compiler/linker search paths. - - LSF is a resource manager system, frequently used as a batch - scheduler in HPC systems. - -* `--with-lsf-libdir=DIR`: - Look in directory for the LSF libraries. By default, Open MPI will - look in `DIR/lib` and `DIR/lib64`, which covers most cases. This - option is only needed for special configurations. - -* `--with-slurm`: - Force the building of SLURM scheduler support. - -* `--with-sge`: - Specify to build support for the Oracle Grid Engine (OGE) resource - manager and/or the Open Grid Engine. OGE support is disabled by - default; this option must be specified to build OMPI's OGE support. - - The Oracle Grid Engine (OGE) and open Grid Engine packages are - resource manager systems, frequently used as a batch scheduler in - HPC systems. It used to be called the "Sun Grid Engine", which is - why the option is still named `--with-sge`. - -* `--with-tm=DIR`: - Specify the directory where the TM libraries and header files are - located. This option is generally only necessary if the TM headers - and libraries are not in default compiler/linker search paths. - - TM is the support library for the Torque and PBS Pro resource - manager systems, both of which are frequently used as a batch - scheduler in HPC systems. - - -### Miscellaneous support libraries - -* `--with-libevent(=VALUE)` - This option specifies where to find the libevent support headers and - library. The following `VALUE`s are permitted: - - * `internal`: Use Open MPI's internal copy of libevent. - * `external`: Use an external Libevent installation (rely on default - compiler and linker paths to find it) - * ``: Same as `internal`. - * `DIR`: Specify the location of a specific libevent - installation to use - - By default (or if `--with-libevent` is specified with no `VALUE`), - Open MPI will build and use the copy of libevent that it has in its - source tree. However, if the `VALUE` is `external`, Open MPI will - look for the relevant libevent header file and library in default - compiler / linker locations. Or, `VALUE` can be a directory tree - where the libevent header file and library can be found. This - option allows operating systems to include Open MPI and use their - default libevent installation instead of Open MPI's bundled - libevent. - - libevent is a support library that provides event-based processing, - timers, and signal handlers. Open MPI requires libevent to build; - passing --without-libevent will cause configure to abort. - -* `--with-libevent-libdir=DIR`: - Look in directory for the libevent libraries. This option is only - usable when building Open MPI against an external libevent - installation. Just like other `--with-FOO-libdir` configure - options, this option is only needed for special configurations. - -* `--with-hwloc(=VALUE)`: - hwloc is a support library that provides processor and memory - affinity information for NUMA platforms. It is required by Open - MPI. Therefore, specifying `--with-hwloc=no` (or `--without-hwloc`) - is disallowed. - - By default (i.e., if `--with-hwloc` is not specified, or if - `--with-hwloc` is specified without a value), Open MPI will first try - to find/use an hwloc installation on the current system. If Open - MPI cannot find one, it will fall back to build and use the internal - copy of hwloc included in the Open MPI source tree. - - Alternatively, the `--with-hwloc` option can be used to specify - where to find the hwloc support headers and library. The following - `VALUE`s are permitted: - - * `internal`: Only use Open MPI's internal copy of hwloc. - * `external`: Only use an external hwloc installation (rely on - default compiler and linker paths to find it). - * `DIR`: Only use the specific hwloc installation found in - the specified directory. - -* `--with-hwloc-libdir=DIR`: - Look in directory for the hwloc libraries. This option is only - usable when building Open MPI against an external hwloc - installation. Just like other `--with-FOO-libdir` configure options, - this option is only needed for special configurations. - -* `--disable-hwloc-pci`: - Disable building hwloc's PCI device-sensing capabilities. On some - platforms (e.g., SusE 10 SP1, x86-64), the libpci support library is - broken. Open MPI's configure script should usually detect when - libpci is not usable due to such brokenness and turn off PCI - support, but there may be cases when configure mistakenly enables - PCI support in the presence of a broken libpci. These cases may - result in `make` failing with warnings about relocation symbols in - libpci. The `--disable-hwloc-pci` switch can be used to force Open - MPI to not build hwloc's PCI device-sensing capabilities in these - cases. - - Similarly, if Open MPI incorrectly decides that libpci is broken, - you can force Open MPI to build hwloc's PCI device-sensing - capabilities by using `--enable-hwloc-pci`. - - hwloc can discover PCI devices and locality, which can be useful for - Open MPI in assigning message passing resources to MPI processes. - -* `--with-libltdl=DIR`: - Specify the directory where the GNU Libtool libltdl libraries and - header files are located. This option is generally only necessary - if the libltdl headers and libraries are not in default - compiler/linker search paths. - - Note that this option is ignored if `--disable-dlopen` is specified. - -* `--disable-libompitrace`: - Disable building the simple `libompitrace` library (see note above - about libompitrace) - -* `--with-valgrind(=DIR)`: - Directory where the valgrind software is installed. If Open MPI - finds Valgrind's header files, it will include additional support - for Valgrind's memory-checking debugger. - - Specifically, it will eliminate a lot of false positives from - running Valgrind on MPI applications. There is a minor performance - penalty for enabling this option. - - -### MPI Functionality - -* `--with-mpi-param-check(=VALUE)`: - Whether or not to check MPI function parameters for errors at - runtime. The following `VALUE`s are permitted: - - * `always`: MPI function parameters are always checked for errors - * `never`: MPI function parameters are never checked for errors - * `runtime`: Whether MPI function parameters are checked depends on - the value of the MCA parameter `mpi_param_check` (default: yes). - * `yes`: Synonym for "always" (same as `--with-mpi-param-check`). - * `no`: Synonym for "never" (same as `--without-mpi-param-check`). - - If `--with-mpi-param` is not specified, `runtime` is the default. - -* `--disable-mpi-thread-multiple`: - Disable the MPI thread level `MPI_THREAD_MULTIPLE` (it is enabled by - default). - -* `--enable-mpi-java`: - Enable building of an ***EXPERIMENTAL*** Java MPI interface - (disabled by default). You may also need to specify - `--with-jdk-dir`, `--with-jdk-bindir`, and/or `--with-jdk-headers`. - See [README.JAVA.md](README.JAVA.md) for details. - - Note that this Java interface is ***INCOMPLETE*** (meaning: it does - not support all MPI functionality) and ***LIKELY TO CHANGE***. The - Open MPI developers would very much like to hear your feedback about - this interface. See [README.JAVA.md](README.JAVA.md) for more - details. - -* `--enable-mpi-fortran(=VALUE)`: - By default, Open MPI will attempt to build all 3 Fortran bindings: - `mpif.h`, the `mpi` module, and the `mpi_f08` module. The following - `VALUE`s are permitted: - - * `all`: Synonym for `yes`. - * `yes`: Attempt to build all 3 Fortran bindings; skip - any binding that cannot be built (same as - `--enable-mpi-fortran`). - * `mpifh`: Only build `mpif.h` support. - * `usempi`: Only build `mpif.h` and `mpi` module support. - * `usempif08`: Build `mpif.h`, `mpi` module, and `mpi_f08` - module support. - * `none`: Synonym for `no`. - * `no`: Do not build any MPI Fortran support (same as - `--disable-mpi-fortran`). This is mutually exclusive - with building the OpenSHMEM Fortran interface. - -* `--enable-mpi-ext(=LIST)`: - Enable Open MPI's non-portable API extensions. `LIST` is a - comma-delmited list of extensions. If no `LIST` is specified, all - of the extensions are enabled. - - See the "Open MPI API Extensions" section for more details. - -* `--disable-mpi-io`: - Disable built-in support for MPI-2 I/O, likely because an - externally-provided MPI I/O package will be used. Default is to use - the internal framework system that uses the ompio component and a - specially modified version of ROMIO that fits inside the romio - component - -* `--disable-io-romio`: - Disable the ROMIO MPI-IO component - -* `--with-io-romio-flags=FLAGS`: - Pass `FLAGS` to the ROMIO distribution configuration script. This - option is usually only necessary to pass - parallel-filesystem-specific preprocessor/compiler/linker flags back - to the ROMIO system. - -* `--disable-io-ompio`: - Disable the ompio MPI-IO component - -* `--enable-sparse-groups`: - Enable the usage of sparse groups. This would save memory - significantly especially if you are creating large - communicators. (Disabled by default) - - -### OpenSHMEM Functionality - -* `--disable-oshmem`: - Disable building the OpenSHMEM implementation (by default, it is - enabled). - -* `--disable-oshmem-fortran`: - Disable building only the Fortran OpenSHMEM bindings. Please see - the "Compiler Notes" section herein which contains further - details on known issues with various Fortran compilers. - - -### Miscellaneous Functionality - -* `--without-memory-manager`: - Disable building Open MPI's memory manager. Open MPI's memory - manager is usually built on Linux based platforms, and is generally - only used for optimizations with some OpenFabrics-based networks (it - is not *necessary* for OpenFabrics networks, but some performance - loss may be observed without it). - - However, it may be necessary to disable the memory manager in order - to build Open MPI statically. - -* `--with-ft=TYPE`: - Specify the type of fault tolerance to enable. Options: LAM - (LAM/MPI-like), cr (Checkpoint/Restart). Fault tolerance support is - disabled unless this option is specified. - -* `--enable-peruse`: - Enable the PERUSE MPI data analysis interface. - -* `--enable-heterogeneous`: - Enable support for running on heterogeneous clusters (e.g., machines - with different endian representations). Heterogeneous support is - disabled by default because it imposes a minor performance penalty. - - ***THIS FUNCTIONALITY IS CURRENTLY BROKEN - DO NOT USE*** - -* `--with-wrapper-cflags=CFLAGS` -* `--with-wrapper-cxxflags=CXXFLAGS` -* `--with-wrapper-fflags=FFLAGS` -* `--with-wrapper-fcflags=FCFLAGS` -* `--with-wrapper-ldflags=LDFLAGS` -* `--with-wrapper-libs=LIBS`: - Add the specified flags to the default flags that are used in Open - MPI's "wrapper" compilers (e.g., `mpicc` -- see below for more - information about Open MPI's wrapper compilers). By default, Open - MPI's wrapper compilers use the same compilers used to build Open - MPI and specify a minimum set of additional flags that are necessary - to compile/link MPI applications. These configure options give - system administrators the ability to embed additional flags in - OMPI's wrapper compilers (which is a local policy decision). The - meanings of the different flags are: - - `CFLAGS`: Flags passed by the `mpicc` wrapper to the C compiler - `CXXFLAGS`: Flags passed by the `mpic++` wrapper to the C++ compiler - `FCFLAGS`: Flags passed by the `mpifort` wrapper to the Fortran compiler - `LDFLAGS`: Flags passed by all the wrappers to the linker - `LIBS`: Flags passed by all the wrappers to the linker - - There are other ways to configure Open MPI's wrapper compiler - behavior; see [the Open MPI FAQ](https://www.open-mpi.org/faq/) for - more information. - -There are many other options available -- see `./configure --help`. - -Changing the compilers that Open MPI uses to build itself uses the -standard Autoconf mechanism of setting special environment variables -either before invoking configure or on the configure command line. -The following environment variables are recognized by configure: - -* `CC`: C compiler to use -* `CFLAGS`: Compile flags to pass to the C compiler -* `CPPFLAGS`: Preprocessor flags to pass to the C compiler -* `CXX`: C++ compiler to use -* `CXXFLAGS`: Compile flags to pass to the C++ compiler -* `CXXCPPFLAGS`: Preprocessor flags to pass to the C++ compiler -* `FC`: Fortran compiler to use -* `FCFLAGS`: Compile flags to pass to the Fortran compiler -* `LDFLAGS`: Linker flags to pass to all compilers -* `LIBS`: Libraries to pass to all compilers (it is rarely - necessary for users to need to specify additional `LIBS`) -* `PKG_CONFIG`: Path to the `pkg-config` utility - -For example: - -``` -shell$ ./configure CC=mycc CXX=myc++ FC=myfortran ... -``` - -***NOTE:*** We generally suggest using the above command line form for -setting different compilers (vs. setting environment variables and -then invoking `./configure`). The above form will save all variables -and values in the `config.log` file, which makes post-mortem analysis -easier if problems occur. - -Note that if you intend to compile Open MPI with a `make` other than -the default one in your `PATH`, then you must either set the `$MAKE` -environment variable before invoking Open MPI's `configure` script, or -pass `MAKE=your_make_prog` to configure. For example: - -``` -shell$ ./configure MAKE=/path/to/my/make ... -``` - -This could be the case, for instance, if you have a shell alias for -`make`, or you always type `gmake` out of habit. Failure to tell -`configure` which non-default `make` you will use to compile Open MPI -can result in undefined behavior (meaning: don't do that). - -Note that you may also want to ensure that the value of -`LD_LIBRARY_PATH` is set appropriately (or not at all) for your build -(or whatever environment variable is relevant for your operating -system). For example, some users have been tripped up by setting to -use a non-default Fortran compiler via the `FC` environment variable, -but then failing to set `LD_LIBRARY_PATH` to include the directory -containing that non-default Fortran compiler's support libraries. -This causes Open MPI's `configure` script to fail when it tries to -compile / link / run simple Fortran programs. - -It is required that the compilers specified be compile and link -compatible, meaning that object files created by one compiler must be -able to be linked with object files from the other compilers and -produce correctly functioning executables. - -Open MPI supports all the `make` targets that are provided by GNU -Automake, such as: - -* `all`: build the entire Open MPI package -* `install`: install Open MPI -* `uninstall`: remove all traces of Open MPI from the $prefix -* `clean`: clean out the build tree - -Once Open MPI has been built and installed, it is safe to run `make -clean` and/or remove the entire build tree. - -VPATH and parallel builds are fully supported. - -Generally speaking, the only thing that users need to do to use Open -MPI is ensure that `PREFIX/bin` is in their `PATH` and `PREFIX/lib` is -in their `LD_LIBRARY_PATH`. Users may need to ensure to set the -`PATH` and `LD_LIBRARY_PATH` in their shell setup files (e.g., -`.bashrc`, `.cshrc`) so that non-interactive `rsh`/`ssh`-based logins -will be able to find the Open MPI executables. - - -## Open MPI Version Numbers and Binary Compatibility - -Open MPI has two sets of version numbers that are likely of interest -to end users / system administrator: - -1. Software version number -1. Shared library version numbers - -Both are predicated on Open MPI's definition of "backwards -compatibility." - -***NOTE:*** The version numbering conventions were changed with the -release of v1.10.0. Most notably, Open MPI no longer uses an -"odd/even" release schedule to indicate feature development vs. stable -releases. See the README in releases prior to v1.10.0 for more -information (e.g., -https://github.com/open-mpi/ompi/blob/v1.8/README#L1392-L1475). - - -### Backwards Compatibility - -Open MPI version Y is backwards compatible with Open MPI version X -(where Y>X) if users can: - -* Compile an MPI/OpenSHMEM application with version X, - `mpirun`/`oshrun` it with version Y, and get the same - user-observable behavior. -* Invoke `ompi_info` with the same CLI options in versions X and Y and - get the same user-observable behavior. - -Note that this definition encompasses several things: - -* Application Binary Interface (ABI) -* MPI / OpenSHMEM run time system -* `mpirun` / `oshrun` command line options -* MCA parameter names / values / meanings - -However, this definition only applies when the same version of Open -MPI is used with all instances of the runtime and MPI / OpenSHMEM -processes in a single MPI job. If the versions are not exactly the -same everywhere, Open MPI is not guaranteed to work properly in any -scenario. - -Backwards compatibility tends to work best when user applications are -dynamically linked to one version of the Open MPI / OSHMEM libraries, -and can be updated at run time to link to a new version of the Open -MPI / OSHMEM libraries. - -For example, if an MPI / OSHMEM application links statically against -the libraries from Open MPI vX, then attempting to launch that -application with `mpirun` / `oshrun` from Open MPI vY is not guaranteed to -work (because it is mixing vX and vY of Open MPI in a single job). - -Similarly, if using a container technology that internally bundles all -the libraries from Open MPI vX, attempting to launch that container -with `mpirun` / `oshrun` from Open MPI vY is not guaranteed to work. - -### Software Version Number - -Official Open MPI releases use the common "A.B.C" version identifier -format. Each of the three numbers has a specific meaning: - -* Major: The major number is the first integer in the version string - Changes in the major number typically indicate a significant - change in the code base and/or end-user functionality, and also - indicate a break from backwards compatibility. Specifically: Open - MPI releases with different major version numbers are not - backwards compatibale with each other. - - ***CAVEAT:*** This rule does not extend to versions prior to v1.10.0. - Specifically: v1.10.x is not guaranteed to be backwards - compatible with other v1.x releases. - -* Minor: The minor number is the second integer in the version string. - Changes in the minor number indicate a user-observable change in the - code base and/or end-user functionality. Backwards compatibility - will still be preserved with prior releases that have the same major - version number (e.g., v2.5.3 is backwards compatible with v2.3.1). - -* Release: The release number is the third integer in the version - string. Changes in the release number typically indicate a bug fix - in the code base and/or end-user functionality. For example, if - there is a release that only contains bug fixes and no other - user-observable changes or new features, only the third integer will - be increased (e.g., from v4.3.0 to v4.3.1). - -The "A.B.C" version number may optionally be followed by a Quantifier: - -* Quantifier: Open MPI version numbers sometimes have an arbitrary - string affixed to the end of the version number. Common strings - include: - * aX: Indicates an alpha release. X is an integer indicating the - number of the alpha release (e.g., v1.10.3a5 indicates the 5th - alpha release of version 1.10.3). - * bX: Indicates a beta release. X is an integer indicating the - number of the beta release (e.g., v1.10.3b3 indicates the 3rd beta - release of version 1.10.3). - * rcX: Indicates a release candidate. X is an integer indicating the - number of the release candidate (e.g., v1.10.3rc4 indicates the - 4th release candidate of version 1.10.3). - -Nightly development snapshot tarballs use a different version number -scheme; they contain three distinct values: - -* The git branch name from which the tarball was created. -* The date/timestamp, in `YYYYMMDDHHMM` format. -* The hash of the git commit from which the tarball was created. - -For example, a snapshot tarball filename of -`openmpi-v2.x-201703070235-e4798fb.tar.gz` indicates that this tarball -was created from the v2.x branch, on March 7, 2017, at 2:35am GMT, -from git hash e4798fb. - -### Shared Library Version Number - -The GNU Libtool official documentation details how the versioning -scheme works. The quick version is that the shared library versions -are a triple of integers: (current,revision,age), or `c:r:a`. This -triple is not related to the Open MPI software version number. There -are six simple rules for updating the values (taken almost verbatim -from the Libtool docs): - -1. Start with version information of `0:0:0` for each shared library. -1. Update the version information only immediately before a public - release of your software. More frequent updates are unnecessary, - and only guarantee that the current interface number gets larger - faster. -1. If the library source code has changed at all since the last - update, then increment revision (`c:r:a` becomes `c:r+1:a`). -1. If any interfaces have been added, removed, or changed since the - last update, increment current, and set revision to 0. -1. If any interfaces have been added since the last public release, - then increment age. -1. If any interfaces have been removed since the last public release, - then set age to 0. - -Here's how we apply those rules specifically to Open MPI: - -1. The above rules do not apply to MCA components (a.k.a. "plugins"); - MCA component `.so` versions stay unspecified. -1. The above rules apply exactly as written to the following libraries - starting with Open MPI version v1.5 (prior to v1.5, `libopen-pal` - and `libopen-rte` were still at `0:0:0` for reasons discussed in bug - ticket #2092 https://svn.open-mpi.org/trac/ompi/ticket/2092): - * `libopen-rte` - * `libopen-pal` - * `libmca_common_*` -1. The following libraries use a slightly modified version of the - above rules: rules 4, 5, and 6 only apply to the official MPI and - OpenSHMEM interfaces (functions, global variables). The rationale - for this decision is that the vast majority of our users only care - about the official/public MPI/OpenSHMEM interfaces; we therefore - want the `.so` version number to reflect only changes to the - official MPI/OpenSHMEM APIs. Put simply: non-MPI/OpenSHMEM API / - internal changes to the MPI-application-facing libraries are - irrelevant to pure MPI/OpenSHMEM applications. - * `libmpi` - * `libmpi_mpifh` - * `libmpi_usempi_tkr` - * `libmpi_usempi_ignore_tkr` - * `libmpi_usempif08` - * `libmpi_cxx` - * `libmpi_java` - * `liboshmem` - - -## Checking Your Open MPI Installation - -The `ompi_info` command can be used to check the status of your Open -MPI installation (located in `PREFIX/bin/ompi_info`). Running it with -no arguments provides a summary of information about your Open MPI -installation. - -Note that the `ompi_info` command is extremely helpful in determining -which components are installed as well as listing all the run-time -settable parameters that are available in each component (as well as -their default values). - -The following options may be helpful: - -* `--all`: Show a *lot* of information about your Open MPI - installation. -* `--parsable`: Display all the information in an easily - `grep`/`cut`/`awk`/`sed`-able format. -* `--param FRAMEWORK COMPONENT`: - A `FRAMEWORK` value of `all` and a `COMPONENT` value of `all` will - show all parameters to all components. Otherwise, the parameters of - all the components in a specific framework, or just the parameters - of a specific component can be displayed by using an appropriate - FRAMEWORK and/or COMPONENT name. -* `--level LEVEL`: - By default, `ompi_info` only shows "Level 1" MCA parameters -- - parameters that can affect whether MPI processes can run - successfully or not (e.g., determining which network interfaces to - use). The `--level` option will display all MCA parameters from - level 1 to `LEVEL` (the max `LEVEL` value is 9). Use `ompi_info - --param FRAMEWORK COMPONENT --level 9` to see *all* MCA parameters - for a given component. See "The Modular Component Architecture - (MCA)" section, below, for a fuller explanation. - -Changing the values of these parameters is explained in the "The -Modular Component Architecture (MCA)" section, below. - -When verifying a new Open MPI installation, we recommend running six -tests: - -1. Use `mpirun` to launch a non-MPI program (e.g., `hostname` or - `uptime`) across multiple nodes. -1. Use `mpirun` to launch a trivial MPI program that does no MPI - communication (e.g., the `hello_c` program in the `examples/` - directory in the Open MPI distribution). -1. Use `mpirun` to launch a trivial MPI program that sends and - receives a few MPI messages (e.g., the `ring_c` program in the - `examples/` directory in the Open MPI distribution). -1. Use `oshrun` to launch a non-OpenSHMEM program across multiple - nodes. -1. Use `oshrun` to launch a trivial MPI program that does no OpenSHMEM - communication (e.g., `hello_shmem.c` program in the `examples/` - directory in the Open MPI distribution.) -1. Use `oshrun` to launch a trivial OpenSHMEM program that puts and - gets a few messages (e.g., the `ring_shmem.c` in the `examples/` - directory in the Open MPI distribution.) - -If you can run all six of these tests successfully, that is a good -indication that Open MPI built and installed properly. - - -## Open MPI API Extensions - -Open MPI contains a framework for extending the MPI API that is -available to applications. Each extension is usually a standalone set -of functionality that is distinct from other extensions (similar to -how Open MPI's plugins are usually unrelated to each other). These -extensions provide new functions and/or constants that are available -to MPI applications. - -WARNING: These extensions are neither standard nor portable to other -MPI implementations! - -### Compiling the extensions - -Open MPI extensions are all enabled by default; they can be disabled -via the `--disable-mpi-ext` command line switch. - -Since extensions are meant to be used by advanced users only, this -file does not document which extensions are available or what they -do. Look in the ompi/mpiext/ directory to see the extensions; each -subdirectory of that directory contains an extension. Each has a -README file that describes what it does. - -### Using the extensions - -To reinforce the fact that these extensions are non-standard, you must -include a separate header file after `` to obtain the function -prototypes, constant declarations, etc. For example: - -```c -#include -#if defined(OPEN_MPI) && OPEN_MPI -#include -#endif - -int main() { - MPI_Init(NULL, NULL); - -#if defined(OPEN_MPI) && OPEN_MPI - { - char ompi_bound[OMPI_AFFINITY_STRING_MAX]; - char current_binding[OMPI_AFFINITY_STRING_MAX]; - char exists[OMPI_AFFINITY_STRING_MAX]; - OMPI_Affinity_str(OMPI_AFFINITY_LAYOUT_FMT, ompi_bound, - current_bindings, exists); - } -#endif - MPI_Finalize(); - return 0; -} -``` - -Notice that the Open MPI-specific code is surrounded by the `#if` -statement to ensure that it is only ever compiled by Open MPI. - -The Open MPI wrapper compilers (`mpicc` and friends) should -automatically insert all relevant compiler and linker flags necessary -to use the extensions. No special flags or steps should be necessary -compared to "normal" MPI applications. - - -## Compiling Open MPI Applications - -Open MPI provides "wrapper" compilers that should be used for -compiling MPI and OpenSHMEM applications: - -* C: `mpicc`, `oshcc` -* C++: `mpiCC`, `oshCC` (or `mpic++` if your filesystem is case-insensitive) -* Fortran: `mpifort`, `oshfort` - -For example: - -``` -shell$ mpicc hello_world_mpi.c -o hello_world_mpi -g -shell$ -``` - -For OpenSHMEM applications: - -``` -shell$ oshcc hello_shmem.c -o hello_shmem -g -shell$ -``` - -All the wrapper compilers do is add a variety of compiler and linker -flags to the command line and then invoke a back-end compiler. To be -specific: the wrapper compilers do not parse source code at all; they -are solely command-line manipulators, and have nothing to do with the -actual compilation or linking of programs. The end result is an MPI -executable that is properly linked to all the relevant libraries. - -Customizing the behavior of the wrapper compilers is possible (e.g., -changing the compiler [not recommended] or specifying additional -compiler/linker flags); see the Open MPI FAQ for more information. - -Alternatively, Open MPI also installs `pkg-config(1)` configuration -files under `$libdir/pkgconfig`. If `pkg-config` is configured to find -these files, then compiling / linking Open MPI programs can be -performed like this: - -``` -shell$ gcc hello_world_mpi.c -o hello_world_mpi -g \ - `pkg-config ompi-c --cflags --libs` -shell$ -``` - -Open MPI supplies multiple `pkg-config(1)` configuration files; one -for each different wrapper compiler (language): - -* `ompi`: Synonym for `ompi-c`; Open MPI applications using the C - MPI bindings -* `ompi-c`: Open MPI applications using the C MPI bindings -* `ompi-cxx`: Open MPI applications using the C MPI bindings -* `ompi-fort`: Open MPI applications using the Fortran MPI bindings - -The following `pkg-config(1)` configuration files *may* be installed, -depending on which command line options were specified to Open MPI's -configure script. They are not necessary for MPI applications, but -may be used by applications that use Open MPI's lower layer support -libraries. - -* `opal`: Open Portable Access Layer applications - - -## Running Open MPI Applications - -Open MPI supports both `mpirun` and `mpiexec` (they are exactly -equivalent) to launch MPI applications. For example: - -``` -shell$ mpirun -np 2 hello_world_mpi -or -shell$ mpiexec -np 1 hello_world_mpi : -np 1 hello_world_mpi -``` - -are equivalent. - -The `rsh` launcher (which defaults to using `ssh`) accepts a -`--hostfile` parameter (the option `--machinefile` is equivalent); you -can specify a `--hostfile` parameter indicating a standard -`mpirun`-style hostfile (one hostname per line): - -``` -shell$ mpirun --hostfile my_hostfile -np 2 hello_world_mpi -``` - -If you intend to run more than one process on a node, the hostfile can -use the "slots" attribute. If "slots" is not specified, a count of 1 -is assumed. For example, using the following hostfile: - -``` -shell$ cat my_hostfile -node1.example.com -node2.example.com -node3.example.com slots=2 -node4.example.com slots=4 -``` - -``` -shell$ mpirun --hostfile my_hostfile -np 8 hello_world_mpi -``` - -will launch `MPI_COMM_WORLD` rank 0 on node1, rank 1 on node2, ranks 2 -and 3 on node3, and ranks 4 through 7 on node4. - -Other starters, such as the resource manager / batch scheduling -environments, do not require hostfiles (and will ignore the hostfile -if it is supplied). They will also launch as many processes as slots -have been allocated by the scheduler if no "-np" argument has been -provided. For example, running a SLURM job with 8 processors: - -``` -shell$ salloc -n 8 mpirun a.out -``` - -The above command will reserve 8 processors and run 1 copy of mpirun, -which will, in turn, launch 8 copies of a.out in a single -`MPI_COMM_WORLD` on the processors that were allocated by SLURM. - -Note that the values of component parameters can be changed on the -`mpirun` / `mpiexec` command line. This is explained in the section -below, "The Modular Component Architecture (MCA)". - -Open MPI supports `oshrun` to launch OpenSHMEM applications. For -example: - -``` -shell$ oshrun -np 2 hello_world_oshmem -``` - -OpenSHMEM applications may also be launched directly by resource -managers such as SLURM. For example, when OMPI is configured -`--with-pmix` and `--with-slurm`, one may launch OpenSHMEM applications -via `srun`: - -``` -shell$ srun -N 2 hello_world_oshmem -``` - -## The Modular Component Architecture (MCA) - -The MCA is the backbone of Open MPI -- most services and functionality -are implemented through MCA components. - -### MPI layer frameworks - -Here is a list of all the component frameworks in the MPI layer of -Open MPI: - -* `bml`: BTL management layer -* `coll`: MPI collective algorithms -* `fbtl`: file byte transfer layer: abstraction for individual - read: collective read and write operations for MPI I/O -* `fs`: file system functions for MPI I/O -* `io`: MPI I/O -* `mtl`: Matching transport layer, used for MPI point-to-point - messages on some types of networks -* `op`: Back end computations for intrinsic MPI_Op operators -* `osc`: MPI one-sided communications -* `pml`: MPI point-to-point management layer -* `rte`: Run-time environment operations -* `sharedfp`: shared file pointer operations for MPI I/O -* `topo`: MPI topology routines -* `vprotocol`: Protocols for the "v" PML - -### OpenSHMEM component frameworks - -* `atomic`: OpenSHMEM atomic operations -* `memheap`: OpenSHMEM memory allocators that support the - PGAS memory model -* `scoll`: OpenSHMEM collective operations -* `spml`: OpenSHMEM "pml-like" layer: supports one-sided, - point-to-point operations -* `sshmem`: OpenSHMEM shared memory backing facility - -### Back-end run-time environment (RTE) component frameworks: - -* `dfs`: Distributed file system -* `errmgr`: RTE error manager -* `ess`: RTE environment-specific services -* `filem`: Remote file management -* `grpcomm`: RTE group communications -* `iof`: I/O forwarding -* `notifier`: System-level notification support -* `odls`: OpenRTE daemon local launch subsystem -* `oob`: Out of band messaging -* `plm`: Process lifecycle management -* `ras`: Resource allocation system -* `rmaps`: Resource mapping system -* `rml`: RTE message layer -* `routed`: Routing table for the RML -* `rtc`: Run-time control framework -* `schizo`: OpenRTE personality framework -* `state`: RTE state machine - -### Miscellaneous frameworks: - -* `allocator`: Memory allocator -* `backtrace`: Debugging call stack backtrace support -* `btl`: Point-to-point Byte Transfer Layer -* `dl`: Dynamic loading library interface -* `event`: Event library (libevent) versioning support -* `hwloc`: Hardware locality (hwloc) versioning support -* `if`: OS IP interface support -* `installdirs`: Installation directory relocation services -* `memchecker`: Run-time memory checking -* `memcpy`: Memory copy support -* `memory`: Memory management hooks -* `mpool`: Memory pooling -* `patcher`: Symbol patcher hooks -* `pmix`: Process management interface (exascale) -* `pstat`: Process status -* `rcache`: Memory registration cache -* `sec`: Security framework -* `shmem`: Shared memory support (NOT related to OpenSHMEM) -* `timer`: High-resolution timers - -### Framework notes - -Each framework typically has one or more components that are used at -run-time. For example, the `btl` framework is used by the MPI layer -to send bytes across different types underlying networks. The `tcp` -`btl`, for example, sends messages across TCP-based networks; the -`ucx` `pml` sends messages across InfiniBand-based networks. - -Each component typically has some tunable parameters that can be -changed at run-time. Use the `ompi_info` command to check a component -to see what its tunable parameters are. For example: - -``` -shell$ ompi_info --param btl tcp -``` - -shows some of the parameters (and default values) for the `tcp` `btl` -component (use `--level` to show *all* the parameters; see below). - -Note that `ompi_info` only shows a small number a component's MCA -parameters by default. Each MCA parameter has a "level" value from 1 -to 9, corresponding to the MPI-3 MPI_T tool interface levels. In Open -MPI, we have interpreted these nine levels as three groups of three: - -1. End user / basic -1. End user / detailed -1. End user / all -1. Application tuner / basic -1. Application tuner / detailed -1. Application tuner / all -1. MPI/OpenSHMEM developer / basic -1. MPI/OpenSHMEM developer / detailed -1. MPI/OpenSHMEM developer / all - -Here's how the three sub-groups are defined: - -1. End user: Generally, these are parameters that are required for - correctness, meaning that someone may need to set these just to - get their MPI/OpenSHMEM application to run correctly. -1. Application tuner: Generally, these are parameters that can be - used to tweak MPI application performance. -1. MPI/OpenSHMEM developer: Parameters that either don't fit in the - other two, or are specifically intended for debugging / - development of Open MPI itself. - -Each sub-group is broken down into three classifications: - -1. Basic: For parameters that everyone in this category will want to - see. -1. Detailed: Parameters that are useful, but you probably won't need - to change them often. -1. All: All other parameters -- probably including some fairly - esoteric parameters. - -To see *all* available parameters for a given component, specify that -ompi_info should use level 9: - -``` -shell$ ompi_info --param btl tcp --level 9 -``` - -These values can be overridden at run-time in several ways. At -run-time, the following locations are examined (in order) for new -values of parameters: - -1. `PREFIX/etc/openmpi-mca-params.conf`: - This file is intended to set any system-wide default MCA parameter - values -- it will apply, by default, to all users who use this Open - MPI installation. The default file that is installed contains many - comments explaining its format. - -1. `$HOME/.openmpi/mca-params.conf`: - If this file exists, it should be in the same format as - `PREFIX/etc/openmpi-mca-params.conf`. It is intended to provide - per-user default parameter values. - -1. environment variables of the form `OMPI_MCA_` set equal to a - `VALUE`: - - Where `` is the name of the parameter. For example, set the - variable named `OMPI_MCA_btl_tcp_frag_size` to the value 65536 - (Bourne-style shells): - - ``` - shell$ OMPI_MCA_btl_tcp_frag_size=65536 - shell$ export OMPI_MCA_btl_tcp_frag_size - ``` - -4. the `mpirun`/`oshrun` command line: `--mca NAME VALUE` - - Where is the name of the parameter. For example: - - ``` - shell$ mpirun --mca btl_tcp_frag_size 65536 -np 2 hello_world_mpi - ``` - -These locations are checked in order. For example, a parameter value -passed on the `mpirun` command line will override an environment -variable; an environment variable will override the system-wide -defaults. - -Each component typically activates itself when relevant. For example, -the usNIC component will detect that usNIC devices are present and -will automatically be used for MPI communications. The SLURM -component will automatically detect when running inside a SLURM job -and activate itself. And so on. - -Components can be manually activated or deactivated if necessary, of -course. The most common components that are manually activated, -deactivated, or tuned are the `btl` components -- components that are -used for MPI point-to-point communications on many types common -networks. - -For example, to *only* activate the `tcp` and `self` (process loopback) -components are used for MPI communications, specify them in a -comma-delimited list to the `btl` MCA parameter: - -``` -shell$ mpirun --mca btl tcp,self hello_world_mpi -``` - -To add shared memory support, add `sm` into the command-delimited list -(list order does not matter): - -``` -shell$ mpirun --mca btl tcp,sm,self hello_world_mpi -``` - -(there used to be a `vader` BTL for shared memory support; it was -renamed to `sm` in Open MPI v5.0.0, but the alias `vader` still works -as well) - -To specifically deactivate a specific component, the comma-delimited -list can be prepended with a `^` to negate it: - -``` -shell$ mpirun --mca btl ^tcp hello_mpi_world -``` - -The above command will use any other `btl` component other than the -`tcp` component. - - -## Questions? Problems? - -Found a bug? Got a question? Want to make a suggestion? Want to -contribute to Open MPI? Please let us know! - -When submitting questions and problems, be sure to include as much -extra information as possible. [See the community help web -page](https://www.open-mpi.org/community/help/) for details on all the -information that we request in order to provide assistance: - -The best way to report bugs, send comments, or ask questions is to -sign up on the user's and/or developer's mailing list (for user-level -and developer-level questions; when in doubt, send to the user's -list): - -* users@lists.open-mpi.org -* devel@lists.open-mpi.org - -Because of spam, only subscribers are allowed to post to these lists -(ensure that you subscribe with and post from exactly the same e-mail -address -- joe@example.com is considered different than -joe@mycomputer.example.com!). Visit these pages to subscribe to the -lists: - -* [Subscribe to the users mailing - list](https://lists.open-mpi.org/mailman/listinfo/users) -* [Subscribe to the developers mailing - list](https://lists.open-mpi.org/mailman/listinfo/devel) - -Make today an Open MPI day! +[The Open MPI Project](https://www.open-mpi.org/) is an open source +implementation of the [Message Passing Interface (MPI) +specification](https://www.mpi-forum.org/docs/) that is developed and +maintained by a consortium of academic, research, and industry +partners. Open MPI is therefore able to combine the expertise, +technologies, and resources from all across the High Performance +Computing community in order to build the best MPI library available. +Open MPI offers advantages for system and software vendors, +application developers and computer science researchers. + +## Official documentation + +The Open MPI documentation can be viewed in the following ways: + +1. Online at https://docs.open-mpi.org/ +1. In self-contained (i.e., suitable for local viewing, without an + internet connection) in official distribution tarballs under + `docs/_build/html/index.html`. + +## Building the documentation locally + +The source code for Open MPI's docs can be found in the Open MPI Git +repository under the `docs` folder. + +Developers who clone the Open MPI Git repository will not have the +HTML documentation and man pages by default; it must be built. +Instructions for how to build the Open MPI documentation can be found +here: +https://docs.open-mpi.org/en/main/developers/prerequisites.html#sphinx-and-therefore-python. diff --git a/VERSION b/VERSION index d616e1c6c77..f1c8928faf6 100644 --- a/VERSION +++ b/VERSION @@ -3,7 +3,7 @@ # Copyright (c) 2011 NVIDIA Corporation. All rights reserved. # Copyright (c) 2013 Mellanox Technologies, Inc. # All rights reserved. -# Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2016-2022 IBM Corporation. All rights reserved. # Copyright (c) 2017 Los Alamos National Security, LLC. All rights # reserved. @@ -16,9 +16,24 @@ # ... major=5 -minor=0 +minor=1 release=0 +# MPI Standard Compliance Level +mpi_standard_version=3 +mpi_standard_subversion=1 + +# OMPI required dependency versions. +# List in x.y.z format. +pmix_min_version=4.2.0 +prte_min_version=3.0.0 +hwloc_min_version=2.1.0 +event_min_version=2.0.21 +automake_min_version=1.13.4 +autoconf_min_version=2.69.0 +libtool_min_version=2.4.2 +flex_min_version=2.5.4 + # greek is generally used for alpha or beta release tags. If it is # non-empty, it will be appended to the version number. It does not # have to be numeric. Common examples include: a1 (alpha release 1), @@ -103,4 +118,3 @@ libmca_opal_common_cuda_so_version=0:0:0 libmca_opal_common_ofi_so_version=0:0:0 libmca_opal_common_sm_so_version=0:0:0 libmca_opal_common_ucx_so_version=0:0:0 -libmca_opal_common_ugni_so_version=0:0:0 diff --git a/autogen.pl b/autogen.pl index 67361f0ec81..ecc726b54eb 100755 --- a/autogen.pl +++ b/autogen.pl @@ -1,16 +1,17 @@ #!/usr/bin/env perl # -# Copyright (c) 2009-2021 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved # Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013 Mellanox Technologies, Inc. # All rights reserved. # Copyright (c) 2013-2020 Intel, Inc. All rights reserved. -# Copyright (c) 2015-2020 Research Organization for Information Science +# Copyright (c) 2015-2024 Research Organization for Information Science # and Technology (RIST). All rights reserved. -# Copyright (c) 2015-2021 IBM Corporation. All rights reserved. +# Copyright (c) 2015-2022 IBM Corporation. All rights reserved. # Copyright (c) 2020 Amazon.com, Inc. or its affiliates. # All Rights reserved. # +# Copyright (c) 2025 Nanook Consulting All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -43,14 +44,9 @@ # Data structures to fill up with all the stuff we find my $mca_found; my $mpiext_found; -my $mpicontrib_found; my @subdirs; # Command line parameters -my $no_ompi_arg = 0; -my $no_orte_arg = 0; -my $no_prrte_arg = 0; -my $no_oshmem_arg = 0; my $no_3rdparty_arg = ""; my $quiet_arg = 0; my $debug_arg = 0; @@ -66,9 +62,9 @@ my $exclude_list; # Minimum versions -my $ompi_automake_version = "1.13.4"; -my $ompi_autoconf_version = "2.69"; -my $ompi_libtool_version = "2.4.2"; +my $ompi_automake_version; +my $ompi_autoconf_version; +my $ompi_libtool_version; # Search paths my $ompi_autoconf_search = "autoconf"; @@ -76,8 +72,8 @@ my $ompi_libtoolize_search = "libtoolize;glibtoolize"; # version of packages we ship as tarballs -my $libevent_version="2.1.12-stable"; -my $hwloc_version="2.4.0"; +my $libevent_version="2.1.12-stable-ompi"; +my $hwloc_version="2.7.1"; # One-time setup my $username; @@ -86,12 +82,6 @@ # Patch program my $patch_prog = "patch"; -# Solaris "patch" doesn't understand unified diffs, and will cause -# autogen.pl to hang with a "File to patch:" prompt. Default to Linux -# "patch", but use "gpatch" on Solaris. -if ($^O eq "solaris") { - $patch_prog = "gpatch"; -} $username = $ENV{USER} || getpwuid($>); $full_hostname = $ENV{HOSTNAME} || `hostname`; @@ -134,6 +124,18 @@ sub debug_dump { ############################################################################## +sub list_contains { + my $searched_string = shift; + foreach my $str (@_) { + if ($searched_string eq $str) { + return 1; + } + } + return 0; +} + +############################################################################## + sub read_config_params { my ($filename, $dir_prefix) = @_; @@ -231,7 +233,7 @@ sub process_autogen_subdirs { # Note: there's no real technical reason to defer # processing the subdirs. It's more of an aesthetic # reason -- don't interrupt the current flow of - # finding mca / ext / contribs (which is a nice, fast + # finding mca / ext (which is a nice, fast # process). Then process the subdirs (which is a slow # process) all at once. push(@subdirs, "$dir/$_"); @@ -348,10 +350,18 @@ sub mca_process_framework { verbose "--- Found $pname / $framework / $d component\n"; # Skip if specifically excluded - if (exists($exclude_list->{$framework}) && - $exclude_list->{$framework}[0] eq $d) { - verbose " => Excluded\n"; - next; + if (exists($exclude_list->{$framework})) { + my $tst = 0; + foreach my $ck (@{$exclude_list->{$framework}}) { + if ($ck eq $d) { + verbose " => Excluded\n"; + $tst = 1; + last; + } + } + if ($tst) { + next; + } } # Skip if the framework is on the include list, but @@ -695,93 +705,6 @@ sub mpiext_run_global { } } -############################################################################## - -sub mpicontrib_process { - my ($topdir, $contrib_prefix, $contribdir) = @_; - - my $cdir = "$topdir/$contrib_prefix/$contribdir"; - return - if (! -d $cdir); - - # Process this directory (pretty much the same treatment as for - # MCA components, so it's in a sub). - my $found_contrib; - - $found_contrib->{"name"} = $contribdir; - - # Push the results onto the hash array - push(@{$mpicontrib_found}, $found_contrib); - - # Is there an autogen.subdirs in here? - process_autogen_subdirs($cdir); -} - -############################################################################## - -sub mpicontrib_run_global { - my ($contrib_prefix) = @_; - - my $topdir = Cwd::cwd(); - - my $dir = "$topdir/$contrib_prefix"; - opendir(DIR, $dir) || - my_die "Can't open $dir directory"; - foreach my $d (sort(readdir(DIR))) { - # Skip any non-directory, "base", or any dir that begins with "." - next - if (! -d "$dir/$d" || $d eq "base" || substr($d, 0, 1) eq "."); - - # If this directory has a configure.m4, then it's an - # contrib. - if (-f "$dir/$d/configure.m4") { - verbose "=== Found $d MPI contrib"; - - # Check ignore status - if (ignored("$dir/$d")) { - verbose " (ignored)\n"; - } else { - verbose "\n"; - mpicontrib_process($topdir, $contrib_prefix, $d); - } - } - } - closedir(DIR); - debug_dump($mpicontrib_found); - - #----------------------------------------------------------------------- - - $m4 .= "\n$dnl_line -$dnl_line -$dnl_line - -dnl Open MPI contrib information -$dnl_line\n\n"; - - # Array for all the m4_includes that we'll need to pick up the - # configure.m4's. - my @includes; - my $m4_config_contrib_list; - - # Troll through each of the found contribs - foreach my $contrib (@{$mpicontrib_found}) { - my $c = $contrib->{name}; - push(@includes, "$contrib_prefix/$c/configure.m4"); - $m4_config_contrib_list .= ", $c"; - } - - $m4_config_contrib_list =~ s/^, //; - - # List the M4 and no configure contribs - $m4 .= "dnl List of all MPI contribs -m4_define([ompi_mpicontrib_list], [$m4_config_contrib_list])\n"; - # List out all the m4_include - $m4 .= "\ndnl List of configure.m4 files to include\n"; - foreach my $i (@includes) { - $m4 .= "m4_include([$i])\n"; - } -} - ############################################################################## # Find and remove stale files @@ -939,6 +862,10 @@ sub patch_autotools_output { verbose "$indent_str"."Patching \"-pthread\" option for NAG compiler in ltmain.sh\n"; system("$patch_prog -N -p0 < $topdir/config/ltmain_nag_pthread.diff >/dev/null 2>&1"); unlink("config/ltmain.sh.rej"); + + verbose "$indent_str"."Patching \"-framework\" option for flang compiler in ltmain.sh\n"; + system("$patch_prog -N -p0 < $topdir/config/ltmain_flang_darwin.diff >/dev/null 2>&1"); + unlink("config/ltmain.sh.rej"); } # If there's no configure script, there's nothing else to do. @@ -963,9 +890,9 @@ sub patch_autotools_output { # source tree); we can't fix it. So all we can do is patch the # resulting configure script. :-( push(@verbose_out, $indent_str . "Patching configure for Libtool PGI 10 fortran compiler name\n"); - $c =~ s/gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn/gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn/g; - $c =~ s/pgcc\* \| pgf77\* \| pgf90\* \| pgf95\*\)/pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)/g; - $c =~ s/pgf77\* \| pgf90\* \| pgf95\*\)/pgf77* | pgf90* | pgf95* | pgfortran*)/g; + $c =~ s/gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn/gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran nvfortran pgf95 lf95 ftn/g; + $c =~ s/pgcc\* \| pgf77\* \| pgf90\* \| pgf95\*\)/pgcc* | pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)/g; + $c =~ s/pgf77\* \| pgf90\* \| pgf95\*\)/pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)/g; # Similar issue as above -- the PGI 10 version number broke <=LT # 2.2.6b's version number checking regexps. Again, we can't fix the @@ -995,7 +922,7 @@ sub patch_autotools_output { '# ICC 10 doesn\047t accept -KPIC any more.\n.*\n\s+' . "lt_prog_compiler_wl${tag}="; my $replace_string = "# Flang compiler - *flang) + *flang*) lt_prog_compiler_wl${tag}='-Wl,' lt_prog_compiler_pic${tag}='-fPIC -DPIC' lt_prog_compiler_static${tag}='-static' @@ -1045,10 +972,28 @@ sub patch_autotools_output { whole_archive_flag_spec${tag}= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared';; + tmp_sharedflag='-Wl,-shared' ;; xl"; - push(@verbose_out, $indent_str . "Patching configure for NAG compiler ($tag)\n"); + push(@verbose_out, $indent_str . "Patching configure for NAG compiler #1 ($tag)\n"); + $c =~ s/$search_string/$replace_string/; + + # Newer versions of Libtool have the previous patch already. Therefore, + # we add the support for convenience libraries separately + my $search_string = "whole_archive_flag_spec${tag}=" . '\n\s+' . + "tmp_sharedflag='--shared' ;;" . '\n\s+' . + 'nagfor\052.*# NAGFOR 5.3\n\s+' . + "tmp_sharedflag='-Wl,-shared' ;;" . '\n\s+' . + 'xl'; + my $replace_string = "whole_archive_flag_spec${tag}= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + whole_archive_flag_spec${tag}='\$wl--whole-archive`for conv in \$convenience\\\"\\\"; do test -n \\\"\$conv\\\" && new_convenience=\\\"\$new_convenience,\$conv\\\"; done; func_echo_all \\\"\$new_convenience\\\"` \$wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-Wl,-shared' ;; + xl"; + + push(@verbose_out, $indent_str . "Patching configure for NAG compiler #2 ($tag)\n"); $c =~ s/$search_string/$replace_string/; } @@ -1115,6 +1060,77 @@ sub patch_autotools_output { *)'; $c =~ s/$search_string/$replace_string/g; + # Fix ifort support on OSX + # see https://ntq1982.github.io/files/20200621.html + $search_string = 'case \$cc_basename in + nagfor\*\) + # NAG Fortran compiler + lt_prog_compiler_wl_FC=\'-Wl,-Wl,,\' + lt_prog_compiler_pic_FC=\'-PIC\' + lt_prog_compiler_static_FC=\'-Bstatic\' + ;;'; + $replace_string = "case \$cc_basename in + flang*) + # flang compiler + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-fPIC' + lt_prog_compiler_static_FC='-static' + ;; + icc* | ifort*) + # Intel Fortran compiler + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-fno-common -PIC' + lt_prog_compiler_static_FC='' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl_FC='-Wl,-Wl,,' + lt_prog_compiler_pic_FC='-PIC' + lt_prog_compiler_static_FC='-Bstatic' + ;;"; + $c =~ s/$search_string/$replace_string/g; + + $c =~ s/for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor/for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor nvfortran/g; + foreach my $tag (("", "_FC")) { + $search_string = 'tcc\*\) + # Fabrice Bellard et al\'s Tiny C Compiler + lt_prog_compiler_wl'."${tag}".'=\'-Wl,\' + lt_prog_compiler_pic'."${tag}".'=\'-fPIC\' + lt_prog_compiler_static'."${tag}".'=\'-static\' + ;;'; + $replace_string = "tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl${tag}='-Wl,' + lt_prog_compiler_pic${tag}='-fPIC' + lt_prog_compiler_static${tag}='-static' + ;; + nvc* | nvcc* | nvfortran*) + # NVIDIA Fortran compiler + lt_prog_compiler_wl${tag}='-Wl,' + lt_prog_compiler_pic${tag}='-fPIC' + lt_prog_compiler_static${tag}='-Bstatic' + ;;"; + push(@verbose_out, $indent_str . "Patching configure for NVIDIA Fortran compiler (${tag})\n"); + $c =~ s/$search_string/$replace_string/g; + } + + $search_string = 'case \$cc_basename in + ifort\*\|nagfor\*\) _lt_dar_can_shared=yes ;; + \*\) _lt_dar_can_shared=\$GCC ;; + esac'; + $replace_string = "case \$cc_basename in + flang*|ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=\$GCC ;; + esac"; + push(@verbose_out, $indent_str . "Patching configure for flang compiler on Darwin (FC)\n"); + $c =~ s/$search_string/$replace_string/g; + + $search_string = 'archive_cmds_FC="\\\\\\$CC -dynamiclib'; + $replace_string = 'archive_cmds_FC="\$CC --shared'; + push(@verbose_out, $indent_str . "Patching configure for flang compiler on Darwin (FC)\n"); + $c =~ s/$search_string/$replace_string/g; + $c =~ s/(archive_cmds_FC.*)-install_name \\\$rpath/$1-Wl,-install_name,\\\`echo \\\$rpath | sed \'s%^[ ]*%%\'\\\`/g; + # Only write out verbose statements and a new configure if the # configure content actually changed return @@ -1131,6 +1147,76 @@ sub patch_autotools_output { unlink("configure.patched"); } +sub export_version { + my ($name,$version) = @_; + $version =~ s/[^a-zA-Z0-9,.]//g; + my @version_splits = split(/\./,$version); + my $hex = sprintf("0x%04x%02x%02x", $version_splits[0], $version_splits[1], $version_splits[2]); + $m4 .= "m4_define([OMPI_${name}_MIN_VERSION], [$version])\n"; + $m4 .= "m4_define([OMPI_${name}_NUMERIC_MIN_VERSION], [$hex])\n"; +} + +sub export_mpi_version { + my ($name,$version) = @_; + $version =~ s/[^a-zA-Z0-9,.]//g; + $m4 .= "m4_define([$name], [$version])\n"; +} + +sub get_and_define_min_versions() { + + open(IN, "VERSION") || my_die "Can't open VERSION"; + while () { + my $line = $_; + my @fields = split(/=/,$line); + if ($fields[0] eq "automake_min_version") { + if ($fields[1] ne "\n") { + $ompi_automake_version = $fields[1]; + } + } + elsif($fields[0] eq "autoconf_min_version") { + if ($fields[1] ne "\n") { + $ompi_autoconf_version = $fields[1]; + } + } + elsif($fields[0] eq "libtool_min_version") { + if ($fields[1] ne "\n") { + $ompi_libtool_version = $fields[1]; + } + } + elsif($fields[0] eq "pmix_min_version") { + if ($fields[1] ne "\n") { + export_version("PMIX", $fields[1]); + } + } + elsif($fields[0] eq "prte_min_version") { + if ($fields[1] ne "\n") { + export_version("PRTE", $fields[1]); + } + } + elsif($fields[0] eq "hwloc_min_version") { + if ($fields[1] ne "\n") { + export_version("HWLOC", $fields[1]); + } + } + elsif($fields[0] eq "event_min_version") { + if ($fields[1] ne "\n") { + export_version("EVENT", $fields[1]); + } + } + elsif($fields[0] eq "mpi_standard_version") { + if ($fields[1] ne "\n") { + export_mpi_version("MPI_VERSION_NUM", $fields[1]); + } + } + elsif($fields[0] eq "mpi_standard_subversion") { + if ($fields[1] ne "\n") { + export_mpi_version("MPI_SUBVERSION_NUM", $fields[1]); + } + } + } + close(IN); +} + sub in_tarball { my $tarball = 0; open(IN, "VERSION") || my_die "Can't open VERSION"; @@ -1253,11 +1339,7 @@ sub replace_config_sub_guess { # Command line parameters -my $ok = Getopt::Long::GetOptions("no-ompi" => \$no_ompi_arg, - "no-orte" => \$no_orte_arg, - "no-prrte" => \$no_prrte_arg, - "no-oshmem" => \$no_oshmem_arg, - "no-3rdparty=s" => \$no_3rdparty_arg, +my $ok = Getopt::Long::GetOptions("no-3rdparty=s" => \$no_3rdparty_arg, "quiet|q" => \$quiet_arg, "debug|d" => \$debug_arg, "help|h" => \$help_arg, @@ -1272,10 +1354,6 @@ sub replace_config_sub_guess { print "Invalid command line argument.\n\n" if (!$ok); print "Options: - --no-ompi | -no-ompi Do not build the Open MPI layer - --no-orte | -no-orte Do not build Open MPI's runtime support (alias for --no-prrte) - --no-prrte | -no-prrte Do not build Open MPI's runtime support - --no-oshmem | -no-oshmem Do not build the OSHMEM layer --no-3rdparty Do not build the listed 3rd-party package (comma separtated list) --quiet | -q Do not display normal verbose output --debug | -d Output lots of debug information @@ -1300,24 +1378,6 @@ sub replace_config_sub_guess { my $project_name_long = "Open MPI"; my $project_name_short = "openmpi"; -if (! -e "ompi") { - $no_ompi_arg = 1; - debug "No ompi subdirectory found - will not build MPI layer\n"; -} -if (! -e "oshmem") { - $no_oshmem_arg = 1; - debug "No oshmem subdirectory found - will not build OSHMEM\n"; -} -# alias --no-orte to --no-prrte -if ($no_orte_arg == 1) { - $no_prrte_arg = 1; -} - -if ($no_ompi_arg == 1) { - $project_name_long = "Open Portability Access Layer"; - $project_name_short = "open-pal"; -} - my_die "Invalid value for --jobs $automake_jobs. Must be greater than 0." if (defined $automake_jobs && $automake_jobs <= 0); @@ -1340,10 +1400,10 @@ sub replace_config_sub_guess { #--------------------------------------------------------------------------- -# Verify that we're in the OMPI root directorty by checking for a token file. +# Verify that we're in the OMPI root directory by checking for a token file. my_die "Not at the root directory of an OMPI source tree" - if (! -f "config/opal_try_assemble.m4"); + if (! -f "config/opal_mca.m4"); my_die "autogen.pl has been invoked in the source tree of an Open MPI distribution tarball; aborting... You likely do not need to invoke \"autogen.pl\" -- you can probably run \"configure\" directly. @@ -1361,6 +1421,8 @@ sub replace_config_sub_guess { $step. Checking tool versions\n\n"; +get_and_define_min_versions(); + # Check the autotools revision levels &find_and_check("autoconf", $ompi_autoconf_search, $ompi_autoconf_version); &find_and_check("libtool", $ompi_libtoolize_search, $ompi_libtool_version); @@ -1371,24 +1433,49 @@ sub replace_config_sub_guess { ++$step; verbose "\n$step. Checking for git submodules\n\n"; +my @enabled_3rdparty_packages = (); +my @disabled_3rdparty_packages = split(/,/, $no_3rdparty_arg); +# Alias: 'openpmix' -> 'pmix' +if (list_contains("openpmix", @disabled_3rdparty_packages)) { + push(@disabled_3rdparty_packages, "pmix"); +} + # Make sure we got a submodule-full clone. If not, abort and let a # human figure it out. if (-f ".gitmodules") { - open(IN, "git submodule status|") - || die "Can't run \"git submodule status\""; + # Do a quick sanity check to ensure that non-3rd-party + # submodules are at least present (e.g., they won't be present + # if you downloaded a GitHub.com-created tarball). + open(IN, ".gitmodules") || + die "Can't open .gitmodules"; while () { - chomp; - $_ =~ m/^(.)(.{40}) ([^ ]+) *\(*([^\(\)]*)\)*$/; - my $status = $1; - my $local_hash = $2; - my $path = $3; - my $extra = $4; + # Find "path = " lines + if (!($_ =~ m/^\s+path = (.+)$/)) { + next; + } + my $path = $1; + + # Only care about paths that do not include "3rd-party" + if (index($path, "3rd-party") != -1) { + next; + } + + # Check that the path exists and is non-empty. + my $happy = 1; + if (! -d $path) { + $happy = 0; + } else { + opendir(DIR, $path) || + my_die "Can't open $path directory"; + my @files = readdir(DIR); + closedir(DIR); - print("=== Submodule: $path\n"); + $happy = 0 + if ($#files < 2); + } - # Make sure the submodule is there - if ($status eq "-") { - print(" ==> ERROR: Missing + if (!$happy) { + print(" ==> ERROR: Missing The submodule \"$path\" is missing. @@ -1396,19 +1483,45 @@ sub replace_config_sub_guess { \"git submodule update --init --recursive\"...?\n\n"); exit(1); } + } + + if (-d ".git") { + open(IN, "git submodule status|") + || die "Can't run \"git submodule status\""; + while () { + $_ =~ m/^(.)[0-9a-f]{40}\s+(\S+)/; + my $status = $1; + my $path = $2; + + print("=== Submodule: $path\n"); + if (index($path, "pmix") != -1 and list_contains("pmix", @disabled_3rdparty_packages)) { + print("Disabled - skipping openpmix"); + next; + } + if (index($path, "prrte") != -1 and list_contains("prrte", @disabled_3rdparty_packages)) { + print("Disabled - skipping prrte"); + next; + } + + # Make sure the submodule is there + if ($status eq "-") { + print(" ==> ERROR: Missing + +The submodule \"$path\" is missing. - # See if the submodule is at the expected git hash - # (it may be ok if it's not -- just warn the user) - $extra =~ m/-g(.+)/; - my $remote_hash = $1; - if ($remote_hash) { - my $abbrev_local_hash = substr($local_hash, 0, length($remote_hash)); - if ($remote_hash ne $abbrev_local_hash) { +Perhaps you forgot to \"git clone --recursive ...\", or you need to +\"git submodule update --init --recursive\"...?\n\n"); + exit(1); + } + + # See if the commit in the submodule is not the same as the + # commit that the git submodule thinks it should be. + elsif ($status eq "+") { print(" ==> WARNING: Submodule hash is different than upstream. If this is not intentional, you may want to run: \"git submodule update --init --recursive\"\n"); } else { - print(" Local hash == remote hash (good!)\n"); + print(" Local hash is what is expected by the submodule (good!)\n"); } } } @@ -1527,10 +1640,8 @@ sub replace_config_sub_guess { # Top-level projects to examine my $projects; push(@{$projects}, { name => "opal", dir => "opal", need_base => 1 }); -push(@{$projects}, { name => "ompi", dir => "ompi", need_base => 1 }) - if (!$no_ompi_arg); -push(@{$projects}, { name => "oshmem", dir => "oshmem", need_base => 1 }) - if (!$no_ompi_arg && !$no_oshmem_arg); +push(@{$projects}, { name => "ompi", dir => "ompi", need_base => 1 }); +push(@{$projects}, { name => "oshmem", dir => "oshmem", need_base => 1 }); $m4 .= "dnl Separate m4 define for each project\n"; foreach my $p (@$projects) { @@ -1550,12 +1661,6 @@ sub replace_config_sub_guess { ++$step; verbose "\n$step. Setup for 3rd-party packages\n"; -my @enabled_3rdparty_packages = (); -my @disabled_3rdparty_packages = split(/,/, $no_3rdparty_arg); -if ($no_prrte_arg) { - push(@disabled_3rdparty_packages, "prrte"); -} - $m4 .= "\n$dnl_line $dnl_line $dnl_line @@ -1563,7 +1668,8 @@ sub replace_config_sub_guess { dnl 3rd-party package information\n"; # Extract the OMPI options to exclude them when processing PMIx and PRRTE -if ( ! ("pmix" ~~ @disabled_3rdparty_packages && "prrte" ~~ @disabled_3rdparty_packages) ) { +if ( ! (list_contains("pmix", @disabled_3rdparty_packages) && + list_contains("prrte", @disabled_3rdparty_packages))) { safe_system("./config/extract-3rd-party-configure.pl -p . -n \"OMPI\" -l > config/auto-generated-ompi-exclude.ini"); } @@ -1571,7 +1677,7 @@ sub replace_config_sub_guess { # generic. Sorry :). verbose "=== Libevent\n"; -if ("libevent" ~~ @disabled_3rdparty_packages) { +if (list_contains("libevent", @disabled_3rdparty_packages)) { verbose "--- Libevent disabled\n"; } else { my $libevent_directory = "libevent-" . $libevent_version; @@ -1586,7 +1692,7 @@ sub replace_config_sub_guess { } verbose "=== hwloc\n"; -if ("hwloc" ~~ @disabled_3rdparty_packages) { +if (list_contains("hwloc", @disabled_3rdparty_packages)) { verbose "--- hwloc disabled\n"; } else { my $hwloc_directory = "hwloc-" . $hwloc_version; @@ -1597,11 +1703,11 @@ sub replace_config_sub_guess { $m4 .= "m4_define([package_hwloc], [1])\n"; $m4 .= "m4_define([hwloc_tarball], [" . $hwloc_tarball . "])\n"; $m4 .= "m4_define([hwloc_directory], [" . $hwloc_directory . "])\n"; - verbose "--- hwloc enabled\n"; + verbose "--- hwloc enabled (" . $hwloc_version . ")\n"; } verbose "=== PMIx\n"; -if ("pmix" ~~ @disabled_3rdparty_packages) { +if (list_contains("pmix", @disabled_3rdparty_packages)) { verbose "--- PMIx disabled\n"; } else { # sanity check pmix files exist @@ -1620,7 +1726,7 @@ sub replace_config_sub_guess { } verbose "=== PRRTE\n"; -if ("prrte" ~~ @disabled_3rdparty_packages) { +if (list_contains("prrte", @disabled_3rdparty_packages)) { verbose "--- PRRTE disabled\n"; } else { # sanity check prrte files exist @@ -1642,16 +1748,10 @@ sub replace_config_sub_guess { #--------------------------------------------------------------------------- -# Find MPI extensions and contribs -if (!$no_ompi_arg) { - ++$step; - verbose "\n$step. Searching for Open MPI extensions\n\n"; - mpiext_run_global("ompi/mpiext"); - - ++$step; - verbose "\n$step. Searching for Open MPI contribs\n\n"; - mpicontrib_run_global("ompi/contrib"); -} +# Find MPI extensions +++$step; +verbose "\n$step. Searching for Open MPI extensions\n\n"; +mpiext_run_global("ompi/mpiext"); #--------------------------------------------------------------------------- @@ -1694,7 +1794,7 @@ sub replace_config_sub_guess { # Run autoreconf verbose "==> Running autoreconf\n"; chdir(".."); -my $cmd = "autoreconf -ivf --warnings=all,no-obsolete,no-override -I config"; +my $cmd = "autoreconf -ivf --warnings=all,no-obsolete,no-override -I config -I config/oac"; foreach my $project (@{$projects}) { $cmd .= " -I $project->{dir}/config" if (-d "$project->{dir}/config"); diff --git a/config/Makefile.am b/config/Makefile.am index 9d539357a75..4af3a33f87c 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -9,12 +9,13 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2006-2021 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2010 Oracle and/or its affiliates. All rights # reserved. # Copyright (c) 2014-2015 Intel, Inc. All rights reserved. # Copyright (c) 2016 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -22,6 +23,19 @@ # $HEADER$ # +# This is a weird place for this, but config/ is the first directory that +# is entered, and the dist-hook runs at the end of the current directory, +# so this is the earliest we can run this test. +dist-hook: + @if test -n "$(OPAL_MAKEDIST_DISABLE)" ; then \ + echo "#########################################################################"; \ + echo "#"; \ + echo "# make dist is disabled due to the following packages: $(OPAL_MAKEDIST_DISABLE)"; \ + echo "#"; \ + echo "#########################################################################"; \ + exit 1; \ + fi + EXTRA_DIST = \ distscript.sh \ opal_get_version.m4sh \ @@ -30,10 +44,9 @@ EXTRA_DIST = \ opal_mca_priority_sort.pl \ find_common_syms \ getdate.sh \ - make_manpage.pl \ - md2nroff.pl \ from-savannah/upstream-config.guess \ - from-savannah/upstream-config.sub + from-savannah/upstream-config.sub \ + extract-3rd-party-configure.pl maintainer-clean-local: rm -f opal_get_version.sh diff --git a/config/c_get_alignment.m4 b/config/c_get_alignment.m4 index a300cc3d1a3..339018712d1 100644 --- a/config/c_get_alignment.m4 +++ b/config/c_get_alignment.m4 @@ -14,6 +14,7 @@ dnl Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2014-2015 Intel, Inc. All rights reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -21,10 +22,10 @@ dnl dnl $HEADER$ dnl -# OPAL_C_GET_ALIGN(type, config_var) +# OPAL_C_GET_ALIGNMENT(c_type, c_macro_name) # ---------------------------------- # Determine datatype alignment. -# First arg is type, 2nd arg is config var to define. +# First arg is type, 2nd arg is macro name to define. # Now that we require C99 compilers, we include stdbool.h # in the alignment test so that we can find the definition # of "bool" when we test for its alignment. We might be able @@ -33,41 +34,26 @@ dnl # what we use. Yes, they should be the same - but "should" and # "are" frequently differ AC_DEFUN([OPAL_C_GET_ALIGNMENT],[ - AC_CACHE_CHECK([alignment of $1], - [AS_TR_SH([opal_cv_c_align_$1])], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT - #include ], -[[ - struct foo { char c; $1 x; }; - struct foo *p = (struct foo *) malloc(sizeof(struct foo)); - int diff; - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - diff = ((char *)&p->x) - ((char *)&p->c); - free(p); - fprintf(f, "%d\n", (diff >= 0) ? diff : -diff); -]])], [AS_TR_SH([opal_cv_c_align_$1])=`cat conftestval`], - [AC_MSG_WARN([*** Problem running configure test!]) - AC_MSG_WARN([*** See config.log for details.]) - AC_MSG_ERROR([*** Cannot continue.])], - [ # cross compile - do a non-executable test. Trick - # taken from the Autoconf 2.59c. Switch to using - # AC_CHECK_ALIGNOF when we can require Autoconf 2.60. - _AC_COMPUTE_INT([(long int) offsetof (opal__type_alignof_, y)], - [AS_TR_SH([opal_cv_c_align_$1])], - [AC_INCLUDES_DEFAULT -#include + OPAL_VAR_SCOPE_PUSH([opal_align_value]) + AC_LANG_PUSH([C]) -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; $1 y; } opal__type_alignof_; -], - [AC_MSG_WARN([*** Problem running configure test!]) - AC_MSG_WARN([*** See config.log for details.]) - AC_MSG_ERROR([*** Cannot continue.])])])]) + AC_CHECK_ALIGNOF([$1], [AC_INCLUDES_DEFAULT + #include + ]) -AC_DEFINE_UNQUOTED([$2], [$AS_TR_SH([opal_cv_c_align_$1])], [Alignment of type $1]) -eval "$2=$AS_TR_SH([opal_cv_c_align_$1])" + # Put the value determined from AC CHECK_ALIGNOF into an + # easy-to-access shell variable. + AS_VAR_COPY([opal_align_value], + [ac_cv_alignof_]AS_TR_SH([$1])) -rm -rf conftest* ]) dnl + # This $opal_cv_c_align_* shell variable is used elsewhere in + # configure.ac + AS_VAR_COPY([opal_cv_c_align_]AS_TR_SH([$1]), + [opal_align_value]) + + # This #define is used in C code. + AC_DEFINE_UNQUOTED([$2], [$opal_align_value], [Alignment of $1]) + + AC_LANG_POP([C]) + OPAL_VAR_SCOPE_POP +]) diff --git a/config/extract-3rd-party-configure.pl b/config/extract-3rd-party-configure.pl index 15ca89323d0..7afa31d9b4e 100755 --- a/config/extract-3rd-party-configure.pl +++ b/config/extract-3rd-party-configure.pl @@ -1,6 +1,7 @@ #!/usr/bin/env perl # # Copyright (c) 2021 IBM Corporation. All rights reserved. +# Copyright (c) 2021 Cisco Systems. All rights reserved. # # $COPYRIGHT$ # @@ -119,7 +120,7 @@ ($) # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given]) my @conf_keywords = ("AC_ARG_ENABLE", "AC_ARG_WITH"); - # stack with funciton parameters: '(', ')' + # stack with function parameters: '(', ')' my @the_stack = (); # push(@the_stack) / pop(@the_stack) / scalar(@the_stack) my $arg_num = 0; @@ -150,7 +151,7 @@ ($) last; } - # Skip any option that contains a variable substition + # Skip any option that contains a variable substitution if ( $option_name =~ /\$/ ) { if( !$list_only && !$quiet_arg) { print "# Warning: Skipped (embedded variable): $option_name\n"; @@ -216,7 +217,7 @@ ($) # Argument separator # We only care about counting arguments for the outermost # function (e.g., AC_ARG_ENABLE), not the innermost - # function (e.g., AC_HELP_STRING) - which we take all of. + # function (e.g., AS_HELP_STRING) - which we take all of. # We know we are in the outermost because the '(' will be # only thing on the stack. elsif( scalar(@the_stack) == 1 && $char eq "," ) { diff --git a/config/find_common_syms b/config/find_common_syms index 26e603cb49b..84f4293ea4c 100755 --- a/config/find_common_syms +++ b/config/find_common_syms @@ -109,7 +109,7 @@ sub object_find { # that turns out to be the case, we can try switching to "nm -P", which is # supposed to activate the "portable" (yet ugly) format. It's also unclear # at this point how common support for "nm -P" is. - open(NM, '-|', "nm '${obj}' 2>/dev/null | egrep '\\s[cC]\\s'"); + open(NM, '-|', "nm '${obj}' 2>/dev/null | grep -E '\\s[cC]\\s'"); SYMBOL: while (my $sym_line = ) { if (!$all and is_allowlisted($sym_line)) { next SYMBOL; diff --git a/config/ltmain_flang_darwin.diff b/config/ltmain_flang_darwin.diff new file mode 100644 index 00000000000..02dc81d988a --- /dev/null +++ b/config/ltmain_flang_darwin.diff @@ -0,0 +1,39 @@ +--- config/ltmain.sh ++++ config/ltmain.sh +@@ -9024,7 +9024,14 @@ + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else +- compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ++ case $host in ++ *-*-darwin*) ++ case $CC in ++ flang*) compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -Wl,-framework,\1%g'`;; ++ *) compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`;; ++ esac;; ++ *) compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`;; ++ esac + fi + fi + dependency_libs=$newdependency_libs +@@ -9369,7 +9376,7 @@ + # On Darwin other compilers + func_cc_basename $CC + case $func_cc_basename_result in +- nagfor*) ++ flang*|nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) +@@ -9869,7 +9876,10 @@ + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) +- newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ++ case $CC in ++ flang*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -Wl,-framework,\1%g'`;; ++ *) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`;; ++ esac + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; diff --git a/config/ltmain_nag_pthread.diff b/config/ltmain_nag_pthread.diff index 927b671f9ae..c1fbd0582df 100644 --- a/config/ltmain_nag_pthread.diff +++ b/config/ltmain_nag_pthread.diff @@ -1,18 +1,40 @@ --- config/ltmain.sh +++ config/ltmain.sh -@@ -6417,8 +6417,14 @@ - func_source "$lib" - +@@ -7862,6 +7862,13 @@ func_mode_link () # Convert "-framework foo" to "foo.ltframework" -+ # and "-pthread" to "-Wl,-pthread" if NAG compiler if test -n "$inherited_linker_flags"; then -- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` -+ case "$CC" in -+ *nagfor*) -+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g' | $SED 's/-pthread/-Wl,-pthread/g'`;; -+ *) -+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`;; -+ esac + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` ++ ++ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor ++ func_cc_basename $CC ++ case $func_cc_basename_result in ++ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;; ++ esac ++ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; +@@ -8881,7 +8888,8 @@ func_mode_link () + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers +- case $CC in ++ func_cc_basename $CC ++ case $func_cc_basename_result in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; +@@ -9493,6 +9501,13 @@ EOF + ;; + esac + ++ # Time to revert the changes made for nagfor. ++ func_cc_basename $CC ++ case $func_cc_basename_result in ++ nagfor*) ++ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;; ++ esac ++ + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= diff --git a/config/make_manpage.pl b/config/make_manpage.pl deleted file mode 100755 index 28c01887e80..00000000000 --- a/config/make_manpage.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env perl -# -# Copyright (c) 2015 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2020 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Subroutine to generate a bunch of Fortran declarations and symbols -# - -use strict; - -use Getopt::Long; - -my $package_name; -my $package_version; -my $ompi_date; -my $opal_date; -my $fortran = '1'; -my $f08 = '1'; -my $input; -my $output; -my $help_arg = 0; - -&Getopt::Long::Configure("bundling"); -my $ok = Getopt::Long::GetOptions("package-name=s" => \$package_name, - "package-version=s" => \$package_version, - "ompi-date=s" => \$ompi_date, - "opal-date=s" => \$opal_date, - "fortran!" => \$fortran, - "f08!" => \$f08, - "input=s" => \$input, - "output=s" => \$output); - -if ($help_arg || !$ok || - !defined($input) || - !defined($output) || - !defined($package_name) || - !defined($package_version) || - !defined($ompi_date) || - !defined($opal_date)) { - print "Usage: $0 --package-name= --package-version= --ompi-date= --opal-date= --input= --output= [--nocxx] [ --nofortran] [--nof08]\n"; - exit(1 - $ok); -} - -open(FILE, $input) || - die "Can't open $input"; -my $file; -$file .= $_ - while(); -close(FILE); - -$file =~ s/#PACKAGE_NAME#/$package_name/g; -$file =~ s/#PACKAGE_VERSION#/$package_version/g; -$file =~ s/#OMPI_DATE#/$ompi_date/g; -$file =~ s/#OPAL_DATE#/$opal_date/g; - -if ($fortran == 0) { - $file =~ s/\n\.SH Fortran Syntax.+?\n\.SH/\n\.SH/s; -} - -if ($f08 == 0) { - $file =~ s/\n\.SH Fortran 2008 Syntax.+?\n\.SH/\n\.SH/s; -} - -open(FILE, ">$output") || - die "Can't open $output"; -print FILE $file; -close(FILE); - -exit(0); - diff --git a/config/md2nroff.pl b/config/md2nroff.pl deleted file mode 100755 index a8ee21d449a..00000000000 --- a/config/md2nroff.pl +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env perl -# -# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -use strict; - -use IPC::Open3; -use File::Basename; -use Getopt::Long; - -#-------------------------------------------------------------------------- - -my $source_arg; -my $dest_arg; -my $pandoc_arg = "pandoc"; -my $help_arg; -my $verbose_arg; - -my $ok = Getopt::Long::GetOptions("source=s" => \$source_arg, - "dest=s" => \$dest_arg, - "pandoc=s" => \$pandoc_arg, - "help" => \$help_arg, - "verbose" => \$verbose_arg); - -if (!$source_arg || !$dest_arg) { - print("Must specify --source and --dest\n"); - $ok = 0; -} - -if (!$ok || $help_arg) { - print "Invalid command line argument.\n\n" - if (!$ok); - print "Options: - --source FILE Source Markdown filename - --dest FILE Destination nroff file - --pandoc FILE Location of pandoc executable - --help This help list - --verbose Be verbose when running\n"; - exit($ok ? 0 : 1); -} - -#-------------------------------------------------------------------------- - -# Read in the source -die "Error: $source_arg does not exist" - if (! -f $source_arg); - -my $source_content; -open(FILE, $source_arg) || - die "Can't open $source_arg"; -$source_content .= $_ - while(); -close(FILE); - -#-------------------------------------------------------------------------- - -# Figure out the section of man page -die "Cannot figure out man page section from source filename" - if (!($source_arg =~ m/(\d+).md$/)); -my $man_section = $1; - -my $shortfile = basename($source_arg); -$shortfile =~ s/\.$man_section\.md$//; - -#-------------------------------------------------------------------------- - -my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); -my $today = sprintf("%04d-%02d-%02d", ($year+1900), $mon, $mday); - -# Run opal_get_version.sh to get the OMPI version. -my $config_dir = dirname($0); -my $get_version = "$config_dir/opal_get_version.sh"; -my $VERSION_file = "$config_dir/../VERSION"; -my $out = `$get_version $VERSION_file --full`; -chomp($out); - -# Pandoc does not handle markdown links in output nroff properly, so -# just remove all links. Specifically: some versions of Pandoc ignore -# the links, but others handle it badly. -$source_content =~ s/\[(.+)\]\((.+)\)/\1/g; - -# Add the pandoc header -$source_content = "--- -section: $man_section -title: $shortfile -header: Open MPI -footer: $today ---- - -$source_content"; - -#-------------------------------------------------------------------------- - -print("*** Processing: $source_arg --> $dest_arg\n") - if ($verbose_arg); - -my $pid = open3(my $child_stdin, my $child_stdout, my $child_stderr, - "$pandoc_arg -s --from=markdown --to=man"); -print $child_stdin $source_content; -close($child_stdin); -my $pandoc_rendered; -$pandoc_rendered .= $_ - while(<$child_stdout>); -close($child_stdout); -close($child_stderr) - if ($child_stderr); -waitpid($pid, 0); - -print("Writing new file $dest_arg\n") - if ($verbose_arg); - -# Make the target directory if it does not exist (needed for VPATH -# builds) -my $dest_dir = dirname($dest_arg); -mkdir($dest_dir) - if (! -d $dest_dir); - -# Write the output file -open(FILE, ">$dest_arg") || - die "Can't open $dest_arg for writing"; -print FILE $pandoc_rendered; -close(FILE); - -exit(0); diff --git a/config/oac b/config/oac new file mode 160000 index 00000000000..dfff67569fb --- /dev/null +++ b/config/oac @@ -0,0 +1 @@ +Subproject commit dfff67569fb72dbf8d73a1dcf74d091dad93f71b diff --git a/config/ompi_check_gpfs.m4 b/config/ompi_check_gpfs.m4 index 5f3b10e0e06..3ab33b36f16 100644 --- a/config/ompi_check_gpfs.m4 +++ b/config/ompi_check_gpfs.m4 @@ -24,46 +24,29 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_GPFS],[ - - check_gpfs_CPPFLAGS= - check_gpfs_LDFLAGS= - check_gpfs_LIBS= - - check_gpfs_save_LIBS="$LIBS" - check_gpfs_save_LDFLAGS="$LDFLAGS" - check_gpfs_save_CPPFLAGS="$CPPFLAGS" - - check_gpfs_configuration="none" - ompi_check_gpfs_happy="yes" + OPAL_VAR_SCOPE_PUSH([ompi_check_gpfs_happy]) # Get some configuration information AC_ARG_WITH([gpfs], [AS_HELP_STRING([--with-gpfs(=DIR)], [Build Gpfs support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([gpfs], [$with_gpfs], [include/gpfs.h]) - AS_IF([test "$with_gpfs" = "no"], - [ompi_check_gpfs_happy="no"], - [AS_IF([test -z "$with_gpfs" || test "$with_gpfs" = "yes"], - [ompi_check_gpfs_dir="/usr"], - [ompi_check_gpfs_dir=$with_gpfs]) - - if test -e "$ompi_check_gpfs_dir/lib64" ; then - ompi_check_gpfs_libdir="$ompi_check_gpfs_dir/lib64" - else - ompi_check_gpfs_libdir="$ompi_check_gpfs_dir/lib" - fi - - # Add correct -I and -L flags - OPAL_CHECK_PACKAGE([$1], [gpfs.h], [gpfs], [gpfs_lib_init], - [], [$ompi_check_gpfs_dir], [$ompi_check_gpfs_libdir], - [ompi_check_gpfs_happy="yes"], - [ompi_check_gpfs_happy="no"]) - ]) + # Add correct -I and -L flags + OAC_CHECK_PACKAGE([gpfs], + [$1], + [gpfs.h], + [gpfs], + [gpfs_lib_init], + [ompi_check_gpfs_happy="yes"], + [ompi_check_gpfs_happy="no"]) + + OPAL_SUMMARY_ADD([OMPIO File Systems], [IBM Spectrum Scale/GPFS], [], [${$1_SUMMARY}]) AS_IF([test "$ompi_check_gpfs_happy" = "yes"], [$2], [AS_IF([test ! -z "$with_gpfs" && test "$with_gpfs" != "no"], [AC_MSG_ERROR([GPFS support requested but not found. Aborting])]) $3]) + + OPAL_VAR_SCOPE_POP ]) diff --git a/config/ompi_check_ime.m4 b/config/ompi_check_ime.m4 index 870bba8a143..8af8899c411 100644 --- a/config/ompi_check_ime.m4 +++ b/config/ompi_check_ime.m4 @@ -1,6 +1,8 @@ dnl -*- shell-script -*- dnl dnl Copyright (c) 2018 DataDirect Networks. All rights reserved. +dnl Copyright (c) 2021 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -14,49 +16,27 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_IME],[ - - check_ime_CPPFLAGS= - check_ime_LDFLAGS= - check_ime_LIBS= - - check_ime_configuration="none" - ompi_check_ime_happy="yes" - + OPAL_VAR_SCOPE_PUSH([ompi_check_ime_happy]) # Get some configuration information AC_ARG_WITH([ime], [AS_HELP_STRING([--with-ime(=DIR)], [Build IME support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([ime], [$with_ime], [include/ime_native.h]) - AS_IF([test "$with_ime" = "no"], - [ompi_check_ime_happy="no"], - [AS_IF([test -z "$with_ime"], - [ompi_check_ime_dir="/usr/local"], - [ompi_check_ime_dir=$with_ime]) - - if test -e "$ompi_check_ime_dir/lib64" ; then - ompi_check_ime_libdir="$ompi_check_ime_dir/lib64" - else - ompi_check_ime_libdir="$ompi_check_ime_dir/lib" - fi - - # Add correct -I and -L flags - OPAL_CHECK_PACKAGE([$1], [ime_native.h], [im_client], [ime_client_native2_init], [], - [$ompi_check_ime_dir], [$ompi_check_ime_libdir], - [ompi_check_ime_happy="yes"], - [OPAL_CHECK_PACKAGE([$1], [ime_native.h], [im_client], [ime_native_init], [], - [$ompi_check_ime_dir], [$ompi_check_ime_libdir], - [ompi_check_ime_happy="yes"], - [ompi_check_ime_happy="no"]) - ]) - ]) + OAC_CHECK_PACKAGE([ime], + [$1], + [ime_native.h], + [im_client], + [ime_client_native2_init], + [ompi_check_ime_happy="yes"], + [ompi_check_ime_happy="no"]) AS_IF([test "$ompi_check_ime_happy" = "yes"], - [$2], - [AS_IF([test ! -z "$with_ime" && test "$with_ime" != "no"], - [echo IME support not found]) - $3]) - - ]) + [$2], + [AS_IF([test ! -z "$with_ime" && test "$with_ime" != "no"], + [AC_MSG_ERROR([IME support requested but not found. Aborting])]) + $3]) + + OPAL_VAR_SCOPE_POP +]) diff --git a/config/ompi_check_libhcoll.m4 b/config/ompi_check_libhcoll.m4 index 44774ab68cf..2151148ab14 100644 --- a/config/ompi_check_libhcoll.m4 +++ b/config/ompi_check_libhcoll.m4 @@ -17,49 +17,35 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_HCOLL],[ - OPAL_VAR_SCOPE_PUSH([ompi_check_hcoll_dir ompi_check_hcoll_libs ompi_check_hcoll_happy CPPFLAGS_save LDFLAGS_save LIBS_save]) + OPAL_VAR_SCOPE_PUSH([ompi_check_hcoll_happy CPPFLAGS_save LDFLAGS_save LIBS_save]) AC_ARG_WITH([hcoll], [AS_HELP_STRING([--with-hcoll(=DIR)], [Build hcoll (Mellanox Hierarchical Collectives) support, optionally adding DIR/include and DIR/lib or DIR/lib64 to the search path for headers and libraries])]) - AS_IF([test "$with_hcoll" != "no"], - [ompi_check_hcoll_libs=hcoll - AS_IF([test ! -z "$with_hcoll" && test "$with_hcoll" != "yes"], - [ompi_check_hcoll_dir=$with_hcoll]) + OAC_CHECK_PACKAGE([hcoll], + [$1], + [hcoll/api/hcoll_api.h], + [hcoll], + [hcoll_get_version], + [ompi_check_hcoll_happy="yes"], + [ompi_check_hcoll_happy="no"]) - CPPFLAGS_save=$CPPFLAGS + AS_IF([test "$ompi_check_hcoll_happy" = "yes"], + [CPPFLAGS_save=$CPPFLAGS LDFLAGS_save=$LDFLAGS LIBS_save=$LIBS - OPAL_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1) - OPAL_LOG_MSG([$1_LDFLAGS : $$1_LDFLAGS], 1) - OPAL_LOG_MSG([$1_LIBS : $$1_LIBS], 1) - - OPAL_CHECK_PACKAGE([$1], - [hcoll/api/hcoll_api.h], - [$ompi_check_hcoll_libs], - [hcoll_get_version], - [], - [$ompi_check_hcoll_dir], - [], - [ompi_check_hcoll_happy="yes"], - [ompi_check_hcoll_happy="no"]) + CPPFLAGS="${$1_CPPFLAGS} ${CPPFLAGS}" + LDFLAGS="${$1_LDFLAGS} ${LDFLAGS}" + LIBS="${$1_LIBS} ${LIBS}" - AS_IF([test "$ompi_check_hcoll_happy" = "yes"], - [ - CPPFLAGS=$coll_hcoll_CPPFLAGS - LDFLAGS=$coll_hcoll_LDFLAGS - LIBS=$coll_hcoll_LIBS - AC_CHECK_FUNCS(hcoll_context_free, [], []) - ], - []) + AC_CHECK_FUNCS(hcoll_context_free, [], []) CPPFLAGS=$CPPFLAGS_save LDFLAGS=$LDFLAGS_save - LIBS=$LIBS_save], - [ompi_check_hcoll_happy=no]) + LIBS=$LIBS_save]) AS_IF([test "$ompi_check_hcoll_happy" = "yes" && test "$enable_progress_threads" = "yes"], [AC_MSG_WARN([hcoll driver does not currently support progress threads. Disabling HCOLL.]) diff --git a/config/ompi_check_lustre.m4 b/config/ompi_check_lustre.m4 index 7421ba01c67..4401ad050cb 100644 --- a/config/ompi_check_lustre.m4 +++ b/config/ompi_check_lustre.m4 @@ -12,7 +12,7 @@ dnl Copyright (c) 2004-2006 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved dnl Copyright (c) 2008-2018 University of Houston. All rights reserved. -dnl Copyright (c) 2015-2018 Research Organization for Information Science +dnl Copyright (c) 2015-2021 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2020 Triad National Security, LLC. All rights dnl reserved. @@ -29,46 +29,26 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_LUSTRE],[ - - check_lustre_CPPFLAGS= - check_lustre_LDFLAGS= - check_lustre_LIBS= - - check_lustre_save_LIBS="$LIBS" - check_lustre_save_LDFLAGS="$LDFLAGS" - check_lustre_save_CPPFLAGS="$CPPFLAGS" - - ompi_check_lustre_happy="yes" + OPAL_VAR_SCOPE_PUSH([ompi_check_lustre_happy]) # Get some configuration information AC_ARG_WITH([lustre], [AS_HELP_STRING([--with-lustre(=DIR)], [Build Lustre support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([lustre], [$with_lustre], [include/lustre/lustreapi.h]) - AS_IF([test "$with_lustre" = "no"], - [ompi_check_lustre_happy=no]) + OAC_CHECK_PACKAGE([lustre], + [$1], + [lustre/lustreapi.h], + [lustreapi], + [llapi_file_create], + [ompi_check_lustre_happy="yes"], + [ompi_check_lustre_happy="no"]) - AS_IF([test "$ompi_check_lustre_happy" != "no" ], - [AC_MSG_CHECKING([looking for lustre libraries and header files in]) - AS_IF([test "$with_lustre" != "yes"], - [ompi_check_lustre_dir=$with_lustre - AC_MSG_RESULT([($ompi_check_lustre_dir)])], - [AC_MSG_RESULT([(default search paths)])]) - AS_IF([test -n "$with_lustre_libdir" && \ - test "$with_lustre_libdir" != "yes"], - [ompi_check_lustre_libdir=$with_lustre_libdir]) - ]) - - AS_IF([test "$ompi_check_lustre_happy" != "no" ], - [OPAL_CHECK_PACKAGE([$1], [lustre/lustreapi.h], [lustreapi], [llapi_file_create], - [], [$ompi_check_lustre_dir], [$ompi_check_lustre_libdir], - [ompi_check_lustre_happy="yes"], - [ompi_check_lustre_happy="no"])]) - AS_IF([test "$ompi_check_lustre_happy" = "yes"], - [AC_MSG_CHECKING([for required lustre data structures]) - cat > conftest.c < conftest.c <]], - [[is_plfs_path(NULL);]])], - [AC_MSG_RESULT([yes]) - ompi_check_plfs_happy="yes"], - [AC_MSG_RESULT([no]) - ompi_check_plfs_happy="no"])], - [ompi_check_plfs_happy="no"]) - ]) - - - LDFLAGS="$check_plfs_save_LDFLAGS" - CPPFLAGS="$check_plfs_save_CPPFLAGS" - LIBS="$check_plfs_save_LIBS" - AS_IF([test "$ompi_check_plfs_happy" = "yes"], - [$2], - [AS_IF([test ! -z "$with_plfs" && test "$with_plfs" != "no"], - [echo PLFS support not found]) - $3]) - - with_plfs="$temp_with_plfs" - with_plfs_libs="$temp_with_plfs_libs" - -]) - diff --git a/config/ompi_check_psm2.m4 b/config/ompi_check_psm2.m4 index 00ccffd98fa..2f5322d2b9e 100644 --- a/config/ompi_check_psm2.m4 +++ b/config/ompi_check_psm2.m4 @@ -11,12 +11,15 @@ # Copyright (c) 2004-2006 The Regents of the University of California. # All rights reserved. # Copyright (c) 2006 QLogic Corp. All rights reserved. -# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2021 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2016 Intel Corporation. All rights reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 Los Alamos National Security, LLC. All rights # reserved. +# Copyright (c) 2021 Triad National Security, LLC. All rights +# reserved. +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -30,68 +33,58 @@ # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_PSM2],[ - if test -z "$ompi_check_psm2_happy" ; then - AC_ARG_WITH([psm2], - [AS_HELP_STRING([--with-psm2(=DIR)], - [Build PSM2 (Intel PSM2) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([psm2], [$with_psm2], [include/psm2.h]) - AC_ARG_WITH([psm2-libdir], - [AS_HELP_STRING([--with-psm2-libdir=DIR], - [Search for PSM (Intel PSM2) libraries in DIR])]) - OPAL_CHECK_WITHDIR([psm2-libdir], [$with_psm2_libdir], [libpsm2.*]) + OPAL_VAR_SCOPE_PUSH([opal_psm2_CPPFLAGS_save opal_psm2_LDFLAGS_save opal_psm2_LIBS_save]) - ompi_check_psm2_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_psm2_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_psm2_$1_save_LIBS="$LIBS" + AC_ARG_WITH([psm2], + [AS_HELP_STRING([--with-psm2(=DIR)], + [Build PSM2 (Intel PSM2) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + AC_ARG_WITH([psm2-libdir], + [AS_HELP_STRING([--with-psm2-libdir=DIR], + [Search for PSM (Intel PSM2) libraries in DIR])]) - AS_IF([test "$with_psm2" != "no"], - [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "yes"], - [ompi_check_psm2_dir="$with_psm2"]) - AS_IF([test ! -z "$with_psm2_libdir" && test "$with_psm2_libdir" != "yes"], - [ompi_check_psm2_libdir="$with_psm2_libdir"]) + AC_ARG_ENABLE([psm2-version-check], + [AS_HELP_STRING([--disable-psm2-version-check], + [Disable PSM2 version checking. Not recommended to disable. (default: enabled)])]) - OPAL_CHECK_PACKAGE([ompi_check_psm2], - [psm2.h], - [psm2], - [psm2_mq_irecv2], - [], - [$ompi_check_psm2_dir], - [$ompi_check_psm2_libdir], - [ompi_check_psm2_happy="yes"], - [ompi_check_psm2_happy="no"])], - [ompi_check_psm2_happy="no"]) + OAC_CHECK_PACKAGE([psm2], + [$1], + [psm2.h], + [psm2], + [psm2_mq_irecv2], + [ompi_check_psm2_happy="yes"], + [ompi_check_psm2_happy="no"]) - CPPFLAGS="$ompi_check_psm2_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_psm2_$1_save_LDFLAGS" - LIBS="$ompi_check_psm2_$1_save_LIBS" + AS_IF([test "$ompi_check_psm2_happy" = "yes" && test "$enable_progress_threads" = "yes"], + [AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.]) + $1_SUMMARY="no (progress threads not supported)" + ompi_check_psm2_happy="no"]) - AS_IF([test "$ompi_check_psm2_happy" = "yes" && test "$enable_progress_threads" = "yes"], - [AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.]) - ompi_check_psm2_happy="no"]) + opal_psm2_CPPFLAGS_save="$CPPFLAGS" + CPPFLAGS="${$1_CPPFLAGS} ${CPPFLAGS}" - AS_IF([test "$ompi_check_psm2_happy" = "yes"], - [AC_CHECK_HEADERS( - glob.h, - [], + AS_IF([test "$ompi_check_psm2_happy" = "yes"], + [AC_CHECK_HEADERS([glob.h], [], [AC_MSG_WARN([glob.h not found. Can not build component.]) - ompi_check_psm2_happy="no"])]) + $1_SUMMARY="no (glob.h not found))" + ompi_check_psm2_happy="no"])]) + + AS_IF([test "$ompi_check_psm2_happy" = "yes"], + [AC_CHECK_DECL([PSM2_LIB_REFCOUNT_CAP], + [AC_DEFINE([HAVE_PSM2_LIB_REFCOUNT_CAP], [1], + [have PSM2_LIB_REFCOUNT_CAP in psm2.h])], + [AS_IF([test "x$enable_psm2_version_check" != "xno"], + [ompi_check_psm2_happy="no" + $1_SUMMARY="no (version too old)" + AC_MSG_WARN([PSM2 needs to be version 11.2.173 or later. Disabling MTL.])] + )], + [#include ])]) - AS_IF([test "$ompi_check_psm2_happy" = "yes"], - [AC_CHECK_DECL([PSM2_LIB_REFCOUNT_CAP], - [], - [AC_MSG_WARN([PSM2 needs to be version 11.2.173 or later. Disabling MTL.]) - ompi_check_psm2_happy="no"], - [#include ]) - ]) + CPPFLAGS="${opal_psm2_CPPFLAGS_save}" - OPAL_SUMMARY_ADD([[Transports]],[[Intel Omnipath (PSM2)]],[$1],[$ompi_check_psm2_happy]) - fi + OPAL_SUMMARY_ADD([Transports], [Intel Omnipath (PSM2)], [], [${$1_SUMMARY}]) AS_IF([test "$ompi_check_psm2_happy" = "yes"], - [$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_psm2_LDFLAGS" - $1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_psm2_CPPFLAGS" - $1_LIBS="[$]$1_LIBS $ompi_check_psm2_LIBS" - $2], + [$2], [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "no"], [AC_MSG_ERROR([PSM2 support requested but not found. Aborting])]) $3]) diff --git a/config/ompi_check_pvfs2.m4 b/config/ompi_check_pvfs2.m4 deleted file mode 100644 index 149d973f2be..00000000000 --- a/config/ompi_check_pvfs2.m4 +++ /dev/null @@ -1,71 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2006 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2008-2018 University of Houston. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# OMPI_CHECK_PVFS2(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -# check if PVFS2 support can be found. sets prefix_{CPPFLAGS, -# LDFLAGS, LIBS} as needed and runs action-if-found if there is -# support, otherwise executes action-if-not-found -AC_DEFUN([OMPI_CHECK_PVFS2],[ - - check_pvfs2_CPPFLAGS= - check_pvfs2_LDFLAGS= - check_pvfs2_LIBS= - - check_pvfs2_configuration="none" - ompi_check_pvfs2_happy="yes" - - - # Get some configuration information - AC_ARG_WITH([pvfs2], - [AS_HELP_STRING([--with-pvfs2(=DIR)], - [Build Pvfs2 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([pvfs2], [$with_pvfs2], [include/pvfs2.h]) - - AS_IF([test "$with_pvfs2" = "no"], - [ompi_check_pvfs2_happy="no"], - [AS_IF([test -z "$with_pvfs2"], - [ompi_check_pvfs2_dir="/usr/local"], - [ompi_check_pvfs2_dir=$with_pvfs2]) - - if test -e "$ompi_check_pvfs2_dir/lib64" ; then - ompi_check_pvfs2_libdir="$ompi_check_pvfs2_dir/lib64" - else - ompi_check_pvfs2_libdir="$ompi_check_pvfs2_dir/lib" - fi - - # Add correct -I and -L flags - OPAL_CHECK_PACKAGE([$1], [pvfs2.h], [pvfs2], [PVFS_util_resolve], [], - [$ompi_check_pvfs2_dir], [$ompi_check_pvfs2_libdir], - [ompi_check_pvfs2_happy="yes"], - [ompi_check_pvfs2_happy="no"]) - ]) - - AS_IF([test "$ompi_check_pvfs2_happy" = "yes"], - [$2], - [AS_IF([test ! -z "$with_pvfs2" && test "$with_pvfs2" != "no"], - [echo PVFS2 support not found]) - $3]) - - ]) - diff --git a/config/ompi_check_ucc.m4 b/config/ompi_check_ucc.m4 new file mode 100644 index 00000000000..4fb05f658d2 --- /dev/null +++ b/config/ompi_check_ucc.m4 @@ -0,0 +1,68 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2021 Mellanox Technologies. All rights reserved. +dnl Copyright (c) 2013-2021 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2015 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# OMPI_CHECK_UCC(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +# check if ucc support can be found. sets prefix_{CPPFLAGS, +# LDFLAGS, LIBS} as needed and runs action-if-found if there is +# support, otherwise executes action-if-not-found +AC_DEFUN([OMPI_CHECK_UCC],[ + OPAL_VAR_SCOPE_PUSH([ompi_check_ucc_happy CPPFLAGS_save LDFLAGS_save LIBS_save]) + + AC_ARG_WITH([ucc], + [AS_HELP_STRING([--with-ucc(=DIR)], + [Build UCC (Unified Collective Communication)])]) + + OAC_CHECK_PACKAGE([ucc], + [$1], + [ucc/api/ucc.h], + [ucc], + [ucc_init_version], + [ompi_check_ucc_happy="yes"], + [ompi_check_ucc_happy="no"]) + + AS_IF([test "$ompi_check_ucc_happy" = "yes"], + [CPPFLAGS_save=$CPPFLAGS + LDFLAGS_save=$LDFLAGS + LIBS_save=$LIBS + + CPPFLAGS="${$1_CPPFLAGS} ${CPPFLAGS}" + LDFLAGS="${$1_LDFLAGS} ${LDFLAGS}" + LIBS="${$1_LIBS} ${LIBS}" + AC_CHECK_FUNCS(ucc_comm_free, [], []) + + AC_MSG_CHECKING([if UCC supports float128 and float32(64,128)_complex datatypes]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ucc_datatype_t dt = UCC_DT_FLOAT32_COMPLEX;]])], + [flag=1 + AC_MSG_RESULT([yes])], + [flag=0 + AC_MSG_RESULT([no])]) + AC_DEFINE_UNQUOTED(UCC_HAVE_COMPLEX_AND_FLOAT128_DT, $flag, [Check if float128 and float32(64,128)_complex dt are available in ucc.]) + + CPPFLAGS=$CPPFLAGS_save + LDFLAGS=$LDFLAGS_save + LIBS=$LIBS_save]) + + AS_IF([test "$ompi_check_ucc_happy" = "yes" && test "$enable_progress_threads" = "yes"], + [AC_MSG_WARN([ucc driver does not currently support progress threads. Disabling UCC.]) + ompi_check_ucc_happy="no"]) + + AS_IF([test "$ompi_check_ucc_happy" = "yes"], + [$2], + [AS_IF([test ! -z "$with_ucc" && test "$with_ucc" != "no"], + [AC_MSG_ERROR([UCC support requested but not found. Aborting])]) + $3]) + + OPAL_VAR_SCOPE_POP +]) diff --git a/config/ompi_check_ucx.m4 b/config/ompi_check_ucx.m4 index 151bf8cf58c..d473454a8ce 100644 --- a/config/ompi_check_ucx.m4 +++ b/config/ompi_check_ucx.m4 @@ -7,6 +7,7 @@ # Copyright (c) 2016 Los Alamos National Security, LLC. All rights # reserved. # Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -20,151 +21,117 @@ # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_UCX],[ - OPAL_VAR_SCOPE_PUSH([ompi_check_ucx_dir]) + OPAL_VAR_SCOPE_PUSH([ompi_check_ucx_happy ompi_check_ucx_CPPFLAGS_save ompi_check_ucx_LDFLAGS_save ompi_check_ucx_LIBS_save]) - AS_IF([test -z "$ompi_check_ucx_happy"], - [AC_ARG_WITH([ucx], - [AS_HELP_STRING([--with-ucx(=DIR)], - [Build with Unified Communication X library support])]) - OPAL_CHECK_WITHDIR([ucx], [$with_ucx], [include/ucp/api/ucp.h]) - AC_ARG_WITH([ucx-libdir], - [AS_HELP_STRING([--with-ucx-libdir=DIR], - [Search for Unified Communication X libraries in DIR])]) - OPAL_CHECK_WITHDIR([ucx-libdir], [$with_ucx_libdir], [libucp.*]) + m4_ifblank([$1], [m4_fatal([First argument to OMPI_CHECK_UCX cannot be blank])]) - AS_IF([test "$with_ucx" != "no"], - [AS_IF([test -n "$with_ucx" && test "$with_ucx" != "yes"], - [ompi_check_ucx_dir="$with_ucx"], - [PKG_CHECK_MODULES_STATIC([ucx],[ucx], - [ompi_check_ucx_dir=`$PKG_CONFIG --variable=prefix ucx` - AS_IF([test "$ompi_check_ucx_dir" = "/usr"], - [ompi_check_ucx_dir=])], - [true])]) - ompi_check_ucx_happy="no" - AS_IF([test -z "$ompi_check_ucx_dir"], - [OPAL_CHECK_PACKAGE([ompi_check_ucx], - [ucp/api/ucp.h], - [ucp], - [ucp_cleanup], - [-luct -lucm -lucs], - [], - [], - [ompi_check_ucx_happy="yes"], - [ompi_check_ucx_happy="no"]) - AS_IF([test "$ompi_check_ucx_happy" = yes], - [AC_MSG_CHECKING(for UCX version compatibility) - AC_REQUIRE_CPP - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]],[[]])], - [ompi_check_ucx_happy="yes"], - [ompi_check_ucx_happy="no"]) + AC_ARG_WITH([ucx], + [AS_HELP_STRING([--with-ucx(=DIR)], + [Build with Unified Communication X library support])]) + AC_ARG_WITH([ucx-libdir], + [AS_HELP_STRING([--with-ucx-libdir=DIR], + [Search for Unified Communication X libraries in DIR])]) - AC_MSG_RESULT([$ompi_check_ucx_happy])]) - AS_IF([test "$ompi_check_ucx_happy" = "no"], - [ompi_check_ucx_dir=/opt/ucx])]) - AS_IF([test "$ompi_check_ucx_happy" != yes], - [AS_IF([test -n "$with_ucx_libdir"], - [ompi_check_ucx_libdir="$with_ucx_libdir"], - [files=`ls $ompi_check_ucx_dir/lib64/libucp.* 2> /dev/null | wc -l` - AS_IF([test "$files" -gt 0], - [ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib64], - [ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib])]) + OAC_CHECK_PACKAGE([ucx], + [$1], + [ucp/api/ucp.h], + [ucp -luct -lucm -lucs], + [ucp_cleanup], + [ompi_check_ucx_happy="yes"], + [ompi_check_ucx_happy="no"]) - ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_ucx_$1_save_LIBS="$LIBS" + ompi_check_ucx_CPPFLAGS_save=${CPPFLAGS} + ompi_check_ucx_LDFLAGS_save=${LDFLAGS} + ompi_check_ucx_LIBS_save=${LIBS} - OPAL_CHECK_PACKAGE([ompi_check_ucx], - [ucp/api/ucp.h], - [ucp], - [ucp_cleanup], - [-luct -lucm -lucs], - [$ompi_check_ucx_dir], - [$ompi_check_ucx_libdir], - [ompi_check_ucx_happy="yes"], - [ompi_check_ucx_happy="no"]) + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${$1_CPPFLAGS}]) + OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [${$1_LDFLAGS}]) + OPAL_FLAGS_APPEND_MOVE([LIBS], [${$1_LIBS}]) - CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS" - LIBS="$ompi_check_ucx_$1_save_LIBS" + AS_IF([test "$ompi_check_ucx_happy" = yes], + [AC_CACHE_CHECK([for UCX version header], + [ompi_check_ucx_cv_have_version_header], + [AC_REQUIRE_CPP + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]],[[]])], + [ompi_check_ucx_cv_have_version_header="yes"], + [ompi_check_ucx_cv_have_version_header="no"])]) + AS_IF([test "${ompi_check_ucx_cv_have_version_header}" != "yes"], + [ompi_check_ucx_happy=no])]) - AS_IF([test "$ompi_check_ucx_happy" = yes], - [AC_MSG_CHECKING(for UCX version compatibility) - AC_REQUIRE_CPP - old_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]],[[]])], - [ompi_check_ucx_happy="yes"], - [ompi_check_ucx_happy="no"]) + AS_IF([test "$ompi_check_ucx_happy" = yes], + [# Turn off UCX version v1.8 due to issue #8321 + AC_CACHE_CHECK([UCX version > 1.9.x], + [ompi_check_ucx_cv_have_version_gt_1_9], + [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ +#include + ]], [[ +#if (UCP_API_MAJOR < 1) || ((UCP_API_MAJOR == 1) && (UCP_API_MINOR < 9)) +#error "Version too low" +#endif + ]])], + [ompi_check_ucx_cv_have_version_gt_1_9=yes], + [ompi_check_ucx_cv_have_version_gt_1_9=no + ompi_check_ucx_happy=no])])]) - AC_MSG_RESULT([$ompi_check_ucx_happy]) - CPPFLAGS=$old_CPPFLAGS])]) + AS_IF([test "$ompi_check_ucx_happy" = yes], + [AC_CHECK_DECLS([ucp_tag_send_nbr], + [AC_DEFINE([HAVE_UCP_TAG_SEND_NBR],[1], + [have ucp_tag_send_nbr()])], [], + [#include ]) + AC_CHECK_DECLS([ucp_ep_flush_nb, ucp_worker_flush_nb, + ucp_request_check_status, ucp_put_nb, ucp_get_nb, + ucp_put_nbx, ucp_get_nbx, ucp_atomic_op_nbx, + ucp_ep_flush_nbx], + [], [], + [#include ]) + AC_CHECK_DECLS([ucm_test_events, + ucm_test_external_events], + [], [], + [#include ]) + AC_CHECK_DECLS([UCP_ATOMIC_POST_OP_AND, + UCP_ATOMIC_POST_OP_OR, + UCP_ATOMIC_POST_OP_XOR, + UCP_ATOMIC_FETCH_OP_FAND, + UCP_ATOMIC_FETCH_OP_FOR, + UCP_ATOMIC_FETCH_OP_FXOR, + UCP_PARAM_FIELD_ESTIMATED_NUM_PPN, + UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK, + UCP_OP_ATTR_FLAG_MULTI_SEND, + UCS_MEMORY_TYPE_RDMA, + UCP_MEM_MAP_SYMMETRIC_RKEY], + [], [], + [#include ]) + AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS], + [AC_DEFINE([HAVE_UCP_WORKER_ADDRESS_FLAGS], [1], + [have worker address attribute])], [], + [#include ]) + AC_CHECK_DECLS([UCP_ATTR_FIELD_MEMORY_TYPES], + [AC_DEFINE([HAVE_UCP_ATTR_MEMORY_TYPES], [1], + [have memory types attribute])], [], + [#include ]) + AC_CHECK_DECLS([UCP_EP_ATTR_FIELD_TRANSPORTS], + [], [], + [#include ]) + AC_CHECK_DECLS([ucp_tag_send_nbx, + ucp_tag_send_sync_nbx, + ucp_tag_recv_nbx, + ucp_rkey_compare], + [], [], + [#include ]) + AC_CHECK_TYPES([ucp_request_param_t], + [], [], + [[#include ]]) + ]) - old_CPPFLAGS="$CPPFLAGS" - AS_IF([test -n "$ompi_check_ucx_dir"], - [CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"]) - # Turn off UCX version v1.8 due to issue #8321 - AC_MSG_CHECKING([UCX version]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#include - #if (UCP_API_MAJOR == 1) && (UCP_API_MINOR == 8) - #error "Invalid version" - #endif], [])], - [AC_MSG_RESULT([ok (not 1.8.x)])], - [AC_MSG_RESULT([bad (1.8.x)]) - AC_MSG_WARN([UCX support skipped because version 1.8.x was found, which has a known catastrophic issue.]) - AC_MSG_WARN([Please upgrade to UCX version 1.9 or higher.]) - ompi_check_ucx_happy=no]) - AS_IF([test "$ompi_check_ucx_happy" = yes], - [ - AC_CHECK_DECLS([ucp_tag_send_nbr], - [AC_DEFINE([HAVE_UCP_TAG_SEND_NBR],[1], - [have ucp_tag_send_nbr()])], [], - [#include ]) - AC_CHECK_DECLS([ucp_ep_flush_nb, ucp_worker_flush_nb, - ucp_request_check_status, ucp_put_nb, ucp_get_nb, - ucp_put_nbx, ucp_get_nbx, ucp_atomic_op_nbx], - [], [], - [#include ]) - AC_CHECK_DECLS([ucm_test_events, - ucm_test_external_events], - [], [], - [#include ]) - AC_CHECK_DECLS([UCP_ATOMIC_POST_OP_AND, - UCP_ATOMIC_POST_OP_OR, - UCP_ATOMIC_POST_OP_XOR, - UCP_ATOMIC_FETCH_OP_FAND, - UCP_ATOMIC_FETCH_OP_FOR, - UCP_ATOMIC_FETCH_OP_FXOR, - UCP_PARAM_FIELD_ESTIMATED_NUM_PPN], - [], [], - [#include ]) - AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS], - [AC_DEFINE([HAVE_UCP_WORKER_ADDRESS_FLAGS], [1], - [have worker address attribute])], [], - [#include ]) - AC_CHECK_DECLS([UCP_ATTR_FIELD_MEMORY_TYPES], - [AC_DEFINE([HAVE_UCP_ATTR_MEMORY_TYPES], [1], - [have memory types attribute])], [], - [#include ]) - AC_CHECK_DECLS([ucp_tag_send_nbx, - ucp_tag_send_sync_nbx, - ucp_tag_recv_nbx], - [], [], - [#include ]) - AC_CHECK_TYPES([ucp_request_param_t], - [], [], - [[#include ]]) - ]) - CPPFLAGS=$old_CPPFLAGS + CPPFLAGS=${ompi_check_ucx_CPPFLAGS_save} + LDFLAGS=${ompi_check_ucx_LDFLAGS_save} + LIBS=${ompi_check_ucx_LIBS_save} - OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])])]) + OPAL_SUMMARY_ADD([Transports], [Open UCX], [], [$ompi_check_ucx_happy]) AS_IF([test "$ompi_check_ucx_happy" = "yes"], - [$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS" - $1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS" - $1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS" - $2], + [$2], [AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "no"], [AC_MSG_ERROR([UCX support requested but not found. Aborting])]) $3]) diff --git a/config/ompi_check_udapl.m4 b/config/ompi_check_udapl.m4 deleted file mode 100644 index 114ec124c54..00000000000 --- a/config/ompi_check_udapl.m4 +++ /dev/null @@ -1,120 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# OMPI_CHECK_UDAPL(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -# check if uDAPL support can be found. sets prefix_{CPPFLAGS, -# LDFLAGS, LIBS} as needed and runs action-if-found if there is -# support, otherwise executes action-if-not-found -AC_DEFUN([OMPI_CHECK_UDAPL],[ - AC_ARG_WITH([udapl], - [AS_HELP_STRING([--with-udapl(=DIR)], - [Build uDAPL support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([udapl], [$with_udapl], [include/dat/udat.h]) - AC_ARG_WITH([udapl-libdir], - [AS_HELP_STRING([--with-udapl-libdir=DIR], - [Search for uDAPL libraries in DIR])]) - OPAL_CHECK_WITHDIR([udapl-libdir], [$with_udapl_libdir], [libdat.*]) - - # Special case for OFED/Linux: the default /etc/dat.conf that - # ships with OFED is broken in that it includes DAT providers that - # are not guarnateed to work (e.g., it includes providers for ib0, - # ib1, ib2, ib3, and bond0). Usually, a sysadmin will need to - # edit this file to configure it for the specific environment in - # which it will be used. Hence, if you run the udapl BTL on - # Linux/OFED, you'll get a bunch of warning messages about the - # providers that don't work. However, on Linux/OFED, you don't - # really want to use udapl anyway; you likely really want to use - # the openib BTL (i.e., native verbs, not udapl). - - # So after exploring many different scenarios, the least evil - # solution seemed to be to disable building the udapl BTL on - # Linux/OFED *unless the user specifically asks for it.* To be - # specific: on Linux/OFED, if you do not specify - # --with-udapl(=DIR), the udapl BTL will not be built. - AS_IF([test -z "$with_udapl"], - [case $host in - *linux*) - AC_MSG_WARN([On Linux and --with-udapl was not specified]) - AC_MSG_WARN([Not building the udapl BTL]) - with_udapl=no - ;; - esac]) - - AS_IF([test ! -z "$with_udapl" && test "$with_udapl" != "yes"], - [ompi_check_udapl_dir="$with_udapl"]) - AS_IF([test ! -z "$with_udapl_libdir" && test "$with_udapl_libdir" != "yes"], - [ompi_check_udapl_libdir="$with_udapl_libdir"]) - AS_IF([test "$with_udapl" = "no"], - [ompi_check_udapl_happy="no"], - [ompi_check_udapl_happy="yes"]) - -dnl Do not use ompi_check_package directly, because then we have -dnl to test for the header file twice, and caching is disabled -dnl for all ompi_check_package checks. Instead, do what -dnl ompi_check_package does, but only do the header check once. -dnl Still do the lib check twice, the second time if it turns -dnl out we need -ldapl to link (looks like udapl over GM). - - ompi_check_package_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_package_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_package_$1_save_LIBS="$LIBS" - - ompi_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS" - ompi_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS" - ompi_check_package_$1_orig_LIBS="$$1_LIBS" - - AS_IF([test "$ompi_check_udapl_happy" = "yes"], - [_OPAL_CHECK_PACKAGE_HEADER([$1], - [dat/udat.h], - [$ompi_check_udapl_dir], - [ompi_check_udapl_happy="yes"], - [ompi_check_udapl_happy="no"])]) - - AS_IF([test "$ompi_check_udapl_happy" = "yes"], - [_OPAL_CHECK_PACKAGE_LIB([$1], - [dat], - [dat_registry_list_providers], - [], - [$ompi_check_udapl_dir], - [$ompi_check_udapl_libdir], - [ompi_check_udapl_happy="yes"], - [_OPAL_CHECK_PACKAGE_LIB([$1], - [dat], - [dat_registry_list_providers], - [-ldapl], - [$ompi_check_udapl_dir], - [$ompi_check_udapl_libdir], - [ompi_check_udapl_happy="yes"], - [ompi_check_udapl_happy="no"])])]) - - CPPFLAGS="$ompi_check_package_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_package_$1_save_LDFLAGS" - LIBS="$ompi_check_package_$1_save_LIBS" - - AS_IF([test "$ompi_check_udapl_happy" = "yes"], - [$2], - [AS_IF([test ! -z "$with_udapl" && test "$with_udapl" != "no"], - [AC_MSG_ERROR([uDAPL support requested but not found. Aborting])]) - $3]) -]) - diff --git a/config/ompi_config_files.m4 b/config/ompi_config_files.m4 index 14e3077b03d..21d1e3eb791 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -1,11 +1,13 @@ # -*- shell-script -*- # -# Copyright (c) 2009-2020 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2017-2020 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2018 Los Alamos National Security, LLC. All rights # reserved. # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. +# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -25,32 +27,23 @@ AC_DEFUN([OMPI_CONFIG_FILES],[ ompi/debuggers/Makefile ompi/mpi/c/Makefile - ompi/mpi/c/profile/Makefile ompi/mpi/fortran/base/Makefile ompi/mpi/fortran/mpif-h/Makefile ompi/mpi/fortran/mpif-h/profile/Makefile ompi/mpi/fortran/use-mpi/Makefile ompi/mpi/fortran/use-mpi/mpi-types.F90 - ompi/mpi/fortran/use-mpi-tkr/Makefile - ompi/mpi/fortran/use-mpi-tkr/fortran_sizes.h - ompi/mpi/fortran/use-mpi-tkr/fortran_kinds.sh ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h ompi/mpi/fortran/use-mpi-f08/Makefile ompi/mpi/fortran/use-mpi-f08/base/Makefile - ompi/mpi/fortran/use-mpi-f08/profile/Makefile ompi/mpi/fortran/use-mpi-f08/bindings/Makefile ompi/mpi/fortran/use-mpi-f08/mod/Makefile ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h ompi/mpi/fortran/mpiext-use-mpi/Makefile ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile ompi/mpi/tool/Makefile - ompi/mpi/tool/profile/Makefile - - ompi/mpi/man/man3/Makefile - ompi/mpi/man/man5/Makefile ompi/tools/ompi_info/Makefile ompi/tools/wrappers/Makefile diff --git a/config/ompi_configure_options.m4 b/config/ompi_configure_options.m4 index c7780baf020..0593a317024 100644 --- a/config/ompi_configure_options.m4 +++ b/config/ompi_configure_options.m4 @@ -28,7 +28,7 @@ dnl $HEADER$ dnl AC_DEFUN([OMPI_CONFIGURE_OPTIONS],[ -opal_show_subtitle "OMPI Configuration options" +opal_show_subtitle "MPI layer configuration options" # # Disable MPI layer? @@ -166,6 +166,15 @@ case "x$enable_mpi_fortran" in ;; esac +AC_MSG_CHECKING([where to install Fortran MPI modules]) +AC_ARG_WITH([mpi-moduledir], + [AS_HELP_STRING([--with-mpi-moduledir], + [specify where to install Fortran MPI modules (default: $libdir)])], + [OMPI_FORTRAN_MODULEDIR=$withval], + [OMPI_FORTRAN_MODULEDIR=$libdir]) +AC_SUBST(OMPI_FORTRAN_MODULEDIR) +AC_MSG_RESULT([$OMPI_FORTRAN_MODULEDIR]) + # Remove these when we finally kill them once and for all AC_ARG_ENABLE([mpi1-compatibility], [AS_HELP_STRING([--enable-mpi1-compatibility], @@ -231,9 +240,25 @@ AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check, AC_DEFINE_UNQUOTED(OMPI_PARAM_CHECK, $ompi_param_check, [Whether we want to check MPI parameters never or possible (an integer constant)]) +AC_MSG_CHECKING([if want OMPIO support]) AC_ARG_ENABLE([io-ompio], [AS_HELP_STRING([--disable-io-ompio], [Disable the ompio MPI-IO component])]) +if test "$enable_io_ompio" = "no" ; then + AC_MSG_RESULT([no]) + ompi_want_ompio=0 +else + AC_MSG_RESULT([yes]) + ompi_want_ompio=1 +fi +AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1") + +# If the binding source files don't exist, then we need Python to generate them +AM_PATH_PYTHON([3.6],,[:]) +binding_file="${srcdir}/ompi/mpi/c/ompi_send.c" +AS_IF([! test -e "$binding_file" && test "$PYTHON" = ":"], + [AC_MSG_ERROR([Open MPI requires Python >=3.6 for generating the bindings. Aborting])]) +AM_CONDITIONAL(OMPI_GENERATE_BINDINGS,[test "$PYTHON" != ":"]) ])dnl diff --git a/config/ompi_contrib.m4 b/config/ompi_contrib.m4 deleted file mode 100644 index 27f6a37ccc6..00000000000 --- a/config/ompi_contrib.m4 +++ /dev/null @@ -1,140 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -###################################################################### -# -# OMPI_CONTRIB -# -# configure the contributed software components. Currently fairly -# hard-wired, but someday should be much more like OMPI_MCA. See -# https://svn.open-mpi.org/trac/ompi/ticket/1162. -# -# USAGE: -# OMPI_CONTRIB() -# -###################################################################### -AC_DEFUN([OMPI_CONTRIB],[ - dnl for OPAL_CONFIGURE_USER env variable - AC_REQUIRE([OPAL_CONFIGURE_SETUP]) - - # Option to not build some of the contributed software packages - AC_ARG_ENABLE([contrib-no-build], - [AS_HELP_STRING([--enable-contrib-no-build=LIST], - [Comma-separated list of contributed package names that will not be built. Possible values: ompi_mpicontrib_list. Example: "--enable-contrib-no-build=foo,bar" will disable building both the "foo" and "bar" contributed software packages (default: none -- i.e., build all possible contrib packages)])]) - - # Parse the list to see what we should not build - opal_show_subtitle "Configuring contributed software packages" - AC_MSG_CHECKING([which contributed software packages should be disabled]) - if test "$enable_contrib_no_build" = "yes"; then - AC_MSG_RESULT([yes]) - AC_MSG_ERROR([*** The enable-contrib-no-build flag requires an explicit list -*** of packages to not build. For example, --enable-contrib-no-build=libompitrace]) - else - ifs_save="$IFS" - IFS="${IFS}$PATH_SEPARATOR," - msg= - for item in $enable_contrib_no_build; do - str="`echo DISABLE_contrib_${item}=1 | sed s/-/_/g`" - eval $str - msg="$item $msg" - done - IFS="$ifs_save" - fi - AC_MSG_RESULT([$msg]) - unset msg - - # List of contrib subdirs to traverse into - OMPI_CONTRIB_SUBDIRS= - OMPI_CONTRIB_DIST_SUBDIRS= - OMPI_MPI_CONTRIBS= - - # Cycle through each of the software packages and - # configure them if not disabled. - m4_foreach(software, [ompi_mpicontrib_list], - [_OMPI_CONTRIB_CONFIGURE(software)]) - - # Setup the top-level glue - AC_DEFINE_UNQUOTED([OMPI_MPI_CONTRIBS], ["$OMPI_MPI_CONTRIBS"], - [Contributed software packages built with Open MPI]) - AC_SUBST(OMPI_CONTRIB_SUBDIRS) - AC_SUBST(OMPI_CONTRIB_DIST_SUBDIRS) -])dnl - - -###################################################################### -# -# _OMPI_CONTRIB_SOFTWARE -# -# Setup a specific contributed software package. This is a subroutine -# because the work to setup each package is essentially the same. -# Currently assumes that there is a configure.m4 file in the -# contributed software directory. May someday be expanded to handle -# other things. -# -# USAGE: -# _OMPI_CONTRIB_SOFTARE([package_name]) -# -###################################################################### -AC_DEFUN([_OMPI_CONTRIB_CONFIGURE],[ - - opal_show_subsubsubtitle "$1 (m4 configuration macro)" - - # Put in a convenient enable/disable switch (it's a little more - # user friendly than - # --enable-contrib-no-build=, although each - # works just as well as the other). - AC_ARG_ENABLE([$1], - [AS_HELP_STRING([--disable-$1], - [disable support for contributed package $1 (default: enabled)])]) - AS_IF([test "x$enable_$1" = xno], [DISABLE_contrib_$1=yes]) - - OMPI_CONTRIB_HAPPY=0 - if test "$DISABLE_contrib_$1" = "" && test "$DISABLE_contrib_all" = ""; then - OMPI_contrib_$1_CONFIG([OMPI_CONTRIB_HAPPY=1], []) - AC_MSG_CHECKING([if contributed component $1 can compile]) - if test "$OMPI_CONTRIB_HAPPY" = "1"; then - OMPI_CONTRIB_SUBDIRS="$OMPI_CONTRIB_SUBDIRS contrib/$1" - OMPI_CONTRIB_DIST_SUBDIRS="$OMPI_CONTRIB_DIST_SUBDIRS contrib/$1" - if test "$OMPI_MPI_CONTRIBS" = ""; then - OMPI_MPI_CONTRIBS=$1 - else - OMPI_MPI_CONTRIBS="$1, $OMPI_MPI_CONTRIBS" - fi - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - - # If this component was requested via command line switch, then abort. - if test "x$enable_$1" = xyes ; then - AC_MSG_WARN([Contributed component "$1" failed to configure properly]) - AC_MSG_WARN([This component was requested via command line switch]) - AC_MSG_ERROR([Cannot continue]) - fi - fi - else - AC_MSG_NOTICE([disabled via command line switch]) - fi - AC_DEFINE_UNQUOTED(OMPI_ENABLE_CONTRIB_$1, [$OMPI_CONTRIB_HAPPY], - [Enable contributed software package $1]) - unset OMPI_CONTRIB_HAPPY -])dnl diff --git a/config/ompi_deleted_options.m4 b/config/ompi_deleted_options.m4 index d068c7c0e57..b3e53bb42d6 100644 --- a/config/ompi_deleted_options.m4 +++ b/config/ompi_deleted_options.m4 @@ -1,7 +1,7 @@ # -*- shell-script -*- # # Copyright (c) 2020 Intel, Inc. All rights reserved. -# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2020-2021 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -10,7 +10,7 @@ # AC_DEFUN([OMPI_CHECK_DELETED_OPTIONS],[ - OPAL_VAR_SCOPE_PUSH([with_pmi_given with_pmi_libdir_given cxx]) + OPAL_VAR_SCOPE_PUSH([with_pmi_given with_pmi_libdir_given ompi_cxx_warn ompi_cxx_error]) # --with-pmi options were removed in v5.0 AC_ARG_WITH([pmi], @@ -41,38 +41,55 @@ AC_DEFUN([OMPI_CHECK_DELETED_OPTIONS],[ AC_MSG_ERROR([Build cannot continue.]) fi - # Open MPI C++ bindings were removed in v5.0 - cxx=0 - cxxseek=0 - cxxex=0 + # Note that we always *warn* if someone used a CLI option for a + # feature that has been deleted. If, however, they are disabling + # the deleted feature (e.g., --disable-mpi-cxx), then emitting a + # warning is good enough -- allow configure to continue. If, + # however, the user asked to enable a deleted feature, then + # configure needs to error out. + ompi_cxx_warn=0 + ompi_cxx_error=0 AC_ARG_ENABLE([mpi-cxx], [AS_HELP_STRING([--enable-mpi-cxx], [*DELETED* Build the MPI C++ bindings])], - [cxx=1]) + [ompi_cxx_warn=1 + AS_IF([test "$enable_mpi_cxx" != "no"], + [ompi_cxx_error=1]) + ]) AC_ARG_ENABLE([mpi-cxx-seek], [AS_HELP_STRING([--enable-mpi-cxx-seek], [*DELETED* Build support for MPI::SEEK])], - [cxxseek=1]) + [ompi_cxx_warn=1 + AS_IF([test "$enable_mpi_cxx_seek" != "no"], + [ompi_cxx_error=1]) + ]) AC_ARG_ENABLE([cxx-exceptions], [AS_HELP_STRING([--enable-cxx-exceptions], [*DELETED* Build support for C++ exceptions in the MPI C++ bindings])], - [cxxex=1]) + [ompi_cxx_warn=1 + AS_IF([test "$enable_cxx_exceptions" != "no"], + [ompi_cxx_error=1]) + ]) - AS_IF([test "$enable_mpi_cxx" = "no" ], - [cxx=0]) - - AS_IF([test "$enable_mpi_cxx_seek" = "no" ], - [cxxseek=0]) - - AS_IF([test "$enable_cxx_exceptions" = "no" ], - [cxxex=0]) - - AS_IF([test $cxx -eq 1 || test $cxxseek -eq 1 || test $cxxex -eq 1], - [AC_MSG_WARN([The MPI C++ bindings have been removed from Open MPI.]) + AS_IF([test $ompi_cxx_warn -eq 1], + [AC_MSG_WARN([An MPI C++ bindings-related command line option]) + AC_MSG_WARN([was given to "configure".]) + AC_MSG_WARN([ ]) + AC_MSG_WARN([This command line option will be removed in a future]) + AC_MSG_WARN([version of Open MPI; you should discontinue using it.]) + AC_MSG_WARN([You have been warned!]) + AC_MSG_WARN([ ]) + AC_MSG_WARN([The MPI C++ bindings were deprecated in the MPI-2.2]) + AC_MSG_WARN([standard in 2009, and removed from the MPI-3.0]) + AC_MSG_WARN([standard in 2012. The MPI C++ bindings were then]) + AC_MSG_WARN([removed from Open MPI v5.0.0 in 2022.]) + AC_MSG_WARN([ ]) AC_MSG_WARN([If you need support for the MPI C++ bindings, you]) AC_MSG_WARN([will need to use an older version of Open MPI.]) - AC_MSG_ERROR([Build cannot continue.]) ]) + AS_IF([test $ompi_cxx_error -eq 1], + [AC_MSG_ERROR([Build cannot continue.])]) + OPAL_VAR_SCOPE_POP ]) diff --git a/config/ompi_ext.m4 b/config/ompi_ext.m4 index 6f96ef2fdbe..5120b3603e7 100644 --- a/config/ompi_ext.m4 +++ b/config/ompi_ext.m4 @@ -34,6 +34,9 @@ AC_DEFUN([OMPI_EXT],[ dnl for OPAL_CONFIGURE_USER env variable AC_REQUIRE([OPAL_CONFIGURE_SETUP]) + m4_ifdef([ompi_mpiext_list], [], + [m4_fatal([Could not find MPI Extensions list. Aborting.])]) + # Note that we do not build DSO's here -- we *only* build convenience # libraries that get slurped into higher-level libraries # @@ -42,7 +45,7 @@ AC_DEFUN([OMPI_EXT],[ # AC_ARG_ENABLE([mpi-ext], [AS_HELP_STRING([--enable-mpi-ext[=LIST]], - [Comma-separated list of extensions that should be built. Possible values: ompi_mpiext_list. Example: "--enable-mpi-ext=foo,bar" will enable building the MPI extensions "foo" and "bar". If LIST is empty or the special value "all", then all available MPI extensions will be built (default: all).])]) + [Comma-separated list of extensions that should be built. Possible values: ]m4_quote(ompi_mpiext_list)[. Example: "--enable-mpi-ext=foo,bar" will enable building the MPI extensions "foo" and "bar". If LIST is empty or the special value "all", then all available MPI extensions will be built (default: all).])]) # print some nice messages about what we're about to do... AC_MSG_CHECKING([for available MPI Extensions]) @@ -74,9 +77,6 @@ AC_DEFUN([OMPI_EXT],[ AC_MSG_RESULT([$msg]) unset msg - m4_ifdef([ompi_mpiext_list], [], - [m4_fatal([Could not find MPI Extensions list. Aborting.])]) - EXT_CONFIGURE ]) @@ -390,6 +390,9 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[ AS_IF([test $should_build -eq 1], [EXT_PROCESS_COMPONENT([$1], [$2], [$3], [$4], [$5], [$6], [$7])], [EXT_PROCESS_DEAD_COMPONENT([$1], [$2])]) + + m4_ifdef([OMPI_MPIEXT_$1_POST_CONFIG], + [OMPI_MPIEXT_$1_POST_CONFIG($should_build)]) ]) ###################################################################### diff --git a/config/ompi_find_mpi_aint_count_offset.m4 b/config/ompi_find_mpi_aint_count_offset.m4 index 5aec6d3ed9f..6684dd10e2f 100644 --- a/config/ompi_find_mpi_aint_count_offset.m4 +++ b/config/ompi_find_mpi_aint_count_offset.m4 @@ -95,7 +95,7 @@ AC_DEFUN([_OMPI_FIND_MPI_COUNT_TYPE], [ # memory space, the scheme we use below may not work. ...but such # systems are pretty rare today. - MPI_COUNT_TYPE=unknonwn + MPI_COUNT_TYPE=unknown AC_MSG_CHECKING([for type of MPI_Count]) if test $ac_cv_sizeof_long_long -le $ac_cv_sizeof_size_t && \ test $ac_cv_sizeof_long_long -ge $MPI_AINT_SIZE; then diff --git a/config/ompi_fortran_check.m4 b/config/ompi_fortran_check.m4 index 86265473a2f..777da4779a4 100644 --- a/config/ompi_fortran_check.m4 +++ b/config/ompi_fortran_check.m4 @@ -32,7 +32,7 @@ dnl # - alignment # - associated C type # -# types to search is a comma-seperated list of values +# types to search is a comma-separated list of values AC_DEFUN([OMPI_FORTRAN_CHECK], [ OPAL_VAR_SCOPE_PUSH([ofc_have_type ofc_type_size ofc_type_alignment ofc_c_type ofc_expected_size]) @@ -117,7 +117,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK], [ AC_MSG_CHECKING([for corresponding KIND value of $1]) case "$ofc_c_type" in - char) ofc_type_kind=C_SIGNED_CHAR ;; + char) ofc_type_kind=C_SIGNED_CHAR ;; double) ofc_type_kind=C_DOUBLE ;; float) ofc_type_kind=C_FLOAT ;; int) ofc_type_kind=C_INT ;; diff --git a/config/ompi_fortran_check_asynchronous.m4 b/config/ompi_fortran_check_asynchronous.m4 index 0cc3c84bfe5..62c53159c50 100644 --- a/config/ompi_fortran_check_asynchronous.m4 +++ b/config/ompi_fortran_check_asynchronous.m4 @@ -11,6 +11,8 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2024 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -35,6 +37,10 @@ SUBROUTINE binky(buf) REAL, DIMENSION(*), ASYNCHRONOUS :: buf END SUBROUTINE END INTERFACE +CONTAINS +SUBROUTINE wookie(buf) + REAL, DIMENSION(*), ASYNCHRONOUS :: buf +END SUBROUTINE END MODULE asynch_mod]])], [AS_VAR_SET(asynchronous_var, yes)], [AS_VAR_SET(asynchronous_var, no)]) diff --git a/config/ompi_fortran_check_elemental.m4 b/config/ompi_fortran_check_elemental.m4 new file mode 100644 index 00000000000..ca3658f1dc8 --- /dev/null +++ b/config/ompi_fortran_check_elemental.m4 @@ -0,0 +1,47 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +dnl University Research and Technology +dnl Corporation. All rights reserved. +dnl Copyright (c) 2004-2005 The University of Tennessee and The University +dnl of Tennessee Research Foundation. All rights +dnl reserved. +dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +dnl University of Stuttgart. All rights reserved. +dnl Copyright (c) 2004-2005 The Regents of the University of California. +dnl All rights reserved. +dnl Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2022 Triad National Security, LLC. All rights +dnl reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# Check whether or not the Fortran compiler supports the "elemental" +# keyword in derived types or not. + +# OMPI_FORTRAN_CHECK_ELEMENTAL([action if found], +# [action if not found]) +# ---------------------------------------------------- +AC_DEFUN([OMPI_FORTRAN_CHECK_ELEMENTAL],[ + AS_VAR_PUSHDEF([elemental_var], [ompi_cv_fortran_elemental]) + + AC_CACHE_CHECK([if Fortran compiler supports ELEMENTAL], elemental_var, + [AC_LANG_PUSH([Fortran]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ELEMENTAL SUBROUTINE binky(buf) + REAL,INTENT(INOUT) :: buf + BUF = BUF + 1 +END SUBROUTINE binky]])], + [AS_VAR_SET(elemental_var, yes)], + [AS_VAR_SET(elemental_var, no)]) + touch conftest_foo.mod + rm -rf *.mod 2>/dev/null + AC_LANG_POP([Fortran]) + ]) + + AS_VAR_IF(elemental_var, [yes], [$1], [$2]) + AS_VAR_POPDEF([elemental_var])dnl +]) diff --git a/config/ompi_fortran_check_f08_assumed_rank.m4 b/config/ompi_fortran_check_f08_assumed_rank.m4 index 513bbdb2435..82ed6aafe7c 100644 --- a/config/ompi_fortran_check_f08_assumed_rank.m4 +++ b/config/ompi_fortran_check_f08_assumed_rank.m4 @@ -39,7 +39,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_F08_ASSUMED_RANK], [ ################################### AC_DEFUN([_OMPI_FORTRAN_CHECK_F08_ASSUMED_RANK], [ - OPAL_VAR_SCOPE_PUSH([happy]) + OPAL_VAR_SCOPE_PUSH([f08_assumed_rank_happy]) # If we were called here, it means that the value was not cached, # so we need to check several different things. Since CACHE_CHECK @@ -50,9 +50,9 @@ AC_DEFUN([_OMPI_FORTRAN_CHECK_F08_ASSUMED_RANK], [ # Check for the F08 type(*),dimension(..) syntax OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB([!], [TYPE(*), DIMENSION(..)], [TYPE(*), DIMENSION(..)], - [happy=yes], [happy=no]) + [f08_assumed_rank_happy=yes], [f08_assumed_rank_happy=no]) - AS_VAR_SET(fortran_f08_assumed_rank, [$happy]); + AS_VAR_SET(fortran_f08_assumed_rank, [$f08_assumed_rank_happy]); # Now put the original CACHE_CHECK MSG_CHECKING back so that it can # output the MSG_RESULT. diff --git a/config/ompi_fortran_check_ignore_tkr.m4 b/config/ompi_fortran_check_ignore_tkr.m4 index bb64eb50565..ac23f42b913 100644 --- a/config/ompi_fortran_check_ignore_tkr.m4 +++ b/config/ompi_fortran_check_ignore_tkr.m4 @@ -14,6 +14,8 @@ dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2024 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -23,7 +25,7 @@ dnl $HEADER$ # Does this compiler support (void*)-like functionality for MPI choice # buffers? If so, which flavor? AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR], [ - OPAL_VAR_SCOPE_PUSH([result happy type predecl]) + OPAL_VAR_SCOPE_PUSH([result ignore_tkr_happy type predecl]) OMPI_FORTRAN_IGNORE_TKR_PREDECL= OMPI_FORTRAN_IGNORE_TKR_TYPE= @@ -41,11 +43,11 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR], [ AS_VAR_COPY([result], [fortran_ignore_tkr_data]) # Parse the result - happy=`echo $result | cut -d: -f1` + ignore_tkr_happy=`echo $result | cut -d: -f1` type=`echo $result | cut -d: -f2` predecl=`echo $result | cut -d: -f3-` - AS_IF([test $happy -eq 1], + AS_IF([test $ignore_tkr_happy -eq 1], [OMPI_FORTRAN_IGNORE_TKR_PREDECL=$predecl OMPI_FORTRAN_IGNORE_TKR_TYPE=$type $1], @@ -58,7 +60,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR], [ ################ AC_DEFUN([_OMPI_FORTRAN_CHECK_IGNORE_TKR], [ - OPAL_VAR_SCOPE_PUSH([happy ompi_fortran_ignore_tkr_predecl ompi_fortran_ignore_tkr_type]) + OPAL_VAR_SCOPE_PUSH([internal_ignore_tkr_happy ompi_fortran_ignore_tkr_predecl ompi_fortran_ignore_tkr_type]) # If we were called here, it means that the value was not cached, # so we need to check several different things. Since CACHE_CHECK @@ -74,43 +76,49 @@ AC_DEFUN([_OMPI_FORTRAN_CHECK_IGNORE_TKR], [ OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( [!], [type(*)], [TYPE(*), DIMENSION(*)], - [happy=1], [happy=0]) + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0]) # GCC compilers - AS_IF([test $happy -eq 0], + AS_IF([test $internal_ignore_tkr_happy -eq 0], [OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( [!GCC\$ ATTRIBUTES NO_ARG_CHECK ::], [type(*), dimension(*)], [!GCC\$ ATTRIBUTES NO_ARG_CHECK], - [happy=1], [happy=0])]) + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0])]) + # LLVM compilers + AS_IF([test $internal_ignore_tkr_happy -eq 0], + [OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( + [!DIR\$ IGNORE_TKR], [type(*)], + [!DIR\$ IGNORE_TKR], + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0])]) # Intel compilers - AS_IF([test $happy -eq 0], + AS_IF([test $internal_ignore_tkr_happy -eq 0], [OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( [!DEC\$ ATTRIBUTES NO_ARG_CHECK ::], [real, dimension(*)], [!DEC\$ ATTRIBUTES NO_ARG_CHECK], - [happy=1], [happy=0])]) + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0])]) # Solaris Studio compilers # Note that due to a compiler bug, we have been advised by Oracle to # use the "character(*)" type - AS_IF([test $happy -eq 0], + AS_IF([test $internal_ignore_tkr_happy -eq 0], [OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( [!\$PRAGMA IGNORE_TKR], [character(*)], [!\$PRAGMA IGNORE_TKR], - [happy=1], [happy=0])]) + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0])]) # Cray compilers - AS_IF([test $happy -eq 0], + AS_IF([test $internal_ignore_tkr_happy -eq 0], [OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( [!DIR\$ IGNORE_TKR], [real, dimension(*)], [!DIR\$ IGNORE_TKR], - [happy=1], [happy=0])]) + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0])]) # IBM compilers - AS_IF([test $happy -eq 0], + AS_IF([test $internal_ignore_tkr_happy -eq 0], [OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB( [!IBM* IGNORE_TKR], [real, dimension(*)], [!IBM* IGNORE_TKR], - [happy=1], [happy=0])]) + [internal_ignore_tkr_happy=1], [internal_ignore_tkr_happy=0])]) AS_VAR_SET(fortran_ignore_tkr_data, - [${happy}:${ompi_fortran_ignore_tkr_type}:${ompi_fortran_ignore_tkr_predecl}]) + [${internal_ignore_tkr_happy}:${ompi_fortran_ignore_tkr_type}:${ompi_fortran_ignore_tkr_predecl}]) # Now put the original CACHE_CHECK MSG_CHECKING back so that it can # output the MSG_RESULT. @@ -133,6 +141,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [ AC_MSG_CHECKING([for Fortran compiler support of $3]) AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[[! ! Autoconf puts "program main" at the top + implicit none interface subroutine force_assumed_shape(a, count) @@ -157,6 +166,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [ complex, pointer, dimension(:,:) :: ptr target :: buffer3 integer :: buffer4 + integer :: a ptr => buffer3 ! Set some known values (somewhat irrelevant for this test, but just be @@ -189,8 +199,23 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [ call foo(a, count) end subroutine force_assumed_shape + module check_ignore_tkr + interface foobar + subroutine foobar_x(buffer, count) + $1 buffer + $2, intent(in) :: buffer + integer, intent(in) :: count + end subroutine foobar_x + end interface + end module + + subroutine bar(var) + use check_ignore_tkr + implicit none + real, intent(inout) :: var(:, :, :) + + call foobar(var(1,1,1), 1) ! Autoconf puts "end" after the last line - subroutine bogus ]]), [msg=yes ompi_fortran_ignore_tkr_predecl="$1" diff --git a/config/ompi_fortran_check_iso_fortran_env_real16.m4 b/config/ompi_fortran_check_iso_fortran_env_real16.m4 new file mode 100644 index 00000000000..9089098a1f6 --- /dev/null +++ b/config/ompi_fortran_check_iso_fortran_env_real16.m4 @@ -0,0 +1,34 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2021 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# Check whether or not the Fortran compiler supports the non standard +# iso_fortran_env:real16 or not +# +# OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV_REAL16([action if found], [action if not found]) +# ---------------------------------------------------- +AC_DEFUN([OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV_REAL16],[ + AS_VAR_PUSHDEF([iso_fortran_env_var_real16], [ompi_cv_fortran_have_iso_fortran_env_real16]) + + AC_CACHE_CHECK([if Fortran compiler supports ISO_FORTRAN_ENV:REAL16], iso_fortran_env_var_real16, + [AC_LANG_PUSH([Fortran]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_iso_fortran_env_real16 + use, intrinsic :: iso_fortran_env + real(REAL16) :: var + var = 12.34 +end program]])], + [AS_VAR_SET(iso_fortran_env_var_real16, yes)], + [AS_VAR_SET(iso_fortran_env_var_real16, no)]) + AC_LANG_POP([Fortran]) + ]) + + AS_VAR_IF(iso_fortran_env_var_real16, [yes], [$1], [$2]) + AS_VAR_POPDEF([iso_fortran_env_var_real16]) +]) diff --git a/config/ompi_fortran_check_real16_c_equiv.m4 b/config/ompi_fortran_check_real16_c_equiv.m4 index 12e427d754b..3e39798d1c7 100644 --- a/config/ompi_fortran_check_real16_c_equiv.m4 +++ b/config/ompi_fortran_check_real16_c_equiv.m4 @@ -24,8 +24,7 @@ dnl # OMPI_FORTRAN_CHECK_REAL16_C_EQUIV # ---------------------------------------------------- AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_C_EQUIV],[ - unset happy - OPAL_VAR_SCOPE_PUSH([happy define_value msg CFLAGS_save]) + OPAL_VAR_SCOPE_PUSH([fortran_real16_happy define_value msg CFLAGS_save]) AS_VAR_PUSHDEF([real16_matches_c_var], [ompi_cv_real16_c_equiv]) # We have to do this as a cache check for cross-compilation platforms @@ -42,16 +41,15 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_C_EQUIV],[ OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE([$OMPI_FORTRAN_REAL16_C_TYPE], [L]) # If that didn't work, see if we have a compiler-specific # type that might work - AS_IF([test "$happy" = "no"], - [AC_MSG_RESULT([$happy]) + AS_IF([test "$fortran_real16_happy" = "no"], + [AC_MSG_RESULT([$fortran_real16_happy]) # Intel compiler has a special type that should work AS_IF([test "$opal_cv_c_compiler_vendor" = "intel"], [AC_MSG_CHECKING([if intel compiler _Quad == REAL*16]) CFLAGS_save="$CFLAGS" - CFLAGS="$CFLAGS -Qoption,cpp,--extended_float_types" - OPAL_FLAGS_UNIQ([CFLAGS]) + OPAL_FLAGS_APPEND_UNIQ([CFLAGS], ["-Qoption,cpp,--extended_float_types"]) OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE([_Quad], [q]) - AS_IF([test "$happy" = "yes"], + AS_IF([test "$fortran_real16_happy" = "yes"], [OMPI_FORTRAN_REAL16_C_TYPE="_Quad" AC_MSG_RESULT([works!])], [CFLAGS="$CFLAGS_save" @@ -59,9 +57,8 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_C_EQUIV],[ ]) AS_IF([test "$opal_cv_c_compiler_vendor" = "gnu" && test "$ac_cv_type___float128" = "yes"], [AC_MSG_CHECKING([if gnu compiler __float128 == REAL*16]) - OPAL_FLAGS_UNIQ([CFLAGS]) OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE([__float128], [q]) - AS_IF([test "$happy" = "yes"], + AS_IF([test "$fortran_real16_happy" = "yes"], [OMPI_FORTRAN_REAL16_C_TYPE="__float128" AC_MSG_RESULT([works!])], [AC_MSG_RESULT([does not work])]) @@ -70,7 +67,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_C_EQUIV],[ # AC_CACHE_CHECK will automatically AC_MSG_RESULT AC_MSG_CHECKING([for C type matching bit representation of REAL*16]) ]) - AS_VAR_SET(real16_matches_c_var, [$happy]) + AS_VAR_SET(real16_matches_c_var, [$fortran_real16_happy]) ],[ # No fortran bindings or no REAL*16 AS_IF([test "$OMPI_TRY_FORTRAN_BINDINGS" = "$OMPI_FORTRAN_NO_BINDINGS"], @@ -136,15 +133,15 @@ EOF # Compile and link OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest_c.c], [OPAL_LOG_COMMAND([$FC $FCFLAGS conftest_f.f conftest_c.o -o conftest $LDFLAGS $LIBS], - [happy="yes"], [happy="no"])], [happy="no"]) - AS_IF([test "$happy" = "no"], + [fortran_real16_happy="yes"], [fortran_real16_happy="no"])], [fortran_real16_happy="no"]) + AS_IF([test "$fortran_real16_happy" = "no"], [AC_MSG_RESULT([Could not determine if REAL*16 bit-matches C type])], # If it worked so far, try running to see what we get - [AS_IF([test "$happy" = "yes" && test "$cross_compiling" = "yes"], + [AS_IF([test "$fortran_real16_happy" = "yes" && test "$cross_compiling" = "yes"], [AC_MSG_RESULT([Error!]) AC_MSG_ERROR([Can not determine if REAL*16 bit-matches C if cross compiling])], [OPAL_LOG_COMMAND([./conftest], - [happy=`cat conftestval`], + [fortran_real16_happy=`cat conftestval`], [AC_MSG_RESULT([Error!]) AC_MSG_ERROR([Could not determine if REAL*16 bit-matches C type]) ]) diff --git a/config/ompi_fortran_check_ts.m4 b/config/ompi_fortran_check_ts.m4 new file mode 100644 index 00000000000..1cc9d07a827 --- /dev/null +++ b/config/ompi_fortran_check_ts.m4 @@ -0,0 +1,69 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2019 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# Check whether or not the C compiler supports ISO_Fortran_binding.h +# Also check whether C and Fortran compiler interoperate. +# +# OMPI_FORTRAN_CHECK_TS([action if found], [action if not found]) +# ---------------------------------------------------- +AC_DEFUN([OMPI_FORTRAN_CHECK_TS],[ + AS_VAR_PUSHDEF([fortran_ts], [ompi_cv_fortran_have_ts]) + + AC_CHECK_HEADERS([ISO_Fortran_binding.h], + [AC_CACHE_CHECK([if Fortran and C compilers support ISO_Fortran_binding.h], fortran_ts, + [mkdir conftest.$$ + cd conftest.$$ + + # Try to compile the C bindings + cat > conftest_c.c << EOF +#include + +int is_contiguous_c(CFI_cdesc_t* x) { + return CFI_is_contiguous(x); +} +EOF + OPAL_LOG_COMMAND([$CC $CCFLAGS -c conftest_c.c], + [cat > conftest.f90 << EOF +module MOD_IS_CONTIGUOUS + +interface + +function is_contiguous(buf) BIND(C, name="is_contiguous_c") + implicit none + type(*), dimension(..) :: buf + integer :: is_contiguous +end function is_contiguous + +end interface + +end module + +program test_is_contiguous + use MOD_IS_CONTIGUOUS + implicit none + integer :: a0, a1(2), a2(2,2), a3(2,2,2) + write (*,*) is_contiguous(a0) + write (*,*) is_contiguous(a1) + write (*,*) is_contiguous(a2) + write (*,*) is_contiguous(a3) +end program +EOF + OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftest.f90 conftest_c.o $LDFLAGS $LIBS], + [AS_VAR_SET(fortran_ts, yes)], + [AS_VAR_SET(fortran_ts, no)])], + [AS_VAR_SET(fortran_ts, no)]) + cd .. + rm -rf conftest.$$])], + [AS_VAR_SET(fortran_ts, no)]) + + AS_VAR_IF(fortran_ts, [yes], [$1], [$2]) + AS_VAR_POPDEF([fortran_ts])dnl +]) diff --git a/config/ompi_fortran_find_module_include_flag.m4 b/config/ompi_fortran_find_module_include_flag.m4 index e6d513fe751..4a44bf12174 100644 --- a/config/ompi_fortran_find_module_include_flag.m4 +++ b/config/ompi_fortran_find_module_include_flag.m4 @@ -54,7 +54,7 @@ EOF cd .. # - # Now try to compile a simple program usinng that module, iterating + # Now try to compile a simple program using that module, iterating # through the possible flags that the compiler might use # diff --git a/config/ompi_fortran_get_alignment.m4 b/config/ompi_fortran_get_alignment.m4 index 141e062d5d7..9ccca2a22fb 100644 --- a/config/ompi_fortran_get_alignment.m4 +++ b/config/ompi_fortran_get_alignment.m4 @@ -10,6 +10,8 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. +dnl Copyright (c) 2025 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. dnl $COPYRIGHT$ dnl @@ -55,8 +57,7 @@ dnl # OMPI_FORTRAN_GET_ALIGNMENT(type, shell variable to set) # ---------------------------------------------------- AC_DEFUN([OMPI_FORTRAN_GET_ALIGNMENT],[ - unset happy - OPAL_VAR_SCOPE_PUSH([happy ompi_conftest_h]) + OPAL_VAR_SCOPE_PUSH([fortran_get_alignment_happy ompi_conftest_h]) # Use of m4_translit suggested by Eric Blake: # http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html AS_VAR_PUSHDEF([type_var], @@ -112,9 +113,11 @@ EOF OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c], [OPAL_LOG_COMMAND([$FC $FCFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS], - [happy="yes"], [happy="no"])], [happy="no"]) + [fortran_get_alignment_happy="yes"], + [fortran_get_alignment_happy="no"])], + [fortran_get_alignment_happy="no"]) - if test "$happy" = "no" ; then + if test "$fortran_get_alignment_happy" = "no" ; then AC_MSG_RESULT([Error!]) AC_MSG_ERROR([Could not determine alignment of $1]) fi @@ -177,3 +180,41 @@ end program]])], AS_VAR_COPY([$2], [type_var]) AS_VAR_POPDEF([type_var])dnl ])dnl + +# OMPI_FORTRAN_GET_COMMON_ALIGNMENT(variable to set) +# ------------------------------------------ +AC_DEFUN([OMPI_FORTRAN_GET_COMMON_ALIGNMENT],[ + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS], + [AC_CACHE_CHECK([alignment of Fortran common], ompi_cv_fortran_common_alignment, + [AC_LANG_PUSH([Fortran]) + AC_LINK_IFELSE([AC_LANG_SOURCE([[ program falignment + CHARACTER A,B + COMMON /AA/A + COMMON /BB/B + OPEN(UNIT=10, FILE="conftestval") + if (LOC(A) > LOC(B)) then + write (10,'(I5)') LOC(A)-LOC(B) + else + write (10,'(I5)') LOC(B)-LOC(A) + endif + CLOSE(10) + +end program]])], + [AS_IF([test "$cross_compiling" = "yes"], + [AC_MSG_ERROR([Can not determine common alignment when cross-compiling])], + [OPAL_LOG_COMMAND([./conftest], + [AS_VAR_SET(ompi_cv_fortran_common_alignment, [`cat conftestval`])], + [AC_MSG_ERROR([Could not determine common alignment])])])], + + [AC_MSG_WARN([Could not determine common alignment]) + AC_MSG_WARN([See config.log for details]) + AC_MSG_ERROR([Cannot continue])]) + rm -rf conftest* *.mod 2> /dev/null + AC_LANG_POP([Fortran])]) + + AS_VAR_COPY([$1], [ompi_cv_fortran_common_alignment])], + [AC_MSG_CHECKING([Fortran common alignment]) + $1=0 + AC_MSG_RESULT([skipped])]) + +])dnl diff --git a/config/ompi_fortran_get_value_true.m4 b/config/ompi_fortran_get_value_true.m4 index 2ca2cb78213..8e68a86bf6b 100644 --- a/config/ompi_fortran_get_value_true.m4 +++ b/config/ompi_fortran_get_value_true.m4 @@ -67,7 +67,7 @@ void ompi_print_f(ompi_fortran_logical_t * logical) if( SIZEOF_INT >= sizeof(ompi_fortran_logical_t) ) { fprintf(f, "%d\n", (int)*logical); } else if (SIZEOF_LONG >= sizeof(ompi_fortran_logical_t) ) { - fprintf(f, "%ld\n", (long) *logical); + fprintf(f, "%ld\n", (long) *logical); } else if (SIZEOF_LONG_LONG >= sizeof(ompi_fortran_logical_t) ) { fprintf(f, "%lld\n", (long long) *logical); } else { diff --git a/config/ompi_interix.m4 b/config/ompi_interix.m4 index 7e4339a497b..2348128e769 100644 --- a/config/ompi_interix.m4 +++ b/config/ompi_interix.m4 @@ -3,6 +3,7 @@ dnl dnl Copyright (c) 2008 The University of Tennessee and The University dnl of Tennessee Research Foundation. All rights dnl reserved. +dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -24,10 +25,10 @@ dnl AC_DEFUN([OMPI_INTERIX],[ AC_MSG_CHECKING(for Interix environment) - AC_TRY_COMPILE([], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [#if !defined(__INTERIX) #error Normal Unix environment - #endif], + #endif])], is_interix=yes, is_interix=no) AC_MSG_RESULT([$is_interix]) diff --git a/config/ompi_microsoft.m4 b/config/ompi_microsoft.m4 deleted file mode 100644 index b50db392c89..00000000000 --- a/config/ompi_microsoft.m4 +++ /dev/null @@ -1,118 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2007 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -###################################################################### -# -# OMPI_MICROSOFT_COMPILER -# -# Keep all the Windows checks in one place. -# -# USAGE: -# OMPI_MICROSOFT_COMPILER() -# -###################################################################### -AC_DEFUN([OMPI_MICROSOFT_COMPILER],[ - - # If we are using one of the Microsoft compilers check that we are - # able to include windows.h. Most of the types that follow are defined - # in this file. If we check for it here it will get included in the - # default list of header files. - if test "x$opal_cv_c_compiler_vendor" = "xmicrosoft" ; then - - opal_show_subtitle "Microsoft specific detection" - - # - # These 2 libraries are a minimum ... - SAVE_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS Ws2_32.lib Advapi32.lib" - - AC_CHECK_HEADERS([windows.h winsock2.h wdm.h]) - - # The atomic functions are defined in a very unuasual manner. - # Some of them are intrinsic defined in windows.h others are - # exported by kernel32.dll. If we force the usage of AC_TRY_RUN - # here we will check for both in same time: compilation and run. - - AC_MSG_CHECKING(for working InterlockedCompareExchange) - AC_TRY_RUN( [#include - int main() { - LONG dest = 1, exchange = 0, comperand = 1; - SetErrorMode(SEM_FAILCRITICALERRORS); - InterlockedCompareExchange( &dest, exchange, comperand ); - return (int)dest; - }], - [AC_MSG_RESULT(yes) - ompi_windows_have_support_for_32_bits_atomic=1], - [AC_MSG_RESULT(no) - ompi_windows_have_support_for_32_bits_atomic=0]) - AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGE, - $ompi_windows_have_support_for_32_bits_atomic, - [Whether we support 32 bits atomic operations on Windows]) - - AC_MSG_CHECKING(for working InterlockedCompareExchangeAcquire) - AC_TRY_RUN( [#include - int main() { - LONG dest = 1, exchange = 0, comperand = 1; - SetErrorMode(SEM_FAILCRITICALERRORS); - InterlockedCompareExchangeAcquire( &dest, exchange, comperand ); - return (int)dest; - }], - [AC_MSG_RESULT(yes) - ompi_windows_have_support_for_32_bits_atomic=1], - [AC_MSG_RESULT(no) - ompi_windows_have_support_for_32_bits_atomic=0]) - AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE, - $ompi_windows_have_support_for_32_bits_atomic, - [Whether we support 32 bits atomic operations on Windows]) - - AC_MSG_CHECKING(for working InterlockedCompareExchangeRelease) - AC_TRY_RUN( [#include - int main() { - LONG dest = 1, exchange = 0, comperand = 1; - SetErrorMode(SEM_FAILCRITICALERRORS); - InterlockedCompareExchangeRelease( &dest, exchange, comperand ); - return (int)dest; - }], - [AC_MSG_RESULT(yes) - ompi_windows_have_support_for_32_bits_atomic=1], - [AC_MSG_RESULT(no) - ompi_windows_have_support_for_32_bits_atomic=0]) - AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE, - $ompi_windows_have_support_for_32_bits_atomic, - [Whether we support 32 bits atomic operations on Windows]) - - AC_MSG_CHECKING(for working InterlockedCompareExchange64) - AC_TRY_RUN( [#include - int main() { - LONGLONG dest = 1, exchange = 0, comperand = 1; - SetErrorMode(SEM_FAILCRITICALERRORS); - InterlockedCompareExchange64( &dest, exchange, comperand ); - return (int)dest; - }], - [AC_MSG_RESULT(yes) - ompi_windows_have_support_for_64_bits_atomic=1], - [AC_MSG_RESULT(no) - ompi_windows_have_support_for_64_bits_atomic=0]) - AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGE64, - $ompi_windows_have_support_for_64_bits_atomic, - [Whether we support 64 bits atomic operations on Windows]) - - opal_show_title "Windows Type tests" - - AC_DEFINE([pid_t], [intptr_t], [Windows pid_t type is a pointer]) - AC_DEFINE_UNQUOTED([SIZEOF_PID_T], $ac_cv_sizeof_int, - [and here is it's size]) - - LDFLAGS="$SAVE_LDFLAGS" -fi - -]) diff --git a/config/ompi_setup_contrib.m4 b/config/ompi_setup_contrib.m4 deleted file mode 100644 index 58c470ef131..00000000000 --- a/config/ompi_setup_contrib.m4 +++ /dev/null @@ -1,29 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2004-2009 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-2007 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) 2006-2009 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved. -# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -AC_DEFUN([OMPI_SETUP_CONTRIB],[ - opal_show_title "Contributed software setup" - - OMPI_CONTRIB -]) diff --git a/config/ompi_setup_cxx.m4 b/config/ompi_setup_cxx.m4 index d1c05f03601..c51d21e8dcc 100644 --- a/config/ompi_setup_cxx.m4 +++ b/config/ompi_setup_cxx.m4 @@ -16,6 +16,7 @@ dnl Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2015-2016 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2021 Nanook Consulting. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -29,11 +30,33 @@ AC_DEFUN([OMPI_SETUP_CXX_BANNER],[ ]) AC_DEFUN([OMPI_PROG_CXX],[ - OPAL_VAR_SCOPE_PUSH([ompi_cxxflags_save]) + OPAL_VAR_SCOPE_PUSH([ompi_cxxflags_save ompi_cxx_argv0]) + ompi_cxxflags_save="$CXXFLAGS" AC_PROG_CXX - AC_PROG_CXXCPP CXXFLAGS="$ompi_cxxflags_save" + + # Note: according to the Autoconf docs, if no C++ compiler is + # found, $CXX is still set to "g++" (!!). So make sure that we + # actually found a C++ compiler; if not, set CXX to "no", per + # thread at + # https://www.open-mpi.org/community/lists/users/2013/02/21356.php, + # which advises us to set Libtool precious variables to "no" if we + # don't want Libtool to setup that language at all. + set dummy $CXX + ompi_cxx_argv0=[$]2 + OPAL_WHICH([$ompi_cxx_argv0], [OMPI_CXX_ABSOLUTE]) + AS_IF([test "x$OMPI_CXX_ABSOLUTE" = "x"], + [CXX=no + OMPI_CXX_ABSOLUTE=no], + [ # If we did actually find a C++ compiler, find the C++ CPP + AC_PROG_CXXCPP]) + + AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler]) + AC_SUBST(OMPI_CXX_ABSOLUTE) + + AM_CONDITIONAL([OMPI_HAVE_CXX_COMPILER], [test "$CXX" != "no"]) + OPAL_VAR_SCOPE_POP ]) @@ -44,8 +67,6 @@ dnl wrapper compiler (there is no C++ code in Open MPI, so we do not dnl need to setup for internal C++ compilations). Safe to AC_REQUIRE dnl this macro. AC_DEFUN([OMPI_SETUP_CXX],[ - OPAL_VAR_SCOPE_PUSH([ompi_cxx_argv0]) - # Do a little tomfoolery to get the subsection title printed first AC_REQUIRE([OMPI_SETUP_CXX_BANNER]) @@ -54,20 +75,11 @@ AC_DEFUN([OMPI_SETUP_CXX],[ # see the docs for AC PROG_CC for details. AC_REQUIRE([OMPI_PROG_CXX]) - BASECXX="`basename $CXX`" - - AS_IF([test "x$CXX" = "x"], [CXX=none]) - set dummy $CXX - ompi_cxx_argv0=[$]2 - OPAL_WHICH([$ompi_cxx_argv0], [OMPI_CXX_ABSOLUTE]) - AS_IF([test "x$OMPI_CXX_ABSOLUTE" = "x"], [OMPI_CXX_ABSOLUTE=none]) - - AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler]) - AC_SUBST(OMPI_CXX_ABSOLUTE) - - # Make sure we can link with the C compiler - OPAL_LANG_LINK_WITH_C([C++], [], - [cat <&2 + # If we have a C++ compiler, do some additional tests + AS_IF([test "$CXX" != "no"], + [ # Make sure we can link with the C compiler + OPAL_LANG_LINK_WITH_C([C++], [], + [cat <&2 ********************************************************************** * It appears that your C++ compiler is unable to link against object * files created by your C compiler. This generally indicates either @@ -78,13 +90,6 @@ AC_DEFUN([OMPI_SETUP_CXX],[ * available in the config.log file in this directory. ********************************************************************** EOF - AC_MSG_ERROR([C and C++ compilers are not link compatible. Can not continue.])]) - - # bool type size and alignment - AC_LANG_PUSH(C++) - AC_CHECK_SIZEOF(bool) - OPAL_C_GET_ALIGNMENT(bool, OPAL_ALIGNMENT_CXX_BOOL) - AC_LANG_POP(C++) - - OPAL_VAR_SCOPE_POP + AC_MSG_ERROR([C and C++ compilers are not link compatible. Can not continue.])]) + ]) ]) diff --git a/config/ompi_setup_fc.m4 b/config/ompi_setup_fc.m4 index ab60092f674..157f5a6301d 100644 --- a/config/ompi_setup_fc.m4 +++ b/config/ompi_setup_fc.m4 @@ -43,16 +43,190 @@ AC_DEFUN_ONCE([_OMPI_SETUP_FC_COMPILER],[ # Fortran compilers (excluding the f77 compiler names) from AC's # default list of compilers and use it here. This is the main # reason we have an OMPI-ized version of the PROG_FC macro. - AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor]) + AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor nvfortran]) FCFLAGS="$ompi_fcflags_save" OPAL_VAR_SCOPE_POP ]) ############################################################################# +dnl On macOS with Xcode, test whether -Wl,-commons,use_dylibs works +dnl by itself or whether it also needs -Wl,-ld_classic. +dnl +dnl Backstory +dnl +dnl The history is that for a long time (decades), +dnl -Wl,-commons,use_dylibs worked by itself. +dnl +dnl XCode 15 introduced a a new linker (either "the new linker" or +dnl "ld_prime", according to +dnl https://developer.apple.com/forums/thread/715385). The new linker +dnl originally did not support "-commons use_dylibs", but Apple recently +dnl added support for that feature to the new linker in the XCode 16 +dnl beta. "-ld_classic" forces using the old linker (which doesn't support +dnl some other features that customers might like, but Open MPI doesn't +dnl use for its Fortran bindings, like mergable libraries). +dnl +dnl Sidenode: Open MPI needs this "-commons use_dylibs" functionality +dnl because Fortran sentinel values (e.g., MPI_BOTTOM) are implemented +dnl with Fortran common blocks. +dnl +dnl So there's three cases: +dnl +dnl 1. Customer's default linker is the classic linker, which always +dnl supported "-commons use_dylibs". +dnl 2. Customer's default linker is the new linker, but not new enough +dnl to support "-commons use_dylibs", so we need to force using the old +dnl linker via "-ld_classic". +dnl 3. Customer's default linker is the new linker, new enough to support +dnl "-commons use_dylibs", so we do not want to force using the old +dnl linker. +dnl +dnl We have to use a slightly complex test code that will actually +dnl fail if the version of Xcode being used requires "-ld_classic" +dnl with "-commons,use_dylibs". +dnl +dnl 1. Build a shared library (with C source code) with a public +dnl symbol that can be used as a Fortran common block symbol. +dnl 2. Compile a Fortran program that calls a function in the shared +dnl library, and link it against the shared library. +dnl +dnl Note: This is a linker test; we are checking to see if this all +dnl compiles and links properly. The logic in the C / Fortran code +dnl below specifically does not test for correctness because we do not +dnl actually run the code. +AC_DEFUN([_OMPI_SETUP_FC_XCODE_COMMONS_LDFLAGS],[ + OPAL_VAR_SCOPE_PUSH([xcode_flags]) + + # This variable is used by the invoking macro to display the + # results via AC RESULT (just to keep the symmetry of + # MSG_CHECKING / RESULT in the same upper-level macro). + OMPI_FORTRAN_WRAPPER_FLAGS= + + xcode_flags="-Wl,-commons,use_dylibs" + _OMPI_SETUP_FC_XCODE_COMMONS_LDFLAGS_BACKEND( + [$xcode_flags], + [OMPI_FORTRAN_WRAPPER_FLAGS=$xcode_flags], []) + AS_IF([test -z "$OMPI_FORTRAN_WRAPPER_FLAGS"], + [xcode_flags="-Wl,-commons,use_dylibs -Wl,-ld_classic" + _OMPI_SETUP_FC_XCODE_COMMONS_LDFLAGS_BACKEND( + [$xcode_flags], + [OMPI_FORTRAN_WRAPPER_FLAGS=$xcode_flags], [])]) + AS_IF([test -z "$OMPI_FORTRAN_WRAPPER_FLAGS"], + [OMPI_FORTRAN_WRAPPER_FLAGS="none"]) + + OPAL_VAR_SCOPE_POP +]) + +dnl Companion to _OMPI SETUP_FC_XCODE_COMMONS_LDFLAGS; +dnl see that macro for an explanation of this macro. +dnl +dnl $1: LDFLAGS to test +dnl $2: action to perform upon success +dnl $3: action to perform upon failure +AC_DEFUN([_OMPI_SETUP_FC_XCODE_COMMONS_LDFLAGS_BACKEND],[ + OPAL_VAR_SCOPE_PUSH([xcode_happy xcode_dir LDFLAGS_save_xcode LIBS_save_xcode]) + + xcode_dir=conftest.$$ + rm -rf $xcode_dir + mkdir -p $xcode_dir + cd $xcode_dir + + LIBS_save_xcode=$LIBS + LDFLAGS_save_xcode=$LDFLAGS + LDFLAGS="$LDFLAGS -L. $1" + + # Note: we use COMPILE_IFELSE and LANG_SOURCE below, which assume + # that confdefs.h exists. This is being invoked extremely early + # in the configure sequence, so we haven't AC DEFINE'ed anything + # yet, and therefore confdefs.h won't be automatically created + # yet. So we'll make an empty confdefs.h to avoid some error + # messages (it'll be removed with the whole tempdir, later). + touch confdefs.h + + # Step 1: make a C library with some public symbols + xcode_happy=0 + AC_LANG_PUSH([C]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +/* Must end the symbol in _ (remember: we are specifically targeting + the MacOS compilation environment, so it is ok to target a specific + Fortran symbol convention), otherwise the Fortran linker will not + find it, and will just create a new Fortran symbol for it */ +int ompi_mpi_bottom_ = 42; + +void ompi_init_f(int *bogus); + +/* Empty / useless function that still ensures that this compilation + unit will not be optimized out */ +void ompi_init_f(int *bogus) +{ + *bogus = ompi_mpi_bottom_; +} +]])], + [ # If the above compiled successfully, Then use + # conftest.OBJEXT to make the library. Note that + # conftest.OBJEXT will automatically be deleted upon exit of + # COMPILE_IFELSE. + # + # NOTE: this is pretty gross -- we're manually making a + # shared library. But the libtool binary doesn't exist yet, + # so this is the best that we can do. + OPAL_LOG_COMMAND([$CC -dynamiclib -Wl,-undefined -Wl,dynamic_lookup $LDFLAGS conftest.$OBJEXT -o libconftest.dylib], + [xcode_happy=1])]) + AC_LANG_POP + + # Now compile and link a Fortran program against this shared + # library. + AC_LANG_PUSH([Fortran]) + AS_IF([test $xcode_happy -eq 1], + [LIBS="$LIBS -lconftest" + AC_LINK_IFELSE([AC_LANG_SOURCE([ +program test + integer :: mpi_bottom + common/ompi_mpi_bottom/mpi_bottom + + interface + subroutine ompi_init(bogus) BIND(C, name="ompi_init_f") + implicit none + integer bogus + end subroutine ompi_init + end interface + + integer bogus + call ompi_init(bogus) +end program +])], + + [], + [xcode_happy=0])]) + AC_LANG_POP + + # Exit the temp dir + cd .. + rm -rf $xcode_dir + + # LIBS was set specifically for the artificial conditions of this + # test, so reset it + LIBS=$LIBS_save_xcode + + AS_IF([test $xcode_happy -eq 1], + [ # Restore LDFLAGS + the new flags (i.e., get rid of the + # "-L." we added for this test) + LDFLAGS="$LDFLAGS_save_xcode $1" + $2], + [ # If we failed the test, reset LDFLAGS back to its + # original value. + LDFLAGS=$LDFLAGS_save_xcode + $3]) + + OPAL_VAR_SCOPE_POP +]) + +############################################################################# + # General Fortran compiler setup AC_DEFUN([OMPI_SETUP_FC],[ - OPAL_VAR_SCOPE_PUSH([ompi_fc_happy LDFLAGS_save fc_version]) + OPAL_VAR_SCOPE_PUSH([ompi_fc_happy LDFLAGS_save fc_version OMPI_FORTRAN_WRAPPER_FLAGS]) # Force the intro banner to be displayed first AC_REQUIRE([_OMPI_SETUP_FC_BANNER]) @@ -61,17 +235,17 @@ AC_DEFUN([OMPI_SETUP_FC],[ # Autoconf (version >= 2.64) docs. AC_REQUIRE([_OMPI_SETUP_FC_COMPILER]) + # If $FC is "no", that's another way of the user telling us "I + # don't want any Fortran compiler". That being said, there are + # already existing code paths that expect an empty $FC to mean "no + # Fortran compiler", so turn "no" into "" here. + AS_IF([test "$FC" = "no"], [FC=]) + AS_IF([test -z "$FC"], [AC_MSG_WARN([*** All Fortran MPI bindings disabled (could not find compiler)]) ompi_fc_happy=0], [ompi_fc_happy=1]) - AS_IF([test $ompi_fc_happy -eq 1 && test "$WANT_DEBUG" = "1" && test "$enable_debug_symbols" != "no"], - [FCFLAGS="$FCFLAGS -g" - OPAL_FLAGS_UNIQ(FCFLAGS) - AC_MSG_WARN([-g has been added to FCFLAGS (--enable-debug)]) - ]) - # Make sure the compiler actually works, if not cross-compiling. # Don't just use the AC macro so that we can have a pretty # message. @@ -81,7 +255,7 @@ AC_DEFUN([OMPI_SETUP_FC],[ # OS X before 10.3 (deployment target) does not allow undefined common # symbols in shared libraries. Because we can't figure out how to - # implement MPI_STATUSES_IGNORE and friends wihtout common symbols, on + # implement MPI_STATUSES_IGNORE and friends without common symbols, on # OS X we can't build the F90 bindings as a shared library. OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS= AS_IF([test $ompi_fc_happy -eq 1], @@ -226,23 +400,12 @@ I = 3]])], ]) ]) - # Per #1982, on OS X, we may need some esoteric linker flags in the + # Per Trac #1982, on OS X, we may need some esoteric linker flags in the # Fortran wrapper compiler. AC_MSG_CHECKING([to see if mpifort compiler needs additional linker flags]) case "$host" in *apple-darwin*) - # Test whether -Wl,-commons,use_dylibs works; if it does, use it. - LDFLAGS_save=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-commons,use_dylibs" - AC_LANG_PUSH([Fortran]) - AC_LINK_IFELSE([AC_LANG_SOURCE([[program test - integer :: i -end program]])], - [OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs" - OPAL_WRAPPER_FLAGS_ADD([FCFLAGS], [$OMPI_FORTRAN_WRAPPER_FLAGS])], - [OMPI_FORTRAN_WRAPPER_FLAGS=none]) - AC_LANG_POP([Fortran]) - LDFLAGS=$LDFLAGS_save + _OMPI_SETUP_FC_XCODE_COMMONS_LDFLAGS AC_MSG_RESULT([$OMPI_FORTRAN_WRAPPER_FLAGS]) ;; *) diff --git a/config/ompi_setup_java.m4 b/config/ompi_setup_java.m4 index b0212b230e7..8339fe3cccb 100644 --- a/config/ompi_setup_java.m4 +++ b/config/ompi_setup_java.m4 @@ -18,6 +18,7 @@ dnl Copyright (c) 2013 Intel, Inc. All rights reserved. dnl Copyright (c) 2015-2018 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +dnl Copyright (c) 2025 Nanook Consulting All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -101,7 +102,7 @@ AC_DEFUN([_OMPI_SETUP_JAVA],[ if test "$ompi_java_found" = "0"; then # Various Linux if test -z "$JAVA_HOME"; then - ompi_java_dir='/usr/lib/jvm/java-*-openjdk-*/include/' + ompi_java_dir='/usr/lib/jvm/java-*-openjdk*/include/' else ompi_java_dir=$JAVA_HOME/include fi @@ -128,17 +129,6 @@ AC_DEFUN([_OMPI_SETUP_JAVA],[ [AC_MSG_RESULT([not found])])]) fi - if test "$ompi_java_found" = "0"; then - # Solaris - ompi_java_dir=/usr/java - AC_MSG_CHECKING([for Java in Solaris locations]) - AS_IF([test -d $ompi_java_dir && test -r "$ompi_java_dir/include/jni.h"], - [AC_MSG_RESULT([found ($ompi_java_dir)]) - with_jdk_headers=$ompi_java_dir/include - with_jdk_bindir=$ompi_java_dir/bin - ompi_java_found=1], - [AC_MSG_RESULT([not found])]) - fi ], [ompi_java_found=1]) @@ -188,11 +178,6 @@ EOF # too. Ugh. AS_IF([test -d "$with_jdk_headers/linux"], [OMPI_JDK_CPPFLAGS="$OMPI_JDK_CPPFLAGS -I$with_jdk_headers/linux"]) - # Solaris JDK also require -I/solaris. - # See if that's there, and if so, add a -I for that, - # too. Ugh. - AS_IF([test -d "$with_jdk_headers/solaris"], - [OMPI_JDK_CPPFLAGS="$OMPI_JDK_CPPFLAGS -I$with_jdk_headers/solaris"]) # Darwin JDK also require -I/darwin. # See if that's there, and if so, add a -I for that, # too. Ugh. diff --git a/config/ompi_setup_mpi_fortran.m4 b/config/ompi_setup_mpi_fortran.m4 index fbfd9c5fcf1..45a8db19317 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -15,10 +15,12 @@ dnl Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2014-2020 Research Organization for Information Science +dnl Copyright (c) 2014-2025 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2016 IBM Corporation. All rights reserved. +dnl Copyright (c) 2016-2022 IBM Corporation. All rights reserved. dnl Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. +dnl Copyright (c) 2022 Triad National Security, LLC. All rights +dnl reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -97,6 +99,8 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS], [OMPI_SETUP_FC([ompi_fortran_happy=1])]) + AM_CONDITIONAL([OMPI_HAVE_FORTRAN_COMPILER], [test -n "$FC"]) + # These values will be determined by SETUP_FC. We must always # AC_DEFINE these results, even in the --disable-mpi-fortran case, # for ompi_info. @@ -134,10 +138,8 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ AC_DEFINE([ompi_fortran_bogus_type_t], [int], [A bogus type that allows us to have sentinel type values that are still valid]) - # These get filled in as we check for each type - OMPI_FORTRAN_IKINDS= - OMPI_FORTRAN_RKINDS= - OMPI_FORTRAN_CKINDS= + OMPI_FORTRAN_GET_COMMON_ALIGNMENT([OMPI_FORTRAN_COMMON_ALIGNMENT]) + AC_SUBST([OMPI_FORTRAN_COMMON_ALIGNMENT]) # We want to set the #define's for all of these, so invoke the macros # regardless of whether we have F77 support or not. @@ -280,14 +282,6 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ [$OMPI_FORTRAN_STATUS_SIZE], [The number or Fortran INTEGER in MPI Status]) - # Setup for the compilers that don't support ignore TKR functionality - OPAL_UNIQ(OMPI_FORTRAN_IKINDS) - AC_SUBST(OMPI_FORTRAN_IKINDS) - OPAL_UNIQ(OMPI_FORTRAN_RKINDS) - AC_SUBST(OMPI_FORTRAN_RKINDS) - OPAL_UNIQ(OMPI_FORTRAN_CKINDS) - AC_SUBST(OMPI_FORTRAN_CKINDS) - # We can't use C_INTxx_T KIND values in mpif.h because many # existing MPI Fortran applications are of the form: # @@ -297,12 +291,44 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ # # ...and you can't have a "use..." statement before that (to get # the Fortran/C interop C_INTxx_T KIND values). So figure out - # those KIND values here and just substitue them in via + # those KIND values here and just substitute them in via # AC_DEFINE's. Kinda gross, but there you are. :-\ OMPI_FORTRAN_GET_KIND_VALUE([C_INT16_T], 4, [OMPI_FORTRAN_C_INT16_T_KIND]) OMPI_FORTRAN_GET_KIND_VALUE([C_INT32_T], 9, [OMPI_FORTRAN_C_INT32_T_KIND]) OMPI_FORTRAN_GET_KIND_VALUE([C_INT64_T], 18, [OMPI_FORTRAN_C_INT64_T_KIND]) + # + # See if "attributes deprecated" is supported + # - False positives were seen with compilers like XL which will ignore + # this option by default, but if the user specifies some options to + # the wrapper compiler later it will fail to recognize the option. + # - For now just limit this check to compilers that we know will work + # This directive is only recognized, and works, for gfortran 11.0 and + # later. As a result, this directive is generated only if the + # Fortran compiler building Open MPI is gfortran 11.0 or later. + OMPI_FORTRAN_HAVE_ATTR_DEPRECATED=0 + AS_IF([test $ompi_fortran_happy -eq 1], + [AC_MSG_CHECKING([if Fortran compiler supports the deprecated attribute]) + AS_IF([test "$opal_cv_c_compiler_vendor" = "gnu"], + [AC_LANG_PUSH([Fortran]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_attr_deprecated +!GCC$ ATTRIBUTES DEPRECATED :: x + real*4 x + x = 123.4 + print *,x +end program]])], + [OMPI_FORTRAN_HAVE_ATTR_DEPRECATED=1 + AC_MSG_RESULT([Yes])], + [AC_MSG_RESULT([No])]) + AC_LANG_POP([Fortran])], + [AC_MSG_RESULT([Unknown])]) + ]) + AC_SUBST(OMPI_FORTRAN_HAVE_ATTR_DEPRECATED) + AC_DEFINE_UNQUOTED(OMPI_FORTRAN_HAVE_ATTR_DEPRECATED, + $OMPI_FORTRAN_HAVE_ATTR_DEPRECATED, + [Whether the compiler supports Fortran ATTRIBUTES DEPRECATED or not]) + + #-------------------------------------------------------- # Fortran mpif.h MPI bindings #-------------------------------------------------------- @@ -328,6 +354,13 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ [OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV=0])]) AC_SUBST(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV) + # The non standard iso_fortran_env:real16 can be used for MPI_SIZEOF + OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16=0 + AS_IF([test $ompi_fortran_happy -eq 1], + [OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV_REAL16( + [OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16=1])]) + AC_SUBST(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) + # Ensure that the fortran compiler supports STORAGE_SIZE for # enough relevant types. AS_IF([test $ompi_fortran_happy -eq 1], @@ -362,16 +395,15 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ ]) # If we got here, we can build the mpi module if it was requested. - # Decide whether to build the ignore TKR version or the - # non-ignore-TKR/legacy version. + # We only support compilers which have an ignore TKR feature. AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPI_BINDINGS && \ test $ompi_fortran_happy -eq 1], [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPI_BINDINGS AS_IF([test $OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1], [OMPI_FORTRAN_USEMPI_DIR=mpi/fortran/use-mpi-ignore-tkr OMPI_FORTRAN_USEMPI_LIB=-l${with_libmpi_name}_usempi_ignore_tkr], - [OMPI_FORTRAN_USEMPI_DIR=mpi/fortran/use-mpi-tkr - OMPI_FORTRAN_USEMPI_LIB=-l${with_libmpi_name}_usempi]) + [AC_MSG_WARN([** Fortran compiler does not support ignoring TKR. Please use a newer fortran compiler.]) + AC_MSG_ERROR([*** Cannot continue])]) ]) OMPI_FORTRAN_HAVE_ISO_C_BINDING=0 @@ -406,14 +438,27 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ # If we got all the stuff from above, then also look for the new # F08 syntax that we can use for the use_mpif08 module. - # We need to have ignore TKR functionality to build the mpi_f08 + OMPI_FORTRAN_HAVE_TS=0 + OMPI_MPI_SUBARRAYS_SUPPORTED=.false. + OMPI_MPI_ASYNC_PROTECTS_NONBLOCKING=.false. + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [OMPI_FORTRAN_CHECK_TS([OMPI_FORTRAN_HAVE_TS=1])]) + + # We need to have ignore TKR or the ISO Fortran bindings functionality to build the mpi_f08 # module - AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ - test $OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1], - [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPIF08_BINDINGS - OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL - OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE - ]) + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [AS_IF([test $OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1], + [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPIF08_BINDINGS + OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL + OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE + ]) + AS_IF([test $OMPI_FORTRAN_HAVE_TS -eq 1], + [OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPIF08_BINDINGS + OMPI_MPI_SUBARRAYS_SUPPORTED=.true. + OMPI_MPI_ASYNC_PROTECTS_NONBLOCKING=.true.])]) + + AC_SUBST(OMPI_MPI_SUBARRAYS_SUPPORTED) + AC_SUBST(OMPI_MPI_ASYNC_PROTECTS_NONBLOCKING) # The overall "_BIND_C" variable will be set to 1 if we have all # the necessary forms of BIND(C) @@ -547,8 +592,6 @@ end type test_mpi_handle], ]) OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1 - OMPI_FORTRAN_F08_PREDECL='!' - OMPI_FORTRAN_F08_TYPE=real OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK=0 AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], @@ -556,8 +599,6 @@ end type test_mpi_handle], OMPI_FORTRAN_CHECK_F08_ASSUMED_RANK( [ # If we have assumed rank, we can build the use # mpi_f08 module "better" - OMPI_FORTRAN_F08_PREDECL='!' - OMPI_FORTRAN_F08_TYPE='type(*), dimension(..)' OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK=1]) # Which mpi_f08 implementation are we using? @@ -578,6 +619,21 @@ end type test_mpi_handle], ]) ]) + OMPI_FORTRAN_HAVE_ELEMENTAL=0 + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ + test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [ # Does the compiler support "elemental" + OMPI_FORTRAN_CHECK_ELEMENTAL( + [OMPI_FORTRAN_ELEMENTAL_TYPE="ELEMENTAL"], + [OMPI_FORTRAN_ELEMENTAL_TYPE=])]) + AC_SUBST(OMPI_FORTRAN_ELEMENTAL_TYPE) + + OMPI_FORTRAN_HAVE_C_ISO_FORTRAN=0 + AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ + test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS], + [OMPI_FORTRAN_CHECK_TS([OMPI_FORTRAN_HAVE_TS=1], + [OMPI_FORTRAN_HAVE_TS=0])]) + # Note: the current implementation *only* has wrappers; # there is no optimized implementation for a "good" # compiler. I'm leaving the above logic in place for @@ -624,7 +680,7 @@ end type test_mpi_handle], AC_SUBST(OMPI_FC_ABSOLUTE) AC_DEFINE_UNQUOTED(OMPI_FC, ["$OMPI_FC"], [Underlying Fortran compiler]) AC_DEFINE_UNQUOTED(OMPI_FC_ABSOLUTE, ["$OMPI_FC_ABSOLUTE"], - [Absolutey path to the underlying Fortran compiler found by configure]) + [Absolute path to the underlying Fortran compiler found by configure]) # These go into ompi/info/param.c AC_DEFINE_UNQUOTED([OMPI_FORTRAN_BUILD_SIZEOF], @@ -640,6 +696,18 @@ end type test_mpi_handle], [$OMPI_FORTRAN_HAVE_STORAGE_SIZE], [Whether the compiler supports STORAGE_SIZE on relevant types]) + # This token is used in the mpifort wrapper compiler data file. + # If we are building the Fortran bindings, then include + # -lompi_mpifh in the link line. If we're not building the + # Fortran bindings, then do not include that token in the link + # line (because we'll still install mpifort to link Fortran + # applications with the C bindings, even if the Fortran MPI + # bindings are not being built). + AS_IF([test $OMPI_BUILD_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS], + [OMPI_FORTRAN_MPIFH_LINK=-l${OMPI_LIBMPI_NAME}_mpifh], + [OMPI_FORTRAN_MPIFH_LINK=]) + AC_SUBST(OMPI_FORTRAN_MPIFH_LINK) + # This conditional is used to determine whether we compile the # various .f90 files that contain MPI_SIZEOF implementations. AM_CONDITIONAL([BUILD_FORTRAN_SIZEOF], @@ -728,10 +796,9 @@ end type test_mpi_handle], # This goes into mpifort-wrapper-data.txt AC_SUBST(OMPI_FORTRAN_USEMPIF08_LIB) - # These go into interfaces/mpi-f08-interfaces-[no]bind.h (and - # mpi-f*-interfaces*.h files) - AC_SUBST(OMPI_FORTRAN_F08_PREDECL) - AC_SUBST(OMPI_FORTRAN_F08_TYPE) + # These go into mod/mpi-f08-interfaces.h + AC_SUBST(OMPI_F08_IGNORE_TKR_PREDECL) + AC_SUBST(OMPI_F08_IGNORE_TKR_TYPE) AC_SUBST(OMPI_MPI_PREFIX) AC_SUBST(OMPI_MPI_BIND_PREFIX) @@ -813,6 +880,25 @@ end type test_mpi_handle], # For configure-fortran-output.h AC_SUBST(OMPI_FORTRAN_HAVE_BIND_C) + AM_CONDITIONAL(OMPI_FORTRAN_HAVE_TS, + [test $OMPI_FORTRAN_HAVE_TS -eq 1]) + AC_SUBST(OMPI_FORTRAN_HAVE_TS) + AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_TS], + [$OMPI_FORTRAN_HAVE_TS], + [For ompi/mpi/fortran/use-mpi-f08/base/ts.*: whether the compiler supports TS 29113 or not]) + + AS_IF([test $OMPI_FORTRAN_HAVE_TS -eq 1], + [OMPI_F08_IGNORE_TKR_TYPE="type(*), dimension(..)" + OMPI_F08_IGNORE_TKR_PREDECL="no attribute required for" + OMPI_F08_BINDINGS_EXTENSION="ts" + OMPI_F08_BINDINGS_TS_SUFFIX="ts"], + [OMPI_F08_IGNORE_TKR_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE + OMPI_F08_IGNORE_TKR_PREDECL=${OMPI_FORTRAN_IGNORE_TKR_PREDECL:1} + OMPI_F08_BINDINGS_EXTENSION="f" + OMPI_F08_BINDINGS_TS_SUFFIX=""]) + AC_SUBST(OMPI_F08_BINDINGS_EXTENSION) + AC_SUBST(OMPI_F08_BINDINGS_TS_SUFFIX) + # Somewhat redundant because ompi/Makefile.am won't traverse into # ompi/mpi/fortran/use-mpi-f08 if it's not to be built, but we # might as well have ompi/mpi/fortran/use-mpi-f08/Makefile.am be @@ -823,4 +909,9 @@ end type test_mpi_handle], AC_DEFINE_UNQUOTED(OMPI_BUILD_FORTRAN_BINDINGS, $OMPI_BUILD_FORTRAN_BINDINGS, [The level of fortran bindings to be built]) + + # This is an overall "are we building any Fortran MPI bindings" + # conditional + AM_CONDITIONAL([OMPI_BUILD_ANY_FORTRAN_BINDINGS], + [test $OMPI_BUILD_FORTRAN_BINDINGS -gt 0]) ]) diff --git a/config/ompi_setup_prrte.m4 b/config/ompi_setup_prrte.m4 index fe6eb17308a..28140bad066 100644 --- a/config/ompi_setup_prrte.m4 +++ b/config/ompi_setup_prrte.m4 @@ -16,10 +16,11 @@ dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. dnl Copyright (c) 2019-2020 Intel, Inc. All rights reserved. -dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. -dnl All Rights reserved. +dnl Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl Copyright (c) 2021 Nanook Consulting. All rights reserved. -dnl Copyright (c) 2021 IBM Corporation. All rights reserved. +dnl Copyright (c) 2021-2022 IBM Corporation. All rights reserved. +dnl Copyright (c) 2023-2024 Jeffrey M. Squyres. All rights reserved. +dnl Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -31,63 +32,61 @@ dnl Check for / configure PRRTE package. Prefer finding an external dnl PRRTE, build our internal one if required. If we can not find an dnl external PRRTE and the internal one fails to configure, abort. dnl -dnl This macro wil change the environment in the following way: -dnl -dnl * PRTE_PATH will be AC_SUBST'ed to the full path (minus the EXE -dnl extension) of the prte binary. +dnl This macro will change the environment in the following way: dnl dnl A Makefile conditional OMPI_WANT_PRRTE will be defined based on the dnl results of the build. AC_DEFUN([OMPI_SETUP_PRRTE],[ - OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy prrte_setup_success_var]) + AC_REQUIRE([AC_PROG_LN_S]) + +OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy target_rst_dir]) opal_show_subtitle "Configuring PRRTE" - # Don't use OPAL_3RDPARTY_WITH because it will not allow packages - # to be disabled - m4_ifdef([package_prrte], - [AC_ARG_WITH([prrte], - [AS_HELP_STRING([--with-prrte(=DIR)], - [Build PRTE support. DIR can take one of four values: "internal", "external", "no", or a valid directory name. "internal" forces Open MPI to use its internal copy of PRRTE. "external" forces Open MPI to use an external installation of PRRTE. Supplying a valid directory name also forces Open MPI to use an external installation of PRRTE, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. If no argument is specified, Open MPI will search default locations for PRRTE and fall back to an internal version if one is not found.])])], - [AC_ARG_WITH([prrte], - [AS_HELP_STRING([--with-prrte(=DIR)], - [Build PRRTE support. DIR can take one of three values: "external", "no", or a valid directory name. "external" forces Open MPI to use an external installation of PRRTE. Supplying a valid directory name also forces Open MPI to use an external installation of PRRTE, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. If no argument is specified, Open MPI will search default locations for PRRTE and disable creating mpirun symlinks if one is not found.])])]) + # We *must* have setup Sphinx before invoking this macro (i.e., it + # is a programming error -- not a run-time error -- if Sphinx was + # not previously setup). + OAC_ASSERT_BEFORE([OAC_SETUP_SPHINX], [OMPI_SETUP_PRRTE]) - m4_ifdef([package_prrte], - [OMPI_PRRTE_ADD_ARGS]) - - # clean up $with_prrte so that it contains only a path or empty - # string. To determine internal or external preferences, use - # $opal_prrte_mode. - AS_IF([test "$with_prrte" = "yes"], [with_prrte=]) - AS_CASE([$with_prrte], - ["internal"], [with_prrte="" - opal_prrte_mode="internal"], - ["external"], [with_prrte="" - opal_prrte_mode="external"], - [""], [opal_prrte_mode="unspecified"], - ["no"], [opal_prrte_mode="disabled"], - [opal_prrte_mode="external"]) - - echo "with_prrte: $with_prrte" - echo "opal_prrte_mode: $opal_prrte_mode" - - m4_ifdef([package_prrte], [], - [AS_IF([test "$opal_prrte_mode" = "internal"], - [AC_MSG_WARN([Invalid argument to --with-prrte: internal.]) - AC_MSG_ERROR([Cannot continue])])]) + # These are sym links to folders with PRRTE's RST files that we'll + # slurp into mpirun.1.rst. We'll remove these links (or even + # accidental full copies) now and replace them with new links to + # the PRRTE that we find, below. + target_rst_dir="$OMPI_TOP_BUILDDIR/docs" + rm -rf "$target_rst_dir/prrte-rst-content" + rm -rf "$target_rst_dir/schizo-ompi-rst-content" + + OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1]) + + AC_ARG_WITH([prrte-bindir], + [AS_HELP_STRING([--with-prrte-bindir=DIR], + [Search for PRRTE binaries in DIR. Defaults to PRRTE_DIR/bin if not specified])]) prrte_setup_internal_happy=0 - m4_ifdef([package_prrte], [ - # always configure the internal prrte, so that - # make dist always works. - AS_IF([test "$opal_prrte_mode" = "disabled"], [prrte_setup_success_var=0], [prrte_setup_success_var=1]) - _OMPI_SETUP_PRRTE_INTERNAL([prrte_setup_internal_happy=$prrte_setup_success_var])]) + m4_ifdef([package_prrte], + [OMPI_PRRTE_ADD_ARGS + AS_IF([test "$opal_prrte_mode" = "unspecified" -o "$opal_prrte_mode" = "internal"], + [# Run PRRTE's configure script unless the user + # explicitly asked us to use an external PMIX, so that + # "make dist" includes PRRTE in the dist tarball. This + # does mean that "make dist" will not work if Open MPI + # was configured to use an external PRRTE library, but + # we decided this was a reasonable tradeoff for not + # having to deal with PRRTE (or PMIx) potentially + # failing to configure in a situation where it isn't + # desired. + _OMPI_SETUP_PRRTE_INTERNAL([prrte_setup_internal_happy=1], + [prrte_setup_internal_happy=0])]) + + # if we have a pmix package and configure did not complete + # successfully (or wasn't started), then disable make dist. + AS_IF([test $prrte_setup_internal_happy != 1], + [OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PRRTE"])]) # unless internal specifically requested by the user, try to find # an external that works. prrte_setup_external_happy=0 - AS_IF([test "$opal_prrte_mode" != "internal" -o "$opal_prrte_mode" != "disabled"], + AS_IF([test "$opal_prrte_mode" != "internal" -a "$opal_prrte_mode" != "disabled"], [_OMPI_SETUP_PRRTE_EXTERNAL( [prrte_setup_external_happy=1 opal_prrte_mode="external"], @@ -98,7 +97,9 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[ # so try the internal version. AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "1"], [opal_prrte_mode="internal" - _OMPI_SETUP_PRRTE_INTERNAL_POST()]) + OMPI_USING_INTERNAL_PRRTE=1 + _OMPI_SETUP_PRRTE_INTERNAL_POST()], + [OMPI_USING_INTERNAL_PRRTE=0]) AS_IF([test "$opal_prrte_mode" != "disabled"], [AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "0"], @@ -106,8 +107,6 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[ OMPI_HAVE_PRRTE=1], [OMPI_HAVE_PRRTE=0]) - AC_SUBST([PRTE_PATH]) - AM_CONDITIONAL([OMPI_WANT_PRRTE], [test "$prrte_setup_internal_happy" = "1" -o "$prrte_setup_external_happy" = "1"]) @@ -115,17 +114,24 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[ [$OMPI_HAVE_PRRTE], [Whether or not PRRTE is available]) - OPAL_SUMMARY_ADD([[Miscellaneous]], [[prrte]], [prrte], [$opal_prrte_mode]) + AC_DEFINE_UNQUOTED([OMPI_USING_INTERNAL_PRRTE], + [$OMPI_USING_INTERNAL_PRRTE], + [Whether or not we are using the internal PRRTE]) + + AC_SUBST(OMPI_PRRTE_RST_CONTENT_DIR) + AC_SUBST(OMPI_SCHIZO_OMPI_RST_CONTENT_DIR) + AM_CONDITIONAL(OMPI_HAVE_PRRTE_RST, [test $OMPI_HAVE_PRRTE_RST -eq 1]) + + OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [], [$opal_prrte_mode]) OPAL_VAR_SCOPE_POP ]) - dnl _OMPI_SETUP_PRRTE_INTERNAL([action-if-success], [action-if-not-success]) dnl dnl Attempt to configure the built-in PRRTE. AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [ - OPAL_VAR_SCOPE_PUSH([internal_prrte_args internal_prrte_extra_libs internal_prrte_happy deprecated_prefix_by_default print_prrte_warning internal_prrte_CPPFLAGS]) + OPAL_VAR_SCOPE_PUSH([internal_prrte_args internal_prrte_happy deprecated_prefix_by_default print_prrte_warning internal_prrte_CPPFLAGS opal_prrte_CPPFLAGS_save]) # This is really a PRTE option that should not be in Open MPI, but # there is not a great way to support the orterun/mpirun checks @@ -159,7 +165,8 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [ internal_prrte_CPPFLAGS= internal_prrte_args="--with-proxy-version-string=$OPAL_VERSION --with-proxy-package-name=\"Open MPI\" --with-proxy-bugreport=\"https://www.open-mpi.org/community/help/\"" - internal_prrte_libs= + # PRRTE sets -Werror on devel builds so avoid buid breaks caused by 3rd-party codes + internal_prrte_args="$internal_prrte_args --disable-devel-check" # Set --enable-prte-prefix-by-default to the deprecated options, # if they were specified. Otherwise, set it to enabled if the @@ -171,19 +178,22 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [ [internal_prrte_args="$internal_prrte_args --enable-prte-prefix-by-default"]) AS_IF([test "$opal_libevent_mode" = "internal"], - [internal_prrte_args="$internal_prrte_args --with-libevent-header=$opal_libevent_header" - internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_libevent_CPPFLAGS" - internal_prrte_libs="$internal_prrte_libs $opal_libevent_LIBS"]) + [internal_prrte_args="$internal_prrte_args --with-libevent --disable-libevent-lib-checks" + internal_prrte_args="$internal_prrte_args --with-libevent-extra-libs=\"$opal_libevent_BUILD_LIBS\"" + internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_libevent_BUILD_CPPFLAGS"]) AS_IF([test "$opal_hwloc_mode" = "internal"], - [internal_prrte_args="$internal_prrte_args --with-hwloc-header=$opal_hwloc_header" - internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_hwloc_CPPFLAGS" - internal_prrte_libs="$internal_prrte_libs $opal_hwloc_LIBS"]) + [internal_prrte_args="$internal_prrte_args --disable-hwloc-lib-checks" + internal_prrte_args="$internal_prrte_args --with-hwloc-extra-libs=\"$opal_hwloc_BUILD_LIBS\"" + internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_hwloc_BUILD_CPPFLAGS"]) AS_IF([test "$opal_pmix_mode" = "internal"], - [internal_prrte_args="$internal_prrte_args --with-pmix-header=$opal_pmix_header" - internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_pmix_CPPFLAGS" - internal_prrte_libs="$internal_prrte_libs $opal_pmix_LIBS"]) + [internal_prrte_args="$internal_prrte_args --disable-pmix-lib-checks" + internal_prrte_args="$internal_prrte_args --with-pmix-extra-libs=\"$opal_pmix_BUILD_LIBS\"" + internal_prrte_CPPFLAGS="$internal_prrte_CPPFLAGS $opal_pmix_BUILD_CPPFLAGS"]) + + opal_prrte_CPPFLAGS_save="${CPPFLAGS}" + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}]) AC_MSG_CHECKING([if PMIx version is 4.0.0 or greater]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], @@ -202,8 +212,8 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [ AC_MSG_WARN([--without-prrte option.]) AC_MSG_ERROR([Cannot continue])]) - # add the extra libs - internal_prrte_args="$internal_prrte_args --with-prte-extra-lib=\"$internal_prrte_libs\" --with-prte-extra-ltlib=\"$internal_prrte_libs\"" + CPPFLAGS="${opal_prrte_CPPFLAGS_save}" + AS_IF([test "$with_ft" != "no"], [internal_prrte_args="--enable-prte-ft $internal_prrte_args"], []) @@ -231,8 +241,17 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [ AS_IF([test "$internal_prrte_happy" = "no" -a "$enable_internal_rte" != "no"], [AC_MSG_ERROR([PRRTE configuration failed. Cannot continue.])]) + OMPI_HAVE_PRRTE_RST=0 AS_IF([test "$internal_prrte_happy" = "yes"], - [$1], [$2]) + [AC_MSG_CHECKING([for internal PRRTE RST files]) + AS_IF([test -n "$SPHINX_BUILD"], + [OMPI_HAVE_PRRTE_RST=1 + OMPI_PRRTE_RST_CONTENT_DIR="$OMPI_TOP_SRCDIR/3rd-party/prrte/src/docs/prrte-rst-content" + OMPI_SCHIZO_OMPI_RST_CONTENT_DIR="$OMPI_TOP_SRCDIR/3rd-party/prrte/src/mca/schizo/ompi" + AC_MSG_RESULT([found])], + [AC_MSG_RESULT([not found])]) + $1], + [$2]) OPAL_VAR_SCOPE_POP ]) @@ -245,55 +264,78 @@ dnl caller configured libprrte configure, and the configure script dnl succeeded. AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL_POST], [ OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS prrte" - - PRTE_PATH="prte" ]) dnl _OMPI_SETUP_PRRTE_EXTERNAL([action if success], [action if not success]) dnl -dnl Try to find an external prrte with sufficient version. Since we -dnl don't link against prrte, only output environment variable is -dnl PRTE_PATH. +dnl Try to find an external prrte with sufficient version. AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [ - OPAL_VAR_SCOPE_PUSH([setup_prrte_external_happy opal_prrte_CPPFLAGS_save]) + OPAL_VAR_SCOPE_PUSH([ompi_prte_min_version ompi_prte_min_num_version setup_prrte_external_happy opal_prrte_CPPFLAGS_save]) opal_prrte_CPPFLAGS_save=$CPPFLAGS - _OPAL_CHECK_PACKAGE_HEADER([opal_prrte], [prte.h], [$with_prrte], - [setup_prrte_external_happy=yes], - [setup_prrte_external_happy=no]) - - CPPFLAGS="$opal_prrte_CPPFLAGS_save $opal_prrte_CPPFLAGS" - - AC_MSG_CHECKING([if external PRRTE version is 2.0.0 or greater]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ -#if PRTE_NUMERIC_VERSION < 0x00020000 -#error "prrte API version is less than 2.0.0" + AS_IF([test -n "${with_prrte}" -a "${with_prrte}" != "yes" -a "${with_prrte}" != "no"], + [OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], ["-I${with_prrte}/include"])]) + + AC_CHECK_HEADER([prte.h], [setup_prrte_external_happy=yes], + [setup_prrte_external_happy=no]) + + ompi_prte_min_version=OMPI_PRTE_MIN_VERSION + ompi_prte_min_num_version=OMPI_PRTE_NUMERIC_MIN_VERSION + AS_IF([test "${setup_prrte_external_happy}" = "yes"], + [AC_CACHE_CHECK([if external PRRTE version is OMPI_PRTE_MIN_VERSION or greater], + [ompi_setup_prrte_cv_version_happy], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], [[ +#if PRTE_NUMERIC_VERSION < $ompi_prte_min_num_version +#error "prrte API version is less than $ompi_prte_min_version" #endif ]])], - [AC_MSG_RESULT([yes]) - setup_prrte_external_happy=yes], - [AC_MSG_RESULT([no]) - setup_prrte_external_happy=no]) + [ompi_setup_prrte_cv_version_happy="yes"], + [ompi_setup_prrte_cv_version_happy="no"])]) + AS_IF([test "${ompi_setup_prrte_cv_version_happy}" = "no"], + [setup_prrte_external_happy="no"])]) CPPFLAGS="$opal_prrte_CPPFLAGS_save" + # If an external build and the user told us where to find PRRTE, + # find prterun and save that path. + prterun_path= AS_IF([test "$setup_prrte_external_happy" = "yes"], - [AS_IF([test -n "$with_prrte"], - [PRTE_PATH="${with_prrte}/bin/prte" - AS_IF([test ! -r ${PRTE_PATH}], [AC_MSG_ERROR([Could not find prte binary at $PRTE_PATH])])], - [PRTE_PATH="" - OPAL_WHICH([prte], [PRTE_PATH]) - AS_IF([tets -z "$PRTE_PATH"], - [AC_MSG_WARN([Could not find prte in PATH]) - setup_prrte_external_happy=no])])]) - + [AS_IF([test "${with_prrte_bindir}" = "yes" -o "${with_prrte_bindir}" = "no"], + [AC_MSG_ERROR(["yes" and "no" are not valid arguments for --with-prrte-bindir])]) + AS_IF([test -z "${with_prrte_bindir}" -a -n "${with_prrte}"], + [with_prrte_bindir="${with_prrte}/bin"]) + AS_IF([test -n "${with_prrte_bindir}"], + [AS_IF([test -x ${with_prrte_bindir}/prterun], + [prterun_path="${with_prrte_bindir}/prterun"], + [AC_MSG_ERROR([Could not find executable prterun: ${with_prrte_bindir}/prterun])])])]) + AS_IF([test -n "${prterun_path}"], + [AC_DEFINE_UNQUOTED([OMPI_PRTERUN_PATH], ["${prterun_path}"], [Path to prterun])]) + + OMPI_HAVE_PRRTE_RST=0 AS_IF([test "$setup_prrte_external_happy" = "yes"], - [$1], [$2]) + [ # Determine if this external PRRTE has installed the RST + # directories that we care about + + AC_MSG_CHECKING([for external PRRTE RST files]) + prrte_install_dir=${with_prrte}/share/prte/rst + AS_IF([test -n "$SPHINX_BUILD"], + [AS_IF([test -d "$prrte_install_dir/prrte-rst-content" && \ + test -d "$prrte_install_dir/schizo-ompi-rst-content"], + [OMPI_HAVE_PRRTE_RST=1 + OMPI_PRRTE_RST_CONTENT_DIR="$prrte_install_dir/prrte-rst-content" + OMPI_SCHIZO_OMPI_RST_CONTENT_DIR="$prrte_install_dir/schizo-ompi-rst-content" + AC_MSG_RESULT([found]) + ], + [ # This version of PRRTE doesn't have installed RST + # files. + AC_MSG_RESULT([not found]) + ]) + ]) + $1], + [$2]) OPAL_VAR_SCOPE_POP ]) - - diff --git a/config/opal_case_sensitive_fs_setup.m4 b/config/opal_case_sensitive_fs_setup.m4 index c901e3ddb9d..7267c8616db 100644 --- a/config/opal_case_sensitive_fs_setup.m4 +++ b/config/opal_case_sensitive_fs_setup.m4 @@ -10,6 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. +dnl Copyright (c) 2022 Cisco Systems, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -63,6 +64,8 @@ AC_ARG_WITH([cs_fs], [AS_HELP_STRING([--with-cs-fs], [Destination FS is case sensitive (default: set to value of the build FS's case sensitivity)])]) +dnl Stupid emacs syntax highlighting: ' + if test "$with_cs_fs" = "yes"; then OPAL_WANT_CS_FS=1 elif test -z "$with_cs_fs"; then @@ -78,26 +81,12 @@ else fi AM_CONDITIONAL(CASE_SENSITIVE_FS, test "$OPAL_WANT_CS_FS" = "1") - -if test "$OPAL_WANT_CS_FS" = "0"; then - cat < /* Check for the longest available __attribute__ (since gcc-2.3) */ struct foo { @@ -169,13 +169,13 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [ int x[2] __attribute__ ((__packed__)); }; ], - [], + [])], [opal_cv___attribute__=1], [opal_cv___attribute__=0], ) if test "$opal_cv___attribute__" = "1" ; then - AC_TRY_COMPILE( + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include /* Check for the longest available __attribute__ (since gcc-2.3) */ struct foo { @@ -183,7 +183,7 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [ int x[2] __attribute__ ((__packed__)); }; ], - [], + [])], [opal_cv___attribute__=1], [opal_cv___attribute__=0], ) @@ -559,6 +559,14 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [ [], []) + _OPAL_CHECK_SPECIFIC_ATTRIBUTE([constructor], + [ + void foo(void) __attribute__ ((__constructor__)); + void foo(void) { return ; } + ], + [], + []) + _OPAL_CHECK_SPECIFIC_ATTRIBUTE([destructor], [ void foo(void) __attribute__ ((__destructor__)); @@ -631,6 +639,8 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [ [Whether your compiler has __attribute__ warn unused result or not]) AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_WEAK_ALIAS, [$opal_cv___attribute__weak_alias], [Whether your compiler has __attribute__ weak alias or not]) + AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_CONSTRUCTOR, [$opal_cv___attribute__constructor], + [Whether your compiler has __attribute__ constructor or not]) AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_DESTRUCTOR, [$opal_cv___attribute__destructor], [Whether your compiler has __attribute__ destructor or not]) AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_OPTNONE, [$opal_cv___attribute__optnone], diff --git a/config/opal_check_cflags.m4 b/config/opal_check_cflags.m4 index 59fc0ce1ace..fd04f12ab45 100644 --- a/config/opal_check_cflags.m4 +++ b/config/opal_check_cflags.m4 @@ -1,6 +1,7 @@ dnl -*- shell-script -*- dnl dnl Copyright (c) 2021 IBM Corporation. All rights reserved. +dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved. dnl dnl $COPYRIGHT$ dnl @@ -22,16 +23,17 @@ AC_DEFUN([_OPAL_CFLAGS_FAIL_SEARCH],[ AC_DEFUN([_OPAL_CHECK_SPECIFIC_CFLAGS], [ AC_MSG_CHECKING(if $CC supports ([$1])) CFLAGS_orig=$CFLAGS - CFLAGS="$CFLAGS $1" + OPAL_FLAGS_APPEND_UNIQ([CFLAGS], ["$1"]) AC_CACHE_VAL(opal_cv_cc_[$2], [ - AC_TRY_COMPILE([], [$3], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [$3])], [ opal_cv_cc_[$2]=1 - _OPAL_CFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown", [$2]) + _OPAL_CFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown"], [$2]) ], + [ opal_cv_cc_[$2]=1 - _OPAL_CFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error", [$2]) - )]) + _OPAL_CFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error"], [$2]) + ])]) if test "$opal_cv_cc_[$2]" = "0" ; then CFLAGS="$CFLAGS_orig" AC_MSG_RESULT([no]) @@ -53,16 +55,17 @@ AC_DEFUN([_OPAL_CXXFLAGS_FAIL_SEARCH],[ AC_DEFUN([_OPAL_CHECK_SPECIFIC_CXXFLAGS], [ AC_MSG_CHECKING(if $CXX supports ([$1])) CXXFLAGS_orig=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $1" + OPAL_FLAGS_APPEND_UNIQ([CXXFLAGS], ["$1"]) AC_CACHE_VAL(opal_cv_cxx_[$2], [ - AC_TRY_COMPILE([], [$3], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [$3])], [ opal_cv_cxx_[$2]=1 - _OPAL_CXXFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown", [$2]) + _OPAL_CXXFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown"], [$2]) ], + [ opal_cv_cxx_[$2]=1 - _OPAL_CXXFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error", [$2]) - )]) + _OPAL_CXXFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error"], [$2]) + ])]) if test "$opal_cv_cxx_[$2]" = "0" ; then CXXFLAGS="$CXXFLAGS_orig" AC_MSG_RESULT([no]) diff --git a/config/opal_check_cma.m4 b/config/opal_check_cma.m4 index cd43d232ab4..ceaf6d615fd 100644 --- a/config/opal_check_cma.m4 +++ b/config/opal_check_cma.m4 @@ -4,9 +4,10 @@ # of Tennessee Research Foundation. All rights # reserved. # Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2010-2012 IBM Corporation. All rights reserved. +# Copyright (c) 2010-2022 IBM Corporation. All rights reserved. # Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights # reserved. +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -44,8 +45,8 @@ AC_DEFUN([OPAL_CHECK_CMA_BACKEND], [ OPAL_VAR_SCOPE_PUSH([opal_check_cma_need_defs opal_check_cma_kernel_version opal_check_cma_CFLAGS opal_check_cma_msg]) - # Some systems have process_cm_readv() in libc, which means CMA is - # supported. Other systems do not have process_cm_readv() in + # Some systems have process_vm_readv() in libc, which means CMA is + # supported. Other systems do not have process_vm_readv() in # libc, but have support for it in the kernel if we invoke it # directly. Check for both. AC_CHECK_HEADERS([sys/prctl.h]) @@ -114,23 +115,42 @@ static void do_check (pid_t pid, int *in, int *out) /* all good */ return 0; ]])], - [AC_MSG_RESULT([yes]) - opal_check_cma_happy=1], - [AC_MSG_RESULT([no]) - opal_check_cma_happy=0], - [AC_MSG_RESULT([no (cross-compiling)]) - opal_check_cma_happy=0]) - CFLAGS=$opal_check_cma_CFLAGS + [AC_MSG_RESULT([yes]) + opal_check_cma_happy=1], + [AC_MSG_RESULT([no]) + opal_check_cma_happy=0], + [AC_MSG_RESULT([no (cross-compiling)]) + opal_check_cma_happy=0]) + CFLAGS=$opal_check_cma_CFLAGS else # If we didn't need the defs, then we have process_vm_readv(), # and CMA is happy. - opal_check_cma_happy=1 + opal_check_cma_happy=1 fi OPAL_VAR_SCOPE_POP + # Testing CAP_SYS_PTRACE between two processes with kcmp + AC_CHECK_HEADERS([linux/kcmp.h]) + AC_CHECK_HEADERS([sys/syscall.h]) + AC_MSG_CHECKING([if kcmp works]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include + ]], [[ +syscall(SYS_kcmp, 123, 456, KCMP_VM, 0, 0); + ]])], + [AC_MSG_RESULT([yes]) + opal_check_cma_kcmp_happy=1], + [AC_MSG_RESULT([no]) + opal_check_cma_kcmp_happy=0]) + AC_DEFINE_UNQUOTED([OPAL_CMA_KCMP_AVAIL], + [$opal_check_cma_kcmp_happy], + [If kcmp is available]) + AS_IF([test $opal_check_cma_happy -eq 1], [opal_check_cma_msg=yes], [opal_check_cma_msg=no]) - OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/Linux CMA]],[$1],[$opal_check_cma_msg]) + OPAL_SUMMARY_ADD([Transports], [Shared memory/Linux CMA], [], [$opal_check_cma_msg]) ]) diff --git a/config/opal_check_compiler_version.m4 b/config/opal_check_compiler_version.m4 index da8321cdf1e..75ee688f2ad 100644 --- a/config/opal_check_compiler_version.m4 +++ b/config/opal_check_compiler_version.m4 @@ -1,6 +1,9 @@ dnl -*- shell-script -*- dnl dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. +dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights +dnl reserved. dnl dnl $COPYRIGHT$ dnl @@ -19,105 +22,35 @@ dnl AC_DEFUN([OPAL_CHECK_COMPILER_VERSION_ID], [ OPAL_CHECK_COMPILER(FAMILYID) - OPAL_CHECK_COMPILER_STRINGIFY(FAMILYNAME) OPAL_CHECK_COMPILER(VERSION) - OPAL_CHECK_COMPILER_STRING(VERSION_STR) ])dnl AC_DEFUN([OPAL_CHECK_COMPILER], [ - lower=m4_tolower($1) - AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1], + OAC_ASSERT_LITERAL([$1], [1])dnl + lower=m4_tolower([$1]) + AC_CACHE_CHECK([for compiler $lower], [opal_cv_compiler_$1], [ CPPFLAGS_orig=$CPPFLAGS - CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include/opal $CPPFLAGS" - AC_TRY_RUN([ + CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include $CPPFLAGS" + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include -#include "opal_portable_platform.h" - -int main (int argc, char * argv[]) -{ +#include "opal/opal_portable_platform.h" +]],[[ FILE * f; f=fopen("conftestval", "w"); if (!f) exit(1); fprintf (f, "%d", PLATFORM_COMPILER_$1); - return 0; -} - ], [ - eval opal_cv_compiler_$1=`cat conftestval`; - ], [ - eval opal_cv_compiler_$1=0 - ], [ - eval opal_cv_compiler_$1=0 - ]) - CPPFLAGS=$CPPFLAGS_orig - ]) - AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1], - [The compiler $lower which OMPI was built with]) -])dnl - -AC_DEFUN([OPAL_CHECK_COMPILER_STRING], [ - lower=m4_tolower($1) - AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1], - [ - CPPFLAGS_orig=$CPPFLAGS - CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include/opal $CPPFLAGS" - AC_TRY_RUN([ -#include -#include -#include "opal_portable_platform.h" - -int main (int argc, char * argv[]) -{ - FILE * f; - f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf (f, "%s", PLATFORM_COMPILER_$1); - return 0; -} - ], [ - eval opal_cv_compiler_$1=`cat conftestval`; - ], [ - eval opal_cv_compiler_$1=UNKNOWN - ], [ - eval opal_cv_compiler_$1=UNKNOWN - ]) - CPPFLAGS=$CPPFLAGS_orig - ]) - AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1], - [The compiler $lower which OMPI was built with]) -])dnl - - -AC_DEFUN([OPAL_CHECK_COMPILER_STRINGIFY], [ - lower=m4_tolower($1) - AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1], - [ - CPPFLAGS_orig=$CPPFLAGS - CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include/opal $CPPFLAGS" - AC_TRY_RUN([ -#include -#include -#include "opal_portable_platform.h" - -int main (int argc, char * argv[]) -{ - FILE * f; - f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1)); - return 0; -} - ], [ - eval opal_cv_compiler_$1=`cat conftestval`; + ]])], [ + opal_cv_compiler_$1=`cat conftestval` ], [ - eval opal_cv_compiler_$1=UNKNOWN + opal_cv_compiler_$1=0 ], [ - eval opal_cv_compiler_$1=UNKNOWN + opal_cv_compiler_$1=0 ]) CPPFLAGS=$CPPFLAGS_orig ]) - AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1], + AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], [$opal_cv_compiler_$1], [The compiler $lower which OMPI was built with]) ])dnl diff --git a/config/opal_check_cray_pmi.m4 b/config/opal_check_cray_pmi.m4 deleted file mode 100644 index 4a0f1e0116f..00000000000 --- a/config/opal_check_cray_pmi.m4 +++ /dev/null @@ -1,107 +0,0 @@ -dnl -*- shell-script ; indent-tabs-mode:nil -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2014-2015 Intel, Inc. All rights reserved. -dnl Copyright (c) 2014-2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([OPAL_CHECK_CRAY_PMI_EXPLICIT],[ - - opal_cray_pmi_lib_good=0 - opal_cray_pmi_include_good=0 - - AC_MSG_CHECKING([Checking for Cray PMI with explicit path $with_cray_pmi]) - AS_IF([test -d "$with_cray_pmi/lib64"], - [opal_cray_pmi_lib_good=1], - [opal_cray_pmi_lib_good=0 - AC_MSG_WARN([No libpmi in path specified by $with_cray_pmi])]) - - AS_IF([test -f "$with_cray_pmi/include/pmi.h"], - [opal_cray_pmi_include_good=1], - [opal_cray_pmi_include_good=0 - AC_MSG_WARN([No pmi.h in path specified by $with_cray_pmi])]) - - AS_IF([test "$opal_cray_pmi_lib_good" -eq 1 && test "$opal_cray_pmi_include_good" -eq 1], - [CRAY_PMI_LDFLAGS="-L$with_cray_pmi/lib64 -L/usr/lib/alps" - CRAY_PMI_LIBS="-L$with_cray_pmi/lib64 -lpmi" - CRAY_PMI_CFLAGS="-I $with_cray_pmi/include" - $1], - [$2]) - -# -# this logic assumes knowledge about all the dependencies of the Cray PMI library, -# something that Cray doesn't generally document -# - AS_IF([test "$enable_static" = "yes"], - [AS_IF([test -d /usr/lib/alps], - [AC_MSG_RESULT([Detected presence of /usr/lib/alps]) - CRAY_PMI_LDFLAGS="$CRAY_PMI_LDFLAGS -L/usr/lib/alps -lalpslli -lalpsutil" - CRAY_PMI_LIBS="$CRAY_PMI_LIBS -L/usr/lib/alps -lalpslli -lalpsutil"], - [AS_IF([test -d /opt/cray/xe-sysroot/default/usr/lib/alps], - [AC_MSG_RESULT([Detected presence of /opt/cray/xe-sysroot/default/usr/lib/alps]) - CRAY_PMI_LDFLAGS="$CRAY_PMI_LDFLAGS -L/opt/cray/xe-sysroot/default/usr/lib/alps -lalpslli -lalpsutil" - CRAY_PMI_LIBS="$CRAY_PMI_LIBS -L/opt/cray/xe-sysroot/default/usr/lib/alps -lalpslli -lalpsutil"], - [AC_MSG_ERROR([Requested enabling static linking but unable to local libalpslli and libalpsutil])]) - ]) - ]) -]) - -# -# special check for cray pmi, uses macro(s) from pkg.m4 -# -# OPAL_CHECK_CRAY_PMI(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([OPAL_CHECK_CRAY_PMI],[ - AC_ARG_WITH([cray_pmi], - [AS_HELP_STRING([--with-cray-pmi(=DIR)], - [Build Cray PMI support, optionally adding DIR to the search path (default: auto)])], - [], with_cray_pmi=auto) - AC_MSG_CHECKING([for Cray PMI support]) - AS_IF([test "$with_cray_pmi" = "no"], - [AC_MSG_RESULT([no]) - $3], - [AS_IF([test "$with_cray_pmi" = "auto" || test "$with_cray_pmi" = "yes"], - [PKG_CHECK_MODULES_STATIC([CRAY_PMI], [cray-pmi], - [opal_check_cray_pmi_happy="yes"], - [opal_check_cray_pmi_happy="no"] - [AS_IF([test "$with_cray_pmi" = "yes"], - [AC_MSG_WARN([Cray PMI support requested but pkg-config failed.]) - AC_MSG_WARN([Need to explicitly indicate cray pmi directory]) - AC_MSG_WARN([on the configure line using --with-cray-pmi option.]) - AC_MSG_ERROR([Aborting])],[])] - )], - [OPAL_CHECK_CRAY_PMI_EXPLICIT([opal_check_cray_pmi_happy="yes"], - [opal_check_cray_pmi_happy="no"]) - AC_MSG_WARN([opal_chack_cray_pmi_happy = $opal_check_cray_pmi_happy])]) - ]) - - AS_IF([test "$opal_check_cray_pmi_happy" = "yes" && test "$enable_static" = "yes"], - [CRAY_PMI_LIBS = $CRAY_PMI_STATIC_LIBS],[]) - - AS_IF([test "$opal_check_cray_pmi_happy" = "yes"], - [$1_LDFLAGS="$CRAY_PMI_LIBS" - $1_CPPFLAGS="$CRAY_PMI_CFLAGS" - $1_LIBS="$CRAY_PMI_LIBS" - $2], [$3]) -]) - - - diff --git a/config/opal_check_cuda.m4 b/config/opal_check_cuda.m4 index dcfe9d117c7..ebd70d59e32 100644 --- a/config/opal_check_cuda.m4 +++ b/config/opal_check_cuda.m4 @@ -1,5 +1,6 @@ -dnl -*- shell-script -*- +dnl -*- autoconf -*- dnl +dnl Copyright (c) 2024 NVIDIA Corporation. All rights reserved. dnl Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana dnl University Research and Technology dnl Corporation. All rights reserved. @@ -19,7 +20,7 @@ dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved. dnl Copyright (c) 2011-2015 NVIDIA Corporation. All rights reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl +dnl Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -27,7 +28,22 @@ dnl dnl $HEADER$ dnl + +# OPAL_CHECK_CUDA(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +# check if CUDA support can be found. sets prefix_{CPPFLAGS, +# LDFLAGS, LIBS} as needed and runs action-if-found if there is +# support, otherwise executes action-if-not-found + +# +# Check for CUDA support +# AC_DEFUN([OPAL_CHECK_CUDA],[ +OPAL_VAR_SCOPE_PUSH([cuda_save_CPPFLAGS cuda_save_LDFLAGS cuda_save_LIBS]) + +cuda_save_CPPFLAGS="$CPPFLAGS" +cuda_save_LDFLAGS="$LDFLAGS" +cuda_save_LIBS="$LIBS" # # Check to see if user wants CUDA support # @@ -36,6 +52,18 @@ AC_ARG_WITH([cuda], [Build cuda support, optionally adding DIR/include])]) AC_MSG_CHECKING([if --with-cuda is set]) +# Search for libcuda.so in $with_cuda if the user didn't pass --with-cuda-libdir +# Otherwise check for cuda in the default path, /usr/local/cuda. If the default +# path doesn't exist, set with_cuda_libdir to empty. +AC_ARG_WITH([cuda-libdir], + [AS_HELP_STRING([--with-cuda-libdir=DIR], + [Search for CUDA libraries in DIR])], + [], + [AS_IF([test -d "$with_cuda"], + [with_cuda_libdir=$(dirname $(find -H $with_cuda -name libcuda.so 2> /dev/null) 2> /dev/null)], + [with_cuda_libdir=$(dirname $(find -H /usr/local/cuda -name libcuda.so 2> /dev/null) 2> /dev/null)]) + ]) + # Note that CUDA support is off by default. To turn it on, the user has to # request it. The user can just ask for --with-cuda and it that case we # look for the cuda.h file in /usr/local/cuda. Otherwise, they can give @@ -72,12 +100,15 @@ AS_IF([test "$with_cuda" = "no" || test "x$with_cuda" = "x"], opal_cuda_incdir="$with_cuda/include" AC_MSG_RESULT([found ($opal_cuda_incdir/cuda.h)])])])])]) -dnl We cannot have CUDA support without dlopen support. HOWEVER, at -dnl this point in configure, we can't know whether the DL framework -dnl has been configured or not yet (it likely hasn't, since CUDA is a -dnl common framework, and likely configured first). So we have to -dnl defer this check until later (see the OPAL_CHECK_CUDA_AFTER_OPAL_DL m4 -dnl macro, below). :-( +AS_IF([test "$opal_check_cuda_happy" = "yes"], + [OAC_CHECK_PACKAGE([cuda], + [$1], + [cuda.h], + [cuda], + [cuMemFree], + [opal_check_cuda_happy="yes"], + [opal_check_cuda_happy="no"])], + []) # We require CUDA IPC support which started in CUDA 4.1. Error # out if the support is not there. @@ -88,9 +119,15 @@ AS_IF([test "$opal_check_cuda_happy" = "yes"], [#include <$opal_cuda_incdir/cuda.h>])], []) +# If we have CUDA support, check to see if we have support for cuMemCreate memory on host NUMA. +AS_IF([test "$opal_check_cuda_happy"="yes"], + [AC_CHECK_DECL([CU_MEM_LOCATION_TYPE_HOST_NUMA], [CUDA_VMM_SUPPORT=1], [CUDA_VMM_SUPPORT=0], + [#include <$opal_cuda_incdir/cuda.h>])], + []) + # If we have CUDA support, check to see if we have support for SYNC_MEMOPS # which was first introduced in CUDA 6.0. -AS_IF([test "$opal_check_cuda_happy"="yes"], +AS_IF([test "$opal_check_cuda_happy" = "yes"], [AC_CHECK_DECL([CU_POINTER_ATTRIBUTE_SYNC_MEMOPS], [CUDA_SYNC_MEMOPS=1], [CUDA_SYNC_MEMOPS=0], [#include <$opal_cuda_incdir/cuda.h>])], []) @@ -108,9 +145,9 @@ AC_COMPILE_IFELSE( # If we have CUDA support, check to see if we have support for cuPointerGetAttributes # which was first introduced in CUDA 7.0. -AS_IF([test "$opal_check_cuda_happy"="yes"], - AC_CHECK_DECL([cuPointerGetAttributes], [CUDA_GET_ATTRIBUTES=1], [CUDA_GET_ATTRIBUTES=0], - [#include <$opal_cuda_incdir/cuda.h>]), +AS_IF([test "$opal_check_cuda_happy" = "yes"], + [AC_CHECK_DECL([cuPointerGetAttributes], [CUDA_GET_ATTRIBUTES=1], [CUDA_GET_ATTRIBUTES=0], + [#include <$opal_cuda_incdir/cuda.h>])], []) AC_MSG_CHECKING([if have cuda support]) @@ -124,12 +161,16 @@ else CUDA_SUPPORT=0 fi -OPAL_SUMMARY_ADD([[Miscellaneous]],[[CUDA support]],[opal_cuda], [$opal_check_cuda_happy]) +OPAL_SUMMARY_ADD([Accelerators], [CUDA support], [], [$opal_check_cuda_happy]) AM_CONDITIONAL([OPAL_cuda_support], [test "x$CUDA_SUPPORT" = "x1"]) AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT],$CUDA_SUPPORT, [Whether we want cuda device pointer support]) +AM_CONDITIONAL([OPAL_cuda_vmm_support], [test "x$CUDA_VMM_SUPPORT" = "x1"]) +AC_DEFINE_UNQUOTED([OPAL_CUDA_VMM_SUPPORT],$CUDA_VMM_SUPPORT, + [Whether we have CU_MEM_LOCATION_TYPE_HOST_NUMA support available]) + AM_CONDITIONAL([OPAL_cuda_sync_memops], [test "x$CUDA_SYNC_MEMOPS" = "x1"]) AC_DEFINE_UNQUOTED([OPAL_CUDA_SYNC_MEMOPS],$CUDA_SYNC_MEMOPS, [Whether we have CUDA CU_POINTER_ATTRIBUTE_SYNC_MEMOPS support available]) @@ -144,22 +185,9 @@ AM_CONDITIONAL([OPAL_cuda_gdr_support], [test "x$CUDA_VERSION_60_OR_GREATER" = " AC_DEFINE_UNQUOTED([OPAL_CUDA_GDR_SUPPORT],$CUDA_VERSION_60_OR_GREATER, [Whether we have CUDA GDR support available]) +CPPFLAGS=${cuda_save_CPPFLAGS} +LDFLAGS=${cuda_save_LDFLAGS} +LIBS=${cuda_save_LIBS} +OPAL_VAR_SCOPE_POP ]) -dnl -dnl CUDA support requires DL support (it dynamically opens the CUDA -dnl library at run time). But we do not check for OPAL DL support -dnl until lafter the initial OPAL_CHECK_CUDA is called. So put the -dnl CUDA+DL check in a separate macro that can be called after the DL MCA -dnl framework checks in the top-level configure.ac. -dnl -AC_DEFUN([OPAL_CHECK_CUDA_AFTER_OPAL_DL],[ - - # We cannot have CUDA support without OPAL DL support. Error out - # if the user wants CUDA but we do not have OPAL DL support. - AS_IF([test $OPAL_HAVE_DL_SUPPORT -eq 0 && \ - test "$opal_check_cuda_happy" = "yes"], - [AC_MSG_WARN([--with-cuda was specified, but dlopen support is disabled.]) - AC_MSG_WARN([You must reconfigure Open MPI with dlopen ("dl") support.]) - AC_MSG_ERROR([Cannot continue.])]) -]) diff --git a/config/opal_check_icc.m4 b/config/opal_check_icc.m4 deleted file mode 100644 index 9c60fa29701..00000000000 --- a/config/opal_check_icc.m4 +++ /dev/null @@ -1,60 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2014 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([OPAL_CHECK_ICC_VARARGS],[ -dnl -dnl On EM64T, icc-8.1 before version 8.1.027 segfaulted, since -dnl va_start was miscompiled... -dnl -AC_MSG_CHECKING([whether icc-8.1 for EM64T works with variable arguments]) -AC_TRY_RUN([ -#include -#include -#include - -void func (int c, char * f, ...) -{ - va_list arglist; - va_start (arglist, f); - /* vprintf (f, arglist); */ - va_end (arglist); -} - -int main () -{ - FILE *f; - func (4711, "Help %d [%s]\n", 10, "ten"); - f=fopen ("conftestval", "w"); - if (!f) exit (1); - return 0; -} - -],[opal_ac_icc_varargs=`test -f conftestval`],[opal_ac_icc_varargs=1],[opal_ac_icc_varargs=1]) - -if test "$opal_ac_icc_varargs" = "1"; then - AC_MSG_WARN([*** Problem running configure test!]) - AC_MSG_WARN([*** Your icc-8.1 compiler seems to miscompile va_start!]) - AC_MSG_WARN([*** Please upgrade compiler to at least version 8.1.027]) - AC_MSG_ERROR([*** Cannot continue.]) -fi - -AC_MSG_RESULT([yes]) - -rm -rf conftest*])dnl diff --git a/config/opal_check_ident.m4 b/config/opal_check_ident.m4 deleted file mode 100644 index 7f79b68648e..00000000000 --- a/config/opal_check_ident.m4 +++ /dev/null @@ -1,101 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl -dnl defines: -dnl OPAL_$1_USE_PRAGMA_IDENT -dnl OPAL_$1_USE_IDENT -dnl OPAL_$1_USE_CONST_CHAR_IDENT -dnl - -# OPAL_CHECK_IDENT(compiler-env, compiler-flags, -# file-suffix, lang) Try to compile a source file containing -# a #pragma ident, and determine whether the ident was -# inserted into the resulting object file -# ----------------------------------------------------------- -AC_DEFUN([OPAL_CHECK_IDENT], [ - AC_MSG_CHECKING([for $4 ident string support]) - - opal_pragma_ident_happy=0 - opal_ident_happy=0 - opal_static_const_char_happy=0 - _OPAL_CHECK_IDENT( - [$1], [$2], [$3], - [[#]pragma ident], [], - [opal_pragma_ident_happy=1 - opal_message="[#]pragma ident"], - _OPAL_CHECK_IDENT( - [$1], [$2], [$3], - [[#]ident], [], - [opal_ident_happy=1 - opal_message="[#]ident"], - _OPAL_CHECK_IDENT( - [$1], [$2], [$3], - [[#]pragma comment(exestr, ], [)], - [opal_pragma_comment_happy=1 - opal_message="[#]pragma comment"], - [opal_static_const_char_happy=1 - opal_message="static const char[[]]"]))) - - AC_DEFINE_UNQUOTED([OPAL_$1_USE_PRAGMA_IDENT], - [$opal_pragma_ident_happy], [Use #pragma ident strings for $4 files]) - AC_DEFINE_UNQUOTED([OPAL_$1_USE_IDENT], - [$opal_ident_happy], [Use #ident strings for $4 files]) - AC_DEFINE_UNQUOTED([OPAL_$1_USE_PRAGMA_COMMENT], - [$opal_pragma_comment_happy], [Use #pragma comment for $4 files]) - AC_DEFINE_UNQUOTED([OPAL_$1_USE_CONST_CHAR_IDENT], - [$opal_static_const_char_happy], [Use static const char[] strings for $4 files]) - - AC_MSG_RESULT([$opal_message]) - - unset opal_pragma_ident_happy opal_ident_happy opal_static_const_char_happy opal_message -]) - -# _OPAL_CHECK_IDENT(compiler-env, compiler-flags, -# file-suffix, header_prefix, header_suffix, action-if-success, action-if-fail) -# Try to compile a source file containing a #-style ident, -# and determine whether the ident was inserted into the -# resulting object file -# ----------------------------------------------------------- -AC_DEFUN([_OPAL_CHECK_IDENT], [ - eval opal_compiler="\$$1" - eval opal_flags="\$$2" - - opal_ident="string_not_coincidentally_inserted_by_the_compiler" - cat > conftest.$3 <&1 1>/dev/null - opal_status=$? - AS_IF([test "$opal_output" != "" || test "$opal_status" = "0"], - [$6], - [$7])], - [OPAL_LOG_MSG([the failed program was:]) - OPAL_LOG_FILE([conftest.$3]) - $7] - [$7])]) - - unset opal_compiler opal_flags opal_output opal_status - rm -rf conftest.* conftest${EXEEXT} -])dnl diff --git a/config/opal_check_knem.m4 b/config/opal_check_knem.m4 index e3f1b90448a..a45547a47e6 100644 --- a/config/opal_check_knem.m4 +++ b/config/opal_check_knem.m4 @@ -9,6 +9,7 @@ dnl Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -22,53 +23,45 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OPAL_CHECK_KNEM],[ - if test -z "$opal_check_knem_happy" ; then - OPAL_VAR_SCOPE_PUSH([opal_check_knem_$1_save_CPPFLAGS opal_check_knem_dir]) - AC_ARG_WITH([knem], - [AS_HELP_STRING([--with-knem(=DIR)], - [Build knem Linux kernel module support, searching for headers in DIR/include])]) + OPAL_VAR_SCOPE_PUSH([opal_check_knem_happy opal_check_knem_CPPFLAGS_save]) - OPAL_CHECK_WITHDIR([knem], [$with_knem], [include/knem_io.h]) - opal_check_knem_$1_save_CPPFLAGS="$CPPFLAGS" + AC_ARG_WITH([knem], + [AS_HELP_STRING([--with-knem(=DIR)], + [Build knem Linux kernel module support, searching for headers in DIR/include])]) - opal_check_knem_happy=no + opal_check_knem_CPPFLAGS_save="${CPPFLAGS}" - AS_IF([test "$with_knem" != "no"], - [AS_IF([test ! -z "$with_knem" && test "$with_knem" != "yes"], - [opal_check_knem_dir="$with_knem"]) + AS_IF([test -n "${with_knem}" -a "${with_knem}" != "yes" -a "${with_knem}" != "no"], + [$1_CPPFLAGS="-I${with_knem}/include" + CPPFLAGS="$CPPFLAGS ${$1_CPPFLAGS}"]) - _OPAL_CHECK_PACKAGE_HEADER([ompi_check_knem], - [knem_io.h], - [$opal_check_knem_dir], - [opal_check_knem_happy="yes"], - [])], - []) + AC_CHECK_HEADER([knem_io.h], [opal_check_knem_happy="yes"], [opal_check_knem_happy="no"]) - CPPFLAGS="$CPPFLAGS $ompi_check_knem_CPPFLAGS" - - # need at least version 0x0000000b - if test "$opal_check_knem_happy" = "yes" ; then - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ + # need at least version 0x0000000b + AS_IF([test "$opal_check_knem_happy" = "yes"], + [AC_CACHE_CHECK([for recent version of knem ABI], + [opal_check_knem_cv_abi_version], + [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #include - ],[ + ]], [[ #if KNEM_ABI_VERSION < 0xc #error "Version less than 0xc" #endif - ])], - [opal_check_knem_happy=yes], - [opal_check_knem_happy=no]) - fi + ]])], + [opal_check_knem_cv_abi_version=yes], + [opal_check_knem_cv_abi_version=no])]) + AS_IF([test "${opal_check_knem_cv_abi_version}" = "no"], + [opal_check_knem_happy=no])]) - CPPFLAGS="$opal_check_knem_$1_save_CPPFLAGS" + CPPFLAGS="${opal_check_knem_CPPFLAGS_save}" - OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/Linux KNEM]],[$1],[$opal_check_knem_happy]) - OPAL_VAR_SCOPE_POP - fi + OPAL_SUMMARY_ADD([Transports], [Shared memory/Linux KNEM], [], [$opal_check_knem_happy]) AS_IF([test "$opal_check_knem_happy" = "yes"], - [$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_knem_CPPFLAGS" - $2], + [$2], [AS_IF([test ! -z "$with_knem" && test "$with_knem" != "no"], [AC_MSG_ERROR([KNEM support requested but not found. Aborting])]) $3]) + + OPAL_VAR_SCOPE_POP ])dnl diff --git a/config/opal_check_libnl.m4 b/config/opal_check_libnl.m4 index e246d39ddb2..5f2c711fa03 100644 --- a/config/opal_check_libnl.m4 +++ b/config/opal_check_libnl.m4 @@ -3,6 +3,7 @@ dnl dnl Copyright (c) 2015-2017 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2017 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -23,7 +24,7 @@ dnl cannot assume is always present) or we need to look in a dnl particular directory for the right libnl3 include files. For dnl now, just hard code the special path into this logic. dnl -dnl _OPAL_CHECK_PACKAGE_LIB() invokes OPAL_LIBNL_SANITY_CHECK() in order +dnl OAC_CHEC_PACKAGE() invokes OPAL_LIBNL_CHECK_PACKAGE_CALLBACK() in order dnl to keep track of which libraries depend on libnl and which libraries dnl depend on libnl3. dnl Open MPI will not be able to build a component vs a given version of libnl @@ -37,40 +38,30 @@ AC_DEFUN([OPAL_LIBNL_SANITY_INIT], [ opal_libnl_version=0 opal_libnlv1_libs= opal_libnlv3_libs= + AC_ARG_WITH([libnl], [AS_HELP_STRING([--with-libnl(=DIR)], - [Directory prefix for libnl (typically only necessary if libnl is installed in a location that the compiler/linker will not search by default)])]) - - # The --with options carry two pieces of information: 1) do - # you want a specific version of libnl, and 2) where that - # version of libnl lives. For simplicity, let's separate - # those two pieces of information. - case "$with_libnl" in - no) - # Nope, don't want it - opal_want_libnl=no - ;; - "") - # Just try to build with libnl - opal_want_libnl=try - opal_libnl_location= - ;; - yes) - # Yes, definitely want it - opal_want_libnl=yes - opal_libnl_location= - ;; - *) - # Yes, definitely want it -- at a specific location - opal_want_libnl=yes - opal_libnl_location=$with_libnl - ;; - esac + [Directory prefix for libnlv3 (typically only necessary if libnl is installed in a location that the compiler/linker will not search by default)])]) + AC_ARG_WITH([libnl-libdir], + [AS_HELP_STRING([--with-libnl-libdir=DIR], + [Directory prefix for libnlv3 libs (typically only necessary if libnl is installed in a location that the compiler/linker will not search by default)])]) + + # ugly hack to deal with potentially alternate locations for + # libnl3 headers. Note that if the pkg-config file is found, + # this ugly hack won't be used. + AS_IF([test -n "$with_libnl_incdir"], + [# skip check if someone above set incdir], + [test -d "/usr/include/libnl3"], + [with_libnl_incdir="/usr/include/libnl3"], + [test -d "/usr/local/include/libnl3"], + [with_libnl_incdir="/usr/local/include/libnl3"]) + + OAC_CHECK_PACKAGE_VERIFY_COMMANDS([[OPAL_LIBNL_CHECK_PACKAGE_CALLBACK]]) ]) dnl OPAL_LIBNL_SANITY_FAIL_MSG(lib) dnl -dnl Helper to pring a big warning message when we detect a libnl conflict. +dnl Helper to print a big warning message when we detect a libnl conflict. dnl dnl -------------------------------------------------------------------- AC_DEFUN([OPAL_LIBNL_SANITY_FAIL_MSG], [ @@ -79,39 +70,31 @@ AC_DEFUN([OPAL_LIBNL_SANITY_FAIL_MSG], [ AC_MSG_WARN([Open MPI will therefore skip using lib$1.]) ]) -dnl OPAL_LIBNL_SANITY_CHECK(lib, function, LIBS, libnl_check_ok) -dnl -dnl This macro is invoked from OPAL_CHECK_PACKAGE to make sure that -dnl new libraries that are added to LIBS do not pull in conflicting -dnl versions of libnl. E.g., if we already have a library in LIBS -dnl that pulls in libnl v3, if OPAL_CHECK_PACKAGE is later called that -dnl pulls in a library that pulls in libnl v1, this macro will detect -dnl the conflict and will abort configure. +dnl OPAL_LIBNL_CHECK_PACKAGE_CALLBACK(package name, prefix, +dnl headers, function name, +dnl action if happy, action if not happy) dnl -dnl We abort rather than silently ignore this library simply because -dnl we are now multiple levels deep in the M4 "call stack", and this -dnl layer does not know the intent of the user. Hence, all we can do -dnl is abort with a hopefully helpful error message (that we aborted -dnl because Open MPI would have been built in a configuration that is -dnl known to crash). -dnl -dnl -------------------------------------------------------------------- -AC_DEFUN([OPAL_LIBNL_SANITY_CHECK], [ +dnl Callback from OAC_CHECK_PACKAGE to verify that there is +dnl not a conflict. Note that CPPFLAGS, LDFLAGS, and LIBS +dnl are setup to compile/link package. +AC_DEFUN([OPAL_LIBNL_CHECK_PACKAGE_CALLBACK], [ OPAL_VAR_SCOPE_PUSH([opal_libnl_sane]) opal_libnl_sane=1 case $host in *linux*) - OPAL_LIBNL_SANITY_CHECK_LINUX($1, $2, $3, opal_libnl_sane) + OPAL_LIBNL_SANITY_CHECK_LINUX([$1], [$4], [], [opal_libnl_sane]) ;; esac - $4=$opal_libnl_sane + AS_IF([test ${opal_libnl_sane} -eq 1], + [$5], [$6]) + OPAL_VAR_SCOPE_POP([opal_libnl_sane]) ]) dnl dnl Simple helper for OPAL_LIBNL_SANITY_CHECK -dnl $1: library name +dnl $1: package name dnl $2: function dnl $3: LIBS dnl $4: output variable (1=ok, 0=not ok) @@ -119,10 +102,12 @@ dnl AC_DEFUN([OPAL_LIBNL_SANITY_CHECK_LINUX], [ OPAL_VAR_SCOPE_PUSH([this_requires_v1 libnl_sane this_requires_v3 ldd_output result_msg]) - AC_LANG_PUSH(C) + AS_VAR_PUSHDEF([libnl_check_lib], [opal_libnl_sanity_check_cv_$1]) - AC_MSG_CHECKING([if lib$1 requires libnl v1 or v3]) - cat > conftest_c.$ac_ext << EOF + AC_CACHE_CHECK([if $1 requires libnl v1 or v3], + [libnl_check_lib], + [AC_LANG_PUSH([C]) + cat > conftest_c.$ac_ext << EOF extern void $2 (void); int main(int argc, char *argv[[]]) { $2 (); @@ -130,21 +115,25 @@ int main(int argc, char *argv[[]]) { } EOF + result_msg= + OPAL_LOG_COMMAND([$CC -o conftest $CFLAGS $CPPFLAGS conftest_c.$ac_ext $LDFLAGS $LIBS $3], + [ldd_output=`ldd conftest` + AS_IF([echo $ldd_output | grep -q libnl-3.so], + [result_msg="v3"]) + AS_IF([echo $ldd_output | grep -q libnl.so], + [OPAL_APPEND([result_msg], ["v1"])]) + AS_IF([test -z "${result_msg}"], [result_msg="none"])], + [AC_MSG_WARN([Could not link a simple program with lib $1])]) + AC_LANG_POP([C]) + AS_VAR_SET([libnl_check_lib], [${result_msg}]) + rm -f conftest conftest_c.$ac_ext]) + AS_VAR_COPY([result_msg], [libnl_check_lib]) this_requires_v1=0 this_requires_v3=0 - result_msg= - OPAL_LOG_COMMAND([$CC -o conftest $CFLAGS $CPPFLAGS conftest_c.$ac_ext $LDFLAGS -l$1 $LIBS $3], - [ldd_output=`ldd conftest` - AS_IF([echo $ldd_output | grep -q libnl-3.so], - [this_requires_v3=1 - result_msg="v3"]) - AS_IF([echo $ldd_output | grep -q libnl.so], - [this_requires_v1=1 - result_msg="v1 $result_msg"]) - AC_MSG_RESULT([$result_msg]) - ], - [AC_MSG_WARN([Could not link a simple program with lib $1]) - ]) + AS_IF([echo "${result_msg}" | grep -q v1], [this_requires_v1=1]) + AS_IF([echo "${result_msg}" | grep -q v3], [this_requires_v3=1]) + + AS_VAR_POPDEF([libnl_check_lib]) # Assume that our configuration is sane; this may get reset below libnl_sane=1 @@ -156,7 +145,7 @@ EOF # Does this library require both v1 and v3? If so, fail. AS_IF([test $this_requires_v1 -eq 1 && test $this_requires_v3 -eq 1], - [AC_MSG_WARN([Unfortunately, lib$1 links to both libnl and libnl-3.]) + [AC_MSG_WARN([Unfortunately, $1 links to both libnl and libnl-3.]) OPAL_LIBNL_SANITY_FAIL_MSG($1) libnl_sane=0]) @@ -176,7 +165,7 @@ EOF # v1? If so, fail. AS_IF([test $libnl_sane -eq 1 && test $this_requires_v3 -eq 1], [AS_IF([test $opal_libnl_version -eq 1], - [AC_MSG_WARN([libnl version conflict: $opal_libnlv1_libs requires libnl whereas lib$1 requires libnl-3]) + [AC_MSG_WARN([libnl version conflict: $opal_libnlv1_libs requires libnl whereas $1 requires libnl-3]) OPAL_LIBNL_SANITY_FAIL_MSG($1) libnl_sane=0], [opal_libnlv3_libs="$opal_libnlv3_libs $1" @@ -184,167 +173,11 @@ EOF opal_libnl_version=3]) ]) - AC_LANG_POP(C) - rm -f conftest conftest_c.$ac_ext - $4=$libnl_sane OPAL_VAR_SCOPE_POP([ldd_output libnl_sane this_requires_v1 this_requires_v3 result_msg]) ]) -dnl -dnl Check for libnl-3. -dnl -dnl Inputs: -dnl -dnl $1: prefix where to look for libnl-3 -dnl $2: var name prefix of _CPPFLAGS and _LDFLAGS and _LIBS -dnl -dnl Outputs: -dnl -dnl - Set $2_CPPFLAGS necessary to compile with libnl-3 -dnl - Set $2_LDFLAGS necessary to link with libnl-3 -dnl - Set $2_LIBS necessary to link with libnl-3 -dnl - Set OPAL_HAVE_LIBNL3 1 if libnl-3 will be used -dnl -AC_DEFUN([OPAL_CHECK_LIBNL_V3],[ - OPAL_VAR_SCOPE_PUSH([CPPFLAGS_save opal_tmp_CPPFLAGS LIBS_save LDFLAGS_save]) - AC_MSG_NOTICE([checking for libnl v3]) - - AS_IF([test "$opal_want_libnl" != "no"], - [AS_IF([test -z "$opal_libnl_location"], - [AC_MSG_CHECKING([for /usr/include/libnl3]) - AS_IF([test -d "/usr/include/libnl3"], - [opal_tmp_CPPFLAGS=-I/usr/include/libnl3 - opal_libnlv3_happy=1 - AC_MSG_RESULT([found])], - [AC_MSG_RESULT([not found]) - AC_MSG_CHECKING([for /usr/local/include/libnl3]) - AS_IF([test -d "/usr/local/include/libnl3"], - [opal_tmp_CPPFLAGS=-I/usr/local/include/netlink3 - opal_libnlv3_happy=1 - AC_MSG_RESULT([found])], - [opal_libnlv3_happy=0 - AC_MSG_RESULT([not found])])])], - [AC_MSG_CHECKING([for $1/include/libnl3]) - AS_IF([test -d "$1/include/libnl3"], - [opal_tmp_CPPFLAGS="-I$1/include/libnl3" - opal_libnlv3_happy=1 - AC_MSG_RESULT([found])], - [opal_libnlv3_happy=0 - AC_MSG_RESULT([not found])])]) - CPPFLAGS_save=$CPPFLAGS - CPPFLAGS="$opal_tmp_CPPFLAGS $CPPFLAGS" - - # Random note: netlink/version.h is only in libnl v3 - it is not in libnl v1. - # Also, nl_recvmsgs_report is only in libnl v3. - AS_IF([test $opal_libnlv3_happy -eq 1], - [OPAL_CHECK_PACKAGE([$2], - [netlink/version.h], - [nl-3], - [nl_recvmsgs_report], - [], - [$1], - [], - [], - [opal_libnlv3_happy=0]) - - # Note that OPAL_CHECK_PACKAGE is going to add - # -I$dir/include into $2_CPPFLAGS. But because libnl v3 - # puts the headers in $dir/include/libnl3, we need to - # overwrite $2_CPPFLAGS with -I$dir/include/libnl3. We can do - # this unconditionally; we don't have to check for - # success (checking for success occurs below). - $2_CPPFLAGS=$opal_tmp_CPPFLAGS]) - - # If we found libnl-3, we *also* need libnl-route-3 - LIBS_save=$LIBS - LDFLAGS_save=$LDFLAGS - AS_IF([test -n "$$2_LDFLAGS"], - [LDFLAGS="$$2_LDFLAGS $LDFLAGS"]) - AS_IF([test $opal_libnlv3_happy -eq 1], - [AC_SEARCH_LIBS([nl_rtgen_request], - [nl-route-3], - [], - [opal_libnlv3_happy=0])]) - LIBS=$LIBS_save - LDFLAGS=$LDFLAGS_save - - # Just because libnl* is evil, double check that the - # netlink/version.h we found was for libnl v3. As far as we - # know, netlink/version.h only first appeared in version - # 3... but let's really be sure. - AS_IF([test $opal_libnlv3_happy -eq 1], - [AC_MSG_CHECKING([to ensure these really are libnl v3 headers]) - AS_IF([test -n "$$2_CPPFLAGS"], - [CPPFLAGS="$$2_CPPFLAGS $CPPFLAGS"]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#ifndef LIBNL_VER_MAJ -#error "LIBNL_VER_MAJ not defined!" -#endif -/* to the best of our knowledge, version.h only exists in libnl v3 */ -#if LIBNL_VER_MAJ != 3 -#error "LIBNL_VER_MAJ != 3, I am sad" -#endif - ]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - opal_libnlv3_happy=0])]) - - CPPFLAGS=$CPPFLAGS_save], - - [opal_libnlv3_happy=0]) - - # If we found everything - AS_IF([test $opal_libnlv3_happy -eq 1], - [$2_LIBS="-lnl-3 -lnl-route-3" - OPAL_HAVE_LIBNL3=1], - [# OPAL_CHECK_PACKAGE(...,nl_recvmsgs_report,...) might have set the variables below - # so reset them if libnl v3 cannot be used - $2_CPPFLAGS="" - $2_LDFLAGS="" - $2_LIBS=""]) - - OPAL_VAR_SCOPE_POP -]) - -dnl -dnl Check for libnl. -dnl -dnl Inputs: -dnl -dnl $1: prefix where to look for libnl -dnl $2: var name prefix of _CPPFLAGS and _LDFLAGS and _LIBS -dnl -dnl Outputs: -dnl -dnl - Set $2_CPPFLAGS necessary to compile with libnl -dnl - Set $2_LDFLAGS necessary to link with libnl -dnl - Set $2_LIBS necessary to link with libnl -dnl - Set OPAL_HAVE_LIBNL3 0 if libnl will be used -dnl -AC_DEFUN([OPAL_CHECK_LIBNL_V1],[ - AC_MSG_NOTICE([checking for libnl v1]) - - AS_IF([test "$opal_want_libnl" != "no"], - [OPAL_CHECK_PACKAGE([$2], - [netlink/netlink.h], - [nl], - [nl_connect], - [-lm], - [$1], - [], - [opal_libnlv1_happy=1], - [opal_libnlv1_happy=0])], - [opal_libnlv1_happy=0]) - - AS_IF([test $opal_libnlv1_happy -eq 1], - [$2_LIBS="-lnl -lm" - OPAL_HAVE_LIBNL3=0]) -]) - dnl dnl Summarize libnl and libnl3 usage, dnl and abort if conflict is found diff --git a/config/opal_check_ofi.m4 b/config/opal_check_ofi.m4 index 072d6ab1e7c..ce575e0554e 100644 --- a/config/opal_check_ofi.m4 +++ b/config/opal_check_ofi.m4 @@ -1,8 +1,11 @@ -dnl -*- shell-script -*- +dnl -*- autoconf -*- dnl dnl Copyright (c) 2015-2020 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights dnl reserved. +dnl Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +dnl Copyright (c) 2023 Triad National Security, LLC. All rights +dnl reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -23,42 +26,55 @@ dnl $3: action if OFI API version is < $1 AC_DEFUN([OPAL_CHECK_OFI_VERSION_GE],[ OPAL_VAR_SCOPE_PUSH([opal_ofi_ver_ge_save_CPPFLAGS opal_ofi_ver_ge_happy]) - AC_MSG_CHECKING([if OFI API version number is >= $1]) - opal_ofi_ver_ge_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$opal_ofi_CPPFLAGS + AS_LITERAL_WORD_IF([$1], [], [m4_fatal([OPAL_CHECK_OFI_VERSION_GE called with non-literal first argument])])dnl + AS_VAR_PUSHDEF([version_cache_var], [opal_ofi_ver_ge_cv_$1])dnl + m4_pushdef([version_pretty_print], [m4_translit([$1], [,], [.])])dnl + + AC_CACHE_CHECK([if OFI API version number is >= version_pretty_print], + [version_cache_var], + [opal_ofi_ver_ge_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS=$opal_ofi_internal_CPPFLAGS - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include +]], [[ #if !defined(FI_MAJOR_VERSION) #error "we cannot check the version -- sad panda" #elif FI_VERSION_LT(FI_VERSION(FI_MAJOR_VERSION, FI_MINOR_VERSION), FI_VERSION($1)) #error "version is too low -- nopes" #endif ]])], - [opal_ofi_ver_ge_happy=1], - [opal_ofi_ver_ge_happy=0]) + [version_cache_var=yes], + [version_cache_var=no])]) - AS_IF([test $opal_ofi_ver_ge_happy -eq 1], - [AC_MSG_RESULT([yes]) - $2], - [AC_MSG_RESULT([no]) - $3]) + AS_IF([test "${version_cache_var}" = "yes"], + [$2], + [$3]) CPPFLAGS=$opal_ofi_ver_ge_save_CPPFLAGS + m4_popdef([version_pretty_print]) + AS_VAR_POPDEF([version_cache_var]) OPAL_VAR_SCOPE_POP ])dnl -dnl -dnl _OPAL_CHECK_OFI + +dnl OPAL_CHECK_OFI(prefix, [action if found], [action if not found]) dnl -------------------------------------------------------- dnl Do the real work of checking for OFI libfabric. dnl Upon return: dnl -dnl - opal_ofi_happy: will be "yes" or "no" -dnl - opal_ofi_{CPPFLAGS|LDFLAGS|LIBS} will be loaded (if relevant) +dnl opal_ofi_{CPPFLAGS, LDFLAGS, LIBS} and prefix_{CPPFLAGS, LDFLAGS, +dnl LIBS} will be set as needed. dnl -AC_DEFUN([_OPAL_CHECK_OFI],[ +dnl This macro intentionally leaks opal_ofi_happy = yes/no as well as +dnl evaluating the action if found / action if not found +dnl +AC_DEFUN([OPAL_CHECK_OFI],[ + OPAL_VAR_SCOPE_PUSH([opal_check_ofi_save_CPPFLAGS opal_check_ofi_save_LDFLAGS opal_check_ofi_save_LIBS opal_check_fi_info_pci]) + + m4_ifblank([$1], [m4_fatal([First argument must be set for call to OPAL_CHECK_OFI])]) + # Add --with options AC_ARG_WITH([libfabric], [AS_HELP_STRING([--with-libfabric=DIR], @@ -70,113 +86,103 @@ AC_DEFUN([_OPAL_CHECK_OFI],[ AC_ARG_WITH([ofi], [AS_HELP_STRING([--with-ofi=DIR], [Specify location of OFI libfabric installation, adding DIR/include to the default search location for libfabric headers, and DIR/lib or DIR/lib64 to the default search location for libfabric libraries. Error if libfabric support cannot be found.])]) - AC_ARG_WITH([ofi-libdir], [AS_HELP_STRING([--with-ofi-libdir=DIR], [Search for OFI libfabric libraries in DIR])]) - if test "$with_ofi" = ""; then - with_ofi=$with_libfabric - fi + AS_IF([test -z "${with_ofi}"], [with_ofi=${with_libfabric}]) + AS_IF([test -z "${with_ofi_libdir}"], [with_ofi_libdir=${with_libfabric_libdir}]) - if test "$with_ofi_libdir" = ""; then - with_ofi_libdir=$with_libfabric_libdir - fi + opal_check_ofi_save_CPPFLAGS=${CPPFLAGS} + opal_check_ofi_save_LDFLAGS=${LDFLAGS} + opal_check_ofi_save_LIBS=${LIBS} - # Sanity check the --with values - OPAL_CHECK_WITHDIR([ofi], [$with_ofi], - [include/rdma/fabric.h]) - OPAL_CHECK_WITHDIR([ofi-libdir], [$with_ofi_libdir], - [libfabric.*]) - - OPAL_VAR_SCOPE_PUSH([opal_check_ofi_save_CPPFLAGS opal_check_ofi_save_LDFLAGS opal_check_ofi_save_LIBS opal_check_fi_info_pci]) - opal_check_ofi_save_CPPFLAGS=$CPPFLAGS - opal_check_ofi_save_LDFLAGS=$LDFLAGS - opal_check_ofi_save_LIBS=$LIBS opal_check_fi_info_pci=0 - opal_ofi_happy=yes - AS_IF([test "$with_ofi" = "no"], - [opal_ofi_happy=no]) + dnl OMPI has used ofi everywhere for some time, but the pkg-config + dnl module name is libfabric. Easier to set the pkg-config module + dnl name explicitly than change everything in OMPI. + m4_define([ofi_pkgconfig_module], [libfabric]) + OAC_CHECK_PACKAGE([ofi], + [$1], + [rdma/fabric.h], + [fabric], + [fi_getinfo], + [opal_ofi_happy=yes], + [opal_ofi_happy=no]) - AS_IF([test $opal_ofi_happy = yes], - [AC_MSG_CHECKING([looking for OFI libfabric in]) - AS_IF([test "$with_ofi" != "yes"], - [opal_ofi_dir=$with_ofi - AC_MSG_RESULT([($opal_ofi_dir)])], - [AC_MSG_RESULT([(default search paths)])]) - AS_IF([test ! -z "$with_ofi_libdir" && \ - test "$with_ofi_libdir" != "yes"], - [opal_ofi_libdir=$with_ofi_libdir]) - ]) + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${$1_CPPFLAGS}]) AS_IF([test $opal_ofi_happy = yes], - [OPAL_CHECK_PACKAGE([opal_ofi], - [rdma/fabric.h], - [fabric], - [fi_getinfo], - [], - [$opal_ofi_dir], - [$opal_ofi_libdir], - [], - [opal_ofi_happy=no])]) - - CPPFLAGS="$CPPFLAGS $opal_ofi_CPPFLAGS" + [AC_CHECK_HEADERS([rdma/fi_ext.h]) - AS_IF([test $opal_ofi_happy = yes], - [AC_CHECK_MEMBER([struct fi_info.nic], + AC_CHECK_MEMBER([struct fi_info.nic], [opal_check_fi_info_pci=1], [opal_check_fi_info_pci=0], - [[#include ]])]) + [[#include ]]) - AC_DEFINE_UNQUOTED([OPAL_OFI_PCI_DATA_AVAILABLE], - [$opal_check_fi_info_pci], - [check if pci data is available in ofi]) + AC_DEFINE_UNQUOTED([OPAL_OFI_PCI_DATA_AVAILABLE], + [${opal_check_fi_info_pci}], + [check if pci data is available in ofi]) - AC_CHECK_DECLS([PMIX_PACKAGE_RANK], - [], - [], - [#include ]) + AC_CHECK_DECLS([FI_OPT_FI_HMEM_P2P], + [], [], + [#include ]) - CPPFLAGS=$opal_check_ofi_save_CPPFLAGS - LDFLAGS=$opal_check_ofi_save_LDFLAGS - LIBS=$opal_check_ofi_save_LIBS + AC_CHECK_TYPES([struct fi_ops_mem_monitor], [], [], + [#ifdef HAVE_RDMA_FI_EXT_H +#include +#endif + ]) - AC_SUBST([opal_ofi_CPPFLAGS]) - AC_SUBST([opal_ofi_LDFLAGS]) - AC_SUBST([opal_ofi_LIBS]) + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}]) + AC_CHECK_DECLS([PMIX_PACKAGE_RANK], + [], + [], + [#include ]) - OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics OFI Libfabric]],[],[$opal_ofi_happy]) + AC_CHECK_MEMBER([struct fi_mr_attr.iface], + [opal_check_fi_mr_attr_iface=1], + [opal_check_fi_mr_attr_iface=0], + [[#include ]]) - OPAL_VAR_SCOPE_POP + AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_MR_IFACE], + [${opal_check_fi_mr_attr_iface}], + [check if iface avaiable in fi_mr_attr]) - AS_IF([test $opal_ofi_happy = no], - [AS_IF([test -n "$with_ofi" && test "$with_ofi" != "no"], + AC_CHECK_DECL([FI_HMEM_ROCR], + [opal_check_fi_hmem_rocr=1], + [opal_check_fi_hmem_rocr=0], + [#include ]) + + AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_HMEM_ROCR], + [${opal_check_fi_hmem_rocr}], + [check if FI_HMEM_ROCR avaiable in fi_hmem_iface]) + + AC_CHECK_DECL([FI_HMEM_ZE], + [opal_check_fi_hmem_ze=1], + [opal_check_fi_hmem_ze=0], + [#include ]) + + AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_HMEM_ZE], + [${opal_check_fi_hmem_ze}], + [check if FI_HMEM_ZE avaiable in fi_hmem_iface])]) + + CPPFLAGS=${opal_check_ofi_save_CPPFLAGS} + LDFLAGS=${opal_check_ofi_save_LDFLAGS} + LIBS=${opal_check_ofi_save_LIBS} + + dnl for version compare tests + opal_ofi_internal_CPPFLAGS="${$1_CPPFLAGS}" + + OPAL_SUMMARY_ADD([Transports], [OpenFabrics OFI Libfabric], [], [${$1_SUMMARY}]) + + AS_IF([test "${opal_ofi_happy}" = "yes"], + [$2], + [AS_IF([test -n "${with_ofi}" && test "${with_ofi}" != "no"], [AC_MSG_WARN([OFI libfabric support requested (via --with-ofi or --with-libfabric), but not found.]) AC_MSG_ERROR([Cannot continue.])]) - ]) -])dnl - + $3]) -dnl -dnl OPAL_CHECK_OFI -dnl -------------------------------------------------------- -dnl Check to see if OFI libfabric is available. -dnl -dnl This is a simple wrapper around _OPAL_CHECK_OFI that just -dnl ensures to only run the checks once. We do not use AC_REQUIRE -dnl because that re-orders the texts and makes ordering in stdout -dnl quite confusing / difficult to grok. -dnl -AC_DEFUN([OPAL_CHECK_OFI],[ - # Check for OFI libfabric. Note that $opal_ofi_happy is used in - # other configure.m4's to know if OFI/libfabric configured - # successfully. We only need to run the back-end checks once, but - # at least emit a "checking..." statement each subsequent time - # this macro is invoked so that configure's stdout has - # sensible/logical output. - AS_IF([test -z "$opal_ofi_happy"], - [_OPAL_CHECK_OFI], - [AC_MSG_CHECKING([if OFI libfabric is available]) - AC_MSG_RESULT([$opal_ofi_happy])]) -]) + OPAL_VAR_SCOPE_POP +])dnl diff --git a/config/opal_check_os_flavors.m4 b/config/opal_check_os_flavors.m4 deleted file mode 100644 index f055d949b06..00000000000 --- a/config/opal_check_os_flavors.m4 +++ /dev/null @@ -1,69 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2014 Intel, Inc. All rights reserved. -dnl Copyright (c) 2014 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# OPAL_CHECK_OS_FLAVOR_SPECIFIC() -# ---------------------------------------------------- -# Helper macro from OPAL-CHECK-OS-FLAVORS(), below. -# $1 = macro to look for -# $2 = suffix of env variable to set with results -AC_DEFUN([OPAL_CHECK_OS_FLAVOR_SPECIFIC], -[ - AC_MSG_CHECKING([$1]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#ifndef $1 - error: this is not $1 - #endif - ]])], - [opal_found_$2=yes], - [opal_found_$2=no]) - AC_MSG_RESULT([$opal_found_$2]) -])dnl - -# OPAL_CHECK_OS_FLAVORS() -# ---------------------------------------------------- -# Try to figure out the various OS flavors out there. -# -AC_DEFUN([OPAL_CHECK_OS_FLAVORS], -[ - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__NetBSD__], [netbsd]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__FreeBSD__], [freebsd]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__OpenBSD__], [openbsd]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__DragonFly__], [dragonfly]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__386BSD__], [386bsd]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__bsdi__], [bsdi]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__APPLE__], [apple]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__linux__], [linux]) - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__sun__], [sun]) - AS_IF([test "$opal_found_sun" = "no"], - OPAL_CHECK_OS_FLAVOR_SPECIFIC([__sun], [sun])) - - AS_IF([test "$opal_found_sun" = "yes"], - [opal_have_solaris=1 - CFLAGS="$CFLAGS -D_REENTRANT" - CPPFLAGS="$CPPFLAGS -D_REENTRANT"], - [opal_have_solaris=0]) - AC_DEFINE_UNQUOTED([OPAL_HAVE_SOLARIS], - [$opal_have_solaris], - [Whether or not we have solaris]) - - # check for sockaddr_in (a good sign we have TCP) - AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h]) - AC_CHECK_TYPES([struct sockaddr_in], - [opal_found_sockaddr=yes], - [opal_found_sockaddr=no], - [AC_INCLUDES_DEFAULT -#ifdef HAVE_NETINET_IN_H -#include -#endif]) -])dnl diff --git a/config/opal_check_package.m4 b/config/opal_check_package.m4 deleted file mode 100644 index dcf4c45bffc..00000000000 --- a/config/opal_check_package.m4 +++ /dev/null @@ -1,229 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2012-2017 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. -dnl Copyright (c) 2014 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015-2016 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -dnl _OPAL_CHECK_PACKAGE_HEADER(prefix, header, dir-prefix, -dnl [action-if-found], [action-if-not-found], -dnl includes) -dnl -------------------------------------------------------------------- -AC_DEFUN([_OPAL_CHECK_PACKAGE_HEADER], [ - # This is stolen from autoconf to peek under the covers to get the - # cache variable for the library check. one should not copy this - # code into other places unless you want much pain and suffering - AS_VAR_PUSHDEF([opal_Header], [ac_cv_header_$2]) - OPAL_VAR_SCOPE_PUSH([dir_prefix]) - - # so this sucks, but there's no way to get through the progression - # of header includes without killing off the cache variable and trying - # again... - unset opal_Header - - # get rid of the trailing slash(es) - dir_prefix=$(echo $3 | sed -e 'sX/*$XXg') - opal_check_package_header_happy="no" - AS_IF([test "$dir_prefix" = "/usr" || \ - test "$dir_prefix" = "/usr/local"], - [ # try as is... - AC_MSG_NOTICE([looking for header without includes]) - AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], []) - AS_IF([test "$opal_check_package_header_happy" = "no"], - [# no go on the as is - reset the cache and try again - unset opal_Header])]) - - AS_IF([test "$opal_check_package_header_happy" = "no"], - [AS_IF([test "$dir_prefix" != ""], - [$1_CPPFLAGS="$$1_CPPFLAGS -I$dir_prefix/include" - CPPFLAGS="$CPPFLAGS -I$dir_prefix/include"]) - AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], [], [$6]) - AS_IF([test "$opal_check_package_header_happy" = "yes"], [$4], [$5])], - [$4]) - unset opal_check_package_header_happy - - OPAL_VAR_SCOPE_POP([dir_prefix]) - AS_VAR_POPDEF([opal_Header])dnl -]) - - -dnl _OPAL_CHECK_PACKAGE_LIB(prefix, library, function, extra-libraries, -dnl dir-prefix, libdir, -dnl [action-if-found], [action-if-not-found]]) -dnl -------------------------------------------------------------------- -AC_DEFUN([_OPAL_CHECK_PACKAGE_LIB], [ - # This is stolen from autoconf to peek under the covers to get the - # cache variable for the library check. one should not copy this - # code into other places unless you want much pain and suffering - AS_VAR_PUSHDEF([opal_Lib], [ac_cv_search_$3]) - - # see comment above - unset opal_Lib - opal_check_package_lib_happy="no" - AS_IF([test "$6" != ""], - [ # libdir was specified - search only there - $1_LDFLAGS="$$1_LDFLAGS -L$6" - LDFLAGS="$LDFLAGS -L$6" - AC_SEARCH_LIBS([$3], [$2], - [opal_check_package_lib_happy="yes"], - [opal_check_package_lib_happy="no"], [$4]) - AS_IF([test "$opal_check_package_lib_happy" = "no"], - [LDFLAGS="$opal_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$opal_check_package_$1_orig_LDFLAGS" - unset opal_Lib])], - [ # libdir was not specified - go through search path - opal_check_package_libdir="$5" - AS_IF([test "$opal_check_package_libdir" = "" || \ - test "$opal_check_package_libdir" = "/usr" || \ - test "$opal_check_package_libdir" = "/usr/local"], - [ # try as is... - AC_MSG_NOTICE([looking for library without search path]) - AC_SEARCH_LIBS([$3], [$2], - [opal_check_package_lib_happy="yes"], - [opal_check_package_lib_happy="no"], [$4]) - AS_IF([test "$opal_check_package_lib_happy" = "no"], - [ # no go on the as is.. see what happens later... - LDFLAGS="$opal_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$opal_check_package_$1_orig_LDFLAGS" - unset opal_Lib])]) - - AS_IF([test "$opal_check_package_lib_happy" = "no"], - [AS_IF([test "$opal_check_package_libdir" != ""], - [$1_LDFLAGS="$$1_LDFLAGS -L$opal_check_package_libdir/lib" - LDFLAGS="$LDFLAGS -L$opal_check_package_libdir/lib" - AC_MSG_NOTICE([looking for library in lib]) - AC_SEARCH_LIBS([$3], [$2], - [opal_check_package_lib_happy="yes"], - [opal_check_package_lib_happy="no"], [$4]) - AS_IF([test "$opal_check_package_lib_happy" = "no"], - [ # no go on the as is.. see what happens later... - LDFLAGS="$opal_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$opal_check_package_$1_orig_LDFLAGS" - unset opal_Lib])])]) - - AS_IF([test "$opal_check_package_lib_happy" = "no"], - [AS_IF([test "$opal_check_package_libdir" != ""], - [$1_LDFLAGS="$$1_LDFLAGS -L$opal_check_package_libdir/lib64" - LDFLAGS="$LDFLAGS -L$opal_check_package_libdir/lib64" - AC_MSG_NOTICE([looking for library in lib64]) - AC_SEARCH_LIBS([$3], [$2], - [opal_check_package_lib_happy="yes"], - [opal_check_package_lib_happy="no"], [$4]) - AS_IF([test "$opal_check_package_lib_happy" = "no"], - [ # no go on the as is.. see what happens later... - LDFLAGS="$opal_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$opal_check_package_$1_orig_LDFLAGS" - unset opal_Lib])])])]) - - AS_IF([test "$opal_check_package_lib_happy" = "yes"], - [ # libnl v1 and libnl3 are known to *not* coexist - # harmoniously in the same process. Check to see if this - # new package will introduce such a conflict. - OPAL_LIBNL_SANITY_CHECK([$2], [$3], [$$1_LIBS], - [opal_check_package_libnl_check_ok]) - AS_IF([test $opal_check_package_libnl_check_ok -eq 0], - [opal_check_package_lib_happy=no]) - ]) - - AS_IF([test "$opal_check_package_lib_happy" = "yes"], - [ # The result of AC SEARCH_LIBS is cached in $ac_cv_search_[function] - AS_IF([test "$ac_cv_search_$3" != "no" && - test "$ac_cv_search_$3" != "none required"], - [$1_LIBS="$ac_cv_search_$3 $4"], - [$1_LIBS="$4"]) - $7], - [$8]) - - AS_VAR_POPDEF([opal_Lib])dnl -]) - - -dnl OPAL_CHECK_PACKAGE(prefix, -dnl header, -dnl library, -dnl function, -dnl extra-libraries, -dnl dir-prefix, -dnl libdir-prefix, -dnl [action-if-found], [action-if-not-found], -dnl includes) -dnl ----------------------------------------------------------- -dnl Check for package defined by header and libs, and probably -dnl located in dir-prefix, possibly with libs in libdir-prefix. -dnl Both dir-prefix and libdir-prefix can be empty. Will set -dnl prefix_{CPPFLAGS, LDFLAGS, LIBS} as needed. -dnl -dnl The general intent of this macro is to provide finer-grained scoping -dnl of C preprocessor flags, linker flags, and libraries (as opposed to -dnl unconditionally adding to the top-level CPFLAGS, LDFLAGS, and LIBS, -dnl which get used to compile/link *everything*). -dnl -dnl Here is a breakdown of the parameters: -dnl -dnl * prefix: the macro sets $prefix_CPPFLAGS, $prefix_LDFLAGS, and -dnl $prefix_LIBS (and AC_SUBSTs all of them). For example, if a -dnl provider uses this macro to check for a header/library that it -dnl needs, it might well set prefix to be its provider name. -dnl * header_filename: the foo.h file to check for -dnl * library_name / function_name: check for function function_name in -dnl -llibrary_name. Specifically, for library_name, use the "foo" form, -dnl as opposed to "libfoo". -dnl * extra_libraries: if the library_name you are checking for requires -dnl additional -l arguments to link successfully, list them here. -dnl * dir_prefix: if the header/library is located in a non-standard -dnl location (e.g., /opt/foo as opposed to /usr), list it here -dnl * libdir_prefix: if the library is not under $dir_prefix/lib or -dnl $dir_prefix/lib64, list it here. -dnl * action_if_found: if both the header and library are found and -dnl usable, execute action_if_found -dnl * action_if_not_found: otherwise, execute action_if_not_found -dnl * extra_includes: if including header_filename requires additional -dnl headers to be included first, list them here -dnl -dnl The output _CPPFLAGS, _LDFLAGS, and _LIBS can be used to limit the -dnl scope various flags in Makefiles. -dnl -AC_DEFUN([OPAL_CHECK_PACKAGE],[ - opal_check_package_$1_save_CPPFLAGS="$CPPFLAGS" - opal_check_package_$1_save_LDFLAGS="$LDFLAGS" - opal_check_package_$1_save_LIBS="$LIBS" - - opal_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS" - opal_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS" - opal_check_package_$1_orig_LIBS="$$1_LIBS" - - _OPAL_CHECK_PACKAGE_HEADER([$1], [$2], [$6], - [_OPAL_CHECK_PACKAGE_LIB([$1], [$3], [$4], [$5], [$6], [$7], - [opal_check_package_happy="yes"], - [opal_check_package_happy="no"])], - [opal_check_package_happy="no"], - [$10]) - - AS_IF([test "$opal_check_package_happy" = "yes"], - [$8], - [$1_CPPFLAGS="$opal_check_package_$1_orig_CPPFLAGS" - $1_LDFLAGS="$opal_check_package_$1_orig_LDFLAGS" - $1_LIBS="$opal_check_package_$1_orig_LIBS" - $9]) - - CPPFLAGS="$opal_check_package_$1_save_CPPFLAGS" - LDFLAGS="$opal_check_package_$1_save_LDFLAGS" - LIBS="$opal_check_package_$1_save_LIBS" -]) diff --git a/config/opal_check_portals4.m4 b/config/opal_check_portals4.m4 index 06a69c38a01..a1811832ebd 100644 --- a/config/opal_check_portals4.m4 +++ b/config/opal_check_portals4.m4 @@ -16,6 +16,7 @@ dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights dnl reserved. +dnl Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -29,81 +30,61 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OPAL_CHECK_PORTALS4],[ - if test -z "$ompi_check_portals4_happy" ; then - AC_ARG_WITH([portals4], - [AS_HELP_STRING([--with-portals4(=DIR)], - [Build Portals4 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([portals4], [$with_portals4], [include/portals4.h]) - AC_ARG_WITH([portals4-libdir], - [AS_HELP_STRING([--with-portals4-libdir=DIR], - [Search for Portals4 libraries in DIR])]) - OPAL_CHECK_WITHDIR([portals4-libdir], [$with_portals4_libdir], [libportals.*]) + OPAL_VAR_SCOPE_PUSH([ompi_check_portals4_happy max_md_size max_va_size]) - ompi_check_portals4_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_portals4_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_portals4_$1_save_LIBS="$LIBS" + AC_ARG_WITH([portals4], + [AS_HELP_STRING([--with-portals4(=DIR)], + [Build Portals4 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + AC_ARG_WITH([portals4-libdir], + [AS_HELP_STRING([--with-portals4-libdir=DIR], + [Search for Portals4 libraries in DIR])]) - AS_IF([test "$with_portals4" != "no"], - [AS_IF([test ! -z "$with_portals4" && test "$with_portals4" != "yes"], - [ompi_check_portals4_dir="$with_portals4"]) - AS_IF([test ! -z "$with_portals4_libdir" && test "$with_portals4_libdir" != "yes"], - [ompi_check_portals4_libdir="$with_portals4_libdir"]) + OAC_CHECK_PACKAGE([portals4], + [$1], + [portals4.h], + [portals], + [PtlLEAppend], + [ompi_check_portals4_happy="yes"], + [ompi_check_portals4_happy="no"]) - OPAL_CHECK_PACKAGE([opal_check_portals4], - [portals4.h], - [portals], - [PtlLEAppend], - [], - [$ompi_check_portals4_dir], - [$ompi_check_portals4_libdir], - [ompi_check_portals4_happy="yes"], - [ompi_check_portals4_happy="no"])], - [ompi_check_portals4_happy="no"]) + max_md_size=0 + AC_ARG_WITH([portals4-max-md-size], + [AS_HELP_STRING([--with-portals4-max-md-size=SIZE], + [Log base 2 of the maximum size in bytes of a memory descriptor. Should only be set for implementations which do not support binding all of virtual address space.])]) + AS_IF([test "$with_portals4_max_md_size" = "yes" || test "$with_portals4_max_md_size" = "no"], + [AC_MSG_ERROR([--with-portals4-max-md-size requires an integer argument])], + [AS_IF([test -n "$with_portals4_max_md_size"], + [max_md_size="$with_portals4_max_md_size"])]) + AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_MD_SIZE], [$max_md_size], + [Log base 2 of the maximum size in bytes of a memory descriptor. Set to 0 if MD can bind all of memory.]) - CPPFLAGS="$ompi_check_portals4_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_portals4_$1_save_LDFLAGS" - LIBS="$ompi_check_portals4_$1_save_LIBS" + max_va_size=0 + AC_ARG_WITH([portals4-max-va-size], + [AS_HELP_STRING([--with-portals4-max-va-size=SIZE], + [Log base 2 of the maximum size in bytes of the user virtual address space. Should only be set for implementations which do not support binding all of virtual address space.])]) + AS_IF([test "$with_portals4_max_va_size" = "yes" || test "$with_portals4_max_va_size" = "no"], + [AC_MSG_ERROR([--with-portals4-max-va-size requires an integer argument])], + [AS_IF([test -n "$with_portals4_max_va_size"], + [max_va_size="$with_portals4_max_va_size"])]) + AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_VA_SIZE], [$max_va_size], + [Log base 2 of the maximum size in bytes of the user virtual address space. Set to 0 if MD can bind all of memory.]) - max_md_size=0 - AC_ARG_WITH([portals4-max-md-size], - [AS_HELP_STRING([--with-portals4-max-md-size=SIZE], - [Log base 2 of the maximum size in bytes of a memory descriptor. Should only be set for implementations which do not support binding all of virtual address space.])]) - AS_IF([test "$with_portals4_max_md_size" = "yes" || test "$with_portals4_max_md_size" = "no"], - [AC_MSG_ERROR([--with-portals4-max-md-size requires an integer argument])], - [AS_IF([test -n "$with_portals4_max_md_size"], - [max_md_size="$with_portals4_max_md_size"])]) - AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_MD_SIZE], [$max_md_size], - [Log base 2 of the maximum size in bytes of a memory descriptor. Set to 0 if MD can bind all of memory.]) - - max_va_size=0 - AC_ARG_WITH([portals4-max-va-size], - [AS_HELP_STRING([--with-portals4-max-va-size=SIZE], - [Log base 2 of the maximum size in bytes of the user virtual address space. Should only be set for implementations which do not support binding all of virtual address space.])]) - AS_IF([test "$with_portals4_max_va_size" = "yes" || test "$with_portals4_max_va_size" = "no"], - [AC_MSG_ERROR([--with-portals4-max-va-size requires an integer argument])], - [AS_IF([test -n "$with_portals4_max_va_size"], - [max_va_size="$with_portals4_max_va_size"])]) - AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_VA_SIZE], [$max_va_size], - [Log base 2 of the maximum size in bytes of the user virtual address space. Set to 0 if MD can bind all of memory.]) - - AS_IF([(test $max_md_size -eq 0 && test $max_va_size -ne 0 ) || (test $max_md_size -ne 0 && test $max_va_size -eq 0 )], + AS_IF([(test $max_md_size -eq 0 && test $max_va_size -ne 0 ) || (test $max_md_size -ne 0 && test $max_va_size -eq 0 )], [AC_MSG_ERROR([If either --with-portals4-max-md-size or --with-portals4-max-va-size is set, both must be set.])]) - AS_IF([test $max_md_size -ge $max_va_size], - [max_md_size=0 - max_va_size=0]) - AS_IF([test $max_md_size -ne 0 && test $max_va_size -ne 0], - [AC_MSG_NOTICE([Portals 4 address space size: $max_md_size, $max_va_size])]) + AS_IF([test $max_md_size -ge $max_va_size], + [max_md_size=0 + max_va_size=0]) + AS_IF([test $max_md_size -ne 0 && test $max_va_size -ne 0], + [AC_MSG_NOTICE([Portals 4 address space size: $max_md_size, $max_va_size])]) - OPAL_SUMMARY_ADD([[Transports]],[[Portals4]],[$1],[$ompi_check_portals4_happy]) - fi + OPAL_SUMMARY_ADD([Transports], [Portals4], [], [${$1_SUMMARY}]) AS_IF([test "$ompi_check_portals4_happy" = "yes"], - [$1_LDFLAGS="[$]$1_LDFLAGS $opal_check_portals4_LDFLAGS" - $1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_portals4_CPPFLAGS" - $1_LIBS="[$]$1_LIBS $opal_check_portals4_LIBS" - $2], + [$2], [AS_IF([test ! -z "$with_portals4" && test "$with_portals4" != "no"], [AC_MSG_ERROR([Portals4 support requested but not found. Aborting])]) $3]) -]) + + OPAL_VAR_SCOPE_POP +])dnl diff --git a/config/opal_check_ps.m4 b/config/opal_check_ps.m4 deleted file mode 100644 index 8a47b1c8343..00000000000 --- a/config/opal_check_ps.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2014 Intel, Inc. All rights reserved. -dnl Copyright (c) 2017 UT-Battelle, LLC. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# See if there is a ps command that will produce the output we are -# interested in. If so, then save it away. Otherwise, the string is -# set to unknown. - -AC_DEFUN([OPAL_PS_FLAVOR_CHECK],[ -AC_MSG_CHECKING([for flavor of ps to use]) -PS_FLAVOR="unknown" -ps -A -o fname > /dev/null 2>&1 - -if test "$?" = "0"; then - PS_FLAVOR="ps -A -o fname,pid,uid" -else - ps -A -o command > /dev/null 2>&1 - if test "$?" = "0"; then - PS_FLAVOR="ps -A -o command,pid,uid" - fi -fi -AC_MSG_RESULT([$PS_FLAVOR]) -AC_DEFINE_UNQUOTED([ORTE_CLEAN_PS_CMD], ["$PS_FLAVOR"], [Specific ps command to use in orte-clean]) -]) - diff --git a/config/opal_check_rocm.m4 b/config/opal_check_rocm.m4 new file mode 100644 index 00000000000..25ac54e438e --- /dev/null +++ b/config/opal_check_rocm.m4 @@ -0,0 +1,72 @@ +dnl +dnl Copyright (C) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + + +# OMPI_CHECK_ROCM(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +# check if ROCM support can be found. sets prefix_{CPPFLAGS, +# LDFLAGS, LIBS} as needed and runs action-if-found if there is +# support, otherwise executes action-if-not-found + + +# +# Check for ROCm support +# +AC_DEFUN([OPAL_CHECK_ROCM],[ + + OPAL_VAR_SCOPE_PUSH([opal_check_rocm_happy rocm_save_CPPFLAGS rocm_save_LDFLAGS rocm_save_LIBS rocm_CPPFLAGS rocm_LDFLAGS rocm_LIBS]) + + rocm_save_CPPFLAGS="$CPPFLAGS" + rocm_save_LDFLAGS="$LDFLAGS" + rocm_save_LIBS="$LIBS" + + # Get some configuration information + AC_ARG_WITH([rocm], + [AS_HELP_STRING([--with-rocm(=DIR)], + [Build ROCm support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + + + AS_IF([ test -n "$with_rocm" && test "$with_rocm" = "yes" ], + [ with_rocm="/opt/rocm"] ) + + rocm_CPPFLAGS="-D__HIP_PLATFORM_AMD__" + rocm_LDFLAGS="-L${with_rocm}/lib/" + + AS_IF([ test -n "$with_rocm" && test "$with_rocm" != "no" ], + [ OPAL_APPEND([CPPFLAGS], [$rocm_CPPFLAGS]) + OPAL_APPEND([LDFLAGS], [$rocm_LDFLAGS]) ]) + + OAC_CHECK_PACKAGE([rocm], + [$1], + [hip/hip_runtime.h], + [amdhip64], + [hipFree], + [opal_check_rocm_happy="yes"], + [opal_check_rocm_happy="no"]) + + LDFLAGS="$rocm_save_LDFLAGS" + LIBS="$rocm_save_LIBS" + CPPFLAGS="$rocm_save_CPPFLAGS" + + AS_IF([ test "$opal_check_rocm_happy" = "yes" ], + [ OPAL_APPEND([$1_CPPFLAGS], [$rocm_CPPFLAGS]) + AC_DEFINE_UNQUOTED([OPAL_ROCM_SUPPORT], [1], [Enable ROCm support]) + ROCM_SUPPORT=1 ], + [ AC_DEFINE_UNQUOTED([OPAL_ROCM_SUPPORT], [0], [Disable ROCm support]) + ROCM_SUPPORT=0 ]) + + AS_IF([ test "$opal_check_rocm_happy" = "yes" ], + [$2], + [AS_IF([test -n "$with_rocm" && test "$with_rocm" != "no"], + [AC_MSG_ERROR([ROCm support requested but not found. Aborting])]) + $3]) + + AM_CONDITIONAL([OPAL_rocm_support], [test "$opal_check_rocm_happy" = "yes"]) + OPAL_VAR_SCOPE_POP +]) diff --git a/config/opal_check_ugni.m4 b/config/opal_check_ugni.m4 deleted file mode 100644 index 29a1f543acc..00000000000 --- a/config/opal_check_ugni.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl -*- Mode: Shell-script ; indent-tabs-mode:nil -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2006 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2006 QLogic Corp. All rights reserved. -dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2014 Intel, Inc. All rights reserved -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# OPAL_CHECK_UGNI(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -# check if GNI support can be found. sets prefix_{CPPFLAGS, -# LDFLAGS, LIBS} as needed and runs action-if-found if there is -# support, otherwise executes action-if-not-found -# - -AC_DEFUN([OPAL_CHECK_UGNI], [ - if test -z "$opal_check_ugni_happy" ; then - AC_ARG_WITH([ugni], [AS_HELP_STRING([--with-ugni], - [Build support for Cray GNI. Set PKG_CONFIG_PATH env. variable to specify alternate path.])]) - - opal_check_ugni_happy="no" - - AS_IF([test "$with_ugni" = "no"], - [opal_check_ugni_happy="no"], - [PKG_CHECK_MODULES([CRAY_UGNI], [cray-ugni], - [opal_check_ugni_happy="yes"], - [opal_check_ugni_happy="no"])]) - - opal_check_ugni_$1_save_CPPFLAGS="$CPPFLAGS" - opal_check_ugni_$1_save_LIBS="$LIBS" - - if test "$opal_check_ugni_happy" = "yes" ; then - CPPFLAGS="$CPPFLAGS $CRAY_UGNI_CFLAGS" - LIBS="$LIBS $CRAY_UGNI_LIBS" -# echo "+++++++++++++++++++++++CPPFLAGS",$CPPFLAGS -# echo "+++++++++++++++++++++++LDFLAGSS",$LDFLAGS -# echo "+++++++++++++++++++++++1_CPPFLAGS",$$1_CPPFLAGS -# echo "+++++++++++++++++++++++1_LDFLAGSS",$$1_LDFLAGS - -# sanity checks - - AC_CHECK_HEADER([gni_pub.h],[],AC_MSG_ERROR(['gni_pub.h not found.'])) - AC_CHECK_FUNCS([GNI_GetJobResInfo]) - - CPPFLAGS="$opal_check_ugni_$1_save_CPPFLAGS" - LIBS="$opal_check_ugni_$1_save_LIBS" - fi - - AS_IF([test "$opal_check_ugni_happy" = "yes" && test "$enable_progress_threads" = "yes"], - [AC_MSG_WARN([GNI driver does not currently support progress threads. Disabling.]) - opal_check_ugni_happy="no"]) - - OPAL_SUMMARY_ADD([[Transports]],[[Cray uGNI (Gemini/Aries)]],[$1],[$opal_check_ugni_happy]) - fi - - AS_IF([test "$opal_check_ugni_happy" = "yes"], - [$1_CPPFLAGS="[$]$1_CPPFLAGS $CRAY_UGNI_CFLAGS" - $1_LIBS="[$]$1_LIBS $CRAY_UGNI_LIBS" - $2], - [AS_IF([test ! -z "$with_ugni" && test "$with_ugni" != "no"], - [AC_MSG_ERROR([GNI support requested but not found. Cannot continue.])]) - $3]) - -]) diff --git a/config/opal_check_vendor.m4 b/config/opal_check_vendor.m4 index 578f542d0b1..06fedf89996 100644 --- a/config/opal_check_vendor.m4 +++ b/config/opal_check_vendor.m4 @@ -62,7 +62,7 @@ AC_DEFUN([OPAL_CXX_COMPILER_VENDOR], [ # workaround to avoid syntax error with Autoconf < 2.68: m4_ifndef([AC_LANG_DEFINES_PROVIDED], - [m4_define([AC_LANG_DEFINES_PROVIDED])]) + [m4_define([AC_LANG_DEFINES_PROVIDED])]) # OPAL_IFDEF_IFELSE(symbol, [action-if-defined], # [action-if-not-defined]) diff --git a/config/opal_check_version.m4 b/config/opal_check_version.m4 deleted file mode 100644 index bcc411733e6..00000000000 --- a/config/opal_check_version.m4 +++ /dev/null @@ -1,79 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2016 IBM Corporation. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# Parameters: (use a version "1.1.4rc2" as the example) -# * prefix -# Will export a variable $prefix_version_cmp -# - action_if_less => "less" -# - action_if_equal => "equal" -# - action_if_equal_series => "series" -# - action_if_greater => "greater" -# * version_actual -# Actual version string -# * version_desired -# Desired version string to check against -# * action_if_less -# Action to take if the version is strictly less than -# "1.1.3" < "1.1.4rc2" -# * action_if_equal -# Action to take if the version matches exactly -# "1.1.4rc2" = "1.1.4rc2" -# * action_if_equal_series -# Action to take if the version matches to this series -# "1.1.4rc1" ~=~ "1.1.4rc2" -# "1.1.4" ~=~ "1.1.4rc2" -# * action_if_greater -# Action to take if the version is strictly greater than -# "1.1.5" > "1.1.4rc2" -# "2.0" > "1.1.4rc2" -# -# See documentation on m4_version_compare and AS_VERSION_COMPARE for more -# precise definitions -# OPAL_CHECK_VERSION(prefix, version_actual, version_desired, -# action_if_less, action_if_equal, action_if_equal_series, -# action_if_greater) -# ---------------------------------------------------- -AC_DEFUN([OPAL_CHECK_VERSION],[ - version_actual=$2 - version_desired=$3 - - AC_MSG_CHECKING([Checking library version is $version_desired]) - # - # Example: If version_desired=1.1.4 and - # version_actual=1.1.3 -> -1 - # version_actual=1.1.4 -> 0 - # version_actual=1.1.4rc1 -> 1 - # version_actual=1.1.5 -> 1 (need further check) - # - AS_VERSION_COMPARE(["$version_actual"], [$version_desired], - [AC_MSG_RESULT([Earlier than expected ($version_actual < $$version_desired)]) - $1_version_cmp="less" - $4], - [AC_MSG_RESULT([Equal]) - $1_version_cmp="equal" - $5], - [ - # Need further check to make sure we are < 1.1.5 - # version_actual=1.1.4rc1 -> -1 - # version_actual=1.1.4 -> 0 (caught above) - # version_actual=1.1.5 -> 1 - AS_VERSION_COMPARE(["$version_actual"], [$version_desired"zzzz"], - [AC_MSG_RESULT([Within release series ($version_actual)]) - $1_version_cmp="series" - $6], - [AC_MSG_RESULT([Within release series ($version_actual)]) - $1_version_cmp="series" - $6], - [AC_MSG_RESULT([Later than expected ($version_actual > $$version_desired)]) - $1_version_cmp="greater" - $7] - )] - ) -])dnl diff --git a/config/opal_check_xpmem.m4 b/config/opal_check_xpmem.m4 index 0a30263bc6f..f1dc8ef8fc0 100644 --- a/config/opal_check_xpmem.m4 +++ b/config/opal_check_xpmem.m4 @@ -16,6 +16,7 @@ # Copyright (c) 2014 Intel, Inc. All rights reserved. # Copyright (c) 2014-2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -58,7 +59,7 @@ AC_DEFUN([OPAL_CHECK_CRAY_XPMEM],[ [$1_LDFLAGS="[$]$1_LDFLAGS $CRAY_XPMEM_LIBS" $1_CPPFLAGS="[$]$1_CPPFLAGS $CRAY_XPMEM_CFLAGS" $1_LIBS="[$]$1_LIBS $CRAY_XPMEM_LIBS" - AC_DEFINE_UNQUOTED([HAVE_XPMEM_H], [1],[is xpmem.h available]) + AC_DEFINE_UNQUOTED([HAVE_XPMEM_H], [1], [is xpmem.h available]) $2], [$3]) ]) @@ -68,45 +69,45 @@ AC_DEFUN([OPAL_CHECK_CRAY_XPMEM],[ # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OPAL_CHECK_XPMEM], [ - if test -z "$opal_check_xpmem_happy" ; then - # check for a cray installed xpmem first - OPAL_CHECK_CRAY_XPMEM([opal_check_xpmem],[opal_check_xpmem_happy=yes],[opal_check_xpmem_happy=no]) + OPAL_VAR_SCOPE_PUSH([opal_check_xpmem_happy]) - if test "$opal_check_xpmem_happy" = no ; then - AC_ARG_WITH([xpmem], - [AS_HELP_STRING([--with-xpmem(=DIR)], - [Build with XPMEM kernel module support, searching for headers in DIR])]) - OPAL_CHECK_WITHDIR([xpmem], [$with_xpmem], [include/xpmem.h]) + # check for a cray installed xpmem first + OPAL_CHECK_CRAY_XPMEM([$1], [opal_check_xpmem_happy=yes], [opal_check_xpmem_happy=no]) + AS_IF([test "${opal_check_xpmem_happy}" = "no"], + [OPAL_CHECK_BASE_XPMEM([$1], [opal_check_xpmem_happy=yes], [opal_check_xpmem_happy=no])]) - AC_ARG_WITH([xpmem-libdir], - [AS_HELP_STRING([--with-xpmem-libdir=DIR], - [Search for XPMEM library in DIR])]) - OPAL_CHECK_WITHDIR([xpmem-libdir], [$with_xpmem_libdir], [libxpmem.*]) + OPAL_SUMMARY_ADD([Transports], [Shared memory/XPMEM], [], [$opal_check_xpmem_happy]) - if test ! "$with_xpmem" = "no" ; then - if test ! -z "$with_xpmem" && test "$with_xpmem" != "yes" ; then - opal_check_xpmem_dir="$with_xpmem" - fi + AS_IF([test "${opal_check_xpmem_happy}" = "yes"], [$2], [$3]) - if test ! -z "$with_xpmem_libdir" && test "$with_xpmem_libdir" != "yes" ; then - opal_check_xpmem_libdir="$with_xpmem_libdir" - fi + OPAL_VAR_SCOPE_POP +])dnl - OPAL_CHECK_PACKAGE([opal_check_xpmem],[xpmem.h],[xpmem],[xpmem_make],[], - [$opal_check_xpmem_dir],[$opal_check_xpmem_libdir], [opal_check_xpmem_happy="yes"], []) - if test "$opal_check_xpmem_happy" = "no" && test -n "$with_xpmem" && test "$with_xpmem" != "yes" ; then - AC_MSG_ERROR([XPMEM support requested but not found. Aborting]) - fi - fi - fi +AC_DEFUN([OPAL_CHECK_BASE_XPMEM], [ + OPAL_VAR_SCOPE_PUSH([opal_check_xpmem_base_happy]) - OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/XPMEM]],[$1],[$opal_check_xpmem_happy]) - fi + AC_ARG_WITH([xpmem], + [AS_HELP_STRING([--with-xpmem(=DIR)], + [Build with XPMEM kernel module support, searching for headers in DIR])]) + AC_ARG_WITH([xpmem-libdir], + [AS_HELP_STRING([--with-xpmem-libdir=DIR], + [Search for XPMEM library in DIR])]) + + OAC_CHECK_PACKAGE([xpmem], + [$1], + [xpmem.h], + [xpmem], + [xpmem_make], + [opal_check_xpmem_base_happy="yes"], + [opal_check_xpmem_base_happy="no"]) + + AS_IF([test "${opal_check_xpmem_base_happy}" = "yes"], + [AC_DEFINE_UNQUOTED([HAVE_XPMEM_H], [1], [is xpmem.h available]) + $2], + [AS_IF([test -n "${with_xpmem}" -a "${with_xpmem}" != "no"], + [AC_MSG_ERROR([XPMEM support requested but not found. Aborting])]) + $3]) - AS_IF([test "$opal_check_xpmem_happy" = "yes"], [ - $1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_xpmem_CPPFLAGS" - $1_LDFLAGS="[$]$1_LDFLAGS $opal_check_xpmem_LDFLAGS" - $1_LIBS="[$]$1_LIBS $opal_check_xpmem_LIBS" - $2], [$3]) + OPAL_VAR_SCOPE_POP ])dnl diff --git a/config/opal_check_ze.m4 b/config/opal_check_ze.m4 new file mode 100644 index 00000000000..d1d47bb67c1 --- /dev/null +++ b/config/opal_check_ze.m4 @@ -0,0 +1,71 @@ +dnl +dnl Copyright (C) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +dnl Copyright (c) 2023 Triad National Security, LLC. All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + + +# OPAL_CHECK_ZE(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +# check if Intel ZE support can be found. sets prefix_{CPPFLAGS, +# LDFLAGS, LIBS} as needed and runs action-if-found if there is +# support, otherwise executes action-if-not-found + + +# +# Check for ZE support +# +AC_DEFUN([OPAL_CHECK_ZE],[ + + OPAL_VAR_SCOPE_PUSH([opal_check_ze_happy ze_save_CPPFLAGS ze_save_LDFLAGS ze_save_LIBS ze_CPPFLAGS ze_LDFLAGS ze_LIBS]) + + ze_save_CPPFLAGS="$CPPFLAGS" + ze_save_LDFLAGS="$LDFLAGS" + ze_save_LIBS="$LIBS" + + # Get some configuration information + AC_ARG_WITH([ze], + [AS_HELP_STRING([--with-ze(=DIR)], + [Build Intel ZE support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + + + AS_IF([ test -n "$with_ze" && test "$with_ze" = "yes" ], + [ with_ze="/opt/ze"] ) + + m4_define([ze_pkgconfig_module], [level-zero]) + OAC_CHECK_PACKAGE([ze], + [$1], + [level_zero/ze_api.h], + [ze_loader], + [zeInit], + [opal_check_ze_happy="yes"], + [opal_check_ze_happy="no"]) + + LDFLAGS="$ze_save_LDFLAGS" + LIBS="$ze_save_LIBS" + OPAL_APPEND([CPPFLAGS], [${$1_CPPFLAGS}] ) + OPAL_APPEND([LDFLAGS], [${$1_LDFLAGS}] ) + OPAL_APPEND([LIBS], [${$1_LIBS}] ) + + AS_IF([ test "$opal_check_ze_happy" = "no" ], + [ CPPFLAGS="$ze_save_CPPFLAGS"]) + + AS_IF([ test "$opal_check_ze_happy" = "yes" ], + [ AC_DEFINE_UNQUOTED([OPAL_ZE_SUPPORT], [1], [Enable Intel ZE support]) + ZE_SUPPORT=1 ], + [ AC_DEFINE_UNQUOTED([OPAL_ZE_SUPPORT], [0], [Disable Intel ZE support]) + ZE_SUPPORT=0 ]) + + AS_IF([ test "$opal_check_ze_happy" = "yes" ], + [$2], + [AS_IF([test -n "$with_ze" && test "$with_ze" != "no"], + [AC_MSG_ERROR([Intel ZE support requested but not found. Aborting])]) + $3]) + + AM_CONDITIONAL([OPAL_ze_support], [test "$opal_check_ze_happy" = "yes"]) + OPAL_VAR_SCOPE_POP +]) diff --git a/config/opal_config_3rdparty.m4 b/config/opal_config_3rdparty.m4 index c80f20e12d7..e931850a9cf 100644 --- a/config/opal_config_3rdparty.m4 +++ b/config/opal_config_3rdparty.m4 @@ -4,7 +4,7 @@ dnl Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved dnl Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. dnl Copyright (c) 2015-2018 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights +dnl Copyright (c) 2020-2021 Amazon.com, Inc. or its affiliates. All Rights dnl reserved. dnl $COPYRIGHT$ dnl @@ -13,44 +13,58 @@ dnl dnl $HEADER$ dnl -dnl OPAL_3RDPARTY_WITH(short package name, long package name, internal supported) +dnl OPAL_3RDPARTY_WITH(short package name, long package name, +dnl internal supported, disabled ok) dnl dnl Basic --with-pkg/--with-pkg-libdir handling for 3rd party dnl packages, with the big long description of internal/external/path dnl handling. dnl dnl At the end of this macro, with_pkg will contain an empty string or -dnl a path (implying external). Further, the shell variable opal_pkg_mode -dnl will be set to "internal", "external", or "unspecified". If a path is -dnl given to --with-pkg, then opal_pkg_mode will be set to external. +dnl a path (the later implying external). Further, the shell variable +dnl opal_pkg_mode will be set to "internal", "external", +dnl "unspecified", or "disabled". If a path is given to --with-pkg, then +dnl opal_pkg_mode will be set to external. If "internal supported" is +dnl not defined, then opal_pkg_mode will not be internal. If +dnl "disabled ok" is not defined, then opal_pkg_mode will not be +dnl "disabled". dnl dnl If m4_ifdef(internal support) does not evaluate to true (ie, at dnl autogen time), the references to internal in the help strings will dnl be removed and internal will not be a supported option. dnl +dnl If m4_ifval(ddisbaled ok) does not evaluate to true (ie, at autogen +dnl time), then --without-pkg will not be a valid configure option and +dnl will raise an error. +dnl dnl $1: short package name dnl $2: long pacakage name AC_DEFUN([OPAL_3RDPARTY_WITH], [ - m4_ifdef([$3], - [AC_ARG_WITH([$1], - [AS_HELP_STRING([--with-$1(=DIR)], - [Build $2 support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])]) - - AC_ARG_WITH([$1-libdir], - [AS_HELP_STRING([--with-$1-libdir=DIR], - [Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])], - [AC_ARG_WITH([$1], - [AS_HELP_STRING([--with-$1(=DIR)], - [Build $2 support. DIR can take one of two values: "external" or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])]) + m4_ifval([$4], + [m4_ifdef([$3], + [AC_ARG_WITH([$1], + [AS_HELP_STRING([--with-$1(=DIR)], + [Build $2 support. DIR can take one of four values: "internal", "external", "no", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. "no" means that Open MPI will not build components that require this package. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])], + [AC_ARG_WITH([$1], + [AS_HELP_STRING([--with-$1(=DIR)], + [Build $2 support. DIR can take one of three values: "external", "no", or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. "no" means that Open MPI will not build components that require this package. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])])], + [m4_ifdef([$3], + [AC_ARG_WITH([$1], + [AS_HELP_STRING([--with-$1(=DIR)], + [Build $2 support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])], + [AC_ARG_WITH([$1], + [AS_HELP_STRING([--with-$1(=DIR)], + [Build $2 support. DIR can take one of two values: "external" or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])])]) - AC_ARG_WITH([$1-libdir], - [AS_HELP_STRING([--with-$1-libdir=DIR], - [Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])]) + AC_ARG_WITH([$1-libdir], + [AS_HELP_STRING([--with-$1-libdir=DIR], + [Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])]) # Bozo check - AS_IF([test "$with_$1" = "no"], - [AC_MSG_WARN([It is not possible to configure Open MPI --without-$1]) - AC_MSG_ERROR([Cannot continue])]) + m4_ifval([$4], [], + [AS_IF([test "$with_$1" = "no"], + [AC_MSG_WARN([It is not possible to configure Open MPI --without-$1]) + AC_MSG_ERROR([Cannot continue])])]) AS_IF([test "$with_$1_libdir" = "no" -o "$with_$1_libdir" = "yes"], [AC_MSG_WARN([yes/no are invalid responses for --with-$1-libdir. Please specify a path.]) @@ -73,6 +87,8 @@ AC_DEFUN([OPAL_3RDPARTY_WITH], [ opal_$1_mode="internal"], ["external"], [with_$1="" opal_$1_mode="external"], + ["no"], [with_$1="" + opal_$1_mode="disabled"], [""], [opal_$1_mode="unspecified"], [opal_$1_mode="external"]) diff --git a/config/opal_config_asm.m4 b/config/opal_config_asm.m4 index aed2139a88b..1a458e748f1 100644 --- a/config/opal_config_asm.m4 +++ b/config/opal_config_asm.m4 @@ -9,14 +9,13 @@ dnl Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. -dnl Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2008-2021 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. dnl Copyright (c) 2015-2018 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights dnl reserved. -dnl Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights -dnl reserved. +dnl Copyright (c) 2017-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl Copyright (c) 2020 Google, LLC. All rights reserved. dnl Copyright (c) 2020 Intel, Inc. All rights reserved. dnl Copyright (c) 2021 IBM Corporation. All rights reserved. @@ -334,7 +333,7 @@ AC_DEFUN([OPAL_CHECK_GCC_ATOMIC_BUILTINS], [ if test -z "$opal_cv_have___atomic" ; then AC_MSG_CHECKING([for 32-bit GCC built-in atomics]) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include uint32_t tmp, old = 0; uint64_t tmp64, old64 = 0;], [ @@ -342,35 +341,35 @@ __atomic_thread_fence(__ATOMIC_SEQ_CST); __atomic_compare_exchange_n(&tmp, &old, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); __atomic_add_fetch(&tmp, 1, __ATOMIC_RELAXED); __atomic_compare_exchange_n(&tmp64, &old64, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); -__atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);], - [opal_cv_have___atomic=yes], - [opal_cv_have___atomic=no]) +__atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);])], + [opal_cv_have___atomic=yes], + [opal_cv_have___atomic=no]) AC_MSG_RESULT([$opal_cv_have___atomic]) if test $opal_cv_have___atomic = "yes" ; then - AC_MSG_CHECKING([for 64-bit GCC built-in atomics]) + AC_MSG_CHECKING([for 64-bit GCC built-in atomics]) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include uint64_t tmp64, old64 = 0;], [ __atomic_compare_exchange_n(&tmp64, &old64, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); -__atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);], - [opal_cv_have___atomic_64=yes], - [opal_cv_have___atomic_64=no]) - - AC_MSG_RESULT([$opal_cv_have___atomic_64]) - - if test $opal_cv_have___atomic_64 = "yes" ; then - AC_MSG_CHECKING([if 64-bit GCC built-in atomics are lock-free]) - AC_RUN_IFELSE([AC_LANG_PROGRAM([], [if (!__atomic_is_lock_free (8, 0)) { return 1; }])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - opal_cv_have___atomic_64=no], - [AC_MSG_RESULT([cannot test -- assume yes (cross compiling)])]) - fi +__atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);])], + [opal_cv_have___atomic_64=yes], + [opal_cv_have___atomic_64=no]) + + AC_MSG_RESULT([$opal_cv_have___atomic_64]) + + if test $opal_cv_have___atomic_64 = "yes" ; then + AC_MSG_CHECKING([if 64-bit GCC built-in atomics are lock-free]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([], [if (!__atomic_is_lock_free (8, 0)) { return 1; }])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + opal_cv_have___atomic_64=no], + [AC_MSG_RESULT([cannot test -- assume yes (cross compiling)])]) + fi else - opal_cv_have___atomic_64=no + opal_cv_have___atomic_64=no fi # Check for 128-bit support @@ -378,6 +377,7 @@ __atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);], fi ]) + AC_DEFUN([OPAL_CHECK_C11_CSWAP_INT128], [ OPAL_VAR_SCOPE_PUSH([atomic_compare_exchange_result atomic_compare_exchange_CFLAGS_save atomic_compare_exchange_LIBS_save]) @@ -422,510 +422,6 @@ AC_DEFUN([OPAL_CHECK_C11_CSWAP_INT128], [ OPAL_VAR_SCOPE_POP ]) -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_TEXT -dnl -dnl Determine how to set current mode as text. -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_TEXT],[ - AC_MSG_CHECKING([directive for setting text section]) - opal_cv_asm_text="" - if test "$opal_cv_c_compiler_vendor" = "microsoft" ; then - # text section will be brought in with the rest of - # header for MS - leave blank for now - opal_cv_asm_text="" - else - case $host in - *-aix*) - opal_cv_asm_text=[".csect .text[PR]"] - ;; - *) - opal_cv_asm_text=".text" - ;; - esac - fi - AC_MSG_RESULT([$opal_cv_asm_text]) - AC_DEFINE_UNQUOTED([OPAL_ASM_TEXT], ["$opal_cv_asm_text"], - [Assembly directive for setting text section]) - OPAL_ASM_TEXT="$opal_cv_asm_text" - AC_SUBST(OPAL_ASM_TEXT) -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_GLOBAL -dnl -dnl Sets OPAL_ASM_GLOBAL to the value to prefix global values -dnl -dnl I'm sure if I don't have a test for this, there will be some -dnl dumb platform that uses something else -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_GLOBAL],[ - AC_MSG_CHECKING([directive for exporting symbols]) - opal_cv_asm_global="" - if test "$opal_cv_c_compiler_vendor" = "microsoft" ; then - opal_cv_asm_global="PUBLIC" - else - case $host in - *) - opal_cv_asm_global=".globl" - ;; - esac - fi - AC_MSG_RESULT([$opal_cv_asm_global]) - AC_DEFINE_UNQUOTED([OPAL_ASM_GLOBAL], ["$opal_cv_asm_global"], - [Assembly directive for exporting symbols]) - OPAL_ASM_GLOBAL="$opal_cv_asm_global" - AC_SUBST(OPAL_AS_GLOBAL) -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_LSYM -dnl -dnl Sets OPAL_ASM_LSYM to the prefix value on a symbol to make it -dnl an internal label (jump target and whatnot) -dnl -dnl We look for L .L $ L$ (in that order) for something that both -dnl assembles and does not leave a label in the output of nm. Fall -dnl back to L if nothing else seems to work :/ -dnl -dnl ################################################################# - -# _OPAL_CHECK_ASM_LSYM([variable-to-set]) -# --------------------------------------- -AC_DEFUN([_OPAL_CHECK_ASM_LSYM],[ - AC_REQUIRE([AC_PROG_GREP]) - - $1="L" - - for sym in L .L $ L$ ; do - asm_result=0 - echo "configure: trying $sym" >&AS_MESSAGE_LOG_FD - OPAL_TRY_ASSEMBLE([foobar$opal_cv_asm_label_suffix -${sym}mytestlabel$opal_cv_asm_label_suffix], - [# ok, we succeeded at assembling. see if we can nm, - # throwing the results in a file - if $NM conftest.$OBJEXT > conftest.out 2>&AS_MESSAGE_LOG_FD ; then - if test "`$GREP mytestlabel conftest.out`" = "" ; then - # there was no symbol... looks promising to me - $1="$sym" - asm_result=1 - elif test ["`$GREP ' [Nt] .*mytestlabel' conftest.out`"] = "" ; then - # see if we have a non-global-ish symbol - # but we should see if we can do better. - $1="$sym" - fi - else - # not so much on the NM goodness :/ - echo "$NM failed. Output from NM was:" >&AS_MESSAGE_LOG_FD - cat conftest.out >&AS_MESSAGE_LOG_FD - AC_MSG_WARN([$NM could not read object file]) - fi - ]) - if test "$asm_result" = "1" ; then - break - fi - done - rm -f conftest.out - unset asm_result sym -]) - -# OPAL_CHECK_ASM_LSYM() -# --------------------- -AC_DEFUN([OPAL_CHECK_ASM_LSYM],[ - AC_REQUIRE([LT_PATH_NM]) - - AC_CACHE_CHECK([prefix for lsym labels], - [opal_cv_asm_lsym], - [_OPAL_CHECK_ASM_LSYM([opal_cv_asm_lsym])]) - AC_DEFINE_UNQUOTED([OPAL_ASM_LSYM], ["$opal_cv_asm_lsym"], - [Assembly prefix for lsym labels]) - OPAL_ASM_LSYM="$opal_cv_asm_lsym" - AC_SUBST(OPAL_ASM_LSYM) -])dnl - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_PROC -dnl -dnl Sets a cv-flag, if the compiler needs a proc/endp-definition to -dnl link with C. -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_PROC],[ - AC_CACHE_CHECK([if .proc/endp is needed], - [opal_cv_asm_need_proc], - [opal_cv_asm_need_proc="no" - OPAL_TRY_ASSEMBLE([ - .proc mysym -mysym: - .endp mysym], - [opal_cv_asm_need_proc="yes"]) - rm -f conftest.out]) - - if test "$opal_cv_asm_need_proc" = "yes" ; then - opal_cv_asm_proc=".proc" - opal_cv_asm_endproc=".endp" - else - opal_cv_asm_proc="#" - opal_cv_asm_endproc="#" - fi -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_GSYM -dnl -dnl Sets OPAL_ASM_GSYM to the prefix value on a symbol to make it -dnl a global linkable from C. Basically, an _ or not. -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_GSYM],[ - AC_CACHE_CHECK([prefix for global symbol labels], - [opal_cv_asm_gsym], - [_OPAL_CHECK_ASM_GSYM]) - - if test "$opal_cv_asm_gsym" = "none" ; then - AC_MSG_ERROR([Could not determine global symbol label prefix]) - fi - - AC_DEFINE_UNQUOTED([OPAL_ASM_GSYM], ["$opal_cv_asm_gsym"], - [Assembly prefix for gsym labels]) - OPAL_ASM_GSYM="$opal_cv_asm_gsym" - AC_SUBST(OPAL_ASM_GSYM) - -]) - -AC_DEFUN([_OPAL_CHECK_ASM_GSYM],[ - opal_cv_asm_gsym="none" - - for sym in "_" "" "." ; do - asm_result=0 - echo "configure: trying $sym" >&AS_MESSAGE_LOG_FD -cat > conftest_c.c <&AS_MESSAGE_LOG_FD - opal_link="$CC $CFLAGS conftest_c.$OBJEXT conftest.$OBJEXT -o conftest $LDFLAGS $LIBS > conftest.link 2>&1" - if AC_TRY_EVAL(opal_link) ; then - # save the warnings - cat conftest.link >&AS_MESSAGE_LOG_FD - asm_result=1 - else - cat conftest.link >&AS_MESSAGE_LOG_FD - echo "configure: failed C program was: " >&AS_MESSAGE_LOG_FD - cat conftest_c.c >&AS_MESSAGE_LOG_FD - echo "configure: failed ASM program was: " >&AS_MESSAGE_LOG_FD - cat conftest.s >&AS_MESSAGE_LOG_FD - asm_result=0 - fi - else - # save output and failed program - cat conftest.cmpl >&AS_MESSAGE_LOG_FD - echo "configure: failed C program was: " >&AS_MESSAGE_LOG_FD - cat conftest.c >&AS_MESSAGE_LOG_FD - asm_result=0 - fi], - [asm_result=0]) - if test "$asm_result" = "1" ; then - opal_cv_asm_gsym="$sym" - break - fi - done - rm -rf conftest.* -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_LABEL_SUFFIX -dnl -dnl Sets OPAL_ASM_LABEL_SUFFIX to the value to suffix for labels -dnl -dnl I'm sure if I don't have a test for this, there will be some -dnl dumb platform that uses something else -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_LABEL_SUFFIX],[ - AC_MSG_CHECKING([suffix for labels]) - opal_cv_asm_label_suffix="" - case $host in - *) - opal_cv_asm_label_suffix=":" - ;; - esac - AC_MSG_RESULT([$opal_cv_asm_label_suffix]) - AC_DEFINE_UNQUOTED([OPAL_ASM_LABEL_SUFFIX], ["$opal_cv_asm_label_suffix"], - [Assembly suffix for labels]) - OPAL_ASM_LABEL_SUFFIX="$opal_cv_asm_label_suffix" - AC_SUBST(OPAL_AS_LABEL_SUFFIX) -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_ALIGN_LOG -dnl -dnl Sets OPAL_ASM_ALIGN_LOG to 1 if align is specified -dnl logarithmically, 0 otherwise -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_ALIGN_LOG],[ - AC_REQUIRE([LT_PATH_NM]) - AC_REQUIRE([AC_PROG_GREP]) - - AC_CACHE_CHECK([if .align directive takes logarithmic value], - [opal_cv_asm_align_log], - [ OPAL_TRY_ASSEMBLE([ $opal_cv_asm_text - .align 4 - $opal_cv_asm_global foo - .byte 1 - .align 4 -foo$opal_cv_asm_label_suffix - .byte 2], - [opal_asm_addr=[`$NM conftest.$OBJEXT | $GREP foo | sed -e 's/.*\([0-9a-fA-F][0-9a-fA-F]\).*foo.*/\1/'`]], - [opal_asm_addr=""]) - # test for both 16 and 10 (decimal and hex notations) - echo "configure: .align test address offset is $opal_asm_addr" >&AS_MESSAGE_LOG_FD - if test "$opal_asm_addr" = "16" || test "$opal_asm_addr" = "10" ; then - opal_cv_asm_align_log="yes" - else - opal_cv_asm_align_log="no" - fi]) - - if test "$opal_cv_asm_align_log" = "yes" || test "$opal_cv_asm_align_log" = "1" ; then - opal_asm_align_log_result=1 - else - opal_asm_align_log_result=0 - fi - - AC_DEFINE_UNQUOTED([OPAL_ASM_ALIGN_LOG], - [$asm_align_log_result], - [Assembly align directive expects logarithmic value]) - - unset omp_asm_addr asm_result -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_TYPE -dnl -dnl Sets OPAL_ASM_TYPE to the prefix for the function type to -dnl set a symbol's type as function (needed on ELF for shared -dnl libraries). If no .type directive is needed, sets OPAL_ASM_TYPE -dnl to an empty string -dnl -dnl We look for @ \# % -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_TYPE],[ - AC_CACHE_CHECK([prefix for function in .type], - [opal_cv_asm_type], - [_OPAL_CHECK_ASM_TYPE]) - - AC_DEFINE_UNQUOTED([OPAL_ASM_TYPE], ["$opal_cv_asm_type"], - [How to set function type in .type directive]) - OPAL_ASM_TYPE="$opal_cv_asm_type" - AC_SUBST(OPAL_ASM_TYPE) -]) - -AC_DEFUN([_OPAL_CHECK_ASM_TYPE],[ - opal_cv_asm_type="" - - case "${host}" in - *-sun-solaris*) - # GCC on solaris seems to accept just about anything, not - # that what it defines actually works... So just hardwire - # to the right answer - opal_cv_asm_type="#" - ;; - *) - for type in @ \# % ; do - asm_result=0 - echo "configure: trying $type" >&AS_MESSAGE_LOG_FD - OPAL_TRY_ASSEMBLE([ .type mysym, ${type}function -mysym:], - [opal_cv_asm_type="${type}" - asm_result=1]) - if test "$asm_result" = "1" ; then - break - fi - done - ;; - esac - rm -f conftest.out - - unset asm_result type -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_ASM_SIZE -dnl -dnl Sets OPAL_ASM_SIZE to 1 if we should set .size directives for -dnl each function, 0 otherwise. -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_ASM_SIZE],[ - AC_CACHE_CHECK([if .size is needed], - [opal_cv_asm_need_size], - [opal_cv_asm_need_size="no" - OPAL_TRY_ASSEMBLE([ .size mysym, 1], - [opal_cv_asm_need_size="yes"]) - rm -f conftest.out]) - - if test "$opal_cv_asm_need_size" = "yes" ; then - opal_asm_size=1 - else - opal_asm_size=0 - fi - - AC_DEFINE_UNQUOTED([OPAL_ASM_SIZE], ["$opal_asm_size"], - [Do we need to give a .size directive]) - OPAL_ASM_SIZE="$opal_asm_size" - AC_SUBST(OPAL_ASM_TYPE) - unset asm_result -])dnl - - -# OPAL_CHECK_ASM_GNU_STACKEXEC(var) -# ---------------------------------- -# sets shell variable var to the things necessary to -# disable execable stacks with GAS -AC_DEFUN([OPAL_CHECK_ASM_GNU_STACKEXEC], [ - AC_REQUIRE([AC_PROG_GREP]) - - AC_CHECK_PROG([OBJDUMP], [objdump], [objdump]) - AC_CACHE_CHECK([if .note.GNU-stack is needed], - [opal_cv_asm_gnu_stack_result], - [AS_IF([test "$OBJDUMP" != ""], - [ # first, see if a simple C program has it set - cat >conftest.c <&1 | $GREP '\.note\.GNU-stack' &> /dev/null && opal_cv_asm_gnu_stack_result=yes], - [OPAL_LOG_MSG([the failed program was:], 1) - OPAL_LOG_FILE([conftest.c]) - opal_cv_asm_gnu_stack_result=no]) - if test "$opal_cv_asm_gnu_stack_result" != "yes" ; then - opal_cv_asm_gnu_stack_result="no" - fi - rm -rf conftest.*], - [opal_cv_asm_gnu_stack_result="no"])]) - if test "$opal_cv_asm_gnu_stack_result" = "yes" ; then - opal_cv_asm_gnu_stack=1 - else - opal_cv_asm_gnu_stack=0 - fi -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_POWERPC_REG -dnl -dnl See if the notation for specifying registers is X (most everyone) -dnl or rX (OS X) -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_POWERPC_REG],[ - AC_MSG_CHECKING([if PowerPC registers have r prefix]) - OPAL_TRY_ASSEMBLE([$opal_cv_asm_text - addi 1,1,0], - [opal_cv_asm_powerpc_r_reg=0], - [OPAL_TRY_ASSEMBLE([$opal_cv_asm_text - addi r1,r1,0], - [opal_cv_asm_powerpc_r_reg=1], - [AC_MSG_ERROR([Can not determine how to use PPC registers])])]) - if test "$opal_cv_asm_powerpc_r_reg" = "1" ; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - - AC_DEFINE_UNQUOTED([OPAL_POWERPC_R_REGISTERS], - [$opal_cv_asm_powerpc_r_reg], - [Whether r notation is used for ppc registers]) -])dnl - - -dnl ################################################################# -dnl -dnl OPAL_CHECK_POWERPC_64BIT -dnl -dnl On some powerpc chips (the PPC970 or G5), the OS usually runs in -dnl 32 bit mode, even though the hardware can do 64bit things. If -dnl the compiler will let us, emit code for 64bit test and set type -dnl operations (on a long long). -dnl -dnl ################################################################# -AC_DEFUN([OPAL_CHECK_POWERPC_64BIT],[ - if test "$ac_cv_sizeof_long" != "4" ; then - # this function should only be called in the 32 bit case - AC_MSG_ERROR([CHECK_POWERPC_64BIT called on 64 bit platform. Internal error.]) - fi - AC_MSG_CHECKING([for 64-bit PowerPC assembly support]) - case $host in - *-darwin*) - ppc64_result=0 - if test "$opal_cv_asm_powerpc_r_reg" = "1" ; then - ldarx_asm=" ldarx r1,r1,r1"; - else - ldarx_asm=" ldarx 1,1,1"; - fi - OPAL_TRY_ASSEMBLE([$opal_cv_asm_text - $ldarx_asm], - [ppc64_result=1], - [ppc64_result=0]) - ;; - *) - ppc64_result=0 - ;; - esac - - if test "$ppc64_result" = "1" ; then - AC_MSG_RESULT([yes]) - ifelse([$1],,:,[$1]) - else - AC_MSG_RESULT([no]) - ifelse([$2],,:,[$2]) - fi - - unset ppc64_result ldarx_asm -])dnl - dnl ################################################################# dnl @@ -1002,20 +498,16 @@ AC_DEFUN([OPAL_CHECK_CMPXCHG16B],[ OPAL_VAR_SCOPE_POP ])dnl + dnl ################################################################# dnl -dnl OPAL_CHECK_INLINE_GCC +dnl OPAL_CHECK_INLINE_GCC([action-if-found], [action-if-not-found]) dnl dnl Check if the compiler is capable of doing GCC-style inline dnl assembly. Some compilers emit a warning and ignore the inline dnl assembly (xlc on OS X) and compile without error. Therefore, dnl the test attempts to run the emitted code to check that the -dnl assembly is actually run. To run this test, one argument to -dnl the macro must be an assembly instruction in gcc format to move -dnl the value 0 into the register containing the variable ret. -dnl For PowerPC, this would be: -dnl -dnl "li %0,0" : "=&r"(ret) +dnl assembly is actually run. dnl dnl For testing ia32 assembly, the assembly instruction xaddl is dnl tested. The xaddl instruction is used by some of the atomic @@ -1024,289 +516,195 @@ dnl some compilers (i.e. earlier versions of Sun Studio 12) do not dnl necessarily handle xaddl properly, so that needs to be detected dnl during configure time. dnl -dnl DEFINE OPAL_GCC_INLINE_ASSEMBLY to 0 or 1 depending on GCC +dnl DEFINE OPAL_C_GCC_INLINE_ASSEMBLY to 0 or 1 depending on GCC dnl support dnl dnl ################################################################# AC_DEFUN([OPAL_CHECK_INLINE_C_GCC],[ - assembly="$1" - asm_result="unknown" + AC_CACHE_CHECK([if $CC supports GCC inline assembly], + [opal_cv_asm_gcc_inline_assembly], + [OPAL_VAR_SCOPE_PUSH([asm_result opal_gcc_inline_assign OPAL_C_GCC_INLINE_ASSEMBLY]) + + asm_result="unknown" - AC_MSG_CHECKING([if $CC supports GCC inline assembly]) + opal_gcc_inline_assign="" + case "${host}" in + x86_64-*x32|i?86-*|x86_64*|amd64*) + opal_gcc_inline_assign='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)' + ;; + aarch64*) + opal_gcc_inline_assign='"mov %0, #0" : "=&r"(ret)' + ;; + powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*) + opal_gcc_inline_assign='"1: li %0,0" : "=&r"(ret)' + ;; + esac - if test ! "$assembly" = "" ; then - AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ + AS_IF([test "$opal_gcc_inline_assign" != ""], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ int ret = 1; int negone = -1; -__asm__ __volatile__ ($assembly); +__asm__ __volatile__ ($opal_gcc_inline_assign); return ret; - ]])], - [asm_result="yes"], [asm_result="no"], - [asm_result="unknown"]) - else - assembly="test skipped - assuming no" - fi - - # if we're cross compiling, just try to compile and figure good enough - if test "$asm_result" = "unknown" ; then - AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ + ]])], + [asm_result="yes"], [asm_result="no"], + [asm_result="unknown"])], + [asm_result="no - architecture not supported"]) + + # if we're cross compiling, just try to compile and figure good enough + AS_IF([test "$asm_result" = "unknown"], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ int ret = 1; int negone = -1; -__asm__ __volatile__ ($assembly); +__asm__ __volatile__ ($opal_gcc_inline_assign); return ret; - ]])], - [asm_result="yes"], [asm_result="no"]) - fi - - AC_MSG_RESULT([$asm_result]) + ]])], + [asm_result="yes"], [asm_result="no"])]) + opal_cv_asm_gcc_inline_assembly="$asm_result" + OPAL_VAR_SCOPE_POP]) - if test "$asm_result" = "yes" ; then - OPAL_C_GCC_INLINE_ASSEMBLY=1 - opal_cv_asm_inline_supported="yes" - else - OPAL_C_GCC_INLINE_ASSEMBLY=0 - fi + AS_IF([test "$opal_cv_asm_gcc_inline_assembly" = "yes"], + [OPAL_C_GCC_INLINE_ASSEMBLY=1 + $1], + [OPAL_C_GCC_INLINE_ASSEMBLY=0 + $2]) AC_DEFINE_UNQUOTED([OPAL_C_GCC_INLINE_ASSEMBLY], [$OPAL_C_GCC_INLINE_ASSEMBLY], [Whether C compiler supports GCC style inline assembly]) - - unset OPAL_C_GCC_INLINE_ASSEMBLY assembly asm_result ])dnl + dnl ################################################################# dnl dnl OPAL_CONFIG_ASM dnl -dnl DEFINE OPAL_ASSEMBLY_ARCH to something in sys/architecture.h -dnl DEFINE OPAL_ASSEMBLY_FORMAT to string containing correct -dnl format for assembly (not user friendly) -dnl SUBST OPAL_ASSEMBLY_FORMAT to string containing correct -dnl format for assembly (not user friendly) +dnl Configure assembly support. AC_DEFINES the following: +dnl - OPAL_C_GCC_INLINE_ASSEMBLY - 1 if C compiler supports +dnl GCC-style inline assembly +dnl - OPAL_USE_C11_ATOMICS - 1 if atomics implementation should +dnl use C11-style atomics +dnl - OPAL_USE_GCC_BUILTIN_ATOMICS - 1 if atomics implementation +dnl should use GCC built-in style atomics +dnl - OPAL_USE_ASM_ATOMICS - 1 if atomics implementation should +dnl use inline assembly (using GCC-style inline assembly) +dnl for atomics implementation dnl dnl ################################################################# AC_DEFUN([OPAL_CONFIG_ASM],[ AC_REQUIRE([OPAL_SETUP_CC]) - AC_REQUIRE([OPAL_SETUP_CXX]) - AC_REQUIRE([AM_PROG_AS]) - AC_ARG_ENABLE([c11-atomics],[AS_HELP_STRING([--enable-c11-atomics], - [Enable use of C11 atomics if available (default: enabled)])]) + OPAL_VAR_SCOPE_PUSH([atomics_found want_c11_atomics want_gcc_builtin_atomics want_asm_atomics]) + + # only assembly style we support today is gcc-style inline + # assembly, find out if it works. We need this even for C11/GCC + # builtin atomics cases, because we use inline assembly for + # timers, LLSC, and 16 byte compare and swap routines. + OPAL_CHECK_INLINE_C_GCC([gcc_inline=1], [gcc_inline=0]) + + atomics_found=no + want_c11_atomics=0 + want_gcc_builtin_atomics=0 + want_asm_atomics=0 + + AC_ARG_ENABLE([c11-atomics], + [AS_HELP_STRING([--enable-c11-atomics], + [Enable use of C11 atomics if available. Note: GCC builtin atomics are currently preferred over C11 atomics. (default: use if available, disabled by default on 64-bit PowerPC)])]) AC_ARG_ENABLE([builtin-atomics], - [AS_HELP_STRING([--enable-builtin-atomics], - [Enable use of GCC built-in atomics (default: autodetect)])]) - - OPAL_CHECK_C11_CSWAP_INT128 - opal_cv_asm_builtin="BUILTIN_NO" - OPAL_CHECK_GCC_ATOMIC_BUILTINS - - if test "x$enable_c11_atomics" != "xno" && test "$opal_cv_c11_supported" = "yes" ; then - opal_cv_asm_builtin="BUILTIN_C11" - OPAL_CHECK_C11_CSWAP_INT128 - elif test "x$enable_c11_atomics" = "xyes"; then - AC_MSG_WARN([C11 atomics were requested but are not supported]) - AC_MSG_ERROR([Cannot continue]) - elif test "$enable_builtin_atomics" = "yes" ; then - if test $opal_cv_have___atomic = "yes" ; then - opal_cv_asm_builtin="BUILTIN_GCC" - else - AC_MSG_WARN([GCC built-in atomics requested but not found.]) - AC_MSG_ERROR([Cannot continue]) - fi - fi + [AS_HELP_STRING([--enable-builtin-atomics], + [Enable use of GCC built-in atomics. Currently preferred over C11 atomics. (default: use if available, disabled by default on 64-bit PowerPC)])]) - OPAL_CHECK_ASM_PROC - OPAL_CHECK_ASM_TEXT - OPAL_CHECK_ASM_GLOBAL - OPAL_CHECK_ASM_GNU_STACKEXEC - OPAL_CHECK_ASM_LABEL_SUFFIX - OPAL_CHECK_ASM_GSYM - OPAL_CHECK_ASM_LSYM - OPAL_CHECK_ASM_TYPE - OPAL_CHECK_ASM_SIZE - OPAL_CHECK_ASM_ALIGN_LOG - - # find our architecture for purposes of assembly stuff - opal_cv_asm_arch="UNSUPPORTED" - OPAL_GCC_INLINE_ASSIGN="" - if test "$opal_cv_have___atomic_64" ; then - OPAL_ASM_SUPPORT_64BIT=1 - else - OPAL_ASM_SUPPORT_64BIT=0 - fi + AC_ARG_ENABLE([builtin-atomics-for-ppc], + [AS_HELP_STRING([--enable-builtin-atomics-for-ppc], + [For performance reasons, 64-bit POWER architectures will not use C11 or GCC built-in atomics, even if --enable-c11-atomics is passed to configure. Enabling this option will re-enable support for both C11 and GCC built-in atomics.])]) - case "${host}" in - x86_64-*x32) - opal_cv_asm_arch="X86_64" - OPAL_ASM_SUPPORT_64BIT=1 - OPAL_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)' - ;; - i?86-*|x86_64*|amd64*) - if test "$ac_cv_sizeof_long" = "4" ; then - opal_cv_asm_arch="IA32" - else - opal_cv_asm_arch="X86_64" - fi - OPAL_ASM_SUPPORT_64BIT=1 - OPAL_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)' - OPAL_CHECK_CMPXCHG16B - ;; + # See the following github PR and some performance numbers/discussion: + # https://github.com/open-mpi/ompi/pull/8649 + # + # This logic is a bit convoluted, but matches existing logic in v4.x. + case "${host}" in + powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*) + AS_IF([test "$ac_cv_sizeof_long" = "8" -a "$enable_builtin_atomics_for_ppc" != "yes"], + [AS_IF([test "$enable_c11_atomics" != "no" -a "$enable_builtin_atomics" != "no"], + [AC_MSG_NOTICE([Disabling built-in and C11 atomics due to known performance issues on Powerpc])]) + AS_IF([test "$enable_c11_atomics" = "yes" -o "$enable_builtin_atomics" = "yes"], + [AC_MSG_WARN([Ignoring --enable-c11-atomics and --enable-builtin-atomics options on POWER. Set +--enable-builtin-atomics-for-ppc to re-enable.])]) + enable_c11_atomics="no" + enable_builtin_atomics="no"]) + ;; + esac - aarch64*) - opal_cv_asm_arch="ARM64" - OPAL_ASM_SUPPORT_64BIT=1 - OPAL_ASM_ARM_VERSION=8 - OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)' + # Option 1 for atomics: GCC-style Builtin + # + # We prefer builtin atomics over C11 atomics because our use of C11 atomics + # at this point is broken as it either incurs undue overheads or + # requires casts to _Atomic where there should be no casts. + AS_IF([test "$atomics_found" = "no" -a "$enable_builtin_atomics" != "no"], + [OPAL_CHECK_GCC_ATOMIC_BUILTINS + AS_IF([test $opal_cv_have___atomic = "yes"], + [AC_MSG_NOTICE([Using GCC built-in style atomics]) + atomics_found="GCC built-in style atomics" + want_gcc_builtin_atomics=1], + [test "$enable_builtin_atomics" = "yes"], + [AC_MSG_WARN([GCC built-in atomics requested but not found.]) + AC_MSG_ERROR([Cannot continue])])]) + + # Option 2 for atomics: C11 + # + # We currently always disable C11 atomics with the Intel compilers. + # We know builds older than 20200310 are broken with respect to + # C11 atomics, but have not apparently found a build we are happy + # with. In the future, this should be changed to a check for a + # particular Intel version. + AS_IF([test "$atomics_found" = "no" -a "$enable_c11_atomics" != "no" -a "$opal_cv_c11_supported" = "yes" -a "$opal_cv_c_compiler_vendor" != "intel"], + [AC_MSG_NOTICE([Using C11 atomics]) + OPAL_CHECK_C11_CSWAP_INT128 + want_c11_atomics=1 + atomics_found="C11 atomics"], + [test "$enable_c11_atomics" = "yes"], + [AC_MSG_WARN([C11 atomics were requested but are not supported]) + AC_MSG_ERROR([Cannot continue])]) + + # Option 3 for atomics: inline assembly + AS_IF([test "$atomics_found" = "no" -a "$gcc_inline" = "1"], + [case "${host}" in + x86_64-*x32|i?86-*|x86_64*|amd64*) + AS_IF([test "$ac_cv_sizeof_long" = "8"], + [OPAL_CHECK_CMPXCHG16B + atomics_found="x86_64 assembly"]) ;; - armv7*|arm-*-linux-gnueabihf) - opal_cv_asm_arch="ARM" - OPAL_ASM_SUPPORT_64BIT=1 - OPAL_ASM_ARM_VERSION=7 - OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)' + aarch64*) + atomics_found="aarch64 assembly" ;; - armv6*) - opal_cv_asm_arch="ARM" - OPAL_ASM_SUPPORT_64BIT=0 - OPAL_ASM_ARM_VERSION=6 - CCASFLAGS="$CCASFLAGS -march=armv7-a" - OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)' + powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*) + AS_IF([test "$ac_cv_sizeof_long" = "8"], + [atomics_found="PowerPC assembly"]) ;; + esac - powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*) - OPAL_CHECK_POWERPC_REG - if test "$ac_cv_sizeof_long" = "4" ; then - opal_cv_asm_arch="POWERPC32" - - # Note that on some platforms (Apple G5), even if we are - # compiling in 32 bit mode (and therefore should assume - # sizeof(long) == 4), we can use the 64 bit test and set - # operations. - OPAL_CHECK_POWERPC_64BIT(OPAL_ASM_SUPPORT_64BIT=1) - elif test "$ac_cv_sizeof_long" = "8" ; then - OPAL_ASM_SUPPORT_64BIT=1 - opal_cv_asm_arch="POWERPC64" - else - AC_MSG_ERROR([Could not determine PowerPC word size: $ac_cv_sizeof_long]) - fi - OPAL_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)' - ;; - *) - if test $opal_cv_have___atomic = "yes" ; then - opal_cv_asm_builtin="BUILTIN_GCC" - else - AC_MSG_ERROR([No atomic primitives available for $host]) - fi - ;; - esac + AS_IF([test "$atomics_found" != "no"], + [want_asm_atomics=1]) + AC_MSG_CHECKING([for inline assembly atomics]) + AC_MSG_RESULT([$atomics_found])]) - if ! test -z "$OPAL_ASM_ARM_VERSION" ; then - AC_DEFINE_UNQUOTED([OPAL_ASM_ARM_VERSION], [$OPAL_ASM_ARM_VERSION], - [What ARM assembly version to use]) - fi - - if test "$opal_cv_asm_builtin" = "BUILTIN_GCC" ; then - AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1], - [Whether C compiler supports GCC style inline assembly]) - else - AC_DEFINE_UNQUOTED([OPAL_ASM_SUPPORT_64BIT], - [$OPAL_ASM_SUPPORT_64BIT], - [Whether we can do 64bit assembly operations or not. Should not be used outside of the assembly header files]) - AC_SUBST([OPAL_ASM_SUPPORT_64BIT]) - - opal_cv_asm_inline_supported="no" - # now that we know our architecture, try to inline assemble - OPAL_CHECK_INLINE_C_GCC([$OPAL_GCC_INLINE_ASSIGN]) - - # format: - # config_file-text-global-label_suffix-gsym-lsym-type-size-align_log-ppc_r_reg-64_bit-gnu_stack - asm_format="default" - asm_format="${asm_format}-${opal_cv_asm_text}-${opal_cv_asm_global}" - asm_format="${asm_format}-${opal_cv_asm_label_suffix}-${opal_cv_asm_gsym}" - asm_format="${asm_format}-${opal_cv_asm_lsym}" - asm_format="${asm_format}-${opal_cv_asm_type}-${opal_asm_size}" - asm_format="${asm_format}-${opal_asm_align_log_result}" - if test "$opal_cv_asm_arch" = "POWERPC32" || test "$opal_cv_asm_arch" = "POWERPC64" ; then - asm_format="${asm_format}-${opal_cv_asm_powerpc_r_reg}" - else - asm_format="${asm_format}-1" - fi - asm_format="${asm_format}-${OPAL_ASM_SUPPORT_64BIT}" - opal_cv_asm_format="${asm_format}-${opal_cv_asm_gnu_stack}" - # For the Makefile, need to escape the $ as $$. Don't display - # this version, but make sure the Makefile gives the right thing - # when regenerating the files because the base has been touched. - OPAL_ASSEMBLY_FORMAT=`echo "$opal_cv_asm_format" | sed -e 's/\\\$/\\\$\\\$/'` - - AC_MSG_CHECKING([for assembly format]) - AC_MSG_RESULT([$opal_cv_asm_format]) - AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_FORMAT], ["$OPAL_ASSEMBLY_FORMAT"], - [Format of assembly file]) - AC_SUBST([OPAL_ASSEMBLY_FORMAT]) - fi # if opal_cv_asm_builtin = BUILTIN_GCC - - result="OPAL_$opal_cv_asm_arch" - OPAL_ASSEMBLY_ARCH="$opal_cv_asm_arch" - AC_MSG_CHECKING([for assembly architecture]) - AC_MSG_RESULT([$opal_cv_asm_arch]) - AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_ARCH], [$result], - [Architecture type of assembly to use for atomic operations and CMA]) - AC_SUBST([OPAL_ASSEMBLY_ARCH]) - - # Check for RDTSCP support - result=0 - AS_IF([test "$opal_cv_asm_arch" = "X86_64" || test "$opal_cv_asm_arch" = "IA32"], - [AC_MSG_CHECKING([for RDTSCP assembly support]) - AC_LANG_PUSH([C]) - AC_TRY_RUN([[ -int main(int argc, char* argv[]) -{ - unsigned int rax, rdx; - __asm__ __volatile__ ("rdtscp\n": "=a" (rax), "=d" (rdx):: "%rax", "%rdx"); - return 0; -} - ]], - [result=1 - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])], - [#cross compile not supported - AC_MSG_RESULT(["no (cross compiling)"])]) - AC_LANG_POP([C])]) - AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_SUPPORTS_RDTSCP], [$result], - [Whether we have support for RDTSCP instruction]) - - result="OPAL_$opal_cv_asm_builtin" - OPAL_ASSEMBLY_BUILTIN="$opal_cv_asm_builtin" - AC_MSG_CHECKING([for builtin atomics]) - AC_MSG_RESULT([$opal_cv_asm_builtin]) - AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_BUILTIN], [$result], - [Whether to use builtin atomics]) - AC_SUBST([OPAL_ASSEMBLY_BUILTIN]) - - OPAL_ASM_FIND_FILE - - unset result asm_format -])dnl + AS_IF([test "$atomics_found" = "no"], + [AC_MSG_ERROR([No usable atomics implementation found. Cannot continue.])]) + AC_DEFINE_UNQUOTED([OPAL_USE_C11_ATOMICS], + [$want_c11_atomics], + [Whether to use C11 atomics for atomics implementation]) + AC_DEFINE_UNQUOTED([OPAL_USE_GCC_BUILTIN_ATOMICS], + [$want_gcc_builtin_atomics], + [Whether to use GCC-style built-in atomics for atomics implementation]) + AC_DEFINE_UNQUOTED([OPAL_USE_ASM_ATOMICS], + [$want_asm_atomics], + [Whether to use assembly-coded atomics for atomics implementation]) -dnl ################################################################# -dnl -dnl OPAL_ASM_FIND_FILE -dnl -dnl -dnl do all the evil mojo to provide a working assembly file -dnl -dnl ################################################################# -AC_DEFUN([OPAL_ASM_FIND_FILE], [ - AC_REQUIRE([AC_PROG_GREP]) - AC_REQUIRE([AC_PROG_FGREP]) - -if test "$opal_cv_asm_arch" != "WINDOWS" && test "$opal_cv_asm_builtin" != "BUILTIN_GCC" && test "$opal_cv_asm_builtin" != "BUILTIN_OSX" && test "$opal_cv_asm_inline_arch" = "no" ; then - AC_MSG_ERROR([no atomic support available. exiting]) -else - # On windows with VC++, atomics are done with compiler primitives - opal_cv_asm_file="" -fi + OPAL_SUMMARY_ADD([Miscellaneous], [Atomics], [], [$atomics_found]) + + OPAL_VAR_SCOPE_POP ])dnl diff --git a/config/opal_config_files.m4 b/config/opal_config_files.m4 index 090b476d35a..cf4e658ef9f 100644 --- a/config/opal_config_files.m4 +++ b/config/opal_config_files.m4 @@ -4,6 +4,8 @@ # Copyright (c) 2020 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. +# Copyright (c) 2022-2024 Amazon.com, Inc. or its affiliates. +# All Rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -20,11 +22,11 @@ AC_DEFUN([OPAL_CONFIG_FILES],[ opal/include/Makefile opal/datatype/Makefile opal/util/Makefile + opal/util/json/Makefile opal/util/keyval/Makefile opal/mca/base/Makefile opal/tools/wrappers/Makefile opal/tools/wrappers/opalcc-wrapper-data.txt - opal/tools/wrappers/opalc++-wrapper-data.txt opal/tools/wrappers/opal.pc ]) ]) diff --git a/config/opal_config_hwloc.m4 b/config/opal_config_hwloc.m4 index 6f006f4044b..779e3daa585 100644 --- a/config/opal_config_hwloc.m4 +++ b/config/opal_config_hwloc.m4 @@ -3,9 +3,9 @@ dnl dnl Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved dnl Copyright (c) 2014-2018 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights -dnl reserved. +dnl Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl Copyright (c) 2020 Intel, Inc. All rights reserved. +dnl Copyright (c) 2022 IBM Corporation. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -20,36 +20,37 @@ dnl configure, abort. dnl dnl This macro will change the environment in the following way: dnl -dnl * opal_hwloc_header [legacy] - will be set if building -dnl internally, to the header file that should be included for -dnl embedded builds. This is used by PRRTE, but should not -dnl be used by new code. dnl * opal_hwloc_mode - either external or internal. If internal, dnl --with-hwloc should be ignored by other packages -dnl * opal_hwloc_CPPFLAGS - the C Preprocessor flags necessary to -dnl run the preprocessor on a file which relies on Hwloc -dnl headers. This will be folded into the global CPPFLAGS, -dnl so most people should never need this. -dnl * opal_hwloc_LDFLAGS - the linker flags necessary to run the -dnl linker on a file which relies on Hwloc libraries. This -dnl will be folded into the global CPPFLAGS, so most people -dnl should never need this. -dnl * opal_hwloc_LIBS - the libraries necessary to link source which -dnl uses Hwloc. Cannot be added to LIBS yet, because then -dnl other execution tests later in configure (there are sadly -dnl some) would fail if the path in LDFLAGS was not added to -dnl LD_LIBRARY_PATH. -dnl * CPPFLAGS, LDFLAGS - Updated opal_hwloc_CPPFLAGS and -dnl opal_hwloc_LDFLAGS. +dnl * CPPFLAGS, LDFLAGS, LIBS - Updated to build against hwloc. +dnl Note that the values may be updated right before +dnl config.status. +dnl +dnl OPAL_WRAPPER_FLAGS_ADD will be called to add the correct LDFLAGS, +dnl STATIC_LDFLAGS, LIBS, and STATIC_LIBS for hwloc. +dnl +dnl The following environment variables will only be set if +dnl opal_hwloc_mode is "internal": +dnl +dnl * opal_hwloc_BUILD_CPPFLAGS - the C Preprocessor flags +dnl necessary to run the preprocessor on a file which relies +dnl on hwloc headers. This will be folded into the global +dnl CPPFLAGS (see note above). +dnl * opal_hwloc_BUILD_LIBS - the libraries necessary to link +dnl source which uses hwloc. Cannot be added to LIBS yet, +dnl because then other execution tests later in configure +dnl (there are sadly some) would fail if the path in LDFLAGS +dnl was not added to LD_LIBRARY_PATH. +dnl * opal_hwloc_WRAPPER_LIBS - the linker flags necessary to +dnl add to the wrapper compilers in order to link an opal +dnl application when opal is built as a static library. AC_DEFUN([OPAL_CONFIG_HWLOC], [ - OPAL_VAR_SCOPE_PUSH([external_hwloc_happy internal_hwloc_happy]) + OPAL_VAR_SCOPE_PUSH([external_hwloc_happy internal_hwloc_happy opal_hwloc_STATIC_LDFLAGS opal_hwloc_LIBS opal_hwloc_STATIC_LIBS]) opal_show_subtitle "Configuring hwloc" OPAL_3RDPARTY_WITH([hwloc], [hwloc], [package_hwloc]) - opal_hwloc_header="" - # unless internal specifically requested by the user, try to find # an external that works. external_hwloc_happy=0 @@ -70,73 +71,106 @@ AC_DEFUN([OPAL_CONFIG_HWLOC], [ AS_IF([test "$external_hwloc_happy" = "0" -a "$internal_hwloc_happy" = "0"], [AC_MSG_ERROR([Could not find viable hwloc build.])]) - # this will work even if there is no hwloc package included, - # because hwloc_tarball and hwloc_directory will evaluate to an - # empty string. These are relative to the 3rd-party/ directory. + dnl this will work even if there is no hwloc package included, + dnl because hwloc_tarball and hwloc_directory will evaluate to an + dnl empty string. These are relative to the 3rd-party/ directory. OPAL_3RDPARTY_EXTRA_DIST="$OPAL_3RDPARTY_EXTRA_DIST hwloc_tarball" OPAL_3RDPARTY_DISTCLEAN_DIRS="$OPAL_3RDPARTY_DISTCLEAN_DIRS hwloc_directory" - AC_SUBST(opal_hwloc_LIBS) + OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [${opal_hwloc_LDFLAGS}]) + OPAL_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [${opal_hwloc_STATIC_LDFLAGS}]) + OPAL_WRAPPER_FLAGS_ADD([LIBS], [${opal_hwloc_LIBS}]) + OPAL_WRAPPER_FLAGS_ADD([STATIC_LIBS], [${opal_hwloc_STATIC_LIBS}]) + OPAL_WRAPPER_FLAGS_ADD([PC_MODULES], [${opal_hwloc_PC_MODULES}]) - OPAL_SUMMARY_ADD([[Miscellaneous]], [[hwloc]], [hwloc], [$opal_hwloc_mode]) + AC_CONFIG_COMMANDS_PRE([OPAL_CONFIG_HWLOC_INTERNAL_LIBS_HANDLER]) + + OPAL_SUMMARY_ADD([Miscellaneous], [hwloc], [], [$opal_hwloc_mode]) OPAL_VAR_SCOPE_POP ]) + dnl _OPAL_CONFIG_HWLOC_EXTERNAL(action-if-happy, action-if-not-happy) dnl dnl only safe to call from OPAL_CONFIG_HWLOC, assumes variables from dnl there are set. AC_DEFUN([_OPAL_CONFIG_HWLOC_EXTERNAL], [ - OPAL_VAR_SCOPE_PUSH([opal_hwloc_CPPFLAGS_save opal_hwloc_LDFLAGS_save opal_hwloc_LIBS_save opal_hwloc_external_support]) + OPAL_VAR_SCOPE_PUSH([opal_hwloc_min_num_version opal_hwloc_min_version opal_hwlox_max_num_version opal_hwloc_CPPFLAGS_save opal_hwloc_LDFLAGS_save opal_hwloc_LIBS_save opal_hwloc_external_support]) + + OAC_CHECK_PACKAGE([hwloc], + [opal_hwloc], + [hwloc.h], + [hwloc], + [hwloc_topology_init], + [opal_hwloc_external_support=yes], + [opal_hwloc_external_support=no]) + # need these set for the tests below. opal_hwloc_CPPFLAGS_save=$CPPFLAGS opal_hwloc_LDFLAGS_save=$LDFLAGS opal_hwloc_LIBS_save=$LIBS - AS_IF([test ! -z "$with_hwloc_libdir"], - [OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir], - [libhwloc.*])]) - - OPAL_CHECK_PACKAGE([opal_hwloc], - [hwloc.h], - [hwloc], - [hwloc_topology_init], - [], - [$with_hwloc], - [$with_hwloc_libdir], - [opal_hwloc_external_support=yes], - [opal_hwloc_external_support=no]) - - # need these set for the tests below. If things fail, will undo at the end. - CPPFLAGS="$opal_hwloc_CPPFLAGS_save $opal_hwloc_CPPFLAGS" - LDFLAGS="$opal_hwloc_LDFLAGS_save $opal_hwloc_LDFLAGS" - LIBS="$opal_hwloc_LIBS_save $opal_hwloc_LIBS" + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [$opal_hwloc_CPPFLAGS]) + OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [$opal_hwloc_LDFLAGS]) + OPAL_FLAGS_APPEND_UNIQ([LIBS], [$opal_hwloc_LIBS]) + opal_hwloc_min_num_version=OMPI_HWLOC_NUMERIC_MIN_VERSION + opal_hwloc_min_version=OMPI_HWLOC_NUMERIC_MIN_VERSION AS_IF([test "$opal_hwloc_external_support" = "yes"], - [AC_MSG_CHECKING([if external hwloc version is 1.6 or greater]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ -#if HWLOC_API_VERSION < 0x00010500 -#error "hwloc API version is less than 0x00010500" + [AC_MSG_CHECKING([if external hwloc version is version OMPI_HWLOC_MIN_VERSION or greater]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], [[ +#if HWLOC_API_VERSION < $opal_hwloc_min_num_version +#error "hwloc API version is less than $opal_hwloc_min_version" #endif ]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_WARN([external hwloc version is too old (1.5 or later required)]) + AC_MSG_WARN([external hwloc version is too old (OMPI_HWLOC_MIN_VERSION or later required)]) opal_hwloc_external_support="no"])]) + # Ensure that we are not using Hwloc >= v3.x. Open MPI does not + # (yet) support Hwloc >= v3.x (which will potentially have ABI and + # API breakage compared to <= v2.x), and using it would lead to + # complicated failure cases. Hence, we just abort outright if we + # find an external Hwloc >= v3.x. AS_IF([test "$opal_hwloc_external_support" = "yes"], - [AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include ]) + [AC_MSG_CHECKING([if external hwloc version is less than version 3.0.0]) + opal_hwloc_max_num_version=0x00030000 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], [[ +#if HWLOC_API_VERSION >= $opal_hwloc_max_num_version +#error "hwloc API version is >= $opal_hwloc_max_num_version" +#endif + ]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_WARN([External hwloc version is too new (less than v3.0.0 is required)]) + dnl Yes, the URL below will be wrong for master + dnl builds. But this is "good enough" -- we're + dnl more concerned about getting the URL correct + dnl for end-user builds of official release Open + dnl MPI distribution tarballs. + AC_MSG_WARN([See https://docs.open-mpi.org/en/v$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.x/installing-open-mpi/required-support-libraries.html for more details]) + AC_MSG_ERROR([Cannot continue])])]) + + AS_IF([test "$opal_hwloc_external_support" = "yes"], + [AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include +]) AC_CHECK_FUNCS([hwloc_topology_dup])]) + CPPFLAGS="$opal_hwloc_CPPFLAGS_save" LDFLAGS="$opal_hwloc_LDFLAGS_save" LIBS="$opal_hwloc_LIBS_save" AS_IF([test "$opal_hwloc_external_support" = "yes"], - [$1], - [CPPFLAGS="$opal_hwloc_CPPFLAGS_save" - $2]) + [dnl Do not add hwloc libs to LIBS until late, because + dnl it will screw up other tests (like the pthread tests) + opal_hwloc_BUILD_LIBS="${opal_hwloc_LIBS}" + + $1], + [$2]) OPAL_VAR_SCOPE_POP ]) @@ -148,31 +182,78 @@ dnl external hwloc is not going to be used. Assumes that if dnl this function is called, that success means the internal package dnl will be used. AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [ - OPAL_VAR_SCOPE_PUSH(subconfig_happy subconfig_prefix internal_hwloc_location) + OPAL_VAR_SCOPE_PUSH([subconfig_happy internal_hwloc_location extra_configure_args found_enable_plugins hwloc_config_arg pkg_config_file pkg_config_happy]) + + extra_configure_args= - AS_IF([test ! -z $prefix], [subconfig_prefix="--prefix=$prefix"]) + # look for a --{enable/disable}-plugins option in the top level + # configure arguments, so that we can add --enable-plugins if + # appropriate. + found_enable_plugins=0 + eval "set x $ac_configure_args" + shift + for hwloc_config_arg + do + case $hwloc_config_arg in + --enable-plugins|--enable-plugins=*|--disable-plugins) + found_enable_plugins=1 + ;; + esac + done + + # while the plugins in hwloc are not explicitly using Open MPI's dlopen + # interface, it seems rude to enable plugins in hwloc if the builder asked + # us not to use plugins in Open MPI. So only enable plugins in hwloc if there's + # a chance we're going to do so. We enable plugins by default so that libhwloc + # does not end up with a dependency on libcuda, which would mean everything else + # would end up with a dependency on libcuda (and similar). + AS_IF([test $found_enable_plugins -eq 0 -a "$enable_dlopen" != "no"], + [extra_configure_args="--enable-plugins"]) # Note: To update the version of hwloc shipped, update the # constant in autogen.pl. OPAL_EXPAND_TARBALL([3rd-party/hwloc_tarball], [3rd-party/hwloc_directory], [configure]) OPAL_SUBDIR_ENV_CLEAN([opal_hwloc_configure]) - PAC_CONFIG_SUBDIR_ARGS([3rd-party/hwloc_directory], [], [[--enable-debug]], + PAC_CONFIG_SUBDIR_ARGS([3rd-party/hwloc_directory], [$extra_configure_args], [[--enable-debug]], [subconfig_happy=1], [subconfig_happy=0]) OPAL_SUBDIR_ENV_RESTORE([opal_hwloc_configure]) - AS_IF([test "$subconfig_happy" = "1"], + AS_IF([test ${subconfig_happy} -eq 1], [internal_hwloc_location="3rd-party/hwloc_directory" - # note: because we only ship/commit a tarball (and not the source - # directory), the source is always expanded in the builddir, so we - # only need to add a -I to the builddir. + + dnl We do not consider it an error if pkg-config doesn't work / exist / etc. + pkg_config_file="${OMPI_TOP_BUILDDIR}/3rd-party/hwloc_directory/hwloc.pc" + pkg_config_happy=0 + + OAC_CHECK_PACKAGE_PARSE_PKGCONFIG([hwloc_internal], [opal_hwloc], [${pkg_config_file}], [pkg_config_happy=1]) + + dnl Don't pull LDFLAGS, because we don't have a good way to avoid + dnl a -L to our install directory, which can cause some weirdness + dnl if there's an old OMPI install there. And it makes filtering + dnl redundant flags easier. + opal_hwloc_LDFLAGS= + + dnl with no pkg-config data, guess. assume that -L${libdir} is already added to LDFLAGS + AS_IF([test $pkg_config_happy -eq 0], + [opal_hwloc_STATIC_LDFLAGS= + opal_hwloc_LIBS="-lhwloc" + opal_hwloc_STATIC_LIBS= + opal_hwloc_PC_MODULES=]) + + # note: because we only ship/commit a tarball (and not the + # source directory), the source is always expanded in the + # builddir, so we only need to add a -I to the builddir. + # Overwrite the OAC_CHECK_PACKAGE_PARSE PKGCONFIG results, + # because it's the install dir location, not the build + # location. opal_hwloc_CPPFLAGS="-I$OMPI_TOP_BUILDDIR/$internal_hwloc_location/include -I$OMPI_TOP_SRCDIR/$internal_hwloc_location/include" - CPPFLAGS="$CPPFLAGS $opal_hwloc_CPPFLAGS" + opal_hwloc_BUILD_CPPFLAGS="${opal_hwloc_CPPFLAGS}" + # No need to update LDFLAGS, because they will install into # our tree and in the mean time are referenced by their .la # files. - opal_hwloc_LIBS="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/hwloc/libhwloc.la" - - opal_hwloc_header="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/include/hwloc.h" + opal_hwloc_BUILD_LIBS="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/hwloc/libhwloc.la" + opal_hwloc_WRAPPER_LIBS="${opal_hwloc_LIBS}" # no need to add to DIST_SUBDIRS, because we only ship the # tarball. This is relative to the 3rd-party/ directory. @@ -182,3 +263,12 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [ OPAL_VAR_SCOPE_POP ]) + + +dnl We need to delay adding .la files to LIBS until the very end of +dnl configure, to avoid pulling it into other configure tests. +AC_DEFUN([OPAL_CONFIG_HWLOC_INTERNAL_LIBS_HANDLER], [ + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_hwloc_CPPFLAGS}]) + OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [$opal_hwloc_LDFLAGS]) + OPAL_FLAGS_APPEND_MOVE([LIBS], [${opal_hwloc_BUILD_LIBS}]) +]) diff --git a/config/opal_config_libevent.m4 b/config/opal_config_libevent.m4 index 7b78e0dede9..4e16d899696 100644 --- a/config/opal_config_libevent.m4 +++ b/config/opal_config_libevent.m4 @@ -4,8 +4,8 @@ dnl Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved dnl Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. dnl Copyright (c) 2015-2018 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights -dnl reserved. +dnl Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +dnl Copyright (c) 2022 IBM Corporation. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -20,36 +20,39 @@ dnl configure, abort. dnl dnl This macro will change the environment in the following way: dnl -dnl * opal_libevent_header [legacy] - will be set if building -dnl internally, to the header file that should be included for -dnl embedded builds. This is used by PRRTE, but should not -dnl be used by new code. dnl * opal_libevent_mode - either external or internal. If internal, dnl --with-libevent should be ignored by other packages -dnl * opal_libevent_CPPFLAGS - the C Preprocessor flags necessary to -dnl run the preprocessor on a file which relies on Libevent -dnl headers. This will be folded into the global CPPFLAGS, -dnl so most people should never need this. -dnl * opal_libevent_LDFLAGS - the linker flags necessary to run the -dnl linker on a file which relies on Libevent libraries. This -dnl will be folded into the global CPPFLAGS, so most people -dnl should never need this. -dnl * opal_libevent_LIBS - the libraries necessary to link source which -dnl uses Libevent. Cannot be added to LIBS yet, because then -dnl other execution tests later in configure (there are sadly -dnl some) would fail if the path in LDFLAGS was not added to -dnl LD_LIBRARY_PATH. -dnl * CPPFLAGS, LDFLAGS - Updated opal_libevent_CPPFLAGS and -dnl opal_libevent_LDFLAGS. +dnl * CPPFLAGS, LDFLAGS, LIBS - Updated to build against libevent. +dnl Note that the value may be updated right before +dnl config.status. +dnl +dnl OPAL_WRAPPER_FLAGS_ADD will be called to add the correct LDFLAGS, +dnl STATIC_LDFLAGS, LIBS, and STATIC_LIBS for libevent. Note that we +dnl intentionally do not use pkg-config modules for Libevent because +dnl we want to avoid libevent in preference for libevent_core. +dnl +dnl The following environment variables will only be set if +dnl opal_libevent_mode is "internal": +dnl +dnl * opal_libevent_BUILD_CPPFLAGS - the C Preprocessor flags +dnl necessary to run the preprocessor on a file which relies +dnl on Libevent headers. This will be folded into the global +dnl CPPFLAGS (see note above). +dnl * opal_libevent_BUILD_LIBS - the libraries necessary to link +dnl source which uses Libevent. Cannot be added to LIBS yet, +dnl because then other execution tests later in configure +dnl (there are sadly some) would fail if the path in LDFLAGS +dnl was not added to LD_LIBRARY_PATH. +dnl * opal_libevent_WRAPPER_LIBS - the linker flags necessary to +dnl add to the wrapper compilers in order to link an opal +dnl application when opal is built as a static library. AC_DEFUN([OPAL_CONFIG_LIBEVENT], [ - OPAL_VAR_SCOPE_PUSH([internal_libevent_happy external_libevent_happy]) + OPAL_VAR_SCOPE_PUSH([internal_libevent_happy external_libevent_happy opal_libevent_STATIC_LDFLAGS opal_libevent_LIBS opal_libevent_STATIC_LIBS]) opal_show_subtitle "Configuring Libevent" OPAL_3RDPARTY_WITH([libevent], [libevent], [package_libevent]) - opal_libevent_header="" - # unless internal specifically requested by the user, try to find # an external that works. external_libevent_happy=0 @@ -70,101 +73,128 @@ AC_DEFUN([OPAL_CONFIG_LIBEVENT], [ AS_IF([test "$external_libevent_happy" = "0" -a "$internal_libevent_happy" = "0"], [AC_MSG_ERROR([Could not find viable libevent build.])]) - # this will work even if there is no libevent package included, - # because libevent_tarball and libevent_directory will evaluate to - # an empty string. These are relative to the 3rd-party/ - # directory. - OPAL_3RDPARTY_EXTRA_DIST="$OPAL_3RDPARTY_EXTRA_DIST libevent_tarball" - OPAL_3RDPARTY_DISTCLEAN_DIRS="$OPAL_3RDPARTY_DISTCLEAN_DIRS libevent_directory" + dnl this will work even if there is no libevent package included, + dnl because libevent_tarball and libevent_directory will evaluate to + dnl an empty string. These are relative to the 3rd-party/ + dnl directory. + OPAL_APPEND([OPAL_3RDPARTY_EXTRA_DIST], [libevent_tarball]) + OPAL_APPEND([OPAL_3RDPARTY_DISTCLEAN_DIRS], [libevent_directory]) + + OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [${opal_libevent_LDFLAGS}]) + OPAL_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [${opal_libevent_STATIC_LDFLAGS}]) + OPAL_WRAPPER_FLAGS_ADD([LIBS], [${opal_libevent_LIBS}]) + OPAL_WRAPPER_FLAGS_ADD([STATIC_LIBS], [${opal_libevent_STATIC_LIBS}]) + OPAL_WRAPPER_FLAGS_ADD([PC_MODULES], [${opal_libevent_PC_MODULES}]) - AC_SUBST(opal_libevent_LIBS) + AC_CONFIG_COMMANDS_PRE([OPAL_CONFIG_LIBEVENT_INTERNAL_LIBS_HANDLER]) - OPAL_SUMMARY_ADD([[Miscellaneous]],[[libevent]],[libevent], [$opal_libevent_mode]) + OPAL_SUMMARY_ADD([Miscellaneous], [libevent], [], [$opal_libevent_mode]) OPAL_VAR_SCOPE_POP ]) + dnl _OPAL_CONFIG_LIBEVENT_EXTERNAL(action-if-happy, action-if-not-happy) dnl dnl only safe to call from OPAL_CONFIG_LIBEVENT, assumes variables dnl from there are set. AC_DEFUN([_OPAL_CONFIG_LIBEVENT_EXTERNAL], [ - OPAL_VAR_SCOPE_PUSH([opal_libevent_CPPFLAGS_save opal_libevent_LDFLAGS_save opal_libevent_LIBS_save opal_libevent_external_support]) + OPAL_VAR_SCOPE_PUSH([opal_event_min_version opal_event_min_num_version opal_libevent_CPPFLAGS_save opal_libevent_LDFLAGS_save opal_libevent_LIBS_save opal_libevent_external_support]) + + dnl Look at libevent_core, not libevent_pthread, because + dnl trying to avoid picking up libevent.so. The wrappers and + dnl ompi.pc will include the -levent_pthreads, so we're + dnl still good from a linking perspective. + m4_define([libevent_pkgconfig_module], [libevent_core]) + OAC_CHECK_PACKAGE([libevent], + [opal_libevent], + [event2/event.h], + [event_core], + [event_config_new], + [opal_libevent_external_support=yes], + [opal_libevent_external_support=no]) + dnl Manually add libevent_pthreads. + OPAL_APPEND([opal_libevent_LIBS], [-levent_pthreads]) + # need these set for the tests below. opal_libevent_CPPFLAGS_save=$CPPFLAGS - opal_libevent_LDFLAGS_save=$LDFLAGS - opal_libevent_LIBS_save=$LIBS - - AS_IF([test ! -z "$with_libevent_libdir"], - [OPAL_CHECK_WITHDIR([libevent-libdir], [$with_libevent_libdir], - [libevent.*])]) - - OPAL_CHECK_PACKAGE([opal_libevent], - [event2/event.h], - [event], - [event_config_new], - [-levent_pthreads], - [$with_libevent], - [$with_libevent_libdir], - [opal_libevent_external_support=yes], - [opal_libevent_external_support=no]) - - # need these set for the tests below. If things fail, will undo at the end. - CPPFLAGS="$opal_libevent_CPPFLAGS_save $opal_libevent_CPPFLAGS" - LDFLAGS="$opal_libevent_LDFLAGS_save $opal_libevent_LDFLAGS" - LIBS="$opal_libevent_LIBS_save $opal_libevent_LIBS" - - # Ensure that this libevent has the symbol - # "evthread_set_lock_callbacks", which will only exist if - # libevent was configured with thread support. + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [$opal_libevent_CPPFLAGS]) + + # verify libevent is configured with thread support AS_IF([test "$opal_libevent_external_support" = "yes"], - [AC_CHECK_LIB([event], [evthread_set_lock_callbacks], - [], - [AC_MSG_WARN([External libevent does not have thread support]) - AC_MSG_WARN([Open MPI requires libevent to be compiled with]) - AC_MSG_WARN([thread support enabled]) - opal_libevent_external_support=no])]) + [AC_CACHE_CHECK([if libevent threads enabled], + [opal_libevent_cv_threads_enabled], + [# Check for general threading support + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +#include +#include + ], [[ +#if !(EVTHREAD_LOCK_API_VERSION >= 1) +# error "No threads!" +#endif + ]])], + [opal_libevent_cv_threads_enabled="yes"], + [opal_libevent_cv_threads_enabled="no"])]) + AS_IF([test "${opal_libevent_cv_threads_enabled}" = "no"], + [AC_MSG_WARN([Open MPI requires libevent to be compiled with thread support enabled]) + opal_libevent_external_support="no"])]) AS_IF([test "$opal_libevent_external_support" = "yes"], - [AC_CHECK_LIB([event_pthreads], [evthread_use_pthreads], - [], - [AC_MSG_WARN([External libevent does not have thread support]) - AC_MSG_WARN([Open MPI requires libevent to be compiled with]) - AC_MSG_WARN([thread support enabled]) - opal_libevent_external_support=no])]) + [AC_CACHE_CHECK([for libevent pthreads support], + [opal_libevent_cv_pthread_support], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +#include +#include + ], [[ +#if !defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) || !EVTHREAD_USE_PTHREADS_IMPLEMENTED +# error "No pthreads!" +#endif + ]])], + [opal_libevent_cv_pthread_support="yes"], + [opal_libevent_cv_pthread_support="no"])]) + AS_IF([test "${opal_libevent_cv_pthread_support}" = "no"], + [AC_MSG_WARN([PMIX requires libevent to be compiled with pthread support enabled]) + opal_libevent_external_support="no"])]) # Open MPI used to fall back to the internal libevent if the # installed version was older than the internal version. This # isn't what we want, because we really want to prefer external # versions. Pin the "oldest supported" external version to # 2.0.21, which we know works from testing on RHEL7. + opal_event_min_num_version=OMPI_EVENT_NUMERIC_MIN_VERSION + opal_event_min_version=OMPI_EVENT_MIN_VERSION AS_IF([test "$opal_libevent_external_support" = "yes"], - [AC_MSG_CHECKING([if external libevent version is 2.0.21 or greater]) - AC_COMPILE_IFELSE( + [AC_CACHE_CHECK([if external libevent version is OMPI_EVENT_MIN_VERSION or greater], + [opal_libevent_cv_version_check], + [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], - [[ -#if defined(_EVENT_NUMERIC_VERSION) && _EVENT_NUMERIC_VERSION < 0x02001500 -#error "libevent API version is less than 0x02001500" -#elif defined(EVENT__NUMERIC_VERSION) && EVENT__NUMERIC_VERSION < 0x02001500 -#error "libevent API version is less than 0x02001500" + [[ +#if defined(_EVENT_NUMERIC_VERSION) && _EVENT_NUMERIC_VERSION < $opal_event_min_num_version +#error "libevent API version is less than $opal_event_min_version" +#elif defined(EVENT__NUMERIC_VERSION) && EVENT__NUMERIC_VERSION < $opal_event_min_num_version +#error "libevent API version is less than $opal_event_min_version" #endif - ]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_WARN([external libevent version is too old (2.0.21 or later required)]) - opal_libevent_external_support=no])]) + ]])], + [opal_libevent_cv_version_check="yes"], + [opal_libevent_cv_version_check="no"])]) + AS_IF([test "${opal_libevent_cv_version_check}" = "no"], + [AC_MSG_WARN([external libevent version is too old (OMPI_EVENT_MIN_VERSION or later required)]) + opal_libevent_external_support=no])]) - LDFLAGS="$opal_libevent_LDFLAGS_save" - LIBS="$opal_libevent_LIBS_save" + CPPFLAGS="$opal_libevent_CPPFLAGS_save" AS_IF([test "$opal_libevent_external_support" = "yes"], - [$1], - [CPPFLAGS="$opal_libevent_CPPFLAGS_save" - $2]) + [dnl Do not add libevent flags until late, because + dnl it will screw up other tests (like the pthread tests) + opal_libevent_BUILD_LIBS="${opal_libevent_LIBS}" + + $1], + [$2]) OPAL_VAR_SCOPE_POP ]) + dnl _OPAL_CONFIG_LIBEVENT_INTERNAL(action-if-happy, action-if-not-happy) dnl dnl Configure the packaged libevent. Only needs to be run if the @@ -189,34 +219,55 @@ AC_DEFUN([_OPAL_CONFIG_LIBEVENT_INTERNAL], [ [], [subconfig_happy=1], [subconfig_happy=0]) OPAL_SUBDIR_ENV_RESTORE([opal_libevent_configure]) - AS_IF([test "$subconfig_happy" = "1"], + AS_IF([test ${subconfig_happy} -eq 1], [internal_libevent_location="3rd-party/libevent_directory" + + # The tarball as configured can not be used for compile + # tests, because libevent uses a Makefile rule rather than + # Autoconf to generate their config file (sigh). Force + # generation of that file now, so that other 3rd party + # packages can run compile tests. + AC_MSG_NOTICE([Generating Libevent's event-config.h]) + (cd $OMPI_TOP_BUILDDIR/$internal_libevent_location/ ; ${MAKE-make} include/event2/event-config.h) + AS_IF([test $? -ne 0], [AC_MSG_ERROR([Could not generate event-config.h.])]) + + # because we don't use pkg-config with libevent, have to + # guess at many of these fields (and likely get static + # versions wrong). + opal_libevent_LDFLAGS= + opal_libevent_STATIC_LDFLAGS= + opal_libevent_LIBS="-levent_core -levent_pthreads" + opal_libevent_STATIC_LIBS= + + AC_MSG_CHECKING([for internal libevent LIBS]) + AC_MSG_RESULT([${opal_libevent_LIBS}]) + # note: because we only ship/commit a tarball (and not the source # directory), the source is always expanded in the builddir, so we # only need to add a -I to the builddir. opal_libevent_CPPFLAGS="-I$OMPI_TOP_BUILDDIR/$internal_libevent_location -I$OMPI_TOP_BUILDDIR/$internal_libevent_location/include" - CPPFLAGS="$CPPFLAGS $opal_libevent_CPPFLAGS" + opal_libevent_BUILD_CPPFLAGS="${opal_libevent_CPPFLAGS}" + # No need to update LDFLAGS, because they will install into # our tree and in the mean time are referenced by their .la # files. - opal_libevent_LIBS="$OMPI_TOP_BUILDDIR/$internal_libevent_location/libevent.la $OMPI_TOP_BUILDDIR/$internal_libevent_location/libevent_pthreads.la" - - opal_libevent_header="$OMPI_TOP_BUILDDIR/$internal_libevent_location/event.h" + opal_libevent_BUILD_LIBS="$OMPI_TOP_BUILDDIR/$internal_libevent_location/libevent_core.la $OMPI_TOP_BUILDDIR/$internal_libevent_location/libevent_pthreads.la" + opal_libevent_WRAPPER_LIBS="${opal_libevent_LIBS}" # no need to add to DIST_SUBDIRS, because we only ship the # tarball. This is relative to the 3rd-party/ directory. OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS libevent_directory" - # The tarball as configured can not be used for compile - # tests, because libevent uses a Makefile rule rather than - # Autoconf to generate their config file (sigh). Force - # generation of that file now, so that other 3rd party - # packages can run compile tests. - AC_MSG_NOTICE([Generating Libevent's event-config.h]) - (cd $OMPI_TOP_BUILDDIR/$internal_libevent_location/ ; ${MAKE-make} include/event2/event-config.h) - AS_IF([test $? -ne 0], [AC_MSG_ERROR([Could not generate event-config.h.])]) - $1], [$2]) OPAL_VAR_SCOPE_POP ]) + + +dnl We need to delay adding .la files to LIBS until the very end of +dnl configure, to avoid pulling it into other configure tests. +AC_DEFUN([OPAL_CONFIG_LIBEVENT_INTERNAL_LIBS_HANDLER], [ + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_libevent_CPPFLAGS}]) + OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [${opal_libevent_LDFLAGS}]) + OPAL_FLAGS_APPEND_MOVE([LIBS], [${opal_libevent_BUILD_LIBS}]) +]) diff --git a/config/opal_config_pmix.m4 b/config/opal_config_pmix.m4 index 5b13e6bd082..bea801c335e 100644 --- a/config/opal_config_pmix.m4 +++ b/config/opal_config_pmix.m4 @@ -16,11 +16,10 @@ dnl reserved. dnl Copyright (c) 2014-2020 Intel, Inc. All rights reserved. dnl Copyright (c) 2014-2021 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2016-2021 IBM Corporation. All rights reserved. +dnl Copyright (c) 2016-2022 IBM Corporation. All rights reserved. dnl Copyright (c) 2020 Triad National Security, LLC. All rights dnl reserved. -dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights -dnl reserved. +dnl Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. dnl Copyright (c) 2021 Nanook Consulting. All rights reserved. dnl $COPYRIGHT$ dnl @@ -36,77 +35,92 @@ dnl configure, abort. dnl dnl This macro will change the environment in the following way: dnl -dnl * opal_pmix_header [legacy] - will be set if building -dnl internally, to the header file that should be included for -dnl embedded builds. This is used by PRRTE, but should not -dnl be used by new code. dnl * opal_pmix_mode - either external or internal. If internal, dnl --with-pmix should be ignored by other packages -dnl * opal_pmix_CPPFLAGS - the C Preprocessor flags necessary to +dnl * CPPFLAGS, LDFLAGS, LIBS - Updated to build against PMIx. +dnl Note that the values may be updated right before +dnl config.status, to avoid interfering with other tests. +dnl +dnl OPAL_WRAPPER_FLAGS_ADD will be called to add the correct LDFLAGS, +dnl STATIC_LDFLAGS, LIBS, and STATIC_LIBS for PMIx. +dnl +dnl The following environment variables will only be set if +dnl opal_pmix_mode is "internal": +dnl +dnl * opal_pmix_BUILD_CPPFLAGS - the C Preprocessor flags necessary to dnl run the preprocessor on a file which relies on PMIx -dnl headers. This will be folded into the global CPPFLAGS, -dnl so most people should never need this. -dnl * opal_pmix_LDFLAGS - the linker flags necessary to run the -dnl linker on a file which relies on PMIx libraries. This -dnl will be folded into the global CPPFLAGS, so most people -dnl should never need this. -dnl * opal_pmix_LIBS - the libraries necessary to link source which +dnl headers. This will be folded into the global +dnl CPPFLAGS (see note above). +dnl * opal_pmix_BUILD_LIBS - the libraries necessary to link source which dnl uses PMIx. Cannot be added to LIBS yet, because then dnl other execution tests later in configure (there are sadly dnl some) would fail if the path in LDFLAGS was not added to dnl LD_LIBRARY_PATH. -dnl * CPPFLAGS, LDFLAGS - Updated opal_pmix_CPPFLAGS and -dnl opal_pmix_LDFLAGS. AC_DEFUN([OPAL_CONFIG_PMIX], [ - OPAL_VAR_SCOPE_PUSH([external_pmix_happy internal_pmix_happy internal_pmix_args internal_pmix_libs internal_pmix_CPPFLAGS]) + OPAL_VAR_SCOPE_PUSH([external_pmix_happy internal_pmix_happy internal_pmix_args internal_pmix_wrapper_libs internal_pmix_CPPFLAGS opal_pmix_STATIC_LDFLAGS opal_pmix_LIBS opal_pmix_STATIC_LIBS]) opal_show_subtitle "Configuring PMIx" OPAL_3RDPARTY_WITH([pmix], [pmix], [package_pmix]) - opal_pmix_header="" - internal_pmix_happy=0 m4_ifdef([package_pmix], - [# always configure the internal pmix, so that - # make dist always works. - internal_pmix_args="--without-tests-examples --disable-pmix-binaries --disable-pmix-backward-compatibility --disable-visibility" - internal_pmix_libs= - internal_pmix_CPPFLAGS= - - OMPI_PMIX_ADD_ARGS - - AS_IF([test "$opal_libevent_mode" = "internal"], - [internal_pmix_args="$internal_pmix_args --with-libevent=cobuild" - internal_pmix_CPPFLAGS="$internal_pmix_CPPFLAGS $opal_libevent_CPPFLAGS" - internal_pmix_libs="$internal_pmix_libs $opal_libevent_LIBS"]) - - AS_IF([test "$opal_hwloc_mode" = "internal"], - [internal_pmix_args="$internal_pmix_args --with-hwloc=cobuild" - internal_pmix_CPPFLAGS="$internal_pmix_CPPFLAGS $opal_hwloc_CPPFLAGS" - internal_pmix_libs="$internal_pmix_libs $opal_hwloc_LIBS"]) - - AS_IF([test ! -z "$internal_pmix_libs"], - [internal_pmix_args="$internal_pmix_args --with-prte-extra-lib=\"$internal_pmix_libs\""]) - - if test "$WANT_DEBUG" = "1"; then - internal_pmix_args="$internal_pmix_args --enable-debug" - fi - - # Pass all our compiler/linker flags to PMIx, so that it - # picks up how to build an internal HWLOC and libevent, plus - # picks up any user-specified compiler flags from the master - # configure run. - OPAL_SUBDIR_ENV_CLEAN([opal_pmix_configure]) - AS_IF([test -n "$internal_pmix_CPPFLAGS"], - [OPAL_SUBDIR_ENV_APPEND([CPPFLAGS], [$internal_pmix_CPPFLAGS])]) - PAC_CONFIG_SUBDIR_ARGS([3rd-party/openpmix], [$internal_pmix_args], - [[--with-libevent=internal], [--with-hwloc=internal], - [--with-libevent=external], [--with-hwloc=external], - [--with-pmix=[[^ ]]*], [--with-platform=[[^ ]]*]], - [internal_pmix_happy=1]) - OPAL_SUBDIR_ENV_RESTORE([opal_pmix_configure]) - OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS openpmix"]) + [OMPI_PMIX_ADD_ARGS + AS_IF([test "$opal_pmix_mode" = "unspecified" -o "$opal_pmix_mode" = "internal"], + [# Run PMIx's configure script unless the user + # explicitly asked us to use an external PMIX, so that + # "make dist" includes PMIx in the dist tarball. This + # does mean that "make dist" will not work if Open MPI + # was configured to use an external PMIx library, but + # we decided this was a reasonable tradeoff for not + # having to deal with PMIx (or PRRTE) potentially + # failing to configure in a situation where it isn't + # desired. + + internal_pmix_args="--without-tests-examples --enable-pmix-binaries --disable-pmix-backward-compatibility --disable-visibility" + # Open PMIx sets -Werror on devel builds so avoid buid breaks caused by 3rd-party codes + internal_pmix_args="$internal_pmix_args --disable-devel-check" + internal_pmix_wrapper_libs= + internal_pmix_CPPFLAGS= + + AS_IF([test "$opal_libevent_mode" = "internal"], + [OPAL_APPEND([internal_pmix_args], [--with-libevent --disable-libevent-lib-checks]) + OPAL_APPEND([internal_pmix_args], [--with-libevent-extra-libs=\"$opal_libevent_BUILD_LIBS\"]) + OPAL_APPEND([internal_pmix_wrapper_libs], [$opal_libevent_WRAPPER_LIBS]) + OPAL_APPEND([internal_pmix_CPPFLAGS], [$opal_libevent_BUILD_CPPFLAGS])]) + + AS_IF([test "$opal_hwloc_mode" = "internal"], + [OPAL_APPEND([internal_pmix_args], [--disable-hwloc-lib-checks]) + OPAL_APPEND([internal_pmix_args], [--with-hwloc-extra-libs=\"$opal_hwloc_BUILD_LIBS\"]) + OPAL_APPEND([internal_pmix_wrapper_libs], [$opal_hwloc_WRAPPER_BUILD_LIBS]) + OPAL_APPEND([internal_pmix_CPPFLAGS], [$opal_hwloc_BUILD_CPPFLAGS])]) + + if test "$WANT_DEBUG" = "1"; then + OPAL_APPEND([internal_pmix_args], [--enable-debug]) + fi + + # Pass all our compiler/linker flags to PMIx, so that it + # picks up how to build an internal HWLOC and libevent, plus + # picks up any user-specified compiler flags from the master + # configure run. + OPAL_SUBDIR_ENV_CLEAN([opal_pmix_configure]) + AS_IF([test -n "$internal_pmix_CPPFLAGS"], + [OPAL_SUBDIR_ENV_APPEND([CPPFLAGS], [$internal_pmix_CPPFLAGS])]) + AS_IF([test -n "$internal_pmix_wrapper_libs"], + [OPAL_APPEND([internal_pmix_args], [--with-wrapper-libs=\"$internal_pmix_wrapper_libs\"])]) + + PAC_CONFIG_SUBDIR_ARGS([3rd-party/openpmix], [$internal_pmix_args], + [[--with-libevent=internal], [--with-hwloc=internal], + [--with-libevent=external], [--with-hwloc=external], + [--with-pmix=[[^ ]]*], [--with-platform=[[^ ]]*]], + [internal_pmix_happy=1]) + OPAL_SUBDIR_ENV_RESTORE([opal_pmix_configure]) + OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS openpmix"]) + + # if we have a pmix package and configure did not complete + # successfully (or wasn't started), then disable make dist. + AS_IF([test $internal_pmix_happy != 1], + [OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PMIX"])]) # unless internal specifically requested by the user, try to find # an external that works. @@ -122,16 +136,26 @@ AC_DEFUN([OPAL_CONFIG_PMIX], [ # so try the internal version. AS_IF([test "$external_pmix_happy" = "0" -a "$internal_pmix_happy" = "1"], [opal_pmix_mode="internal" - _OPAL_CONFIG_PMIX_INTERNAL_POST()]) + OPAL_USING_INTERNAL_PMIX=1 + _OPAL_CONFIG_PMIX_INTERNAL_POST()], + [OPAL_USING_INTERNAL_PMIX=0]) AS_IF([test "$external_pmix_happy" = "0" -a "$internal_pmix_happy" = "0"], [AC_MSG_ERROR([Could not find viable pmix build.])]) - AC_SUBST(opal_pmix_CPPFLAGS) - AC_SUBST(opal_pmix_LDFLAGS) - AC_SUBST(opal_pmix_LIBS) + OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [${opal_pmix_LDFLAGS}]) + OPAL_WRAPPER_FLAGS_ADD([STATIC_LDFLAGS], [${opal_pmix_STATIC_LDFLAGS}]) + OPAL_WRAPPER_FLAGS_ADD([LIBS], [${opal_pmix_LIBS}]) + OPAL_WRAPPER_FLAGS_ADD([STATIC_LIBS], [${opal_pmix_STATIC_LIBS}]) + OPAL_WRAPPER_FLAGS_ADD([PC_MODULES], [${opal_pmix_PC_MODULES}]) - OPAL_SUMMARY_ADD([[Miscellaneous]], [[pmix]], [pmix], [$opal_pmix_mode]) + AC_CONFIG_COMMANDS_PRE([OPAL_CONFIG_PMIX_INTERNAL_LIBS_HANDLER]) + + AC_DEFINE_UNQUOTED([OPAL_USING_INTERNAL_PMIX], + [$OPAL_USING_INTERNAL_PMIX], + [Whether or not we are using the internal PMIx]) + + OPAL_SUMMARY_ADD([Miscellaneous], [pmix], [], [$opal_pmix_mode]) OPAL_VAR_SCOPE_POP ]) @@ -141,11 +165,7 @@ dnl dnl only safe to call from OPAL_CONFIG_PMIX, assumes variables from dnl there are set. AC_DEFUN([_OPAL_CONFIG_PMIX_EXTERNAL], [ - OPAL_VAR_SCOPE_PUSH([opal_pmix_CPPFLAGS_save opal_pmix_LDFLAGS_save opal_pmix_LIBS_save opal_pmix_external_support]) - - opal_pmix_CPPFLAGS_save=$CPPFLAGS - opal_pmix_LDFLAGS_save=$LDFLAGS - opal_pmix_LIBS_save=$LIBS + OPAL_VAR_SCOPE_PUSH([opal_pmix_min_version opal_pmix_min_num_version opal_pmix_CPPFLAGS_save opal_pmix_LDFLAGS_save opal_pmix_LIBS_save opal_pmix_external_support]) opal_pmix_external_support="yes" @@ -153,44 +173,51 @@ AC_DEFUN([_OPAL_CONFIG_PMIX_EXTERNAL], [ [opal_pmix_external_support="no" AS_IF([test "$opal_pmix_mode" = "external"], [AC_MSG_ERROR([Building against an external PMIx with an internal Libevent or HWLOC is unsupported. Cannot continue.])])], - [AS_IF([test ! -z "$with_pmix_libdir"], - [OPAL_CHECK_WITHDIR([pmix-libdir], [$with_pmix_libdir], - [libpmix.*])]) - - OPAL_CHECK_PACKAGE([opal_pmix], - [pmix.h], - [pmix], - [PMIx_Init], - [], - [$with_pmix], - [$with_pmix_libdir], - [], - [opal_pmix_external_support=no]) - - # need these set for the tests below. If things fail, will undo at the end. + + [dnl Need to explicitly enable wrapper compiler to get the dependent libraries + dnl when pkg-config is not available. + pmix_USE_WRAPPER_COMPILER=1 + OAC_CHECK_PACKAGE([pmix], + [opal_pmix], + [pmix.h], + [pmix], + [PMIx_Init], + [], + [opal_pmix_external_support=no]) + + opal_pmix_CPPFLAGS_save=$CPPFLAGS + opal_pmix_LDFLAGS_save=$LDFLAGS + opal_pmix_LIBS_save=$LIBS + CPPFLAGS="$opal_pmix_CPPFLAGS_save $opal_pmix_CPPFLAGS" LDFLAGS="$opal_pmix_LDFLAGS_save $opal_pmix_LDFLAGS" LIBS="$opal_pmix_LIBS_save $opal_pmix_LIBS" + opal_pmix_min_num_version=OMPI_PMIX_NUMERIC_MIN_VERSION + opal_pmix_min_version=OMPI_PMIX_MIN_VERSION AS_IF([test "$opal_pmix_external_support" = "yes"], - [AC_MSG_CHECKING([if external PMIx version is 3.1.5 or greater]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ -#if PMIX_NUMERIC_VERSION < 0x00030105 -#error "pmix API version is less than 3.1.5" + [AC_MSG_CHECKING([if external PMIx version is OMPI_PMIX_MIN_VERSION or greater]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], [[ +#if PMIX_NUMERIC_VERSION < $opal_pmix_min_num_version +#error "pmix API version is less than $opal_pmix_min_version" #endif ]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) opal_pmix_external_support=no])]) + CPPFLAGS="$opal_pmix_CPPFLAGS_save" LDFLAGS="$opal_pmix_LDFLAGS_save" LIBS="$opal_pmix_LIBS_save" AS_IF([test "$opal_pmix_external_support" = "yes"], - [$1], - [CPPFLAGS="$opal_pmix_CPPFLAGS_save" - $2])]) + [dnl Do not add libevent libs to LIBS until late, because + dnl it will screw up other tests (like the pthread tests) + opal_pmix_BUILD_LIBS="${opal_pmix_LIBS}" + + $1], + [$2])]) OPAL_VAR_SCOPE_POP ]) @@ -201,13 +228,74 @@ dnl Expectation is that this is called only if external fails, the dnl caller configured libpmix configure, and the configure script dnl succeeded. AC_DEFUN([_OPAL_CONFIG_PMIX_INTERNAL_POST], [ - opal_pmix_CPPFLAGS="-I$OMPI_TOP_BUILDDIR/3rd-party/openpmix/include -I$OMPI_TOP_SRCDIR/3rd-party/openpmix/include" - opal_pmix_LDFLAGS="" - opal_pmix_LIBS="$OMPI_TOP_BUILDDIR/3rd-party/openpmix/src/libpmix.la" + dnl pkg-config might not always be available, and we always need + dnl to pull in the relevant flags. We parse the compiler wrapper + dnl config file all the time rather than use pkg-config when + dnl available, so that we have a smaller testing surface. + datafile="${OMPI_TOP_BUILDDIR}/3rd-party/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt" + AS_IF([test ! -f "${datafile}"], + [AC_MSG_ERROR([Cannot find PMIx wrapper compiler data. Aborting])]) + + pmix_internal_happy=1 + + dnl Don't pull LDFLAGS, because we don't have a good way to avoid + dnl a -L to our install directory, which can cause some weirdness + dnl if there's an old OMPI install there. And it makes filtering + dnl redundant flags easier. + opal_pmix_LDFLAGS= + + AC_CACHE_CHECK([for internal pmix static LDFLAGS], + [opal_internal_pmix_cv_STATIC_LDFLAGS], + [_OPAL_CONFIG_PMIX_GET_WRAPPER_FIELD([${datafile}], [linker_flags_static], + [opal_internal_pmix_cv_STATIC_LDFLAGS], + [], [pmix_internal_happy=0])]) + opal_pmix_STATIC_LDFLAGS="${opal_internal_pmix_cv_STATIC_LDFLAGS}" + + AC_CACHE_CHECK([for internal pmix LIBS], + [opal_internal_pmix_cv_LIBS], + [_OPAL_CONFIG_PMIX_GET_WRAPPER_FIELD([${datafile}], [libs], + [opal_internal_pmix_cv_LIBS], + [], [pmix_internal_happy=0])]) + opal_pmix_LIBS="${opal_internal_pmix_cv_LIBS}" + + AC_CACHE_CHECK([for internal pmix static LIBS], + [opal_internal_pmix_cv_STATIC_LIBS], + [_OPAL_CONFIG_PMIX_GET_WRAPPER_FIELD([${datafile}], [libs_static], + [opal_internal_pmix_cv_STATIC_LIBS], + [], [pmix_internal_happy=0])]) + opal_pmix_STATIC_LIBS="${opal_internal_pmix_cv_STATIC_LIBS}" - CPPFLAGS="$CPPFLAGS $opal_pmix_CPPFLAGS" + AC_MSG_CHECKING([for internal pmix pkg-config module]) + opal_pmix_PC_MODULES="pmix" + AC_MSG_RESULT([${opal_pmix_PC_MODULES}]) - opal_pmix_header="$OMPI_TOP_SRCDIR/opal/mca/pmix/pmix-3rdparty.h" + AS_IF([test ${pmix_internal_happy} -eq 0], + [AC_MSG_ERROR([Failed to retrieve PMIx wrapper data. Aborting.])]) + + # Overwrite the wrapper data results for CPPFLAGS, because it's + # the install dir location, not the build location. + opal_pmix_CPPFLAGS="-I$OMPI_TOP_BUILDDIR/3rd-party/openpmix/include -I$OMPI_TOP_SRCDIR/3rd-party/openpmix/include -I$OMPI_TOP_BUILDDIR/3rd-party/openpmix/ -I$OMPI_TOP_SRCDIR/3rd-party/openpmix/" + opal_pmix_BUILD_CPPFLAGS="${opal_pmix_CPPFLAGS}" + + opal_pmix_BUILD_LIBS="$OMPI_TOP_BUILDDIR/3rd-party/openpmix/src/libpmix.la" OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS openpmix" ]) + + +AC_DEFUN([_OPAL_CONFIG_PMIX_GET_WRAPPER_FIELD], [ + OAC_LOG_COMMAND([wrapper_field_results=`sed -ne 's/$2=\(.*\)/\1/p' $1 2>&1`], + [AS_VAR_COPY([$3], [wrapper_field_results]) + $4], + [$5]) + OAC_LOG_MSG([wrapper field output: $2: ${wrapper_field_results}], [1]) +]) + + +dnl We need to delay adding .la files to LIBS until the very end of +dnl configure, to avoid pulling it into other configure tests. +AC_DEFUN([OPAL_CONFIG_PMIX_INTERNAL_LIBS_HANDLER], [ + OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}]) + OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [${opal_pmix_LDFLAGS}]) + OPAL_FLAGS_APPEND_MOVE([LIBS], [${opal_pmix_BUILD_LIBS}]) +]) diff --git a/config/opal_config_subdir.m4 b/config/opal_config_subdir.m4 index b6e20c802b3..0b920bf7e3a 100644 --- a/config/opal_config_subdir.m4 +++ b/config/opal_config_subdir.m4 @@ -52,30 +52,30 @@ if test "$subdir_dir" != ":" && test -d $srcdir/$subdir_dir; then case $srcdir in .) - ;; + ;; *) - { case $subdir_dir in - [[\\/]]* | ?:[[\\/]]* ) total_dir=;; - *) total_dir=.;; - esac - temp=$subdir_dir - for dir_part in `IFS='/\\'; set X $temp; shift; echo "$[@]"`; do - case $dir_part in - # Skip DOS drivespec - ?:) total_dir=$dir_part ;; - *) total_dir=$total_dir/$dir_part - test -d "$total_dir" || - mkdir "$total_dir" || - AC_MSG_ERROR([cannot create $subdir_dir]) - ;; - esac - done; } - - if test -d ./$subdir_dir; then :; - else - AC_MSG_ERROR([cannot create `pwd`/$subdir_dir]) - fi - ;; + { case $subdir_dir in + [[\\/]]* | ?:[[\\/]]* ) total_dir=;; + *) total_dir=.;; + esac + temp=$subdir_dir + for dir_part in `IFS='/\\'; set X $temp; shift; echo "$[@]"`; do + case $dir_part in + # Skip DOS drivespec + ?:) total_dir=$dir_part ;; + *) total_dir=$total_dir/$dir_part + test -d "$total_dir" || + mkdir "$total_dir" || + AC_MSG_ERROR([cannot create $subdir_dir]) + ;; + esac + done; } + + if test -d ./$subdir_dir; then :; + else + AC_MSG_ERROR([cannot create `pwd`/$subdir_dir]) + fi + ;; esac # @@ -96,17 +96,17 @@ if test "$subdir_dir" != ":" && test -d $srcdir/$subdir_dir; then case $srcdir in .) - # In place - subdir_srcdir="$srcdir" - ;; + # In place + subdir_srcdir="$srcdir" + ;; [[\\/]* | ?:[\\/]*] ) - # Absolute path - subdir_srcdir="$srcdir/$subdir_dir" - ;; + # Absolute path + subdir_srcdir="$srcdir/$subdir_dir" + ;; *) - # Relative path - subdir_srcdir="$subdir_dots$srcdir/$subdir_dir" - ;; + # Relative path + subdir_srcdir="$subdir_dots$srcdir/$subdir_dir" + ;; esac # @@ -124,13 +124,13 @@ if test "$subdir_dir" != ":" && test -d $srcdir/$subdir_dir; then sub_configure="$SHELL '$subdir_srcdir/configure'" AC_MSG_NOTICE([running $sub_configure $subdir_args --cache-file=$subdir_cache_file --srcdir=$subdir_srcdir --disable-option-checking]) eval "$sub_configure $subdir_args \ - --cache-file=\"\$subdir_cache_file\" --srcdir=\"$subdir_srcdir\" --disable-option-checking" + --cache-file=\"\$subdir_cache_file\" --srcdir=\"$subdir_srcdir\" --disable-option-checking" if test "$?" = "0"; then - eval $subdir_success - AC_MSG_NOTICE([$sub_configure succeeded for $subdir_dir]) + eval $subdir_success + AC_MSG_NOTICE([$sub_configure succeeded for $subdir_dir]) else - eval $subdir_failure - AC_MSG_NOTICE([$sub_configure *failed* for $subdir_dir]) + eval $subdir_failure + AC_MSG_NOTICE([$sub_configure *failed* for $subdir_dir]) fi # diff --git a/config/opal_config_subdir_args.m4 b/config/opal_config_subdir_args.m4 index 0d5f8febabc..4afc51275e5 100644 --- a/config/opal_config_subdir_args.m4 +++ b/config/opal_config_subdir_args.m4 @@ -43,34 +43,34 @@ shift for subdirs_arg do if test "$subdirs_skip" = "yes"; then - subdirs_skip=no + subdirs_skip=no else - case $subdirs_arg in - -cache-file | --cache-file | -cache | --cache) - subdirs_skip=yes - ;; - --config-cache | -C) - ;; - -cache-file=* | --cache-file=*) - ;; - -srcdir | --srcdir) - subdirs_skip=yes - ;; - -srcdir=* | --srcdir=*) - ;; - -with-platform=* | --with-platform=*) - ;; + case $subdirs_arg in + -cache-file | --cache-file | -cache | --cache) + subdirs_skip=yes + ;; + --config-cache | -C) + ;; + -cache-file=* | --cache-file=*) + ;; + -srcdir | --srcdir) + subdirs_skip=yes + ;; + -srcdir=* | --srcdir=*) + ;; + -with-platform=* | --with-platform=*) + ;; --with*=internal) ;; --with*=external) ;; - *) - case $subdir_arg in - *\'*) subdir_arg=`echo "$subdir_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - subdirs_args="$subdirs_args '$subdirs_arg'" - ;; - esac + *) + case $subdir_arg in + *\'*) subdir_arg=`echo "$subdir_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + subdirs_args="$subdirs_args '$subdirs_arg'" + ;; + esac fi done diff --git a/config/opal_config_treematch.m4 b/config/opal_config_treematch.m4 index cfcfba1f119..967946b53ef 100644 --- a/config/opal_config_treematch.m4 +++ b/config/opal_config_treematch.m4 @@ -9,8 +9,7 @@ # Copyright (c) 2015 Intel, Inc. All rights reserved. # Copyright (c) 2019 Research Organization for Information Science # and Technology (RIST). All rights reserved. -# Copyright (c) 2020 Amazon.com, Inc. or its affiliates. -# All Rights reserved. +# Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # Copyright (c) 2021 Google, LLC. All rights reserved. # $COPYRIGHT$ # @@ -20,73 +19,23 @@ # AC_DEFUN([OPAL_CONFIG_TREEMATCH], [ - OPAL_VAR_SCOPE_PUSH(treematch_files_local) + OPAL_VAR_SCOPE_PUSH(treematch_builddir) - OPAL_3RDPARTY_WITH([treematch], [treematch], [package_treematch]) - - if test -z "$opal_config_treematch_happy" ; then - AC_ARG_WITH([treematch], - [AS_HELP_STRING([--with-treematch(=DIR)], - [Build TreeMatch topology support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])], + AC_ARG_WITH([treematch], + [AS_HELP_STRING([--with-treematch], + [Build TreeMatch topology support. Building against an external TreeMatch is no longer supported, so valid values are "yes" or "no".])], [], [with_treematch=yes]) - AC_ARG_WITH([treematch-include], - [AS_HELP_STRING([--with-treematch-include(=DIR)], - ["Search for TreeMatch headers in DIR"])]) - AC_ARG_WITH([treematch-libdir], - [AS_HELP_STRING([--with-treematch-libdir(=DIR)], - ["Search for TreeMatch libraries in DIR"])]) - - treematch_files_local=no - opal_config_treematch_happy=0 - if test "$with_treematch" != no ; then - # Argument sanity checks. - if (test -z "$with_treematch_include" && test -n "$with_treematch_libdir") || - (test -n "$with_treematch_include" && test -z "$with_treematch_libdir") ; then - AC_MSG_ERROR([specified only one of --with-treematch-include or --with-treematch-libdir. Both (or neither) should be specified]) - fi - if test -n "$with_treematch_include" && test "$with_treematch" != yes ; then - AC_MSG_ERROR([specified both --with-treematch-include and either --with-treematch=path or --without-treematch]) - fi + AS_IF([test "$with_treematch" != "yes" -a "$with_treematch" != "no"], + [AC_MSG_ERROR([Valid values for --with-treematch are yes or no.])]) - AC_MSG_CHECKING([TreeMatch source]) - if test -n "$with_treematch_include" || test "$with_treematch" != yes ; then - if test -z "$with_treematch_include" ; then - with_treematch_include="$with_treematch/include" - with_treematch_libdir="$with_treematch/lib" - fi - AC_MSG_RESULT([user provided]) - else - treematch_files_local=yes - with_treematch_include="$OMPI_TOP_SRCDIR/3rd-party/treematch" - with_treematch_libdir="$OMPI_TOP_BUILDDIR/3rd-party/treematch" - AC_MSG_RESULT([in tree (3rd-party)]) - fi + treematch_builddir="${OMPI_TOP_BUILDDIR}/3rd-party/treematch" - OPAL_CHECK_WITHDIR([treematch], - [$with_treematch_include], - [tm_tree.h]) - if test $treematch_files_local == no ; then - OPAL_CHECK_WITHDIR([treematch-libdir], [$with_treematch_libdir], [libtreematch.*]) - OPAL_CHECK_PACKAGE([topo_treematch], - [treematch.h], - [treematch], - [tm_build_synthetic_topology], - [], - [${with_treematch_include%include}], - [$with_treematch_libdir], - [opal_config_treematch_happy=1], - [AC_MSG_ERROR([TreeMatch support requested but not found. Aborting])]) - else - opal_config_treematch_happy=1 - fi - fi + AS_IF([test "${opal_config_treematch_run_once}" != "yes"], + [AS_IF([! test -d ${treematch_builddir}], + [mkdir -p ${treematch_builddir}]) - if test $opal_config_treematch_happy -eq 1 && test $treematch_files_local = yes ; then - AS_IF([! test -d $OMPI_TOP_BUILDDIR/3rd-party/treematch], - [mkdir -p $OMPI_TOP_BUILDDIR/3rd-party/treematch]) - AC_CONFIG_FILES([3rd-party/treematch/Makefile]) - cat > $OMPI_TOP_BUILDDIR/3rd-party/treematch/config.h << EOF + cat > ${treematch_builddir}/config.h << EOF /* * This file is automatically generated by configure. Edits will be lost * @@ -96,25 +45,22 @@ AC_DEFUN([OPAL_CONFIG_TREEMATCH], [ * see https://github.com/open-mpi/ompi/pull/6185#issuecomment-458807930 */ EOF - opal_config_treematch_LIBS=$OMPI_TOP_BUILDDIR/3rd-party/treematch/libtreematch.la - opal_config_treematch_LDFLAGS= - else - opal_config_treematch_LIBS="-ltreematch" - opal_config_treematch_LDFLAGS="-L$with_treematch_libdir" - fi - fi - if test $opal_config_treematch_happy -eq 1 ; then - $1_CPPFLAGS="[$]$1_CPPFLAGS -I$with_treematch_include" - $1_LDFLAGS="[$]$1_LDFLAGS $opal_config_treematch_LDFLAGS" - $1_LIBS="[$]$1_LIBS $opal_config_treematch_LIBS" - fi + AC_CONFIG_FILES([3rd-party/treematch/Makefile]) + OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS treematch" + + AS_IF([test "${with_treematch}" = "yes"], + [OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS treematch"]) + + opal_config_treematch_run_once=yes]) + + $1_CPPFLAGS="-I$OMPI_TOP_SRCDIR/3rd-party/treematch" + $1_LIBS="${OMPI_TOP_BUILDDIR}/3rd-party/treematch/libtreematch.la" + + AS_IF([test "${with_treematch}" = "yes"], + [$2], + [AC_MSG_NOTICE([Treematch explicitly disabled via --with-treematch=no]) + $3]) - OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS treematch" - OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS treematch" - - AS_IF([test $opal_config_treematch_happy -eq 1], [$2], [$3]) OPAL_VAR_SCOPE_POP ]) - - diff --git a/config/opal_configure_options.m4 b/config/opal_configure_options.m4 index 78dc6ba413c..66a5b3e5a39 100644 --- a/config/opal_configure_options.m4 +++ b/config/opal_configure_options.m4 @@ -3,14 +3,14 @@ dnl dnl Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana dnl University Research and Technology dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University +dnl Copyright (c) 2004-2024 The University of Tennessee and The University dnl of Tennessee Research Foundation. All rights dnl reserved. dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. -dnl Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved +dnl Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2009 IBM Corporation. All rights reserved. dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights @@ -20,6 +20,9 @@ dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved. dnl Copyright (c) 2013-2017 Intel, Inc. All rights reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights +dnl Copyright (c) 2019-2021 Triad National Security, LLC. All rights +dnl reserved. dnl dnl $COPYRIGHT$ dnl @@ -29,14 +32,14 @@ dnl $HEADER$ dnl AC_DEFUN([OPAL_CONFIGURE_OPTIONS],[ -opal_show_subtitle "OPAL Configuration options" +opal_show_subtitle "General configuration options" # # Is this a developer copy? # -if test -d .git; then +if test -d ${OPAL_TOP_SRCDIR}/.git; then OPAL_DEVEL=1 else OPAL_DEVEL=0 @@ -178,10 +181,47 @@ AC_DEFINE_UNQUOTED(OPAL_ENABLE_TIMING, $WANT_TIMING, AM_CONDITIONAL([OPAL_COMPILE_TIMING], [test "$WANT_TIMING" = "1"]) AM_CONDITIONAL([OPAL_INSTALL_TIMING_BINARIES], [test "$WANT_TIMING" = "1" && test "$enable_binaries" != "no"]) +# Later calls to AC_PROG_CC/CXX/FC can +# inject things like -O2 into compile flags if they are +# not defined, which we don't want. Make sure these flags +# are at least set to an empty string now. +# +# Complicating matters is that autogen can re-order +# these calls toward the top of configure. This block should +# be at/near the top, so do it now. +# if test "$WANT_DEBUG" = "0"; then CFLAGS="-DNDEBUG $CFLAGS" CXXFLAGS="-DNDEBUG $CXXFLAGS" + + # NDEBUG doesn't exist in fortran, so just make sure it's defined. + if [ test -z "$FCFLAGS" ]; then + FCFLAGS="" + fi +else + # Do we want debugging symbols? + if test "$enable_debug_symbols" != "no" ; then + CFLAGS="$CFLAGS -g" + CXXFLAGS="$CXXFLAGS -g" + FCFLAGS="$FCFLAGS -g" + AC_MSG_WARN([-g has been added to compiler (--enable-debug)]) + else + # If not set, define compile flags to an empty string + # to prevent AC_PROG_CC/FC/CXX from modifying compiler flags. + # See: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/C-Compiler.html + # for more info. + if [ test -z "$CFLAGS" ]; then + CFLAGS="" + fi + if [ test -z "$CXXFLAGS" ]; then + CXXFLAGS="" + fi + if [ test -z "$FCFLAGS" ]; then + FCFLAGS="" + fi + fi fi + AC_DEFINE_UNQUOTED(OPAL_ENABLE_DEBUG, $WANT_DEBUG, [Whether we want developer-level debugging code or not]) @@ -206,7 +246,6 @@ else fi AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1) - # # Do we want the pretty-print stack trace feature? # @@ -275,16 +314,12 @@ AC_ARG_ENABLE([dlopen], Disabling dlopen implies --disable-mca-dso. (default: enabled)])]) if test "$enable_dlopen" = "no" ; then - enable_mca_dso=no - enable_mca_static=yes OPAL_ENABLE_DLOPEN_SUPPORT=0 AC_MSG_RESULT([no]) else OPAL_ENABLE_DLOPEN_SUPPORT=1 AC_MSG_RESULT([yes]) fi -AC_DEFINE_UNQUOTED(OPAL_ENABLE_DLOPEN_SUPPORT, $OPAL_ENABLE_DLOPEN_SUPPORT, - [Whether we want to enable dlopen support]) # @@ -292,25 +327,24 @@ AC_DEFINE_UNQUOTED(OPAL_ENABLE_DLOPEN_SUPPORT, $OPAL_ENABLE_DLOPEN_SUPPORT, # AC_MSG_CHECKING([for default value of mca_base_component_show_load_errors]) -AC_ARG_ENABLE([show-load-errors-by-default], - [AS_HELP_STRING([--enable-show-load-errors-by-default], - [Set the default value for the MCA parameter - mca_base_component_show_load_errors (but can be - overridden at run time by the usual - MCA-variable-setting mechansism). This MCA variable - controls whether warnings are displayed when an MCA - component fails to load at run time due to an error. - (default: enabled, meaning that - mca_base_component_show_load_errors is enabled - by default])]) -if test "$enable_show_load_errors_by_default" = "no" ; then - OPAL_SHOW_LOAD_ERRORS_DEFAULT=0 - AC_MSG_RESULT([disabled by default]) -else - OPAL_SHOW_LOAD_ERRORS_DEFAULT=1 - AC_MSG_RESULT([enabled by default]) -fi -AC_DEFINE_UNQUOTED(OPAL_SHOW_LOAD_ERRORS_DEFAULT, $OPAL_SHOW_LOAD_ERRORS_DEFAULT, +AC_ARG_WITH([show-load-errors], + [AS_HELP_STRING([--with-show-load-errors], + [Set the default value for the MCA + parameter + mca_base_component_show_load_errors (but + can be overridden at run time by the usual + MCA-variable-setting mechansism). + (default: "all")])]) + +AS_IF([test -z "$with_show_load_errors" -o "$with_show_load_errors" = "yes"], + [with_show_load_errors=all + AC_MSG_RESULT([enabled for all])], + [AS_IF([test "$with_show_load_errors" = "no"], + [with_show_load_errors=none + AC_MSG_RESULT([disabled for all])], + [AC_MSG_RESULT([$with_show_load_errors])])]) + +AC_DEFINE_UNQUOTED(OPAL_SHOW_LOAD_ERRORS_DEFAULT, ["$with_show_load_errors"], [Default value for mca_base_component_show_load_errors MCA variable]) @@ -335,29 +369,6 @@ AC_DEFINE_UNQUOTED([OPAL_ENABLE_HETEROGENEOUS_SUPPORT], [Enable features required for heterogeneous support]) -if test "$opal_want_heterogeneous" = 1; then - ompi_cv_c_word_size_align=yes -else - AC_CACHE_CHECK([if word-sized integers must be word-size aligned], - [ompi_cv_c_word_size_align], - [AC_LANG_PUSH(C) - AC_RUN_IFELSE([AC_LANG_PROGRAM([dnl -#include ], [[ long data[2] = {0, 0}; - long *lp; - int *ip; - ip = (int*) data; - ip++; - lp = (long*) ip; - return lp[0]; ]])], - [ompi_cv_c_word_size_align=no], - [ompi_cv_c_word_size_align=yes], - [ompi_cv_c_word_size_align=yes])]) -fi -AS_IF([test $ompi_cv_c_word_size_align = yes], [results=1], [results=0]) -AC_DEFINE_UNQUOTED([OPAL_ALIGN_WORD_SIZE_INTEGERS], [$results], - [set to 1 if word-size integers must be aligned to word-size padding to prevent bus errors]) - - # # Cross-compile data # @@ -400,6 +411,7 @@ AM_CONDITIONAL([OPAL_WANT_SCRIPT_WRAPPER_COMPILERS], [test "$enable_script_wrapp # # Support per-user config files? # +OPAL_VAR_SCOPE_PUSH([result]) AC_ARG_ENABLE([per-user-config-files], [AS_HELP_STRING([--enable-per-user-config-files], [Disable per-user configuration files, to save disk accesses during job start-up. This is likely desirable for large jobs. Note that this can also be achieved by environment variables at run-time. (default: enabled)])]) @@ -410,6 +422,7 @@ else fi AC_DEFINE_UNQUOTED([OPAL_WANT_HOME_CONFIG_FILES], [$result], [Enable per-user config files]) +OPAL_VAR_SCOPE_POP # # Do we want to enable IPv6 support? @@ -500,7 +513,7 @@ OPAL_WITH_OPTION_MIN_MAX_VALUE(error_string, 256, 64, 1024) # Min length according to MPI-2.1, p. 236 (information passed in ompi/communicator/comm.c: min only 48) OPAL_WITH_OPTION_MIN_MAX_VALUE(object_name, 64, 64, 256) -# Min and Max length according to MPI-2.1, p. 287 is 32; longest key in ROMIO however 33 +# Min and Max length according to MPI-2.1, p. 287 is 32 OPAL_WITH_OPTION_MIN_MAX_VALUE(info_key, 36, 34, 255) # No lower and upper bound required or enforced! @@ -509,9 +522,13 @@ OPAL_WITH_OPTION_MIN_MAX_VALUE(info_val, 256, 32, 1024) # Min length according to _POSIX_HOST_NAME_MAX=255 (4*HOST_NAME_MAX) OPAL_WITH_OPTION_MIN_MAX_VALUE(port_name, 1024, 255, 2048) -# Min length accroding to MPI-2.1, p. 418 +# Min length according to MPI-2.1, p. 418 OPAL_WITH_OPTION_MIN_MAX_VALUE(datarep_string, 128, 64, 256) +OPAL_WITH_OPTION_MIN_MAX_VALUE(pset_name_len, 512, 512, 4096) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(stringtag_len, 1024, 256, 2048) + # some systems don't want/like getpwuid AC_MSG_CHECKING([if want getpwuid support]) AC_ARG_ENABLE([getpwuid], diff --git a/config/opal_functions.m4 b/config/opal_functions.m4 index 7ae5ff994cb..aed34160edc 100644 --- a/config/opal_functions.m4 +++ b/config/opal_functions.m4 @@ -16,6 +16,8 @@ dnl Copyright (c) 2009-2020 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2014 Intel, Inc. All rights reserved. dnl Copyright (c) 2015-2017 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights +dnl reserved. dnl dnl $COPYRIGHT$ dnl @@ -200,274 +202,52 @@ dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -AC_DEFUN([OPAL_LOG_MSG],[ # 1 is the message # 2 is whether to put a prefix or not -if test -n "$2"; then - echo "configure:__oline__: $1" >&5 -else - echo $1 >&5 -fi])dnl +AC_DEFUN([OPAL_LOG_MSG], +[AS_IF([test -n "$2"], [OAC_LOG_MSG([$1])], [OAC_LOG_MSG_NOPREFIX([$1])])]) dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -AC_DEFUN([OPAL_LOG_FILE],[ -# 1 is the filename -if test -n "$1" && test -f "$1"; then - cat $1 >&5 -fi])dnl +m4_copy([OAC_LOG_FILE], [OPAL_LOG_FILE]) dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -AC_DEFUN([OPAL_LOG_COMMAND],[ -# 1 is the command -# 2 is actions to do if success -# 3 is actions to do if fail -echo "configure:__oline__: $1" >&5 -$1 1>&5 2>&1 -opal_status=$? -OPAL_LOG_MSG([\$? = $opal_status], 1) -if test "$opal_status" = "0"; then - unset opal_status - $2 -else - unset opal_status - $3 -fi])dnl +m4_copy([OAC_LOG_COMMAND], [OPAL_LOG_COMMAND]) dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -AC_DEFUN([OPAL_UNIQ],[ -# 1 is the variable name to be uniq-ized -opal_name=$1 - -# Go through each item in the variable and only keep the unique ones - -opal_count=0 -for val in ${$1}; do - opal_done=0 - opal_i=1 - opal_found=0 - - # Loop over every token we've seen so far - - opal_done="`expr $opal_i \> $opal_count`" - while test "$opal_found" = "0" && test "$opal_done" = "0"; do - - # Have we seen this token already? Prefix the comparison with - # "x" so that "-Lfoo" values won't be cause an error. - - opal_eval="expr x$val = x\$opal_array_$opal_i" - opal_found=`eval $opal_eval` - - # Check the ending condition - - opal_done="`expr $opal_i \>= $opal_count`" - - # Increment the counter - - opal_i="`expr $opal_i + 1`" - done - - # If we didn't find the token, add it to the "array" - - if test "$opal_found" = "0"; then - opal_eval="opal_array_$opal_i=$val" - eval $opal_eval - opal_count="`expr $opal_count + 1`" - else - opal_i="`expr $opal_i - 1`" - fi -done - -# Take all the items in the "array" and assemble them back into a -# single variable - -opal_i=1 -opal_done="`expr $opal_i \> $opal_count`" -opal_newval= -while test "$opal_done" = "0"; do - opal_eval="opal_newval=\"$opal_newval \$opal_array_$opal_i\"" - eval $opal_eval - - opal_eval="unset opal_array_$opal_i" - eval $opal_eval - - opal_done="`expr $opal_i \>= $opal_count`" - opal_i="`expr $opal_i + 1`" -done - -# Done; do the assignment - -opal_newval="`echo $opal_newval`" -opal_eval="$opal_name=\"$opal_newval\"" -eval $opal_eval - -# Clean up - -unset opal_name opal_i opal_done opal_newval opal_eval opal_count])dnl +m4_copy([OAC_UNIQ], [OPAL_UNIQ]) dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -# OPAL_APPEND_UNIQ(variable, new_argument) -# ---------------------------------------- -# Append new_argument to variable if not already in variable. This assumes a -# space separated list. -# -# This could probably be made more efficient :(. -AC_DEFUN([OPAL_APPEND_UNIQ], [ -for arg in $2; do - opal_found=0; - for val in ${$1}; do - if test "x$val" = "x$arg" ; then - opal_found=1 - break - fi - done - if test "$opal_found" = "0" ; then - if test -z "$$1"; then - $1="$arg" - else - $1="$$1 $arg" - fi - fi -done -unset opal_found -]) +m4_copy([OAC_APPEND], [OPAL_APPEND]) dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -# Remove all duplicate -I, -L, and -l flags from the variable named $1 -AC_DEFUN([OPAL_FLAGS_UNIQ],[ - # 1 is the variable name to be uniq-ized - opal_name=$1 - - # Go through each item in the variable and only keep the unique ones - - opal_count=0 - for val in ${$1}; do - opal_done=0 - opal_i=1 - opal_found=0 - - # Loop over every token we've seen so far - - opal_done="`expr $opal_i \> $opal_count`" - while test "$opal_found" = "0" && test "$opal_done" = "0"; do +m4_copy([OAC_APPEND_UNIQ], [OPAL_APPEND_UNIQ]) - # Have we seen this token already? Prefix the comparison - # with "x" so that "-Lfoo" values won't be cause an error. - - opal_eval="expr x$val = x\$opal_array_$opal_i" - opal_found=`eval $opal_eval` - - # Check the ending condition - - opal_done="`expr $opal_i \>= $opal_count`" - - # Increment the counter - - opal_i="`expr $opal_i + 1`" - done - - # Check for special cases where we do want to allow repeated - # arguments (per - # https://www.open-mpi.org/community/lists/devel/2012/08/11362.php - # and - # https://github.com/open-mpi/ompi/issues/324). - - case $val in - -Xclang) - opal_found=0 - opal_i=`expr $opal_count + 1` - ;; - -framework) - opal_found=0 - opal_i=`expr $opal_count + 1` - ;; - --param) - opal_found=0 - opal_i=`expr $opal_count + 1` - ;; - esac - - # If we didn't find the token, add it to the "array" - - if test "$opal_found" = "0"; then - opal_eval="opal_array_$opal_i=$val" - eval $opal_eval - opal_count="`expr $opal_count + 1`" - else - opal_i="`expr $opal_i - 1`" - fi - done - - # Take all the items in the "array" and assemble them back into a - # single variable - - opal_i=1 - opal_done="`expr $opal_i \> $opal_count`" - opal_newval= - while test "$opal_done" = "0"; do - opal_eval="opal_newval=\"$opal_newval \$opal_array_$opal_i\"" - eval $opal_eval - - opal_eval="unset opal_array_$opal_i" - eval $opal_eval - - opal_done="`expr $opal_i \>= $opal_count`" - opal_i="`expr $opal_i + 1`" - done - - # Done; do the assignment - - opal_newval="`echo $opal_newval`" - opal_eval="$opal_name=\"$opal_newval\"" - eval $opal_eval - - # Clean up +dnl ####################################################################### +dnl ####################################################################### +dnl ####################################################################### - unset opal_name opal_i opal_done opal_newval opal_eval opal_count -])dnl +m4_copy([OAC_FLAGS_APPEND_UNIQ], [OPAL_FLAGS_APPEND_UNIQ]) dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -# OPAL_FLAGS_APPEND_UNIQ(variable, new_argument) -# ---------------------------------------------- -# Append new_argument to variable if: -# -# - the argument does not begin with -I, -L, or -l, or -# - the argument begins with -I, -L, or -l, and it's not already in variable -# -# This macro assumes a space separated list. -AC_DEFUN([OPAL_FLAGS_APPEND_UNIQ], [ - OPAL_VAR_SCOPE_PUSH([opal_tmp opal_append]) - - for arg in $2; do - opal_tmp=`echo $arg | cut -c1-2` - opal_append=1 - AS_IF([test "$opal_tmp" = "-I" || test "$opal_tmp" = "-L" || test "$opal_tmp" = "-l"], - [for val in ${$1}; do - AS_IF([test "x$val" = "x$arg"], [opal_append=0]) - done]) - AS_IF([test "$opal_append" = "1"], - [AS_IF([test -z "$$1"], [$1=$arg], [$1="$$1 $arg"])]) - done - - OPAL_VAR_SCOPE_POP -]) +m4_copy([OAC_FLAGS_APPEND_MOVE], [OPAL_FLAGS_APPEND_MOVE]) dnl ####################################################################### dnl ####################################################################### @@ -479,88 +259,68 @@ dnl ####################################################################### # ~/.whatever file (and we do not want the error messages to be part # of the assignment in foo=`which `). This macro ensures that we # get a sane executable value. -AC_DEFUN([OPAL_WHICH],[ +# # 1 is the variable name to do "which" on # 2 is the variable name to assign the return value to +AC_DEFUN([OPAL_WHICH],[ + OPAL_VAR_SCOPE_PUSH([opal_prog opal_file opal_dir opal_sentinel]) + + opal_prog=$1 + + # There are 3 cases: + + # 1. opal_prog is an absolute filename. If that absolute filename + # exists and is executable, return $2 with that name. Otherwise, + # $2 is unchanged. + + # 2. opal_prog is a relative filename (i.e., it contains one or + # more /, but does not begin with a /). If that file exists + # relative to where we are right now in the filesystem and is + # executable, return the absolute path of that value in $2. + # Otherwise, $2 is unchanged. + + # 3. opal_prog contains no /. Search the PATH for an executable + # with the appropriate name. If found, return the absolute path + # in $2. Otherwise, $2 is unchanged. + + # Note that these three cases are exactly what which(1) does. + + # Note the double square brackets around the case expressions for + # m4 escaping. + case $opal_prog in + [[\\/]]* | ?:[[\\/]]* ) + # Case 1: absolute + AS_IF([test -x "$opal_prog"], + [$2=$opal_prog]) + ;; + + *[[\\/]]*) + # Case 2: relative with 1 or more / + AS_IF([test -x "$opal_prog"], + [$2="$cwd/$opal_prog"]) + ;; + + *) + # Case 3: no / at all + IFS_SAVE=$IFS + IFS=$PATH_SEPARATOR + for opal_dir in $PATH; do + AS_IF([test -x "$opal_dir/$opal_prog"], + [$2="$opal_dir/$opal_prog"]) + done + IFS=$IFS_SAVE + ;; + esac -OPAL_VAR_SCOPE_PUSH([opal_prog opal_file opal_dir opal_sentinel]) - -opal_prog=$1 - -IFS_SAVE=$IFS -IFS="$PATH_SEPARATOR" -for opal_dir in $PATH; do - if test -x "$opal_dir/$opal_prog"; then - $2="$opal_dir/$opal_prog" - break - fi -done -IFS=$IFS_SAVE - -OPAL_VAR_SCOPE_POP + OPAL_VAR_SCOPE_POP ])dnl dnl ####################################################################### dnl ####################################################################### dnl ####################################################################### -# Declare some variables; use OPAL_VAR_SCOPE_POP to ensure that they -# are cleaned up / undefined. -AC_DEFUN([OPAL_VAR_SCOPE_PUSH],[ - - # Is the private index set? If not, set it. - if test "x$opal_scope_index" = "x"; then - opal_scope_index=1 - fi - - # First, check to see if any of these variables are already set. - # This is a simple sanity check to ensure we're not already - # overwriting pre-existing variables (that have a non-empty - # value). It's not a perfect check, but at least it's something. - for opal_var in $1; do - opal_str="opal_str=\"\$$opal_var\"" - eval $opal_str - - if test "x$opal_str" != "x"; then - AC_MSG_WARN([Found configure shell variable clash at line $LINENO!]) - AC_MSG_WARN([[OPAL_VAR_SCOPE_PUSH] called on "$opal_var",]) - AC_MSG_WARN([but it is already defined with value "$opal_str"]) - AC_MSG_WARN([This usually indicates an error in configure.]) - AC_MSG_ERROR([Cannot continue]) - fi - done - - # Ok, we passed the simple sanity check. Save all these names so - # that we can unset them at the end of the scope. - opal_str="opal_scope_$opal_scope_index=\"$1\"" - eval $opal_str - unset opal_str - - env | grep opal_scope - opal_scope_index=`expr $opal_scope_index + 1` -])dnl - -# Unset a bunch of variables that were previously set -AC_DEFUN([OPAL_VAR_SCOPE_POP],[ - # Unwind the index - opal_scope_index=`expr $opal_scope_index - 1` - opal_scope_test=`expr $opal_scope_index \> 0` - if test "$opal_scope_test" = "0"; then - AC_MSG_WARN([[OPAL_VAR_SCOPE_POP] popped too many OPAL configure scopes.]) - AC_MSG_WARN([This usually indicates an error in configure.]) - AC_MSG_ERROR([Cannot continue]) - fi - - # Get the variable names from that index - opal_str="opal_str=\"\$opal_scope_$opal_scope_index\"" - eval $opal_str - - # Iterate over all the variables and unset them all - for opal_var in $opal_str; do - unset $opal_var - done -])dnl - +m4_copy([OAC_VAR_SCOPE_PUSH], [OPAL_VAR_SCOPE_PUSH]) +m4_copy([OAC_VAR_SCOPE_POP], [OPAL_VAR_SCOPE_POP]) dnl ####################################################################### dnl ####################################################################### diff --git a/config/opal_get_version.m4 b/config/opal_get_version.m4 index 5c200e2161d..3a8f78565e5 100644 --- a/config/opal_get_version.m4 +++ b/config/opal_get_version.m4 @@ -14,6 +14,7 @@ dnl Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2014 Intel, Inc. All rights reserved. dnl Copyright (c) 2014-2020 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2022 IBM Corporation. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -44,20 +45,20 @@ m4_define([OPAL_GET_VERSION],[ if test -f "$1"; then srcdir=`dirname $1` opal_vers=`sed -n " - t clear - : clear - s/^major/$2_MAJOR_VERSION/ - s/^minor/$2_MINOR_VERSION/ - s/^release/$2_RELEASE_VERSION/ - s/^greek/$2_GREEK_VERSION/ - s/^repo_rev/$2_REPO_REV/ - s/^tarball_version/$2_TARBALL_VERSION/ - s/^date/$2_RELEASE_DATE/ - t print - b - : print - p" < "$1"` - [eval] "$opal_vers" + t clear + : clear + s/^major/$2_MAJOR_VERSION/ + s/^minor/$2_MINOR_VERSION/ + s/^release/$2_RELEASE_VERSION/ + s/^greek/$2_GREEK_VERSION/ + s/^repo_rev/$2_REPO_REV/ + s/^tarball_version/$2_TARBALL_VERSION/ + s/^date/$2_RELEASE_DATE/ + t print + b + : print + p" < "$1"` + [eval] "$opal_vers" $2_VERSION="$$2_MAJOR_VERSION.$$2_MINOR_VERSION.$$2_RELEASE_VERSION" $2_VERSION="${$2_VERSION}${$2_GREEK_VERSION}" diff --git a/config/opal_get_version.m4sh b/config/opal_get_version.m4sh index d9d45d972a2..4ef056ca1e3 100644 --- a/config/opal_get_version.m4sh +++ b/config/opal_get_version.m4sh @@ -33,29 +33,29 @@ else OPAL_GET_VERSION([$srcfile],[OPAL]) if test "$option" = ""; then - option="--full" + option="--full" fi fi case "$option" in --full|-v|--version) - echo $OPAL_VERSION - ;; + echo $OPAL_VERSION + ;; --major) - echo $OPAL_MAJOR_VERSION - ;; + echo $OPAL_MAJOR_VERSION + ;; --minor) - echo $OPAL_MINOR_VERSION - ;; + echo $OPAL_MINOR_VERSION + ;; --release) - echo $OPAL_RELEASE_VERSION - ;; + echo $OPAL_RELEASE_VERSION + ;; --greek) - echo $OPAL_GREEK_VERSION - ;; + echo $OPAL_GREEK_VERSION + ;; --repo-rev) - echo $OPAL_REPO_REV - ;; + echo $OPAL_REPO_REV + ;; --tarball) echo $OPAL_TARBALL_VERSION ;; @@ -66,7 +66,7 @@ case "$option" in echo ${OPAL_VERSION} : ${OPAL_MAJOR_VERSION} : ${OPAL_MINOR_VERSION} : ${OPAL_RELEASE_VERSION} : ${OPAL_GREEK_VERSION} : ${OPAL_REPO_REV} : ${OPAL_TARBALL_VERSION} ;; -h|--help) - cat < [