Commit 0de43401 authored by Berenger Bramas's avatar Berenger Bramas

Update the Call to MPI where const cast is needed for old implementation

parent 0d25c845
......@@ -113,7 +113,7 @@ public:
std::cout << "FMpiFmaGenericWriter only works with binary file (.bfma)." << std::endl;
std::exit(EXIT_FAILURE);
}
int fileIsOpen = MPI_File_open( _parallelManager->global().getComm(), inFilename.c_str(),
int fileIsOpen = MPI_File_open( _parallelManager->global().getComm(), const_cast<char*>(inFilename.c_str()),
MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &_mpiFile );
// Is it open?
if(fileIsOpen != MPI_SUCCESS){
......@@ -306,7 +306,7 @@ public:
MPI_Type_size(MPI_INT, &sizeType) ;
_headerSize += sizeType*2 ;
if(myRank==0){
ierr = MPI_File_write_at(_mpiFile, _headerSize, &nbParticles, 1, mpiFSize_t, MPI_STATUS_IGNORE);
ierr = MPI_File_write_at(_mpiFile, _headerSize, const_cast<FSize*>(&nbParticles), 1, mpiFSize_t, MPI_STATUS_IGNORE);
}
MPI_Type_size(mpiFSize_t, &sizeType) ;
_headerSize += sizeType*1 ;
......@@ -341,7 +341,7 @@ public:
std::vector<FReal> particles(maxPartLeaf*_nbDataTowritePerRecord);
// Build the offset for eaxh processes
FSize before=0; // Number of particles before me (rank < myrank)
MPI_Scan(&nbLocalParticles,&before,1,mpiFSize_t,MPI_SUM,_parallelManager->global().getComm());
MPI_Scan(const_cast<FSize*>(&nbLocalParticles),&before,1,mpiFSize_t,MPI_SUM,_parallelManager->global().getComm());
before -= nbLocalParticles ;
MPI_Offset offset = _headerSize + sizeType*_nbDataTowritePerRecord*before;
//
......
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