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 ){
......
......@@ -39,10 +39,10 @@ protected:
CellClass*** cells; //< Potential cells, cells are allocated only if needed
FAbstractSubOctree* const parent; //< Parent suboctree (null for root)
const long indexInParent; //< This is the index of the current octree in the parent's array
const int indexInParent; //< This is the index of the current octree in the parent's array
long leftLeafIndex; //< The leaf at the left position (this is the array index to start when iterate)
long rightLeafIndex; //< The leaf at the right position (this is the last array index when iterate)
int leftLeafIndex; //< The leaf at the left position (this is the array index to start when iterate)
int rightLeafIndex; //< The leaf at the right position (this is the last array index when iterate)
const int subOctreeHeight; //< Height of this suboctree
const int subOctreePosition; //< Level of the current suboctree in the global tree (0 if node)
......@@ -107,7 +107,7 @@ protected:
* for example it updates the leaf array marges and calls createPreviousCells()
* @param arrayIndex the position of the new leaf in the leafs array
*/
void newLeafInserted(const long arrayIndex, const MortonIndex inLeafCellIndex, const FTreeCoordinate& host, const FReal* const inBoxWidthAtLevel){
void newLeafInserted(const int arrayIndex, const MortonIndex inLeafCellIndex, const FTreeCoordinate& host, const FReal* const inBoxWidthAtLevel){
createPreviousCells(arrayIndex,inLeafCellIndex, host, inBoxWidthAtLevel);
// Update if this is the bottom left
if(arrayIndex < this->leftLeafIndex) this->leftLeafIndex = arrayIndex;
......@@ -120,7 +120,7 @@ protected:
* this cell too and go upper, etc.
* @return true if there is no more cells in this tree
*/
bool removeCellsFromLeaf( long arrayIndex ){
bool removeCellsFromLeaf( int arrayIndex ){
// last array index
int indexLevel = this->subOctreeHeight - 1;
......@@ -172,7 +172,7 @@ public:
* @param inSubOctreeHeight Height of this suboctree
* @param inSubOctreePosition Level of the current suboctree in the global tree (1 if upper tree)
*/
FAbstractSubOctree(FAbstractSubOctree* const inParent, const long inIndexInParent,
FAbstractSubOctree(FAbstractSubOctree* const inParent, const int inIndexInParent,
const int inSubOctreeHeight, const int inSubOctreePosition, const bool inIsLeafSubtree) :
cells(0), parent( inParent ), indexInParent(inIndexInParent), leftLeafIndex(1 << (3 * inSubOctreeHeight)), rightLeafIndex(-1),
subOctreeHeight( inSubOctreeHeight ), subOctreePosition( inSubOctreePosition ), isLeafSubtree(inIsLeafSubtree) {
......@@ -181,7 +181,7 @@ public:
fassert(this->cells, "Allocation failled", __LINE__, __FILE__);
// We start at a sub-level - 8^1
long cellsAtlevel = 8;
int cellsAtlevel = 8;
for( int indexLevel = 0 ; indexLevel < this->subOctreeHeight ; ++indexLevel ){
this->cells[indexLevel] = new CellClass*[cellsAtlevel];
fassert(this->cells[indexLevel], "Allocation failled", __LINE__, __FILE__);
......@@ -199,11 +199,11 @@ public:
* Delete cells arrays and allocated cells
*/
virtual ~FAbstractSubOctree(){
long mostRight = rightLeafIndex;
long mostLeft = leftLeafIndex;
int mostRight = rightLeafIndex;
int mostLeft = leftLeafIndex;
for( int indexLevel = this->subOctreeHeight - 1 ; indexLevel >= 0 ; --indexLevel ){
for( long indexCells = mostLeft ; indexCells <= mostRight ; ++indexCells ){
for( int indexCells = mostLeft ; indexCells <= mostRight ; ++indexCells ){
if(this->cells[indexLevel][indexCells]){
//delete this->cells[indexLevel][indexCells];
}
......@@ -251,14 +251,14 @@ public:
/** Return the more left leaf index
* the smallest index on the leafs array
* @return leftLeafIndex */
long getLeftLeafIndex() const {
int getLeftLeafIndex() const {
return leftLeafIndex;
}
/** Return the more right leaf index
* the biggest index on the leafs array
* @return rightLeafIndex */
long getRightLeafIndex() const {
int getRightLeafIndex() const {
return rightLeafIndex;
}
......@@ -292,7 +292,7 @@ public:
* This index can is part of the morton index of the cells contains
* in this suboctree
* @return indexInParent */
long getIndexInParent() const{
int getIndexInParent() const{
return indexInParent;
}
......@@ -341,16 +341,16 @@ public:
* @param inSubOctreeHeight Height of this suboctree
* @param inSubOctreePosition Level of the current suboctree in the global tree (1 if upper tree)
*/
FSubOctreeWithLeafs(FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>* const inParent, const long inIndexInParent,
FSubOctreeWithLeafs(FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>* const inParent, const int inIndexInParent,
const int inSubOctreeHeight, const int inSubOctreePosition) :
FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>(inParent, inIndexInParent, inSubOctreeHeight, inSubOctreePosition, true) {
const long cellsAtLeafLevel = 1 << (3 * inSubOctreeHeight);
const int cellsAtLeafLevel = 1 << (3 * inSubOctreeHeight);
this->leafs = new LeafClass*[cellsAtLeafLevel];
fassert(this->leafs, "Allocation failled", __LINE__, __FILE__);
for( long indexLeaf = 0 ; indexLeaf < cellsAtLeafLevel ; ++indexLeaf ){
for( int indexLeaf = 0 ; indexLeaf < cellsAtLeafLevel ; ++indexLeaf ){
this->leafs[indexLeaf] = 0;
}
}
......@@ -378,7 +378,7 @@ public:
if( !this->leafs[arrayIndex] ){
this->leafs[arrayIndex] = new LeafClass();
FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::newLeafInserted( long(arrayIndex) , index, host, inBoxWidthAtLevel);
FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::newLeafInserted( int(arrayIndex) , index, host, inBoxWidthAtLevel);
}
// add particle to leaf list
this->leafs[arrayIndex]->push(inParticle);
......@@ -395,7 +395,7 @@ public:
delete this->leafs[arrayIndex];
this->leafs[arrayIndex] = 0;
return FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::removeCellsFromLeaf( long(arrayIndex) );
return FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::removeCellsFromLeaf( int(arrayIndex) );
}
return false;
}
......@@ -473,11 +473,11 @@ public:
* @param inSubOctreeHeight Height of this suboctree
* @param inSubOctreePosition Level of the current suboctree in the global tree (0 if upper tree)
*/
FSubOctree(FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>* const inParent, const long inIndexInParent,
FSubOctree(FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>* const inParent, const int inIndexInParent,
const int inSubOctreeHeight, const int inSubOctreePosition) :
FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>(inParent, inIndexInParent, inSubOctreeHeight, inSubOctreePosition, false) {
const long cellsAtLeafLevel = 1 << (3 * inSubOctreeHeight);
const int cellsAtLeafLevel = 1 << (3 * inSubOctreeHeight);
this->subleafs = new FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>*[cellsAtLeafLevel];
fassert(this->subleafs, "Allocation failled", __LINE__, __FILE__);
......@@ -490,7 +490,7 @@ public:
* Destructor dealloc all suboctrees leafs & leafs array
*/
virtual ~FSubOctree(){
const long cellsAtLeafLevel = 1 << (3 * this->subOctreeHeight);
const int cellsAtLeafLevel = 1 << (3 * this->subOctreeHeight);
for( int indexLeaf = 0 ; indexLeaf < cellsAtLeafLevel ; ++indexLeaf ){
if(this->subleafs[indexLeaf]) delete this->subleafs[indexLeaf];
}
......@@ -512,11 +512,11 @@ public:
// Next suboctree is a middle suboctree
if(inTreeHeight > nextSubOctreeHeight + nextSubOctreePosition){
this->subleafs[arrayIndex] = new FSubOctree(this,long(arrayIndex),nextSubOctreeHeight,nextSubOctreePosition);
this->subleafs[arrayIndex] = new FSubOctree(this,int(arrayIndex),nextSubOctreeHeight,nextSubOctreePosition);
}
// Or next suboctree contains the reail leaf!
else{
this->subleafs[arrayIndex] = new FSubOctreeWithLeafs<ParticleClass,CellClass,ContainerClass,LeafClass>(this,long(arrayIndex),nextSubOctreeHeight,nextSubOctreePosition);
this->subleafs[arrayIndex] = new FSubOctreeWithLeafs<ParticleClass,CellClass,ContainerClass,LeafClass>(this,int(arrayIndex),nextSubOctreeHeight,nextSubOctreePosition);
}
const FTreeCoordinate hostAtLevel(
......@@ -525,7 +525,7 @@ public:
host.getZ() >> (inTreeHeight - nextSubOctreePosition ));
// We need to inform parent class
FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::newLeafInserted( long(arrayIndex), index >> (3 * (inTreeHeight-nextSubOctreePosition) ), hostAtLevel, inBoxWidthAtLevel);
FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::newLeafInserted( int(arrayIndex), index >> (3 * (inTreeHeight-nextSubOctreePosition) ), hostAtLevel, inBoxWidthAtLevel);
}
// Ask next suboctree to insert the particle
this->subleafs[arrayIndex]->insert( index, host, inParticle, inTreeHeight, inBoxWidthAtLevel);
......@@ -542,7 +542,7 @@ public:
delete this->subleafs[arrayIndex];
this->subleafs[arrayIndex] = 0;
return FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::removeCellsFromLeaf( long(arrayIndex) );
return FAbstractSubOctree<ParticleClass,CellClass,ContainerClass,LeafClass>::removeCellsFromLeaf( int(arrayIndex) );
}
return false;
}
......
......@@ -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 ){
......