diff --git a/TPLsList.cmake b/TPLsList.cmake index 1f66d5f02d..eab14e1676 100644 --- a/TPLsList.cmake +++ b/TPLsList.cmake @@ -74,7 +74,7 @@ SET( Seacas_TPLS_FINDMODS_CLASSIFICATIONS Kokkos "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" SS Faodel "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/" SS Cereal "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/" SS - ADIOS2 "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/FindTPLADIOS2.cmake" EX + ADIOS2 "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" EX Catalyst2 "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/FindTPLCatalyst2.cmake" EX # TPLs defined in Zoltan/cmake/Dependencies.cmake that are never enabled PaToH "cmake/TPLs/" EX diff --git a/cmake-config b/cmake-config index 443bdb7822..b88cde80cc 100755 --- a/cmake-config +++ b/cmake-config @@ -407,6 +407,15 @@ then " fi +if [ "$HAVE_ADIOS2" == "YES" ] +then + ADIOS2_SYMBOLS=" -D TPL_ENABLE_ADIOS2:BOOL=YES \ + -DTPL_ADIOS2_INCLUDE_DIRS:PATH=${ADIOS2_PATH}/include/ADIOS2 \ + -DTPL_ADIOS2_LIBRARY_DIRS:PATH=${ADIOS2_PATH}/lib \ + -DADIOS2_LIBRARY_DIRS:PATH=${ADIOS2_PATH}/lib \ + " +fi + if [ "$OS" == "Darwin" ] ; then DARWIN_OPT="-D CMAKE_MACOSX_RPATH:BOOL=ON -D TPL_X11_INCLUDE_DIRS:PATH=/opt/X11/include" else @@ -532,6 +541,7 @@ ${KOKKOS_SYMBOLS} \ ${MPI_SYMBOLS} \ ${DARWIN_OPT} \ ${FAODEL_SYMBOLS} \ +${ADIOS2_SYMBOLS} \ \ -D MPI_BIN_DIR:PATH=${MPI_BIN} \ -D NetCDF_ROOT:PATH=${NETCDF_PATH} \ diff --git a/cmake/tribits/common_tpls/FindTPLADIOS2.cmake b/cmake/tribits/common_tpls/FindTPLADIOS2.cmake new file mode 100644 index 0000000000..6961aa4d1b --- /dev/null +++ b/cmake/tribits/common_tpls/FindTPLADIOS2.cmake @@ -0,0 +1,97 @@ +# @HEADER +# ************************************************************************ +# +# TriBITS: Tribal Build, Integrate, and Test System +# Copyright 2016, 2024 Sandia Corporation +# +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the Corporation nor the names of the +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ************************************************************************ +# @HEADER + +if (${CMAKE_VERSION} GREATER "3.13") + cmake_policy(SET CMP0074 NEW) +endif() + +# First, set up the variables for the (backward-compatible) TriBITS way of +# finding ADIOS2. These are used in case find_package(ADIOS2 ...) is not +# called or does not find HDF5. Also, these variables need to be non-null +# in order to trigger the right behavior in the function +# tribits_tpl_find_include_dirs_and_libraries(). + +set(REQUIRED_HEADERS adios2.h) +set(REQUIRED_LIBS_NAMES adios2_c adios2_cxx11) + +if (TPL_ENABLE_MPI) + set(REQUIRED_LIBS_NAMES ${REQUIRED_LIBS_NAMES} adios2_c_mpi adios2_cxx11_mpi) +endif() + +# +# Second, search for ADIOS2 components (if allowed) using the standard +# find_package(ADIOS2 ...). +# +tribits_tpl_allow_pre_find_package(ADIOS2 ADIOS2_ALLOW_PREFIND) +if (ADIOS2_ALLOW_PREFIND) + + message("-- Using find_package(ADIOS2 ...) ...") + set(CMAKE_MODULE_PATH + "${CMAKE_MODULE_PATH}" + "${CMAKE_CURRENT_LIST_DIR}/find_modules" + "${CMAKE_CURRENT_LIST_DIR}/utils" + ) + + find_package(ADIOS2) +endif() + +# +# Third, call tribits_tpl_find_include_dirs_and_libraries() +# +tribits_tpl_find_include_dirs_and_libraries( ADIOS2 + REQUIRED_HEADERS ${REQUIRED_HEADERS} + REQUIRED_LIBS_NAMES ${REQUIRED_LIBS_NAMES} + ) +# NOTE: If find_package(ADIOS2 ...) was called and successfully found ADIOS2, +# then tribits_tpl_find_include_dirs_and_libraries() will use the already-set +# variables TPL_ADIOS2_INCLUDE_DIRS and TPL_ADIOS2_LIBRARIES and then print +# them out (and set some other standard variables as well). This is the final +# "hook" into the TriBITS TPL system. + +# If the `find_package(ADIOS2)` is not run, then this may not be set +# Need to determine how this is set in the library that is being used... + +if ("${TPL_ADIOS2_PARALLEL}" STREQUAL "") + assert_defined(TPL_ADIOS2_INCLUDE_DIRS) + if ("${TPL_ADIOS2_PARALLEL}" STREQUAL "") + set(TPL_ADIOS2_PARALLEL False CACHE INTERNAL + "True if ADIOS2 compiled with parallel enabled") + endif() +endif() +message(STATUS "TPL_ADIOS2_PARALLEL is ${TPL_ADIOS2_PARALLEL}") diff --git a/packages/seacas/cmake/tpls/FindTPLADIOS2.cmake b/packages/seacas/cmake/tpls/FindTPLADIOS2.cmake deleted file mode 100644 index bddbe96e9c..0000000000 --- a/packages/seacas/cmake/tpls/FindTPLADIOS2.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# @HEADER -# ************************************************************************ -# -# Trilinos: An Object-Oriented Solver Framework -# Copyright (2001) Sandia Corporation -# -# -# Copyright (2001) Sandia Corporation. Under the terms of Contract -# DE-AC04-94AL85000, there is a non-exclusive license for use of this -# work by or on behalf of the U.S. Government. Export of this program -# may require a license from the United States Government. -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# NOTICE: The United States Government is granted for itself and others -# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide -# license in this data to reproduce, prepare derivative works, and -# perform publicly and display publicly. Beginning five (5) years from -# July 25, 2001, the United States Government is granted for itself and -# others acting on its behalf a paid-up, nonexclusive, irrevocable -# worldwide license in this data to reproduce, prepare derivative works, -# distribute copies to the public, perform publicly and display -# publicly, and to permit others to do so. -# -# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT -# OF ENERGY, NOR SANDIA CORPORATION, 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. -# -# ************************************************************************ -# @HEADER - - -MESSAGE("-- Using FIND_PACKAGE(ADIOS2 ...) ...") - -FIND_PACKAGE(ADIOS2) - -IF (ADIOS2_FOUND) - # Tell TriBITS that we found ADIOS2 and there no need to look any further! - GET_TARGET_PROPERTY(_ADIOS2_INCLUDE_DIRS adios2::adios2 INTERFACE_INCLUDE_DIRECTORIES) - GET_TARGET_PROPERTY(_ADIOS2_LIBRARY_LOCATION adios2::adios2 LOCATION) - GET_FILENAME_COMPONENT(ADIOS2_LIBRARY_DIRS ${_ADIOS2_LIBRARY_LOCATION} DIRECTORY) - -# For compatibility with TriBITS: -SET(DOCSTR "List of semi-colon separated paths to look for the TPL ADIOS2") - -GET_TARGET_PROPERTY(ADIOS2_LOCATION adios2::adios2 LOCATION) - -SET(TPL_ADIOS2_LIBRARIES ${ADIOS2_LOCATION} CACHE PATH ${DOCSTR}) -SET(TPL_ADIOS2_INCLUDE_DIRS ${_ADIOS2_INCLUDE_DIRS} CACHE PATH ${DOCSTR}) -SET(TPL_ADIOS2_LIBRARY_DIRS ${_ADIOS2_LIBRARY_DIRS} CACHE PATH ${DOCSTR}) - -ENDIF() - -# -# Third, call TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES() -# -TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( ADIOS2 - REQUIRED_HEADERS adios2.h - REQUIRED_LIBS_NAMES adios2_cxx11_mpi,adios2_cxx11,adios2_core_mpi,adios2_core - ) - -# NOTE: If FIND_PACKAGE(ADIOS2 ...) was called and successfully found ADIOS2, then -# TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES() will use the already-set -# variables TPL_ADIOS2_INCLUDE_DIRS and TPL_ADIOS2_LIBRARIES and then print them -# out (and set some other standard variables as well). This is the final -# "hook" into the TriBITS TPL system. diff --git a/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.C b/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.C index 63de1523f7..6efb3353df 100644 --- a/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.C +++ b/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -12,9 +12,14 @@ namespace Ioad { AdiosWrapper::AdiosWrapper(Ioss_MPI_Comm comm, const std::string &filename, bool is_input, unsigned long rank, const Ioss::PropertyManager &properties) - : adios2::ADIOS(comm), adios2::IO(IOInit(properties, is_input)), - adios2::Engine(EngineInit(filename, is_input)), m_Rank(rank), m_Communicator(comm), - m_OpenStep(false) +#if ADIOS2_USE_MPI + : adios2::ADIOS(comm), +#else + : adios2::ADIOS(), +#endif + adios2::IO(IOInit(properties, is_input)), + adios2::Engine(EngineInit(filename, is_input)), m_Rank(rank), m_Communicator(comm), + m_OpenStep(false) { } diff --git a/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.hpp b/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.hpp index 1705d95548..3cc759cc1d 100644 --- a/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.hpp +++ b/packages/seacas/libraries/ioss/src/adios/AdiosWrapper.hpp @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -15,7 +15,7 @@ namespace Ioad { template void AdiosWrapper::DefineVariable(const std::string &name, const adios2::Dims &shape, const adios2::Dims &start, const adios2::Dims &count, - const bool constantDims) + const bool /*constantDims*/) { adios2::Variable var = this->IO::InquireVariable(name); if (!var) { diff --git a/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h b/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h index 632f5332d2..54b0caef8b 100644 --- a/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h @@ -60,18 +60,18 @@ namespace Ioad { size_t data_size) const override; int64_t get_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, - void *data, size_t data_size) const override + int64_t get_field_internal(const Ioss::StructuredBlock */* sb */, const Ioss::Field &/*field*/, + void */*data*/, size_t /*data_size*/) const override { return -1; } - int64_t get_field_internal(const Ioss::Assembly *sb, const Ioss::Field &field, void *data, - size_t data_size) const override + int64_t get_field_internal(const Ioss::Assembly */*sb*/, const Ioss::Field &/*field*/, void */*data*/, + size_t /*data_size*/) const override { return -1; } - int64_t get_field_internal(const Ioss::Blob *sb, const Ioss::Field &field, void *data, - size_t data_size) const override + int64_t get_field_internal(const Ioss::Blob */*sb*/, const Ioss::Field &/*field*/, void */*data*/, + size_t /*data_size*/) const override { return -1; } @@ -120,18 +120,18 @@ namespace Ioad { size_t data_size) const override; int64_t put_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, - void *data, size_t data_size) const override + int64_t put_field_internal(const Ioss::StructuredBlock */*sb*/, const Ioss::Field &/*field*/, + void */*data*/, size_t /*data_size*/) const override { return -1; } - int64_t put_field_internal(const Ioss::Assembly *sb, const Ioss::Field &field, void *data, - size_t data_size) const override + int64_t put_field_internal(const Ioss::Assembly */*sb*/, const Ioss::Field &/*field*/, void */*data*/, + size_t /*data_size*/) const override { return -1; } - int64_t put_field_internal(const Ioss::Blob *sb, const Ioss::Field &field, void *data, - size_t data_size) const override + int64_t put_field_internal(const Ioss::Blob */*sb*/, const Ioss::Field &/*field*/, void */*data*/, + size_t /*data_size*/) const override { return -1; }