Commit 3d293f9e authored by Matthias Messner's avatar Matthias Messner
parents 3da06e35 a5d07478
# - Finds OpenMP support
# This module can be used to detect OpenMP support in a compiler.
# If the compiler supports OpenMP, the flags required to compile with
# openmp support are set.
#
# The following variables are set:
# OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
# OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
# OPENMP_FOUND - true if openmp is detected
#
# Supported compilers can be found at http://openmp.org/wp/openmp-compilers/
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Modified in RSTM from original source to provide CXX-tm flags
set(OpenMP_C_FLAG_CANDIDATES
#Gnu
"-fopenmp"
#Microsoft Visual Studio
"/openmp"
#Intel windows
"-Qopenmp"
#Intel
"-openmp"
#Empty, if compiler automatically accepts openmp
" "
#Sun
"-xopenmp"
#HP
"+Oopenmp"
#IBM XL C/c++
"-qsmp"
#Portland Group
"-mp"
)
set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES})
set(OpenMP_CXX-tm_FLAG_CANDIDATES ${OpenMP_CXX_FLAG_CANDIDATES})
# sample openmp source code to test
set(OpenMP_C_TEST_SOURCE
"
#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}
")
# use the same source for CXX as C for now
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
set(OpenMP_CXX-tm_TEST_SOURCE ${OpenMP_CXX_TEST_SOURCE})
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS AND DEFINED OpenMP_CXX-tm_FLAGS)
set(OpenMP_C_FLAG_CANDIDATES)
set(OpenMP_CXX_FLAG_CANDIDATES)
set(OpenMP_CXX-tm_FLAG_CANDIDATES)
endif()
# check c compiler
IF (CMAKE_C_COMPILER)
include (CheckCSourceCompiles)
foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP C flag = [${FLAG}]")
check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
ENDIF (CMAKE_C_COMPILER)
# check cxx compiler
IF (CMAKE_CXX_COMPILER)
include (CheckCXXSourceCompiles)
foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
ENDIF (CMAKE_CXX_COMPILER)
# check cxxtm compiler
IF (CMAKE_CXX-tm_COMPILER)
include (CheckCXX-tmSourceCompiles)
foreach(FLAG ${OpenMP_CXX-tm_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP CXX-tm flag = [${FLAG}]")
check_cxxtm_source_compiles("${OpenMP_CXX-tm_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX-tm_FLAGS_INTERNAL "${FLAG}")
break()
endif()
endforeach()
ENDIF ()
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
macro (OpenMP_complete_lang_flags lang langstring)
IF (CMAKE_${lang}_COMPILER)
set(OpenMP_${lang}_FLAGS "${OpenMP_${lang}_FLAGS_INTERNAL}"
CACHE STRING "${langstring} compiler flags for OpenMP parallization")
find_package_handle_standard_args(OpenMP DEFAULT_MSG
OpenMP_${lang}_FLAGS )
mark_as_advanced(OpenMP_${lang}_FLAGS)
ENDIF ()
endmacro ()
OpenMP_complete_lang_flags (C "C")
OpenMP_complete_lang_flags (CXX "C++")
OpenMP_complete_lang_flags (CXX-tm "C++ TM")
...@@ -6,11 +6,14 @@ if(insource) ...@@ -6,11 +6,14 @@ if(insource)
MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../") MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
endif(insource) endif(insource)
# MPI option has to be set before project # MPI option has to be set before project, cannot be changed in the cache!
OPTION( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" OFF )
if( SCALFMM_USE_MPI ) if( SCALFMM_USE_MPI )
SET(CMAKE_CXX_COMPILER mpicxx) include(CMakeForceCompiler)
endif() CMAKE_FORCE_C_COMPILER(mpicc "MPI C Compiler")
CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")
else()
MESSAGE(STATUS "Remove CMake cache and run cmake .. -DSCALFMM_USE_MPI=ON to enable MPI" )
endif(SCALFMM_USE_MPI)
# Project Infos # Project Infos
project(scalfmm) project(scalfmm)
...@@ -32,9 +35,12 @@ OPTION( SCALFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF ) ...@@ -32,9 +35,12 @@ OPTION( SCALFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF )
# Test if openmp is here # Test if openmp is here
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake) find_package (OpenMP)
find_package(OpenMP) if(OPENMP_FOUND)
# include(FindOpenMP) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
# Debug # Debug
MESSAGE( STATUS "SCALFMM_BUILD_DEBUG = ${SCALFMM_BUILD_DEBUG}" ) MESSAGE( STATUS "SCALFMM_BUILD_DEBUG = ${SCALFMM_BUILD_DEBUG}" )
...@@ -87,15 +93,6 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake ...@@ -87,15 +93,6 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
# Use Mem stats # Use Mem stats
MESSAGE( STATUS "SCALFMM_USE_MEM_STATS = ${SCALFMM_USE_MEM_STATS}" ) MESSAGE( STATUS "SCALFMM_USE_MEM_STATS = ${SCALFMM_USE_MEM_STATS}" )
# Test if openmp is here
find_package (OpenMP)
# include(FindOpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
# Add CBLAS # Add CBLAS
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CBLAS_LIBRARIES}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CBLAS_LIBRARIES}")
......
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
/** This class is an arranger, it move the particles that need /** This class is an arranger, it move the particles that need
* to be hosted in a different leaf * to be hosted in a different leaf
* \n
* For example, if a simulation has been executed and the position
* of the particles have been changed, then it may be better
* to move the particles in the tree instead of building a new
* tree.
*/ */
template <class OctreeClass, class ContainerClass, class ParticleClass> template <class OctreeClass, class ContainerClass, class ParticleClass>
class FOctreeArranger : FAssertable { class FOctreeArranger : FAssertable {
......
...@@ -18,7 +18,12 @@ ...@@ -18,7 +18,12 @@
/** This class is an arranger, it move the particles that need /** This class is an arranger, it move the particles that need
* to be hosted in a different leaf * to be hosted in a different leaf
* This is the parallel version. * This is the parallel version that use MPI.
* \n
* For example, if a simulation has been executed and the position
* of the particles have been changed, then it may be better
* to move the particles in the tree instead of building a new
* tree.
*/ */
template <class OctreeClass, class ContainerClass, class ParticleClass> template <class OctreeClass, class ContainerClass, class ParticleClass>
class FOctreeArrangerProc : FAssertable { class FOctreeArrangerProc : FAssertable {
......
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
* @author Berenger Bramas (berenger.bramas@inria.fr) * @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FAbstractCell * @class FAbstractCell
* @brief * @brief
* Please read the license
* *
* This class define the method that every cell class * This class define the methods that every cell class
* has to implement. * has to implement to be insertable in the tree.
* * \n
* In fact FOctree & FFmmAlgorithm need this function to be implemented. * In fact FOctree & FFmmAlgorithm need this functions to be implemented.
* But you cannot use this interface with the extension (as an example : * But you cannot use this interface with the extension (as an example :
* because the compiler will faill to know if getMortonIndex is coming * because the compiler will faill to know if getMortonIndex is coming
* from this interface or from the extension) * from this interface or from the extension)
...@@ -37,9 +36,9 @@ public: ...@@ -37,9 +36,9 @@ public:
} }
/** /**
* Must be implemented by each user Cell class * Must be implemented by each user Cell class
* @return the position of the current cell * @return the position of the current cell
*/ */
virtual MortonIndex getMortonIndex() const = 0; virtual MortonIndex getMortonIndex() const = 0;
......
...@@ -71,10 +71,11 @@ public: ...@@ -71,10 +71,11 @@ public:
/** /**
* L2L * L2L
* Local to local * Local to local
* @param the father to take value from * @param local the father to take value from
* @param the child to downward values (child may have already been impacted by M2L) * @param child the child to downward values (child may have already been impacted by M2L)
* @param level the current level of computation * @param inLevel the current level of computation
* the child array has a size of 8 elements (address if exists or 0 otherwise). * the child array has a size of 8 elements (address if exists or 0 otherwise).
* Children are ordering in the morton index way.
* You must test if a pointer is 0 to know if an element exists inside this array * You must test if a pointer is 0 to know if an element exists inside this array
*/ */
virtual void L2L(const CellClass* const FRestrict local, CellClass* FRestrict * const FRestrict child, const int inLevel) = 0; virtual void L2L(const CellClass* const FRestrict local, CellClass* FRestrict * const FRestrict child, const int inLevel) = 0;
......
...@@ -6,7 +6,7 @@ class FBufferWriter; ...@@ -6,7 +6,7 @@ class FBufferWriter;
/** /**
* @author Berenger Bramas (berenger.bramas@inria.fr) * @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FAbstractSendable * @class FAbstractSerializable
* Please read the license * Please read the license
* *
* This propose an interface to save and restore a class * This propose an interface to save and restore a class
......
...@@ -33,10 +33,12 @@ public: ...@@ -33,10 +33,12 @@ public:
virtual ~FBasicCell(){ virtual ~FBasicCell(){
} }
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{ void save(FBufferWriter& buffer) const{
FExtendMortonIndex::save(buffer); FExtendMortonIndex::save(buffer);
FExtendCoordinate::save(buffer); FExtendCoordinate::save(buffer);
} }
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){ void restore(FBufferReader& buffer){
FExtendMortonIndex::restore(buffer); FExtendMortonIndex::restore(buffer);
FExtendCoordinate::restore(buffer); FExtendCoordinate::restore(buffer);
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "FAbstractKernels.hpp" #include "FAbstractKernels.hpp"
#include "../Utils/FGlobal.hpp"
#include "../Utils/FTrace.hpp"
/** /**
* @author Berenger Bramas (berenger.bramas@inria.fr) * @author Berenger Bramas (berenger.bramas@inria.fr)
...@@ -23,8 +21,7 @@ ...@@ -23,8 +21,7 @@
* @brief * @brief
* Please read the license * Please read the license
* *
* This kernels simply shows the details of the information * This kernels is empty and does nothing.
* it receives (in debug)
*/ */
template< class ParticleClass, class CellClass, class ContainerClass> template< class ParticleClass, class CellClass, class ContainerClass>
class FBasicKernels : public FAbstractKernels<ParticleClass,CellClass,ContainerClass> { class FBasicKernels : public FAbstractKernels<ParticleClass,CellClass,ContainerClass> {
......
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
*/ */
class FBasicParticle : public FExtendPosition{ class FBasicParticle : public FExtendPosition{
public: public:
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{ void save(FBufferWriter& buffer) const{
FExtendPosition::save(buffer); FExtendPosition::save(buffer);
} }
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){ void restore(FBufferReader& buffer){
FExtendPosition::restore(buffer); FExtendPosition::restore(buffer);
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define FFmaPARTICLE_HPP #define FFmaPARTICLE_HPP
#include "FBasicParticle.hpp" #include "../Extensions/FExtendPosition.hpp"
#include "../Extensions/FExtendPhysicalValue.hpp" #include "../Extensions/FExtendPhysicalValue.hpp"
/** /**
...@@ -23,14 +23,16 @@ ...@@ -23,14 +23,16 @@
* This class defines a particle for FMA loader. * This class defines a particle for FMA loader.
* As defined in FFmaLoader it needs {FBasicParticle,FExtendPhysicalValue} * As defined in FFmaLoader it needs {FBasicParticle,FExtendPhysicalValue}
*/ */
class FFmaParticle : public FBasicParticle, public FExtendPhysicalValue { class FFmaParticle : public FExtendPosition, public FExtendPhysicalValue {
public: public:
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{ void save(FBufferWriter& buffer) const{
FBasicParticle::save(buffer); FExtendPosition::save(buffer);
FExtendPhysicalValue::save(buffer); FExtendPhysicalValue::save(buffer);
} }
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){ void restore(FBufferReader& buffer){
FBasicParticle::restore(buffer); FExtendPosition::restore(buffer);
FExtendPhysicalValue::restore(buffer); FExtendPhysicalValue::restore(buffer);
} }
}; };
......
...@@ -33,7 +33,7 @@ public: ...@@ -33,7 +33,7 @@ public:
/** /**
* To add a new particle in the leaf * To add a new particle in the leaf
* @param particle the new particle * @param particle the new particle to store in the current leaf
*/ */
void push(const ParticleClass& particle){ void push(const ParticleClass& particle){
this->particles.push(particle); this->particles.push(particle);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* Please read the license * Please read the license
* *
* This class is used in the FTestKernels, please * This class is used in the FTestKernels, please
* look at this class to know what it is. * look at this class to know how to customize a cell.
* *
* This cell simply store the data when up/down * This cell simply store the data when up/down
*/ */
...@@ -51,25 +51,36 @@ public: ...@@ -51,25 +51,36 @@ public:
this->dataDown = inData; this->dataDown = inData;
} }
/////////////////////////////////////////////////
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{ void save(FBufferWriter& buffer) const{
FBasicCell::save(buffer); FBasicCell::save(buffer);
buffer << dataDown << dataUp; buffer << dataDown << dataUp;
} }
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){ void restore(FBufferReader& buffer){
FBasicCell::restore(buffer); FBasicCell::restore(buffer);
buffer >> dataDown >> dataUp; buffer >> dataDown >> dataUp;
} }
/////////////////////////////////////////////////
/** Serialize only up data in a buffer */
void serializeUp(FBufferWriter& buffer) const { void serializeUp(FBufferWriter& buffer) const {
buffer << this->dataUp; buffer << this->dataUp;
} }
/** Deserialize only up data in a buffer */
void deserializeUp(FBufferReader& buffer){ void deserializeUp(FBufferReader& buffer){
buffer >> this->dataUp; buffer >> this->dataUp;
} }
/** Serialize only down data in a buffer */
void serializeDown(FBufferWriter& buffer) const { void serializeDown(FBufferWriter& buffer) const {
buffer << this->dataDown; buffer << this->dataDown;
} }
/** Deserialize only up data in a buffer */
void deserializeDown(FBufferReader& buffer){ void deserializeDown(FBufferReader& buffer){
buffer >> this->dataDown; buffer >> this->dataDown;
} }
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
* *
* This kernels is a virtual kernels to validate that the fmm algorithm is * This kernels is a virtual kernels to validate that the fmm algorithm is
* correctly done on particles. * correctly done on particles.
* It used FTestCell and FTestParticle * It should use FTestCell and FTestParticle.
* A the end of a computation, the particles should host then number of particles
* in the simulation (-1).
*/ */
template< class ParticleClass, class CellClass, class ContainerClass> template< class ParticleClass, class CellClass, class ContainerClass>
class FTestKernels : public FAbstractKernels<ParticleClass,CellClass,ContainerClass> { class FTestKernels : public FAbstractKernels<ParticleClass,CellClass,ContainerClass> {
...@@ -38,14 +40,12 @@ public: ...@@ -38,14 +40,12 @@ public:
/** Before upward */ /** Before upward */
void P2M(CellClass* const pole, const ContainerClass* const particles) { void P2M(CellClass* const pole, const ContainerClass* const particles) {
// the pole represents all particles under // the pole represents all particles under
pole->setDataUp(pole->getDataUp() + particles->getSize()); pole->setDataUp(pole->getDataUp() + particles->getSize());
} }
/** During upward */ /** During upward */
void M2M(CellClass* const FRestrict pole, const CellClass *const FRestrict *const FRestrict child, const int /*level*/) { void M2M(CellClass* const FRestrict pole, const CellClass *const FRestrict *const FRestrict child, const int /*level*/) {
// A parent represents the sum of the child // A parent represents the sum of the child
for(int idx = 0 ; idx < 8 ; ++idx){ for(int idx = 0 ; idx < 8 ; ++idx){
if(child[idx]){ if(child[idx]){
...@@ -56,7 +56,6 @@ public: ...@@ -56,7 +56,6 @@ public:
/** Before Downward */ /** Before Downward */
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[343], const int /*size*/, const int /*level*/) { void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[343], const int /*size*/, const int /*level*/) {
// The pole is impacted by what represent other poles // The pole is impacted by what represent other poles
for(int idx = 0 ; idx < 343 ; ++idx){ for(int idx = 0 ; idx < 343 ; ++idx){
if(distantNeighbors[idx]){ if(distantNeighbors[idx]){
...@@ -67,7 +66,6 @@ public: ...@@ -67,7 +66,6 @@ public:
/** During Downward */ /** During Downward */
void L2L(const CellClass*const FRestrict local, CellClass* FRestrict *const FRestrict child, const int /*level*/) { void L2L(const CellClass*const FRestrict local, CellClass* FRestrict *const FRestrict child, const int /*level*/) {
// Each child is impacted by the father // Each child is impacted by the father
for(int idx = 0 ; idx < 8 ; ++idx){ for(int idx = 0 ; idx < 8 ; ++idx){
if(child[idx]){ if(child[idx]){
...@@ -79,7 +77,6 @@ public: ...@@ -79,7 +77,6 @@ public:
/** After Downward */ /** After Downward */
void L2P(const CellClass* const local, ContainerClass*const particles){ void L2P(const CellClass* const local, ContainerClass*const particles){
// The particles is impacted by the parent cell // The particles is impacted by the parent cell
typename ContainerClass::BasicIterator iter(*particles); typename ContainerClass::BasicIterator iter(*particles);
while( iter.hasNotFinished() ){ while( iter.hasNotFinished() ){
...@@ -94,7 +91,6 @@ public: ...@@ -94,7 +91,6 @@ public:
void P2P(const FTreeCoordinate& , void P2P(const FTreeCoordinate& ,
ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources, ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
ContainerClass* const directNeighborsParticles[27], const int ){ ContainerClass* const directNeighborsParticles[27], const int ){
// Each particles targeted is impacted by the particles sources // Each particles targeted is impacted by the particles sources
long long int inc = sources->getSize(); long long int inc = sources->getSize();
if(targets == sources){ if(targets == sources){
...@@ -118,7 +114,6 @@ public: ...@@ -118,7 +114,6 @@ public:
void P2PRemote(const FTreeCoordinate& , void P2PRemote(const FTreeCoordinate& ,
ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources, ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
ContainerClass* const directNeighborsParticles[27], const int ){ ContainerClass* const directNeighborsParticles[27], const int ){
// Each particles targeted is impacted by the particles sources // Each particles targeted is impacted by the particles sources
long long int inc = 0; long long int inc = 0;
for(int idx = 0 ; idx < 27 ; ++idx){ for(int idx = 0 ; idx < 27 ; ++idx){
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
* This class is used in the FTestKernels, please * This class is used in the FTestKernels, please
* look at this class to know whit it is. * look at this class to know whit it is.
* *
* Particles just need the data down. * Particles just need the data down (after and run with FTestKernel the
* value shoud be NB PARTICLES (-1)).
*/ */
class FTestParticle : public FBasicParticle { class FTestParticle : public FBasicParticle {
protected: protected:
...@@ -46,10 +47,15 @@ public: ...@@ -46,10 +47,15 @@ public:
this->dataDown = inData; this->dataDown = inData;
} }
//////////////////////////////////////////////////
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{ void save(FBufferWriter& buffer) const{
FBasicParticle::save(buffer); FBasicParticle::save(buffer);
buffer << dataDown; buffer << dataDown;
} }
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){ void restore(FBufferReader& buffer){
FBasicParticle::restore(buffer); FBasicParticle::restore(buffer);
buffer >> dataDown;