Skip to content
Snippets Groups Projects
Commit f63d9a62 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Merge branch 'cuda_on_cpu'

parents 2b5f1586 e352522f
No related branches found
No related tags found
No related merge requests found
Pipeline #2567 failed
......@@ -55,7 +55,7 @@ if(ENABLE_GPU)
endif()
endif()
find_package(Boost 1.66.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options)
find_package(Boost 1.72.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options OPTIONAL_COMPONENTS fiber context)
find_package(MPI REQUIRED)
find_package(HDF5 REQUIRED)
find_package(TinyObjLoader)
......@@ -92,10 +92,19 @@ if(PETSC_FOUND)
endif()
if (Boost_FOUND)
set(DEFINE_HAVE_BOOST "#define HAVE_BOOST")
set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS")
set(DEFINE_HAVE_BOOST_PROGRAM_OPTIONS "#define HAVE_BOOST_PROGRAM_OPTIONS")
set(DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK")
set(DEFINE_HAVE_BOOST "#define HAVE_BOOST")
set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS")
set(DEFINE_HAVE_BOOST_PROGRAM_OPTIONS "#define HAVE_BOOST_PROGRAM_OPTIONS")
set(DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK")
if (Boost_CONTEXT_FOUND)
set(DEFINE_HAVE_BOOST_CONTEXT "#define HAVE_BOOST_CONTEXT")
else()
#if context is not there CUDA_ON_CPU cannot be activated
set(CUDA_ON_CPU OFF)
endif()
if (Boost_FIBER_FOUND)
set(DEFINE_HAVE_BOOST_FIBER "#define HAVE_BOOST_FIBER")
endif()
else()
message( FATAL_ERROR "BOOST is required in order to install OpenFPM" )
endif()
......@@ -119,4 +128,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_subdirectory (src)
add_subdirectory (../openfpm_vcluster build)
......@@ -36,10 +36,14 @@ cd ..
cd "$1/openfpm_io"
#rm -rf $HOME/openfpm_dependencies/openfpm_io/$branch/MPI
#rm -rf $HOME/openfpm_dependencies/openfpm_io/$branch/HDF5
#rm -rf $HOME/openfpm_dependencies/openfpm_io/$branch/BOOST
if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de" ]; then
source /opt/rh/devtoolset-7/enable
./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
export PATH="/opt/bin:$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
fi
......@@ -64,22 +68,8 @@ fi
echo "Compiling on $2"
sh ./autogen.sh
if [ "$2" == "master" ]
then
sh ./configure CXX=mpic++ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc --disable-gpu
elif [ "$2" == "gin" ]
then
module load gcc/4.8.2
module load boost/1.54.0
sh ./configure CXX=mpic++ --with-boost=/sw/apps/boost/1.54.0/ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc
else
sh ./configure CXX=mpic++ --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/
fi
sh ./configure CXX=mpic++ --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/ --enable-cuda-on-cpu
make VERBOSE=1 -j 4
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to compile the openfpm_io test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
......@@ -7,9 +7,9 @@ if [ -d "$1/BOOST" ]; then
exit 0
fi
wget http://ppmcore.mpi-cbg.de/upload/boost_1_68_0.tar.bz2
tar -xvf boost_1_68_0.tar.bz2
cd boost_1_68_0
wget http://ppmcore.mpi-cbg.de/upload/boost_1_72_0.tar.bz2
tar -xvf boost_1_72_0.tar.bz2
cd boost_1_72_0
if [ x"$4" != x"" ]; then
if [ -f $HOME/user-config.jam ]; then
mv $HOME/user-config.jam $HOME/user-config.jam_bck
......@@ -23,10 +23,10 @@ fi
./bootstrap.sh --with-toolset=$3
mkdir $1/BOOST
./b2 -j $2 install --prefix=$1/BOOST
rm -rf boost_1_68_0
rm -rf boost_1_72_0
if [ -f $HOME/user-config.jam_bck ]; then
mv $HOME/user-config.jam_bck $HOME/user-config.jam
fi
rm -rf boost_1_68_0.tar.bz2
rm -rf boost_1_72_0.tar.bz2
......@@ -24,7 +24,7 @@ if [ ! -d "$1/ZLIB" -a x"$platform" != x"cygwin" ]; then
CC=mpicc ./configure --prefix=$1/ZLIB
make -j $2
cd ..
if [ $? -eq 0 ]; then
make check install
else
......@@ -37,9 +37,9 @@ else
fi
### 1.8.19 does not compile on CYGWIN
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.8.19.tar.gz
tar -xf hdf5-1.8.19.tar.gz
cd hdf5-1.8.19
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.10.6.tar.gz
tar -xf hdf5-1.10.6.tar.gz
cd hdf5-1.10.6
if [ x"$platform" != x"cygwin" ]; then
CC=mpicc ./configure --with-zlib=$1/ZLIB --enable-parallel --prefix=$1/HDF5
......@@ -54,4 +54,4 @@ if [ $? -ne 0 ]; then
echo "HDF5 error installing"
exit 0
fi
echo 1 > $1/HDF5/version
echo 2 > $1/HDF5/version
......@@ -2,14 +2,17 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
########################### Executables
if (CUDA_ON_CPU)
add_definitions(-DCUDA_ON_CPU)
endif()
add_executable(io main.cpp
MetaParser/MetaParser_unit_test.cpp
HDF5_wr/HDF5_writer_cuda.cu
ObjReader/ObjReader_unit_test.cpp
../../openfpm_vcluster/src/VCluster/VCluster.cpp
../../openfpm_devices/src/memory/CudaMemory.cu
../../openfpm_devices/src/memory/HeapMemory.cpp
../../openfpm_devices/src/memory/PtrMemory.cpp)
ObjReader/ObjReader_unit_test.cpp)
add_dependencies(io ofpmmemory)
add_dependencies(io vcluster)
if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(io PRIVATE "-Wno-deprecated-declarations")
......@@ -44,6 +47,7 @@ target_include_directories (io PUBLIC ${HDF5_ROOT}/include)
target_include_directories (io PUBLIC ${TINYOBJLOADER_INCLUDE_DIRS} )
target_include_directories (io PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories (io PUBLIC ${OPENFPM_PDATA_DIR}/src)
target_include_directories (io PUBLIC ${ALPAKA_ROOT}/include)
if (PETSC_FOUND)
target_include_directories(io PUBLIC ${PETSC_INCLUDES})
......@@ -52,6 +56,8 @@ endif()
target_link_libraries(io ${Boost_LIBRARIES})
target_link_libraries(io ${HDF5_LIBRARIES})
target_link_libraries(io ${TINYOBJLOADER_LIBRARIES} )
target_link_libraries(io ofpmmemory)
target_link_libraries(io vcluster)
if (PETSC_FOUND)
target_link_libraries(io ${PETSC_LIBRARIES})
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment