@@ -4,7 +4,7 @@ FileHandle() = FileHandle(FILE_NULL.val)
4
4
5
5
module File
6
6
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,
8
8
Comm, MPI_Comm, FileHandle, MPI_File, Info, MPI_Info, FILE_NULL,
9
9
Datatype, MPI_Datatype, MPI_Offset, Status, Buffer, Buffer_send
10
10
import Base: close
@@ -71,6 +71,38 @@ function close(file::FileHandle)
71
71
return nothing
72
72
end
73
73
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
+
74
106
# View
75
107
"""
76
108
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"))
322
354
function write_ordered (file:: FileHandle , buf:: Buffer )
323
355
stat_ref = Ref {Status} (MPI. STATUS_EMPTY)
324
356
# 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)
326
358
@mpichk ccall ((:MPI_File_write_ordered , libmpi), Cint,
327
359
(MPI_File, MPIPtr, Cint, MPI_Datatype, Ptr{Status}),
328
360
file, buf. data, buf. count, buf. datatype, stat_ref)
@@ -335,7 +367,7 @@ write_ordered(file::FileHandle, buf) = write_ordered(file, Buffer_send(buf))
335
367
SEEK_SET = MPI. MPI_SEEK_SET
336
368
SEEK_CUR = MPI. MPI_SEEK_CUR
337
369
SEEK_END = MPI. MPI_SEEK_END
338
- end
370
+ end
339
371
340
372
"""
341
373
MPI.File.seek_shared(file::FileHandle, offset::Integer, whence::Seek=SEEK_SET)
0 commit comments