Skip to content

Catalyst Adaptor merge. #6

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(METIS_ROOT CACHE PATH "Metis root directory")
set(LIBHILBERT_ROOT CACHE PATH "LibHilbert root path")
set(HDF5_ROOT CACHE PATH "HDF5 root path")
set(TINYOBJLOADER_ROOT CACHE PATH "TinyObjLoader library path")
set(catalyst_DIR CACHE PATH "Catalyst library path")
set(SE_CLASS1 CACHE BOOL "Activate compilation with SE_CLASS1")
set(SE_CLASS2 CACHE BOOL "Activate compilation with SE_CLASS2")
set(SE_CLASS3 CACHE BOOL "Activate compilation with SE_CLASS3")
Expand Down Expand Up @@ -50,6 +51,7 @@ find_package(TinyObjLoader)
find_package(MPI REQUIRED)
find_package(METIS)
find_package(ParMETIS)
find_package(catalyst 2.0)

if (CUDA_ON_BACKEND STREQUAL "HIP")
find_package(HIP)
Expand Down Expand Up @@ -311,4 +313,4 @@ include(CPack)

cpack_add_component(OpenFPM
DISPLAY_NAME OpenFPM
DESCRITION OpenFPM binary files)
DESCRITION OpenFPM binary files)
3 changes: 3 additions & 0 deletions config/config_cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ${DEFINE_HAVE_BOOST_CONTEXT} /**/
/* define if the Boost::Fiber library is available */
${DEFINE_HAVE_BOOST_FIBER} /**/

/* Defined if you have Catalyst library */
${DEFINE_HAVE_CATALYST}

/* Have clock time */
${DEFINE_HAVE_CLOCK_GETTIME} /**/

Expand Down
2 changes: 1 addition & 1 deletion openfpm_data
8 changes: 6 additions & 2 deletions script/conf_CMake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ if [ -d "$prefix_dependencies/EIGEN" ]; then
configure_options=" $configure_options -DEIGEN3_ROOT=$prefix_dependencies/EIGEN "
fi

if [ -d "$prefix_dependencies/CATALYST/lib" ]; then
configure_options=" $configure_options -Dcatalyst_DIR=$prefix_dependencies/CATALYST/lib/cmake/catalyst-2.0 "
elif [ -d "$prefix_dependencies/CATALYST/lib64" ]; then
configure_options=" $configure_options -Dcatalyst_DIR=$prefix_dependencies/CATALYST/lib64/cmake/catalyst-2.0 "
fi

echo "CXX=mpic++ DYLD_LIBRARY_PATH=$ld_lib_pathopt cmake ../. $configure_options"
printf "CXX=mpic++ DYLD_LIBRARY_PATH=$ld_lib_pathopt cmake ../. $configure_options" > cmake_build_options

printf "CXX=mpic++ DYLD_LIBRARY_PATH=$ld_lib_pathopt cmake ../. $configure_options" > cmake_build_options
8 changes: 7 additions & 1 deletion script/create_env_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ if [ -d "$prefix_dependencies/SUITESPARSE" -a -f "$prefix_dependencies/SUITESPA
bash_library="$bash_library:$prefix_dependencies/SUITESPARSE/lib"
fi

if [ -d "$prefix_dependencies/CATALYST/lib" ]; then
bash_library="$bash_library:$prefix_dependencies/CATALYST/lib"
elif [ -d "$prefix_dependencies/CATALYST/lib64" ]; then
bash_library="$bash_library:$prefix_dependencies/CATALYST/lib64"
fi

# in cygwin we have to add to PATH additional directories
if [[ "$OSTYPE" == "cygwin" ]]; then
bash_path="$bash_path:$prefix_dependencies/BOOST/bin:$prefix_dependencies/HDF5/bin"
Expand All @@ -62,4 +68,4 @@ bash_library="$bash_library\""

echo "$bash_path" > openfpm_vars
echo "$bash_library" >> openfpm_vars
echo "export PURE_PYTHON=1" >> openfpm_vars
echo "export PURE_PYTHON=1" >> openfpm_vars
18 changes: 13 additions & 5 deletions script/create_example.mk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,19 @@ if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "linux" ]]; then
lin_alg_lib="$lin_alg_lib -lrt"
fi

echo "INCLUDE_PATH=$mpi_include_dirs $cuda_include_dirs $openmp_flags -I. -I$prefix_openfpm/openfpm_numerics/include -I$prefix_openfpm/openfpm_pdata/include/config -I$prefix_openfpm/openfpm_pdata/include -I$prefix_openfpm/openfpm_data/include -I$prefix_openfpm/openfpm_vcluster/include -I$prefix_openfpm/openfpm_io/include -I$prefix_openfpm/openfpm_devices/include -I$prefix_dependencies/VCDEVEL/include -I$prefix_dependencies/METIS/include -I$prefix_dependencies/PARMETIS/include -I$prefix_dependencies/BOOST/include -I$prefix_dependencies/HDF5/include -I$prefix_dependencies/LIBHILBERT/include $lin_alg_inc -I$prefix_dependencies/BLITZ/include -I$prefix_dependencies/ALGOIM/include -I$prefix_dependencies/SUITESPARSE/include " > example.mk
echo "LIBS_PATH=$mpi_libs -L$prefix_openfpm/openfpm_devices/lib -L$prefix_openfpm/openfpm_pdata/lib -L$prefix_openfpm/openfpm_vcluster/lib -L$prefix_dependencies/VCDEVEL/lib -L$prefix_dependencies/METIS/lib -L$prefix_dependencies/PARMETIS/lib -L$prefix_dependencies/BOOST/lib $hdf5_lib_dir -L$prefix_dependencies/LIBHILBERT/lib $lin_alg_dir " >> example.mk
if [ -d "$prefix_dependencies/CATALYST/lib" ]; then
catalyst_lib=$prefix_dependencies/CATALYST/lib
catalyst_lib_dir=-L$prefix_dependencies/CATALYST/lib
elif [ -d "$prefix_dependencies/CATALYST/lib64" ]; then
catalyst_lib=$prefix_dependencies/CATALYST/lib64
catalyst_lib_dir=-L$prefix_dependencies/CATALYST/lib64
fi

echo "INCLUDE_PATH=$mpi_include_dirs $cuda_include_dirs $openmp_flags -I. -I$prefix_openfpm/openfpm_numerics/include -I$prefix_openfpm/openfpm_pdata/include/config -I$prefix_openfpm/openfpm_pdata/include -I$prefix_openfpm/openfpm_data/include -I$prefix_openfpm/openfpm_vcluster/include -I$prefix_openfpm/openfpm_io/include -I$prefix_openfpm/openfpm_devices/include -I$prefix_dependencies/VCDEVEL/include -I$prefix_dependencies/METIS/include -I$prefix_dependencies/PARMETIS/include -I$prefix_dependencies/BOOST/include -I$prefix_dependencies/HDF5/include -I$prefix_dependencies/LIBHILBERT/include $lin_alg_inc -I$prefix_dependencies/BLITZ/include -I$prefix_dependencies/ALGOIM/include -I$prefix_dependencies/SUITESPARSE/include -I$prefix_dependencies/CATALYST/include/catalyst-2.0 " > example.mk
echo "LIBS_PATH=$mpi_libs -L$prefix_openfpm/openfpm_devices/lib -L$prefix_openfpm/openfpm_pdata/lib -L$prefix_openfpm/openfpm_vcluster/lib -L$prefix_dependencies/VCDEVEL/lib -L$prefix_dependencies/METIS/lib -L$prefix_dependencies/PARMETIS/lib -L$prefix_dependencies/BOOST/lib $hdf5_lib_dir -L$prefix_dependencies/LIBHILBERT/lib $lin_alg_dir $catalyst_lib_dir " >> example.mk
if [ x"$cuda_on_cpu" == x"YES" ]; then
echo "CUDA_ON_CPU=YES" >> example.mk
fi
echo "LIBS=$openmp_flags $mpi_libs $openmp_libs -lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $cuda_lib $lin_alg_lib -ldl -lboost_filesystem -lboost_system $optional_boost" >> example.mk
echo "LIBS_NVCC=-Xcompiler=$openmp_flags $mpi_libs -lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $cuda_lib $lin_alg_lib -ldl -lboost_filesystem -lboost_system $optional_boost" >> example.mk
echo "INCLUDE_PATH_NVCC=-Xcompiler=$openmp_flags "$cuda_options" $mpi_include_dirs -I. -I$prefix_openfpm/openfpm_numerics/include -I$prefix_openfpm/openfpm_pdata/include/config -I$prefix_openfpm/openfpm_pdata/include -I$prefix_openfpm/openfpm_data/include -I$prefix_openfpm/openfpm_vcluster/include -I$prefix_openfpm/openfpm_io/include -I$prefix_openfpm/openfpm_devices/include -I$prefix_dependencies/METIS/include -I$prefix_dependencies/PARMETIS/include -I$prefix_dependencies/BOOST/include -I$prefix_dependencies/HDF5/include -I$prefix_dependencies/LIBHILBERT/include $lin_alg_inc -I$prefix_dependencies/BLITZ/include -I$prefix_dependencies/ALGOIM/include -I$prefix_dependencies/SUITESPARSE/include " >> example.mk
echo "LIBS=$openmp_flags $mpi_libs $openmp_libs -lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $cuda_lib $lin_alg_lib -ldl -lboost_filesystem -lboost_system $optional_boost -lcatalyst" >> example.mk
echo "LIBS_NVCC=-Xcompiler=$openmp_flags $mpi_libs -lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $cuda_lib $lin_alg_lib -ldl -lboost_filesystem -lboost_system $optional_boost -lcatalyst" >> example.mk
echo "INCLUDE_PATH_NVCC=-Xcompiler=$openmp_flags "$cuda_options" $mpi_include_dirs -I. -I$prefix_openfpm/openfpm_numerics/include -I$prefix_openfpm/openfpm_pdata/include/config -I$prefix_openfpm/openfpm_pdata/include -I$prefix_openfpm/openfpm_data/include -I$prefix_openfpm/openfpm_vcluster/include -I$prefix_openfpm/openfpm_io/include -I$prefix_openfpm/openfpm_devices/include -I$prefix_dependencies/METIS/include -I$prefix_dependencies/PARMETIS/include -I$prefix_dependencies/BOOST/include -I$prefix_dependencies/HDF5/include -I$prefix_dependencies/LIBHILBERT/include $lin_alg_inc -I$prefix_dependencies/BLITZ/include -I$prefix_dependencies/ALGOIM/include -I$prefix_dependencies/SUITESPARSE/include -I$prefix_dependencies/CATALYST/include/catalyst-2.0 " >> example.mk
9 changes: 9 additions & 0 deletions script/install_CATALYST.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash

rm -rf catalyst
git clone https://gitlab.kitware.com/paraview/catalyst.git
cd catalyst
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1/CATALYST ..
make -j $2
make install