Commit 802a75e3 authored by COULAUD Olivier's avatar COULAUD Olivier

Rename -h (-sh) in -depth (-subdepth); remove FFma(Bin)Loader

parent 630936dc
......@@ -195,7 +195,7 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
if( ScalFMM_USE_MIC_NATIVE )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmic")
else()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xhost")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xhost")
ENDIF()
##################################################################
# Use SSE #
......
......@@ -29,41 +29,53 @@
* <li> Go to scalfmm/Build directory </li>
* <li> type <b> $> cmake .. </b>
* <ul>
* <li> If you want to enable MPI, use <b> $> cmake .. -DSCALFMM_USE_MPI=ON </b> </li>
* <li> If you want to enable MPI, use <b> $> cmake .. -DScaLFMM_USE_MPI=ON </b> </li>
* </ul>
* </li>
* <li> then configure your build with <b> $> ccmake .. </b> if needed </li>
* <li> then type <b> $> make name_of_exec </b> </li>
* </ul>
*
* an example : <br>
* <b> cmake -DScalFMM_USE_BLAS=ON -DScalFMM_USE_MKL_AS_BLAS=ON \ <br>
* -DScalFMM_USE_SSE=OFF -DScalFMM_USE_AVX=ON ../ </b>
*
* \subsection conf Configuration of the build
*
* This is all the build options you can modify.
*
* <ul>
* <li> CMAKE_INSTALL_PREFIX : to choose where to install ScalFmm </li>
* <li> DSCALFMM_USE_MPI : to use and enable MPI. Warning, you need to use this parameter at the first cmake command you write. </li>
* <li> SCALFMM_ATTACHE_SOURCE : to build with -g </li>
* <li> SCALFMM_BUILD_DEBUG : to build in debug mode of cmake (with -O0) </li>
* <li> SCALFMM_BUILD_TESTS : to build the text and the examples </li>
* <li> SCALFMM_BUILD_UTESTS : to build the unit tests </li>
* <li> SCALFMM_USE_ADDONS : to activate add ons </li>
* <li> ScalFMM_USE_MPI : to use and enable MPI. Warning, you need to use this parameter at the first cmake command you write. </li>
* <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>
* <ul>
* <li> SCALFMM_ADDON_FMMAPI : to build Fmm Api </li>
* </ul>
* <li> SCALFMM_USE_DOUBLE_PRECISION : to build in double precision </li>
* <li> SCALFMM_USE_MEM_STATS : to use memory stats (which count any new/delete done during a simulation) </li>
* <li> SCALFMM_USE_BLAS : to enable blas (needed by most of the kernel) </li>
* <li> ScalFMM_USE_DOUBLE_PRECISION : to build in double precision </li>
* <li> ScalFMMUSE_MEM_STATS : to use memory stats (which count any new/delete done during a simulation) </li>
* <li> ScalFMM_USE_BLAS : to enable BLAS (needed by Chebyshev interpolation kernel) </li>
* <ul>
* <li> SCALFMM_USE_MKL_AS_BLAS : to use MKL as blas </li>
* </ul>
* <li> SCALFMM_USE_TRACE : to create trace </li>
* <li> ScalFMM_USE_FFT : Use FFTW needed for uniform point for interpolation kernel</li>
* <ul>
* <li> ( ScalFMM_USE_MKL_AS_FFTW : to use MKL as FFTW </li>
* </ul>
* <li> ScalFMM_USE_TRACE : to create trace </li>
* <ul>
* <li> SCALFMM_USE_ITAC : to use Intel ITAC tool as trace generator </li>
* <li> ScalFMM_USE_ITAC : to use Intel ITAC tool as trace generator </li>
* </ul>
* <li> ScalFMM_USE_LOG to print output debug information
* <li> ScalFMM_USE_ASSERT enable safe tests during execution
* <li> ScalFMM_USE_MEM_STATS to profile memory
* <li> ScalFMM_USE_SSE compile with SEE support
* <li> ScalFMM_USE_AVX compile with AVX support
* <li>
* </ul>
*
* Once the library is built, you may want to install it : <b> $> make
* install </b>. Note that it is not an obligation to install ScalFmm
* to use it. You can build it and use it from the Build directory.
......
......@@ -23,9 +23,9 @@
* Tests/Utils/testStatsTree.cpp:
\code{.cpp}
const int NbLevels = FParameters::getValue(argc,argv,"-h", 5);
const int NbLevels = FParameters::getValue(argc,argv,"-depth", 5);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-sh", 3);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-subdepth", 3);
const char* const filename = FParameters::getStr(argc,argv,"-f", "../Data/test20k.fma");
\endcode
......@@ -33,14 +33,14 @@
* This means that in the console, you can tape:
\code{.cpp}
./Tests/Release/testStatsTree -h [an height] -sh [a sub height] -f [a file to load]
./Tests/Release/testStatsTree -depth [an height] -subdepth [a sub height] -f [a file to load]
\endcode
* \subsection concrete A Concrete example : SH FMM
* In this part we will run a simulation with Spherical Harmonics :
* Tests/Kernels/testSphericalAlgorithm.cpp.
* In this part we will run a simulation with Spherical Harmonics and rotation optimization:
* ./Examples/Release/RotationFMM .
* \subsubsection create Create a particles file
......@@ -68,9 +68,14 @@
* kernel.
\code{.cpp}
* ./Tests/Release/testSphericalAlgorithm -f my2kkpartfile.fma -h 5 -sh 3 -p 4
* ./Examples/Release/RotationFMM -f my2kkpartfile.fma -depth 5 -subdepth 3 -p 4
\endcode
* \section driver Driver
* <a href="../html/files.html"> Here</a> some drivers.
*
html/files.html
\section example_from_test Examples from Tests
\subsection tests_utils From Tests/Utils
......
......@@ -17,7 +17,7 @@
#ifndef FFMABINLOADERRESULT_HPP
#define FFMABINLOADERRESULT_HPP
#include "./FFmaBinLoader.hpp"
#include "./FFmaGenericLoader.hpp"
/**
* @author Cyrille Piacibello (cyrille.piacibello@inria.fr)
......@@ -29,44 +29,52 @@
* file, to compare with results from any Fmm Kernel.
*/
class FFmaBinLoaderResult : public FFmaBinLoader {
class FFmaBinLoaderResult : public FFmaGenericLoader {
protected:
typedef FFmaBinLoader Parent;
size_t removeWarning;
typedef FFmaGenericLoader Parent;
size_t removeWarning;
public:
FFmaBinLoaderResult(const char * filename):
Parent::FFmaBinLoader(filename)
{
}
FFmaBinLoaderResult(const char * filename):
Parent::FFmaGenericLoader(filename,true)
{
}
void fillParticle(FPoint*const outParticlePosition, FReal*const outphysicalValue,
FReal* forceX, FReal* forceY, FReal* forceZ, FReal * const potential){
// FReal x,y,z,data,fx,fy,fz,pot;
//Same data as particle files
// removeWarning += fread(&x, sizeof(FReal), 1, file);
// removeWarning += fread(&y, sizeof(FReal), 1, file);
// removeWarning += fread(&z, sizeof(FReal), 1, file);
// removeWarning += fread(&data, sizeof(FReal), 1, file);
this->Parent::fillParticle(outParticlePosition,outphysicalValue);
// file->read((char*)(outParticlePositions), sizeof(FReal)*3);
// file->read((char*)(outPhysicalValue), sizeof(FReal));
//
file->read((char*)(forceX), sizeof(FReal)*3);
file->read((char*)(forceY), sizeof(FReal));
file->read((char*)(forceZ), sizeof(FReal)*3);
file->read((char*)(potential), sizeof(FReal));
void fillParticle(FPoint*const inParticlePosition, FReal*const physicalValue, FReal* forceX, FReal* forceY, FReal* forceZ, FReal * const potential){
FReal x,y,z,data,fx,fy,fz,pot;
//Same data as particle files
removeWarning += fread(&x, sizeof(FReal), 1, file);
removeWarning += fread(&y, sizeof(FReal), 1, file);
removeWarning += fread(&z, sizeof(FReal), 1, file);
removeWarning += fread(&data, sizeof(FReal), 1, file);
//results data
// removeWarning += fread(&fx, sizeof(FReal), 1, file);
// removeWarning += fread(&fy, sizeof(FReal), 1, file);
// removeWarning += fread(&fz, sizeof(FReal), 1, file);
// removeWarning += fread(&pot, sizeof(FReal), 1, file);
//results data
removeWarning += fread(&fx, sizeof(FReal), 1, file);
removeWarning += fread(&fy, sizeof(FReal), 1, file);
removeWarning += fread(&fz, sizeof(FReal), 1, file);
removeWarning += fread(&pot, sizeof(FReal), 1, file);
//return
inParticlePosition->setPosition(x,y,z);
(*physicalValue) = data;
*forceX = fx;
*forceY = fy;
*forceZ = fz;
*potential = pot;
}
// inParticlePosition->setPosition(x,y,z);
// (*physicalValue) = data;
// *forceX = fx;
// *forceY = fy;
// *forceZ = fz;
// *potential = pot;
}
};
......
......@@ -91,13 +91,14 @@ int main(int argc, char ** argv){
///////////////////////What we do/////////////////////////////
if( FParameters::existParameter(argc, argv, "-help")){
std::cout << ">> This executable has to be used to compute direct interaction either for periodic or non periodic system.\n";
std::cout << ">> options are -h H -sh SH [-per perdeep, -noper] -fin filenameIN (-bin) -fout filenameOUT \n";
std::cout << ">> options are -depth H -subdepth SH [-per perdeep, -noper] -fin filenameIN (-bin) -fout filenameOUT \n";
std::cout << ">> Recommended files : ../Data/EwalTest_Periodic.run ../Data/EwalTest_NoPeriodic.run\n";
std::cout << " Options " << std::endl;
std::cout <<" -bin if input file is in binary mode "<< std::endl;
std::cout << " -per perDeep " << std::endl;
std::cout << " -noper no periodic boundary conditions " << std::endl;
std::cout << " -verbose : print index x y z fx fy fy Q and V" << std::endl;
std::cout << " -fout filenameOUT bunary output file " << std::endl;
std::cout << " -fout filenameOUT binary output file " << std::endl;
exit(-1);
}
......@@ -108,8 +109,8 @@ int main(int argc, char ** argv){
//////////////////////////////////////////////////////////////
const int NbLevels = FParameters::getValue(argc,argv,"-h", 4);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-sh", 2);
const int NbLevels = FParameters::getValue(argc,argv,"-depth", 4);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-subdepth", 2);
const int PeriodicDeep = FParameters::getValue(argc,argv,"-per", 3);
const std::string filenameIn(FParameters::getStr(argc,argv,"-fin", "../Data/forceNacl_128_dlpolyPer.bin"));
const char* const filenameOut = FParameters::getStr(argc,argv,"-fout", "periodicDirect.out");
......
......@@ -21,7 +21,7 @@
#include "../../Src/Core/FFmmAlgorithmThread.hpp"
#include "../../Src/Core/FFmmAlgorithmTask.hpp"
#include "../../Src/Files/FFmaBinLoader.hpp"
#include "../../Src/Files/FFmaGenericLoader.hpp"
#include "../../Src/GroupTree/FGroupSeqAlgorithm.hpp"
#include "../../Src/GroupTree/FP2PGroupParticleContainer.hpp"
......@@ -36,11 +36,11 @@ int main(int argc, char* argv[]){
typedef FGroupTree< CellClass, FP2PGroupParticleContainer<>, 5, FReal> GroupOctreeClass;
FTic counter;
const int NbLevels = FParameters::getValue(argc,argv,"-h", 5);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-sh", 3);
const int NbLevels = FParameters::getValue(argc,argv,"-depth", 5);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-subdepth", 3);
const char* const filename = FParameters::getStr(argc,argv,"-f", "../Data/test20k.bin.fma.double");
FFmaBinLoader loader(filename);
FFmaGenericLoader loader(filename,true);
FAssertLF(loader.isOpen());
OctreeClass tree(NbLevels, SizeSubLevels, loader.getBoxWidth(), loader.getCenterOfBox());
......
// ===================================================================================
// Ce LOGICIEL "ScalFmm" est couvert par le copyright Inria 20xx-2012.
// Inria d��tient tous les droits de propri��t�� sur le LOGICIEL, et souhaite que
// la communaut�� scientifique l'utilise afin de le tester et de l'��valuer.
// Inria donne gracieusement le droit d'utiliser ce LOGICIEL. Toute utilisation
// dans un but lucratif ou �� des fins commerciales est interdite sauf autorisation
// expresse et pr��alable d'Inria.
// Toute utilisation hors des limites pr��cis��es ci-dessus et r��alis��e sans l'accord
// expresse pr��alable d'Inria constituerait donc le d��lit de contrefa��on.
// Le LOGICIEL ��tant un produit en cours de d��veloppement, Inria ne saurait assurer
// aucune responsabilit�� et notamment en aucune mani��re et en aucun cas, ��tre tenu
// de r��pondre d'��ventuels dommages directs ou indirects subits par l'utilisateur.
// Tout utilisateur du LOGICIEL s'engage �� communiquer �� Inria ses remarques
// relatives �� l'usage du LOGICIEL
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
// ==== CMAKE =====
......@@ -24,8 +24,6 @@
#include <cstdlib>
#include "../../Src/Files/FFmaScanfLoader.hpp"
#include "../../Src/Files/FFmaBinLoader.hpp"
#include "../../Src/Kernels/Chebyshev/FChebCell.hpp"
#include "../../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
......@@ -52,8 +50,8 @@
int main(int argc, char* argv[])
{
const char* const filename = FParameters::getStr(argc,argv,"-f", "../Data/test20k.fma");
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-h", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-sh", 2);
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", 1);
#ifdef _OPENMP
......
// ===================================================================================
// Ce LOGICIEL "ScalFmm" est couvert par le copyright Inria 20xx-2012.
// Inria détient tous les droits de propriété sur le LOGICIEL, et souhaite que
// la communauté scientifique l'utilise afin de le tester et de l'évaluer.
// Inria donne gracieusement le droit d'utiliser ce LOGICIEL. Toute utilisation
// dans un but lucratif ou à des fins commerciales est interdite sauf autorisation
// expresse et préalable d'Inria.
// Toute utilisation hors des limites précisées ci-dessus et réalisée sans l'accord
// expresse préalable d'Inria constituerait donc le délit de contrefaçon.
// Le LOGICIEL étant un produit en cours de développement, Inria ne saurait assurer
// aucune responsabilité et notamment en aucune manière et en aucun cas, être tenu
// de répondre d'éventuels dommages directs ou indirects subits par l'utilisateur.
// Tout utilisateur du LOGICIEL s'engage à communiquer à Inria ses remarques
// relatives à l'usage du LOGICIEL
// Copyright ScalFmm 2013 INRIA,
//
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
//
// #author P. Blanchard
// ==== CMAKE =====
// @FUSE_BLAS
// ================
......@@ -24,8 +25,6 @@
#include <cstdlib>
#include "../../Src/Files/FFmaScanfLoader.hpp"
#include "../../Src/Files/FFmaBinLoader.hpp"
#include "../../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
......@@ -52,8 +51,8 @@
int main(int argc, char* argv[])
{
const char* const filename = FParameters::getStr(argc,argv,"-f", "../Data/test20k.fma");
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-h", 3);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-sh", 2);
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 3);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", 1);
#ifdef _OPENMP
......
// ===================================================================================
// Ce LOGICIEL "ScalFmm" est couvert par le copyright Inria 20xx-2012.
// Inria détient tous les droits de propriété sur le LOGICIEL, et souhaite que
// la communauté scientifique l'utilise afin de le tester et de l'évaluer.
// Inria donne gracieusement le droit d'utiliser ce LOGICIEL. Toute utilisation
// dans un but lucratif ou à des fins commerciales est interdite sauf autorisation
// expresse et préalable d'Inria.
// Toute utilisation hors des limites précisées ci-dessus et réalisée sans l'accord
// expresse préalable d'Inria constituerait donc le délit de contrefaçon.
// Le LOGICIEL étant un produit en cours de développement, Inria ne saurait assurer
// aucune responsabilité et notamment en aucune manière et en aucun cas, être tenu
// de répondre d'éventuels dommages directs ou indirects subits par l'utilisateur.
// Tout utilisateur du LOGICIEL s'engage à communiquer à Inria ses remarques
// relatives à l'usage du LOGICIEL
// Copyright ScalFmm 2013 INRIA
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
// ==== CMAKE =====
......@@ -112,7 +112,7 @@ int main(int argc, char* argv[])
}
////////////////////////////////////////////////////////////////////
{ // begin Chebyshef kernel
{ // begin Chebyshev kernel
// accuracy
const unsigned int ORDER = 7;
......@@ -195,24 +195,19 @@ int main(int argc, char* argv[])
{ // begin FFmaBlas kernel
// accuracy
const int DevP = FParameters::getValue(argc, argv, "-p", 6);
const int DevP = FParameters::getValue(argc, argv, "-p", 11);
// typedefs
typedef FSphericalCell CellClass;
typedef FP2PParticleContainerIndexed<> ContainerClass;
typedef FSimpleLeaf< ContainerClass > LeafClass;
typedef FOctree< CellClass, ContainerClass , LeafClass > OctreeClass;
//typedef FSphericalBlasKernel< CellClass, ContainerClass > KernelClass;
//typedef FSphericalBlockBlasKernel< CellClass, ContainerClass > KernelClass;
//typedef FSphericalKernel< CellClass, ContainerClass > KernelClass;
typedef FSphericalBlockBlasKernel< CellClass, ContainerClass > KernelClass;
//typedef FSphericalRotationKernel< CellClass, ContainerClass > KernelClass;
//typedef FFmmAlgorithm<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass > FmmClass;
typedef FFmmAlgorithmThread<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass > FmmClass;
typedef FSphericalBlockBlasKernel< CellClass, ContainerClass > KernelClass;
typedef FFmmAlgorithmThread<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass > FmmClass;
// init cell class and oct-tree
CellClass::Init(DevP, true); // only for blas
CellClass::Init(DevP, false);
//
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
{ // -----------------------------------------------------
......
// ===================================================================================
// Ce LOGICIEL "ScalFmm" est couvert par le copyright Inria 20xx-2012.
// Inria détient tous les droits de propriété sur le LOGICIEL, et souhaite que
// la communauté scientifique l'utilise afin de le tester et de l'évaluer.
// Inria donne gracieusement le droit d'utiliser ce LOGICIEL. Toute utilisation
// dans un but lucratif ou à des fins commerciales est interdite sauf autorisation
// expresse et préalable d'Inria.
// Toute utilisation hors des limites précisées ci-dessus et réalisée sans l'accord
// expresse préalable d'Inria constituerait donc le délit de contrefaçon.
// Le LOGICIEL étant un produit en cours de développement, Inria ne saurait assurer
// aucune responsabilité et notamment en aucune manière et en aucun cas, être tenu
// de répondre d'éventuels dommages directs ou indirects subits par l'utilisateur.
// Tout utilisateur du LOGICIEL s'engage à communiquer à Inria ses remarques
// relatives à l'usage du LOGICIEL
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
/**
*@author Matthias Messner
*
* **/
// ==== CMAKE =====
// @FUSE_BLAS
// ================
......@@ -24,7 +29,6 @@
#include <cstdlib>
#include "../../Src/Files/FFmaScanfLoader.hpp"
#include "../../Src/Files/FFmaBinLoader.hpp"
#include "../../Src/Kernels/Chebyshev/FChebCell.hpp"
#include "../../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
......@@ -47,54 +51,54 @@
int main(int argc, char* argv[])
{
const char* const filename = FParameters::getStr(argc,argv,"-f", "../Data/test20k.fma");
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-h", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-sh", 2);
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int ORDER = 8;
const FReal epsilon = FReal(1e-8);
// init timer
FTic time;
// typedefs
typedef FP2PParticleContainer<> ContainerClass;
typedef FSimpleLeaf<ContainerClass> LeafClass;
// typedefs
typedef FP2PParticleContainer<> ContainerClass;
typedef FSimpleLeaf<ContainerClass> LeafClass;
typedef FInterpMatrixKernelR MatrixKernelClass;
typedef FChebCell<ORDER> CellClass;
typedef FOctree<CellClass,ContainerClass,LeafClass> OctreeClass;
typedef FChebFlopsSymKernel<CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
typedef FOctree<CellClass,ContainerClass,LeafClass> OctreeClass;
typedef FChebFlopsSymKernel<CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// What we do //////////////////////////////////////////////////////
std::cout << ">> Testing the Chebyshev interpolation base FMM algorithm.\n";
// open particle file
FFmaScanfLoader loader(filename);
//FFmaBinLoader loader(filename);
FFmaScanfLoader loader(filename);
//
if(!loader.isOpen()) throw std::runtime_error("Particle file couldn't be opened!");
// init oct-tree
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
// -----------------------------------------------------
std::cout << "Creating and inserting " << loader.getNumberOfParticles()
<< " particles in a octree of height " << TreeHeight << " ..." << std::endl;
<< " particles in a octree of height " << TreeHeight << " ..." << std::endl;
time.tic();
{
FPoint particlePosition;
FReal physicalValue = 0.0;
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(&particlePosition,&physicalValue);
tree.insert(particlePosition, physicalValue);
}
}
{
FPoint particlePosition;
FReal physicalValue = 0.0;
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(&particlePosition,&physicalValue);
tree.insert(particlePosition, physicalValue);
}
}
std::cout << "Done " << "(" << time.tacAndElapsed() << ")." << std::endl;
// -----------------------------------------------------
// -----------------------------------------------------
std::cout << "\nChebyshev FMM ... " << std::endl;
KernelClass kernels(TreeHeight, loader.getBoxWidth(),loader.getCenterOfBox(), epsilon);
......@@ -103,8 +107,8 @@ int main(int argc, char* argv[])
algorithm.execute();
std::cout << "completed in " << time.tacAndElapsed() << "sec." << std::endl;
// -----------------------------------------------------
return 0;
return 0;
}
......
// ===================================================================================
// Ce LOGICIEL "ScalFmm" est couvert par le copyright Inria 20xx-2012.
// Inria détient tous les droits de propriété sur le LOGICIEL, et souhaite que
// la communauté scientifique l'utilise afin de le tester et de l'évaluer.
// Inria donne gracieusement le droit d'utiliser ce LOGICIEL. Toute utilisation
// dans un but lucratif ou à des fins commerciales est interdite sauf autorisation
// expresse et préalable d'Inria.
// Toute utilisation hors des limites précisées ci-dessus et réalisée sans l'accord
// expresse préalable d'Inria constituerait donc le délit de contrefaçon.
// Le LOGICIEL étant un produit en cours de développement, Inria ne saurait assurer
// aucune responsabilité et notamment en aucune manière et en aucun cas, être tenu
// de répondre d'éventuels dommages directs ou indirects subits par l'utilisateur.
// Tout utilisateur du LOGICIEL s'engage à communiquer à Inria ses remarques
// relatives à l'usage du LOGICIEL
// Copyright ScalFmm 2013 INRIA,
//
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
//
// ==== CMAKE =====
//
// ================
......@@ -81,10 +81,10 @@ int main(int argc, char* argv[])
{
// get info from commandline
const char* const filename = FParameters::getStr(argc,argv,"-f", "../Data/test20k.fma");
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-h", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-sh", 2);
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", omp_get_max_threads());
const int DevP = FParameters::getValue(argc, argv, "-p", 7);
const int DevP = FParameters::getValue(argc, argv, "-p", 11);
#ifdef _OPENMP
omp_set_num_threads(NbThreads);
std::cout << "\n>> Using " << omp_get_max_threads() << " threads.\n" << std::endl;
......@@ -142,7 +142,6 @@ int main(int argc, char* argv[])
// accuracy
const unsigned int ORDER = 7;
const FReal epsilon = FReal(1e-7);
// typedefs
typedef FP2PParticleContainerIndexed<> ContainerClass;
......@@ -176,9 +175,9 @@ int main(int argc, char* argv[])
} // -----------------------------------------------------
{ // -----------------------------------------------------
std::cout << "\nChebyshev FMM ... " << std::endl;
std::cout << "\nChebyshev FMM ... ORDER: " << ORDER <<std::endl;
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox(), epsilon);
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
FmmClass algorithm(&tree, &kernels);
algorithm.execute();
time.tac();
......@@ -229,7 +228,6 @@ int main(int argc, char* argv[])
// init cell class and oct-tree
CellClass::Init(DevP, true); // only for blas
//CellClass::Init(DevP, false);
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
{ // -----------------------------------------------------
......@@ -250,7 +248,7 @@ int main(int argc, char* argv[])
} // -----------------------------------------------------
// -----------------------------------------------------
std::cout << "\nFFmaBlas FMM ..." << std::endl;
std::cout << "\nFFmaBlas FMM ... P: " <<DevP << std::endl;
time.tic();
KernelClass kernels(DevP, TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
FmmClass algorithm(&tree, &kernels);
......@@ -331,7 +329,7 @@ int main(int argc, char* argv[])
} // -----------------------------------------------------
{ // -----------------------------------------------------
std::cout << "\nLagrange FMM ... " << std::endl;
std::cout << "\nLagrange FMM ... ORDER " << ORDER <<std::endl;
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
FmmClass algorithm(&tree, &kernels);
......@@ -372,7 +370,7 @@ int main(int argc, char* argv[])
#endif
{
const static int P = 8;
const static int P = 12;
typedef FRotationCell<P> CellClass;
typedef FP2PParticleContainerIndexed<> ContainerClass;
typedef FSimpleLeaf< ContainerClass > LeafClass;
......@@ -401,7 +399,7 @@ int main(int argc, char* argv[])
} // -----------------------------------------------------
// -----------------------------------------------------
std::cout << "\nFFmaRotation FMM ..." << std::endl;
std::cout << "\nFFmaRotation FMM ... P: " << P<< std::endl;
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
FmmClass algorithm(&tree, &kernels);
......@@ -441,7 +439,7 @@ int main(int argc, char* argv[])
{ // begin Taylor kernel
// accuracy
const unsigned int ORDER = 7;
const unsigned int ORDER = 8;
// typedefs
typedef FTaylorCell<ORDER,1> CellClass;
......@@ -474,7 +472,7 @@ int main(int argc, char* argv[])
} // -----------------------------------------------------
// -----------------------------------------------------
std::cout << "\nFFmaTaylor FMM ..." << std::endl;
std::cout << "\nFFmaTaylor FMM ... ORDER: " << ORDER << std::endl;
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
FmmClass algorithm(&tree, &kernels);
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -33,7 +33,7 @@
#include "../../Src/Kernels/Spherical/FSphericalCell.hpp"
#include "../../Src/Components/FSimpleLeaf.hpp"
#include "../../Src/Files/FFmaLoader.hpp"
#include "../../Src/Files/FFmaGenericLoader.hpp"
#include "../../Src/Kernels/P2P/FP2PParticleContainer.hpp"
/** This program show an example of use of
......@@ -60,14 +60,14 @@ int main(int argc, char ** argv){
std::cout << ">> You can pass -sequential or -task (thread by default).\n";
//////////////////////////////////////////////////////////////
const int DevP = FParameters::getValue(argc,argv,"-p", 8);
const int NbLevels = FParameters::getValue(argc,argv,"-h", 5);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-sh", 3);
const int NbLevels = FParameters::getValue(argc,argv,"-depth", 5);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-subdepth", 3);