NUM_IMAGES takes optional arguments TEAM and TEAM_NUMBER.
This patch provides an interface for only the optional TEAM_NUMBER dummy argument. It is likely that a different function will be required to support TEAM arguments.
Differential D109547
[flang] Add runtime interface for NUM_IMAGES craig.rasmussen on Sep 9 2021, 2:52 PM. Authored by
Details
NUM_IMAGES takes optional arguments TEAM and TEAM_NUMBER. This patch provides an interface for only the optional TEAM_NUMBER dummy argument. It is likely that a different function will be required to support TEAM arguments.
Diff Detail Event Timeline
Comment Actions Added comments explaining why team_number=0 is a good default value when NUM_IMAGES is called without an actual argument for TEAM_NUMBER. Comment Actions So far, so good. As I commented earlier, I suspect that we'll need an additional interface to cover all forms of NUM_IMAGES().
Comment Actions Peter Klausler wrote:
I can revisit this when I add a TEAM type dummy (probably after you complete the type magic in the front end). For now this allows me to implement NUM_IMAGES for a single image. Possible function names: NumImages, NumImagesTeam NumImagesTeamNum. As you say, the implementation can do whatever it wants. -craig From: Peter Klausler via Phabricator <reviews@reviews.llvm.org> Comment at: flang/runtime/coarray.h:21 + const char *sourceFile = nullptr, int sourceLine = 0);craig.rasmussen wrote:
Or you could have two entry points, one with a team number and one without, and avoid exposing this kind of trick in the API. It could still be used as a hidden part of a common implementation. CHANGES SINCE LAST ACTION https://urldefense.us/v3/__https://reviews.llvm.org/D109547/new/__;!!G2kpM7uM-TzIFchu!neIxNJ4lJsWyAIvx6heTGuRQA6DGC8sGAzRI639eyb5fm7Gj4uXoj6rpMY6Nj4XCIU8K$<https://urldefense.us/v3/__https:/reviews.llvm.org/D109547/new/__;!!G2kpM7uM-TzIFchu!neIxNJ4lJsWyAIvx6heTGuRQA6DGC8sGAzRI639eyb5fm7Gj4uXoj6rpMY6Nj4XCIU8K$> https://urldefense.us/v3/__https://reviews.llvm.org/D109547__;!!G2kpM7uM-TzIFchu!neIxNJ4lJsWyAIvx6heTGuRQA6DGC8sGAzRI639eyb5fm7Gj4uXoj6rpMY6Nj3z2uaZ1$https://urldefense.us/v3/__https:/reviews.llvm.org/D109547__;!!G2kpM7uM-TzIFchu!neIxNJ4lJsWyAIvx6heTGuRQA6DGC8sGAzRI639eyb5fm7Gj4uXoj6rpMY6Nj3z2uaZ1$ Comment Actions Inlined call to Fortran::semantics::IsCoarray (one line change) to fix link error. Also minor cleanup suggested by clang-format. Comment Actions Hopefully this will open the issue and is the correct way to correct a push that was reverted. Note comment on line 97 of flang/include/flang/Evaluate/tools.h. This fixes link error for shared libraries.
|
Note that patch https://reviews.llvm.org/D109107 rearranged the location of the runtime header files. So the correct location for coarray.h is now .../flang/include/flang/Runtime.