Commit d4e03ce3 authored by incardon's avatar incardon

Last changes to ghost cell

parent 699c8959
......@@ -9,10 +9,7 @@ AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([src/config/config.h])
m4_ifdef([ACX_PTHREAD],,[m4_include([m4/acx_pthread.m4])])
m4_ifdef([AX_CHECK_CL],,[m4_include([m4/ax_opencl.m4])])
m4_ifdef([AX_BOOST_BASE],,[m4_include([m4/ax_boost_base.m4])])
m4_ifdef([AX_BOOST_PROGRAM_OPTIONS],,[m4_include([m4/ax_boost_program_options.m4])])
m4_ifdef([AX_BOOST_THREAD],,[m4_include([m4/ax_boost_thread.m4])])
m4_ifdef([AX_BOOST],,[m4_include([m4/ax_boost.m4])])
m4_ifdef([ACX_MPI],,[m4_include([m4/acx_mpi.m4])])
m4_ifdef([AX_OPENMP],,[m4_include([m4/ax_openmp.m4])])
m4_ifdef([AX_CUDA],,[m4_include([m4/ax_cuda.m4])])
......@@ -53,7 +50,7 @@ if test x"$debuger" = x"yes"; then
CXXFLAGS="$CXXFLAGS -g3 -Wall -O0 "
NVCCFLAGS+="$NVCCFLAGS -g -O0 "
else
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 -flto -funroll-loops "
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 -funroll-loops "
NVCCFLAGS+="$NVCCFLAGS -O3 "
fi
......@@ -80,6 +77,10 @@ fi
INCLUDES_PATH+="-I. -Isrc/config/ -I../../metis_install/include -I../../OpenFPM_IO/src -I../../OpenFPM_data/src -I../../OpenFPM_devices/src -I../../OpenFPM_vcluster/src/"
##### CHECK FOR BOOST ##############
AX_BOOST([1.52],[],[])
####### Checking for GPU support
AX_CUDA
......@@ -116,10 +117,6 @@ AM_CONDITIONAL(BUILDCUDA, test ! x$NVCC = x"no")
AC_DEFINE([HAVE_MPI],[],[MPI Enabled])
#####
AX_CHECK_COMPILER_FLAGS([-Wno-unused-but-set-variable],[CXXFLAGS="$CXXFLAGS -Wno-unused-but-set-variable"],[])
AC_SUBST(NVCCFLAGS)
AC_SUBST(INCLUDES_PATH)
......
......@@ -956,6 +956,7 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
../../OpenFPM_data/src/Grid/comb.hpp \
../../OpenFPM_data/src/Grid/grid_key_expression.hpp \
../../OpenFPM_data/src/Space/Shape/Point.hpp \
../../OpenFPM_data/src/Grid/Encap.hpp \
../../OpenFPM_data/src/Grid/grid_key.hpp \
../../OpenFPM_data/src/Grid/Encap.hpp \
../../OpenFPM_data/src/memory_array.hpp \
......@@ -3059,6 +3060,8 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
../../OpenFPM_data/src/Space/Shape/Point.hpp:
../../OpenFPM_data/src/Grid/Encap.hpp:
../../OpenFPM_data/src/Grid/grid_key.hpp:
../../OpenFPM_data/src/Grid/Encap.hpp:
......
......@@ -921,6 +921,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_data/src/Grid/comb.hpp \
../../OpenFPM_data/src/Grid/grid_key_expression.hpp \
../../OpenFPM_data/src/Space/Shape/Point.hpp \
../../OpenFPM_data/src/Grid/Encap.hpp \
../../OpenFPM_data/src/Grid/grid_key.hpp \
../../OpenFPM_data/src/Grid/Encap.hpp \
../../OpenFPM_data/src/memory_array.hpp \
......@@ -1288,13 +1289,78 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_data/src/Space/SpaceBox.hpp \
../../OpenFPM_data/src/Space/Shape/Point.hpp \
../../OpenFPM_data/src/Space/Shape/Box.hpp \
../../OpenFPM_data/src/Grid/Encap.hpp Grid/grid_dist_id_iterator.hpp \
../../OpenFPM_data/src/Space/Ghost.hpp Grid/grid_dist_id_iterator.hpp \
Grid/grid_dist_key.hpp ../../OpenFPM_data/src/Point_test.hpp \
../../OpenFPM_data/src/base_type.hpp Decomposition/CartDecomposition.hpp \
Decomposition/Decomposition.hpp ../../OpenFPM_data/src/global_const.hpp \
SubdomainGraphNodes.hpp metis_util.hpp \
../../metis_install/include/metis.h /usr/include/inttypes.h \
../../OpenFPM_IO/src/VTKWriter.hpp dec_optimizer.hpp \
../../OpenFPM_IO/src/VTKWriter.hpp \
../../OpenFPM_IO/src/VTKWriter_graph.hpp \
../../OpenFPM_IO/src/VTKWriter_vector_box.hpp \
/usr/include/boost/math/special_functions/pow.hpp \
/usr/include/boost/math/policies/error_handling.hpp \
/usr/include/boost/math/tools/precision.hpp \
/usr/include/boost/format.hpp \
/usr/include/boost/format/detail/compat_workarounds.hpp \
/usr/include/boost/format/detail/config_macros.hpp \
/usr/include/boost/format/detail/workarounds_gcc-2_95.hpp \
/usr/include/boost/format/detail/workarounds_stlport.hpp \
/usr/include/boost/format/format_fwd.hpp \
/usr/include/boost/format/internals_fwd.hpp \
/usr/include/boost/format/internals.hpp \
/usr/include/boost/format/alt_sstream.hpp \
/usr/include/boost/format/alt_sstream_impl.hpp \
/usr/include/boost/format/format_class.hpp \
/usr/include/boost/format/exceptions.hpp \
/usr/include/boost/format/format_implementation.hpp \
/usr/include/boost/format/group.hpp \
/usr/include/boost/format/feed_args.hpp \
/usr/include/boost/format/detail/msvc_disambiguater.hpp \
/usr/include/boost/format/parsing.hpp \
/usr/include/boost/format/free_funcs.hpp \
/usr/include/boost/format/detail/unset_macros.hpp \
../../OpenFPM_IO/src/util.hpp \
/usr/include/boost/iostreams/device/mapped_file.hpp \
/usr/include/boost/iostreams/close.hpp \
/usr/include/boost/iostreams/categories.hpp \
/usr/include/boost/iostreams/flush.hpp \
/usr/include/boost/iostreams/detail/dispatch.hpp \
/usr/include/boost/iostreams/detail/select.hpp \
/usr/include/boost/iostreams/traits.hpp \
/usr/include/boost/iostreams/detail/bool_trait_def.hpp \
/usr/include/boost/iostreams/detail/template_params.hpp \
/usr/include/boost/preprocessor/control/expr_if.hpp \
/usr/include/boost/iostreams/detail/config/wide_streams.hpp \
/usr/include/boost/iostreams/detail/is_iterator_range.hpp \
/usr/include/boost/iostreams/detail/config/disable_warnings.hpp \
/usr/include/boost/iostreams/detail/config/enable_warnings.hpp \
/usr/include/boost/iostreams/detail/select_by_size.hpp \
/usr/include/boost/preprocessor/iteration/local.hpp \
/usr/include/boost/preprocessor/iteration/detail/local.hpp \
/usr/include/boost/iostreams/detail/wrap_unwrap.hpp \
/usr/include/boost/iostreams/detail/enable_if_stream.hpp \
/usr/include/boost/iostreams/traits_fwd.hpp \
/usr/include/boost/iostreams/detail/streambuf.hpp \
/usr/include/boost/iostreams/operations_fwd.hpp \
/usr/include/boost/iostreams/detail/adapter/non_blocking_adapter.hpp \
/usr/include/boost/iostreams/detail/ios.hpp \
/usr/include/boost/iostreams/read.hpp \
/usr/include/boost/iostreams/char_traits.hpp \
/usr/include/boost/iostreams/detail/char_traits.hpp \
/usr/include/boost/iostreams/seek.hpp \
/usr/include/boost/iostreams/positioning.hpp \
/usr/include/boost/iostreams/detail/config/codecvt.hpp \
/usr/include/boost/iostreams/detail/config/fpos.hpp \
/usr/include/boost/iostreams/write.hpp \
/usr/include/boost/iostreams/concepts.hpp \
/usr/include/boost/iostreams/detail/default_arg.hpp \
/usr/include/boost/iostreams/detail/config/auto_link.hpp \
/usr/include/boost/config/auto_link.hpp \
/usr/include/boost/iostreams/detail/config/dyn_link.hpp \
/usr/include/boost/iostreams/detail/path.hpp \
/usr/include/boost/config/abi_prefix.hpp \
/usr/include/boost/config/abi_suffix.hpp dec_optimizer.hpp \
../../OpenFPM_data/src/NN/CellList/CellDecomposer.hpp \
/usr/include/c++/4.8.3/unordered_map \
/usr/include/c++/4.8.3/bits/hashtable.h \
......@@ -1306,9 +1372,9 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_data/src/NN/CellList/CellNNIterator.hpp \
../../OpenFPM_data/src/NN/CellList/CellListBal.hpp \
../../OpenFPM_data/src/NN/CellList/CellListMem.hpp \
../../OpenFPM_data/src/util.hpp unit_test_init_cleanup.hpp \
Decomposition/ORB_unit_test.hpp Decomposition/ORB.hpp \
../../OpenFPM_data/src/data_type/scalar.hpp \
../../OpenFPM_data/src/Space/Ghost.hpp ../../OpenFPM_IO/src/util.hpp \
unit_test_init_cleanup.hpp Decomposition/ORB_unit_test.hpp \
Decomposition/ORB.hpp ../../OpenFPM_data/src/data_type/scalar.hpp \
Graph/CartesianGraphFactory_unit_test.hpp \
Graph/CartesianGraphFactory.hpp metis_util_unit_test.hpp metis_util.hpp \
dec_optimizer_unit_test.hpp dec_optimizer.hpp \
......@@ -3344,6 +3410,8 @@ Graph/CartesianGraphFactory.hpp:
../../OpenFPM_data/src/Space/Shape/Point.hpp:
../../OpenFPM_data/src/Grid/Encap.hpp:
../../OpenFPM_data/src/Grid/grid_key.hpp:
../../OpenFPM_data/src/Grid/Encap.hpp:
......@@ -4164,7 +4232,7 @@ Grid/grid_dist_id.hpp:
../../OpenFPM_data/src/Space/Shape/Box.hpp:
../../OpenFPM_data/src/Grid/Encap.hpp:
../../OpenFPM_data/src/Space/Ghost.hpp:
Grid/grid_dist_id_iterator.hpp:
......@@ -4190,6 +4258,136 @@ metis_util.hpp:
../../OpenFPM_IO/src/VTKWriter.hpp:
../../OpenFPM_IO/src/VTKWriter_graph.hpp:
../../OpenFPM_IO/src/VTKWriter_vector_box.hpp:
/usr/include/boost/math/special_functions/pow.hpp:
/usr/include/boost/math/policies/error_handling.hpp:
/usr/include/boost/math/tools/precision.hpp:
/usr/include/boost/format.hpp:
/usr/include/boost/format/detail/compat_workarounds.hpp:
/usr/include/boost/format/detail/config_macros.hpp:
/usr/include/boost/format/detail/workarounds_gcc-2_95.hpp:
/usr/include/boost/format/detail/workarounds_stlport.hpp:
/usr/include/boost/format/format_fwd.hpp:
/usr/include/boost/format/internals_fwd.hpp:
/usr/include/boost/format/internals.hpp:
/usr/include/boost/format/alt_sstream.hpp:
/usr/include/boost/format/alt_sstream_impl.hpp:
/usr/include/boost/format/format_class.hpp:
/usr/include/boost/format/exceptions.hpp:
/usr/include/boost/format/format_implementation.hpp:
/usr/include/boost/format/group.hpp:
/usr/include/boost/format/feed_args.hpp:
/usr/include/boost/format/detail/msvc_disambiguater.hpp:
/usr/include/boost/format/parsing.hpp:
/usr/include/boost/format/free_funcs.hpp:
/usr/include/boost/format/detail/unset_macros.hpp:
../../OpenFPM_IO/src/util.hpp:
/usr/include/boost/iostreams/device/mapped_file.hpp:
/usr/include/boost/iostreams/close.hpp:
/usr/include/boost/iostreams/categories.hpp:
/usr/include/boost/iostreams/flush.hpp:
/usr/include/boost/iostreams/detail/dispatch.hpp:
/usr/include/boost/iostreams/detail/select.hpp:
/usr/include/boost/iostreams/traits.hpp:
/usr/include/boost/iostreams/detail/bool_trait_def.hpp:
/usr/include/boost/iostreams/detail/template_params.hpp:
/usr/include/boost/preprocessor/control/expr_if.hpp:
/usr/include/boost/iostreams/detail/config/wide_streams.hpp:
/usr/include/boost/iostreams/detail/is_iterator_range.hpp:
/usr/include/boost/iostreams/detail/config/disable_warnings.hpp:
/usr/include/boost/iostreams/detail/config/enable_warnings.hpp:
/usr/include/boost/iostreams/detail/select_by_size.hpp:
/usr/include/boost/preprocessor/iteration/local.hpp:
/usr/include/boost/preprocessor/iteration/detail/local.hpp:
/usr/include/boost/iostreams/detail/wrap_unwrap.hpp:
/usr/include/boost/iostreams/detail/enable_if_stream.hpp:
/usr/include/boost/iostreams/traits_fwd.hpp:
/usr/include/boost/iostreams/detail/streambuf.hpp:
/usr/include/boost/iostreams/operations_fwd.hpp:
/usr/include/boost/iostreams/detail/adapter/non_blocking_adapter.hpp:
/usr/include/boost/iostreams/detail/ios.hpp:
/usr/include/boost/iostreams/read.hpp:
/usr/include/boost/iostreams/char_traits.hpp:
/usr/include/boost/iostreams/detail/char_traits.hpp:
/usr/include/boost/iostreams/seek.hpp:
/usr/include/boost/iostreams/positioning.hpp:
/usr/include/boost/iostreams/detail/config/codecvt.hpp:
/usr/include/boost/iostreams/detail/config/fpos.hpp:
/usr/include/boost/iostreams/write.hpp:
/usr/include/boost/iostreams/concepts.hpp:
/usr/include/boost/iostreams/detail/default_arg.hpp:
/usr/include/boost/iostreams/detail/config/auto_link.hpp:
/usr/include/boost/config/auto_link.hpp:
/usr/include/boost/iostreams/detail/config/dyn_link.hpp:
/usr/include/boost/iostreams/detail/path.hpp:
/usr/include/boost/config/abi_prefix.hpp:
/usr/include/boost/config/abi_suffix.hpp:
dec_optimizer.hpp:
../../OpenFPM_data/src/NN/CellList/CellDecomposer.hpp:
......@@ -4214,7 +4412,9 @@ dec_optimizer.hpp:
../../OpenFPM_data/src/NN/CellList/CellListMem.hpp:
../../OpenFPM_data/src/util.hpp:
../../OpenFPM_data/src/Space/Ghost.hpp:
../../OpenFPM_IO/src/util.hpp:
unit_test_init_cleanup.hpp:
......
This diff is collapsed.
......@@ -33,6 +33,13 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_test_use)
// Decompose
dec.setParameters(div,box);
Ghost<3,float> g(0.01);
// create a ghost border
dec.calculateGhostBoxes(g);
//
}
BOOST_AUTO_TEST_SUITE_END()
......
......@@ -353,14 +353,15 @@ public:
*
* Each vertex is a subspace (Hyper-cube) of dimension dim, each vertex is
* connected with an edge if two vertex (Hyper-cube) share a element of dimension grater than
* dim_c
* dim_c. One property can be used to store the contact size or the d-dimensional
* surface in common between two connected hyper-cube.
*
* \param sz Vector that store the size of the grid on each dimension
* \param dom Box enclosing the physical domain
*
* \tparam se Indicate which properties fill with the element weight. The
* element weight is the point, line , surface, d dimensional object
* in contact (in common between two hyper-cube). NO_EDGE indicate
* \tparam se Indicate which properties fill with the contact size. The
* contact size is the point, line , surface, d-dimensional object size
* in contact (in common) between two hyper-cube. NO_EDGE indicate
* no property will store this information
* \tparam T type of the domain like (int real complex ... )
* \tparam dim_c Connectivity dimension
......
......@@ -54,7 +54,7 @@ class grid_dist_id
/*! \brief Get the grid size
*
* Get the grid size, given a domain, the resolution on it and another spaceBox
* Given a domain, the resolution of the grid on it and another spaceBox contained in the domain
* it give the size on all directions of the local grid
*
* \param sp SpaceBox enclosing the local grid
......@@ -92,7 +92,7 @@ class grid_dist_id
for (size_t d = 0 ; d < dim ; d++)
{
// push the size of the local grid
v_size[d] = sp.getHigh(d) - sp.getLow(d) + 1;
v_size[d] = sp.getHigh(d) - sp.getLow(d);
}
}
......@@ -175,11 +175,9 @@ public:
dec.hyperCube();
// Get the number of local grid needed
size_t n_grid = dec.getNLocalHyperCube();
// create local grids for each hyper-cube
loc_grid = v_cl.allocate<device_grid>(n_grid);
// Size of the grid on each dimension
......@@ -322,7 +320,7 @@ class grid_dist_id<1,T,Decomposition,Memory,device_grid>
for (size_t d = 0 ; d < 1 ; d++)
{
// push the size of the local grid
v_size[d] = sp.getHigh(d) - sp.getLow(d) + 1;
v_size[d] = sp.getHigh(d) - sp.getLow(d);
}
}
......
......@@ -58,6 +58,16 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
++dom;
}
// Get the virtual cluster machine
Vcluster & vcl = g_dist.getVC();
// reduce
vcl.reduce(count);
vcl.execute();
// Check
BOOST_REQUIRE_EQUAL(count,1024*1024);
size_t count_check = 0;
dom = g_dist.getDomainIterator();
......@@ -71,16 +81,6 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
++dom;
}
// Get the virtual cluster machine
Vcluster & vcl = g_dist.getVC();
// reduce
vcl.reduce(count);
vcl.execute();
// Check
BOOST_REQUIRE_EQUAL(count,1024*1024);
/* auto g_it = g_dist.getIteratorBulk();
auto g_it_halo = g_dist.getHalo();
......
......@@ -84,13 +84,10 @@ subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compiler_flags.m4 \
$(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/ax_opencl.m4 \
$(top_srcdir)/m4/ax_boost_base.m4 \
$(top_srcdir)/m4/ax_boost_program_options.m4 \
$(top_srcdir)/m4/ax_boost_thread.m4 \
$(top_srcdir)/m4/acx_mpi.m4 $(top_srcdir)/m4/ax_openmp.m4 \
$(top_srcdir)/m4/ax_cuda.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/ax_boost.m4 $(top_srcdir)/m4/acx_mpi.m4 \
$(top_srcdir)/m4/ax_openmp.m4 $(top_srcdir)/m4/ax_cuda.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -104,7 +101,8 @@ am_pdata_OBJECTS = pdata-main.$(OBJEXT) pdata-HeapMemory.$(OBJEXT) \
pdata-Memleak_check.$(OBJEXT)
pdata_OBJECTS = $(am_pdata_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
pdata_DEPENDENCIES = $(am__DEPENDENCIES_2)
pdata_LINK = $(CXXLD) $(pdata_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
......@@ -175,6 +173,18 @@ AUTOCONF = ${SHELL} /home/i-bird/Desktop/MOSAIC/OpenFPM_project/OpenFPM_pdata/mi
AUTOHEADER = ${SHELL} /home/i-bird/Desktop/MOSAIC/OpenFPM_project/OpenFPM_pdata/missing autoheader
AUTOMAKE = ${SHELL} /home/i-bird/Desktop/MOSAIC/OpenFPM_project/OpenFPM_pdata/missing automake-1.13
AWK = gawk
BOOST_CPPFLAGS = -pthread -I/usr/include
BOOST_DATE_TIME_LIB = -lboost_date_time
BOOST_FILESYSTEM_LIB = -lboost_filesystem
BOOST_IOSTREAMS_LIB = -lboost_iostreams
BOOST_LDFLAGS = -L/usr/lib
BOOST_PROGRAM_OPTIONS_LIB = -lboost_program_options
BOOST_REGEX_LIB = -lboost_regex
BOOST_SERIALIZATION_LIB = -lboost_serialization
BOOST_SIGNALS_LIB = -lboost_signals
BOOST_THREAD_LIB = -lboost_thread
BOOST_UNIT_TEST_FRAMEWORK_LIB = -lboost_unit_test_framework
BOOST_WSERIALIZATION_LIB = -lboost_wserialization
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
......@@ -183,7 +193,7 @@ CUDA_CFLAGS = -I -I -I/usr/local/cuda-5.5/include
CUDA_LIBS = -L -L -L/usr/local/cuda-5.5/lib64 -lcuda -lcudart
CXX = mpic++
CXXDEPMODE = depmode=gcc3
CXXFLAGS = --std=c++11 -march=native -mtune=native -Wall -O3 -g3 -flto -funroll-loops -Wno-unused-but-set-variable
CXXFLAGS = --std=c++11 -march=native -mtune=native -g3 -Wall -O0
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
......@@ -204,7 +214,7 @@ LTLIBOBJS =
MAKEINFO = ${SHELL} /home/i-bird/Desktop/MOSAIC/OpenFPM_project/OpenFPM_pdata/missing makeinfo
MKDIR_P = /usr/bin/mkdir -p
NVCC = /usr/local/cuda-5.5/bin/nvcc
NVCCFLAGS = -O3
NVCCFLAGS = -g -O0
NVCC_EXIST = yes
OBJEXT = o
PACKAGE = full-package-name
......@@ -274,7 +284,7 @@ target_vendor = unknown
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB)
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS)
pdata_SOURCES = main.cpp ../../OpenFPM_devices/src/memory/HeapMemory.cpp ../../OpenFPM_devices/src/memory/PtrMemory.cpp ../../OpenFPM_vcluster/src/VCluster.cpp ../../OpenFPM_data/src/Memleak_check.cpp
pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH)
pdata_CFLAGS = $(CUDA_CFLAGS)
......
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB)
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS)
bin_PROGRAMS = pdata
pdata_SOURCES = main.cpp ../../OpenFPM_devices/src/memory/HeapMemory.cpp ../../OpenFPM_devices/src/memory/PtrMemory.cpp ../../OpenFPM_vcluster/src/VCluster.cpp ../../OpenFPM_data/src/Memleak_check.cpp
......
......@@ -84,13 +84,10 @@ subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compiler_flags.m4 \
$(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/ax_opencl.m4 \
$(top_srcdir)/m4/ax_boost_base.m4 \
$(top_srcdir)/m4/ax_boost_program_options.m4 \
$(top_srcdir)/m4/ax_boost_thread.m4 \
$(top_srcdir)/m4/acx_mpi.m4 $(top_srcdir)/m4/ax_openmp.m4 \
$(top_srcdir)/m4/ax_cuda.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/ax_boost.m4 $(top_srcdir)/m4/acx_mpi.m4 \
$(top_srcdir)/m4/ax_openmp.m4 $(top_srcdir)/m4/ax_cuda.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
......@@ -104,7 +101,8 @@ am_pdata_OBJECTS = pdata-main.$(OBJEXT) pdata-HeapMemory.$(OBJEXT) \
pdata-Memleak_check.$(OBJEXT)
pdata_OBJECTS = $(am_pdata_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
pdata_DEPENDENCIES = $(am__DEPENDENCIES_2)
pdata_LINK = $(CXXLD) $(pdata_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
......@@ -175,6 +173,18 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
BOOST_DATE_TIME_LIB = @BOOST_DATE_TIME_LIB@
BOOST_FILESYSTEM_LIB = @BOOST_FILESYSTEM_LIB@
BOOST_IOSTREAMS_LIB = @BOOST_IOSTREAMS_LIB@
BOOST_LDFLAGS = @BOOST_LDFLAGS@
BOOST_PROGRAM_OPTIONS_LIB = @BOOST_PROGRAM_OPTIONS_LIB@
BOOST_REGEX_LIB = @BOOST_REGEX_LIB@
BOOST_SERIALIZATION_LIB = @BOOST_SERIALIZATION_LIB@
BOOST_SIGNALS_LIB = @BOOST_SIGNALS_LIB@
BOOST_THREAD_LIB = @BOOST_THREAD_LIB@
BOOST_UNIT_TEST_FRAMEWORK_LIB = @BOOST_UNIT_TEST_FRAMEWORK_LIB@
BOOST_WSERIALIZATION_LIB = @BOOST_WSERIALIZATION_LIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......@@ -274,7 +284,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB)
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS)
pdata_SOURCES = main.cpp ../../OpenFPM_devices/src/memory/HeapMemory.cpp ../../OpenFPM_devices/src/memory/PtrMemory.cpp ../../OpenFPM_vcluster/src/VCluster.cpp ../../OpenFPM_data/src/Memleak_check.cpp
pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH)
pdata_CFLAGS = $(CUDA_CFLAGS)
......
......@@ -17,6 +17,8 @@
#include "memory/PtrMemory.hpp"
#include "NN/CellList/CellList.hpp"
#include "common.hpp"
#include "util/vector_creator.hpp"
#include "memory/ExtPreAlloc.hpp"
#define NO_ID false
#define ID true
......@@ -24,6 +26,25 @@
#define GET 1
#define PUT 2
#define INTERNAL 0
#define NO_POSITION 1
/*! \brief This is a container for the sending buffers
*
* It is used in ghost_get to create a particular object with the properties selected
*
* \tparam Is a boost::fusion::vector with the properties selected
*
*
*/
template<typename v>
class buff_com
{
typedef v type;
const int max_prop = boost::fusion::result_of::size<v>::value;
};
/*! \brief Distributed vector
*
*/
......@@ -91,19 +112,16 @@ public:
// Create the sub-domains
dec.setParameters(div,box);
// Get the bounding box containing the processor domain +- one sub-domain spacing
::Box<point::dims,typename point::coord_type> & bbound = dec.getProcessorBounds();
// Get the bounding box containing the processor domain
const ::Box<point::dims,typename point::coord_type> & bbound = dec.getProcessorBounds();
// the smallest sub-division of the domain on each dimension
typename point::coord_type smallest_doms[point::dims];
const ::Box<point::dims,typename point::coord_type> & smallest_unit = dec.getSmallestSubdivision();
// convert spacing divisions
size_t n_g[point::dims];
for (size_t i = 0 ; i < point::dims ; i++)
{
n_g[i] = box.template getBase<b::p2>(i) / smallest_doms[i];
}
n_g[i] = (bbound.getHigh(i) - bbound.getLow(i)) / smallest_unit.getHigh(i);
point p;
p.zero();
......@@ -112,6 +130,16 @@ public:
geo_cell.Initialize(box,n_g,p,8);
}
/*! \brief return the local size of the vector
*
* \return local size
*
*/
size_t size_local()
{
v_pos.get(0).size();
}
/*! \brief Get position of an object
*
* \param vec_key vector element
......@@ -144,6 +172,16 @@ public:
openfpm::vector<prop,openfpm::device_cpu<prop>,PreAllocHeapMemory<2>,openfpm::grow_policy_identity> prp;
};
/*! \brief set the ghost
*
* \param g ghost
*
*/
void setGhost(Ghost<point::dims,typename point::coord_type> & g)
{
dec.calculateGhostBoxes(g);
}
/*! \brief It communicate the particle to the respective processor
*
*/
......@@ -256,12 +294,10 @@ public:
prc_cnt.get(lbl)++;
// Add processors and add size
++it;
}
// Create the set of pointers
openfpm::vector<void *> ptr(prc_r.size());
for (size_t i = 0 ; i < prc_r.size() ; i++)
{
......@@ -269,8 +305,7 @@ public:
}
// convert the particle number to buffer size
for (size_t i = 0 ; i < v_cl.getProcessingUnits() ; i++)
for (size_t i = 0 ; i < prc_sz_r.size() ; i++)
{
prc_sz_r.get(i) = prc_sz_r.get(i)*(sizeof(prop) + sizeof(point));
}
......@@ -328,72 +363,133 @@ public:
v_prp.get(0).remove(opart,o_p_id);
}
// ghost particles sending buffer
openfpm::vector<HeapMemory> ghost_send_hp;
// outgoing particles-id
openfpm::vector<openfpm::vector<size_t>> opart;
// Each entry contain the size of the ghost sending buffer
std::unordered_map<size_t,size_t> ghost_prc_sz;
openfpm::vector<size_t> ghost_prc_sz;
// ghost particle labels
openfpm::vector<size_t> ghost_lbl_p;
// Memory for the ghost sending buffer
Memory g_prp_mem;
// Memory for the ghost
Memory g_pos_mem;
/*! \brief It synchronize getting the ghost particles
*
* \prp Properties to get
* \opt options
* NO_RELABEL: If the particles does not move avoid to relabel
* NO_RELABEL: If the particles does not move avoid to relabel and send particle position
*
*/
template<unsigned int N> void ghost_get(const size_t prp[N], size_t opt)
template<int... prp> void ghost_get(size_t opt = NONE)
{
// outgoing particles-id
openfpm::vector<size_t> opart;
// Create the ghost buffer
ghost_prc_sz.clear();
ghost_lbl_p.clear();
ghost_lbl_p.resize(v_pos.get(INTERNAL).size());
// Label the internal (assigned) particles
auto it = v_pos.get(0).getIterator();
auto it = v_pos.get(INTERNAL).getIterator();
// Label all the particles with the processor id, where they should go
while (it.isNext())
{
auto key = it.get();
size_t p_id = dec.ghost_processorID(v_pos.get(0).get(key));
size_t p_id = dec.ghost_processorID(v_pos.get(INTERNAL).get(key));
ghost_lbl_p.get(key) = p_id;
// It has to communicate
if (p_id != v_cl.getProcessUnitID())
{
size_t id = dec.ProcToID(p_id);
// add particle to communicate
ghost_prc_sz[p_id]++;
ghost_prc_sz.get(id)++;
opart.add(key);
opart.get(id).add(key);
}
++it;
}
// Create memory allocator for the send buffers
size_t i = 0;
ghost_send_hp.resize(ghost_prc_sz.size());
// Total number of elements
size_t n_ele = 0;