diff --git a/.github/ci/spack-envs/clang10_nopy_ompi_h5_ad1_ad2/spack.yaml b/.github/ci/spack-envs/clang12_py38_nompi_h5_ad1_ad2/spack.yaml similarity index 73% rename from .github/ci/spack-envs/clang10_nopy_ompi_h5_ad1_ad2/spack.yaml rename to .github/ci/spack-envs/clang12_py38_nompi_h5_ad1_ad2/spack.yaml index 26d7c39119..076314528d 100644 --- a/.github/ci/spack-envs/clang10_nopy_ompi_h5_ad1_ad2/spack.yaml +++ b/.github/ci/spack-envs/clang12_py38_nompi_h5_ad1_ad2/spack.yaml @@ -9,25 +9,19 @@ spack: - adios - adios2 - hdf5 - - openmpi packages: hdf5: variants: ~mpi adios: - variants: ~zfp ~sz ~lz4 ~blosc + variants: ~mpi ~zfp ~sz ~lz4 ~blosc adios2: - variants: ~zfp ~sz ~png ~dataman ~python ~fortran ~ssc ~shared ~bzip2 + variants: ~mpi ~zfp ~sz ~png ~dataman ~python ~fortran ~ssc ~shared ~bzip2 cmake: externals: - spec: "cmake" prefix: /usr buildable: False - openmpi: - externals: - - spec: "openmpi" - prefix: /usr - buildable: False perl: externals: - spec: "perl" @@ -43,7 +37,7 @@ spack: variants: ~fortran providers: mpi: [openmpi] - compiler: [clang@10.0.0] + compiler: [clang@12.0.0] compilers: - compiler: @@ -53,11 +47,11 @@ spack: modules: [] operating_system: ubuntu20.04 paths: - cc: /usr/lib/llvm-10/bin/clang - cxx: /usr/lib/llvm-10/bin/clang++ + cc: /usr/lib/llvm-12/bin/clang + cxx: /usr/lib/llvm-12/bin/clang++ f77: /usr/bin/gfortran fc: /usr/bin/gfortran - spec: clang@10.0.0 + spec: clang@12.0.0 target: x86_64 config: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 380fe7de5c..3fd612e7dc 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -106,29 +106,33 @@ jobs: # TODO # clang6_py36_nompi_h5_ad1_ad2_libcpp - clang10_py38_nompi_h5_ad1_ad2_libcpp: + clang12_py38_nompi_h5_ad1_ad2: runs-on: ubuntu-20.04 if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v2 + - name: Spack Cache + uses: actions/cache@v2 + with: {path: /opt/spack, key: clang12_py38_nompi_h5_ad1_ad2 } - name: Install run: | sudo apt-get update - sudo apt-get install clang-10 libc++-dev libc++abi-dev libhdf5-dev python3 - python3 -m pip install -U pip - python3 -m pip install -U numpy -# TODO ADIOS1 ADIOS2 + sudo apt-get install clang-12 libhdf5-dev python3 python3-pip python3-numpy python3-pandas + sudo .github/workflows/dependencies/install_spack - name: Build - env: {CC: clang-10, CXX: clang++-10, CXXFLAGS: -Werror -Wno-deprecated-declarations} - # TODO - # , CXXFLAGS: -nostdinc++ -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10/, LDFLAGS: -stdlib=libc++ -lc++ -lc++abi} + env: {CC: clang-12, CXX: clang++-12, CXXFLAGS: -Werror -Wno-deprecated-declarations} run: | + eval $(spack env activate --sh .github/ci/spack-envs/clang12_py38_nompi_h5_ad1_ad2/) + spack install + share/openPMD/download_samples.sh build chmod u-w build/samples/git-sample/*.h5 cmake -S . -B build \ -DopenPMD_USE_PYTHON=ON \ -DopenPMD_USE_MPI=OFF \ -DopenPMD_USE_HDF5=ON \ + -DopenPMD_USE_ADIOS1=ON \ + -DopenPMD_USE_ADIOS2=ON \ -DopenPMD_USE_INVASIVE_TESTS=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON cmake --build build --parallel 2 diff --git a/CMakeLists.txt b/CMakeLists.txt index aacc6f5049..b7f5317e6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -574,13 +574,6 @@ if(openPMD_HAVE_ADIOS1) target_include_directories(openPMD.ADIOS1.Parallel PRIVATE ${openPMD_SOURCE_DIR}/include ${openPMD_BINARY_DIR}/include) - if(openPMD_HAVE_MPI) - target_link_libraries(openPMD.ADIOS1.Parallel PUBLIC ${openPMD_MPI_TARGETS}) - target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_MPI=1) - else() - target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_MPI=0) - endif() - target_include_directories(openPMD.ADIOS1.Serial SYSTEM PRIVATE $ $) @@ -610,7 +603,7 @@ if(openPMD_HAVE_ADIOS1) target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE "${ADIOS_DEFINITIONS_SEQUENTIAL}") target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE openPMD_HAVE_ADIOS1=1) target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE openPMD_HAVE_MPI=0) - target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE _NOMPI=1) + target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE _NOMPI) # ADIOS header if(openPMD_HAVE_MPI) set_target_properties(openPMD.ADIOS1.Parallel PROPERTIES @@ -631,10 +624,16 @@ if(openPMD_HAVE_ADIOS1) foreach(adlib ${ADIOS_LIBRARIES}) target_link_libraries(openPMD.ADIOS1.Parallel PRIVATE ${adlib}) endforeach() + target_link_libraries(openPMD.ADIOS1.Parallel PUBLIC ${openPMD_MPI_TARGETS}) target_include_directories(openPMD.ADIOS1.Parallel SYSTEM PRIVATE ${ADIOS_INCLUDE_DIRS}) target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE "${ADIOS_DEFINITIONS}") target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_ADIOS1=1) + target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_MPI=1) + else() + target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_ADIOS1=0) + target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_MPI=0) + target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE _NOMPI) # ADIOS header endif() # Runtime parameter and API status checks ("asserts") diff --git a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp index c64ce92743..fefa5d479d 100644 --- a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp +++ b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp @@ -1788,6 +1788,7 @@ void CommonADIOS1IOHandlerImpl< ChildClass >::initJson( template class CommonADIOS1IOHandlerImpl< ADIOS1IOHandlerImpl >; #if openPMD_HAVE_MPI template class CommonADIOS1IOHandlerImpl< ParallelADIOS1IOHandlerImpl >; -#endif // opepnPMD_HAVE_MPI +#endif // openPMD_HAVE_MPI + +} // namespace openPMD #endif // openPMD_HAVE_ADIOS1 -} diff --git a/src/IO/ADIOS/ParallelADIOS1IOHandler.cpp b/src/IO/ADIOS/ParallelADIOS1IOHandler.cpp index bfcc13675d..50880812a1 100644 --- a/src/IO/ADIOS/ParallelADIOS1IOHandler.cpp +++ b/src/IO/ADIOS/ParallelADIOS1IOHandler.cpp @@ -346,7 +346,7 @@ ParallelADIOS1IOHandlerImpl::initialize_group(std::string const &name) return group; } -#else +#else // openPMD_HAVE_ADIOS1 && openPMD_HAVE_MPI # if openPMD_HAVE_MPI ParallelADIOS1IOHandler::ParallelADIOS1IOHandler(std::string path, Access at, @@ -364,7 +364,7 @@ ParallelADIOS1IOHandler::ParallelADIOS1IOHandler(std::string path, { throw std::runtime_error("openPMD-api built without parallel ADIOS1 support"); } -# endif +# endif // openPMD_HAVE_MPI ParallelADIOS1IOHandler::~ParallelADIOS1IOHandler() = default; @@ -374,9 +374,11 @@ ParallelADIOS1IOHandler::flush() return std::future< void >(); } +#if openPMD_HAVE_ADIOS1 void ParallelADIOS1IOHandler::enqueue(IOTask const&) { } -#endif -} // openPMD +#endif // openPMD_HAVE_ADIOS1 +#endif // openPMD_HAVE_ADIOS1 && openPMD_HAVE_MPI +} // namespace openPMD