Commit 7668036d authored by berenger-bramas's avatar berenger-bramas

Update basic fma creator + change array size in M2L

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@225 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 1b82a810
......@@ -46,7 +46,7 @@ public:
* @param size the number of neighbors
* @param inLevel the current level of the computation
*/
virtual void M2L(CellClass* const FRestrict local, const CellClass* distantNeighbors[208],
virtual void M2L(CellClass* const FRestrict local, const CellClass* distantNeighbors[189],
const int size, const int inLevel) = 0;
/**
......
......@@ -45,7 +45,7 @@ public:
}
/** Before Downward */
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208], const int size, const int ) {
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[189], const int size, const int ) {
// The pole is impacted by what represent other poles
for(int idx = 0 ; idx < size ; ++idx){
......
......@@ -697,7 +697,7 @@ public:
* @param inLevel the level of the element
* @return the number of neighbors
*/
int getDistantNeighbors(const CellClass* inNeighbors[208],
int getDistantNeighbors(const CellClass* inNeighbors[189],
const FTreeCoordinate& workingCell,
const int inLevel) const{
......
......@@ -149,7 +149,7 @@ public:
typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator);
const CellClass* neighbors[208];
const CellClass* neighbors[189];
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
......
......@@ -229,7 +229,7 @@ public:
#pragma omp parallel
{
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[208];
const CellClass* neighbors[189];
#pragma omp for schedule(dynamic) nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
......
......@@ -466,7 +466,7 @@ public:
// Which cell potentialy needs other data and in the same time
// are potentialy needed by other
MortonIndex neighborsIndexes[208];
MortonIndex neighborsIndexes[189];
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
// Find the M2L neigbors of a cell
const int counter = getDistantNeighbors(iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel,neighborsIndexes);
......@@ -607,7 +607,7 @@ public:
#pragma omp parallel
{
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[208];
const CellClass* neighbors[189];
#pragma omp for schedule(dynamic) nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
......@@ -671,9 +671,9 @@ public:
#pragma omp parallel
{
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
MortonIndex neighborsIndex[208];
const CellClass* neighbors[208];
CellClass neighborsData[208];
MortonIndex neighborsIndex[189];
const CellClass* neighbors[189];
CellClass neighborsData[189];
#pragma omp for schedule(dynamic) nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
......@@ -1210,7 +1210,7 @@ public:
return idxNeig;
}
int getDistantNeighbors(const FTreeCoordinate& workingCell,const int inLevel, MortonIndex inNeighbors[208]) const{
int getDistantNeighbors(const FTreeCoordinate& workingCell,const int inLevel, MortonIndex inNeighbors[189]) const{
// Then take each child of the parent's neighbors if not in directNeighbors
// Father coordinate
......
......@@ -226,7 +226,7 @@ public:
#pragma omp parallel
{
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[208];
const CellClass* neighbors[189];
#pragma omp for schedule(dynamic) nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
......
......@@ -207,7 +207,7 @@ public:
#pragma omp parallel
{
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
CellClass* neighbors[208];
CellClass* neighbors[189];
#pragma omp for schedule(dynamic) nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
......
......@@ -168,7 +168,7 @@ public:
typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator);
const CellClass* neighbors[208];
const CellClass* neighbors[189];
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
......
......@@ -16,7 +16,7 @@
// P is a input parameter
static const int FMB_Info_P = 2;
static const int FMB_Info_P = 12;
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -835,7 +835,7 @@ public:
*Remark: here we have always j+n >= |-k-l|
*
*/
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208],
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[189],
const int size, const int inLevel) {
......
......@@ -909,7 +909,7 @@ public:
*Remark: here we have always j+n >= |-k-l|
*
*/
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208],
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[189],
const int size, const int inLevel) {
......
......@@ -1211,7 +1211,7 @@ public:
*Remark: here we have always j+n >= |-k-l|
*
*/
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208],
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[189],
const int size, const int inLevel) {
......
......@@ -8,6 +8,7 @@
#include <time.h>
#include "../Src/Utils/FGlobal.hpp"
#include "../Src/Utils/FParameters.hpp"
// This file can generate basic particles files in the FMA format
// g++ testLoaderFMACreate.cpp -o testLoaderFMACreate.exe
......@@ -24,17 +25,19 @@ int main(int argc, char ** argv){
//////////////////////////////////////////////////////////////
// Nb of particles
const long NbParticles = 50000;
const long NbParticles = FParameters::getValue(argc,argv,"-nb", long(200000));
const FReal FRandMax = FReal(RAND_MAX);
const FReal f2 = 2;
// Box width
const FReal BoxWidth = FParameters::getValue(argc,argv,"-width", FReal(1.0/2.0));
// Center of the box
const FReal XCenter = 0.5;
const FReal YCenter = 0.5;
const FReal ZCenter = 0.5;
const FReal XCenter = BoxWidth;
const FReal YCenter = BoxWidth;
const FReal ZCenter = BoxWidth;
// Box width
const FReal BoxWidth = 1.0/2;
// Output file please let .temp extension
const char * const defaultFilename = "testLoaderFMA.fma";
......
......@@ -203,7 +203,7 @@ int main(int argc, char ** argv){
if(child[idxChild]) ++nbChildAtLevel[idxArray];
}
const FBasicCell* neighbors[208];
const FBasicCell* neighbors[189];
M2LCalculusAtLevel[idxArray] += tree.getDistantNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(),idxLevel);
......
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