@@ -4,7 +4,7 @@ FileHandle() = FileHandle(FILE_NULL.val)
44
55module File
66
7- import MPI: MPI, @mpichk , _doc_external, MPIPtr, libmpi, refcount_inc, refcount_dec,
7+ import MPI: MPI, @mpichk , _doc_external, MPIPtr, libmpi, refcount_inc, refcount_dec, free,
88 Comm, MPI_Comm, FileHandle, MPI_File, Info, MPI_Info, FILE_NULL,
99 Datatype, MPI_Datatype, MPI_Offset, Status, Buffer, Buffer_send
1010import Base: close
@@ -71,6 +71,38 @@ function close(file::FileHandle)
7171 return nothing
7272end
7373
74+ # Info
75+ """
76+ MPI.File.get_info(file::FileHandle)
77+
78+ Returns the hints for a file that are actually being used by MPI.
79+
80+ # External links
81+ $(_doc_external (" MPI_File_get_info" ))
82+ """
83+ function get_info (file:: FileHandle )
84+ file_info = Info (init= false )
85+ @mpichk ccall ((:MPI_File_get_info , libmpi), Cint,
86+ (MPI_File, Ptr{MPI_Info}), file, file_info)
87+ refcount_inc ()
88+ finalizer (free, file_info)
89+ return file_info
90+ end
91+
92+ """
93+ MPI.File.set_info!(file::FileHandle, info::Info)
94+
95+ Collectively sets new values for the hints associated with a MPI.File.FileHandle.
96+
97+ # External links
98+ $(_doc_external (" MPI_File_set_info" ))
99+ """
100+ function set_info! (file:: FileHandle , info:: Info )
101+ @mpichk ccall ((:MPI_File_set_info , libmpi), Cint,
102+ (MPI_File, MPI_Info), file, info)
103+ return file
104+ end
105+
74106# View
75107"""
76108 MPI.File.set_view!(file::FileHandle, disp::Integer, etype::Datatype, filetype::Datatype, datarep::AbstractString; kwargs...)
@@ -322,7 +354,7 @@ $(_doc_external("MPI_File_write_ordered"))
322354function write_ordered (file:: FileHandle , buf:: Buffer )
323355 stat_ref = Ref {Status} (MPI. STATUS_EMPTY)
324356 # int MPI_File_write_ordered(MPI_File fh, const void *buf, int count,
325- # MPI_Datatype datatype, MPI_Status *status)
357+ # MPI_Datatype datatype, MPI_Status *status)
326358 @mpichk ccall ((:MPI_File_write_ordered , libmpi), Cint,
327359 (MPI_File, MPIPtr, Cint, MPI_Datatype, Ptr{Status}),
328360 file, buf. data, buf. count, buf. datatype, stat_ref)
@@ -335,7 +367,7 @@ write_ordered(file::FileHandle, buf) = write_ordered(file, Buffer_send(buf))
335367 SEEK_SET = MPI. MPI_SEEK_SET
336368 SEEK_CUR = MPI. MPI_SEEK_CUR
337369 SEEK_END = MPI. MPI_SEEK_END
338- end
370+ end
339371
340372"""
341373 MPI.File.seek_shared(file::FileHandle, offset::Integer, whence::Seek=SEEK_SET)
0 commit comments