...
 
Commits (58)
......@@ -9,15 +9,16 @@ centos_build:
- ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS $CI_COMMIT_REF_NAME
centos_run:
needs: [centos_build]
stage: test
tags:
- centos
dependencies:
- centos_build
script:
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 5 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 5 $CI_COMMIT_REF_NAME
mac_build:
......@@ -31,15 +32,15 @@ mac_build:
- ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS $CI_COMMIT_REF_NAME
mac_run:
needs: [mac_build]
stage: test
tags:
- mac
dependencies:
- mac_build
script:
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 5 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 4 $CI_COMMIT_REF_NAME
ubuntu_build:
stage: build
......@@ -52,13 +53,14 @@ ubuntu_build:
- ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS $CI_COMMIT_REF_NAME
ubuntu_run:
needs: [ubuntu_build]
stage: test
tags:
- ubuntu
dependencies:
- ubuntu_build
script:
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 5 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR "$CI_RUNNER_TAGS" 5 $CI_COMMIT_REF_NAME
......@@ -3,35 +3,30 @@ project(openfpm_pdata LANGUAGES C CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake_modules/)
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
set(BOOST_INCLUDE ${Boost_INCLUDE_DIR} CACHE PATH "Include directory for BOOST")
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")
set(PETSC_ROOT CACHE PATH "If compiling with linear algebra indicate the PETSC root directory")
set(ENV{PETSC_DIR} ${PETSC_ROOT})
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CUDA_STANDARD 11)
set(ALPAKA_ROOT CACHE PATH "Alpaka root path")
set(CUDA_ON_CPU CACHE BOOL "Make Cuda work on heap")
if (ENABLE_GPU)
enable_language(CUDA)
find_package(CUDA)
if (CUDA_VERSION_MAJOR EQUAL 9 AND CUDA_VERSION_MINOR EQUAL 2)
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=611 --diag_suppress=2885 --diag_suppress=2886 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111" --expt-extended-lambda)
elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 1 )
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=2915 --diag_suppress=2912 --diag_suppress=2913 --diag_suppress=111 --diag_suppress=186 --diag_suppress=611 " --expt-extended-lambda)
set(CUDA_ON_CPU OFF)
enable_language(CUDA)
find_package(CUDA)
endif()
else()
message(FATAL_ERROR "CUDA is incompatible, version 9.2 is only supported")
endif()
set(ENV{PETSC_DIR} ${PETSC_ROOT})
endif()
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CUDA_STANDARD 14)
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(PETSc)
......@@ -59,10 +54,6 @@ if(PETSC_FOUND)
set(DEFINE_HAVE_PETSC "#define HAVE_PETSC")
endif()
if(CUDA_FOUND)
set(DEFINE_CUDA_GPU "#define CUDA_GPU")
endif()
if(MPI_FOUND)
set(DEFINE_HAVE_MPI "#define HAVE_MPI")
else()
......@@ -70,18 +61,38 @@ else()
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()
if(CUDA_FOUND)
set(DEFINE_CUDA_GPU "#define CUDA_GPU")
endif()
if(CUDA_ON_CPU)
set(DEFINE_CUDA_GPU "#define CUDA_GPU")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config/config.h)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_subdirectory (src)
add_subdirectory (../openfpm_data/ openfpm_data)
set(WARNING_SUPPRESSION_AND_OPTION_NVCC ${WARNING_SUPPRESSION_AND_OPTION_NVCC} PARENT_SCOPE)
set(WARNING_SUPPRESSION_AND_OPTION_NVCC_TEXT ${WARNING_SUPPRESSION_AND_OPTION_NVCC_TEXT} PARENT_SCOPE)
add_subdirectory (src)
#!groovy
parallel (
"cifarm-centos-node" : {node ('cifarm-centos-node')
{
deleteDir()
checkout scm
stage ('build centos')
{
sh "./build.sh $WORKSPACE $NODE_NAME $BRANCH_NAME"
}
stage ('run centos')
{
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 2 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 3 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 4 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 5 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./success.sh 2 centos openfpm_vcluster"
}
}
},
"cifarm-mac-node" : {node ('cifarm-mac-node')
{
deleteDir()
checkout scm
stage ('build mac')
{
sh "./build.sh $WORKSPACE $NODE_NAME $BRANCH_NAME"
}
stage ('run mac')
{
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 2 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 3 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 4 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 5 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 6 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 7 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./success.sh 2 mac openfpm_vcluster"
}
}
},
"cifarm-ubuntu-node" : {node ('cifarm-ubuntu-node')
{
deleteDir()
checkout scm
stage ('build ubuntu')
{
sh "./build.sh $WORKSPACE $NODE_NAME $BRANCH_NAME"
}
stage ('run ubuntu')
{
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 2 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 3 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 4 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 5 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 6 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 7 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./success.sh 2 ubuntu openfpm_vcluster"
}
}
}
)
......@@ -38,6 +38,20 @@ if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/LIBHILBERT ]; then
./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi
#if [ x"$hostname" == x"cifarm-mac-node" ]; then
# echo "Killing ghost"
# kill 73440 87662 87661 73439 51687 51686
#fi
if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de" ]; then
echo "CentOS node"
source /opt/rh/devtoolset-7/enable
fi
if [ x"$hostname" == x"cifarm-ubuntu-node" ]; then
echo "Ubuntu node"
export PATH="/opt/bin:$PATH"
fi
if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/BOOST ]; then
if [ x"$hostname" == x"cifarm-mac-node" ]; then
......@@ -54,60 +68,21 @@ if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/MPI ]; then
./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
if [ "$hostname" == "gin" ]; then
echo "Compiling on gin\n"
module load gcc/4.9.2
module load openmpi/1.8.1
elif [ "$hostname" == "wetcluster" ]; then
echo "Compiling on wetcluster"
## produce the module path
export MODULEPATH="/sw/apps/modules/modulefiles:$MODULEPATH"
script="module load gcc/4.9.2\n
module load openmpi/1.8.1\n
module load boost/1.54.0\n
compile_options='--with-boost=/sw/apps/boost/1.54.0/'\n
\n
sh ./autogen.sh\n
sh ./configure \"\$compile_options\" CXX=mpic++\n
make\n
if [ \"\$?\" = "0" ]; then exit 1 ; fi\n
exit(0)\n"
echo $script | sed -r 's/\\n/\n/g' > compile_script
bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script
elif [ "$hostname" == "taurus" ]; then
echo "Compiling on taurus"
echo "$PATH"
module load gcc/5.3.0
module load boost/1.60.0
module load openmpi/1.10.2-gnu
module unload bullxmpi
sh ./autogen.sh
sh ./configure CXX=mpic++
make
if [ $? -ne 0 ]; then exit 1 ; fi
### to exclude --exclude=taurusi[6300-6400],taurusi[5400-5500]
if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/LIBHILBERT ]; then
./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi
else
if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/VCDEVEL ]; then
./install_VCDEVEL.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 gcc g++
fi
source $HOME/.bashrc
echo "$PATH"
echo "Compiling general"
sh ./autogen.sh
sh ./configure CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
make VERBOSE=1 -j 4
if [ $? -ne 0 ]; then exit 1 ; fi
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
fi
source $HOME/.bashrc
echo "$PATH"
echo "Compiling general"
sh ./autogen.sh
sh ./configure CXX=mpic++ --with-vcdevel=$HOME/openfpm_dependencies/openfpm_vcluster/VCDEVEL --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST --with-libhilbert=$HOME/openfpm_dependencies/openfpm_vcluster/LIBHILBERT --enable-cuda-on-cpu
make VERBOSE=1 -j 4
if [ $? -ne 0 ]; then exit 1 ; fi
#!/bin/sh
#!/bin/bash
# configure script
#
#
# Because we moved to cmake this script emulate the configure script from autotools
conf_options=
ld_lib_pathopt=
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
......@@ -99,6 +100,7 @@ enable_debug
with_metis
with_hdf5
with_libhilbert
enable_cuda_on_cpu
enable_scan_coverty
enable_test_performance
enable_test_coverage
......@@ -106,6 +108,7 @@ with_parmetis
enable_se_class1
enable_se_class2
enable_se_class3
with_alpaka
with_action_on_error
with_boost
with_boost_libdir
......@@ -117,7 +120,9 @@ with_lapack
with_suitesparse
with_petsc
with_eigen
with_vcdevel
enable_gpu
enable_asan
'
rm -rf build
......@@ -125,6 +130,8 @@ if [ ! -d "build" ]; then
mkdir build
fi
echo "/usr/local" > install_dir
##### Go over all options
for ac_option
do
......@@ -229,6 +236,15 @@ do
test_coverage)
conf_options="$conf_options -DTEST_COVERAGE=ON"
;;
scan_coverty)
conf_options="$conf_options -DSCAN_COVERTY=ON"
;;
cuda_on_cpu)
conf_options="$conf_options -DCUDA_ON_CPU=ON"
;;
test_performance)
conf_options="$conf_options -DTEST_PERFORMANCE=ON"
;;
gpu)
if [ x"$CXX" == x"" ]; then
conf_options="$conf_options"
......@@ -237,6 +253,9 @@ do
fi
conf_options="$conf_options -DENABLE_GPU=ON"
;;
asan)
conf_options="$conf_options -DENABLE_ASAN=ON"
;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', '
;;
......@@ -462,16 +481,26 @@ do
;;
suitesparse)
conf_options="$conf_options -DSUITESPARSE_ROOT=$ac_optarg"
ld_lib_pathopt=$ac_optarg/lib
;;
eigen)
conf_options="$conf_options -DEIGEN3_ROOT=$ac_optarg"
;;
boost)
conf_options="$conf_options -DBOOST_ROOT=$ac_optarg"
conf_options="$conf_options -DBOOST_ROOT=$ac_optarg -DBoost_NO_BOOST_CMAKE=ON"
;;
action_on_error)
conf_options="$conf_options -DACTION_ON_ERROR=$ac_optarg"
;;
mpivendor)
conf_options="$conf_options -DMPI_VENDOR=$ac_optarg"
;;
vcdevel)
conf_options="$conf_options -DVc_ROOT=$ac_optarg"
;;
alpaka)
conf_options="$conf_options -DALPAKA_ROOT=$ac_optarg"
;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
......@@ -545,7 +574,7 @@ cd build
## remove enerything
echo "Calling cmake ../. $conf_options"
rm ../error_code
cmake ../. $conf_options
DYLD_LIBRARY_PATH=$ld_lib_pathopt cmake ../. $conf_options
if [ $? != 0 ]; then
#ok something went wrong the install script analyze the return code to potentially fix the problem automatically
# Read the error code and exit with that
......
......@@ -7,11 +7,26 @@ 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
fi
if [ x"$5" != x"" ]; then
echo "using gcc : $5.$6 : $4 ; " > $HOME/user-config.jam
else
echo "using gcc : : $4 ; " > $HOME/user-config.jam
fi
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_72_0.tar.bz2
#! /bin/bash
# check if the directory $1/VCDEVEL exist
if [ -d "$1/VCDEVEL" -a -f "$1/VCDEVEL/include/Vc/Vc" ]; then
echo "VCDEVEL already installed"
exit 0
fi
wget http://ppmcore.mpi-cbg.de/upload/Vc-1.4.1.tar.gz
#rm -rf Vc
tar -xf Vc-1.4.1.tar.gz
cd Vc-1.4.1
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1/VCDEVEL -DCMAKE_C_COMPILER=$3 -DCMAKE_CXX_COMPILER=$4 ..
make
make install
......@@ -2,11 +2,20 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
########################### Executables
if (CUDA_FOUND)
set(CUDA_SOURCES ../../openfpm_devices/src/memory/CudaMemory.cu VCluster/cuda/VCluster_semantic_unit_cuda_tests.cu VCluster/cuda/VCluster_unit_tests.cu )
if (CUDA_FOUND OR CUDA_ON_CPU)
set(CUDA_SOURCES VCluster/cuda/VCluster_semantic_unit_cuda_tests.cu VCluster/cuda/VCluster_unit_tests.cu )
endif()
add_executable(vcluster_test main.cpp VCluster/VCluster.cpp ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/memory/PtrMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp VCluster/VCluster_unit_tests.cpp VCluster/VCluster_semantic_unit_tests.cpp ${CUDA_SOURCES})
if (CUDA_ON_CPU)
add_definitions(-DCUDA_ON_CPU -D__NVCC__ -DCUDART_VERSION=11000)
set_source_files_properties(${CUDA_SOURCES} PROPERTIES LANGUAGE CXX)
# set_source_files_properties(${CUDA_SOURCES} PROPERTIES COMPILE_FLAGS "-D__NVCC__ -DCUDA_GPU -DCUDART_VERSION=11000")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_definitions("-x c++")
endif()
endif()
add_executable(vcluster_test main.cpp VCluster/VCluster.cpp VCluster/VCluster_unit_tests.cpp VCluster/VCluster_semantic_unit_tests.cpp ${CUDA_SOURCES})
if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(vcluster_test PRIVATE "-Wno-deprecated-declarations")
......@@ -15,18 +24,28 @@ if ( CMAKE_COMPILER_IS_GNUCC )
endif()
endif()
add_library(vcluster STATIC VCluster/VCluster.cpp)
###########################
add_library(vcluster STATIC VCluster/VCluster.cpp)
add_library(vcluster_dl SHARED VCluster/VCluster.cpp)
if(CUDA_FOUND)
target_compile_options(vcluster_test PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
target_compile_options(vcluster PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
target_compile_options(vcluster_dl PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
target_include_directories (vcluster_test PUBLIC ${MPI_C_INCLUDE_DIRS})
if (TEST_COVERAGE)
target_compile_options(vcluster_test PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage">)
target_compile_options(vcluster_test PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage" >)
endif()
if (NOT CUDA_ON_CPU)
set_source_files_properties(VCluster/VCluster.cpp PROPERTIES LANGUAGE CUDA)
endif()
endif()
add_dependencies(vcluster_test ofpmmemory)
target_include_directories (vcluster_test PUBLIC ${CUDA_INCLUDE_DIRS})
target_include_directories (vcluster_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (vcluster_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_devices/src/)
......@@ -35,6 +54,7 @@ target_include_directories (vcluster_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
target_include_directories (vcluster_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_include_directories (vcluster_test PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories (vcluster_test PUBLIC ${PETSC_INCLUDES})
target_include_directories (vcluster_test PUBLIC ${ALPAKA_ROOT}/include)
target_include_directories (vcluster PUBLIC ${CUDA_INCLUDE_DIRS})
target_include_directories (vcluster PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
......@@ -43,9 +63,23 @@ target_include_directories (vcluster PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_include_directories (vcluster PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_data/src/)
target_include_directories (vcluster PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_devices/src/)
target_include_directories (vcluster PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories (vcluster PUBLIC ${ALPAKA_ROOT}/include)
target_include_directories (vcluster_dl PUBLIC ${CUDA_INCLUDE_DIRS})
target_include_directories (vcluster_dl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (vcluster_dl PUBLIC ${PETSC_INCLUDES})
target_include_directories (vcluster_dl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_include_directories (vcluster_dl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_data/src/)
target_include_directories (vcluster_dl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_devices/src/)
target_include_directories (vcluster_dl PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories (vcluster_dl PUBLIC ${ALPAKA_ROOT}/include)
target_link_libraries(vcluster_test ${Boost_LIBRARIES})
target_link_libraries(vcluster_test ${PETSC_LIBRARIES})
target_link_libraries(vcluster_test ofpmmemory)
target_link_libraries(vcluster_dl ${PETSC_LIBRARIES})
target_link_libraries(vcluster ${PETSC_LIBRARIES})
if (TEST_COVERAGE)
target_link_libraries(vcluster_test -lgcov)
......@@ -57,7 +91,7 @@ endif()
target_compile_features(vcluster_test PUBLIC cxx_std_11)
target_link_libraries(vcluster_test ${MPI_C_LIBRARIES})
install(TARGETS vcluster DESTINATION openfpm_vcluster/lib)
install(TARGETS vcluster vcluster_dl DESTINATION openfpm_vcluster/lib)
install(FILES MPI_wrapper/MPI_IallreduceW.hpp
MPI_wrapper/MPI_IrecvW.hpp
MPI_wrapper/MPI_IBcastW.hpp
......
......@@ -21,7 +21,9 @@ template<typename T> class MPI_IallreduceW
public:
static inline void reduce(T & buf,MPI_Op op, MPI_Request & req)
{
#ifndef DISABLE_ALL_RTTI
std::cerr << "Error: " << __FILE__ << ":" << __LINE__ << " cannot recognize " << typeid(T).name() << "\n";
#endif
}
};
......
......@@ -29,6 +29,12 @@ std::string program_name;
CudaMemory mem_tmp;
CudaMemory rem_tmp;
CudaMemory rem_tmp2[MAX_NUMER_OF_PROPERTIES];
CudaMemory exp_tmp;
CudaMemory exp_tmp2[MAX_NUMER_OF_PROPERTIES];
#endif
// Segmentation fault signal handler
......@@ -43,3 +49,121 @@ void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
exit(0);
}
double time_spent = 0.0;
/*! \brief Initialize the library
*
* This function MUST be called before any other function
*
*/
void openfpm_init_vcl(int *argc, char ***argv)
{
#ifdef HAVE_PETSC
PetscInitialize(argc,argv,NULL,NULL);
#endif
init_global_v_cluster_private(argc,argv);
#ifdef SE_CLASS1
std::cout << "OpenFPM is compiled with debug mode LEVEL:1. Remember to remove SE_CLASS1 when you go in production" << std::endl;
#endif
#ifdef SE_CLASS2
std::cout << "OpenFPM is compiled with debug mode LEVEL:2. Remember to remove SE_CLASS2 when you go in production" << std::endl;
#endif
#ifdef SE_CLASS3
std::cout << "OpenFPM is compiled with debug mode LEVEL:3. Remember to remove SE_CLASS3 when you go in production" << std::endl;
#endif
#ifdef CUDA_ON_CPU
init_wrappers();
#endif
// install segmentation fault signal handler
struct sigaction sa;
sa.sa_sigaction = bt_sighandler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
sigaction(SIGSEGV, &sa, NULL);
if (argc != NULL && *argc != 0)
{program_name = std::string(*argv[0]);}
// Initialize math pre-computation tables
openfpm::math::init_getFactorization();
ofp_initialized = true;
#ifdef CUDA_GPU
// Initialize temporal memory
mem_tmp.incRef();
exp_tmp.incRef();
for (int i = 0 ; i < MAX_NUMER_OF_PROPERTIES ; i++)
{
exp_tmp2[i].incRef();
}
#endif
}
size_t openfpm_vcluster_compilation_mask()
{
size_t compiler_mask = 0;
#ifdef CUDA_ON_CPU
compiler_mask |= 0x1;
#endif
#ifdef CUDA_GPU
compiler_mask |= 0x04;
#endif
return compiler_mask;
}
/*! \brief Finalize the library
*
* This function MUST be called at the end of the program
*
*/
void openfpm_finalize()
{
#ifdef HAVE_PETSC
PetscFinalize();
#endif
delete_global_v_cluster_private();
ofp_initialized = false;
#ifdef CUDA_GPU
// Release memory
mem_tmp.destroy();
mem_tmp.decRef();
exp_tmp.destroy();
exp_tmp.decRef();
for (int i = 0 ; i < MAX_NUMER_OF_PROPERTIES ; i++)
{
exp_tmp2[i].destroy();
exp_tmp2[i].decRef();
}
#endif
}
This diff is collapsed.
This diff is collapsed.
......@@ -262,7 +262,9 @@ struct unpack_selector_with_prp_lin<true,T,S,layout_base,Memory>
// add the received particles to the vector
PtrMemory * ptr1 = new PtrMemory(recv_buf.get(i).getPointer(),recv_buf.get(i).size());
ptr1->incRef();
{
// create vector representation to a piece of memory already allocated
openfpm::vector<typename T::value_type,PtrMemory,typename layout_base<typename T::value_type>::type,layout_base,openfpm::grow_policy_identity> v2;
......@@ -283,7 +285,10 @@ struct unpack_selector_with_prp_lin<true,T,S,layout_base,Memory>
sz_byte->get(i) = recv_buf.get(i).size();
if (sz != NULL)
sz->get(i) = recv_size_new - recv_size_old;
}
ptr1->decRef();
delete ptr1;
return 1;
}
};
......@@ -626,7 +631,7 @@ struct op_ssend_recv_add
};
//! Helper class to merge data without serialization
template<bool sr,template<typename,typename> class op>
template<bool sr,template<typename,typename> class op, typename vector_type_opart>
struct op_ssend_recv_merge_impl
{
//! Merge the
......@@ -635,7 +640,7 @@ struct op_ssend_recv_merge_impl
typename S,
template <typename> class layout_base,
int ... prp>
inline static void execute(D & recv,S & v2,size_t i,openfpm::vector<openfpm::vector<aggregate<size_t,size_t>>> & opart)
inline static void execute(D & recv,S & v2,size_t i,vector_type_opart & opart)
{
// Merge the information
recv.template merge_prp_v<op,
......@@ -643,13 +648,14 @@ struct op_ssend_recv_merge_impl
PtrMemory,
openfpm::grow_policy_identity,
layout_base,
typename vector_type_opart::value_type,
prp...>(v2,opart.get(i));
}
};
//! Helper class to merge data with serialization
template<template<typename,typename> class op>
struct op_ssend_recv_merge_impl<true,op>
template<template<typename,typename> class op, typename vector_type_opart>
struct op_ssend_recv_merge_impl<true,op,vector_type_opart>
{
//! merge the data
template<typename T,
......@@ -657,7 +663,7 @@ struct op_ssend_recv_merge_impl<true,op>
typename S,
template <typename> class layout_base,
int ... prp>
inline static void execute(D & recv,S & v2,size_t i,openfpm::vector<openfpm::vector<aggregate<size_t,size_t>>> & opart)
inline static void execute(D & recv,S & v2,size_t i,vector_type_opart & opart)
{
// Merge the information
recv.template merge_prp_v<op,
......@@ -665,19 +671,20 @@ struct op_ssend_recv_merge_impl<true,op>
HeapMemory,
openfpm::grow_policy_double,
layout_base,
typename vector_type_opart::value_type,
prp...>(v2,opart.get(i));
}
};
//! Helper class to merge data
template<template<typename,typename> class op>
template<template<typename,typename> class op, typename vector_type_opart>
struct op_ssend_recv_merge
{
//! For each processor contain the list of the particles with which I must merge the information
openfpm::vector<openfpm::vector<aggregate<size_t,size_t>>> & opart;
vector_type_opart & opart;
//! constructor
op_ssend_recv_merge(openfpm::vector<openfpm::vector<aggregate<size_t,size_t>>> & opart)
op_ssend_recv_merge(vector_type_opart & opart)
:opart(opart)
{}
......@@ -690,7 +697,81 @@ struct op_ssend_recv_merge
int ... prp>
void execute(D & recv,S & v2,size_t i,size_t opt)
{
op_ssend_recv_merge_impl<sr,op>::template execute<T,D,S,layout_base,prp...>(recv,v2,i,opart);
op_ssend_recv_merge_impl<sr,op,vector_type_opart>::template execute<T,D,S,layout_base,prp...>(recv,v2,i,opart);
}
};
//! Helper class to merge data without serialization
template<bool sr,template<typename,typename> class op, typename vector_type_opart, typename vector_type_prc_offset>
struct op_ssend_recv_merge_gpu_impl
{
//! Merge the
template<typename T,
typename D,
typename S,
template <typename> class layout_base,
int ... prp>
inline static void execute(D & recv,S & v2,size_t i,vector_type_opart & opart, vector_type_prc_offset & prc_off)
{
prc_off.template deviceToHost<0>();
unsigned int start = 0;
unsigned int stop = prc_off.template get<0>(i / sizeof...(prp));
if (i != 0)
{start = prc_off.template get<0>(i / sizeof...(prp)-1);}
// Merge the information
recv.template merge_prp_v_device<op,
typename T::value_type,
PtrMemory,
openfpm::grow_policy_identity,
layout_base,
vector_type_opart,
prp...>(v2,opart,start,stop);
}
};
//! Helper class to merge data with serialization
template<template<typename,typename> class op, typename vector_type_opart, typename vector_type_prc_offset>
struct op_ssend_recv_merge_gpu_impl<true,op,vector_type_opart,vector_type_prc_offset>
{
//! merge the data
template<typename T,
typename D,
typename S,
template <typename> class layout_base,
int ... prp>
inline static void execute(D & recv,S & v2,size_t i,vector_type_opart & opart, vector_type_prc_offset & prc_off)
{
std::cout << __FILE__ << ":" << __LINE__ << " Error: not implemented" << std::endl;
}
};
//! Helper class to merge data
template<template<typename,typename> class op, typename vector_type_opart, typename vector_type_prc_offset>
struct op_ssend_recv_merge_gpu
{
//! For each processor contain the list of the particles with which I must merge the information
vector_type_opart & opart;
vector_type_prc_offset & prc_offset;
//! constructor
op_ssend_recv_merge_gpu(vector_type_opart & opart, vector_type_prc_offset & prc_offset)
:opart(opart),prc_offset(prc_offset)
{}
//! execute the merge
template<bool sr,
typename T,
typename D,
typename S,
template <typename> class layout_base,
int ... prp>
void execute(D & recv,S & v2,size_t i,size_t opt)
{
op_ssend_recv_merge_gpu_impl<sr,op,vector_type_opart,vector_type_prc_offset>::template execute<T,D,S,layout_base,prp...>(recv,v2,i,opart,prc_offset);
}
};
......
This diff is collapsed.
......@@ -186,42 +186,160 @@ BOOST_AUTO_TEST_CASE(VCluster_bcast_complex_test)
test_single_all_broadcast_complex<aggregate<int,int>,HeapMemory,memory_traits_inte>(vcl);
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv)
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_unkn)
{
std::cout << "VCluster unit test start sendrecv" << "\n";
std::cout << "VCluster unit test start sendrecv short unknown" << "\n";
totp_check = false;
test<NBX>(RECEIVE_UNKNOWN);
test_short<NBX>(RECEIVE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv short unknown" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_unkn_async)
{
std::cout << "VCluster unit test start sendrecv short unknown async" << "\n";
totp_check = false;
test_no_send_some_peer<NBX>();
test_short<NBX_ASYNC>(RECEIVE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv" << "\n";
std::cout << "VCluster unit test stop sendrecv short unknown async" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_size_known)
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_unkn_async_multiple)
{
std::cout << "VCluster unit test start sendrecv known size" << "\n";
std::cout << "VCluster unit test start sendrecv short unknown async multiple" << "\n";
totp_check = false;
test<NBX>(RECEIVE_SIZE_UNKNOWN);
test_short_multiple<NBX_ASYNC>(RECEIVE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv short unknown async multiple" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_rand_unkn)
{
std::cout << "VCluster unit test start sendrecv random unknown" << "\n";
totp_check = false;
test_random<NBX>(RECEIVE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv random unknown" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_rand_unkn_async)
{
std::cout << "VCluster unit test start sendrecv random unknown async" << "\n";
totp_check = false;
test_random<NBX_ASYNC>(RECEIVE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv random unknown async" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_rand_unkn_async_multiple)
{
std::cout << "VCluster unit test start sendrecv random unknown async" << "\n";
totp_check = false;
test_random_multiple<NBX_ASYNC>(RECEIVE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv random unknown async" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_someempty)
{
std::cout << "VCluster unit test start sendrecv some empty" << "\n";
totp_check = false;
test_no_send_some_peer<NBX>();
std::cout << "VCluster unit test stop sendrecv known size" << "\n";
std::cout << "VCluster unit test stop sendrecv some empty" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_prc_known)
{
std::cout << "VCluster unit test start sendrecv short known prc" << "\n";
totp_check = false;
test_short<NBX>(RECEIVE_SIZE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv short known prc" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_prc_known_multiple)
{
std::cout << "VCluster unit test start sendrecv short known prc" << "\n";
totp_check = false;
test_short_multiple<NBX>(RECEIVE_SIZE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv short known prc" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_random_prc_known)
{
std::cout << "VCluster unit test start sendrecv random known prc" << "\n";
totp_check = false;
test_random<NBX>(RECEIVE_SIZE_UNKNOWN);
std::cout << "VCluster unit test stop sendrecv random known prc" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known )
{
std::cout << "VCluster unit test start known" << "\n";
test_known<NBX>();
test_known<NBX>(0);
std::cout << "VCluster unit test stop known" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_async )
{
std::cout << "VCluster unit test start known" << "\n";
test_known<NBX_ASYNC>(0);
std::cout << "VCluster unit test stop known" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_async_multiple )
{
std::cout << "VCluster unit test start known" << "\n";
test_known_multiple<NBX_ASYNC>(0);
std::cout << "VCluster unit test stop known" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_prc )
{
std::cout << "VCluster unit test start known prc" << "\n";
test_known<NBX>(KNOWN_PRC);
std::cout << "VCluster unit test stop known prc" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_prc_async )
{
std::cout << "VCluster unit test start known prc" << "\n";
test_known<NBX_ASYNC>(KNOWN_PRC);
std::cout << "VCluster unit test stop known prc" << "\n";
}
BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_prc_async_multiple )
{
std::cout << "VCluster unit test start known prc" << "\n";
test_known_multiple<NBX_ASYNC>(KNOWN_PRC);
std::cout << "VCluster unit test stop known prc" << "\n";
}
BOOST_AUTO_TEST_SUITE_END()
......@@ -32,6 +32,12 @@ ${DEFINE_HAVE_BOOST_PROGRAM_OPTIONS} /**/
/* define if the Boost::Unit_Test_Framework library is available */
${DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK} /**/
/* define if the Boost::Context library is available */
${DEFINE_HAVE_BOOST_CONTEXT} /**/
/* define if the Boost::Fiber library is available */
${DEFINE_HAVE_BOOST_FIBER} /**/
/* Have clock time */
${DEFINE_HAVE_CLOCK_GETTIME} /**/
......@@ -104,12 +110,31 @@ ${DEFINE_HAVE_SYS_TYPES_H}
/* Define to 1 if you have the <unistd.h> header file. */
${DEFINE_HAVE_UNISTD_H}
/* Test TinyObjLoader */
${DEFINE_HAVE_TINYOBJLOADER}
/* ACTION to take in case of error */
${DEFINE_ACTION_ON_ERROR}
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* NVCC compiling */
${DEFINE_NVCC} /**/
/* Define if we have Alpaka */
${DEFINE_HAVE_ALPAKA}
/* Additional alpaka definitions */
${ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE_DEF}
${ALPAKA_ACC_CPU_BT_OMP4_ENABLE_DEF}
/* Name of package */
#define PACKAGE "openfpm_pdata"
......@@ -157,3 +182,5 @@ ${DEFINE_TEST_COVERAGE_MODE}
/* Version number of package */
#define VERSION "1.0.0"
#define OPENFPM_PDATA