We'll be taking GitLab down for maintenance around 22 in the evening on the 15th of September, so this Sunday. Let us know (tt.mpi-cbg.de) if you experience any issues with it after the maintenance period.

...
 
Commits (14)
include ../../example.mk
CC=mpic++
LDIR =
OBJ = main.o
all: md_dyn
%.o: %.cpp
$(CC) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
md_dyn: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
run: all
mpirun -np 3 ./md_dyn;
.PHONY: clean all run
clean:
rm -f *.o *~ core md_dyn
This diff is collapsed.
......@@ -949,7 +949,7 @@ inline void sensor_pressure(Vector & vd,
}
// Get the position of the neighborhood particle q
Point<3,double> xq = vd.template getPos(q);
Point<3,double> xq = vd.getPos(q);
// Calculate the contribution of the particle to the pressure
// of the probe
......
......@@ -209,10 +209,10 @@
*/
// A constant to indicate boundary particles
#define BOUNDARY 1
#define BOUNDARY 0
// A constant to indicate fluid particles
#define FLUID 0
#define FLUID 1
// initial spacing between particles dp in the formulas
const double dp = 0.0085;
......@@ -1125,7 +1125,6 @@ int main(int argc, char* argv[])
{
vd.deleteGhost();
vd.write_frame("Geometry",write,VTK_WRITER | FORMAT_BINARY);
vd.getDecomposition().write("dec" + std::to_string(write));
vd.ghost_get<type,rho,Pressure,velocity>(SKIP_LABELLING);
write++;
......
include ../../example.mk
CC=mpic++
LDIR =
OPT=
OBJ = main.o
sph_dlb:
sph_dlb_test: OPT += -DTEST_RUN
sph_dlb_test: sph_dlb
%.o: %.cpp
$(CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
sph_dlb: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: sph_dlb
run: sph_dlb_test
mpirun -np 2 ./sph_dlb
.PHONY: clean all run
clean:
rm -f *.o *~ core sph_dlb
[pack]
files = main.cpp Makefile
This diff is collapsed.
......@@ -6,13 +6,13 @@ if(CUDA_FOUND)
set(CUDA_SOURCES ../openfpm_devices/src/memory/CudaMemory.cu)
endif()
add_executable(cart_dec CartDecomposition_gen_vtk.cpp ../src/lib/pdata.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(cart_dec CartDecomposition_gen_vtk.cpp ../src/lib/pdata.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/ShmAllocator_manager.cpp ../openfpm_devices/src/memory/SemManager.cpp ../openfpm_devices/src/memory/ShmAllocator.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(metis_dec Metis_gen_vtk.cpp ../src/lib/pdata.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(metis_dec Metis_gen_vtk.cpp ../src/lib/pdata.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/ShmAllocator_manager.cpp ../openfpm_devices/src/memory/SemManager.cpp ../openfpm_devices/src/memory/ShmAllocator.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(dom_box domain_gen_vtk.cpp ../src/lib/pdata.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(dom_box domain_gen_vtk.cpp ../src/lib/pdata.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/ShmAllocator_manager.cpp ../openfpm_devices/src/memory/SemManager.cpp ../openfpm_devices/src/memory/ShmAllocator.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(vector_dist vector.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(vector_dist vector.cpp ${CUDA_SOURCES} ../openfpm_devices/src/memory/ShmAllocator_manager.cpp ../openfpm_devices/src/memory/SemManager.cpp ../openfpm_devices/src/memory/ShmAllocator.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_devices/src/Memleak_check.cpp)
###########################
......@@ -39,7 +39,7 @@ include_directories (${LIBHILBERT_INCLUDE_DIRS})
target_link_libraries(cart_dec ${Boost_LIBRARIES})
target_link_libraries(cart_dec -L${PARMETIS_ROOT}/lib parmetis)
target_link_libraries(cart_dec -L${METIS_ROOT}/lib metis)
target_link_libraries(cart_dec -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
target_link_libraries(cart_dec ${HDF5_LIBRARIES})
#target_link_libraries(cart_dec ${HDF5_LIBRARIES})
target_link_libraries(cart_dec -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES})
target_link_libraries(cart_dec ${MPI_C_LIBRARIES})
......@@ -47,24 +47,24 @@ target_link_libraries(cart_dec ${MPI_C_LIBRARIES})
target_link_libraries(metis_dec ${Boost_LIBRARIES})
target_link_libraries(metis_dec -L${PARMETIS_ROOT}/lib parmetis)
target_link_libraries(metis_dec -L${METIS_ROOT}/lib metis)
target_link_libraries(metis_dec -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
#target_link_libraries(metis_dec ${HDF5_LIBRARIES})
#target_link_libraries(metis_dec -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
target_link_libraries(metis_dec ${HDF5_LIBRARIES})
target_link_libraries(metis_dec -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES})
target_link_libraries(metis_dec ${MPI_C_LIBRARIES})
target_link_libraries(dom_box ${Boost_LIBRARIES})
target_link_libraries(dom_box -L${PARMETIS_ROOT}/lib parmetis)
target_link_libraries(dom_box -L${METIS_ROOT}/lib metis)
target_link_libraries(dom_box -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
#target_link_libraries(dom_box ${HDF5_LIBRARIES})
#target_link_libraries(dom_box -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
target_link_libraries(dom_box ${HDF5_LIBRARIES})
target_link_libraries(dom_box -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES})
target_link_libraries(dom_box ${MPI_C_LIBRARIES})
target_link_libraries(vector_dist ${Boost_LIBRARIES})
target_link_libraries(vector_dist -L${PARMETIS_ROOT}/lib parmetis)
target_link_libraries(vector_dist -L${METIS_ROOT}/lib metis)
target_link_libraries(vector_dist -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
#target_link_libraries(vector_dist ${HDF5_LIBRARIES})
#target_link_libraries(vector_dist -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
target_link_libraries(vector_dist ${HDF5_LIBRARIES})
target_link_libraries(vector_dist -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES})
target_link_libraries(vector_dist ${MPI_C_LIBRARIES})
......
openfpm_data @ 14682857
Subproject commit 6e1c547e785a6ce03b31dfbfd41d77314a169ecd
Subproject commit 14682857a31aa1424227535a7de94b9fc68aea27
openfpm_devices @ 22b0ed11
Subproject commit 1a3dfc0a96e4ad8ab61f7f1f7cdc9127ea99041c
Subproject commit 22b0ed11ce799f286c8435544d5af8abcb5a131a
openfpm_io @ c01dfb53
Subproject commit 764fcd4eb12ffa80acf469ce6e47bace55d7a9e2
Subproject commit c01dfb531800dc755361c756af3b99fbbb553d97
openfpm_numerics @ 8097fca9
Subproject commit bfb34d93c57beaafaac820f21fc922af5c78e387
Subproject commit 8097fca9ca2fe7df09601013306e049bd89a04e7
openfpm_vcluster @ 8b660cc6
Subproject commit 23c94dfb18a9b72887f98978afd1bca6ca6acbed
Subproject commit 8b660cc68ecc65cc2c368145c567efb4cea7c4f0
......@@ -36,6 +36,11 @@ else
echo "ZLIB is already installed"
fi
if [ -d "$1/HDF5" ]; then
echo "HDF5 is already installed"
exit 0
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
......
......@@ -23,10 +23,14 @@ fi
cd SuiteSparse
if [ x"$CXX" == x"icpc" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/$1/OPENBLAS/lib"
STS_LIB="-shared-intel -lrt -lifcore"
fi
if [ x"$CXX" == x"g++" ]; then
OPT_GPP=" -shared -fPIC "
fi
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1/OPENBLAS/lib"
if [ x"$platform" == x"cygwin" ]; then
......
......@@ -9,7 +9,7 @@ else()
set(CUDA_SOURCES)
endif()
add_executable(pdata ${OPENFPM_INIT_FILE} ${CUDA_SOURCES} main.cpp Debug/debug_test.cpp Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp Grid/tests/grid_dist_id_unit_test.cpp Grid/tests/staggered_grid_dist_unit_test.cpp Vector/tests/vector_dist_cell_list_tests.cpp Vector/tests/vector_dist_complex_prp_unit_test.cpp Vector/tests/vector_dist_HDF5_chckpnt_restart_test.cpp Vector/tests/vector_dist_MP_unit_tests.cpp Vector/tests/vector_dist_NN_tests.cpp Vector/tests/vector_dist_unit_test.cpp pdata_performance.cpp Decomposition/tests/CartDecomposition_unit_test.cpp Decomposition/tests/shift_vect_converter_tests.cpp Vector/performance/vector_dist_performance_util.cpp lib/pdata.cpp test_multiple_o.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
add_executable(pdata ${OPENFPM_INIT_FILE} ${CUDA_SOURCES} main.cpp Debug/debug_test.cpp Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp Grid/tests/grid_dist_id_unit_test.cpp Grid/tests/staggered_grid_dist_unit_test.cpp Vector/tests/vector_dist_cell_list_tests.cpp Vector/tests/vector_dist_complex_prp_unit_test.cpp Vector/tests/vector_dist_HDF5_chckpnt_restart_test.cpp Vector/tests/vector_dist_MP_unit_tests.cpp Vector/tests/vector_dist_NN_tests.cpp Vector/tests/vector_dist_unit_test.cpp pdata_performance.cpp Decomposition/tests/CartDecomposition_unit_test.cpp Decomposition/tests/shift_vect_converter_tests.cpp Vector/performance/vector_dist_performance_util.cpp lib/pdata.cpp test_multiple_o.cpp ../openfpm_devices/src/memory/ShmAllocator_manager.cpp ../openfpm_devices/src/memory/SemManager.cpp ../openfpm_devices/src/memory/ShmAllocator.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp)
if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(pdata PRIVATE "-Wno-deprecated-declarations")
......@@ -55,7 +55,7 @@ target_include_directories (pdata PUBLIC ${Boost_INCLUDE_DIRS})
target_link_libraries(pdata ${Boost_LIBRARIES})
target_link_libraries(pdata -L${PARMETIS_ROOT}/lib parmetis)
target_link_libraries(pdata -L${METIS_ROOT}/lib metis)
target_link_libraries(pdata -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
target_link_libraries(pdata ${HDF5_LIBRARIES})
target_link_libraries(pdata -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES})
target_link_libraries(pdata ${PETSC_LIBRARIES})
......
......@@ -182,7 +182,7 @@ public:
v_cl(v_cl), nc(nc)
{
// TODO Move into VCluster
MPI_Comm_dup(MPI_COMM_WORLD, &comm);
MPI_Comm_dup(v_cl.getMPIComm(), &comm);
// Nullify Mg
Mg.nvtxs = NULL;
......
......@@ -224,7 +224,7 @@ public:
#endif
// TODO Move into VCluster
MPI_Comm_dup(MPI_COMM_WORLD, &comm);
MPI_Comm_dup(v_cl.getMPIComm(), &comm);
// Nullify Mg
Mg.nvtxs = NULL;
......
LINKLIBS = $(HDF5_LDFLAGS) $(HDF5_LIBS) $(OPENMP_LDFLAGS) $(LIBHILBERT_LIB) $(METIS_LIB) $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS) $(PETSC_LIB) $(SUITESPARSE_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(PARMETIS_LIB) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(BOOST_CHRONO_LIB) $(BOOST_TIMER_LIB) $(BOOST_SYSTEM_LIB) $(LIBIFCORE)
FLAGS_NVCC = -Xcudafe "--display_error_number --diag_suppress=2885 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111" $(NVCCFLAGS) $(INCLUDES_PATH) $(HDF5_CPPFLAGS) $(BOOST_CPPFLAGS) $(MPI_INC_PATH) $(PETSC_INCLUDE) $(LIBHILBERT_INCLUDE) $(PARMETIS_INCLUDE) $(METIS_INCLUDE) -g --expt-extended-lambda
noinst_PROGRAMS = pdata actual_test
if BUILDCUDA
pdata_SOURCES = initialize/initialize_wrapper_cuda.cu
actual_test_SOURCES = initialize/initialize_wrapper_cuda.cu
else
pdata_SOURCES = initialize/initialize_wrapper_cpu.cpp
actual_test_SOURCES = initialize/initialize_wrapper_cpu.cpp
endif
pdata_SOURCES += main.cpp Vector/cuda/vector_dist_cuda_func_test.cu Decomposition/cuda/decomposition_cuda_tests.cu Vector/cuda/vector_dist_gpu_unit_tests.cu Grid/tests/grid_dist_id_HDF5_chckpnt_restart_test.cpp Grid/tests/grid_dist_id_unit_test.cpp Grid/tests/staggered_grid_dist_unit_test.cpp Vector/tests/vector_dist_cell_list_tests.cpp Vector/tests/vector_dist_complex_prp_unit_test.cpp Vector/tests/vector_dist_HDF5_chckpnt_restart_test.cpp Vector/tests/vector_dist_MP_unit_tests.cpp Vector/tests/vector_dist_NN_tests.cpp Vector/tests/vector_dist_unit_test.cpp pdata_performance.cpp Decomposition/tests/CartDecomposition_unit_test.cpp Decomposition/tests/shift_vect_converter_tests.cpp Vector/performance/vector_dist_performance_util.cpp lib/pdata.cpp test_multiple_o.cpp ../openfpm_devices/src/memory/CudaMemory.cu ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
pdata_CXXFLAGS = -Wno-unknown-pragmas $(BOOST_CPPFLAGS) $(HDF5_CPPFLAGS) $(OPENMP_CFLAGS) $(AM_CXXFLAGS) $(LIBHILBERT_INCLUDE) $(PETSC_INCLUDE) $(CUDA_CFLAGS) $(INCLUDES_PATH) $(PARMETIS_INCLUDE) $(METIS_INCLUDE) $(H5PART_INCLUDE) -DPARALLEL_IO -Wno-unused-local-typedefs
pdata_CFLAGS = $(CUDA_CFLAGS)
pdata_LDADD = $(LINKLIBS) -lparmetis -lmetis
actual_test_SOURCES = Vector/cuda/vector_dist_cuda_func_test.cu Vector/cuda/vector_dist_gpu_unit_tests.cu vector_ main_single.cpp lib/pdata.cpp test_multiple_o.cpp ../openfpm_devices/src/memory/CudaMemory.cu ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
actual_test_CXXFLAGS = -Wno-unknown-pragmas $(BOOST_CPPFLAGS) $(HDF5_CPPFLAGS) $(OPENMP_CFLAGS) $(AM_CXXFLAGS) $(LIBHILBERT_INCLUDE) $(PETSC_INCLUDE) $(CUDA_CFLAGS) $(INCLUDES_PATH) $(PARMETIS_INCLUDE) $(METIS_INCLUDE) $(H5PART_INCLUDE) -DPARALLEL_IO -Wno-unused-local-typedefs
actual_test_CFLAGS = $(CUDA_CFLAGS)
actual_test_LDADD = $(LINKLIBS) -lparmetis -lmetis
nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/shift_vect_converter.hpp Decomposition/CartDecomposition_ext.hpp Decomposition/common.hpp Decomposition/Decomposition.hpp Decomposition/ie_ghost.hpp \
Decomposition/Domain_NN_calculator_cart.hpp Decomposition/nn_processor.hpp Decomposition/ie_loc_ghost.hpp Decomposition/ORB.hpp \
Graph/CartesianGraphFactory.hpp \
Grid/grid_dist_id.hpp Grid/grid_dist_id_comm.hpp Grid/Iterators/grid_dist_id_iterator_util.hpp Grid/Iterators/grid_dist_id_iterator_dec.hpp Grid/Iterators/grid_dist_id_iterator_dec_skin.hpp Grid/grid_dist_util.hpp Grid/Iterators/grid_dist_id_iterator_sub.hpp Grid/Iterators/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp Grid/staggered_dist_grid.hpp Grid/staggered_dist_grid_util.hpp Grid/staggered_dist_grid_copy.hpp \
Vector/se_class3_vector.hpp Vector/vector_dist_multiphase_functions.hpp Vector/vector_dist_comm.hpp Vector/vector_dist.hpp Vector/vector_dist_ofb.hpp Vector/Iterators/vector_dist_iterator.hpp Vector/vector_dist_key.hpp \
config/config.h \
example.mk \
Decomposition/Distribution/metis_util.hpp Decomposition/Distribution/SpaceDistribution.hpp Decomposition/Distribution/parmetis_dist_util.hpp Decomposition/Distribution/parmetis_util.hpp Decomposition/Distribution/MetisDistribution.hpp Decomposition/Distribution/ParMetisDistribution.hpp Decomposition/Distribution/DistParMetisDistribution.hpp Decomposition/dec_optimizer.hpp SubdomainGraphNodes.hpp \
Graph/ids.hpp Graph/dist_map_graph.hpp Graph/DistGraphFactory.hpp \
DLB/DLB.hpp DLB/LB_Model.hpp
#testa_SOURCES = Decomposition/Domain_NN_calculator_cart_unit_test.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_vcluster/src/VCluster/VCluster.cpp
#testa_LDADD = $(LINKLIBS)
#testa_CXXFLAGS = $(OPENMP_CFLAGS) $(AM_CXXFLAGS) $(LIBHILBERT_INCLUDE) $(PETSC_INCLUDE) $(HDF5_CPPFLAGS) $(CUDA_CFLAGS) $(INCLUDES_PATH) $(PARMETIS_INCLUDE) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) $(H5PART_INCLUDE) -DPARALLEL_IO -Wno-unused-local-typedefs
lib_LIBRARIES = libofpm_pdata.a
libofpm_pdata_a_SOURCES = lib/pdata.cpp
libofpm_pdata_a_CXXFLAGS = $(OPENMP_CFLAGS) $(AM_CXXFLAGS) $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -Wno-unused-local-typedefs
libofpm_pdata_a_CFLAGS =
.cu.o :
$(NVCC) $(FLAGS_NVCC) -o $@ -c $<
test: pdata
source $(HOME)/openfpm_vars && cd .. && mpirun -np 3 ./src/pdata && mpirun -np 4 ./src/pdata
......@@ -238,6 +238,178 @@ BOOST_AUTO_TEST_CASE( vector_dist_full_NN )
test_full_nn<VERLET_MEMMW(3,float)>(k);
}
BOOST_AUTO_TEST_CASE( vector_dist_particle_shmem_test )
{
Vcluster<> & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() > 12)
return;
// set the seed
// create the random generator engine
std::srand(v_cl.getProcessUnitID());
std::default_random_engine eg;
std::uniform_real_distribution<float> ud(0.0f, 1.0f);
long int k = 750 * v_cl.getProcessingUnits();
print_test_v("Testing 3D particle cell iterator=",k);
BOOST_TEST_CHECKPOINT( "Testing 3D full NN search k=" << k );
Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0});
// Boundary conditions
size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
float r_cut = 0.1;
// ghost
Ghost<3,float> ghost(r_cut);
typedef aggregate<float> part_prop;
// Distributed vector
vector_dist<3,float, part_prop > vd(0,box,bc,ghost);
vd.visualize();
vd.setCapacity(10000);
vd.resize(1000);
auto it = vd.getIterator();
while (it.isNext())
{
auto key = it.get();
vd.getPos(key)[0] = ud(eg);
vd.getPos(key)[1] = ud(eg);
vd.getPos(key)[2] = ud(eg);
// Fill some properties randomly
vd.getProp<0>(key) = 0.0;
++it;
}
vd.map();
// sync the ghost
vd.ghost_get<0>();
vd.write("stationary_particles");
sleep(100000);
/* openfpm::vector<size_t> ids;
ids.resize(vd.size_local());
auto NN = vd.getCellListSym(r_cut);
auto it_pcell = vd.getDomainIteratorCells(NN);
size_t count = 0;
while (it_pcell.isNext())
{
count++;
size_t id = it_pcell.get();
ids.get(id) = 1;
BOOST_REQUIRE(id < vd.size_local());
++it_pcell;
}
v_cl.sum(count);
v_cl.execute();
BOOST_REQUIRE_EQUAL((long int)count,k);*/
}
BOOST_AUTO_TEST_CASE( vector_dist_particle )
{
Vcluster<> & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() > 12)
return;
// set the seed
// create the random generator engine
std::srand(v_cl.getProcessUnitID());
std::default_random_engine eg;
std::uniform_real_distribution<float> ud(0.0f, 1.0f);
long int k = 750 * v_cl.getProcessingUnits();
print_test_v("Testing 3D particle cell iterator=",k);
BOOST_TEST_CHECKPOINT( "Testing 3D full NN search k=" << k );
Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0});
// Boundary conditions
size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
float r_cut = 0.1;
// ghost
Ghost<3,float> ghost(r_cut);
typedef aggregate<float> part_prop;
// Distributed vector
vector_dist<3,float, part_prop > vd(k,box,bc,ghost,BIND_DEC_TO_GHOST);
auto it = vd.getIterator();
while (it.isNext())
{
auto key = it.get();
vd.getPos(key)[0] = ud(eg);
vd.getPos(key)[1] = ud(eg);
vd.getPos(key)[2] = ud(eg);
// Fill some properties randomly
vd.getProp<0>(key) = 0.0;
++it;
}
vd.map();
// sync the ghost
vd.ghost_get<0>();
openfpm::vector<size_t> ids;
ids.resize(vd.size_local());
auto NN = vd.getCellListSym(r_cut);
auto it_pcell = vd.getDomainIteratorCells(NN);
size_t count = 0;
while (it_pcell.isNext())
{
count++;
size_t id = it_pcell.get();
ids.get(id) = 1;
BOOST_REQUIRE(id < vd.size_local());
++it_pcell;
}
v_cl.sum(count);
v_cl.execute();
BOOST_REQUIRE_EQUAL((long int)count,k);
}
BOOST_AUTO_TEST_CASE( vector_dist_particle_iteration )
{
Vcluster<> & v_cl = create_vcluster();
......
......@@ -1991,9 +1991,9 @@ void test_vector_dist_particle_NN_MP_iteration()
{
auto key = it.get();
vd.template getPosWrite(key)[0] = ud(eg);
vd.template getPosWrite(key)[1] = ud(eg);
vd.template getPosWrite(key)[2] = ud(eg);
vd.getPosWrite(key)[0] = ud(eg);
vd.getPosWrite(key)[1] = ud(eg);
vd.getPosWrite(key)[2] = ud(eg);
// Fill some properties randomly
......
......@@ -37,6 +37,7 @@
#include "NN/CellList/ProcKeys.hpp"
#include "Vector/vector_dist_kernel.hpp"
#include "NN/CellList/cuda/CellList_gpu.hpp"
#include "memory/ShmAllocator_manager.hpp"
#define DEC_GRAN(gr) ((size_t)gr << 32)
......@@ -257,6 +258,11 @@ private:
//! reordered v_prp buffer
openfpm::vector<Point<dim, St>,Memory,typename layout_base<Point<dim,St>>::type,layout_base> v_pos_out;
//! Shared memory handle for position vector
handle_shmem hpos;
//! Shared memory handle for property vector
handle_shmem hprp;
//! Virtual cluster
Vcluster<Memory> & v_cl;
......@@ -378,6 +384,8 @@ private:
}
}
public:
//! property object
......@@ -451,7 +459,8 @@ public:
// default constructor (structure contain garbage)
vector_dist()
:v_cl(create_vcluster<Memory>()),opt(opt)
{}
{
}
/*! \brief Copy Constructor
......@@ -547,6 +556,26 @@ public:
#ifdef SE_CLASS2
check_delete(this);
#endif
create_shmanager().destroy(hpos);
create_shmanager().destroy(hprp);
}
/*! /brief set shared memory
*
*
*/
void visualize()
{
if (global_option == init_options::in_situ_visualization)
{
hpos = create_shmanager().create("/tmp",v_cl.rank());
hprp = create_shmanager().create("/home",v_cl.rank());
v_pos.init_shmem(hpos);
v_prp.init_shmem(hprp);
}
}
/*! \brief remove all the elements
......@@ -2726,6 +2755,20 @@ public:
return key;
}
void set_g_m(size_t g_m)
{
this->g_m = g_m;
}
/* \brief set the capacity of the internal vector (advanced use only)
*
*
*/
void setCapacity(size_t np)
{
v_pos.reserve(np);
v_prp.reserve(np);
}
#ifdef CUDA_GPU
......@@ -2797,10 +2840,6 @@ public:
v_pos.template hostToDevice<0>();
}
void set_g_m(size_t g_m)
{
this->g_m = g_m;
}
/*! \brief this function sort the vector
*
......
......@@ -4,7 +4,7 @@
void openfpm_init_wrapper(int * argc, char *** argv)
{
openfpm_init(argc,argv);
openfpm_init(argc,argv,init_options::in_situ_visualization);
}
void openfpm_finalize_wrapper()
......
......@@ -5,7 +5,7 @@
void openfpm_init_wrapper(int * argc, char *** argv)
{
openfpm_init(argc,argv);
openfpm_init(argc,argv,init_options::in_situ_visualization);
}
void openfpm_finalize_wrapper()
......