+\r
+\r
+ int File::write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){\r
+ //get position first as we may be doing non contiguous reads and it will probably be updated badly\r
+ MPI_Offset position = fh->file_->tell();\r
+ MPI_Offset movesize = datatype->get_extent()*count;\r
+ MPI_Offset writesize = datatype->size()*count;\r
+ XBT_DEBUG("Position before write in MPI_File %s : %llu",fh->file_->get_path(),fh->file_->tell());\r
+ MPI_Offset write = fh->file_->write(writesize);\r
+ XBT_DEBUG("Write in MPI_File %s, %lld bytes read, readsize %lld bytes, movesize %lld", fh->file_->get_path(), write, writesize, movesize);\r
+ if(writesize!=movesize){\r
+ fh->file_->seek(position+movesize, SEEK_SET);\r