Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b4a8b59a authored by Olivier COULAUD's avatar Olivier COULAUD
Browse files

Fix compilotion error with Intel

parent 41ecd20c
No related branches found
No related tags found
No related merge requests found
...@@ -109,9 +109,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/ ...@@ -109,9 +109,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
option( OPENMP_SUPPORT_PRIORITY "Set to ON to enable tasks priority (KSTAR/StarPU compiler only)" OFF ) option( OPENMP_SUPPORT_PRIORITY "Set to ON to enable tasks priority (KSTAR/StarPU compiler only)" OFF )
option( OPENMP_SUPPORT_TASK_NAME "Set to ON to enable a taskname clause for tasks (KSTAR/StarPU compiler only)" OFF ) option( OPENMP_SUPPORT_TASK_NAME "Set to ON to enable a taskname clause for tasks (KSTAR/StarPU compiler only)" OFF )
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
option( SCALFMM_DISABLE_NATIVE_OMP4 "Set to ON to disable the gcc/intel omp4" OFF ) option( SCALFMM_USE_OMP4 "Set to ON to disable the gcc/intel omp4" OFF )
else() else()
option( SCALFMM_DISABLE_NATIVE_OMP4 "Set to ON to disable the gcc/intel omp4" ON ) option( SCALFMM_USE_OMP4 "Set to ON to disable the gcc/intel omp4" ON )
endif() endif()
option( SCALFMM_TIME_OMPTASKS "Set to ON to time omp4 tasks and generate output file" OFF ) option( SCALFMM_TIME_OMPTASKS "Set to ON to time omp4 tasks and generate output file" OFF )
# SIMGRID and peformance models options # SIMGRID and peformance models options
...@@ -616,6 +616,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/ ...@@ -616,6 +616,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
list(APPEND FUSE_LIST "STARPU") list(APPEND FUSE_LIST "STARPU")
list(APPEND FUSE_LIST "CUDA") list(APPEND FUSE_LIST "CUDA")
list(APPEND FUSE_LIST "OPENCL") list(APPEND FUSE_LIST "OPENCL")
list(APPEND FUSE_LIST "OMP4")
################################################################## ##################################################################
# Use SSE # # Use SSE #
...@@ -959,6 +960,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/ ...@@ -959,6 +960,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
message(STATUS "SCALFMM_CXX_FLAGS = ${SCALFMM_CXX_FLAGS}") message(STATUS "SCALFMM_CXX_FLAGS = ${SCALFMM_CXX_FLAGS}")
message(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}") message(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
message(STATUS "SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}") message(STATUS "SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
message(STATUS "FUSE_LIST = ${FUSE_LIST}")
# #
################################################################## ##################################################################
# END # # END #
......
...@@ -27,18 +27,18 @@ SET(SCALFMM_BUILD_TYPE "@CMAKE_BUILD_TYPE@") ...@@ -27,18 +27,18 @@ SET(SCALFMM_BUILD_TYPE "@CMAKE_BUILD_TYPE@")
# #
# SCALFMM Options # SCALFMM Options
# #
SET(SCALFMM_USE_ADDONS "@SCALFMM_USE_ADDONS@")
SET(SCALFMM_USE_MPI "@SCALFMM_USE_MPI@") SET(SCALFMM_USE_MPI "@SCALFMM_USE_MPI@")
SET(SCALFMM_USE_BLAS "@SCALFMM_USE_BLAS@") SET(SCALFMM_USE_BLAS "@SCALFMM_USE_BLAS@")
SET(SCALFMM_USE_FFT "@SCALFMM_USE_FFT@") SET(SCALFMM_USE_FFT "@SCALFMM_USE_FFT@")
SET(SCALFMM_USE_MKL "@SCALFMM_USE_MKL_AS_BLAS@") SET(SCALFMM_USE_MKL "@SCALFMM_USE_MKL_AS_BLAS@")
SET(SCALFMM_USE_MEM_STATS "@SCALFMM_USE_MEM_STATS@")
SET(SCALFMM_USE_SSE "@SCALFMM_USE_SSE@")
SET(SCALFMM_FLAGS "@SCALFMM_FLAGS_OPTI@") SET(SCALFMM_FLAGS "@SCALFMM_FLAGS_OPTI@")
SET(SCALFMM_USE_ADDONS "@SCALFMM_USE_ADDONS@") SET(SCALFMM_USE_MEM_STATS "@SCALFMM_USE_MEM_STATS@")
SET(SCALFMM_USE_LOG "@SCALFMM_USE_LOG@") SET(SCALFMM_USE_LOG "@SCALFMM_USE_LOG@")
SET(SCALFMM_USE_OMP4 "@SCALFMM_USE_OMP4@")
SET(SCALFMM_USE_STARPU "@SCALFMM_USE_STARPU@") SET(SCALFMM_USE_STARPU "@SCALFMM_USE_STARPU@")
SET(SCALFMM_USE_SSE "@SCALFMM_USE_SSE@") SET(SCALFMM_USE_SSE "@SCALFMM_USE_SSE@")
SET(SCALFMM_USE_AVX "@SCALFMM_USE_AVX@") SET(SCALFMM_USE_AVX "@SCALFMM_USE_AVX@")
# #
SET(SCALFMM_DOC_TAGS "@CMAKE_BINARY_DIR@/Doc/scalfmm.tag") SET(SCALFMM_DOC_TAGS "@CMAKE_BINARY_DIR@/Doc/scalfmm.tag")
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
// ==== CMAKE ===== // ==== CMAKE =====
// @FUSE_BLAS // @FUSE_BLAS
// @FUSE_OMP4
// ================ // ================
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// "http://www.gnu.org/licenses". // "http://www.gnu.org/licenses".
// =================================================================================== // ===================================================================================
// @SCALFMM_PRIVATE // @ SCALFMM_PRIVATE
// @FUSE_OMP4 // @FUSE_OMP4
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
// Run FMM computation // Run FMM computation
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
Print("Fmm..."); Print("Fmm...");
std::unique_ptr<KernelClass> kernels(GetKernelFunc(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel)); std::unique_ptr<KernelClass> kernels(GetKernelFunc(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel));
FmmClass algo(&tree,kernels.get()); FmmClass algo(&tree,kernels.get());
algo.execute(); algo.execute();
// //
...@@ -118,12 +118,12 @@ public: ...@@ -118,12 +118,12 @@ public:
tree.forEachLeaf([&](LeafClass* leaf){ tree.forEachLeaf([&](LeafClass* leaf){
const FReal*const potentials = leaf->getTargets()->getPotentials(); const FReal*const potentials = leaf->getTargets()->getPotentials();
const FReal*const physicalValues = leaf->getTargets()->getPhysicalValues(); const FReal*const physicalValues = leaf->getTargets()->getPhysicalValues();
const FReal*const forcesX = leaf->getTargets()->getForcesX(); const FReal*const forcesX = leaf->getTargets()->getForcesX();
const FReal*const forcesY = leaf->getTargets()->getForcesY(); const FReal*const forcesY = leaf->getTargets()->getForcesY();
const FReal*const forcesZ = leaf->getTargets()->getForcesZ(); const FReal*const forcesZ = leaf->getTargets()->getForcesZ();
const FSize nbParticlesInLeaf = leaf->getTargets()->getNbParticles(); const FSize nbParticlesInLeaf = leaf->getTargets()->getNbParticles();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes(); const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
for(FSize idxPart = 0 ; idxPart < nbParticlesInLeaf ; ++idxPart){ for(FSize idxPart = 0 ; idxPart < nbParticlesInLeaf ; ++idxPart){
const FSize indexPartOrig = indexes[idxPart]; const FSize indexPartOrig = indexes[idxPart];
......
...@@ -34,65 +34,65 @@ ...@@ -34,65 +34,65 @@
#include "Kernels/P2P/FP2PParticleContainerIndexed.hpp" #include "Kernels/P2P/FP2PParticleContainerIndexed.hpp"
/* /*
In this test we compare the Chebyschev fmm results and the direct results. In this test we compare the Chebyschev fmm results and the direct results.
*/ */
/** the test class /** the test class
* *
*/ */
class TestChebyshevDirect : public FUKernelTester<TestChebyshevDirect> { class TestChebyshevDirect : public FUKernelTester<TestChebyshevDirect> {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Set the tests! // Set the tests!
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
/** TestChebKernel */ /** TestChebKernel */
void TestChebKernel(){ void TestChebKernel(){
typedef double FReal; typedef double FReal;
const unsigned int ORDER = 6; const unsigned int ORDER = 6;
typedef FP2PParticleContainerIndexed<FReal> ContainerClass; typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FSimpleLeaf<FReal, ContainerClass> LeafClass; typedef FSimpleLeaf<FReal, ContainerClass> LeafClass;
typedef FInterpMatrixKernelR<FReal> MatrixKernelClass; typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
typedef FChebCell<FReal,ORDER> CellClass; typedef FChebCell<FReal,ORDER> CellClass;
typedef FOctree<FReal, CellClass,ContainerClass,LeafClass> OctreeClass; typedef FOctree<FReal, CellClass,ContainerClass,LeafClass> OctreeClass;
typedef FChebKernel<FReal,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass; typedef FChebKernel<FReal,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass; typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// run test // run test
RunTest<FReal,CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>( RunTest<FReal,CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>(
[&](int NbLevels, FReal boxWidth, FPoint<FReal> centerOfBox, const MatrixKernelClass *const MatrixKernel){ [&](int NbLevels, FReal boxWidth, FPoint<FReal> centerOfBox, const MatrixKernelClass *const MatrixKernel){
return std::unique_ptr<KernelClass>(new KernelClass(NbLevels, boxWidth, centerOfBox, MatrixKernel)); return std::unique_ptr<KernelClass>(new KernelClass(NbLevels, boxWidth, centerOfBox, MatrixKernel));
}); });
} }
/** TestChebSymKernel */ /** TestChebSymKernel */
void TestChebSymKernel(){ void TestChebSymKernel(){
typedef double FReal; typedef double FReal;
const unsigned int ORDER = 6; const unsigned int ORDER = 6;
typedef FP2PParticleContainerIndexed<FReal> ContainerClass; typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FSimpleLeaf<FReal, ContainerClass> LeafClass; typedef FSimpleLeaf<FReal, ContainerClass> LeafClass;
typedef FInterpMatrixKernelR<FReal> MatrixKernelClass; typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
typedef FChebCell<FReal,ORDER> CellClass; typedef FChebCell<FReal,ORDER> CellClass;
typedef FOctree<FReal, CellClass,ContainerClass,LeafClass> OctreeClass; typedef FOctree<FReal, CellClass,ContainerClass,LeafClass> OctreeClass;
typedef FChebSymKernel<FReal,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass; typedef FChebSymKernel<FReal,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass; typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// run test // run test
RunTest<FReal,CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>( RunTest<FReal,CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>(
[&](int NbLevels, FReal boxWidth, FPoint<FReal> centerOfBox, const MatrixKernelClass *const MatrixKernel){ [&](int NbLevels, FReal boxWidth, FPoint<FReal> centerOfBox, const MatrixKernelClass *const MatrixKernel){
return std::unique_ptr<KernelClass>(new KernelClass(NbLevels, boxWidth, centerOfBox, MatrixKernel)); return std::unique_ptr<KernelClass>(new KernelClass(NbLevels, boxWidth, centerOfBox, MatrixKernel));
}); });
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Set the tests! // Set the tests!
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
/** set test */ /** set test */
void SetTests(){ 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"); AddTest(&TestChebyshevDirect::TestChebSymKernel,"Test Chebyshev Kernel with 16 small SVDs and symmetries");
} }
}; };
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "Kernels/P2P/FP2PParticleContainerIndexed.hpp" #include "Kernels/P2P/FP2PParticleContainerIndexed.hpp"
/* /*
In this test we compare the TestLagrange fmm results with the direct results. In this test we compare the TestLagrange fmm results with the direct results.
*/ */
/** the test class /** the test class
...@@ -53,191 +53,191 @@ ...@@ -53,191 +53,191 @@
*/ */
class TestLagrange : public FUTester<TestLagrange> { class TestLagrange : public FUTester<TestLagrange> {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// The tests! // The tests!
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
template <class FReal, class CellClass, class ContainerClass, class KernelClass, class MatrixKernelClass,
class LeafClass, class OctreeClass, class FmmClass>
void RunTest() {
//
// Load particles
//
if(sizeof(FReal) == sizeof(float) ) {
std::cerr << "No input data available for Float "<< std::endl;
exit(EXIT_FAILURE);
}
const std::string parFile( (sizeof(FReal) == sizeof(float))?
"Test/DirectFloatbfma":
"UTest/DirectDouble.bfma");
//
std::string filename(SCALFMMDataPath+parFile);
//
FFmaGenericLoader<FReal> loader(filename);
Print("Number of particles:");
Print(loader.getNumberOfParticles());
const int NbLevels = 4;
const int SizeSubLevels = 2;
// Create Matrix Kernel template <class FReal, class CellClass, class ContainerClass, class KernelClass, class MatrixKernelClass,
const MatrixKernelClass MatrixKernel; // FUKernelTester is only designed to work with 1/R, i.e. matrix kernel ctor takes no argument. class LeafClass, class OctreeClass, class FmmClass>
void RunTest() {
//
// Load particles
//
if(sizeof(FReal) == sizeof(float) ) {
std::cerr << "No input data available for Float "<< std::endl;
exit(EXIT_FAILURE);
}
const std::string parFile( (sizeof(FReal) == sizeof(float))?
"Test/DirectFloatbfma":
"UTest/DirectDouble.bfma");
//
std::string filename(SCALFMMDataPath+parFile);
//
FFmaGenericLoader<FReal> loader(filename);
Print("Number of particles:");
Print(loader.getNumberOfParticles());
const int NbLevels = 4;
const int SizeSubLevels = 2;
// Load particles // Load particles
FSize nbParticles = loader.getNumberOfParticles() ; FSize nbParticles = loader.getNumberOfParticles() ;
FmaRWParticle<FReal, 8,8>* const particles = new FmaRWParticle<FReal, 8,8>[nbParticles]; FmaRWParticle<FReal, 8,8>* const particles = new FmaRWParticle<FReal, 8,8>[nbParticles];
loader.fillParticle(particles,nbParticles); loader.fillParticle(particles,nbParticles);
// Create octree // Create octree
OctreeClass tree(NbLevels, SizeSubLevels, loader.getBoxWidth(), loader.getCenterOfBox()); OctreeClass tree(NbLevels, SizeSubLevels, loader.getBoxWidth(), loader.getCenterOfBox());
//
// Insert particle in the tree
//
for(FSize idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
tree.insert(particles[idxPart].getPosition(), idxPart, particles[idxPart].getPhysicalValue() );
}
//
// Create Matrix Kernel
const MatrixKernelClass MatrixKernel; // FUKernelTester is only designed to work with 1/R, i.e. matrix kernel ctor takes no argument.
// //
// Insert particle in the tree /////////////////////////////////////////////////////////////////////////////////////////////////
// // Run FMM computation
for(FSize idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){ /////////////////////////////////////////////////////////////////////////////////////////////////
tree.insert(particles[idxPart].getPosition(), idxPart, particles[idxPart].getPhysicalValue() ); Print("Fmm...");
} KernelClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel);
// FmmClass algo(&tree,&kernels);
///////////////////////////////////////////////////////////////////////////////////////////////// algo.execute();
// Run FMM computation //0
///////////////////////////////////////////////////////////////////////////////////////////////// FReal energy= 0.0 , energyD = 0.0 ;
Print("Fmm..."); /////////////////////////////////////////////////////////////////////////////////////////////////
KernelClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel); // Compute direct energy
FmmClass algo(&tree,&kernels); /////////////////////////////////////////////////////////////////////////////////////////////////
algo.execute();
//0 for(FSize idx = 0 ; idx < loader.getNumberOfParticles() ; ++idx){
FReal energy= 0.0 , energyD = 0.0 ; energyD += particles[idx].getPotential()*particles[idx].getPhysicalValue() ;
///////////////////////////////////////////////////////////////////////////////////////////////// }
// Compute direct energy /////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////// // Compare
/////////////////////////////////////////////////////////////////////////////////////////////////
for(FSize idx = 0 ; idx < loader.getNumberOfParticles() ; ++idx){ Print("Compute Diff...");
energyD += particles[idx].getPotential()*particles[idx].getPhysicalValue() ; FMath::FAccurater<FReal> potentialDiff;
} FMath::FAccurater<FReal> fx, fy, fz;
///////////////////////////////////////////////////////////////////////////////////////////////// { // Check that each particle has been summed with all other
// Compare
///////////////////////////////////////////////////////////////////////////////////////////////// tree.forEachLeaf([&](LeafClass* leaf){
Print("Compute Diff..."); const FReal*const potentials = leaf->getTargets()->getPotentials();
FMath::FAccurater<FReal> potentialDiff; const FReal*const physicalValues = leaf->getTargets()->getPhysicalValues();
FMath::FAccurater<FReal> fx, fy, fz; const FReal*const forcesX = leaf->getTargets()->getForcesX();
{ // Check that each particle has been summed with all other const FReal*const forcesY = leaf->getTargets()->getForcesY();
const FReal*const forcesZ = leaf->getTargets()->getForcesZ();
tree.forEachLeaf([&](LeafClass* leaf){ const FSize nbParticlesInLeaf = leaf->getTargets()->getNbParticles();
const FReal*const potentials = leaf->getTargets()->getPotentials(); const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
const FReal*const physicalValues = leaf->getTargets()->getPhysicalValues();
const FReal*const forcesX = leaf->getTargets()->getForcesX(); for(FSize idxPart = 0 ; idxPart < nbParticlesInLeaf ; ++idxPart){
const FReal*const forcesY = leaf->getTargets()->getForcesY(); const FSize indexPartOrig = indexes[idxPart];
const FReal*const forcesZ = leaf->getTargets()->getForcesZ(); potentialDiff.add(particles[indexPartOrig].getPotential(),potentials[idxPart]);
const FSize nbParticlesInLeaf = leaf->getTargets()->getNbParticles(); fx.add(particles[indexPartOrig].getForces()[0],forcesX[idxPart]);
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes(); fy.add(particles[indexPartOrig].getForces()[1],forcesY[idxPart]);
fz.add(particles[indexPartOrig].getForces()[2],forcesZ[idxPart]);
for(FSize idxPart = 0 ; idxPart < nbParticlesInLeaf ; ++idxPart){ energy += potentials[idxPart]*physicalValues[idxPart];
const FSize indexPartOrig = indexes[idxPart]; }
potentialDiff.add(particles[indexPartOrig].getPotential(),potentials[idxPart]); });
fx.add(particles[indexPartOrig].getForces()[0],forcesX[idxPart]); }
fy.add(particles[indexPartOrig].getForces()[1],forcesY[idxPart]);
fz.add(particles[indexPartOrig].getForces()[2],forcesZ[idxPart]); delete[] particles;
energy += potentials[idxPart]*physicalValues[idxPart];
} // Print for information
});
} Print("Potential diff is = ");
printf(" Pot L2Norm %e\n",potentialDiff.getL2Norm());
delete[] particles; printf(" Pot RL2Norm %e\n",potentialDiff.getRelativeL2Norm());
printf(" Pot RMSError %e\n",potentialDiff.getRMSError());
// Print for information Print("Fx diff is = ");
printf(" Fx L2Norm %e\n",fx.getL2Norm());
Print("Potential diff is = "); printf(" Fx RL2Norm %e\n",fx.getRelativeL2Norm());
printf(" Pot L2Norm %e\n",potentialDiff.getL2Norm()); printf(" Fx RMSError %e\n",fx.getRMSError());
printf(" Pot RL2Norm %e\n",potentialDiff.getRelativeL2Norm()); Print("Fy diff is = ");
printf(" Pot RMSError %e\n",potentialDiff.getRMSError()); printf(" Fy L2Norm %e\n",fy.getL2Norm());
Print("Fx diff is = "); printf(" Fy RL2Norm %e\n",fy.getRelativeL2Norm());
printf(" Fx L2Norm %e\n",fx.getL2Norm()); printf(" Fy RMSError %e\n",fy.getRMSError());
printf(" Fx RL2Norm %e\n",fx.getRelativeL2Norm()); Print("Fz diff is = ");
printf(" Fx RMSError %e\n",fx.getRMSError()); printf(" Fz L2Norm %e\n",fz.getL2Norm());
Print("Fy diff is = "); printf(" Fz RL2Norm %e\n",fz.getRelativeL2Norm());
printf(" Fy L2Norm %e\n",fy.getL2Norm()); printf(" Fz RMSError %e\n",fz.getRMSError());
printf(" Fy RL2Norm %e\n",fy.getRelativeL2Norm()); FReal L2error = (fx.getRelativeL2Norm()*fx.getRelativeL2Norm() + fy.getRelativeL2Norm()*fy.getRelativeL2Norm() + fz.getRelativeL2Norm() *fz.getRelativeL2Norm() );
printf(" Fy RMSError %e\n",fy.getRMSError()); printf(" Total L2 Force Error= %e\n",FMath::Sqrt(L2error)) ;
Print("Fz diff is = "); printf(" Energy Error = %.12e\n",FMath::Abs(energy-energyD));
printf(" Fz L2Norm %e\n",fz.getL2Norm()); printf(" Energy FMM = %.12e\n",FMath::Abs(energy));
printf(" Fz RL2Norm %e\n",fz.getRelativeL2Norm()); printf(" Energy DIRECT = %.12e\n",FMath::Abs(energyD));
printf(" Fz RMSError %e\n",fz.getRMSError());
FReal L2error = (fx.getRelativeL2Norm()*fx.getRelativeL2Norm() + fy.getRelativeL2Norm()*fy.getRelativeL2Norm() + fz.getRelativeL2Norm() *fz.getRelativeL2Norm() ); // Assert
printf(" Total L2 Force Error= %e\n",FMath::Sqrt(L2error)) ; const FReal MaximumDiffPotential = FReal(9e-3);
printf(" Energy Error = %.12e\n",FMath::Abs(energy-energyD)); const FReal MaximumDiffForces = FReal(9e-2);
printf(" Energy FMM = %.12e\n",FMath::Abs(energy));
printf(" Energy DIRECT = %.12e\n",FMath::Abs(energyD)); Print("Test1 - Error Relative L2 norm Potential ");
uassert(potentialDiff.getRelativeL2Norm() < MaximumDiffPotential); //1
// Assert Print("Test2 - Error RMS L2 norm Potential ");
const FReal MaximumDiffPotential = FReal(9e-3); uassert(potentialDiff.getRMSError() < MaximumDiffPotential); //2
const FReal MaximumDiffForces = FReal(9e-2); Print("Test3 - Error Relative L2 norm FX ");
uassert(fx.getRelativeL2Norm() < MaximumDiffForces); //3
Print("Test1 - Error Relative L2 norm Potential "); Print("Test4 - Error RMS L2 norm FX ");
uassert(potentialDiff.getRelativeL2Norm() < MaximumDiffPotential); //1 uassert(fx.getRMSError() < MaximumDiffForces); //4
Print("Test2 - Error RMS L2 norm Potential "); Print("Test5 - Error Relative L2 norm FY ");
uassert(potentialDiff.getRMSError() < MaximumDiffPotential); //2 uassert(fy.getRelativeL2Norm() < MaximumDiffForces); //5
Print("Test3 - Error Relative L2 norm FX "); Print("Test6 - Error RMS L2 norm FY ");
uassert(fx.getRelativeL2Norm() < MaximumDiffForces); //3 uassert(fy.getRMSError() < MaximumDiffForces); //6
Print("Test4 - Error RMS L2 norm FX "); Print("Test7 - Error Relative L2 norm FZ ");
uassert(fx.getRMSError() < MaximumDiffForces); //4 uassert(fz.getRelativeL2Norm() < MaximumDiffForces); //8
Print("Test5 - Error Relative L2 norm FY "); Print("Test8 - Error RMS L2 norm FZ ");
uassert(fy.getRelativeL2Norm() < MaximumDiffForces); //5 uassert(fz.getRMSError() < MaximumDiffForces); //8
Print("Test6 - Error RMS L2 norm FY "); Print("Test9 - Error Relative L2 norm F ");
uassert(fy.getRMSError() < MaximumDiffForces); //6 uassert(L2error < MaximumDiffForces); //9 Total Force
Print("Test7 - Error Relative L2 norm FZ "); Print("Test10 - Relative error Energy ");
uassert(fz.getRelativeL2Norm() < MaximumDiffForces); //8 uassert(FMath::Abs(energy-energyD) /energyD< MaximumDiffPotential); //10 Total Energy
Print("Test8 - Error RMS L2 norm FZ ");
uassert(fz.getRMSError() < MaximumDiffForces); //8
Print("Test9 - Error Relative L2 norm F "); }
uassert(L2error < MaximumDiffForces); //9 Total Force
Print("Test10 - Relative error Energy "); /** If memstas is running print the memory used */
uassert(FMath::Abs(energy-energyD) /energyD< MaximumDiffPotential); //10 Total Energy void PostTest() {
if( FMemStats::controler.isUsed() ){
std::cout << "Memory used at the end " << FMemStats::controler.getCurrentAllocated()
} << " Bytes (" << FMemStats::controler.getCurrentAllocatedMB() << "MB)\n";
std::cout << "Max memory used " << FMemStats::controler.getMaxAllocated()
/** If memstas is running print the memory used */ << " Bytes (" << FMemStats::controler.getMaxAllocatedMB() << "MB)\n";
void PostTest() { std::cout << "Total memory used " << FMemStats::controler.getTotalAllocated()
if( FMemStats::controler.isUsed() ){ << " Bytes (" << FMemStats::controler.getTotalAllocatedMB() << "MB)\n";
std::cout << "Memory used at the end " << FMemStats::controler.getCurrentAllocated() }
<< " Bytes (" << FMemStats::controler.getCurrentAllocatedMB() << "MB)\n"; }
std::cout << "Max memory used " << FMemStats::controler.getMaxAllocated()
<< " Bytes (" << FMemStats::controler.getMaxAllocatedMB() << "MB)\n";
std::cout << "Total memory used " << FMemStats::controler.getTotalAllocated() ///////////////////////////////////////////////////////////
<< " Bytes (" << FMemStats::controler.getTotalAllocatedMB() << "MB)\n"; // Set the tests!
} ///////////////////////////////////////////////////////////
}
/** TestUnifKernel */
/////////////////////////////////////////////////////////// void TestUnifKernel(){
// Set the tests! typedef double FReal;
/////////////////////////////////////////////////////////// const unsigned int ORDER = 6;
// typedefs
typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
/** TestUnifKernel */ typedef FSimpleLeaf<FReal, ContainerClass > LeafClass;
void TestUnifKernel(){ typedef FInterpMatrixKernelR<FReal> MatrixKernelClass;
typedef double FReal; typedef FUnifCell<FReal,ORDER> CellClass;
const unsigned int ORDER = 6; typedef FOctree<FReal, CellClass,ContainerClass,LeafClass> OctreeClass;
// typedefs typedef FUnifKernel<FReal,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FP2PParticleContainerIndexed<FReal> ContainerClass; typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
typedef FSimpleLeaf<FReal, ContainerClass > LeafClass; // run test
typedef FInterpMatrixKernelR<FReal> MatrixKernelClass; RunTest<FReal,CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>();
typedef FUnifCell<FReal,ORDER> CellClass; }
typedef FOctree<FReal, CellClass,ContainerClass,LeafClass> OctreeClass;
typedef FUnifKernel<FReal,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass; ///////////////////////////////////////////////////////////
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass; // Set the tests!
// run test ///////////////////////////////////////////////////////////
RunTest<FReal,CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>();
} /** set test */
void SetTests(){
/////////////////////////////////////////////////////////// AddTest(&TestLagrange::TestUnifKernel,"Test Lagrange Kernel ");
// Set the tests! }
///////////////////////////////////////////////////////////
/** set test */
void SetTests(){
AddTest(&TestLagrange::TestUnifKernel,"Test Lagrange Kernel ");
}
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment