⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 source-guide.tex

📁 fortran并行计算包
💻 TEX
📖 第 1 页 / 共 2 页
字号:
... what else is in there?\subsection{Calling ADIO Functions}Throughout the code you will see calls to functions such as ADIO\_ReadContig.There is no such function - this is actually a macro defined inadio/include/adioi.h that calls the particular function out of the correctADIOI\_Fns\_struct for the file being accessed.  This is done for convenience.Exceptions!!!  ADIO\_Open, ADIO\_Close...\section{ROMIO Implementation Details}The ROMIO Implementation relies on some basic concepts in order to operate andto optimize I/O access.  In this section we will discuss these concepts andhow they are implemented within ROMIO.  Before we do that though, we willdiscuss the core data structure of ROMIO, the ADIO\_File structure.\subsection{ADIO\_File}... discussion ...\subsection{I/O Aggregation and Aggregators}When performing collective I/O operations, it is often to our advantage tocombine operations or eliminate redundant operations altogether.  We call thiscombining process "aggregation", and processes that perform these combinedoperations aggregators.Aggregators are defined at the time the file is opened.  A collection of MPIhints can be used to tune what processes become aggregators for a given file(see ROMIO User's Guide).  The aggregators will then interact with the filesystem during collective operations.Note that it is possible to implement a system where ALL I/O operations passexclusively through aggregators, including independent I/O operations fromnon-aggregators.  However, this would require a guarantee of progress from theaggregators that for portability would mean adding a thread to manage I/O.  Wehave chosen not to pursue this path at this time, so independent operationscontinue to be serviced by the process making the call.... how implemented ...Rank 0 in the communicator opening a file \emph{always} processes thecb\_config\_list hint using ADIOI\_cb\_config\_list\_parse.  A previous call toADIOI\_cb\_gather\_name\_array had collected the processor names from all hostsinto an array that is cached on the communicator (so we don't have to gatherit more than once).  This creates an ordered array of ranks (relative to thecommunicator used to open the file) that will be aggregators.  This array isdistributed to all processes using ADIOI\_cb\_bcast\_rank\_map.  Aggregators arereferenced by their rank in the communicator used to open the file.  Theseranks are stored in fd->hints->ranklist[].Note that this could be a big list for very large runs.  If we were torestrict aggregators to a rank order subset, we could use a bitfield instead.If the user specified hints and met conditions for deferred open, then aseparate communicator is also set up (fd->agg\_comm) that contains all theaggregators, in order of their original ranks (not their order in the ranklist).  Otherwise this communicator is set to MPI\_COMM\_NULL, and in any caseit is set to this for non-aggregators.  This communicator is currently onlyused at ADIO\_Close (adio/common/ad\_close.c), but could be useful in two-phaseI/O as well (discussed later).\subsection{Deferred Open}We do not always want all processes to attempt to actually open a file whenMPI\_File\_open is called.  We might want to avoid this open because in factsome processes (non-aggregators) cannot access the file at all and would getan error, or we might want to avoid this open to avoid a storm of system callshitting the file system all at once.  In either case, ROMIO implements a"deferred open" mode that allows some processes to avoid opening the fileuntil such time as they perform an independent I/O operation on the file (seeROMIO User's Guide).Deferred open has a broad impact on the ROMIO implementation, because with itsaddition there are now many places where we must first check to see if we havecalled the file system specific ADIO Open call before performing I/O.  Thisimpact is limited to the MPI-IO layer by semantically guaranteeing the FS ADIOOpen call has been made by the process prior to calling a read or writefunction.... how implemented ...\subsection{Two-Phase I/O}Two-Phase I/O is a technique for increasing the efficiency of I/O operationsby reordering data between processes, either before writes, or after reads.ROMIO implements two-phase I/O as part of the generic implementations ofADIO\_WriteStridedColl and ADIO\_ReadStridedColl.  These implementations in turnrely heavily on the aggregation code to determine what processes will actuallyperform I/O on behalf of the application as a whole.\subsection{Data Sieving}Data sieving is a single-process technique for reducing the number of I/Ooperations used to service a MPI read or write operation by accessing acontiguous region of the file that contains more than one desired region atonce.  Because often I/O operations require data movement across the network,this is usually a more efficient way to access data.Data sieving is implemented in the common strided I/O routines(adio/common/ad\_write\_str.c and adio/common/ad\_read\_str.c).  These functionsuse the contig read and write routines to perform actual I/O.  In the case ofa write operation, a read/modify/write sequence is used.  In that case, aswell as in the atomic mode case, locking is required on the region.  Some ofthe ADIO implementations do not currently support locking, and in those casesit would be erroneous to use the generic strided I/O routines.\subsection{Shared File Pointers}Because no file systems supported by ROMIO currently support a shared filepointer mode, ROMIO must implement shared file pointers under the covers onits own.Currently ROMIO implements shared file pointers by storing the file pointervalue in a separate file...Note that the ROMIO team has devised a portable method for implementing sharedfile pointers using only MPI-1 and MPI-2 functions.  However, this method hasnot yet been implemented in ROMIO.file name is selected at end of mpi-io/open.c.\subsection{Error Handling}\subsection{MPI and MPIO Requests}\section*{Appendix A: ADIO Functions and Semantics}ADIOI\_Open(ADIO\_File fd, int *error\_code)Open is used in a strange way in ROMIO, as described previously.The Open function is used to perform whatever operations are necessary priorto actually accessing a file using read or write.  The file name for the fileis stored in fd->filename prior to Open being called.Note that when deferred open is in effect, all processes may not immediatelycall Open at MPI\_File\_open time, but instead call open if they performindependent I/O.  This can result in somewhat unusual error returns toprocesses (e.g. learning that a file is not accessible at write time).ADIOI\_ReadContig(ADIO\_File fd, void *buf, int count, MPI\_Datatype datatype,int file\_ptr\_type, ADIO\_Offset offset, ADIO\_Status *status, int *error\_code)ReadContig is used to read a contiguous region from a file into a contiguousbuffer.  The datatype (which refers to the buffer) can be assumed to becontiguous.  The offset is in bytes and is an absolute offset ifADIO\_EXPLICIT\_OFFSET was passed as the file\_ptr\_type or relative to thecurrent individual file pointer if ADIO\_INDIVIDUAL was passed asfile\_ptr\_type.  Open has been called by this process prior to the call toReadContig.  There is no guarantee that any other processes will call thisfunction at the same time.ADIOI\_WriteContig(ADIO\_File fd, void *buf, int count, MPI\_Datatype datatype,int file\_ptr\_type, ADIO\_Offset offset, ADIO\_Status *status, int *error\_code)WriteContig is used to write a contiguous region to a file from a contiguousbuffer.  The datatype (which refers to the buffer) can be assumed to becontiguous.  The offset is in bytes and is an absolute offset ifADIO\_EXPLICIT\_OFFSET was passed as the file\_ptr\_type or relative to thecurrent individual file pointer if ADIO\_INDIVIDUAL was passed asfile\_ptr\_type.  Open has been called by this process prior to the call toWriteContig.  There is no guarantee that any other processes will call thisfunction at the same time.ADIOI\_ReadStridedCollADIOI\_WriteStridedCollADIOI\_SeekIndividualADIOI\_FcntlADIOI\_SetInfoADIOI\_ReadStridedADIOI\_WriteStridedADIOI\_Close(ADIO\_File fd, int *error\_code)Close is responsible for releasing any resources associated with an open file.It is called on all processes that called the corresponding ADIOI Open, whichmight not be all the processes that opened the file (due to deferred open).Thus it is not safe to perform collective communication among all processes inthe communicator during Close, although collective communication betweenaggregators would be safe (if desired).For performance reasons ROMIO does not guarantee that all file data is writtento "storage" at MPI\_File\_close, instead only performing synchronizationoperations at MPI\_File\_sync time.  As a result, our Close implementations donot typically call a sync.  However, any locally cached data, if any, shouldbe passed on to the underlying storage system at this time.Note that ADIOI\_GEN\_Close is implemented in adio/common/adi\_close.c;ad\_close.c implements ADIO\_Close, which is called by all processes that openedthe file.ADIOI\_IreadContigADIOI\_IwriteContigADIOI\_ReadDoneADIOI\_WriteDoneADIOI\_ReadCompleteADIOI\_WriteCompleteADIOI\_IreadStridedADIOI\_IwriteStridedADIOI\_FlushADIOI\_Resize(ADIO\_File fd, ADIO\_Offset size, int *error\_code)Resize is called collectively by all processes that opened the file referencedby fd.  It is not required that the Resize implementation block until allprocesses have completed resize operations, but each process should be able tosee the correct size with a corresponding MPI\_File\_get\_size operation (anindependent operation that results in an ADIO Fcntl to obtain the file size).ADIOI\_Delete(char *filename, int *error\_code)Delete is called independently, and because only a filename is passed, thereis no opportunity to coordinate deletion if an application were to choose tohave all processes call MPI\_File\_delete.  That's not likely to be an issuethough.\section*{Appendix B: Status of ADIO Implementations}... who wrote what, status, etc.Appendix C: Adding a New ADIO ImplementationReferences\end{document}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -