[flang-commits] [PATCH] D126143: [flang][runtime] Clean up asynchronous I/O APIs
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Sat May 21 22:09:17 PDT 2022
klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a project: All.
klausler requested review of this revision.
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.
https://reviews.llvm.org/D126143
Files:
flang/include/flang/Runtime/io-api.h
flang/include/flang/Runtime/iostat.h
flang/lib/Lower/IO.cpp
flang/runtime/io-api.cpp
flang/runtime/io-error.h
flang/runtime/io-stmt.h
flang/runtime/iostat.cpp
flang/runtime/unit.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126143.431200.patch
Type: text/x-patch
Size: 11281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220522/1995c3ba/attachment-0001.bin>
More information about the flang-commits
mailing list