Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Catalyst 2.0 support as a Database to IOSS #242

Merged
merged 5 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@ TPL/pnetcdf/parallel-netcdf-*/
TPL/pnetcdf/pnetcdf-*.tar.gz
TPL/pnetcdf/pnetcdf-*/
TPL/faodel/faodel*/
TPL/catalyst2/catalyst/
build/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ manually as detailed in
| METIS | YES, NO | NO | Should metis TPL be built (parallel decomposition). |
| PARMETIS | YES, NO | NO | Should parmetis TPL be built (parallel decomposition). |
| ADIOS2 | YES, NO | NO | Should adios2 TPL be built. |
| CATALYST2 | YES, NO | NO | Should catalyst 2 TPL be built. |
| KOKKOS | YES, NO | NO | Should Kokkos TPL be built. |
| GNU_PARALLEL | YES, NO | YES | Should GNU parallel script be built. |
| H5VERSION | V112, V110, V18 | V110 | Use HDF5-1.12.X, HDF5-1.10.X or HDF5-1.8.X |
Expand Down
72 changes: 72 additions & 0 deletions TPL/catalyst2/runcmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#! /usr/bin/env bash
EXTRA_ARGS=$@

MPI="${MPI:-NO}"

echo "MPI set to ${MPI}"

### The following assumes you are building in a subdirectory of ACCESS Root
if [ "X$ACCESS" == "X" ] ; then
ACCESS=$(cd ../../../..; pwd)
echo "ACCESS set to ${ACCESS}"
fi
INSTALL_PATH=${INSTALL_PATH:-${ACCESS}}

SHARED="${SHARED:-YES}"

if [ "$MPI" == "YES" ] && [ "$CRAY" = "YES" ]
then
export CC=cc
export CXX=cxx
elif [ "$MPI" == "YES" ]
then
export CC=mpicc
export CXX=mpicxx
else
COMPILER="${COMPILER:-gnu}"
if [ "$COMPILER" == "gnu" ]
then
export CC=gcc
export CXX=g++
fi
if [ "$COMPILER" == "clang" ]
then
export CC=clang
export CXX=clang++
fi
if [ "$COMPILER" == "intel" ]
then
export CC=icc
export CXX=icpc
fi
if [ "$COMPILER" == "ibm" ]
then
export CC=xlc
export CXX=xlC
fi
fi

CFLAGS="-I${INSTALL_PATH}/include"; export CFLAGS
CPPFLAGS="-DNDEBUG"; export CPPFLAGS

rm -f CMakeCache.txt

cmake \
${RPATH} \
-D CATALYST_BUILD_SHARED_LIBS:BOOL=${SHARED} \
-D CMAKE_PREFIX_PATH:PATH=${INSTALL_PATH}/lib \
-D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_PATH} \
-D CMAKE_INSTALL_LIBDIR:PATH=lib \
-D CATALYST_BUILD_STUB_IMPLEMENTATION:BOOL=ON \
-D CATALYST_USE_MPI:BOOL=${MPI} \
-D CATALYST_BUILD_TESTING:BOOL=OFF \
$EXTRA_ARGS \
..

echo ""
echo " MPI: ${MPI}"
echo " COMPILER: ${CC}"
echo "C++ COMPILER: ${CXX}"
echo " ACCESS: ${ACCESS}"
echo "INSTALL_PATH: ${INSTALL_PATH}"
echo ""
2 changes: 1 addition & 1 deletion TPLsList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ SET( SEACASProj_TPLS_FINDMODS_CLASSIFICATIONS
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
Catalyst2 "${PROJECT_SOURCE_DIR}/packages/seacas/cmake/tpls/FindTPLCatalyst2.cmake" EX
)

4 changes: 4 additions & 0 deletions cmake-config
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ HDF5_PATH=${INSTALL_PATH}
CGNS_PATH=${INSTALL_PATH}
FAODEL_PATH=${INSTALL_PATH}
ADIOS2_PATH=${INSTALL_PATH}
CATALYST2_PATH=${INSTALL_PATH}
GTEST_PATH=${INSTALL_PATH}
KOKKOS_PATH=${INSTALL_PATH}
METIS_PATH=${INSTALL_PATH}
Expand All @@ -279,6 +280,7 @@ HAVE_MATIO=$(check_enable "${MATIO_PATH}/include/matio.h")
HAVE_CGNS=$(check_enable "${CGNS_PATH}/include/cgnslib.h")
HAVE_FAODEL=$(check_enable "${FAODEL_PATH}/include/faodel/faodelConfig.h")
HAVE_ADIOS2=$(check_enable "${ADIOS2_PATH}/include/adios2.h")
HAVE_CATALYST2=$(check_enable "${CATALYST2_PATH}/include/catalyst-2.0/catalyst.h")
HAVE_GTEST=$(check_enable "${GTEST_PATH}/include/gtest/gtest.h")
HAVE_KOKKOS=$(check_enable "${KOKKOS_PATH}/include/Kokkos_Core.hpp")
HAVE_METIS=$(check_enable "${METIS_PATH}/include/metis.h")
Expand Down Expand Up @@ -453,6 +455,7 @@ ${SUBSET_OPTIONS} \
-D TPL_ENABLE_Matio:BOOL=${HAVE_MATIO} \
-D TPL_ENABLE_CGNS:BOOL=${HAVE_CGNS} \
-D TPL_ENABLE_ADIOS2:BOOL=${HAVE_ADIOS2} \
-D TPL_ENABLE_Catalyst2:BOOL=${HAVE_CATALYST2} \
-D TPL_ENABLE_gtest:BOOL=${HAVE_GTEST} \
-D TPL_ENABLE_Kokkos:BOOL=${HAVE_KOKKOS} \
-D TPL_ENABLE_METIS:BOOL=${HAVE_METIS} \
Expand Down Expand Up @@ -506,6 +509,7 @@ echo " CGNS: ${HAVE_CGNS}"
echo " KOKKOS: ${HAVE_KOKKOS}"
echo " ZOLTAN: ${ZOLTAN}"
echo " ADIOS2: ${HAVE_ADIOS2}"
echo " CATALYST2: ${HAVE_CATALYST2}"
echo " METIS: ${HAVE_METIS}"
echo " PARMETIS: ${HAVE_PARMETIS}"
echo " FAODEL: ${HAVE_FAODEL}"
Expand Down
46 changes: 46 additions & 0 deletions install-tpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ FAODEL=$(check_valid FAODEL)
ADIOS2=${ADIOS2:-NO}
ADIOS2=$(check_valid ADIOS2)

CATALYST2=${CATALYST2:-NO}
CATALYST2=$(check_valid CATALYST2)

GTEST=${GTEST:-NO}
GTEST=$(check_valid GTEST)

Expand Down Expand Up @@ -197,6 +200,7 @@ if [ $# -gt 0 ]; then
echo " BB = ${BB}"
echo " FAODEL = ${FAODEL}"
echo " ADIOS2 = ${ADIOS2}"
echo " CATALYST2 = ${CATALYST2}"
echo " GTEST = ${GTEST}"
echo ""
echo " SUDO = ${SUDO} (empty unless need superuser permission via 'sudo')"
Expand Down Expand Up @@ -794,6 +798,48 @@ then
fi
fi

# =================== INSTALL CATALYST2 ===============
if [ "$CATALYST2" == "YES" ]
then
if [ "$FORCE" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libcatalyst.${LD_EXT} ]
then
echo "${txtgrn}+++ Catalyst2${txtrst}"
cd $ACCESS
cd TPL/catalyst2
if [ "$DOWNLOAD" == "YES" ]
then
echo "${txtgrn}+++ Downloading...${txtrst}"
rm -rf catalyst
git clone https://gitlab.kitware.com/paraview/catalyst.git
fi

if [ "$BUILD" == "YES" ]
then
echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}"
cd catalyst
git checkout master #todo: a specific version
rm -rf build
mkdir build
cd build
SHARED=${SHARED} MPI=${MPI} DEBUG=${DEBUG} bash -x ../../runcmake.sh
if [[ $? != 0 ]]
then
echo 1>&2 ${txtred}couldn\'t configure cmake for Catalyst2. exiting.${txtrst}
exit 1
fi

make -j${JOBS} && ${SUDO} make "VERBOSE=${VERBOSE}" install
if [[ $? != 0 ]]
then
echo 1>&2 ${txtred}couldn\'t build Catalyst2. exiting.${txtrst}
exit 1
fi
fi
else
echo "${txtylw}+++ Catalyst2 already installed. Skipping download and installation.${txtrst}"
fi
fi

# =================== INSTALL gtest ===============
if [ "$GTEST" == "YES" ]
then
Expand Down
89 changes: 89 additions & 0 deletions packages/seacas/cmake/tpls/FindTPLCatalyst2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# @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(catalyst ...) ...")

FIND_PACKAGE(catalyst)

IF (catalyst_FOUND)
# Tell TriBITS that we found Catalyst2 and there no need to look any further!
GET_TARGET_PROPERTY(_Catalyst2_INCLUDE_DIRS catalyst::catalyst_headers INTERFACE_INCLUDE_DIRECTORIES)
GET_TARGET_PROPERTY(_Catalyst2_LIBRARY_LOCATION catalyst::catalyst LOCATION)
GET_FILENAME_COMPONENT(Catalyst2_LIBRARY_DIRS ${_Catalyst2_LIBRARY_LOCATION} DIRECTORY)

# For compatibility with TriBITS:
SET(DOCSTR "List of semi-colon separated paths to look for the TPL Catalyst2")

GET_TARGET_PROPERTY(Catalyst2_LOCATION catalyst::catalyst LOCATION)

SET(TPL_Catalyst2_LIBRARIES ${Catalyst2_LOCATION} CACHE PATH ${DOCSTR})
SET(TPL_Catalyst2_INCLUDE_DIRS ${_Catalyst2_INCLUDE_DIRS} CACHE PATH ${DOCSTR})
SET(TPL_Catalyst2_LIBRARY_DIRS ${_Catalyst2_LIBRARY_DIRS} CACHE PATH ${DOCSTR})

ENDIF()

#
# Third, call TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES()
#
TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( Catalyst2
REQUIRED_HEADERS catalyst.h
REQUIRED_LIBS_NAMES catalyst
)

# NOTE: If FIND_PACKAGE(Catalyst2 ...) was called and successfully found Catalyst2, then
# TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES() will use the already-set
# variables TPL_Catalyst2_INCLUDE_DIRS and TPL_Catalyst2_LIBRARIES and then print them
# out (and set some other standard variables as well). This is the final
# "hook" into the TriBITS TPL system.
4 changes: 2 additions & 2 deletions packages/seacas/libraries/ioss/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
if(CMAKE_PROJECT_NAME STREQUAL "SEACASProj")
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_OPTIONAL_PACKAGES SEACASExodus Zoltan
LIB_OPTIONAL_TPLS HDF5 Pamgen CGNS ParMETIS Faodel Cereal DLlib Pthread ADIOS2 GTest Kokkos DataWarp fmt
LIB_OPTIONAL_TPLS HDF5 Pamgen CGNS ParMETIS Faodel Cereal DLlib Pthread ADIOS2 Catalyst2 GTest Kokkos DataWarp fmt
)
else()
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_OPTIONAL_PACKAGES SEACASExodus Pamgen Zoltan Kokkos
LIB_OPTIONAL_TPLS HDF5 CGNS ParMETIS Faodel Cereal DLlib Pthread DataWarp ADIOS2 GTest
LIB_OPTIONAL_TPLS HDF5 CGNS ParMETIS Faodel Cereal DLlib Pthread DataWarp ADIOS2 Catalyst2 GTest
)
endif()

Expand Down
2 changes: 2 additions & 0 deletions packages/seacas/libraries/ioss/cmake/SEACASIoss_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
#cmakedefine SEACAS_HAVE_PAMGEN

#cmakedefine HAVE_SEACASIOSS_ADIOS2

#cmakedefine SEACAS_HAVE_CATALYST2
8 changes: 8 additions & 0 deletions packages/seacas/libraries/ioss/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ IF (${TPL_ENABLE_Faodel})
SET(SEACAS_HAVE_FAODEL ON)
ENDIF()

IF (TPL_ENABLE_Catalyst2)
SET(SEACAS_HAVE_CATALYST2 ON)
ENDIF()

IF (${PACKAGE_NAME}_ENABLE_SEACASExodus)
SET(SEACAS_HAVE_EXODUS ON)
ENDIF()
Expand Down Expand Up @@ -109,6 +113,10 @@ IF (TPL_ENABLE_ADIOS2)
ADD_SUBDIRECTORY(adios)
ENDIF()

IF (TPL_ENABLE_Catalyst2)
ADD_SUBDIRECTORY(catalyst)
ENDIF()

ADD_SUBDIRECTORY(visualization)
ADD_SUBDIRECTORY(generated)
ADD_SUBDIRECTORY(gen_struc)
Expand Down
24 changes: 24 additions & 0 deletions packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SET(HEADERS "")
SET(SOURCES "")

SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR})
APPEND_GLOB(HEADERS ${DIR}/*.h*)
APPEND_GLOB(SOURCES ${DIR}/*.C)

INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_SOURCE_DIR}/../"
"${CMAKE_CURRENT_BINARY_DIR}/../"
)

TRIBITS_ADD_LIBRARY(
Iocatalyst
HEADERS ${HEADERS}
SOURCES ${SOURCES}
DEPLIBS Ioss ${DEPLIBS}
)

#IF (BUILD_TESTING)
# ENABLE_TESTING()
#ENDIF (BUILD_TESTING)
#
#TRIBITS_ADD_TEST_DIRECTORIES(utest)
Loading