Skip to content

Commit

Permalink
fix MPI_File const error
Browse files Browse the repository at this point in the history
  • Loading branch information
patflick committed Dec 27, 2018
1 parent 56df6f6 commit f09a41c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/mxx/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct file {

void open(const std::string& filename, int mode) {
this->filename = filename;
MPI_File_open(MPI_COMM_SELF, &filename[0], mode, MPI_INFO_NULL, &handle);
MPI_File_open(MPI_COMM_SELF, const_cast<char*>(filename.c_str()), mode, MPI_INFO_NULL, &handle);
this->isopen = true;
}

Expand All @@ -122,7 +122,7 @@ struct file {
}

static void delete_file(const std::string& filename) {
MPI_File_delete(&filename[0], MPI_INFO_NULL);
MPI_File_delete(const_cast<char*>(filename.c_str()), MPI_INFO_NULL);
}


Expand Down Expand Up @@ -210,7 +210,7 @@ struct coll_file : public file {
}

void open(int mode) {
MPI_File_open(comm, &filename[0], mode, MPI_INFO_NULL, &handle);
MPI_File_open(comm, const_cast<char*>(filename.c_str()), mode, MPI_INFO_NULL, &handle);
this->isopen = true;
}
};
Expand Down

0 comments on commit f09a41c

Please sign in to comment.