From 704f2517e7dc2770f76b62d4a630b7c54f038b07 Mon Sep 17 00:00:00 2001 From: Patrick Flick Date: Mon, 10 Sep 2018 14:47:30 -0400 Subject: [PATCH] fixing const problem for older MPI --- include/mxx/file.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);