Commit 7863df56 authored by Luka Stanisic's avatar Luka Stanisic

Merge remote-tracking branch 'origin/master' into simgrid

# Conflicts:
#	CMakeLists.txt
#	Src/GroupTree/Core/FGroupTaskStarpuAlgorithm.hpp
#	Src/GroupTree/StarPUUtils/FStarPUTaskNameParams.hpp
#	Tests/GroupTree/testBlockedUniform.cpp
parents 06742e8c 14ea2817
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 1400
PenaltyBreakComment: 1400
PenaltyBreakFirstLessLess: 140000
PenaltyBreakString: 1400
PenaltyExcessCharacter: 1
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: true
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
DisableFormat: false
...@@ -22,7 +22,7 @@ if(SCALFMM_ADDON_CKERNELAPI) ...@@ -22,7 +22,7 @@ if(SCALFMM_ADDON_CKERNELAPI)
file( GLOB_RECURSE source_lib_files Src/*.cpp ) file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project # Adding cpp files to project
add_library( scalfmmckernelapi STATIC ${source_lib_files} ) add_library( scalfmmckernelapi ${source_lib_files} )
# Add blas library (even if it is set to off) # Add blas library (even if it is set to off)
target_link_libraries( scalfmmckernelapi scalfmm) target_link_libraries( scalfmmckernelapi scalfmm)
...@@ -35,7 +35,7 @@ if(SCALFMM_ADDON_CKERNELAPI) ...@@ -35,7 +35,7 @@ if(SCALFMM_ADDON_CKERNELAPI)
) )
# Install lib # Install lib
install( TARGETS scalfmmckernelapi ARCHIVE DESTINATION lib ) install( TARGETS scalfmmckernelapi ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
# Install header # Install header
SET(my_include_dirs "Src") SET(my_include_dirs "Src")
......
...@@ -145,10 +145,10 @@ typedef void (*Callback_free_cell)(void*); ...@@ -145,10 +145,10 @@ typedef void (*Callback_free_cell)(void*);
/** /**
* @brief Callback used to know the size of userData. * @brief Callback used to know the size of userData.
* @param level current level of current cell * @param level current level of current cell
* @param userData Datas that will be serialize
* @param morton_index of the current cell * @param morton_index of the current cell
* @param userData : ptr to user's kernel
*/ */
typedef FSize (*Callback_get_cell_size)(int level, void * userDatas, long long morton_index); typedef FSize (*Callback_get_cell_size)(int level, long long morton_index, void * userData);
/** /**
* @brief Callback used to serialize userdata inside an array of size * @brief Callback used to serialize userdata inside an array of size
...@@ -159,6 +159,39 @@ typedef FSize (*Callback_get_cell_size)(int level, void * userDatas, long long m ...@@ -159,6 +159,39 @@ typedef FSize (*Callback_get_cell_size)(int level, void * userDatas, long long m
*/ */
typedef void (*Callback_copy_cell)(void * userDatas, FSize size, void * memoryAllocated); typedef void (*Callback_copy_cell)(void * userDatas, FSize size, void * memoryAllocated);
/**
* @brief Callback used by scalfmm to know the size needed by the user
* to store its local datas linked to a leaf.
*
* @param nbParts : number of point inside current Leaf
* @return Size (in bytes) needed to serialize the user datas
*/
typedef FSize (*Callback_get_leaf_size)(FSize nbParts);
/**
* @brief Callback used by scalfmm to serialize the leaf user data.
*
* @param Morton MortonIndex of current Leaf
* @param nbParts : number of point inside current Leaf
* @param userdata : leaf User data
* @param memAllocated : Ptr to an array of size =
* Callback_get_leaf_size(...), to be filled by the user.
*/
typedef void (*Callback_copy_leaf)(FSize nbParts, void * userDatas, void * memAllocated);
/**
* @brief Callback used by scalfmm to retreive leaf data from an array
* (previously filled by the user through Callback_copy_leaf)
*
* @param Morton MortonIndex of current Leaf
* @param nbParts : number of point inside current Leaf
* @param memAllocated : Ptr to an array of size =
* Callback_get_leaf_size(...), to be read by the user in order to
* re-build its leaf.
* @return new userdata local to the leaf
*/
typedef void * (*Callback_restore_leaf)(FSize nbParts, void * memAllocated);
/** /**
* @brief Callback called if scalfmm_finalize_cell is called. * @brief Callback called if scalfmm_finalize_cell is called.
...@@ -214,10 +247,18 @@ typedef struct User_Scalfmm_Cell_Descriptor{ ...@@ -214,10 +247,18 @@ typedef struct User_Scalfmm_Cell_Descriptor{
Callback_get_cell_size user_get_size; Callback_get_cell_size user_get_size;
Callback_copy_cell user_copy_cell; Callback_copy_cell user_copy_cell;
Callback_restore_cell user_restore_cell; Callback_restore_cell user_restore_cell;
Callback_init_leaf user_init_leaf;
Callback_free_leaf user_free_leaf;
}Scalfmm_Cell_Descriptor; }Scalfmm_Cell_Descriptor;
/**
* @brief This struct contains all the callback affecting leaves
*/
typedef struct User_Scalfmm_Leaf_Descriptor{
Callback_init_leaf user_init_leaf;
Callback_free_leaf user_free_leaf;
Callback_get_leaf_size user_get_size;
Callback_copy_leaf user_copy_leaf;
Callback_restore_leaf user_restore_leaf;
}Scalfmm_Leaf_Descriptor;
/** /**
* @brief This function build the tree. If scalfmm_init has been * @brief This function build the tree. If scalfmm_init has been
...@@ -228,7 +269,10 @@ typedef struct User_Scalfmm_Cell_Descriptor{ ...@@ -228,7 +269,10 @@ typedef struct User_Scalfmm_Cell_Descriptor{
* @param BoxWidth Width of the entire simulation box. * @param BoxWidth Width of the entire simulation box.
* @param BoxCenter Coordinate of the center of the box (ie array) * @param BoxCenter Coordinate of the center of the box (ie array)
*/ */
void scalfmm_build_tree(scalfmm_handle handle,int TreeHeight,double BoxWidth,double* BoxCenter,Scalfmm_Cell_Descriptor user_cell_descriptor); void scalfmm_build_tree(scalfmm_handle handle,int TreeHeight,double BoxWidth,
double* BoxCenter,
Scalfmm_Cell_Descriptor user_cell_descriptor,
Scalfmm_Leaf_Descriptor user_leaf_descriptor);
/** /**
...@@ -488,6 +532,15 @@ typedef void (*Callback_P2M)(void* cellData, void * leafData, FSize nbParticles, ...@@ -488,6 +532,15 @@ typedef void (*Callback_P2M)(void* cellData, void * leafData, FSize nbParticles,
*/ */
typedef void (*Callback_M2M)(int level, void* parentCell, int childPosition, void* childCell, void* userData); typedef void (*Callback_M2M)(int level, void* parentCell, int childPosition, void* childCell, void* userData);
/**
* @brief Function to be filled by user's M2M
* @param level current level in the tree
* @prama parentCell cell to be filled
* @param userData datas specific to the user's kernel
* @param childCell array of cells to be read
*/
typedef void (*Callback_M2M_Full)(int level, void* parentCell, void* childCell[8], void* userData);
/** /**
* @brief Function to be filled by user's M2L * @brief Function to be filled by user's M2L
* @param level current level in the tree * @param level current level in the tree
...@@ -529,6 +582,15 @@ typedef void (*Callback_M2LFull)(int level, void* targetCell, const int * neighb ...@@ -529,6 +582,15 @@ typedef void (*Callback_M2LFull)(int level, void* targetCell, const int * neighb
*/ */
typedef void (*Callback_L2L)(int level, void* parentCell, int childPosition, void* childCell, void* userData); typedef void (*Callback_L2L)(int level, void* parentCell, int childPosition, void* childCell, void* userData);
/**
* @brief Function to be filled by user's L2L
* @param level current level in the tree
* @prama parentCell cell to be filled
* @param userData datas specific to the user's kernel
* @param childCell array of cells to be read
*/
typedef void (*Callback_L2L_Full)(int level, void* parentCell, void* childCell[8], void* userData);
/** /**
* @brief Function to be filled by user's L2P * @brief Function to be filled by user's L2P
* @param cellData cell to be read * @param cellData cell to be read
...@@ -599,6 +661,29 @@ typedef void (*Callback_P2PInner)(void * targetLeaf,FSize nbParticles, const FSi ...@@ -599,6 +661,29 @@ typedef void (*Callback_P2PInner)(void * targetLeaf,FSize nbParticles, const FSi
typedef void (*Callback_P2PSym)(void * targetLeaf, FSize nbParticles, const FSize* particleIndexes, typedef void (*Callback_P2PSym)(void * targetLeaf, FSize nbParticles, const FSize* particleIndexes,
void * sourceLeaf, FSize nbSourceParticles, const FSize* sourceParticleIndexes, void* userData); void * sourceLeaf, FSize nbSourceParticles, const FSize* sourceParticleIndexes, void* userData);
/**
* @brief Function to be filled by user's P2P Remote, the sources will
* be erased after the call, so no need to modify them
* @param targetLeaf ptr to user target leaf
* @param nbParticles number of particle in current leaf
* @param particleIndexes indexes of particles currently computed
* @praram sourceLeaves array of user source target
* @param sourceParticleIndexes array of indexes for each source
* @param sourceNbPart : array containing the number of part for each source
* @param size Number of direct neighbors
* @param userData datas specific to the user's kernel
* @attention This function will be called in distributed scalfmm
* only, between leaves belonging to diffenrent MPI processus. On ly
* the target leaf should be modified, since we don't send back the
* sources.
*/
typedef void (*Callback_P2PRemote)(void * targetLeaf,FSize nbParticles, const FSize* particleIndexes,
void ** sourceLeaves,
const FSize ** sourceParticleIndexes,FSize * sourceNbPart,
const int * sourcePosition, const int size, void* userData);
/** /**
* @brief Function to be filled by user's method to reset a user's cell * @brief Function to be filled by user's method to reset a user's cell
* @param level level of the cell. * @param level level of the cell.
...@@ -618,15 +703,18 @@ typedef void (*Callback_apply_on_cell)(int level, long long morton_index, int* t ...@@ -618,15 +703,18 @@ typedef void (*Callback_apply_on_cell)(int level, long long morton_index, int* t
typedef struct User_Scalfmm_Kernel_Descriptor { typedef struct User_Scalfmm_Kernel_Descriptor {
Callback_P2M p2m; Callback_P2M p2m;
Callback_M2M m2m; Callback_M2M m2m;
Callback_M2M_Full m2m_full;
Callback_M2L m2l; Callback_M2L m2l;
Callback_M2L_Ext m2l_ext; Callback_M2L_Ext m2l_ext;
Callback_M2LFull m2l_full; Callback_M2LFull m2l_full;
Callback_L2L l2l; Callback_L2L l2l;
Callback_L2L_Full l2l_full;
Callback_L2P l2p; Callback_L2P l2p;
Callback_P2P p2p; Callback_P2P p2p;
Callback_P2PFull p2p_full; Callback_P2PFull p2p_full;
Callback_P2PInner p2pinner; Callback_P2PInner p2pinner;
Callback_P2PSym p2p_sym; Callback_P2PSym p2p_sym;
Callback_P2PRemote p2p_remote;
}Scalfmm_Kernel_Descriptor; }Scalfmm_Kernel_Descriptor;
...@@ -662,6 +750,14 @@ void scalfmm_user_kernel_config(scalfmm_handle Handle, Scalfmm_Kernel_Descriptor ...@@ -662,6 +750,14 @@ void scalfmm_user_kernel_config(scalfmm_handle Handle, Scalfmm_Kernel_Descriptor
*/ */
void scalfmm_execute_fmm(scalfmm_handle Handle); void scalfmm_execute_fmm(scalfmm_handle Handle);
/**
* @brief This function launch the fmm on the parameters given, but
* only the far field will be evaluated
* @param Handle scalfmm_handle provided by scalfmm_init
*/
void scalfmm_execute_fmm_far_field(scalfmm_handle Handle);
/** /**
* @brief This function apply the call back on each leaf. Should be * @brief This function apply the call back on each leaf. Should be
* called after insert_parts. * called after insert_parts.
...@@ -758,8 +854,7 @@ scalfmm_handle scalfmm_init_distributed( scalfmm_kernel_type KernelType,scalfmm_ ...@@ -758,8 +854,7 @@ scalfmm_handle scalfmm_init_distributed( scalfmm_kernel_type KernelType,scalfmm_
* once the partitionning done. Can be inserted with no changes. * once the partitionning done. Can be inserted with no changes.
* @param indexesFilled Array that store the global index of each part * @param indexesFilled Array that store the global index of each part
* in the localArrayFilled. * in the localArrayFilled.
* @param stride stride between two attributes inside attr. * @param outputNbPoint number of points dedicated to this proc
* @param attr array of attribute to be distributed alongside the positions.
*/ */
void scalfmm_create_local_partition(scalfmm_handle handle, int nbPoints, double * particleXYZ, double ** localArrayFilled, void scalfmm_create_local_partition(scalfmm_handle handle, int nbPoints, double * particleXYZ, double ** localArrayFilled,
FSize ** indexesFilled, FSize * outputNbPoint); FSize ** indexesFilled, FSize * outputNbPoint);
......
...@@ -83,7 +83,8 @@ public: ...@@ -83,7 +83,8 @@ public:
FScalFMMEngine<FReal>::Algorithm = algo; FScalFMMEngine<FReal>::Algorithm = algo;
} }
void build_tree(int TreeHeight, FReal BoxWidth , FReal * BoxCenter,User_Scalfmm_Cell_Descriptor notUsedHere){ virtual void build_tree(int TreeHeight, FReal BoxWidth , FReal * BoxCenter,
User_Scalfmm_Cell_Descriptor notUsedHere, Scalfmm_Leaf_Descriptor notUsedHereToo){
octree = new OctreeClass(TreeHeight,FMath::Min(3,TreeHeight-1),BoxWidth,FPoint<FReal>(BoxCenter)); octree = new OctreeClass(TreeHeight,FMath::Min(3,TreeHeight-1),BoxWidth,FPoint<FReal>(BoxCenter));
this->matrix = new MatrixKernelClass(); this->matrix = new MatrixKernelClass();
this->kernel = new InterKernel(TreeHeight,BoxWidth,FPoint<FReal>(BoxCenter),matrix); this->kernel = new InterKernel(TreeHeight,BoxWidth,FPoint<FReal>(BoxCenter),matrix);
...@@ -115,12 +116,12 @@ public: ...@@ -115,12 +116,12 @@ public:
}else{ }else{
if(type==SOURCE){ if(type==SOURCE){
for(FSize idPart = 0; idPart<NbPositions ; ++idPart){ for(FSize idPart = 0; idPart<NbPositions ; ++idPart){
octree->insert(FPoint<FReal>(&XYZ[3*idPart]),FParticleTypeSource,idPart); octree->insert(FPoint<FReal>(&XYZ[3*idPart]),FParticleType::FParticleTypeSource,idPart);
}