@@ -21,6 +21,8 @@ MPI.Barrier(comm)
21
21
fh = MPI. File. open (comm, filename, read= true , write= true , create= true )
22
22
@test MPI. File. get_position_shared (fh) == 0
23
23
24
+ MPI. Barrier (comm)
25
+
24
26
header = " my header"
25
27
26
28
if rank == 0
@@ -38,12 +40,16 @@ byte_offset = MPI.File.get_byte_offset(fh, offset)
38
40
MPI. File. set_view! (fh, byte_offset, MPI. Datatype (Int64), MPI. Datatype (Int64))
39
41
@test MPI. File. get_position_shared (fh) == 0
40
42
43
+ MPI. Barrier (comm)
44
+
41
45
MPI. File. write_ordered (fh, fill (Int64 (rank), rank+ 1 ))
42
46
@test MPI. File. get_position_shared (fh) == sum (1 : sz)
43
47
44
48
MPI. File. seek_shared (fh, 0 )
45
49
@test MPI. File. get_position_shared (fh) == 0
46
50
51
+ MPI. Barrier (comm)
52
+
47
53
buf = zeros (Int64, rank+ 1 )
48
54
MPI. File. read_ordered! (fh, buf)
49
55
@test buf == fill (Int64 (rank), rank+ 1 )
@@ -55,6 +61,8 @@ MPI.File.set_view!(fh, 0, MPI.Datatype(UInt8), MPI.Datatype(UInt8))
55
61
MPI. File. seek_shared (fh, 0 )
56
62
@test MPI. File. get_position_shared (fh) == 0
57
63
64
+ MPI. Barrier (comm)
65
+
58
66
if rank == sz- 1
59
67
buf = Array {UInt8} (undef, sizeof (header))
60
68
MPI. File. read_shared! (fh, buf)
0 commit comments