Unverified Commit 3401dd09 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon Committed by GitHub
Browse files

Merge pull request #2585 from pnorbert/doc-faq

change faq on MPI vs non-MPI library question
parents 6e494238 0d6461a9
Loading
Loading
Loading
Loading
+41 −4
Original line number Diff line number Diff line
@@ -35,11 +35,48 @@ FAQs Answered
Can I use the same library for MPI and non-MPI code?
----------------------------------------------------

Short answer: No.
Short answer: Yes, since version 2.6.0. 

Long answer: This created conflicts in the past, as the MPI APIs were mocked in the sequential version.
If you need "sequential" behavior with the MPI library, use ``MPI_COMM_SELF``.
Always pass a communicator in the MPI version
Long answer: One build of ADIOS can be used by both serial and parallel applications. Use the ``-s`` and ``-m`` flags in the ``adios2-config`` command. By default, or with the ``-m`` flag, the command gives the flags for a parallel build, which add ``-DADIOS2_USE_MPI`` to the compilation flags and include extra libaries containing the MPI implementations into the linker flags. The ``-s`` flag will omit these flags. For example, if ADIOS is installed into /opt/adios2, the flags for a Fortran application will look like these:

    .. code-block:: bash

        $ /opt/adios2/bin/adios2-config --fortran-flags
        -DADIOS2_USE_MPI -I/opt/adios2/include/adios2/fortran
        $ /opt/adios2/bin/adios2-config --fortran-flags -m
        -DADIOS2_USE_MPI -I/opt/adios2/include/adios2/fortran
        $ /opt/adios2/bin/adios2-config --fortran-flags -s
        -I/opt/adios2/include/adios2/fortran

        $ /opt/adios2/bin/adios2-config --fortran-libs
        -Wl,-rpath,/opt/adios2/lib /opt/adios2/lib/libadios2_fortran_mpi.so.2.6.0 /opt/adios2/lib/libadios2_fortran.so.2.6.0 -Wl,-rpath-link,/opt/adios2/lib
        $ /opt/adios2/bin/adios2-config --fortran-libs -s
        -Wl,-rpath,/opt/adios2/lib /opt/adios2/lib/libadios2_fortran.so.2.6.0 -Wl,-rpath-link,/opt/adios2/lib

If using cmake, there are different targets to build parallel

    .. code-block:: cmake

        find_package(MPI REQUIRED)
        find_package(ADIOS2 REQUIRED)
        #...
        add_library(my_library src1.cxx src2.cxx)
        target_link_libraries(my_library PRIVATE adios2::cxx11_mpi MPI::MPI_C)
        #...
        add_library(my_f_library src1.F90 src2.F90)
        target_link_libraries(my_f_library PRIVATE adios2::fortran_mpi adios2::fortran MPI::MPI_Fortran)

and serial applications:

    .. code-block:: cmake

        find_package(ADIOS2 REQUIRED)
        #...
        add_library(my_library src1.cxx src2.cxx)
        target_link_libraries(my_library PRIVATE adios2::cxx11)
        #...
        add_library(my_f_library src1.F90 src2.F90)
        target_link_libraries(my_f_library PRIVATE adios2::fortran)


Can I use ADIOS 2 C++11 library with C++98 codes?
+6 −6
Original line number Diff line number Diff line
#!/bin/bash

set +x
set -x

echo "Setting up default XCode version"
case "$SYSTEM_JOBNAME" in
@@ -18,13 +18,10 @@ case "$SYSTEM_JOBNAME" in
    ;;
esac

echo "Removing all existing brew package and update the formule"
brew remove --force $(brew list)
echo "Removing all existing brew package and update the formula"
brew remove --force --ignore-dependencies $(brew list --formula)
brew update

echo "Installing Kitware CMake and Ninja"
brew install cmake ninja

echo "Installing GCC"
brew install gcc

@@ -36,6 +33,9 @@ brew install python numpy
brew link --overwrite python
brew link --overwrite numpy

echo "Installing CMake and Ninja"
brew install cmake ninja

if [[ "$SYSTEM_JOBNAME" =~ .*openmpi.* ]]
then
  echo "Installing OpenMPI"