Commit 699c8959 authored by incardon's avatar incardon

Restructuring configure.ac

parent f382ac89
......@@ -8,8 +8,6 @@ AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([src/config/config.h])
m4_ifdef([MYSQL_FOUND],,[m4_include([m4/ax_lib_mysql.m4])])
m4_ifdef([AX_CHECK_COMPILER_FLAGS],,[m4_include([m4/ax_check_compiler_flags.m4])])
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])])
......@@ -17,11 +15,9 @@ 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([ACX_MPI],,[m4_include([m4/acx_mpi.m4])])
m4_ifdef([AX_OPENMP],,[m4_include([m4/ax_openmp.m4])])
m4_ifdef([AX_GCC_X86_CPUID],,[m4_include([m4/ax_gcc_x86_cpuid.m4])])
m4_ifdef([AX_GCC_ARCHFLAG],,[m4_include([m4/ax_gcc_archflag.m4])])
m4_ifdef([AX_CUDA],,[m4_include([m4/ax_cuda.m4])])
CXXFLAGS+=" --std=c++11 "
CXXFLAGS+=" --std=c++11 -march=native -mtune=native "
NVCCFLAGS=" "
INCLUDES_PATH=" "
......@@ -34,7 +30,7 @@ AC_CANONICAL_HOST
# Check target architetture
AX_GCC_ARCHFLAG([], [CXXFLAGS="$CXXFLAGS $ax_cv_gcc_archflag"], [])
#AX_GCC_ARCHFLAG([], [CXXFLAGS="$CXXFLAGS $ax_cv_gcc_archflag"], [])
###### Check for debug compilation
......@@ -57,14 +53,13 @@ if test x"$debuger" = x"yes"; then
CXXFLAGS="$CXXFLAGS -g3 -Wall -O0 "
NVCCFLAGS+="$NVCCFLAGS -g -O0 "
else
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 "
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 -flto -funroll-loops "
NVCCFLAGS+="$NVCCFLAGS -O3 "
fi
## Check for memcheck
AC_MSG_CHECKING(whether to build with memcheck capabilities)
debuger=no
AC_ARG_ENABLE(memcheck,
AC_HELP_STRING(
[--enable-memcheck],
......@@ -89,21 +84,25 @@ INCLUDES_PATH+="-I. -Isrc/config/ -I../../metis_install/include -I../../OpenFPM_
AX_CUDA
AC_MSG_CHECKING(whether to build with GPU support)
gpu_support=no
AC_ARG_ENABLE(gpu,
## detect for NVCC
if test x"$NVCC_EXIST" = x"yes"; then
AC_MSG_CHECKING(whether to build with GPU support)
gpu_support=yes
AC_ARG_ENABLE(gpu,
AC_HELP_STRING(
[--enable-gpu],
[enable gpu support]
),
gpu_support="$enableval"
)
)
AC_MSG_RESULT($gpu_support)
if test x"$gpu_support" = x"yes"; then
AC_MSG_RESULT($gpu_support)
if test x"$gpu_support" = x"yes"; then
AC_DEFINE([GPU],[],[GPU support])
fi
else
gpu_support=no
fi
......@@ -119,20 +118,6 @@ AC_DEFINE([HAVE_MPI],[],[MPI Enabled])
#####
no_avx=no
no_sse42=no
no_sse41=no
no_sse3=no
no_sse2=no
no_sse=no
no_mmx=no
AX_CHECK_COMPILER_FLAGS([-msse4.2],[CXXFLAGS="$CXXFLAGS -mavx"],[no_avx=yes])
AX_CHECK_COMPILER_FLAGS([-msse4.2],[CXXFLAGS="$CXXFLAGS -msse4.2"],[no_sse42=yes])
AX_CHECK_COMPILER_FLAGS([-msse4.1],[CXXFLAGS="$CXXFLAGS -msse4.1"],[no_sse41=yes])
AX_CHECK_COMPILER_FLAGS([-msse3],[CXXFLAGS="$CXXFLAGS -msse3"],[no_sse3=yes])
AX_CHECK_COMPILER_FLAGS([-msse2],[CXXFLAGS="$CXXFLAGS -msse2"],[no_sse2=yes])
AX_CHECK_COMPILER_FLAGS([-msse],[CXXFLAGS="$CXXFLAGS -msse"],[no_sse=yes])
AX_CHECK_COMPILER_FLAGS([-mmmx],[CXXFLAGS="$CXXFLAGS -mmmx"],[no_mmx=yes])
AX_CHECK_COMPILER_FLAGS([-Wno-unused-but-set-variable],[CXXFLAGS="$CXXFLAGS -Wno-unused-but-set-variable"],[])
AC_SUBST(NVCCFLAGS)
......@@ -147,59 +132,21 @@ AC_OUTPUT
echo ""
echo "***********************************"
echo "* *"
arch_str="${ax_cv_gcc_archflag#-march=#-mtune=}"
arch_str="${arch_str#-mtune=}"
n_arch_str=${#arch_str}
for (( X=0; X<23-n_arch_str; X++ ))
do
arch_str="$arch_str "
done
echo "* arch: $arch_str*"
if [ test x"$no_sse42" = x"no" ]; then
echo "* sse4.2: yes *"
else
echo "* sse4.2: no *"
fi
if [ test x"$no_sse41" = x"no" ]; then
echo "* sse4.1: yes *"
else
echo "* sse4.1: no *"
fi
if [ test x"$no_sse3" = x"no" ]; then
echo "* sse3: yes *"
else
echo "* sse3: no *"
fi
if [ test x"$no_sse2" = x"no" ]; then
echo "* sse2: yes *"
else
echo "* sse2: no *"
fi
if [ test x"$no_sse" = x"no" ]; then
echo "* sse: yes *"
else
echo "* sse: no *"
fi
if [ test x"$no_mmx" = x"no" ]; then
echo "* mmx: yes *"
else
echo "* mmx: no *"
fi
if [ test x"$profiler" = x"yes" ]; then
echo "* profiler: yes *"
else
echo "* profiler: no *"
fi
if [ test x"$memcheck" = x"yes" ]; then
echo "* memcheck: yes *"
else
echo "* memcheck: no *"
fi
if [ test x"$debuger" = x"yes" ]; then
echo "* debug: yes *"
else
echo "* debug: no *"
fi
if [ test x"$no_64" = x"no" ]; then
echo "* 64 bit: yes *"
else
echo "* 64 bit: no *"
fi
if [ test x"$gpu_support" = x"no" ]; then
echo "* gpu: no *"
else
......
pdata-HeapMemory.o: ../../OpenFPM_devices/src/memory/HeapMemory.cpp \
/usr/include/stdc-predef.h \
../../OpenFPM_devices/src/memory/HeapMemory.hpp config.h \
../../OpenFPM_devices/src/memory/HeapMemory.hpp ../src/config/config.h \
../../OpenFPM_data/src/memory.hpp \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/stddef.h \
/usr/include/c++/4.8.3/cstddef \
......@@ -72,10 +72,9 @@ pdata-HeapMemory.o: ../../OpenFPM_devices/src/memory/HeapMemory.cpp \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.8.3/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.8.3/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/c++/4.8.3/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -96,21 +95,13 @@ pdata-HeapMemory.o: ../../OpenFPM_devices/src/memory/HeapMemory.cpp \
/usr/include/c++/4.8.3/bits/basic_ios.tcc \
/usr/include/c++/4.8.3/bits/ostream.tcc /usr/include/c++/4.8.3/istream \
/usr/include/c++/4.8.3/bits/istream.tcc /usr/include/c++/4.8.3/cstring \
/usr/include/string.h ../../OpenFPM_data/src/Memleak_check.hpp \
/usr/include/c++/4.8.3/map /usr/include/c++/4.8.3/bits/stl_tree.h \
/usr/include/c++/4.8.3/bits/alloc_traits.h \
/usr/include/c++/4.8.3/bits/ptr_traits.h \
/usr/include/c++/4.8.3/bits/stl_map.h /usr/include/c++/4.8.3/tuple \
/usr/include/c++/4.8.3/utility /usr/include/c++/4.8.3/bits/stl_relops.h \
/usr/include/c++/4.8.3/array /usr/include/c++/4.8.3/stdexcept \
/usr/include/c++/4.8.3/bits/uses_allocator.h \
/usr/include/c++/4.8.3/bits/stl_multimap.h
/usr/include/string.h
/usr/include/stdc-predef.h:
../../OpenFPM_devices/src/memory/HeapMemory.hpp:
config.h:
../src/config/config.h:
../../OpenFPM_data/src/memory.hpp:
......@@ -304,8 +295,6 @@ config.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.8.3/cstdio:
......@@ -318,8 +307,6 @@ config.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.8.3/cerrno:
/usr/include/errno.h:
......@@ -373,29 +360,3 @@ config.h:
/usr/include/c++/4.8.3/cstring:
/usr/include/string.h:
../../OpenFPM_data/src/Memleak_check.hpp:
/usr/include/c++/4.8.3/map:
/usr/include/c++/4.8.3/bits/stl_tree.h:
/usr/include/c++/4.8.3/bits/alloc_traits.h:
/usr/include/c++/4.8.3/bits/ptr_traits.h:
/usr/include/c++/4.8.3/bits/stl_map.h:
/usr/include/c++/4.8.3/tuple:
/usr/include/c++/4.8.3/utility:
/usr/include/c++/4.8.3/bits/stl_relops.h:
/usr/include/c++/4.8.3/array:
/usr/include/c++/4.8.3/stdexcept:
/usr/include/c++/4.8.3/bits/uses_allocator.h:
/usr/include/c++/4.8.3/bits/stl_multimap.h:
pdata-Memleak_check.o: ../../OpenFPM_data/src/Memleak_check.cpp \
/usr/include/stdc-predef.h config.h \
/usr/include/stdc-predef.h ../src/config/config.h \
../../OpenFPM_data/src/Memleak_check.hpp /usr/include/c++/4.8.3/iostream \
/usr/include/c++/4.8.3/x86_64-redhat-linux/bits/c++config.h \
/usr/include/bits/wordsize.h \
......@@ -69,10 +69,9 @@ pdata-Memleak_check.o: ../../OpenFPM_data/src/Memleak_check.cpp \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.8.3/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.8.3/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/c++/4.8.3/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -104,7 +103,7 @@ pdata-Memleak_check.o: ../../OpenFPM_data/src/Memleak_check.cpp \
/usr/include/stdc-predef.h:
config.h:
../src/config/config.h:
../../OpenFPM_data/src/Memleak_check.hpp:
......@@ -296,8 +295,6 @@ config.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.8.3/cstdio:
......@@ -310,8 +307,6 @@ config.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.8.3/cerrno:
/usr/include/errno.h:
......
......@@ -75,10 +75,9 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.8.3/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.8.3/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/c++/4.8.3/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -146,7 +145,7 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/c++/4.8.3/bits/vector.tcc \
../../OpenFPM_vcluster/src/VObject.hpp \
../../OpenFPM_data/src/Vector/map_vector.hpp \
../../OpenFPM_data/src/Grid/map_grid.hpp config.h \
../../OpenFPM_data/src/Grid/map_grid.hpp ../src/config/config.h \
/usr/include/boost/fusion/include/mpl.hpp \
/usr/include/boost/fusion/adapted/mpl.hpp \
/usr/include/boost/fusion/adapted/mpl/detail/begin_impl.hpp \
......@@ -789,8 +788,7 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/bits/mathinline.h /usr/include/c++/4.8.3/sstream \
/usr/include/c++/4.8.3/bits/sstream.tcc \
/usr/include/c++/4.8.3/sstream /usr/include/c++/4.8.3/bits/sstream.tcc \
/usr/include/boost/type_traits/is_compound.hpp \
/usr/include/boost/type_traits/is_floating_point.hpp \
/usr/include/boost/type_traits/is_member_object_pointer.hpp \
......@@ -839,10 +837,12 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/tmmintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/smmintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/popcntintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/wmmintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/immintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/avxintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/fxsrintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveoptintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/adxintrin.h \
/usr/include/c++/4.8.3/bits/random.tcc /usr/include/c++/4.8.3/numeric \
/usr/include/c++/4.8.3/bits/stl_numeric.h \
......@@ -1173,8 +1173,6 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.8.3/cstdio:
......@@ -1187,8 +1185,6 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.8.3/cerrno:
/usr/include/errno.h:
......@@ -1339,7 +1335,7 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
../../OpenFPM_data/src/Grid/map_grid.hpp:
config.h:
../src/config/config.h:
/usr/include/boost/fusion/include/mpl.hpp:
......@@ -2695,8 +2691,6 @@ config.h:
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/c++/4.8.3/sstream:
/usr/include/c++/4.8.3/bits/sstream.tcc:
......@@ -2805,6 +2799,8 @@ config.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/popcntintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/wmmintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/immintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/avxintrin.h:
......@@ -2813,6 +2809,8 @@ config.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveoptintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/adxintrin.h:
/usr/include/c++/4.8.3/bits/random.tcc:
......
......@@ -68,10 +68,9 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.8.3/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.8.3/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/c++/4.8.3/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -91,10 +90,10 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/c++/4.8.3/bits/locale_facets.tcc \
/usr/include/c++/4.8.3/bits/basic_ios.tcc \
/usr/include/c++/4.8.3/bits/ostream.tcc /usr/include/c++/4.8.3/istream \
/usr/include/c++/4.8.3/bits/istream.tcc config.h \
/usr/include/c++/4.8.3/bits/istream.tcc ../src/config/config.h \
Graph/CartesianGraphFactory.hpp \
../../OpenFPM_data/src/Vector/map_vector.hpp \
../../OpenFPM_data/src/Grid/map_grid.hpp config.h \
../../OpenFPM_data/src/Grid/map_grid.hpp \
/usr/include/boost/fusion/include/mpl.hpp \
/usr/include/boost/fusion/adapted/mpl.hpp \
/usr/include/boost/fusion/adapted/mpl/detail/begin_impl.hpp \
......@@ -738,8 +737,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/bits/mathinline.h /usr/include/c++/4.8.3/sstream \
/usr/include/c++/4.8.3/bits/sstream.tcc \
/usr/include/c++/4.8.3/sstream /usr/include/c++/4.8.3/bits/sstream.tcc \
/usr/include/boost/type_traits/is_compound.hpp \
/usr/include/boost/type_traits/is_floating_point.hpp \
/usr/include/boost/type_traits/is_member_object_pointer.hpp \
......@@ -797,10 +795,12 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/tmmintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/smmintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/popcntintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/wmmintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/immintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/avxintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/fxsrintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveoptintrin.h \
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/adxintrin.h \
/usr/include/c++/4.8.3/bits/random.tcc /usr/include/c++/4.8.3/numeric \
/usr/include/c++/4.8.3/bits/stl_numeric.h \
......@@ -1083,7 +1083,6 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/boost/math/tools/user.hpp \
/usr/include/boost/detail/fenv.hpp /usr/include/c++/4.8.3/fenv.h \
/usr/include/fenv.h /usr/include/bits/fenv.h \
/usr/include/bits/fenvinline.h \
/usr/include/boost/math/special_functions/math_fwd.hpp \
/usr/include/boost/math/special_functions/detail/round_fwd.hpp \
/usr/include/boost/math/tools/promotion.hpp \
......@@ -1297,6 +1296,16 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../metis_install/include/metis.h /usr/include/inttypes.h \
../../OpenFPM_IO/src/VTKWriter.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 \
/usr/include/c++/4.8.3/bits/hashtable_policy.h \
/usr/include/c++/4.8.3/bits/unordered_map.h \
../../OpenFPM_data/src/NN/CellList/CellList.hpp \
../../OpenFPM_data/src/NN/CellList/CellListFast.hpp \
../../OpenFPM_data/src/NN/CellList/CellDecomposer.hpp \
../../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 \
......@@ -1503,8 +1512,6 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.8.3/cstdio:
......@@ -1517,8 +1524,6 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.8.3/cerrno:
/usr/include/errno.h:
......@@ -1569,7 +1574,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/c++/4.8.3/bits/istream.tcc:
config.h:
../src/config/config.h:
Graph/CartesianGraphFactory.hpp:
......@@ -1577,8 +1582,6 @@ Graph/CartesianGraphFactory.hpp:
../../OpenFPM_data/src/Grid/map_grid.hpp:
config.h:
/usr/include/boost/fusion/include/mpl.hpp:
/usr/include/boost/fusion/adapted/mpl.hpp:
......@@ -2937,8 +2940,6 @@ config.h:
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/c++/4.8.3/sstream:
/usr/include/c++/4.8.3/bits/sstream.tcc:
......@@ -3065,6 +3066,8 @@ config.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/popcntintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/wmmintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/immintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/avxintrin.h:
......@@ -3073,6 +3076,8 @@ config.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xsaveoptintrin.h:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/adxintrin.h:
/usr/include/c++/4.8.3/bits/random.tcc:
......@@ -3711,8 +3716,6 @@ config.h:
/usr/include/bits/fenv.h:
/usr/include/bits/fenvinline.h:
/usr/include/boost/math/special_functions/math_fwd.hpp:
/usr/include/boost/math/special_functions/detail/round_fwd.hpp:
......@@ -4191,6 +4194,26 @@ 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:
/usr/include/c++/4.8.3/bits/hashtable_policy.h:
/usr/include/c++/4.8.3/bits/unordered_map.h:
../../OpenFPM_data/src/NN/CellList/CellList.hpp:
../../OpenFPM_data/src/NN/CellList/CellListFast.hpp:
../../OpenFPM_data/src/NN/CellList/CellDecomposer.hpp:
../../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:
......
......@@ -20,6 +20,10 @@
#include "Space/Shape/Box.hpp"
#include "Space/Shape/Point.hpp"
#include "NN/CellList/CellDecomposer.hpp"
#include <unordered_map>
#include "NN/CellList/CellList.hpp"
template<unsigned int dim, typename T> using Ghost = Box<dim,T>;
/**
* \brief This class decompose a space into subspaces
......@@ -38,11 +42,31 @@
* \note if PARALLEL_DECOMPOSITION macro is defined a parallel decomposition algorithm is used, basically
* each processor does not recompute the same decomposition
*
* \note sub-sub-domain portion of space at finer level than the sub-domain (before optimization)
* (or before sub-sub-domain merging)
* \note sub-domain portion of space (after optimization)
* \note near processor sub-domain a sub-domain that live in the a near (or contiguous) processor
*
*/
template<unsigned int dim, typename T, template<typename> class device_l=openfpm::device_cpu, typename Memory=HeapMemory, template<unsigned int, typename> class Domain=Box, template<typename, typename, typename, typename, unsigned int> class data_s = openfpm::vector>
class CartDecomposition
{
struct Box_proc
{
// Intersection between the local sub-domain enlarged by the ghost and the contiguous processor
// sub-domains
openfpm::vector<::Box<dim,T>> bx;
// Intersection between the contiguous processor sub-domain enlarged by the ghost with the
// local sub-domain
openfpm::vector<::Box<dim,T>> nbx;
// processor
size_t proc;
};
public:
//! Type of the domain we are going to decompose
......@@ -67,6 +91,20 @@ private:
//! the set of all local sub-domain as vector
data_s<SpaceBox<dim,T>,device_l<SpaceBox<dim,T>>,Memory,openfpm::vector_grow_policy_default, openfpm::vect_isel<SpaceBox<dim,T>>::value > sub_domains;
//! List of near processors
openfpm::vector<size_t> nn_processors;
//! for each sub-domain, contain the list of the neighborhood processors
//! and for each processor contain the boxes calculated from the intersection
//! of the sub-domain ghost with the near-by processor sub-domain ()
openfpm::vector< openfpm::vector< Box_proc > > box_nn_processor_int;
//! for each box, contain the list of the neighborhood processors
openfpm::vector<openfpm::vector<long unsigned int> > box_nn_processor;
// for each near-processor store the sub-domain of the near processor
std::unordered_map<size_t,typename openfpm::vector<::Box<dim,T>> > nn_processor_subdomains;
//! Structure that contain for each sub-domain box the processor id
//! exist for efficient global communication
openfpm::vector<size_t> fine_s;
......@@ -81,12 +119,48 @@ private:
//! rectangular domain to decompose
Domain<dim,T> domain;
//! Ghost boxes of the processor
//! for each Sub-domain it store the ghost boxes, or
//! the set of boxes that enclose the the ghost space
//! Box cannot overlap, they contain one id that is the
//! processor the information should come from
openfpm::vector< openfpm::vector<Domain<dim,T>> > gh_dom;
//! Internal boxes of the processor
//! for each Sub-domain it store the boxes enclosing the
//! space that must be communicated when another processor
//! require the ghost
//! Box can overlap, they contain one id that is the
//! processor the information should be communicated to
openfpm::vector< openfpm::vector< Domain<dim,T>> > int_box;
//! Box Spacing
T spacing[dim];
//! Runtime virtual cluster machine
Vcluster & v_cl;
//! Structure that store the geometrical information about intersection between the local sub-domain
//! and the near processor sub-domains
CellList<dim,T,FAST> geo_cell;
/*! \brief Enlarge the ghost domain
*
* \param the box