Hardware Reference
In-Depth Information
start
data partitioning of
P
P 1
a 2D global array
P 2
P 3
end
aggregate access region
file offset view of
start
end
subarrays in the
file space
P
P 1
P
P 1
P
P 1
P 2
P 3
P 2
P 3
disp
request aggregation phase
Two−phase I/O
I/O aggregators
P
P
0
2
P 0 's file domain
P 2 's file domain
file access phase
file system
FIGURE 13.3: A 5 8 2D array partitioned among 4 MPI processes in a
block{block pattern and its data layout in the le. The data layout in the le
follows the array's canonical order. The bottom part describes the two-phase
I/O operation carried out in MPI collective I/O.
At each checkpoint, the intention considers writing the 2D array as a single
request. The outcome, and hence the user requirement, is that the 2D array
is saved in the file starting from the given file offset, denoted as disp , and
occupies a contiguous space of size equal to 5 8 = 40 integers. This section
continues to describe three ways of using MPI-IO functions to carry out such
I/O operations and discusses how they differ in their way of expressing the
user intent.
13.3.1 Independent I/O
MPI-IO functions consist of two types: independent and collective. The
MPI-IO read/write functions discussed so far belong to the independent I/O
category, and their use is very similar to that of POSIX I/O functions. As for
collective I/O functions, their appearance and syntax look the same as the in-
dependent ones, except that the collective functions have a sux, all , added
to their names. The name \independent" implies the functions can be called
by a process independently from another process. There is no restriction on
the number of calls a process can make, and they need not match with calls
on other processes. Collective functions, on the other hand, require the partic-
ipation of all processes that collectively open the shared file. The participant
processes are identified by the MPI communicator passed to MPIFileopen .
For example, Figure 13.4(a) shows an MPI code fragment that uses
MPIFilewriteat , an independent I/O function, to write the 2D array in
parallel. In this case, the loop at line 2 runs N iterations where N is equal
to 3 for process ranks 0 and 1, and 2 for ranks 2 and 3. From this example,
 
Search WWH ::




Custom Search