From 5ad87499bfc307770a496dad39a81f7996414d4f Mon Sep 17 00:00:00 2001 From: Pietro Incardona <incardon@mpi-cbg.de> Date: Thu, 22 Sep 2016 19:48:10 +0200 Subject: [PATCH] Latest modules --- CHANGELOG.md | 9 +++++++- configure.ac | 9 +++----- .../PSE/0_Derivative_approx_1D/Makefile | 2 +- example/Numerics/PSE/1_Diffusion_1D/Makefile | 2 +- .../Stoke_flow/0_2D_incompressible/Makefile | 2 +- .../Stoke_flow/1_3D_incompressible/Makefile | 2 +- example/Vector/0_simple/Makefile | 2 +- example/Vector/2_expressions/Makefile | 2 +- example/Vector/3_molecular_dynamic/Makefile | 2 +- example/Vector/4_complex_prop/Makefile | 2 +- example/Vector/4_multiphase_celllist/Makefile | 2 +- example/Vector/4_reorder/Makefile | 2 +- openfpm_data | 2 +- openfpm_numerics | 2 +- src/Makefile.am | 2 +- src/Vector/vector_dist.hpp | 21 +++++++++++++++++-- src/Vector/vector_dist_comm.hpp | 21 +++++++++++++++++++ 17 files changed, 64 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5042a8a4..8c03e493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,16 @@ All notable changes to this project will be documented in this file. - Miss-compilation of SUITESPARSE on gcc-6.2 - vector_dist with negative domain (Now supported) - Grid 1D has been fixed -- One constructor of Box had arguments inverted. +- One constructor of Box had arguments inverted. + PLEASE CAREFULL ON THIS BUG + float xmin[] = {0.0,0.0}; + float xmax[] = {1.0,1.0}; + // Box<2,float> box(xmax,xmin) BUG IT WAS xmax,xmin + Box<2,float> box(xmin,xmax) <--- NOW IT IS xmin,xmax + Box<2,float> box({0.0,0.0},{1.0,1.0}) <---- This constructor is not affected by the BUG ### Changed +- On gcc the -fext-numeric-literals compilation flag is now mandatory ## [0.5.0] - 15 August 2016 diff --git a/configure.ac b/configure.ac index bff4f8b1..45305737 100644 --- a/configure.ac +++ b/configure.ac @@ -175,14 +175,11 @@ my_save_cflags="$CXXFLAGS" CXXFLAGS=-fext-numeric-literals AC_MSG_CHECKING([whether CXX supports -fext-numeric-literals]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AC_MSG_RESULT([yes])], - [ - AM_CXXFLAGS=-fext-numeric-literals - echo "-fext-numeric-literals" > config_opt + [AC_MSG_RESULT([yes]) + AM_CXXFLAGS="-fext-numeric-literals" ], [ - AC_MSG_RESULT([no]), - echo "" > config_opt + AC_MSG_RESULT([no]) ] ) AC_LANG_POP([C++]) diff --git a/example/Numerics/PSE/0_Derivative_approx_1D/Makefile b/example/Numerics/PSE/0_Derivative_approx_1D/Makefile index 4399591a..24da6b8b 100644 --- a/example/Numerics/PSE/0_Derivative_approx_1D/Makefile +++ b/example/Numerics/PSE/0_Derivative_approx_1D/Makefile @@ -7,7 +7,7 @@ LDIR = OBJ = main.o %.o: %.cpp - $(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) pse_1d: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Numerics/PSE/1_Diffusion_1D/Makefile b/example/Numerics/PSE/1_Diffusion_1D/Makefile index 80cc4ffe..241b3dfd 100644 --- a/example/Numerics/PSE/1_Diffusion_1D/Makefile +++ b/example/Numerics/PSE/1_Diffusion_1D/Makefile @@ -7,7 +7,7 @@ LDIR = OBJ = main.o %.o: %.cpp - $(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) diff_1d: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Numerics/Stoke_flow/0_2D_incompressible/Makefile b/example/Numerics/Stoke_flow/0_2D_incompressible/Makefile index b6512e4c..3c6a733e 100644 --- a/example/Numerics/Stoke_flow/0_2D_incompressible/Makefile +++ b/example/Numerics/Stoke_flow/0_2D_incompressible/Makefile @@ -8,7 +8,7 @@ OBJ_EIGEN = main_eigen.o OBJ_PETSC = main_petsc.o %.o: %.cpp - $(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) all: stokes_2d_eigen stokes_2d_petsc diff --git a/example/Numerics/Stoke_flow/1_3D_incompressible/Makefile b/example/Numerics/Stoke_flow/1_3D_incompressible/Makefile index 37f93648..68f9098b 100644 --- a/example/Numerics/Stoke_flow/1_3D_incompressible/Makefile +++ b/example/Numerics/Stoke_flow/1_3D_incompressible/Makefile @@ -8,7 +8,7 @@ OBJ_EIGEN = main_eigen.o OBJ_PETSC = main_petsc.o %.o: %.cpp - $(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) all: stokes_3d_eigen stokes_3d_petsc diff --git a/example/Vector/0_simple/Makefile b/example/Vector/0_simple/Makefile index 646357e9..9afd8418 100644 --- a/example/Vector/0_simple/Makefile +++ b/example/Vector/0_simple/Makefile @@ -7,7 +7,7 @@ LDIR = OBJ = main.o %.o: %.cpp - $(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) vect: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Vector/2_expressions/Makefile b/example/Vector/2_expressions/Makefile index a7705b97..bfa50d40 100644 --- a/example/Vector/2_expressions/Makefile +++ b/example/Vector/2_expressions/Makefile @@ -7,7 +7,7 @@ LDIR = OBJ = main.o %.o: %.cpp - $(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) expr: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Vector/3_molecular_dynamic/Makefile b/example/Vector/3_molecular_dynamic/Makefile index 9c467c81..6d55806e 100644 --- a/example/Vector/3_molecular_dynamic/Makefile +++ b/example/Vector/3_molecular_dynamic/Makefile @@ -12,7 +12,7 @@ OBJ_VL_SYM = main_vl_sym.o all: md_dyn md_dyn_expr md_dyn_vl md_dyn_vl_sym %.o: %.cpp - $(CC) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) md_dyn: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Vector/4_complex_prop/Makefile b/example/Vector/4_complex_prop/Makefile index 47ec488c..f41f44fc 100644 --- a/example/Vector/4_complex_prop/Makefile +++ b/example/Vector/4_complex_prop/Makefile @@ -10,7 +10,7 @@ OBJ_SER = main_ser.o all: vect_cp vect_ser %.o: %.cpp - $(CC) -O0 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH) vect_cp: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Vector/4_multiphase_celllist/Makefile b/example/Vector/4_multiphase_celllist/Makefile index 0acbf7c2..16168a45 100644 --- a/example/Vector/4_multiphase_celllist/Makefile +++ b/example/Vector/4_multiphase_celllist/Makefile @@ -7,7 +7,7 @@ LDIR = OBJ = main.o %.o: %.cpp - $(CC) -O0 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) cell: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/example/Vector/4_reorder/Makefile b/example/Vector/4_reorder/Makefile index c5ada0a4..0c5222d9 100644 --- a/example/Vector/4_reorder/Makefile +++ b/example/Vector/4_reorder/Makefile @@ -13,7 +13,7 @@ all_test: OPT += -DTEST_RUN all_test: md_data_ord_test md_comp_ord_test %.o: %.cpp - $(CC) -O3 -g -c --std=c++11 $(OPT) -o $@ $< $(INCLUDE_PATH) + $(CC) -fext-numeric-literals -O3 -g -c --std=c++11 $(OPT) -o $@ $< $(INCLUDE_PATH) md_data_ord: $(OBJ_DORD) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/openfpm_data b/openfpm_data index fd67c262..ebf5628c 160000 --- a/openfpm_data +++ b/openfpm_data @@ -1 +1 @@ -Subproject commit fd67c2620e44caed20d3e3c30fad72c41cd9d48e +Subproject commit ebf5628ca2191c298589d36973da2bbaceb4ecfe diff --git a/openfpm_numerics b/openfpm_numerics index a384941b..c476b51f 160000 --- a/openfpm_numerics +++ b/openfpm_numerics @@ -1 +1 @@ -Subproject commit a384941b412db3d3aa280caae3cb3eaa874a86c2 +Subproject commit c476b51f466d6e5ed746d7dd64a09a48b77bafdd diff --git a/src/Makefile.am b/src/Makefile.am index a2c3cee0..66860062 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/CartD lib_LIBRARIES = libofpm_pdata.a libofpm_pdata_a_SOURCES = lib/pdata.cpp -libofpm_pdata_a_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -Wno-unused-local-typedefs +libofpm_pdata_a_CXXFLAGS = $(AM_CXXFLAGS) $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -Wno-unused-local-typedefs libofpm_pdata_a_CFLAGS = .cu.o : diff --git a/src/Vector/vector_dist.hpp b/src/Vector/vector_dist.hpp index ef47a83d..7fc66a8a 100644 --- a/src/Vector/vector_dist.hpp +++ b/src/Vector/vector_dist.hpp @@ -164,7 +164,7 @@ public: * */ vector_dist(const vector_dist<dim,St,prop,Decomposition,Memory> & v) - :vector_dist_comm<dim,St,prop,Decomposition,Memory>(v.dec),v_cl(v.v_cl) + :vector_dist_comm<dim,St,prop,Decomposition,Memory>(v.getDecomposition()),v_cl(v.v_cl) { #ifdef SE_CLASS2 check_new(this,8,VECTOR_DIST_EVENT,4); @@ -799,6 +799,16 @@ public: return vector_dist_comm<dim,St,prop,Decomposition,Memory>::getDecomposition(); } + /*! \brief Get the decomposition + * + * \return + * + */ + inline const Decomposition & getDecomposition() const + { + return vector_dist_comm<dim,St,prop,Decomposition,Memory>::getDecomposition(); + } + /*! \brief It move all the particles that does not belong to the local processor to the respective processor * * \tparam out of bound policy it specify what to do when the particles are detected out of bound @@ -1022,7 +1032,14 @@ public: */ void getCellListParams(St r_cut, size_t (&div)[dim],Box<dim, St> & box, Ghost<dim,St> enlarge = Ghost<dim,St>(0.0)) { - box = cl_param_calculate(div,r_cut,enlarge); + // get the processor bounding box + Box<dim, St> pbox = getDecomposition().getProcessorBounds(); + + // enlarge the processor bounding box by the ghost + Ghost<dim,St> g = getDecomposition().getGhost(); + pbox.enlarge(g); + + cl_param_calculate(pbox, div,r_cut,enlarge); } /*! \brief It return the id of structure in the allocation list diff --git a/src/Vector/vector_dist_comm.hpp b/src/Vector/vector_dist_comm.hpp index 585be039..ca70fd99 100644 --- a/src/Vector/vector_dist_comm.hpp +++ b/src/Vector/vector_dist_comm.hpp @@ -743,6 +743,17 @@ class vector_dist_comm public: + /*! \brief Copy Constructor + * + * \param v vector to copy + * + */ + vector_dist_comm(const vector_dist_comm<dim,St,prop,Decomposition,Memory> & v) + { + this->operator=(v); + } + + /*! \brief Constructor * * \param dec Domain decompositon @@ -999,6 +1010,16 @@ public: return dec; } + /*! \brief Get the decomposition + * + * \return + * + */ + inline const Decomposition & getDecomposition() const + { + return dec; + } + /*! \brief Copy a vector * * \param vc vector to copy -- GitLab