Commit b91611f7 authored by COULAUD Olivier's avatar COULAUD Olivier
parents e28f89c6 38ec2433
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,48 +6,94 @@ extern "C" {
#include "FInterEngine.hpp"
#include "FUserKernelEngine.hpp"
extern "C" scalfmm_handle scalfmm_init(/*int TreeHeight,double BoxWidth,double* BoxCenter, */scalfmm_kernel_type KernelType){
ScalFmmCoreHandle * handle = new ScalFmmCoreHandle();
extern "C" scalfmm_handle scalfmm_init(/*int TreeHeight,double BoxWidth,double* BoxCenter, */scalfmm_kernel_type KernelType,
scalfmm_algorithm algo){
ScalFmmCoreHandle<double> * handle = new ScalFmmCoreHandle<double>();
typedef double FReal;
switch(KernelType){
case 0:
handle->engine = new FUserKernelEngine<FReal>(/*TreeHeight, BoxWidth, BoxCenter, */KernelType);
break;
if(algo == source_target){
case 1:
//TODO typedefs
typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FChebCell<FReal,7> ChebCell;
switch(KernelType){
case 0:
typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FTypedLeaf<FReal,ContainerClass> LeafClass;
typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
typedef FChebSymKernel<FReal,ChebCell,ContainerClass,MatrixKernelClass,7> ChebKernel;
handle->engine = new FUserKernelEngine<FReal,LeafClass>(/*TreeHeight, BoxWidth, BoxCenter, */KernelType);
break;
handle->engine = new FInterEngine<FReal,ChebCell,ChebKernel>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
break;
// case 2:
// //TODO typedefs
// typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
// typedef FUnifCell<7> UnifCell;
case 1:
//TODO typedefs
typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FTypedChebCell<FReal,7> ChebCell;
typedef FTypedLeaf<FReal,ContainerClass> LeafClass;
// typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
// typedef FUnifKernel<UnifCell,ContainerClass,MatrixKernelClass,7> UnifKernel;
typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
typedef FChebSymKernel<FReal,ChebCell,ContainerClass,MatrixKernelClass,7> ChebKernel;
// handle->engine = new FInterEngine<UnifCell,UnifKernel>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
// break;
handle->engine = new FInterEngine<FReal,ChebCell,ChebKernel,LeafClass>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
break;
// case 2:
// //TODO typedefs
// typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
// typedef FUnifCell<7> UnifCell;
default:
std::cout<< "Kernel type unsupported" << std::endl;
exit(0);
break;
// typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
// typedef FUnifKernel<UnifCell,ContainerClass,MatrixKernelClass,7> UnifKernel;
// handle->engine = new FInterEngine<UnifCell,UnifKernel>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
// break;
default:
std::cout<< "Kernel type unsupported" << std::endl;
exit(0);
break;
}
}
else{ //No Source/Targets distinction
switch(KernelType){
case 0:
typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FSimpleLeaf<FReal,ContainerClass> LeafClass;
handle->engine = new FUserKernelEngine<FReal,LeafClass>(/*TreeHeight, BoxWidth, BoxCenter, */KernelType);
break;
case 1:
//TODO typedefs
typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FChebCell<FReal,7> ChebCell;
typedef FSimpleLeaf<FReal,ContainerClass> LeafClass;
typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
typedef FChebSymKernel<FReal,ChebCell,ContainerClass,MatrixKernelClass,7> ChebKernel;
handle->engine = new FInterEngine<FReal,ChebCell,ChebKernel,LeafClass>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
break;
// case 2:
// //TODO typedefs
// typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
// typedef FUnifCell<7> UnifCell;
// typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
// typedef FUnifKernel<UnifCell,ContainerClass,MatrixKernelClass,7> UnifKernel;
// handle->engine = new FInterEngine<UnifCell,UnifKernel>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
// break;
default:
std::cout<< "Kernel type unsupported" << std::endl;
exit(0);
break;
}
}
return handle;
return handle;
}
extern "C" void scalfmm_dealloc_handle(scalfmm_handle handle, Callback_free_cell userDeallocator){
((ScalFmmCoreHandle *) handle)->engine->intern_dealloc_handle(userDeallocator);
delete ((ScalFmmCoreHandle *) handle)->engine ;
delete (ScalFmmCoreHandle *) handle;
((ScalFmmCoreHandle<double> *) handle)->engine->intern_dealloc_handle(userDeallocator);
delete ((ScalFmmCoreHandle<double> *) handle)->engine ;
delete (ScalFmmCoreHandle<double> *) handle;
}
/**
......
This diff is collapsed.
This diff is collapsed.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
//For timing monitoring
#include <time.h>
#include <sys/time.h>
#include "../Src/CScalfmmApi.h"
#include "../../Src/Kernels/Chebyshev/FChebInterface.h"
double getRandom(){
return (random()/(double)(RAND_MAX));
}
void generateSurfacePointOnUnitSphere(int N, double * points){
double u, v, theta, phi, sinPhi ;
//
int j = 0,i=0 ;
for ( i = 0 ; i< N ; ++i, j+=3) {
//
u = getRandom() ; v = getRandom() ;
theta = 2*M_PI*u ;
phi = acos(2*v-1);
sinPhi = sin(phi);
//
points[j] = cos(theta)*sinPhi ;
points[j+1] = sin(theta)*sinPhi ;
points[j+2] = 2*v-1 ;
//
}
}
void generateSurfacePoints(double rayon, double* centre, int nbDePoints, double* points){
generateSurfacePointOnUnitSphere(nbDePoints , points) ;
int j =0,i=0 ;
for ( i = 0 ; i< nbDePoints ; ++i, j+=3) {
points[j] *= rayon + centre[0];
points[j+1] *= rayon + centre[1];
points[j+2] *= rayon + centre[2];
}
}
void generateInsidePoints(double rayon, double*centre, int nbDePoints, double* points){
generateSurfacePointOnUnitSphere(nbDePoints, points);
int j=0;
double u;
for(j=0 ; j<nbDePoints ; ++j){
u = getRandom();
points[j] *= (rayon + centre[0])*u;
points[j+1] *= (rayon + centre[1])*u;
points[j+2] *= (rayon + centre[2])*u;
}
}
void displayPoints(int nbPoints, double * points){
int i = 0;
for(i=0 ; i<nbPoints ; ++i){
printf("%e %e %e \n",points[i*3],points[i*3+1],points[i*3+2]);
}
}
void displayArray(int nbValue, double * array){
int i = 0;
for(i=0 ; i<nbValue ; ++i){
printf("%e \n",array[i]);
}
}
void getNormal(double * positions, double * normeToFill){
int i;
double norme = sqrt(positions[0]*positions[0] + positions[1]*positions[1] + positions[2]*positions[2]);
for(i=0 ; i<3 ; ++i){
normeToFill[i] = positions[i]/norme;
}
printf("Tgt Norme %e - %e - %e\n",
normeToFill[0],
normeToFill[1],
normeToFill[2]);
}
void computeNormalXForces(int nbPoints, double * forcesToRead, double * positionsToRead, double * arrayToFill){
double * currentNormal = malloc(sizeof(double)*3);
int idxPart,i;
for(idxPart = 0 ; idxPart<nbPoints ; ++idxPart){
getNormal(&positionsToRead[idxPart],currentNormal); //get the norme
for(i=0 ; i<3 ; ++i){
arrayToFill[idxPart] += currentNormal[i]*forcesToRead[idxPart+i];
}
}
free(currentNormal);
}
int main(int argc, char ** av){
printf("Start\n");
if(argc<2){
printf("Use : %s nb_part(cible) (optionnal : TreeHeight) \nexiting\n",av[0]);
exit(0);
}
int nbPartTarget= atoi(av[1]);
int treeHeight = 5 ;
if(argc>2){
int treeHeight = atoi(av[2]);
}
double boxWidth = 2.0;
double boxCenter[3];
boxCenter[0] = boxCenter[1] = boxCenter[2] = 0.0;
int i;
//Allocation of the target points
double * targetsXYZ = malloc(sizeof(double)* 3*nbPartTarget);
double * targetsPhiValues = malloc(sizeof(double)* nbPartTarget);
//Memset (au cas ou)
memset(targetsXYZ,0,sizeof(double)*3*nbPartTarget);
memset(targetsPhiValues,0,sizeof(double)*nbPartTarget);
//Fill
for(i=0 ; i<nbPartTarget ; ++i){
targetsPhiValues[i] = -1.0;
}
generateSurfacePoints(1.0,boxCenter,nbPartTarget,targetsXYZ);
printf("Surface points generated \n");
//Allocation of the sources points
int nbPartSource = 10;
double * sourceXYZ = malloc(sizeof(double)* 3*nbPartSource);
double * sourcePhiValues = malloc(sizeof(double)* nbPartSource);
//Set to Zero
memset(sourceXYZ,0,3*sizeof(double)*nbPartSource);
memset(sourcePhiValues,0,sizeof(double)*nbPartSource);
//Fill
for(i=0 ; i<nbPartSource ; ++i){
sourcePhiValues[i] = 1.0;
}
generateInsidePoints(1.0,boxCenter,nbPartSource,sourceXYZ);
//displayPoints(nbPartTarget,targetsXYZ);
printf("Inside points generated \n");
//displayPoints(nbPartSource,sourceXYZ);
//Creation of arrays to store forces
double * arrayOfForces = malloc(sizeof(double )* 3 * (nbPartSource+nbPartTarget));
memset(arrayOfForces,0,sizeof(double)* 3 * (nbPartTarget));
{//Start of computation
//For handling the library
scalfmm_handle handle = scalfmm_init(chebyshev,source_target);
//Struct for ref cheb kernel
struct User_Scalfmm_Cell_Descriptor user_descr;
user_descr.user_init_cell = NULL;
user_descr.user_free_cell = NULL;
//Set algorithm to source target
//scalfmm_algorithm_config(handle,source_target);
//Build the tree
scalfmm_build_tree(handle,treeHeight, boxWidth, boxCenter, user_descr);
//Insert Sources and targets
scalfmm_tree_insert_particles_xyz(handle,nbPartSource,sourceXYZ,SOURCE);
printf("Sources inserted \n");
scalfmm_tree_insert_particles_xyz(handle,nbPartTarget,targetsXYZ,TARGET);
printf("Targets inserted \n");
//Since we inserted first the sources, then sources will get
//indices from 0 to (nbPartSource-1), and targets from
//(nbPartSource) to nbPartSource+nbPartTarget-1).
int * arrayofIndicesSource = malloc(sizeof(int)*nbPartSource);
int * arrayofIndicesTarget = malloc(sizeof(int)*nbPartTarget);
{//Set physical values
//SRC
int idPart;
for(idPart = 0 ; idPart<nbPartSource ; ++idPart){
arrayofIndicesSource[idPart] = idPart;
}
scalfmm_set_physical_values_npart(handle,nbPartSource,arrayofIndicesSource,sourcePhiValues,SOURCE);
//TGT
for(idPart = 0 ; idPart<nbPartTarget ; ++idPart){
arrayofIndicesTarget[idPart] = idPart; // here, we add the number of sources previously inserted
}
scalfmm_set_physical_values_npart(handle,nbPartTarget,arrayofIndicesTarget,targetsPhiValues,TARGET);
}
//Computation
scalfmm_execute_fmm(handle/*, kernel, &my_data*/);
//Get back the forces
scalfmm_get_forces_xyz(handle,nbPartTarget,arrayOfForces,TARGET);
scalfmm_get_forces_xyz(handle,nbPartSource,&arrayOfForces[nbPartTarget],SOURCE);
printf("Forces computed : \n");
displayPoints(nbPartTarget+nbPartSource,arrayOfForces);
printf("As expected, Source forces are 0\n \n");
//Release memory used :
free(arrayofIndicesSource);
free(arrayofIndicesTarget);
scalfmm_dealloc_handle(handle,NULL);
}
{//Let's check the result, we computed fr each target part its forces
//Storage of reference forces
double * arrayRefForces = malloc(sizeof(double)*nbPartTarget*3);
memset(arrayRefForces,0,sizeof(double)*nbPartTarget*3);
int idTgt;
for(idTgt = 0 ; idTgt<nbPartTarget ; ++idTgt){
int idSrc;
double dx,dy,dz;
for(idSrc = 0 ; idSrc<nbPartTarget ; ++idSrc){
//First compute dist.
dx = sourceXYZ[idSrc+0] - targetsXYZ[idTgt+0];
dy = sourceXYZ[idSrc+1] - targetsXYZ[idTgt+1];
dz = sourceXYZ[idSrc+2] - targetsXYZ[idTgt+2];
//Secondly, compute coeff
double coeffs = targetsPhiValues[idTgt] * sourcePhiValues[idSrc];
double one_over_r = 1.0/(sqrt(dx*dx+dy*dy+dz*dz));
double one_over_r3 = one_over_r * one_over_r * one_over_r;
arrayRefForces[idTgt*3+0] += dx*coeffs*one_over_r3;
arrayRefForces[idTgt*3+1] += dy*coeffs*one_over_r3;
arrayRefForces[idTgt*3+2] += dz*coeffs*one_over_r3;
}
}
{//Then, we compare
double errorCumul = 0;
int idArr;
for(idArr = 0 ; idArr<nbPartTarget ; ++idArr){
errorCumul += fabs(arrayRefForces[idArr+0]-arrayOfForces[idArr+0]);
errorCumul += fabs(arrayRefForces[idArr+1]-arrayOfForces[idArr+1]);
errorCumul += fabs(arrayRefForces[idArr+2]-arrayOfForces[idArr+2]);
printf("Directly Computed %e %e %e\n",
arrayRefForces[idArr+0],
arrayRefForces[idArr+1],
arrayRefForces[idArr+2]);
}
printf("Error cumul : %e\n",errorCumul);
}
}
//Part where we apply normal on target's forces vector
//Copying each target's parts forces,
double * targetsForces = malloc(sizeof(double) * 3 * nbPartTarget);
memcpy(targetsForces,arrayOfForces,sizeof(double)*3*nbPartTarget);
double * normeXForces = malloc(sizeof(double) * nbPartTarget);
memset(normeXForces,0,sizeof(double) * nbPartTarget);
computeNormalXForces(nbPartTarget,targetsForces,targetsXYZ,normeXForces);
printf("For each target, we display [Normal To Sphere] . [Force product] \n");
displayArray(nbPartTarget,normeXForces);
//Free memory
free(sourceXYZ);
free(sourcePhiValues);
free(targetsXYZ);
free(targetsPhiValues);
free(arrayOfForces);
return EXIT_SUCCESS;
}
......@@ -70,7 +70,8 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
option( SCALFMM_USE_MIC_NATIVE "Set to ON to compile in native mode for MIC" OFF )
option( SCALFMM_ONLY_DEVEL "Set to ON to compile Development tools (only scalfmm team)" ON )
if( SCALFMM_ONLY_DEVEL )
option( SCALFMM_USE_STARPU "Set to ON to build SCALFMM with StarPU" OFF )
option( SCALFMM_USE_STARPU "Set to ON to build SCALFMM with StarPU" OFF )
option( SCALFMM_BUILD_UTILS "Set to ON to build utils Tests" OFF )
endif()
if( SCALFMM_USE_MPI )
try_compile(COMPILE_INTEL ${CMAKE_CURRENT_BINARY_DIR}
......@@ -653,7 +654,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
# Build tools (Internal use) #
##################################################################
# Build - UTILs
if( SCALFMM_ONLY_DEVEL )
if( SCALFMM_ONLY_DEVEL AND SCALFMM_BUILD_UTILS)
add_subdirectory(Utils)
endif()
......
......@@ -47,6 +47,19 @@
## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model),
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
# C/CXX should be enabled to use Intel mkl
###
# We handle different modes to find the dependency
#
# - Detection if already installed on the system
# - BLAS libraries can be detected from different ways
# Here is the order of precedence:
# 1) we look in cmake variable BLAS_LIBDIR or BLAS_DIR (we guess the libdirs) if defined
# 2) we look in environnement variable BLAS_LIBDIR or BLAS_DIR (we guess the libdirs) if defined
# 3) we look in common environnment variables depending on the system (INCLUDE, C_INCLUDE_PATH, CPATH - LIB, DYLD_LIBRARY_PATH, LD_LIBRARY_PATH)
# 4) we look in common system paths depending on the system, see for example paths contained in the following cmake variables:
# - CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES, CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
# - CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES, CMAKE_C_IMPLICIT_LINK_DIRECTORIES
#
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
......@@ -288,6 +301,10 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
unset(${_prefix}${_combined_name}_WORKS CACHE)
endif()
if (_CHECK_FORTRAN)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
string(REPLACE "mkl_intel_lp64" "mkl_gf_lp64" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
string(REPLACE "mkl_intel_ilp64" "mkl_gf_ilp64" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
endif()
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
else()
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
......@@ -402,8 +419,6 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
# libiomp5
# --------
if (WIN32)
string(REPLACE ":" ";" _libdir "$ENV{LIB}")
elseif (APPLE)
......@@ -413,6 +428,8 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif ()
list(APPEND _libdir "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
# libiomp5
# --------
set(OMP_iomp5_LIBRARY "OMP_iomp5_LIBRARY-NOTFOUND")
find_library(OMP_iomp5_LIBRARY
NAMES iomp5
......@@ -420,15 +437,35 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
)
mark_as_advanced(OMP_iomp5_LIBRARY)
set(OMP_LIB "")
if (OMP_iomp5_LIBRARY)
set(OMP_LIB "${OMP_iomp5_LIBRARY}")
# libgomp
# -------
set(OMP_gomp_LIBRARY "OMP_gomp_LIBRARY-NOTFOUND")
find_library(OMP_gomp_LIBRARY
NAMES gomp
HINTS ${_libdir}
)
mark_as_advanced(OMP_gomp_LIBRARY)
# choose one or another depending on the compilo
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
if (OMP_gomp_LIBRARY)
set(OMP_LIB "${OMP_gomp_LIBRARY}")
endif()
else(CMAKE_C_COMPILER_ID STREQUAL "Intel")
if (OMP_iomp5_LIBRARY)
set(OMP_LIB "${OMP_iomp5_LIBRARY}")
endif()
endif()
if (UNIX AND NOT WIN32)
set(LM "-lm")
set(BLAS_COMPILER_FLAGS "")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT BLA_VENDOR STREQUAL "Intel10_64lp_seq")
list(APPEND BLAS_COMPILER_FLAGS "-openmp")
if (NOT BLA_VENDOR STREQUAL "Intel10_64lp_seq")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list(APPEND BLAS_COMPILER_FLAGS "-openmp")
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_COMPILER_FLAGS "-fopenmp")
endif()
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
if (BLA_VENDOR STREQUAL "Intel10_32")
......@@ -510,8 +547,14 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
# mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core")
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
endif()
endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
......@@ -576,8 +619,14 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core guide")
# mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core")
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_gnu_thread mkl_core")
endif()
endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
......
......@@ -48,6 +48,19 @@
# look for a stand alone cblas, please add the following in your
# CMakeLists.txt before to call find_package(CBLAS):
# set(CBLAS_STANDALONE TRUE)
###
# We handle different modes to find the dependency
#
# - Detection if already installed on the system
# - CBLAS libraries can be detected from different ways
# Here is the order of precedence:
# 1) we look in cmake variable CBLAS_LIBDIR or CBLAS_DIR (we guess the libdirs) if defined
# 2) we look in environnement variable CBLAS_LIBDIR or CBLAS_DIR (we guess the libdirs) if defined
# 3) we look in common environnment variables depending on the system (INCLUDE, C_INCLUDE_PATH, CPATH - LIB, DYLD_LIBRARY_PATH, LD_LIBRARY_PATH)
# 4) we look in common system paths depending on the system, see for example paths contained in the following cmake variables:
# - CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES, CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
# - CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES, CMAKE_C_IMPLICIT_LINK_DIRECTORIES
#
#=============================================================================
# Copyright 2012-2013 Inria
......@@ -80,11 +93,7 @@ endif()
if (CBLAS_FIND_COMPONENTS)
foreach( component ${CBLAS_FIND_COMPONENTS} )
if(CBLAS_FIND_REQUIRED_${component})
if (CBLAS_FIND_REQUIRED)
find_package(${component} REQUIRED)
else()
find_package(${component})
endif()
find_package(${component} REQUIRED)
else()
find_package(${component})
endif()
......
......@@ -205,6 +205,10 @@ if(METIS_LIBRARIES)
set(REQUIRED_LIBDIRS "${METIS_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${METIS_LIBRARIES}")
# m
if(UNIX OR WIN32)
list(APPEND REQUIRED_LIBS "-lm")
endif()
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
......
......@@ -205,6 +205,10 @@ if(PARMETIS_LIBRARIES)
set(REQUIRED_LIBDIRS "${PARMETIS_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${PARMETIS_LIBRARIES}")
# m
if(UNIX OR WIN32)
list(APPEND REQUIRED_LIBS "-lm")
endif()
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
......
......@@ -310,7 +310,12 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND)
set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND")
find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS
NAMES ${starpu_hdr}
HINTS ${_inc_env})
HINTS ${_inc_env}
PATH_SUFFIXES
"starpu/1.0"
"starpu/1.1"
"starpu/1.2"
"starpu/1.3")
endforeach()
endif()
endif()
......
......@@ -111,12 +111,14 @@ int main(int argc, char ** argv){
FParameterDefinitions::NbParticles,FParameterDefinitions::OutputVisuFile,LocalOptionEllipsoid);
typedef double FReal;
FReal extraRadius = 0.000 ;
FReal extraRadius = 0.000 ;
const FSize NbPoints = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, FSize(20000));
const std::string genericFileName(FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "unifPointDist"));
FReal BoxWith = 0.0;
const std::string genericFileName(FParameters::getStr(argc,argv,FParameterDefinitions::OutputFile.options, "unifPointDist"));
FReal BoxWith = 0.0;
FPoint<FReal> Centre(0.0, 0.0,0.0);
//
// Allocation
......
This diff is collapsed.
// ==== CMAKE ====
// Keep in private GIT
// @SCALFMM_PRIVATE
#ifndef _FCOORDCOLOUR_HPP_
#define _FCOORDCOLOUR_HPP_
class FCoordColour {
public:
enum {range = 3*3*3};
static int coord2colour(const FTreeCoordinate& coord) {
return (coord.getX() % 3) * 9
+ (coord.getY() % 3) * 3
+ (coord.getZ() % 3);
}
};
#endif
// ==== CMAKE ====
// Keep in private GIT
// @SCALFMM_PRIVATE
#ifndef _FCOSTCELL_HPP_
#define _FCOSTCELL_HPP_
#include <type_traits>
/**
* \brief Empty trait class.
* \author Quentin Khan
*
* This class is used to check whether a cell class has FCostCell in its
* inheritance tree.
*/
class FCostCellTypeTrait {};
/**
* \brief Cell with a cost memory for balance computations.