Commit 16e6ae0d authored by berenger-bramas's avatar berenger-bramas

Change long to int, etc. to remove all the warning generated by a compilation under platfrim.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@317 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 3320da01
......@@ -135,7 +135,7 @@ public:
// send
for(int idxProc = 0 ; idxProc < comm.processCount() ; ++idxProc){
if(idxProc != comm.processId() && allcounter[idxProc * comm.processCount() + comm.processId()]){
FMpi::MpiAssert( MPI_Irecv(&toReceive[indexToReceive[idxProc]], allcounter[idxProc * comm.processCount() + comm.processId()] * sizeof(ParticleClass), MPI_BYTE,
FMpi::MpiAssert( MPI_Irecv(&toReceive[indexToReceive[idxProc]], allcounter[idxProc * comm.processCount() + comm.processId()] * int(sizeof(ParticleClass)), MPI_BYTE,
idxProc, 0, comm.getComm(), &requests[iterRequests++]), __LINE__ );
hasToRecvFrom += 1;
}
......@@ -146,7 +146,7 @@ public:
// recv
for(int idxProc = 0 ; idxProc < comm.processCount() ; ++idxProc){
if(idxProc != comm.processId() && toMove[idxProc].getSize()){
FMpi::MpiAssert( MPI_Isend(toMove[idxProc].data(), toMove[idxProc].getSize() * sizeof(ParticleClass), MPI_BYTE,
FMpi::MpiAssert( MPI_Isend(toMove[idxProc].data(), toMove[idxProc].getSize() * int(sizeof(ParticleClass)), MPI_BYTE,
idxProc, 0, comm.getComm(), &requests[iterRequests++]), __LINE__ );
}
}
......
......@@ -75,10 +75,10 @@ class FOctree : protected FAssertable {
* @param inRelativePosition a position from the corner of the box
* @return the box num at the leaf level that contains inRelativePosition
*/
long getTreeCoordinate(const FReal inRelativePosition) const {
int getTreeCoordinate(const FReal inRelativePosition) const {
FDEBUG( fassert(inRelativePosition >= 0 && inRelativePosition < this->boxWidth, "Particle out of box", __LINE__, __FILE__) );
const FReal indexFReal = inRelativePosition / this->boxWidthAtLevel[this->leafIndex];
const long index = long(FMath::dfloor(indexFReal));
const int index = int(FMath::dfloor(indexFReal));
if( index && FMath::LookEqual(inRelativePosition, this->boxWidthAtLevel[this->leafIndex] * FReal(index) ) ){
return index - 1;
}
......@@ -203,14 +203,14 @@ public:
class Iterator : protected FAssertable {
SubOctreeTypes current; //< Current suboctree
long currentLocalIndex; //< Current index (array position) in the current_suboctree.cells[ currentLocalLevel ]
int currentLocalIndex; //< Current index (array position) in the current_suboctree.cells[ currentLocalLevel ]
int currentLocalLevel; //< Current level in the current suboctree
/**
* To know what is the left limit on the current level on the current subtree
* @retrun suboctree.left_limit >> 3 * diff(leaf_index, current_index).
*/
static long TransposeIndex(const long indexInLeafLevel, const int distanceFromLeafLevel) {
static int TransposeIndex(const int indexInLeafLevel, const int distanceFromLeafLevel) {
return indexInLeafLevel >> (3 * distanceFromLeafLevel);
}
......@@ -368,8 +368,8 @@ public:
bool moveRight(){
// Function variables
SubOctreeTypes workingTree = this->current; // To cover parent other sub octre
long workingLevel = this->currentLocalLevel; // To know where we are
long workingIndex = this->currentLocalIndex; // To know where we are
int workingLevel = this->currentLocalLevel; // To know where we are
int workingIndex = this->currentLocalIndex; // To know where we are
// -- First we have to go in a tree where we can move on the right --
// Number of time we go into parent subtree
......@@ -396,7 +396,7 @@ public:
// While we are not on a allocated cell
while( true ){
// Test element on the right (test brothers)
const long rightLimite = (workingIndex | 7) + 1;
const int rightLimite = (workingIndex | 7) + 1;
while( workingIndex < rightLimite && !workingTree.tree->cellsAt(workingLevel)[workingIndex]){
++workingIndex;
}
......@@ -417,7 +417,7 @@ public:
while( workingLevel != objectiveLevel ){
++workingLevel;
workingIndex <<= 3;
const long rightLimite = (workingIndex | 7); // not + 1 because if the 7th first are null it must be the 8th!
const int rightLimite = (workingIndex | 7); // not + 1 because if the 7th first are null it must be the 8th!
while( workingIndex < rightLimite && !workingTree.tree->cellsAt(workingLevel)[workingIndex]){
++workingIndex;
}
......@@ -654,19 +654,19 @@ public:
FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel);
const long limite = FMath::pow(2,inLevel);
const int limite = FMath::pow(2,inLevel);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(center.getX() + idxX,0l,limite)) continue;
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(center.getX() + idxX,0,limite)) continue;
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(center.getY() + idxY,0l,limite)) continue;
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(center.getY() + idxY,0,limite)) continue;
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(center.getZ() + idxZ,0l,limite)) continue;
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(center.getZ() + idxZ,0,limite)) continue;
// if we are not on the current cell
if( !(!idxX && !idxY && !idxZ) ){
......@@ -738,18 +738,18 @@ public:
const FTreeCoordinate parentCell(workingCell.getX()>>1,workingCell.getY()>>1,workingCell.getZ()>>1);
// Limite at parent level number of box (split by 2 by level)
const long limite = FMath::pow(2,inLevel-1);
const int limite = FMath::pow(2,inLevel-1);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(parentCell.getX() + idxX,0l,limite)) continue;
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(parentCell.getX() + idxX,0,limite)) continue;
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(parentCell.getY() + idxY,0l,limite)) continue;
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(parentCell.getY() + idxY,0,limite)) continue;
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(parentCell.getZ() + idxZ,0l,limite)) continue;
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(parentCell.getZ() + idxZ,0,limite)) continue;
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......@@ -808,14 +808,14 @@ public:
const FTreeCoordinate parentCell(workingCell.getX()>>1,workingCell.getY()>>1,workingCell.getZ()>>1);
// Limite at parent level number of box (split by 2 by level)
const long limite = FMath::pow(2,inLevel-1);
const int limite = FMath::pow(2,inLevel-1);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......@@ -918,19 +918,19 @@ public:
FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel);
const long limite = FMath::pow(2,inLevel);
const int limite = FMath::pow(2,inLevel);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(center.getX() + idxX,0l,limite)) continue;
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(center.getX() + idxX,0,limite)) continue;
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(center.getY() + idxY,0l,limite)) continue;
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(center.getY() + idxY,0,limite)) continue;
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(center.getZ() + idxZ,0l,limite)) continue;
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(center.getZ() + idxZ,0,limite)) continue;
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......@@ -961,16 +961,16 @@ public:
FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel);
const long limite = FMath::pow(2,inLevel);
const int limite = FMath::pow(2,inLevel);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......
This diff is collapsed.
......@@ -15,9 +15,9 @@
*/
class FTreeCoordinate{
private:
long x; //< x box-th position
long y; //< y box-th position
long z; //< z box-th position
int x; //< x box-th position
int y; //< y box-th position
int z; //< z box-th position
public:
/** Default constructor (position = {0,0,0})*/
......@@ -30,7 +30,7 @@ public:
* @param inY the y
* @param inZ the z
*/
explicit FTreeCoordinate(const long inX,const long inY,const long inZ)
explicit FTreeCoordinate(const int inX,const int inY,const int inZ)
: x(inX), y(inY), z(inZ){
}
......@@ -67,7 +67,7 @@ public:
* @param inY the new y
* @param inZ the new z
*/
void setPosition(const long inX,const long inY,const long inZ){
void setPosition(const int inX,const int inY,const int inZ){
this->x = inX;
this->y = inY;
this->z = inZ;
......@@ -77,7 +77,7 @@ public:
* X Getter
* @return this->x
*/
long getX() const{
int getX() const{
return this->x;
}
......@@ -85,7 +85,7 @@ public:
* Y Getter
* @return this->y
*/
long getY() const{
int getY() const{
return this->y;
}
......@@ -93,7 +93,7 @@ public:
* Z Getter
* @return this->z
*/
long getZ() const{
int getZ() const{
return this->z;
}
......@@ -101,7 +101,7 @@ public:
* X Setter, simply change x position
* @param the new x
*/
void setX(const long inX){
void setX(const int inX){
this->x = inX;
}
......@@ -109,7 +109,7 @@ public:
* Y Setter, simply change y position
* @param the new y
*/
void setY(const long inY){
void setY(const int inY){
this->y = inY;
}
......@@ -117,7 +117,7 @@ public:
* Z Setter, simply change z position
* @param the new z
*/
void setZ(const long inZ){
void setZ(const int inZ){
this->z = inZ;
}
......@@ -163,11 +163,11 @@ public:
this->z = 0;
for(int indexLevel = 0; indexLevel < inLevel ; ++indexLevel){
z |= long(inIndex & mask);
z |= int(inIndex & mask);
inIndex >>= 1;
y |= long(inIndex & mask);
y |= int(inIndex & mask);
inIndex >>= 1;
x |= long(inIndex & mask);
x |= int(inIndex & mask);
mask <<= 1;
}
......
......@@ -162,8 +162,8 @@ public:
}
// We get the min/max indexes from each procs
FMpi::MpiAssert( MPI_Allgather( myIntervals, sizeof(Interval) * OctreeHeight, MPI_BYTE,
workingIntervalsPerLevel, sizeof(Interval) * OctreeHeight, MPI_BYTE, MPI_COMM_WORLD), __LINE__ );
FMpi::MpiAssert( MPI_Allgather( myIntervals, int(sizeof(Interval)) * OctreeHeight, MPI_BYTE,
workingIntervalsPerLevel, int(sizeof(Interval)) * OctreeHeight, MPI_BYTE, MPI_COMM_WORLD), __LINE__ );
}
// run;
......@@ -578,7 +578,7 @@ private:
toSend[idxLevel * nbProcess + idxProc][idxLeaf].getCurrentCell()->serializeUp(sendBuffer[idxLevel * nbProcess + idxProc][idxLeaf].data);
}
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxLevel * nbProcess + idxProc], toSendAtProcAtLevel * sizeof(CellToSend) , MPI_BYTE ,
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxLevel * nbProcess + idxProc], toSendAtProcAtLevel * int(sizeof(CellToSend)) , MPI_BYTE ,
idxProc, FMpi::TagLast + idxLevel, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
......@@ -586,7 +586,7 @@ private:
if(toReceiveFromProcAtLevel){
recvBuffer[idxLevel * nbProcess + idxProc] = new CellToSend[toReceiveFromProcAtLevel];
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxLevel * nbProcess + idxProc], toReceiveFromProcAtLevel * sizeof(CellToSend), MPI_BYTE,
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxLevel * nbProcess + idxProc], toReceiveFromProcAtLevel * int(sizeof(CellToSend)), MPI_BYTE,
idxProc, FMpi::TagLast + idxLevel, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
}
......@@ -919,7 +919,7 @@ private:
}
// Box limite
const long limite = 1 << (this->OctreeHeight - 1);
const int limite = 1 << (this->OctreeHeight - 1);
// pointer to send
typename OctreeClass::Iterator* toSend[nbProcess];
memset(toSend, 0, sizeof(typename OctreeClass::Iterator*) * nbProcess );
......@@ -993,7 +993,7 @@ private:
if(globalReceiveMap[idxProc * nbProcess + idProcess]){
recvBuffer[idxProc] = reinterpret_cast<ParticleClass*>(new char[sizeof(ParticleClass) * globalReceiveMap[idxProc * nbProcess + idProcess]]);
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxProc], globalReceiveMap[idxProc * nbProcess + idProcess]*sizeof(ParticleClass), MPI_BYTE,
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxProc], globalReceiveMap[idxProc * nbProcess + idProcess]*int(sizeof(ParticleClass)), MPI_BYTE,
idxProc, FMpi::TagFmmP2P, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
}
......@@ -1010,7 +1010,7 @@ private:
currentIndex += toSend[idxProc][idxLeaf].getCurrentListSrc()->getSize();
}
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxProc], sizeof(ParticleClass) * partsToSend[idxProc] , MPI_BYTE ,
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxProc], int(sizeof(ParticleClass)) * partsToSend[idxProc] , MPI_BYTE ,
idxProc, FMpi::TagFmmP2P, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
......@@ -1174,7 +1174,7 @@ private:
MortonIndex neighborsIndex[26];
int previous = 0;
// Box limite
const long limite = 1 << (this->OctreeHeight - 1);
const int limite = 1 << (this->OctreeHeight - 1);
for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
const int endAtThisShape = shapeLeaf[idxShape] + previous;
......@@ -1232,19 +1232,19 @@ private:
}
int getNeighborsIndexes(const MortonIndex centerIndex, const long limite, MortonIndex indexes[26]) const{
int getNeighborsIndexes(const MortonIndex centerIndex, const int limite, MortonIndex indexes[26]) const{
FTreeCoordinate center;
center.setPositionFromMorton(centerIndex, OctreeHeight - 1);
int idxNeig = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(center.getX() + idxX,0l, limite)) continue;
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(center.getX() + idxX,0, limite)) continue;
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(center.getY() + idxY,0l, limite)) continue;
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(center.getY() + idxY,0, limite)) continue;
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(center.getZ() + idxZ,0l, limite)) continue;
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(center.getZ() + idxZ,0, limite)) continue;
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......@@ -1264,18 +1264,18 @@ private:
const FTreeCoordinate parentCell(workingCell.getX()>>1,workingCell.getY()>>1,workingCell.getZ()>>1);
// Limite at parent level number of box (split by 2 by level)
const long limite = FMath::pow(2,inLevel-1);
const int limite = FMath::pow(2,inLevel-1);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(parentCell.getX() + idxX,0l,limite)) continue;
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
if(!FMath::Between(parentCell.getX() + idxX,0,limite)) continue;
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(parentCell.getY() + idxY,0l,limite)) continue;
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
if(!FMath::Between(parentCell.getY() + idxY,0,limite)) continue;
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(parentCell.getZ() + idxZ,0l,limite)) continue;
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
if(!FMath::Between(parentCell.getZ() + idxZ,0,limite)) continue;
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......
......@@ -166,8 +166,8 @@ public:
}
// We get the min/max indexes from each procs
FMpi::MpiAssert( MPI_Allgather( myIntervals, sizeof(Interval) * OctreeHeight, MPI_BYTE,
workingIntervalsPerLevel, sizeof(Interval) * OctreeHeight, MPI_BYTE, MPI_COMM_WORLD), __LINE__ );
FMpi::MpiAssert( MPI_Allgather( myIntervals, int(sizeof(Interval)) * OctreeHeight, MPI_BYTE,
workingIntervalsPerLevel, int(sizeof(Interval)) * OctreeHeight, MPI_BYTE, MPI_COMM_WORLD), __LINE__ );
}
// run;
......@@ -654,7 +654,7 @@ private:
toSend[idxLevel * nbProcess + idxProc][idxLeaf].getCurrentCell()->serializeUp(sendBuffer[idxLevel * nbProcess + idxProc][idxLeaf].data);
}
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxLevel * nbProcess + idxProc], toSendAtProcAtLevel * sizeof(CellToSend) , MPI_BYTE ,
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxLevel * nbProcess + idxProc], toSendAtProcAtLevel * int(sizeof(CellToSend)) , MPI_BYTE ,
idxProc, FMpi::TagLast + idxLevel, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
......@@ -662,7 +662,7 @@ private:
if(toReceiveFromProcAtLevel){
recvBuffer[idxLevel * nbProcess + idxProc] = new CellToSend[toReceiveFromProcAtLevel];
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxLevel * nbProcess + idxProc], toReceiveFromProcAtLevel * sizeof(CellToSend), MPI_BYTE,
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxLevel * nbProcess + idxProc], toReceiveFromProcAtLevel * int(sizeof(CellToSend)), MPI_BYTE,
idxProc, FMpi::TagLast + idxLevel, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
}
......@@ -1002,7 +1002,7 @@ private:
}
// Box limite
const long limite = 1 << (this->OctreeHeight - 1);
const int limite = 1 << (this->OctreeHeight - 1);
// pointer to send
typename OctreeClass::Iterator* toSend[nbProcess];
memset(toSend, 0, sizeof(typename OctreeClass::Iterator*) * nbProcess );
......@@ -1075,7 +1075,7 @@ private:
if(globalReceiveMap[idxProc * nbProcess + idProcess]){
recvBuffer[idxProc] = reinterpret_cast<ParticleClass*>(new char[sizeof(ParticleClass) * globalReceiveMap[idxProc * nbProcess + idProcess]]);
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxProc], globalReceiveMap[idxProc * nbProcess + idProcess]*sizeof(ParticleClass), MPI_BYTE,
FMpi::MpiAssert( MPI_Irecv(recvBuffer[idxProc], globalReceiveMap[idxProc * nbProcess + idProcess]*int(sizeof(ParticleClass)), MPI_BYTE,
idxProc, FMpi::TagFmmP2P, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
}
......@@ -1092,7 +1092,7 @@ private:
currentIndex += toSend[idxProc][idxLeaf].getCurrentListSrc()->getSize();
}
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxProc], sizeof(ParticleClass) * partsToSend[idxProc] , MPI_BYTE ,
FMpi::MpiAssert( MPI_Isend( sendBuffer[idxProc], int(sizeof(ParticleClass)) * partsToSend[idxProc] , MPI_BYTE ,
idxProc, FMpi::TagFmmP2P, MPI_COMM_WORLD, &requests[iterRequest++]) , __LINE__ );
}
......@@ -1256,7 +1256,7 @@ private:
//MortonIndex neighborsIndex[26];
int previous = 0;
// Box limite
const long limite = 1 << (this->OctreeHeight - 1);
const int limite = 1 << (this->OctreeHeight - 1);
for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
const int endAtThisShape = shapeLeaf[idxShape] + previous;
......@@ -1323,22 +1323,22 @@ private:
}
int getNeighborsIndexes(const MortonIndex centerIndex, const long limite, MortonIndex indexes[26]) const{
int getNeighborsIndexes(const MortonIndex centerIndex, const int limite, MortonIndex indexes[26]) const{
FTreeCoordinate relativePositions[26];
return getNeighborsIndexes(centerIndex, limite, indexes, relativePositions);
}
int getNeighborsIndexes(const MortonIndex centerIndex, const long limite, MortonIndex indexes[26], FTreeCoordinate inRelativePositions[26]) const{
int getNeighborsIndexes(const MortonIndex centerIndex, const int limite, MortonIndex indexes[26], FTreeCoordinate inRelativePositions[26]) const{
FTreeCoordinate center;
center.setPositionFromMorton(centerIndex, OctreeHeight - 1);
int idxNeig = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
// if we are not on the current cell
if( idxX || idxY || idxZ ){
FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
......@@ -1374,13 +1374,13 @@ private:
const FTreeCoordinate parentCell(workingCell.getX()>>1,workingCell.getY()>>1,workingCell.getZ()>>1);
// Limite at parent level number of box (split by 2 by level)
const long limite = FMath::pow(2,inLevel-1);
const int limite = FMath::pow(2,inLevel-1);
int idxNeighbors = 0;
// We test all cells around
for(long idxX = -1 ; idxX <= 1 ; ++idxX){
for(long idxY = -1 ; idxY <= 1 ; ++idxY){
for(long idxZ = -1 ; idxZ <= 1 ; ++idxZ){
for(int idxX = -1 ; idxX <= 1 ; ++idxX){
for(int idxY = -1 ; idxY <= 1 ; ++idxY){
for(int idxZ = -1 ; idxZ <= 1 ; ++idxZ){
// if we are not on the current cell
if( idxX || idxY || idxZ ){
......
......@@ -42,7 +42,7 @@ public:
}
/** To set the position from 3 FReals */
void setCoordinate(const long inX, const long inY, const long inZ) {
void setCoordinate(const int inX, const int inY, const int inZ) {
this->coordinate.setX(inX);
this->coordinate.setY(inY);
this->coordinate.setZ(inZ);
......
......@@ -44,7 +44,7 @@ protected:
FReal boxWidth; //< the box width read from file
FSize nbParticles; //< the number of particles read from file
int removeWarning;
size_t removeWarning;
public:
/**
......
......@@ -119,7 +119,7 @@ public:
}
else {
FILE* file(fopen(filename, "rb"));
int removeWarning(0);
size_t removeWarning(0);
// test if open
if(file != NULL) {
int sizeOfElement(0);
......
......@@ -26,9 +26,9 @@ private:
/** This method has been tacken from the octree
* it computes a tree coordinate (x or y or z) from real position
*/
static long getTreeCoordinate(const FReal inRelativePosition, const FReal boxWidthAtLeafLevel) {
static int getTreeCoordinate(const FReal inRelativePosition, const FReal boxWidthAtLeafLevel) {
const FReal indexFReal = inRelativePosition / boxWidthAtLeafLevel;
const long index = long(FMath::dfloor(indexFReal));
const int index = int(FMath::dfloor(indexFReal));
if( index && FMath::LookEqual(inRelativePosition, boxWidthAtLeafLevel * FReal(index) ) ){
return index - 1;
}
......@@ -66,7 +66,7 @@ private:
FTreeCoordinate host;
const FReal boxWidthAtLeafLevel = loader.getBoxWidth() / FReal(1 << (TreeHeight - 1) );
for(long idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(realParticlesIndexed[idxPart].particle);
host.setX( getTreeCoordinate( realParticlesIndexed[idxPart].particle.getPosition().getX() - boxCorner.getX(), boxWidthAtLeafLevel ));
host.setY( getTreeCoordinate( realParticlesIndexed[idxPart].particle.getPosition().getY() - boxCorner.getY(), boxWidthAtLeafLevel ));
......@@ -101,7 +101,7 @@ private:
const FReal boxWidthAtLeafLevel = boxWidth / FReal(1 << (TreeHeight - 1) );
for(long idxPart = 0 ; idxPart < size ; ++idxPart){
for(int idxPart = 0 ; idxPart < size ; ++idxPart){
realParticlesIndexed[idxPart].particle = array[idxPart];
host.setX( getTreeCoordinate( realParticlesIndexed[idxPart].particle.getPosition().getX() - boxCorner.getX(), boxWidthAtLeafLevel ));
host.setY( getTreeCoordinate( realParticlesIndexed[idxPart].particle.getPosition().getY() - boxCorner.getY(), boxWidthAtLeafLevel ));
......@@ -171,7 +171,7 @@ private:
sendBuffer = new IndexedParticle[particlesToSend];
memcpy(sendBuffer, &workingArray[idxPart + 1], particlesToSend * sizeof(IndexedParticle));
MPI_Isend( sendBuffer, particlesToSend * sizeof(IndexedParticle), MPI_BYTE, rank + 1, FMpi::TagSplittedLeaf, MPI_COMM_WORLD, &requestSendLeaf);
MPI_Isend( sendBuffer, particlesToSend * int(sizeof(IndexedParticle)), MPI_BYTE, rank + 1, FMpi::TagSplittedLeaf, MPI_COMM_WORLD, &requestSendLeaf);
}
else{
MPI_Isend( 0, 0, MPI_BYTE, rank + 1, FMpi::TagSplittedLeaf, MPI_COMM_WORLD, &requestSendLeaf);
......@@ -186,7 +186,7 @@ private:
MPI_Get_count( &probStatus, MPI_BYTE, &sendByOther);
if(sendByOther){
sendByOther /= sizeof(IndexedParticle);
sendByOther /= int(sizeof(IndexedParticle));
const IndexedParticle* const reallocOutputArray = workingArray;
const FSize reallocOutputSize = workingSize;
......@@ -196,7 +196,7 @@ private:
FMemUtils::memcpy(&workingArray[sendByOther], reallocOutputArray, reallocOutputSize * sizeof(IndexedParticle));
delete[] reallocOutputArray;
MPI_Recv(workingArray, sizeof(IndexedParticle) * sendByOther, MPI_BYTE, rank - 1, FMpi::TagSplittedLeaf, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Recv(workingArray, int(sizeof(IndexedParticle)) * sendByOther, MPI_BYTE, rank - 1, FMpi::TagSplittedLeaf, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
}
else{
MPI_Recv( 0, 0, MPI_BYTE, rank - 1, FMpi::TagSplittedLeaf, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
......
......@@ -156,7 +156,7 @@ protected:
this->transitionM2M[idxLevel] = new FComplexe*[8];
this->transitionL2L[idxLevel] = new FComplexe*[8];
for(long idxChild = 0; idxChild < 8; ++idxChild){
for(int idxChild = 0; idxChild < 8; ++idxChild){
this->transitionM2M[idxLevel][idxChild] = new FComplexe[FMB_Info_exp_size];
this->transitionL2L[idxLevel][idxChild] = new FComplexe[FMB_Info_exp_size];
}
......@@ -167,13 +167,13 @@ protected:
for(int idxLevel = 0; idxLevel < this->TreeHeight; ++idxLevel){
//this->transferM2L[idxLevel] = new FComplexe***[this->size1Dim];
for(long idxD1 = 0 ; idxD1 < this->size1Dim; ++idxD1){
for(int idxD1 = 0 ; idxD1 < this->size1Dim; ++idxD1){
//this->transferM2L[idxLevel][idxD1] = new FComplexe**[this->size1Dim];
for(long idxD2 = 0; idxD2 < this->size1Dim; ++idxD2){
for(int idxD2 = 0; idxD2 < this->size1Dim; ++idxD2){
//this->transferM2L[idxLevel][idxD1][idxD2] = new FComplexe*[this->size1Dim];
for(long idxD3 = 0; idxD3 < this->size1Dim; ++idxD3){
for(int idxD3 = 0; idxD3 < this->size1Dim; ++idxD3){
const int x = idxD1 - this->halphSize1Dim;
const int y = idxD2 - this->halphSize1Dim;
const int z = idxD3 - this->halphSize1Dim;
......@@ -195,8 +195,8 @@ protected:
// transfer_M2L_free
void transferDeallocate(){
// M2M L2L
/*for(long idxLevel = 0 ; idxLevel < this->TreeHeight ; ++idxLevel){
for(long idxChild = 0; idxChild < 8; ++idxChild){
/*for(int idxLevel = 0 ; idxLevel < this->TreeHeight ; ++idxLevel){
for(int idxChild = 0; idxChild < 8; ++idxChild){
delete [] this->transitionM2M[idxLevel][idxChild];
delete [] this->transitionL2L[idxLevel][idxChild];
}
......@@ -207,9 +207,9 @@ protected:
delete [] this->transitionL2L;*/
// M2L