The Berkeley Lab Flang team develops tests for the LLVM-Project Flang Fortran compiler. Because of the paramount importance of parallelism in high-performance computing, we are focusing on Fortran’s parallel features, commonly denoted "Coarray Fortran."
This issue is designed to plan and keep track of progress towards using Caffeine as a runtime library for coarrays in flang.
Philosophy of Caffeine:
Caffeine doesn't need to know about the compiler's internal descriptors
Tentative to do items:
[ ] Write design document and submit for feedback from community
[ ] Explore answers to the following questions: How does the compiler represent the coarray? How much information is going to be tracked by the compiler?
[ ] Client side API
[ ] Explore coarray descriptor needs
[ ] Create coarray MLIR dialect?
To do items for design document:
[x] Create .md file on a branch on Berkeley Lab fork - Kate
[x] Create framework for design document - Kate
[x] Begin to populate document with info from this issue
Information Compiler needs to track about coarrays:
corank
List of features that are team relevant
num_imagesthis_imageco_sumco_maxco_minco_reduceco_broadcastsync-team-stmtsync-images-stmtsync-all-stmtteam_numberget_teamfailed_imagesstopped_imagesimage_statuscoarray allocationcoarray deallocationmove-alloc with coarray args
Notes:
When read end of change-team-construct, if allocated any coarrays during that region, all of those coarrays are implicitly freed, need to be able to free them all,
[x] Can Caffeine directly implement the atomic subroutines by accepting the arguments as they appear in the Fortran Standard, or do we need compiler involvement? A: Compiler will be involved
[x] When there are accesses to allocatable components on another image, who is doing that iteration? A: Compiler
[x] When is it legal for the compiler to do copy in or copy out, are there ways to declare arguments to prevent copy in and copy out? A: Always
[x] Are we breaking Fortran semantics by passing a cohandle which will be used in C to access the target, not through the dummy argument target? A: Only in transformed code, the compiler will understand what is happening
[x] How do we want to express asynchrony to the compiler of all communication operations? A: No intention to implement the interface for the time being. Eventually we would like the compiler to be able to do prefetching of an optimized object (read ahead version of split phase optimization)
[ ] teams...
[ ] synchronization statements...
[x] Answer questions about critical construct A: Answered some preliminary questions about it. Discovered nested critical constructs are not valid code.
[ ] With no details of the Fortran memory consistency model, how do we design our asynchrony model to provide the compilers what they need?
This issue is designed to plan and keep track of progress towards using Caffeine as a runtime library for coarrays in flang.
Philosophy of Caffeine: Caffeine doesn't need to know about the compiler's internal descriptors
Tentative to do items:
To do items for design document:
Information Compiler needs to track about coarrays:
List of features that are team relevant
num_images
this_image
co_sum
co_max
co_min
co_reduce
co_broadcast
sync-team-stmt
sync-images-stmt
sync-all-stmt
team_number
get_team
failed_images
stopped_images
image_status
coarray allocation
coarray deallocation
move-alloc with coarray args
Notes: