diff --git a/include/mxx/file.hpp b/include/mxx/file.hpp index bfc70b6..2a0f697 100644 --- a/include/mxx/file.hpp +++ b/include/mxx/file.hpp @@ -116,7 +116,7 @@ std::string file_block_decompose(const char* filename, MPI_Comm comm = MPI_COMM_ template void write_ordered(const std::string& filename, const T* buf, size_t count, const mxx::comm& comm) { MPI_File handle; - MPI_File_open(comm, &filename[0], MPI_MODE_CREATE | MPI_MODE_WRONLY, MPI_INFO_NULL, &handle); + MPI_File_open(comm, const_cast(&filename[0]), MPI_MODE_CREATE | MPI_MODE_WRONLY, MPI_INFO_NULL, &handle); mxx::datatype dt = mxx::get_datatype(); MPI_File_write_ordered(handle, const_cast(buf), count, dt.type(), MPI_STATUS_IGNORE); MPI_File_close(&handle);