📄 source-guide.tex
字号:
% \documentstyle[11pt,psfig]{article}\documentclass[11pt]{article}\hoffset=-.7in\voffset=-.6in\textwidth=6.5in\textheight=8.5in\begin{document}\vspace*{-1in}\thispagestyle{empty}\begin{center}ARGONNE NATIONAL LABORATORY \\9700 South Cass Avenue \\Argonne, IL 60439\end{center}\vskip .5 in\begin{center}\rule{1.75in}{.01in} \\\vspace{.1in}ANL/MCS-TM-XXX \\\rule{1.75in}{.01in} \\\vskip 1.3 in{\Large\bf A Guide to the ROMIO MPI-IO Implementation } \\by \\ [2ex]{\large\it Robert Ross, Robert Latham, and Rajeev Thakur}\vspace{1in}Mathematics and Computer Science Division\bigskipTechnical Memorandum No.\ XXX% \vspace{1.4in}% Revised May 2004\end{center}\vfill{\small\noindentThis work was supported by the Mathematical, Information, andComputational Sciences Division subprogram of the Office of AdvancedScientific Computing Research, U.S. Department of Energy, underContract W-31-109-Eng-38; and by the Scalable I/O Initiative, amultiagency project funded by the Defense Advanced Research ProjectsAgency (Contract DABT63-94-C-0049), the Department of Energy, theNational Aeronautics and Space Administration, and the NationalScience Foundation.}\newpage%% Line Spacing (e.g., \ls{1} for single, \ls{2} for double, even \ls{1.5})%%\newcommand{\ls}[1] {\dimen0=\fontdimen6\the\font \lineskip=#1\dimen0 \advance\lineskip.5\fontdimen5\the\font \advance\lineskip-\dimen0 \lineskiplimit=.9\lineskip \baselineskip=\lineskip \advance\baselineskip\dimen0 \normallineskip\lineskip \normallineskiplimit\lineskiplimit \normalbaselineskip\baselineskip \ignorespaces }\renewcommand{\baselinestretch}{1}\newcommand {\ix} {\hspace*{2em}}\newcommand {\mc} {\multicolumn}\tableofcontents\thispagestyle{empty}\newpage\pagenumbering{arabic}\setcounter{page}{1}\begin{center}{\bf Users Guide for ROMIO: A High-Performance,\\[1ex]Portable MPI-IO Implementation} \\ [2ex]by \\ [2ex]{\it Rajeev Thakur, Robert Ross, Ewing Lusk, and William Gropp}\end{center}\addcontentsline{toc}{section}{Abstract}\begin{abstract}\noindentROMIO is a high-performance, portable implementation of MPI-IO (theI/O chapter in \mbox{MPI-2}).This document describes the internals of the ROMIO implementation.\end{abstract}\section{Introduction}The ROMIO MPI-IO implementation, originally written by Rajeev Thakur, has beenin existence since XXX.... Discussion of the evolution of ROMIO ...Architecturally, ROMIO is broken up into three layers: a layer implementingthe MPI I/O routines in terms of an abstract device for I/O (ADIO), a layer ofcommon code implementing a subset of the ADIO interface, and a set of storagesystem specific functions that complete the ADIO implementation in terms ofthat storage type. These three layers work together to provide I/O supportfor MPI applications.In this document we will discuss the details of the ROMIO implementation,including the major components, how those components are implemented, andwhere those components are located in the ROMIO source tree.\section{The Directory Structure}The ROMIO directory structure consists of two main branches, the MPI-IO branch(mpi-io) and the ADIO branch (adio). The MPI-IO branch contains code thatimplements the functions defined in the MPI-2 specification for I/O, such asMPI\_File\_open. These functions are then written in terms of other functionsthat provide an abstract interface to I/O resources, the ADIO functions.There is an additional glue subdirectory in the MPI-IO branch that definesfunctions related to the MPI implementation as a whole, such as how toallocate MPI\_File structures and how to report errors.Code for the ADIO functions is located under the ADIO branch. This code isresponsible for performing I/O operations on whatever underlying storage isavailable. There are two categories of directories in this branch. The firstis the common directory. This directory contains two distinct types ofsource: source that is used by all ADIO implementations and source that iscommon across many ADIO implementations. This distinction will become moreapparent when we discuss file system implementations.The second category of directory in the ADIO branch is the file systemspecific directory (e.g. ad\_ufs, ad\_pvfs2). These directories provide codethat is specific to a particular file system type and is only built if thatfile system type is selected at configure time.\section{The Configure Process}... What can be specified, AIO stuff, where romioconf exists, how to addanother Makefile.in into the list.\section{File System Implementations}Each file system implementation exists in its own subdirectory under the adiodirectory in the source tree. Each of these subdirectories must contain atleast two files, a Makefile.in (describing how to build the code in thedirectory) and a C source file describing the mapping of ADIO operations to Cfunctions.The common practice is to name this file based on the name of the ADIOimplementation. In the ad\_ufs implementation this file is called ad\_ufs.c,and contains the following:\begin{verbatim}struct ADIOI_Fns_struct ADIO_UFS_operations = { ADIOI_UFS_Open, /* Open */ ADIOI_GEN_ReadContig, /* ReadContig */ ADIOI_GEN_WriteContig, /* WriteContig */ ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */ ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */ ADIOI_GEN_SeekIndividual, /* SeekIndividual */ ADIOI_GEN_Fcntl, /* Fcntl */ ADIOI_GEN_SetInfo, /* SetInfo */ ADIOI_GEN_ReadStrided, /* ReadStrided */ ADIOI_GEN_WriteStrided, /* WriteStrided */ ADIOI_GEN_Close, /* Close */ ADIOI_GEN_IreadContig, /* IreadContig */ ADIOI_GEN_IwriteContig, /* IwriteContig */ ADIOI_GEN_IODone, /* ReadDone */ ADIOI_GEN_IODone, /* WriteDone */ ADIOI_GEN_IOComplete, /* ReadComplete */ ADIOI_GEN_IOComplete, /* WriteComplete */ ADIOI_GEN_IreadStrided, /* IreadStrided */ ADIOI_GEN_IwriteStrided, /* IwriteStrided */ ADIOI_GEN_Flush, /* Flush */ ADIOI_GEN_Resize, /* Resize */ ADIOI_GEN_Delete, /* Delete */};\end{verbatim}The ADIOI\_Fns\_struct structure is defined in adio/include/adioi.h. Thisstructure holds pointers to appropriate functions for a given file systemtype. "Generic" functions, defined in adio/common, are denoted by the"ADIOI\_GEN" prefix, while file system specific functions use a file systemrelated prefix. In this example, the only file system specific function isADIOI\_UFS\_Open. All other operations use the generic versions.Typically a third file, a header with file system specific defines andincludes, is also provided and named based on the name of the ADIOimplementation (e.g. ad\_ufs.h).Because the UFS implementation provides its own open function, that code must be provided in the ad\_ufs subdirectory. That function is implemented in adio/ad\_ufs/ad\_ufs\_open.c.\section{Generic Functions}As we saw in the discussion above, generic ADIO function implementations areused to minimize the amount of code in the ROMIO tree by sharing commonfunctionality between ADIO implementations. As the ROMIO implementation hasgrown, a few categories of generic implementations have developed. At thistime, these are all lumped into the adio/common subdirectory together, whichcan be confusing.The easiest category of generic functions to understand is the ones thatimplement functionality in terms of some other ADIO function.ADIOI\_GEN\_ReadStridedColl is a good example of this type of function and isimplemented in adio/common/ad\_read\_coll.c. This function implementscollective read operations (e.g. MPI\_File\_read\_at\_all). We will discuss howit works later in this document, but for the time being it is sufficient tonote that it is written in terms of ADIO ReadStrided or ReadContig calls.A second category of generic functions are ones that implement functionalityin terms of POSIX I/O calls. ADIOI\_GEN\_ReadContig (adio/common/ad\_read.c) isa good example of this type of function. These "generic" functions are theresult of a large number of ADIO implementations that are largely POSIX I/Obased, such as the UFS, XFS, and PANFS implementations. We have discussedmoving these functions into a separate common/posix subdirectory and renamingthem with ADIOI\_POSIX prefixes, but this has not been done as of the writingof this document.The next category of generic functions holds functions that do not actuallyrequire I/O at all. ADIOI\_GEN\_SeekIndividual (adio/common/ad\_seek.c) is agood example of this. Since we don't need to actually perform I/O at seektime, we can just update local variables at each process. In fact, one couldargue that we no longer need the ADIO SeekIndividual function at all - all theADIO implementations simply use this generic version (with the exception ofTESTFS, which prints the value as well).The next category of generic functions are the "FAKE" functions (e.g.ADIOI\_FAKE\_IODone implemented in adio/common/ad\_done\_fake.c). These functionsare all related to asynchronous I/O (AIO) operations. These implement the AIOoperations in terms of blocking operations - in other words, they follow thestandard but do not allow for overlap of I/O and computation or communication.These are used in cases where AIO support is otherwise unavailable orunimplemented.The final category of generic functions are the "na侊ve" functions (e.g.ADIOI\_GEN\_WriteStrided\_naive in adio/common/ad\_write\_str\_naive.c). Thesefunctions avoid the use of certain optimizations, such as data sieving.Other Things in adio/common
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -