Commit 080a82bd authored by incardon's avatar incardon

Test on KEEP_PROPERTIES for GPU

parent 8c935272
...@@ -466,6 +466,9 @@ do ...@@ -466,6 +466,9 @@ do
boost) boost)
conf_options="$conf_options -DBOOST_ROOT=$ac_optarg" conf_options="$conf_options -DBOOST_ROOT=$ac_optarg"
;; ;;
mpivendor)
conf_options="$conf_options -DMPI_VENDOR=$ac_optarg"
;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';; ac_unrecognized_sep=', ';;
esac esac
......
...@@ -55,6 +55,7 @@ target_include_directories (ofpm_pdata PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config ...@@ -55,6 +55,7 @@ target_include_directories (ofpm_pdata PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config
target_include_directories (ofpm_pdata PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../openfpm_devices/src/) target_include_directories (ofpm_pdata PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../openfpm_devices/src/)
target_include_directories (ofpm_pdata PUBLIC ${Boost_INCLUDE_DIRS}) target_include_directories (ofpm_pdata PUBLIC ${Boost_INCLUDE_DIRS})
target_compile_definitions(pdata PRIVATE ${MPI_VENDOR})
if(PETSC_FOUND) if(PETSC_FOUND)
target_link_libraries(pdata ${PETSC_LIBRARIES}) target_link_libraries(pdata ${PETSC_LIBRARIES})
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#ifndef VECTOR_DIST_COMM_UTIL_FUNCS_HPP_ #ifndef VECTOR_DIST_COMM_UTIL_FUNCS_HPP_
#define VECTOR_DIST_COMM_UTIL_FUNCS_HPP_ #define VECTOR_DIST_COMM_UTIL_FUNCS_HPP_
#define SKIP_LABELLING 512
#define KEEP_PROPERTIES 512
template<unsigned int dim, typename St, typename prop, typename Memory, template<typename> class layout_base, typename Decomposition, typename scan_type, bool is_ok_cuda> template<unsigned int dim, typename St, typename prop, typename Memory, template<typename> class layout_base, typename Decomposition, typename scan_type, bool is_ok_cuda>
struct labelParticlesGhost_impl struct labelParticlesGhost_impl
{ {
...@@ -195,7 +198,11 @@ struct local_ghost_from_opart_impl<with_pos,dim,St,prop,Memory,layout_base,true> ...@@ -195,7 +198,11 @@ struct local_ghost_from_opart_impl<with_pos,dim,St,prop,Memory,layout_base,true>
size_t old = v_pos.size(); size_t old = v_pos.size();
v_pos.resize(v_pos.size() + o_part_loc.size(),DATA_ON_DEVICE); v_pos.resize(v_pos.size() + o_part_loc.size(),DATA_ON_DEVICE);
v_prp.resize(v_prp.size() + o_part_loc.size(),DATA_ON_DEVICE);
if (!(opt & SKIP_LABELLING))
{
v_prp.resize(v_prp.size() + o_part_loc.size(),DATA_ON_DEVICE);
}
process_ghost_particles_local<with_pos,dim,decltype(o_part_loc.toKernel()),decltype(v_pos.toKernel()),decltype(v_prp.toKernel()),decltype(shifts.toKernel())> process_ghost_particles_local<with_pos,dim,decltype(o_part_loc.toKernel()),decltype(v_pos.toKernel()),decltype(v_prp.toKernel()),decltype(shifts.toKernel())>
<<<ite.wthr,ite.thr>>> <<<ite.wthr,ite.thr>>>
......
...@@ -970,9 +970,6 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda) ...@@ -970,9 +970,6 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda)
vd.deviceToHostPos(); vd.deviceToHostPos();
vd.template deviceToHostProp<0>(); vd.template deviceToHostProp<0>();
// Get the neighborhood of each particles
auto VV = vd.getVerlet(0.01);
// store the number of neighborhood for each particles // store the number of neighborhood for each particles
...@@ -1036,12 +1033,11 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda) ...@@ -1036,12 +1033,11 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda)
for (size_t i = 0 ; i < 25 ; i++) for (size_t i = 0 ; i < 25 ; i++)
{ {
// move particles to CPU and move the particles by 0.1
vd.deviceToHostPos();
if (i % 2 == 0) if (i % 2 == 0)
{ {
// move particles to CPU and move the particles by 0.1
vd.deviceToHostPos();
auto it = vd.getDomainIterator(); auto it = vd.getDomainIterator();
...@@ -1091,6 +1087,7 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda) ...@@ -1091,6 +1087,7 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda)
} }
else else
{ {
vd.template deviceToHostProp<0,1,2>();
auto it2 = vd.getDomainIterator(); auto it2 = vd.getDomainIterator();
...@@ -1118,6 +1115,8 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda) ...@@ -1118,6 +1115,8 @@ BOOST_AUTO_TEST_CASE(vector_dist_keep_prop_on_cuda)
++it2; ++it2;
} }
vd.template hostToDeviceProp<0,1,2>();
++base; ++base;
vd.template ghost_get<0,1,2>(RUN_ON_DEVICE | KEEP_PROPERTIES); vd.template ghost_get<0,1,2>(RUN_ON_DEVICE | KEEP_PROPERTIES);
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
#include "Vector/util/vector_dist_funcs.hpp" #include "Vector/util/vector_dist_funcs.hpp"
#include "cuda/vector_dist_comm_util_funcs.cuh" #include "cuda/vector_dist_comm_util_funcs.cuh"
#define SKIP_LABELLING 512
#define KEEP_PROPERTIES 512
#define NO_POSITION 1 #define NO_POSITION 1
#define WITH_POSITION 2 #define WITH_POSITION 2
#define NO_CHANGE_ELEMENTS 4 #define NO_CHANGE_ELEMENTS 4
...@@ -1493,8 +1490,16 @@ public: ...@@ -1493,8 +1490,16 @@ public:
size_t opt_ = compute_options(opt); size_t opt_ = compute_options(opt);
if (opt & SKIP_LABELLING) if (opt & SKIP_LABELLING)
{ {
op_ssend_gg_recv_merge opm(g_m); if (opt & RUN_ON_DEVICE)
v_cl.template SSendRecvP_op<op_ssend_gg_recv_merge,send_vector,decltype(v_prp),layout_base,prp...>(g_send_prp,v_prp,prc_g_opart,opm,prc_recv_get,recv_sz_get,opt_); {
op_ssend_gg_recv_merge_run_device opm(g_m);
v_cl.template SSendRecvP_op<op_ssend_gg_recv_merge_run_device,send_vector,decltype(v_prp),layout_base,prp...>(g_send_prp,v_prp,prc_g_opart,opm,prc_recv_get,recv_sz_get,opt_);
}
else
{
op_ssend_gg_recv_merge opm(g_m);
v_cl.template SSendRecvP_op<op_ssend_gg_recv_merge,send_vector,decltype(v_prp),layout_base,prp...>(g_send_prp,v_prp,prc_g_opart,opm,prc_recv_get,recv_sz_get,opt_);
}
} }
else else
{v_cl.template SSendRecvP<send_vector,decltype(v_prp),layout_base,prp...>(g_send_prp,v_prp,prc_g_opart,prc_recv_get,recv_sz_get,recv_sz_get_byte,opt_);} {v_cl.template SSendRecvP<send_vector,decltype(v_prp),layout_base,prp...>(g_send_prp,v_prp,prc_g_opart,prc_recv_get,recv_sz_get,recv_sz_get_byte,opt_);}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment