Commit e8f3b15a authored by BRAMAS Berenger's avatar BRAMAS Berenger

Remove warnings

parent 1fd98d21
......@@ -616,14 +616,14 @@ public:
/** To get access to leafs elements (child suboctree)
* @param index the position of the leaf/child suboctree
* @return child at this index */
FAbstractSubOctree<FReal,CellClass,ContainerClass,LeafClass,CellAllocatorClass>* leafs(const int index) {
FAbstractSubOctree<FReal,CellClass,ContainerClass,LeafClass,CellAllocatorClass>* leafs(const size_t index) {
return this->subleafs[index];
}
/** To get access to leafs elements (child suboctree)
* @param index the position of the leaf/child suboctree
* @return child at this index */
const FAbstractSubOctree<FReal,CellClass,ContainerClass,LeafClass,CellAllocatorClass>* leafs(const int index) const {
const FAbstractSubOctree<FReal,CellClass,ContainerClass,LeafClass,CellAllocatorClass>* leafs(const size_t index) const {
return this->subleafs[index];
}
};
......
......@@ -326,7 +326,7 @@ public:
else{
// We need to know the number of leaves per procs
std::unique_ptr<FSize[]> numberOfLeavesPerProc(new FSize[nbProcs]);
FMpi::MpiAssert(MPI_Allgather((FSize*)&currentNbLeaves, 1, MPI_LONG_LONG_INT, numberOfLeavesPerProc.get(),
FMpi::MpiAssert(MPI_Allgather(const_cast<FSize*>(&currentNbLeaves), 1, MPI_LONG_LONG_INT, numberOfLeavesPerProc.get(),
1, MPI_LONG_LONG_INT, communicator.getComm()), __LINE__);
//prefix sum
......@@ -366,9 +366,9 @@ public:
for(FSize idxMess = 0 ; idxMess < nbPartsPerPackToSend[idxPack]; idxMess += MAX_PARTICLES_PER_MPI_MESS){
const int nbElementsInMessage = int(FMath::Min(nbPartsPerPackToSend[idxPack]-idxMess, MAX_PARTICLES_PER_MPI_MESS));
requestsParts.emplace_back();
FMpi::MpiAssert(MPI_Isend((ParticleClass*)&particlesArrayInLeafOrder[leavesOffsetInParticles[pack.elementFrom]+idxMess],
sizeof(ParticleClass)*nbElementsInMessage,
MPI_BYTE, pack.idProc, FMpi::TagExchangeIndexs + 2 + idxMess, communicator.getComm(), &requestsParts.back()), __LINE__);
FMpi::MpiAssert(MPI_Isend(const_cast<ParticleClass*>(&particlesArrayInLeafOrder[leavesOffsetInParticles[pack.elementFrom]+idxMess]),
int(sizeof(ParticleClass)*nbElementsInMessage),
MPI_BYTE, pack.idProc, int(FMpi::TagExchangeIndexs + 2 + idxMess), communicator.getComm(), &requestsParts.back()), __LINE__);
}
}
else {
......@@ -411,7 +411,7 @@ public:
}
}
FMpi::MpiAssert(MPI_Waitall(requestsNbParts.size(), requestsNbParts.data(), MPI_STATUSES_IGNORE), __LINE__);
FMpi::MpiAssert(MPI_Waitall(int(requestsNbParts.size()), requestsNbParts.data(), MPI_STATUSES_IGNORE), __LINE__);
// Count the number of leaf to receive
FSize totalPartsToReceive = 0;
......@@ -431,8 +431,8 @@ public:
const int nbElementsInMessage = int(FMath::Min(nbPartsPerPackToRecv[idxPack]-idxMess, MAX_PARTICLES_PER_MPI_MESS));
requestsParts.emplace_back();
FMpi::MpiAssert( MPI_Irecv(&particlesRecvBuffer[offsetToRecv+idxMess],
sizeof(ParticleClass)*nbElementsInMessage, MPI_BYTE, pack.idProc,
FMpi::TagExchangeIndexs + 2 + idxMess, communicator.getComm(), &requestsParts.back()), __LINE__);
int(sizeof(ParticleClass)*nbElementsInMessage), MPI_BYTE, pack.idProc,
int(FMpi::TagExchangeIndexs + 2 + idxMess), communicator.getComm(), &requestsParts.back()), __LINE__);
}
}
else if(pack.idProc == myRank){
......@@ -446,7 +446,7 @@ public:
}
// Finalize communication
FMpi::MpiAssert(MPI_Waitall(requestsParts.size(), requestsParts.data(), MPI_STATUSES_IGNORE), __LINE__);
FMpi::MpiAssert(MPI_Waitall(int(requestsParts.size()), requestsParts.data(), MPI_STATUSES_IGNORE), __LINE__);
// Insert in the particle saver
for(FSize idPartsToStore = 0 ; idPartsToStore < int(particlesRecvBuffer.size()) ; ++idPartsToStore){
......@@ -488,13 +488,13 @@ public:
const int finalNbParticles = particleSaver->getSize();
if(communicator.processId() != 0){
FMpi::MpiAssert(MPI_Gather((int*)&finalNbParticles,1,MPI_INT,nullptr,1,MPI_INT,0,communicator.getComm()), __LINE__);
FMpi::MpiAssert(MPI_Gather(const_cast<int*>(&finalNbParticles),1,MPI_INT,nullptr,1,MPI_INT,0,communicator.getComm()), __LINE__);
}
else{
const int nbProcs = communicator.processCount();
std::unique_ptr<int[]> nbPartsPerProc(new int[nbProcs]);
FMpi::MpiAssert(MPI_Gather((int*)&finalNbParticles,1,MPI_INT,nbPartsPerProc.get(),1,MPI_INT,0,communicator.getComm()), __LINE__);
FMpi::MpiAssert(MPI_Gather(const_cast<int*>(&finalNbParticles),1,MPI_INT,nbPartsPerProc.get(),1,MPI_INT,0,communicator.getComm()), __LINE__);
FReal averageNbParticles = 0;
int minNbParticles = finalNbParticles;
......
......@@ -27,7 +27,7 @@ class FGroupOfCells {
protected:
//< The size of the memoryBuffer
int allocatedMemoryInByte;
size_t allocatedMemoryInByte;
//< Pointer to a block memory
unsigned char* memoryBuffer;
......@@ -168,7 +168,7 @@ public:
}
/** The the size of the allocated buffer */
int getBufferSizeInByte() const {
size_t getBufferSizeInByte() const {
return allocatedMemoryInByte;
}
......@@ -183,7 +183,7 @@ public:
}
/** The the size of the allocated buffer */
int getMultipoleBufferSizeInByte() const {
size_t getMultipoleBufferSizeInByte() const {
return sizeof(PoleCellClass)*blockHeader->numberOfCellsInBlock;
}
......@@ -198,7 +198,7 @@ public:
}
/** The the size of the allocated buffer */
int getLocalBufferSizeInByte() const {
size_t getLocalBufferSizeInByte() const {
return sizeof(LocalCellClass)*blockHeader->numberOfCellsInBlock;
}
......
......@@ -62,7 +62,7 @@ protected:
static const int LeafIsEmptyFlag = -1;
//< The size of memoryBuffer in byte
int allocatedMemoryInByte;
size_t allocatedMemoryInByte;
//< Pointer to a block memory
unsigned char* memoryBuffer;
......@@ -208,7 +208,7 @@ public:
}
/** The the size of the allocated buffer */
int getBufferSizeInByte() const {
size_t getBufferSizeInByte() const {
return allocatedMemoryInByte;
}
......@@ -223,7 +223,7 @@ public:
}
/** The the size of the allocated buffer */
int getAttributesBufferSizeInByte() const {
size_t getAttributesBufferSizeInByte() const {
return blockHeader->attributeOffset*NbAttributesPerParticle;
}
......
......@@ -162,15 +162,15 @@ protected:
int currentOutInteraction = 0;
for(int idxLeftGroup = 0 ; idxLeftGroup < idxGroup && currentOutInteraction < int(outsideInteractions.size()) ; ++idxLeftGroup){
ParticleGroupClass* leftContainers = tree->getParticleGroup(idxLeftGroup);
const MortonIndex blockStartIdx = leftContainers->getStartingIndex();
const MortonIndex blockEndIdx = leftContainers->getEndingIndex();
const MortonIndex blockStartIdxOther = leftContainers->getStartingIndex();
const MortonIndex blockEndIdxOther = leftContainers->getEndingIndex();
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdx){
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdxOther){
currentOutInteraction += 1;
}
int lastOutInteraction = currentOutInteraction;
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdx){
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdxOther){
lastOutInteraction += 1;
}
......@@ -237,15 +237,15 @@ protected:
int currentOutInteraction = 0;
for(int idxLeftGroup = 0 ; idxLeftGroup < idxGroup && currentOutInteraction < int(outsideInteractions.size()) ; ++idxLeftGroup){
CellContainerClass* leftCells = tree->getCellGroup(idxLevel, idxLeftGroup);
const MortonIndex blockStartIdx = leftCells->getStartingIndex();
const MortonIndex blockEndIdx = leftCells->getEndingIndex();
const MortonIndex blockStartIdxOther = leftCells->getStartingIndex();
const MortonIndex blockEndIdxOther = leftCells->getEndingIndex();
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdx){
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdxOther){
currentOutInteraction += 1;
}
int lastOutInteraction = currentOutInteraction;
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdx){
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdxOther){
lastOutInteraction += 1;
}
......
......@@ -157,15 +157,15 @@ protected:
int currentOutInteraction = 0;
for(int idxLeftGroup = 0 ; idxLeftGroup < idxGroup && currentOutInteraction < int(outsideInteractions.size()) ; ++idxLeftGroup){
ParticleGroupClass* leftContainers = tree->getParticleGroup(idxLeftGroup);
const MortonIndex blockStartIdx = leftContainers->getStartingIndex();
const MortonIndex blockEndIdx = leftContainers->getEndingIndex();
const MortonIndex blockStartIdxOther = leftContainers->getStartingIndex();
const MortonIndex blockEndIdxOther = leftContainers->getEndingIndex();
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdx){
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdxOther){
currentOutInteraction += 1;
}
int lastOutInteraction = currentOutInteraction;
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdx){
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdxOther){
lastOutInteraction += 1;
}
......@@ -232,10 +232,10 @@ protected:
int currentOutInteraction = 0;
for(int idxLeftGroup = 0 ; idxLeftGroup < idxGroup && currentOutInteraction < int(outsideInteractions.size()) ; ++idxLeftGroup){
CellContainerClass* leftCells = tree->getCellGroup(idxLevel, idxLeftGroup);
const MortonIndex blockStartIdx = leftCells->getStartingIndex();
const MortonIndex blockEndIdx = leftCells->getEndingIndex();
const MortonIndex blockStartIdxOther = leftCells->getStartingIndex();
const MortonIndex blockEndIdxOther = leftCells->getEndingIndex();
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdx){
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdxOther){
currentOutInteraction += 1;
}
......
......@@ -99,7 +99,7 @@ protected:
starpu_codelet p2p_cl_in;
starpu_codelet p2p_cl_inout;
#ifdef STARPU_USE_CPU
#ifdef STARPU_USE_CPU
StarPUCpuWrapperClass cpuWrapper;
#endif
#ifdef SCALFMM_ENABLE_CUDA_KERNEL
......@@ -569,15 +569,15 @@ protected:
int currentOutInteraction = 0;
for(int idxLeftGroup = 0 ; idxLeftGroup < idxGroup && currentOutInteraction < int(outsideInteractions.size()) ; ++idxLeftGroup){
ParticleGroupClass* leftContainers = tree->getParticleGroup(idxLeftGroup);
const MortonIndex blockStartIdx = leftContainers->getStartingIndex();
const MortonIndex blockEndIdx = leftContainers->getEndingIndex();
const MortonIndex blockStartIdxOther = leftContainers->getStartingIndex();
const MortonIndex blockEndIdxOther = leftContainers->getEndingIndex();
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdx){
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdxOther){
currentOutInteraction += 1;
}
int lastOutInteraction = currentOutInteraction;
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdx){
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdxOther){
lastOutInteraction += 1;
}
......@@ -645,15 +645,15 @@ protected:
int currentOutInteraction = 0;
for(int idxLeftGroup = 0 ; idxLeftGroup < idxGroup && currentOutInteraction < int(outsideInteractions.size()) ; ++idxLeftGroup){
CellContainerClass* leftCells = tree->getCellGroup(idxLevel, idxLeftGroup);
const MortonIndex blockStartIdx = leftCells->getStartingIndex();
const MortonIndex blockEndIdx = leftCells->getEndingIndex();
const MortonIndex blockStartIdxOther = leftCells->getStartingIndex();
const MortonIndex blockEndIdxOther = leftCells->getEndingIndex();
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdx){
while(currentOutInteraction < int(outsideInteractions.size()) && outsideInteractions[currentOutInteraction].outIndex < blockStartIdxOther){
currentOutInteraction += 1;
}
int lastOutInteraction = currentOutInteraction;
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdx){
while(lastOutInteraction < int(outsideInteractions.size()) && outsideInteractions[lastOutInteraction].outIndex < blockEndIdxOther){
lastOutInteraction += 1;
}
......
......@@ -188,14 +188,14 @@ class FQuickSortMpi : public FQuickSort< SortType, IndexType> {
MPI_Request currentRequest;
const int nbBytesInMessage = int(FMath::Min(IndexType(FQS_MAX_MPI_BYTES), totalByteToRecv-idxSize));
FMpi::Assert( MPI_Irecv(&ptrDataToRecv[idxSize], nbBytesInMessage, MPI_BYTE, pack.idProc,
FMpi::TagQuickSort + idxSize, currentComm.getComm(), &currentRequest) , __LINE__);
int(FMpi::TagQuickSort + idxSize), currentComm.getComm(), &currentRequest) , __LINE__);
requests.push_back(currentRequest);
}
}
FAssertLF(whatToRecvFromWho.size() <= requests.size());
// Wait to complete
FMpi::Assert( MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE), __LINE__ );
FMpi::Assert( MPI_Waitall(int(requests.size()), requests.data(), MPI_STATUSES_IGNORE), __LINE__ );
////FLOG( FLog::Controller << currentComm.processId() << "] Recv Done \n"; )
// Copy to ouput variables
(*inPartRecv) = recvBuffer;
......@@ -221,19 +221,19 @@ class FQuickSortMpi : public FQuickSort< SortType, IndexType> {
// Work per max size
const IndexType nbElementsInPack = (pack.toElement - pack.fromElement);
const IndexType totalByteToSend = nbElementsInPack*sizeof(SortType);
unsigned char*const ptrDataToSend = (unsigned char*)&inPartToSend[pack.fromElement];
unsigned char*const ptrDataToSend = (unsigned char*)const_cast<SortType*>(&inPartToSend[pack.fromElement]);
for(IndexType idxSize = 0 ; idxSize < totalByteToSend ; idxSize += FQS_MAX_MPI_BYTES){
MPI_Request currentRequest;
const int nbBytesInMessage = int(FMath::Min(IndexType(FQS_MAX_MPI_BYTES), totalByteToSend-idxSize));
FMpi::Assert( MPI_Isend((SortType*)&ptrDataToSend[idxSize], nbBytesInMessage, MPI_BYTE , pack.idProc,
FMpi::TagQuickSort + idxSize, currentComm.getComm(), &currentRequest) , __LINE__);
int(FMpi::TagQuickSort + idxSize), currentComm.getComm(), &currentRequest) , __LINE__);
requests.push_back(currentRequest);
}
}
FAssertLF(whatToSendToWho.size() <= requests.size());
// Wait to complete
FMpi::Assert( MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE), __LINE__ );
FMpi::Assert( MPI_Waitall(int(requests.size()), requests.data(), MPI_STATUSES_IGNORE), __LINE__ );
////FLOG( FLog::Controller << currentComm.processId() << "] Send Done \n"; )
}
......@@ -370,8 +370,8 @@ public:
int procInTheMiddle;
if(globalNumberOfElementsLower == 0) procInTheMiddle = -1;
else if(globalNumberOfElementsGreater == 0) procInTheMiddle = currentNbProcs-1;
else procInTheMiddle = FMath::Min(IndexType(currentNbProcs-2), (currentNbProcs*globalNumberOfElementsLower)
/(globalNumberOfElementsGreater + globalNumberOfElementsLower));
else procInTheMiddle = int(FMath::Min(IndexType(currentNbProcs-2), (currentNbProcs*globalNumberOfElementsLower)
/(globalNumberOfElementsGreater + globalNumberOfElementsLower)));
////FLOG( FLog::Controller << currentComm.processId() << "] procInTheMiddle = " << procInTheMiddle << "\n"; )
......
......@@ -104,7 +104,7 @@ int main(int argc, char* argv[]){
// Usual octree
OctreeClass tree(NbLevels, 2, loader.getBoxWidth(), loader.getCenterOfBox());
FP2PParticleContainer<FReal> allParticles;
FTestParticleContainer<FReal> allParticles;
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
FPoint<FReal> particlePosition;
#ifndef LOAD_FILE
......
......@@ -106,7 +106,7 @@ int main(int argc, char* argv[]){
&myParticles,
&balancer);
FP2PParticleContainer<FReal> allParticles;
FTestParticleContainer<FReal> allParticles;
for(int idxPart = 0 ; idxPart < myParticles.getSize() ; ++idxPart){
allParticles.push(myParticles[idxPart].position);
}
......@@ -125,7 +125,7 @@ int main(int argc, char* argv[]){
mpiComm.global().getComm(), MPI_STATUS_IGNORE), __LINE__);
}
if(mpiComm.global().processId() != mpiComm.global().processCount()-1){
FMpi::Assert(MPI_Send((void*)&myLeftLimite, sizeof(myLeftLimite), MPI_BYTE,
FMpi::Assert(MPI_Send(const_cast<MortonIndex*>(&myLeftLimite), sizeof(myLeftLimite), MPI_BYTE,
mpiComm.global().processId()+1, 0,
mpiComm.global().getComm()), __LINE__);
}
......
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