VSS Mpi 2
VSS Mpi 2
Sathish Vadhiyar
•http://www-unix.mcs.anl.gov/mpi/mpi-standard/mpi-report-2.0/mpi2-report.htm
•Using MPI2: Advanced Features of the Message-Passing Interface.
http://www-unix.mcs.anl.gov/mpi/usingmpi2/
MPI-2
…….
One sided communications
Parallel I/O
………
Parallel I/O
Motivation
High level parallel I/O interface
Supports file partitioning among
processes
Transfer of data structures between
process memories and files
Also supports
Asynchronous/non-blocking I/O
Strided / Non-contiguous access
Collective I/O
Definitions
Displacement – file position from the
beginning of a file
etype – unit of data access
filetype – template for accessing the file
view – current set of data accessible by a
process. Repetition of filetype pattern
define a view
offset – position relative to the current view
Examples
File Manipulation
MPI_FILE_OPEN(comm, filename, amode,
info, fh)
MPI_FILE_CLOSE(fh)
File View
MPI_FILE_SET_VIEW(fh, disp, etype,
filetype, datarep, info)
MPI_FILE_GET_VIEW(fh, disp, etype,
filetype, datarep)
Input Parameters
ndims number of array dimensions (positive integer)
array_of_sizes number of elements of type oldtype in each
dimension of the full array (array of positive integers)
array_of_subsizes number of elements of type newtype in each
dimension of the subarray (array of positive integers)
array_of_starts starting coordinates of the subarray in each
dimension (array of nonnegative integers)
order array storage order flag (state)
oldtype old datatype (handle)
Output Parameters
newtype
new datatype (handle)
Example: filetype creation
sizes[0]=100; sizes[1]=100;
subsizes[0]=100; subsizes[1]=25;
starts[0]=0; starts[1]=rank*subsizes[1];
gsizes[0] = m; gsizes[1] = n;
psizes[0] = row_procs; psizes[1] = col_procs;
lsizes[0] = m/psizes[0]; lsizes[1] = n/psizes[1];
dims[0] = 2; dims[1] = 3;
periods[0] = periods[1] = 1;
DO i=1,m
j = map(i)/p
k = MOD(map(i),p)
CALL MPI_ACCUMULATE(A(i), 1, MPI_REAL, j, k, 1, MPI_REAL, &
MPI_SUM, win, ierr)
END DO
CALL MPI_WIN_FENCE(0, win, ierr)
CALL MPI_WIN_FREE(win, ierr)
RETURN END
Synchronization
3 synchronization mechanisms:
- MPI_WIN_FENCE (at origin and target)
(for active target)
- MPI_WIN_START, MPI_WIN_COMPLETE
(origin)
MPI_WIN_POST, MPI_WIN_WAIT (target)
(for active target)
- MPI_WIN_LOCK, MPI_WIN_UNLOCK
(only at origin) (passive target)
Active synchronization