Commit 027be94c authored by berenger-bramas's avatar berenger-bramas

Add a debug mode in cmake

clean/refactor tests

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@85 2616d619-271b-44dc-8df4-d4a8f33a7222
parent e96cc656
......@@ -11,6 +11,7 @@ OPTION( SCALFMM_USE_CBLAS "Set to ON to build ScaFMM with BLAS" ON )
OPTION( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" ON )
OPTION( SCALFMM_BUILD_TESTS "Set to ON to build fonctionnalities Tests" ON )
OPTION( SCALFMM_BUILD_UTESTS "Set to ON to build UTests" ON )
OPTION( SCALFMM_BUILD_DEBUG "Set to ON to build in Debug" OFF )
# MPI option has to be set before project
if( SCALFMM_USE_MPI )
......@@ -20,6 +21,12 @@ endif()
# Project Infos
project(scalfmm CXX)
# Debug
MESSAGE( STATUS "SCALFMM_BUILD_DEBUG = ${SCALFMM_BUILD_DEBUG}" )
if( SCALFMM_BUILD_DEBUG )
SET(CMAKE_BUILD_TYPE Debug)
endif()
# Blas option
if( SCALFMM_USE_CBLAS )
OPTION( SCALFMM_USE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
......
......@@ -64,7 +64,7 @@ public:
this->kernels[idxThread] = new KernelClass<ParticleClass, CellClass, OctreeHeight>(*inKernels);
}
FDEBUG(FDebug::Controller << "FFmmAlgorithmThread\n");
FDEBUG(FDebug::Controller << "FFmmAlgorithmThread (Max Thread " << omp_get_max_threads() << ")\n");
}
/** Default destructor */
......
......@@ -100,7 +100,7 @@ public:
this->sendBuffer = new FBufferVector<BufferSize>[nbProcess];
FDEBUG(FDebug::Controller << "FFmmAlgorithmThreadProc\n");
FDEBUG(FDebug::Controller << "Max threads = " << MaxThreads << " .\n");
FDEBUG(FDebug::Controller << "Max threads = " << MaxThreads << ", Procs = " << app.processCount() << ".\n");
}
/** Default destructor */
......
......@@ -116,15 +116,12 @@ int main(int argc, char ** argv){
FFmbKernels<FmbParticle, FmbCell, NbLevels> kernels(loader.getBoxWidth());
//FFmmAlgorithm FFmmAlgorithmThreaded FFmmAlgorithmThread FFmmAlgorithmTask FFmmAlgorithmThreadUs
FFmmAlgorithm<FFmbKernels, FmbParticle, FmbCell, FSimpleLeaf, NbLevels, SizeSubLevels> algo(&tree,&kernels);
FFmmAlgorithmThread<FFmbKernels, FmbParticle, FmbCell, FSimpleLeaf, NbLevels, SizeSubLevels> algo(&tree,&kernels);
algo.execute();
counter.tac();
std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl;
//std::cout << "Foces Sum x = " << kernels.getForcesSum().getX() << " y = " << kernels.getForcesSum().getY() << " z = " << kernels.getForcesSum().getZ() << std::endl;
//std::cout << "Potential = " << kernels.getPotential() << std::endl;
{ // get sum forces&potential
FReal potential = 0;
F3DPosition forces;
......
......@@ -29,6 +29,7 @@
#include "../Src/Files/FFmaLoader.hpp"
//#define VALIDATE_FMM
// With openmp : g++ testFmbAlgorithm.cpp ../Src/Utils/FAssertable.cpp ../Src/Utils/FDebug.cpp ../Src/Utils/FTrace.cpp -lgomp -fopenmp -O2 -o testFmbAlgorithm.exe
......
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