J3/04-221 Date: 22 January 2004 To: J3 From: Dan Nagle Subject: Performance Information on Open One recurrent theme, which has never been satisfactorily answered, is: "How to put performance hints on OPEN statements?" Of course, the reason is that it's very hard to do so portably. This paper cribs an idea from the MPI-2 I/O features, which we may well be able to cobble into something very useful to Fortran programs. Number: Title: The INFO= specifier on OPEN Statements Submitted By: J3 Status: For Consideration References: OPEN 9.4.5 Basic Functionality: Add a new specifier, INFO= to OPEN to provide performance hints to the rtl. Rationale: There are many variables, whose value, if known to the RTL, could reasonably be translated into higher performance of Fortran I/O. Items include, large or small buffer, large or small physical transfers, single pass of transfers or repeated transfers. The difficulty is to make these hints portable. This is one way to do so. See the Cray Unicos man page for "assign" for ideas. Estimated Impact: This proposal allows vendors to "opt-out" of any hint they want, so there's little impact beyond parsing yet another specifier. Detailed Specification: New OPEN specifier, INFO= INFO = , where the info-string is a list of , where each info-item is a KEYWORD=VALUE pair. is a . The keyword is a name= string, the value may be a number, logical, or string. The rules are: 1. No info-item may change the semantics of the connection. Each must be a "performance-only" hint. 2. No processor is required to recognize any particular info-item. Any unrecognized info-item must be ignored. 3. Processors are encouraged to invent their own info-items, to cover the specifics of their supported systems. 4. A short list of keywords is specified, each of which, if a processor chooses to recognize it, has a standard-specified meaning. 5. As is our usual way, case is irrelavant to the keywords (the values may depend on case). Suppose keywords BUFFER_SIZE, TRANSFER_SIZE, PREALLOCATE, CONTIGUOUS, ALLOCATE_INCREMENT are given (obvious) meanings (numbers expressed in file storage units?). Then the following is a standard-conforming OPEN: OPEN( UNIT= iunit, FILE= 'something', & & INFO= 'BUFFER_SIZE=1000000,DEVICE=SCSI-1') If a processor chooses to recognize the BUFFER_SIZE keyword, it will allocate the I/O buffer that large. The DEVICE keyword is a processor-specific keyword, so no processor (other than the vendor who defined it) need recognize it. Other processors will ignore it. (The processor who defined it could ignore it, if it is perhaps momentarily appropriate to do so.) All is subject to the Size and Complexity rule, so obnoxious requests may be ignored. Perhaps INQUIRE should be enhanced to retrieve a connection's info-string, but this paper does not propose to do so. History: