Commit c1b1b17a authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille
parents 9645f7a6 0b35fdcc
......@@ -91,20 +91,12 @@ void Scalfmm_execute_kernel(Scalfmm_Handle handle, struct Scalfmm_Kernel_Descrip
///////////////////////////////////////////////////////////////////////////
//< This function fill the childFullPosition[3] with [0;1] to know the position of a child relatively to
//< its position from its parent
inline void Scalfmm_utils_parentChildPosition(int childPosition, int* childFullPosition){
childFullPosition[2] = (childPosition%2 ? 1 : -1);
childFullPosition[1] = ((childPosition/2)%2 ? 1 : -1);
childFullPosition[0] = ((childPosition/4)%2 ? 1 : -1);
}
//< This function fill the childFullPosition[3] with [-1;1] to know the position of a child relatively to
//< its position from its parent in term of halph box for this level
void Scalfmm_utils_parentChildPosition(int childPosition, int* childFullPosition);
//< This function fill the childFullPosition[3] with [-3;3] to know the position of a interaction
//< cell relatively to its position from the target
inline void Scalfmm_utils_interactionPosition(int interactionPosition, int* srcPosition){
srcPosition[2] = interactionPosition%7 - 3;
srcPosition[1] = (interactionPosition/7)%7 - 3;
srcPosition[0] = (interactionPosition/49)%7 - 3;
}
//< cell relatively to its position from the target in term of box
void Scalfmm_utils_interactionPosition(int interactionPosition, int* srcPosition);
#endif // CKERNELAPI_H
......@@ -250,6 +250,20 @@ extern "C" void Scalfmm_execute_kernel(Scalfmm_Handle handle, struct Scalfmm_Ker
algorithm.execute();
}
//< This function fill the childFullPosition[3] with [-1;1] to know the position of a child relatively to
//< its position from its parent
extern "C" void Scalfmm_utils_parentChildPosition(int childPosition, int* childFullPosition){
childFullPosition[2] = (childPosition%2 ? 1 : -1);
childFullPosition[1] = ((childPosition/2)%2 ? 1 : -1);
childFullPosition[0] = ((childPosition/4)%2 ? 1 : -1);
}
//< This function fill the childFullPosition[3] with [-3;3] to know the position of a interaction
//< cell relatively to its position from the target
extern "C" void Scalfmm_utils_interactionPosition(int interactionPosition, int* srcPosition){
srcPosition[2] = interactionPosition%7 - 3;
srcPosition[1] = (interactionPosition/7)%7 - 3;
srcPosition[0] = (interactionPosition/49)%7 - 3;
}
......@@ -26,29 +26,29 @@
////////////////////// Opérateurs FMM Kernel : //////////////////////////
class KernelCell : public FBasicCell {
FComplexe* multipole;
FComplexe* local;
FComplex* multipole;
FComplex* local;
public:
KernelCell() : multipole(nullptr), local(nullptr){
}
void attachArrays(FComplexe inMultipole[], FComplexe inLocal[]){
void attachArrays(FComplex inMultipole[], FComplex inLocal[]){
multipole = inMultipole;
local = inLocal;
}
const FComplexe* getMultipole() const{
const FComplex* getMultipole() const{
return multipole;
}
const FComplexe* getLocal() const{
const FComplex* getLocal() const{
return local;
}
FComplexe* getMultipole(){
FComplex* getMultipole(){
return multipole;
}
FComplexe* getLocal(){
FComplex* getLocal(){
return local;
}
};
......@@ -184,12 +184,12 @@ int FmmKernel_getParameter(void *fmmKernel, int name, void*value){
/****** Données FMM : *****/
int FmmKernel_getMultipoleArraySize(void */*fmmCore*/, int *size) {
*size = ((P+2)*(P+1))/2 * sizeof(FComplexe);
*size = ((P+2)*(P+1))/2 * sizeof(FComplex);
return FMMAPI_NO_ERROR;
} /* Renvoie dans size la taille (en octets) de l'expansion multipôle associée à la boîte boxId */
int FmmKernel_getLocalArraySize(void */*fmmCore*/, int *size){
*size = ((P+2)*(P+1))/2 * sizeof(FComplexe);
*size = ((P+2)*(P+1))/2 * sizeof(FComplex);
return FMMAPI_NO_ERROR;
} /* Renvoie dans size la taille (en octets) de l'expansion locale associée à la boîte boxId*/
......@@ -201,7 +201,7 @@ int FmmKernel_P2M(void *fmmCore, void* boxId){
int threadId;
FmmCore_getParameter(fmmCore, FMMCORE_THREAD_ID, &threadId);
FComplexe* multipole;
FComplex* multipole;
FmmCore_getMultipoleArray(fmmCore, boxId, (void**)&multipole);
KernelCellClass cell;
......@@ -233,7 +233,7 @@ int FmmKernel_L2P(void *fmmCore, void* boxId){
int threadId;
FmmCore_getParameter(fmmCore, FMMCORE_THREAD_ID, &threadId);
FComplexe* local;
FComplex* local;
FmmCore_getLocalArray(fmmCore, boxId, (void**)&local);
KernelCellClass cell;
......@@ -286,7 +286,7 @@ int FmmKernel_M2M(void *fmmCore, void *boxIdFather, void *boxIdSon){
int threadId;
FmmCore_getParameter(fmmCore, FMMCORE_THREAD_ID, &threadId);
FComplexe* multipole;
FComplex* multipole;
FmmCore_getMultipoleArray(fmmCore, boxIdFather, (void**)&multipole);
KernelCellClass cellFather;
......@@ -322,7 +322,7 @@ int FmmKernel_L2L(void *fmmCore, void *boxIdFather, void *boxIdSon){
int threadId;
FmmCore_getParameter(fmmCore, FMMCORE_THREAD_ID, &threadId);
FComplexe* local;
FComplex* local;
FmmCore_getLocalArray(fmmCore, boxIdFather, (void**)&local);
KernelCellClass cellFather;
......@@ -358,7 +358,7 @@ int FmmKernel_M2L(void *fmmCore, void *boxIdSrc, void *boxIdDest){
int threadId;
FmmCore_getParameter(fmmCore, FMMCORE_THREAD_ID, &threadId);
FComplexe* multipole;
FComplex* multipole;
FmmCore_getMultipoleArray(fmmCore, boxIdSrc, (void**)&multipole);
KernelCellClass cellSrc;
cellSrc.attachArrays(multipole,nullptr);
......@@ -366,7 +366,7 @@ int FmmKernel_M2L(void *fmmCore, void *boxIdSrc, void *boxIdDest){
FmmCore_getCoord(fmmCore, boxIdSrc, coord);
cellSrc.setCoordinate(coord[0], coord[1], coord[2]);
FComplexe* local;
FComplex* local;
FmmCore_getLocalArray(fmmCore, boxIdDest, (void**)&local);
KernelCellClass cellDst;
cellDst.attachArrays(nullptr, local);
......
......@@ -43,7 +43,11 @@ MESSAGE(STATUS " CXX ${CMAKE_CXX_COMPILER_ID}" )
#
# Options
OPTION( ScalFMM_USE_BLAS "Set to ON to build ScaFMM with BLAS" OFF )
if( ScalFMM_ONLY_DEVEL )
OPTION( ScalFMM_USE_FFT "Set to ON to build ScaFMM with FFTW" OFF )
ELSE()
SET(ScalFMM_USE_FFT OFF)
endif()
OPTION( ScalFMM_BUILD_TESTS "Set to ON to build functionalities Tests" OFF )
OPTION( ScalFMM_BUILD_UTESTS "Set to ON to build UTests" OFF )
OPTION( ScalFMM_BUILD_DEBUG "Set to ON to build in Debug" OFF )
......@@ -57,6 +61,7 @@ OPTION( ScalFMM_USE_AVX "Set to ON to compile with AVX support"
OPTION( ScalFMM_USE_ASSERT "Set to ON to enable safe tests during execution" ON )
OPTION( ScalFMM_USE_MIC_NATIVE "Set to ON to compile in native mode for MIC" OFF )
OPTION( ScalFMM_BUILD_ONLY_LIB "Set to ON to compile only the lib (examples are not compiled) " OFF )
OPTION( ScalFMM_ONLY_DEVEL "Set to ON to compile Development tools (only scalfmm team)" OFF )
# Set scalfmm to default libraries
SET(SCALFMM_LIBRARIES "")
SET(ScaLFMM_CXX_FLAGS "")
......@@ -139,7 +144,6 @@ else()
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -ip -no-prec-div -no-prec-sqrt")
ENDIF()
# Compile optimization
IF( APPLE )
SET(SCALFMM_FLAGS_OPTI_RELEASE "-m64 -funroll-loops" CACHE STRING "Set your optimization flags for release mode.")
......@@ -171,9 +175,14 @@ endif(ScalFMM_ATTACHE_SOURCE)
if( ScalFMM_USE_BLAS )
OPTION( ScalFMM_USE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
if( ScalFMM_USE_MKL_AS_BLAS )
SET(BLAS_LIBRARIES
"-L$ENV{MKLROOT}/lib;-lmkl_intel_lp64;-lmkl_sequential;-lmkl_core" CACHE STRING "Set your MKL flags")
SET(LAPACK_LIBRARIES "")
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
SET(BLAS_LIBRARIES "-mkl=sequential" CACHE STRING "Set your MKL flags")
else()
SET(BLAS_LIBRARIES
"-L$ENV{MKLROOT}/lib;-lmkl_intel_lp64;-lmkl_sequential;-lmkl_core" CACHE STRING "Set your MKL flags")
ENDIF()
UNSET(LAPACK_LIBRARIES)
SET(BLASLAPACK_LIBRARIES ${BLAS_LIBRARIES})
elseif(ScalFMM_USE_EXTERNAL_BLAS)
MESSAGE(STATUS "BLAS SET BY EXTERNAL PROGRAM = ${BLAS_LIBRARIES}")
else()
......@@ -182,24 +191,35 @@ if( ScalFMM_USE_BLAS )
MESSAGE(FATAL_ERROR : "NO BLAS LIBRARY FOUND")
endif()
INCLUDE(FindLAPACK)
SET(BLASLAPACK_LIBRARIES "${BLAS_LIBRARIES};${LAPACK_LIBRARIES}")
endif()
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${BLAS_LIBRARIES};${LAPACK_LIBRARIES}")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${BLASLAPACK_LIBRARIES}")
MESSAGE(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
endif(ScalFMM_USE_BLAS)
#
# FFT option
#
if( ScalFMM_USE_FFT )
OPTION( ScalFMM_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" OFF )
if( ScalFMM_USE_MKL_AS_FFTW )
SET(FFT_LIBRARIES "-L$ENV{MKLROOT}/lib; -lmkl_intel_lp64; -lmkl_sequential; -lmkl_core; -lpthread; -lm" CACHE STRING "Set your MKL flags")
SET(FFT_INCLUDES "$ENV{MKLROOT}/include/fftw" CACHE STRING "Set your MKL flags")
if( ScalFMM_USE_MKL_AS_BLAS )
UNSET(FFT_LIBRARIES CACHE)
# UNSET(FFT_INCLUDES CACHE)
SET(FFT_INCLUDES "$ENV{MKLROOT}/include/fftw" CACHE STRING "Set your MKL flags")
ELSE()
SET(FFT_LIBRARIES "-L$ENV{MKLROOT}/lib; -lmkl_intel_lp64; -lmkl_sequential; -lmkl_core; -lpthread; -lm" CACHE STRING "Set your MKL flags")
SET(FFT_INCLUDES "$ENV{MKLROOT}/include/fftw" CACHE STRING "Set your MKL flags")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${FFT_LIBRARIES}")
ENDIF()
else()
SET(FFT_LIBRARIES "-lfftw3" CACHE STRING "Use LIBFFTW")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${FFT_LIBRARIES}")
endif()
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${FFT_LIBRARIES}")
SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${FFT_INCLUDES}")
MESSAGE(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
MESSAGE(STATUS "SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
endif(ScalFMM_USE_FFT)
# Compile option
......@@ -318,12 +338,20 @@ add_subdirectory(Src)
set(scalfmm_lib scalfmm)
#
##################################################################
# Remove compilation of the drivers #
# Remove compilation of the drivers #
##################################################################
if( NOT ScalFMM_BUILD_ONLY_LIB )
# Build - Examples and drivers
add_subdirectory(Examples)
endif()
##################################################################
# Build tools (Internal use) #
##################################################################
# Build - UTILs
if( ScalFMM_ONLY_DEVEL )
#if( NOT ScalFMM_BUILD_ONLY_LIB )
add_subdirectory(Utils)
endif()
##################################################################
# Build -Tests to see examples #
......@@ -397,7 +425,6 @@ INSTALL(FILES
# build a CPack driven installer package #
# #
##################################################################
INCLUDE(CPack)
#
# Use git commit number as CPACK_PACKAGE_VERSION_PATCH
set(CPACK_PACKAGE_VERSION_PATCH 0)
......@@ -406,18 +433,24 @@ execute_process(
OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
RESULT_VARIABLE RET
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
# STRING_TRIM(PATCH1 PATCH)
)
#STRING_TRIM(PATCH1 PATCH)
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "ON")
#
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Licence.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${ScalFMM_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_NINOR "${ScalFMM_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${ScalFMM_MINOR_VERSION}")
#
SET(PACK_PACKAGE_VERSION "${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ScalFMM-${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_IGNORE_FILES "\\\\.git;.DS_Store;.*~;/*.aux;/*.idx;/*.log;/*.out;/*.toc;/*.ilg;/*.ind;scalfmm.pro*;org.eclipse.core.resources.prefs;.cproject;.project")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/Utils/;Notes;Deprecated;Build*,noDist" )
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/Utils/;Notes;Deprecated;Build*;noDist;Bench;ToRemove;Olivier;tages;Uniform;GroupTree;Adaptive;testUnif*;/*Lagrange*")
#LIST(APPEND CPACK_SOURCE_IGNORE_FILES "Stages;Uniform;Adaptive;testUnif*;*Lagrange*" )
#
INCLUDE(CPack)
#
#
##################################################################
# #
# PRINT MESSAGES #
......
......@@ -50,7 +50,7 @@
* <li> ScalFMM_ATTACHE_SOURCE : to build with -g </li>
* <li> SScalFMM_BUILD_TESTS : to build the text and the examples </li>
* <li> ScalFMM_BUILD_UTESTS : to build the unit tests </li>
* <li> SScalFMM_USE_ADDONS : to activate add ons </li>
* <li> ScalFMM_USE_ADDONS : to activate add ons </li>
* <ul>
* <li> SCALFMM_ADDON_FMMAPI : to build Fmm Api </li>
* </ul>
......
......@@ -49,6 +49,18 @@
* If you want to cite the project and/or the team, please contact
* us. See \ref contacts page.
*
*
* \subsection Publications
* <ul>
* <li>Task-based FMM for heterogeneous architectures, Emmanuel Agullo; Berenger Bramas; Olivier Coulaud,;Eric Darve; Matthias Messner; Toru Takahashi, Inria Research Report, 2014, pp. 29. <a href="http://hal.inria.fr/docs/00/97/46/74/PDF/RR-8513.pdf">RR-8513</a>
* <li> Task-Based FMM for Multicore Architectures, Emmanuel Agullo; Berenger Bramas; Olivier Coulaud , Eric Darve; Matthias Messner; Toru Takahashi SIAM Journal on Scientific Computing, SIAM, 2014, 36 (1), pp. 66-93
DOI : <a href="http://epubs.siam.org/doi/abs/10.1137/130915662"> 10.1137/130915662</a></li>
* <li>Optimized M2L Kernels for the Chebyshev Interpolation based Fast Multipole Method, Matthias Messner; Berenger Bramas; Olivier Coulaud ; Eric Darve
<a href="http://hal.inria.fr/docs/00/75/39/34/PDF/main.pdf">Research Report</a>, 2012</li>
* <li>Pipelining the Fast Multipole Method over a Runtime System, Emmanuel Agullo; Berenger Bramas; Olivier Coulaud ; Eric Darve ; Matthias Messner; Toru Takahashi, 2012, pp. 24. <a href="http://hal.inria.fr/hal-00703130/PDF/RR-7981.pdf">RR-7981</a>
*
* </ul>
*
*/
......
......@@ -19,6 +19,8 @@ file(
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/Src
${CMAKE_SOURCE_DIR}/Src
${SCALFMM_INCLUDES}
)
......
......@@ -35,6 +35,8 @@ target_link_libraries(
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/Src
${CMAKE_BINARY_DIR}/Src
${SCALFMM_INCLUDES}
)
......
......@@ -208,9 +208,9 @@ struct FInterpMatrixKernelRH :FInterpMatrixKernelR{
block[0] = one_over_rL;
blockDerivative[0] = LX * one_over_rL3 * diffx;
blockDerivative[1] = LY * one_over_rL3 * diffy;
blockDerivative[2] = LZ * one_over_rL3 * diffz;
blockDerivative[0] = FMath::ConvertTo<ValueClass,FReal>(LX) * one_over_rL3 * diffx;
blockDerivative[1] = FMath::ConvertTo<ValueClass,FReal>(LY)* one_over_rL3 * diffy;
blockDerivative[2] = FMath::ConvertTo<ValueClass,FReal>(LZ)* one_over_rL3 * diffz;
}
......
......@@ -47,7 +47,7 @@
#include "Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "Kernels/Uniform/FUnifCell.hpp"
#include "Adaptive/FAdaptUnifKernel.hpp"
#include "Adaptive/FAdaptTools.hpp"
//#include "Adaptive/FAdaptTools.hpp"
//
//
#include "Core/FFmmAlgorithm.hpp"
......
......@@ -41,7 +41,7 @@
#include "../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
/*
In this test we compare the Chebyshev fmm results and the direct results.
In this test we compare the Chebyshev FMM results and the direct results.
*/
......@@ -310,7 +310,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
/** set test */
void SetTests(){
AddTest(&TestChebyshevDirect::TestChebKernel,"Test Chebyshev Kernel with one big SVD") ;
// AddTest(&TestChebyshevDirect::TestChebKernel,"Test Chebyshev Kernel with one big SVD") ;
AddTest(&TestChebyshevDirect::TestChebSymKernel,"Test Chebyshev Kernel with 16 small SVDs and symmetries");
}
};
......
//
#include "Utils/FParameters.hpp"
#include "Kernels/Chebyshev/FChebCell.hpp"
int main(int argc, char ** argv){
}
......@@ -73,8 +73,12 @@ class TestBlock : public FUTester<TestBlock> {
alloc.deleteObject(dl2);
}
for(int idx = 0 ; idx < NbAlloc ; ++idx){
for(int idxval = 0 ; idxval < SizeArray ; ++idxval){
// Just put on volatile to avoid loop unrolling (which leads to a bug with my gcc!)
volatile int volSizeArray = SizeArray;
volatile int volNbAlloc = NbAlloc;
for(int idx = 0 ; idx < volNbAlloc ; ++idx){
for(int idxval = 0 ; idxval < volSizeArray ; ++idxval){
ptr[idx]->array[idxval] += (idxval * idx);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment