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;
}
......
......@@ -48,7 +48,7 @@
template <class OctreeClass, class CellContainerClass, class KernelClass, class ParticleGroupClass, class StarPUCpuWrapperClass
#ifdef SCALFMM_ENABLE_CUDA_KERNEL
, class StarPUCudaWrapperClass = FStarPUCudaWrapper<KernelClass, FCudaEmptyCellSymb, int, int, FCudaGroupOfCells<FCudaEmptyCellSymb, int, int>,
FCudaGroupOfParticles<0, 0, int>, FCudaGroupAttachedLeaf<0, 0, int>, FCudaEmptyKernel>
FCudaGroupOfParticles<int, 0, 0, int>, FCudaGroupAttachedLeaf<int, 0, 0, int>, FCudaEmptyKernel<int> >
#endif
#ifdef SCALFMM_ENABLE_OPENCL_KERNEL
, class StarPUOpenClWrapperClass = FStarPUOpenClWrapper<KernelClass, FOpenCLDeviceWrapper<KernelClass>>
......@@ -69,7 +69,7 @@ protected:
int shift = 0;
int height = tree->getHeight();
while(height) { shift += 1; height >>= 1; }
return (((mindex<<shift) + inLevel) << 5) + mode;
return int((((mindex<<shift) + inLevel) << 5) + mode);
}
const FMpi::FComm& comm;
......@@ -593,6 +593,8 @@ protected:
starpu_data_handle_t handleUp;
unsigned char * ptrDown;
starpu_data_handle_t handleDown;
int intervalSize;
};
std::vector<std::vector<RemoteHandle>> remoteCellGroups;
......@@ -740,15 +742,15 @@ protected:
FAssertLF(idxOtherGroup < int(processesBlockInfos[idxLevel].size()));
}
const MortonIndex blockStartIdx = processesBlockInfos[idxLevel][idxOtherGroup].firstIndex;
const MortonIndex blockEndIdx = processesBlockInfos[idxLevel][idxOtherGroup].lastIndex;
const MortonIndex blockStartIdxOther = processesBlockInfos[idxLevel][idxOtherGroup].firstIndex;
const MortonIndex blockEndIdxOther = processesBlockInfos[idxLevel][idxOtherGroup].lastIndex;
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;
}
......@@ -759,12 +761,12 @@ protected:
#pragma omp critical(CreateM2LRemotes)
{
if(remoteCellGroups[idxLevel][idxOtherGroup].ptrSymb == nullptr){
const int nbBytesInBlockSymb = processesBlockInfos[idxLevel][idxOtherGroup].bufferSizeSymb;
const size_t nbBytesInBlockSymb = processesBlockInfos[idxLevel][idxOtherGroup].bufferSizeSymb;
unsigned char* memoryBlockSymb = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlockSymb);
remoteCellGroups[idxLevel][idxOtherGroup].ptrSymb = memoryBlockSymb;
starpu_variable_data_register(&remoteCellGroups[idxLevel][idxOtherGroup].handleSymb, 0,
(uintptr_t)remoteCellGroups[idxLevel][idxOtherGroup].ptrSymb, nbBytesInBlockSymb);
const int nbBytesInBlockUp = processesBlockInfos[idxLevel][idxOtherGroup].bufferSizeUp;
const size_t nbBytesInBlockUp = processesBlockInfos[idxLevel][idxOtherGroup].bufferSizeUp;
unsigned char* memoryBlockUp = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlockUp);
remoteCellGroups[idxLevel][idxOtherGroup].ptrUp = memoryBlockUp;
starpu_variable_data_register(&remoteCellGroups[idxLevel][idxOtherGroup].handleUp, 0,
......@@ -844,15 +846,15 @@ protected:
FAssertLF(idxOtherGroup < int(processesBlockInfos[tree->getHeight()-1].size()));
}
const MortonIndex blockStartIdx = processesBlockInfos[tree->getHeight()-1][idxOtherGroup].firstIndex;
const MortonIndex blockEndIdx = processesBlockInfos[tree->getHeight()-1][idxOtherGroup].lastIndex;
const MortonIndex blockStartIdxOther = processesBlockInfos[tree->getHeight()-1][idxOtherGroup].firstIndex;
const MortonIndex blockEndIdxOther = processesBlockInfos[tree->getHeight()-1][idxOtherGroup].lastIndex;
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;
}
......@@ -862,7 +864,7 @@ protected:
#pragma omp critical(CreateM2LRemotes)
{
if(remoteParticleGroupss[idxOtherGroup].ptrSymb == nullptr){
const int nbBytesInBlock = processesBlockInfos[tree->getHeight()-1][idxOtherGroup].leavesBufferSize;
const size_t nbBytesInBlock = processesBlockInfos[tree->getHeight()-1][idxOtherGroup].leavesBufferSize;
unsigned char* memoryBlock = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlock);
remoteParticleGroupss[idxOtherGroup].ptrSymb = memoryBlock;
starpu_variable_data_register(&remoteParticleGroupss[idxOtherGroup].handleSymb, 0,
......@@ -963,15 +965,15 @@ protected:
std::unique_ptr<int[]> displs(new int[comm.processCount()]);
displs[0] = 0;
for(int idxProc = 1 ; idxProc < comm.processCount() ; ++idxProc){
displs[idxProc] = displs[idxProc-1] + nbBlocksToSendToEach[idxProc-1];
for(int idxProcOther = 1 ; idxProcOther < comm.processCount() ; ++idxProcOther){
displs[idxProcOther] = displs[idxProcOther-1] + nbBlocksToSendToEach[idxProcOther-1];
}
toSend.resize(displs[comm.processCount()-1] + nbBlocksToSendToEach[comm.processCount()-1]);
// We work in bytes
for(int idxProc = 0 ; idxProc < comm.processCount() ; ++idxProc){
nbBlocksToSendToEach[idxProc] *= sizeof(MpiDependency);
displs[idxProc] *= sizeof(MpiDependency);
for(int idxProcOther = 0 ; idxProcOther < comm.processCount() ; ++idxProcOther){
nbBlocksToSendToEach[idxProcOther] *= int(sizeof(MpiDependency));
displs[idxProcOther] *= int(sizeof(MpiDependency));
}
FMpi::Assert(MPI_Gatherv( nullptr, 0, MPI_BYTE,
......@@ -1156,15 +1158,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;
}
......@@ -1232,15 +1234,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;
}
......@@ -1370,13 +1372,13 @@ protected:
myLastIdx == (processesBlockInfos[idxLevel+1][firstOtherBlock + idxBlockToRecv].firstIndex >> 3)){
if(remoteCellGroups[idxLevel+1][firstOtherBlock + idxBlockToRecv].ptrSymb == nullptr){
const int nbBytesInBlockSymb = processesBlockInfos[idxLevel+1][firstOtherBlock + idxBlockToRecv].bufferSizeSymb;
const size_t nbBytesInBlockSymb = processesBlockInfos[idxLevel+1][firstOtherBlock + idxBlockToRecv].bufferSizeSymb;
unsigned char* memoryBlockSymb = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlockSymb);
remoteCellGroups[idxLevel+1][firstOtherBlock + idxBlockToRecv].ptrSymb = memoryBlockSymb;
starpu_variable_data_register(&remoteCellGroups[idxLevel+1][firstOtherBlock + idxBlockToRecv].handleSymb, 0,
(uintptr_t)remoteCellGroups[idxLevel+1][firstOtherBlock + idxBlockToRecv].ptrSymb, nbBytesInBlockSymb);
const int nbBytesInBlockUp = processesBlockInfos[idxLevel+1][firstOtherBlock + idxBlockToRecv].bufferSizeUp;
const size_t nbBytesInBlockUp = processesBlockInfos[idxLevel+1][firstOtherBlock + idxBlockToRecv].bufferSizeUp;
unsigned char* memoryBlockUp = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlockUp);
remoteCellGroups[idxLevel+1][firstOtherBlock + idxBlockToRecv].ptrUp = memoryBlockUp;
starpu_variable_data_register(&remoteCellGroups[idxLevel+1][firstOtherBlock + idxBlockToRecv].handleUp, 0,
......@@ -1620,14 +1622,14 @@ protected:
FAssertLF(processesBlockInfos[idxLevel][firstOtherBlock].lastIndex-1 == missingParentIdx);
if(remoteCellGroups[idxLevel][firstOtherBlock].ptrSymb == nullptr){
const int nbBytesInBlock = processesBlockInfos[idxLevel][firstOtherBlock].bufferSizeSymb;
const size_t nbBytesInBlock = processesBlockInfos[idxLevel][firstOtherBlock].bufferSizeSymb;
unsigned char* memoryBlock = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlock);
remoteCellGroups[idxLevel][firstOtherBlock].ptrSymb = memoryBlock;
starpu_variable_data_register(&remoteCellGroups[idxLevel][firstOtherBlock].handleSymb, 0,
(uintptr_t)remoteCellGroups[idxLevel][firstOtherBlock].ptrSymb, nbBytesInBlock);
}
if(remoteCellGroups[idxLevel][firstOtherBlock].ptrDown == nullptr){
const int nbBytesInBlock = processesBlockInfos[idxLevel][firstOtherBlock].bufferSizeDown;
const size_t nbBytesInBlock = processesBlockInfos[idxLevel][firstOtherBlock].bufferSizeDown;
unsigned char* memoryBlock = (unsigned char*)FAlignedMemory::AllocateBytes<32>(nbBytesInBlock);
remoteCellGroups[idxLevel][firstOtherBlock].ptrDown = memoryBlock;
starpu_variable_data_register(&remoteCellGroups[idxLevel][firstOtherBlock].handleDown, 0,
......
......@@ -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