[all-commits] [llvm/llvm-project] deb62f: [flang][runtime] Clean up asynchronous I/O APIs

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue May 24 07:55:14 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: deb62f5ad64931c6d47ef3cbf9bb53f4f651b3ae
      https://github.com/llvm/llvm-project/commit/deb62f5ad64931c6d47ef3cbf9bb53f4f651b3ae
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-05-24 (Tue, 24 May 2022)

  Changed paths:
    M flang/include/flang/Runtime/io-api.h
    M flang/include/flang/Runtime/iostat.h
    M flang/lib/Lower/IO.cpp
    M flang/runtime/io-api.cpp
    M flang/runtime/io-error.h
    M flang/runtime/io-stmt.h
    M flang/runtime/iostat.cpp
    M flang/runtime/unit.h

  Log Message:
  -----------
  [flang][runtime] Clean up asynchronous I/O APIs

Now that the requirements and implementation of asynchronous I/O are
better understood, adjust their I/O runtime APIs.  In particular:
1) Remove the BeginAsynchronousOutput/Input APIs; they're not needed,
   since any data transfer statement might have ASYNCHRONOUS= and
   (if ASYNCHRONOUS='YES') ID= control list specifiers that need to
   at least be checked.
2) Add implementations for BeginWait(All) to check for the error
   case of a bad unit number and nonzero ID=.
3) Rearrange and comment SetAsynchronous so that it's clear that
   it can be called for READ/WRITE as well as for OPEN.

The implementation remains completely synchronous, but should be conforming.
Where opportunities make sense for true asynchronous implementations of
some big block transfers without SIZE= in the future, we'll need to add
a GetAsynchronousId API to capture ID= on a READ or WRITE; add sourceFile
and sourceLine arguments to BeginWait(All) for good error reporting;
track pending operations in unit.h; and add code to force synchronization
to non-asynchronous I/O operations.

Lowering should call SetAsynchronous when ASYNCHRONOUS= appears as
a control list specifier.  It should also set ID=x variables to 0
until such time as we support asynchronous operations, if ever.
This patch only removes the removed APIs from lowering.

Differential Revision: https://reviews.llvm.org/D126143




More information about the All-commits mailing list