Commit ed4964b4 authored by berenger-bramas's avatar berenger-bramas

Enable compilation without using Blas and also remove error with ubuntu new compiler.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@272 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 5fb0e43e
......@@ -7,7 +7,7 @@ if(insource)
endif(insource)
# Options
OPTION( SCALFMM_USE_CBLAS "Set to ON to build ScaFMM with BLAS" ON )
OPTION( SCALFMM_USE_CBLAS "Set to ON to build ScaFMM with BLAS" OFF )
OPTION( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" ON )
OPTION( SCALFMM_USE_TRACE "Set to ON to print trace or use itac trace" OFF )
OPTION( SCALFMM_BUILD_TESTS "Set to ON to build fonctionnalities Tests" ON )
......
......@@ -298,10 +298,8 @@ private:
FDEBUG(FTic computationCounter);
FDEBUG(FTic computationCounterP2P);
int countShape[SizeShape];
omp_lock_t lockShape[SizeShape];
for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
countShape[idxShape] = 0;
omp_init_lock(&lockShape[idxShape]);
}
......
......@@ -302,7 +302,6 @@ private:
// I need to send right if I hold leaves that belong to procs on my right
const bool iNeedToSendToRight = correctRightLeavesIndex < currentLeafsOnMyLeft + currentNbLeafs;
int leftProcToStartSend = rank;
if(iNeedToSendToLeft){
FTRACE( FTrace::FRegion regionTrace("Calcul SendToLeft", __FUNCTION__ , __FILE__ , __LINE__) );
// Find the first proc that need my data
......@@ -317,7 +316,6 @@ private:
}
// Count data for this proc
leftProcToStartSend = idxProc;
int ICanGive = int(currentNbLeafs);
leavesToSend[idxProc] = int(FMath::Min(communicator.getOtherRight(totalNbLeaves, idxProc), totalNbLeaves - currentLeafsOnMyRight)
- FMath::Max( currentLeafsOnMyLeft , communicator.getOtherLeft(totalNbLeaves, idxProc)));
......
......@@ -47,7 +47,7 @@ protected:
// Can be FMB_Info_P if user ask to -- if FMB_Info.up_to_P_in_M2L it true
static const int FMB_Info_M2L_P = FMB_Info_up_to_P_in_M2L? FMB_Info_P : 2 * FMB_Info_P;
static const int FMB_Info_M2L_exp_size = ((FMB_Info_M2L_P)+1) * ((FMB_Info_M2L_P)+2) * 0.5;
static const int FMB_Info_M2L_exp_size = int(((FMB_Info_M2L_P)+1) * ((FMB_Info_M2L_P)+2) * 0.5);
// Default value set in main
static const int FMB_Info_ws = 1;
......@@ -58,7 +58,7 @@ protected:
static const int halphSize1Dim = (2*(FMB_Info_ws)+1);
// EXPANSION_SIZE(FMB_Info.P)
static const int FMB_Info_exp_size = ((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5;
static const int FMB_Info_exp_size = int(((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5);
// NEXP_SIZE(FMB_Info.P)
static const int FMB_Info_nexp_size = (FMB_Info_P + 1) * (FMB_Info_P + 1);
......@@ -1226,9 +1226,9 @@ public:
if (th < -M_PI + FMath::Epsilon) th += 2 * FMath::Epsilon;
}
//spherical_position_Set_r
FReal rh = spherical.r;
//FReal rh = spherical.r;
if (spherical.r < 0){
rh = -spherical.r;
//rh = -spherical.r;
//spherical_position_Set_ph(p, M_PI - spherical_position_Get_th(p));
ph = FMath::Fmod(FMath::FPi - th, 2*FMath::FPi);
if (ph > M_PI) ph -= 2*FMath::FPi;
......
......@@ -46,7 +46,7 @@ protected:
// Can be FMB_Info_P if user ask to -- if FMB_Info.up_to_P_in_M2L it true
static const int FMB_Info_M2L_P = FMB_Info_up_to_P_in_M2L? FMB_Info_P : 2 * FMB_Info_P;
static const int FMB_Info_M2L_exp_size = ((FMB_Info_M2L_P)+1) * ((FMB_Info_M2L_P)+2) * 0.5;
static const int FMB_Info_M2L_exp_size = int(((FMB_Info_M2L_P)+1) * ((FMB_Info_M2L_P)+2) * 0.5);
// Default value set in main
static const int FMB_Info_ws = 1;
......@@ -57,7 +57,7 @@ protected:
static const int halphSize1Dim = (2*(FMB_Info_ws)+1);
// EXPANSION_SIZE(FMB_Info.P)
static const int FMB_Info_exp_size = ((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5;
static const int FMB_Info_exp_size = int(((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5);
// NEXP_SIZE(FMB_Info.P)
static const int FMB_Info_nexp_size = (FMB_Info_P + 1) * (FMB_Info_P + 1);
......
......@@ -46,7 +46,7 @@ protected:
// Can be FMB_Info_P if user ask to -- if FMB_Info.up_to_P_in_M2L it true
static const int FMB_Info_M2L_P = FMB_Info_up_to_P_in_M2L? FMB_Info_P : 2 * FMB_Info_P;
static const int FMB_Info_M2L_exp_size = ((FMB_Info_M2L_P)+1) * ((FMB_Info_M2L_P)+2) * 0.5;
static const int FMB_Info_M2L_exp_size = int(((FMB_Info_M2L_P)+1) * ((FMB_Info_M2L_P)+2) * 0.5);
// Default value set in main
static const int FMB_Info_ws = 1;
......@@ -57,7 +57,7 @@ protected:
static const int halphSize1Dim = (2*(FMB_Info_ws)+1);
// EXPANSION_SIZE(FMB_Info.P)
static const int FMB_Info_exp_size = ((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5;
static const int FMB_Info_exp_size = int(((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5);
// NEXP_SIZE(FMB_Info.P)
static const int FMB_Info_nexp_size = (FMB_Info_P + 1) * (FMB_Info_P + 1);
......@@ -1514,9 +1514,9 @@ public:
if (th < -M_PI + FMath::Epsilon) th += 2 * FMath::Epsilon;
}
//spherical_position_Set_r
FReal rh = spherical.r;
//FReal rh = spherical.r;
if (spherical.r < 0){
rh = -spherical.r;
//rh = -spherical.r;
//spherical_position_Set_ph(p, M_PI - spherical_position_Get_th(p));
ph = FMath::Fmod(FMath::FPi - th, 2*FMath::FPi);
if (ph > M_PI) ph -= 2*FMath::FPi;
......
......@@ -11,67 +11,87 @@
#include "FGlobal.hpp"
#ifdef SCALFMM_USE_MKL_AS_BLAS
#include <mkl_cblas.h>
#else
#include <cblas.h>
#endif
#ifdef SCALFMM_USE_CBLAS
///////////////////////////////////////////////////////
// GEMV
///////////////////////////////////////////////////////
#ifdef SCALFMM_USE_MKL_AS_BLAS
#include <mkl_cblas.h>
#else
#include <cblas.h>
#endif
///////////////////////////////////////////////////////
// GEMV
///////////////////////////////////////////////////////
template <typename T>
void cblas_gemv(const CBLAS_ORDER order ,
template <typename T>
void cblas_gemv(const CBLAS_ORDER order ,
const CBLAS_TRANSPOSE TransA , const int M , const int N ,
const void *alpha , const void *A , const int lda ,
const void *X , const int incX , const void *beta ,
void *Y , const int incY){
T t;
t.you_cannot_use_this_function_with_this_type();
}
}
template <>
void cblas_gemv<double>(const CBLAS_ORDER order ,
template <>
void cblas_gemv<double>(const CBLAS_ORDER order ,
const CBLAS_TRANSPOSE TransA , const int M , const int N ,
const void *alpha , const void *A , const int lda ,
const void *X , const int incX , const void *beta ,
void *Y , const int incY){
cblas_zgemv(order,TransA,M,N,alpha,A,lda,X,incX,beta,Y,incY);
}
}
template <>
void cblas_gemv<float>(const CBLAS_ORDER order ,
template <>
void cblas_gemv<float>(const CBLAS_ORDER order ,
const CBLAS_TRANSPOSE TransA , const int M , const int N ,
const void *alpha , const void *A , const int lda ,
const void *X , const int incX , const void *beta ,
void *Y , const int incY){
cblas_cgemv(order,TransA,M,N,alpha,A,lda,X,incX,beta,Y,incY);
}
}
///////////////////////////////////////////////////////
// Dotu
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// Dotu
///////////////////////////////////////////////////////
template <typename T>
void cblas_dotu_sub( const int N , const void *X , const int incX ,
template <typename T>
void cblas_dotu_sub( const int N , const void *X , const int incX ,
const void *Y , const int incY , void *dotu){
T t;
t.you_cannot_use_this_function_with_this_type();
}
}
template <>
void cblas_dotu_sub<double>(const int N , const void *X , const int incX ,
template <>
void cblas_dotu_sub<double>(const int N , const void *X , const int incX ,
const void *Y , const int incY , void *dotu){
cblas_zdotu_sub(N,X,incX,Y,incY,dotu);
}
}
template <>
void cblas_dotu_sub<float>(const int N , const void *X , const int incX ,
template <>
void cblas_dotu_sub<float>(const int N , const void *X , const int incX ,
const void *Y , const int incY , void *dotu){
cblas_cdotu_sub(N,X,incX,Y,incY,dotu);
}
}
#else
enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
enum CBLAS_TRANSPOSE {CblasNoTrans, CblasTrans, CblasConjTrans};
template <typename T>
void cblas_gemv(const CBLAS_ORDER order ,
const CBLAS_TRANSPOSE TransA , const int M , const int N ,
const void *alpha , const void *A , const int lda ,
const void *X , const int incX , const void *beta ,
void *Y , const int incY){
}
template <typename T>
void cblas_dotu_sub( const int N , const void *X , const int incX ,
const void *Y , const int incY , void *dotu){
}
#endif //SCALFMM_USE_CBLAS
#endif //FBLAS_HPP
......@@ -5,7 +5,6 @@
#include <new>
#include <stdexcept>
#include <stdlib.h>
#include <cstdio>
#ifdef SCALFMM_USE_MEM_STATS
void* operator new(std::size_t n) throw(std::bad_alloc);
......
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