diff --git a/.gitignore b/.gitignore index 90aa7391366004cc40dc56c3bbc86d7fc2b77fd7..66ccf5dc2012792b3537a635eba8766fa94abf06 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ Doc/html/ #ignore temporary files tmp/ *.tmp +*.temp *~ *TAGS *#*# diff --git a/Tests/FDebug.out b/Tests/FDebug.out deleted file mode 100644 index 768050eb7c9137f49f26c4255bd5c4a5daec759e..0000000000000000000000000000000000000000 --- a/Tests/FDebug.out +++ /dev/null @@ -1 +0,0 @@ -Hello Wordl 2 the return diff --git a/Tests/testApplication.cpp b/Tests/testApplication.cpp index 5e501f4990b7c32a514aeb3540922d7a3aa0b9ed..9976704d313833236f0c9558ddcdb393b969528a 100644 --- a/Tests/testApplication.cpp +++ b/Tests/testApplication.cpp @@ -1,14 +1,14 @@ // /!\ Please, you must read the license at the bottom of this page -//#define FUSE_MPI +#define FUSE_MPI #ifdef FUSE_MPI -// Compile by mpic++ testApplication.cpp -o testApplication.exe -// run by mpirun -np 4 ./testApplication +// Compile by mpic++ testApplication.cpp ../Sources/Utils/FAssertable.cpp -o testApplication.exe +// run by mpirun -np 4 ./testApplication.exe #include "../Sources/Utils/FMpiApplication.hpp" #define ApplicationImplementation FMpiApplication #else -// Compile by g++ testApplication.cpp -o testApplication.exe +// Compile by g++ testApplication.cpp ../Sources/Utils/FAssertable.cpp -o testApplication.exe #include "../Sources/Utils/FSingleApplication.hpp" #define ApplicationImplementation FSingleApplication #endif diff --git a/Tests/testAssert.cpp b/Tests/testAssert.cpp index e0dcfe429928822a869b06357dc89f5128e0049a..0d61a08e041dddb3f59ea24d9f6c451f6e10fb6e 100644 --- a/Tests/testAssert.cpp +++ b/Tests/testAssert.cpp @@ -29,7 +29,7 @@ protected: // optional : doing something before assert calls FApp->exit void calledBeforeExit() const { - std::cout << "assert is false we will quit what can I do...?\n"; + std::cout << "assert is false we will quit! what can I do...?\n"; } }; diff --git a/Tests/testDebug.cpp b/Tests/testDebug.cpp index 128932b428013df2ce1fc395ff77300d7d0b522f..94ac53cab81fca6c947dbfdeaca45236b007e90d 100644 --- a/Tests/testDebug.cpp +++ b/Tests/testDebug.cpp @@ -2,11 +2,10 @@ #include "../Sources/Utils/FDebug.hpp" -// Compile by : g++ testDebug.cpp ../Sources/Utils/FDebug.cpp -o testFDebug.exe +// Compile by : g++ testDebug.cpp ../Sources/Utils/FDebug.cpp -o testDebug.exe /** * In this file we show how to use the debug module -* please refere to the source of testDebug.cpp directly to knwo more */ int main(void){ @@ -18,10 +17,10 @@ int main(void){ FDEBUG( FDebug::Controller.writeVariableFromLine( "i", i, __LINE__, __FILE__);); // Write a developer information - FDEBUG( FDebug::Controller.writeFromLine("Strange things happend here!", __LINE__, __FILE__); ) + FDEBUG( FDebug::Controller.writeFromLine("Strange things are there!", __LINE__, __FILE__); ) // Change stream type - FDEBUG( FDebug::Controller.writeToFile("FDebug.out"); ) + FDEBUG( FDebug::Controller.writeToFile("testDebug.out.temp"); ) FDEBUG( FDebug::Controller << "Hello Wordl 2 the return\n"); return 0; diff --git a/Tests/testLoader.cpp b/Tests/testLoader.cpp index 0a6ff401ca48e979ddc397d217792f12d16ee4bd..49c4c71b84cf6841646ab6eb98d8ac7707aec607 100644 --- a/Tests/testLoader.cpp +++ b/Tests/testLoader.cpp @@ -18,16 +18,16 @@ #include "../Sources/Files/FBasicLoader.hpp" -// Compile by : g++ testLoader.cpp ../Sources/Utils/FAssertable.cpp -o testLoader.exe - +// Compile by : g++ testLoader.cpp ../Sources/Utils/FAssertable.cpp -O2 -lgomp -fopenmp -o testLoader.exe +// Fake cell class class TestCell{ }; /** * In this file we show an example of BasicParticule and BasicLoader use * Démarrage de /home/berenger/Dropbox/Personnel/FMB++/FMB++-build-desktop/FMB++... -* Inserting particules ... +* Inserting 2000000 particules ... * Done (5.77996). * Deleting particules ... * Done (0.171918). @@ -36,11 +36,12 @@ class TestCell{ int main(int , char ** ){ // we store all particules to be able to dealloc FList<FBasicParticule*> particules; + const char* const filename = "testLoader.basic.temp"; // open basic particules loader - FBasicLoader<FBasicParticule> loader("../FMB++/Tests/particules.basic.txt"); + FBasicLoader<FBasicParticule> loader(filename); if(!loader.isValide()){ - std::cout << "Loader Error\n"; + std::cout << "Loader Error, " << filename << "is missing\n"; return 1; } @@ -48,7 +49,7 @@ int main(int , char ** ){ FOctree<FBasicParticule, TestCell, 10, 3> tree(loader.getBoxWidth(),loader.getCenterOfBox()); // ----------------------------------------------------- - std::cout << "Inserting particules ..." << std::endl; + std::cout << "Inserting " << loader.getNumberOfParticules() << " particules ..." << std::endl; const double InsertingStartTime = omp_get_wtime(); for(int idx = 0 ; idx < loader.getNumberOfParticules() ; ++idx){ FBasicParticule* const part = new FBasicParticule(); diff --git a/Tests/testOctree.cpp b/Tests/testOctree.cpp index 786bce03a1988ac6a083fa29b2df5f328ba3ac35..a1f99facb94d7f61ecfae1e0088c18f38ce6846a 100644 --- a/Tests/testOctree.cpp +++ b/Tests/testOctree.cpp @@ -16,7 +16,8 @@ #include "../Sources/Core/FAbstractParticule.hpp" -// Compile by : g++ testOctree.cpp ../Sources/Utils/FAssertable.cpp -o testOctree.exe +// We use openmp to count time (portable and easy to manage) +// Compile by : g++ testOctree.cpp ../Sources/Utils/FAssertable.cpp -O2 -lgomp -fopenmp -o testOctree.exe /** * In this file we show how to use octree @@ -28,6 +29,8 @@ * Deleting particules ... * Done (0.0791715). */ + +// Fake particule class class TestParticule : public FAbstractParticule { F3DPosition pos; public: @@ -38,7 +41,7 @@ public: return pos; } }; - +// Fake cell class class TestCell{ }; diff --git a/Tests/testOctreeIter.cpp b/Tests/testOctreeIter.cpp index f13bf87c299b091c691c0b58d85cc7e5c26e4639..27b463c4e5e9375531f7d36d6a4706260f3d961f 100644 --- a/Tests/testOctreeIter.cpp +++ b/Tests/testOctreeIter.cpp @@ -16,10 +16,12 @@ #include "../Sources/Core/FAbstractParticule.hpp" -// Compile by : g++ testOctreeIter.cpp ../Sources/Utils/FAssertable.cpp -o testOctreeIter.exe +// We use openmp to count time (portable and easy to manage) +// Compile by : g++ testOctreeIter.cpp ../Sources/Utils/FAssertable.cpp -lgomp -fopenmp -O2 -o testOctreeIter.exe /** * In this file we show how to use octree with iteration + NbLevels = 5 & NbSubLevels = 2 & NbPart = 2000000 Creating particules ... Done (0.263944s). @@ -53,6 +55,8 @@ Done (0.716064s). Deleting particules ... Done (0.0830964s). */ + +// Fake particule class class TestParticule : public FAbstractParticule { F3DPosition pos; public: @@ -64,6 +68,7 @@ public: } }; +// Fake cell class class TestCell{ }; @@ -71,13 +76,13 @@ class TestCell{ int main(int , char ** ){ const int NbLevels = 10; const int NbSubLevels = 3; - const long NbPart = 2E5; + const long NbPart = 2E6; FList<TestParticule*> particules; srand ( 1 ); // volontary set seed to constant // ----------------------------------------------------- - std::cout << "Creating particules ..." << std::endl; + std::cout << "Creating " << NbPart << " particules ..." << std::endl; const double CreatingStartTime = omp_get_wtime(); for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){ particules.pushFront(new TestParticule(F3DPosition(double(rand())/RAND_MAX,double(rand())/RAND_MAX,double(rand())/RAND_MAX))); diff --git a/Tests/testThread.cpp b/Tests/testThread.cpp index 9c8acd2ad5d45ad7002c719f64573beb6cfa7dba..d5e12cd597218c08d45a1de19858fe6da44a4efb 100644 --- a/Tests/testThread.cpp +++ b/Tests/testThread.cpp @@ -11,7 +11,6 @@ /** * In this file we show how to use the thread module -* please refere to the source of testDebug.cpp directly to knwo more */ diff --git a/UTests/flistUTest.cpp b/UTests/utestList.cpp similarity index 93% rename from UTests/flistUTest.cpp rename to UTests/utestList.cpp index 36cbab79bd2a7fc95eac69246cb19fc0b863361b..0a1c2954fd3a17bb5fbf808ac71f84fa1db917b1 100644 --- a/UTests/flistUTest.cpp +++ b/UTests/utestList.cpp @@ -2,7 +2,7 @@ #include "../Sources/Containers/FList.hpp" -// compile by g++ flistUTest.cpp -o testFile.exe +// compile by g++ utestList.cpp -o utestList.exe /** * This file is a unit test for the FList class diff --git a/UTests/testUTest.cpp b/UTests/utestTest.cpp similarity index 87% rename from UTests/testUTest.cpp rename to UTests/utestTest.cpp index 7ada6af86debda027c60b2ace26012c656279932..61b93a429e3793bd7cc6a392f57683ce64936d20 100644 --- a/UTests/testUTest.cpp +++ b/UTests/utestTest.cpp @@ -1,6 +1,6 @@ #include "FUTester.hpp" -// compile by g++ testUTest.cpp -o test.exe +// compile by g++ utestTest.cpp -o utestTest.exe /** this class show a simple example of unit test */ class MyTest : public FUTester<MyTest> {