[Flang-dev] Flang Biweekly Sync - Notes from October 17, 2018 call

Gary Klimowicz gklimowicz at nvidia.com
Mon Oct 29 10:33:27 EDT 2018

Flang team,

Here are the notes from the last Flang biweekly call. Updates are in bold.

Please be sure to let us know if you have any questions.

As always, please let us know specific topics you would like to go over in the next Flang Sync call October 31st, 8:30 AM PDT.

Gary Klimowicz


  *   LLVM Developer Meeting Flang roundtable Wednesday 3:30 PM. Meet-and-greet and some likely discussion about f18.
  *   Supercomputing 2018
     *   Flang meetup updates: Sunday 6-9 PM; Aloft Hotel
     *   “OpenMP GPU Offload in Flang and LLVM” accepted to LLVM in HPC at SC18
     *   Hal Finkel encouraged authors to make their papers available in ways besides behind paywalls (review the paper submission guidelines for the Workshop). Let us know of other Flang-related activity at SC18
     *   Can we make the paper available before SC18? We will look at the rules
  *   Flang Dev news and updates
     *   Bugfixes (see below)
  *   F18 update
     *   Ongoing development: Symbol semantics (parent types, accessibility), data reference semantics in expressions, DO loops
     *   Repository is https://github.com/flang-compiler/f18
     *   Lots of discussions on flang-dev


  *   Short meeting, as many of the usual participants were attending LLVM Developer Meeting or the Fortran Standards meeting.
  *   LLVM Developer Meeting Flang roundtable Wednesday 3:30 PM. News after the meeting was a lot of discussion and interest in making Flang more mainstream.
  *   We continue to push changes from PGI to Flang, especially C++ improvements and bug fixes (details below).
  *   We continue development on the new Flang “f18” front end (symbol semantics, control flow graphs, DO loop body recognition.
  *   These notes are now being sent to flang-dev at lists.flang-compiler.com<mailto:flang-dev at lists.flang-compiler.com>.

Where we can use your help:

  *   Topics for the next call, as always.
  *   Let us know if you have SC18 presentations relevant to the Flang community. We will help publicize in these notes.
  *   Let Gary Klimowicz know if you are interested in giving a 5-minute flash talk on your use of Flang at the SC18 meetup. We have two identified so far.
  *   Please let us know of any problems with the serial implementation of DO CONCURRENT in Flang now that it has been added.
  *   Please let us know of any problems with SUBMODULE or MODULE in Flang now that submodule support has been added.
  *   Feedback on applications being built with Flang would be helpful (whether running or having issues with compiling and running). We haven’t heard lately about several applications (CTH, Miranda, SciPy, SSD) and would like to know if they’re been compiled recently with Flang.
  *   Feedback on GitHub issue priorities.


  1.  Flang on GitHub

  *   There have been 1,166 total commits (1,162 in the last update).
  *   There are 395 people who have “starred” the flang repo and 53 forks. 58 people are following f18.
·        Pull requests: We have 8 CLAs submitted from Arm Ltd, LANS, Cavium and five individuals working on Windows OpenBSD ports, and providing test cases.

  1.  Open source community

  *   Website: www.flang-compiler.org<http://www.flang-compiler.org> redirects to http://github.com/flang-compiler/flang.
  *   Wiki: https://github.com/flang-compiler/flang/wiki is the Flang wiki page where the most up-to-date build instructions and news can be found.
  *   Issues: Bug reports for Flang can be reported to https://github.com/flang-compiler/flang/issues.
  *   Mailing lists: There are two mailing lists for Flang: flang-dev and flang-announce at http://lists.flang-compiler.org/. You can reach this community by emailing flang-dev at lists.flang-compiler.org<mailto:flang-dev at lists.flang-compiler.org>. Occasional announcements are sent to  flang-announce at lists.flang-compiler.org<mailto:flang-announce at lists.flang-compiler.org>.
  *   Slack: flang-compiler.slack.com is used for informal real-time communication in the Flang community. Add yourself via the invite <https://join.slack.com/t/flang-compiler/shared_invite/enQtMjExOTEyMzQ3MjIxLTZkMDNlODc2YjgxZDY1NTQ2YWJiZWVhOGU2YWY0NDNiOWY0ZjQzNjYyZTNlZjBlNjgxY2U1ZjFjMmY5NzIwMzA> link.
  *   LLVM Developers Meeting: After our call, we got some recap from the LLVM Dev meeting Flang roundtable. A few takeaways: We will start posting these emails to flang-dev. We will post notice of the meetings as well. There was a desire to have more design discussions on flang-dev. The goal is to get Flang as an “official” LLVM project, including hosting the email lists, f18 integrated into LLVM’s cmake, and have upstream builders build and test f18. There is also strong desire to get debug metadata enhancements for Fortran upstreamed to LLVM.
  *   Flang meetup at SC18: We will hold a Flang meetup at Supercomputing 2018 in Dallas in conjunction with the LLVM in HPC workshop. The format is likely to be a short series of flash talks on the current state of Flang and F18, and application experience with Flang. Date is Sunday November 11, 6:00 PM to 9:00 PM at the Aloft hotel across the street from the Convention Center. Drink tickets and light appetizers will be provided. Nathan Sircombe (Arm) plans to give a flash talk. Gary Klimowicz and Hal Finkel need to announce this on cfe-dev and flang-dev.

  1.  What we’re up to
·        Recent updates to Flang:

     *   Several changes to Flang pending internal NVIDIA review
·        #255 Segfault on sourced allocation of unlimited polymorphic variable
·        #424 constant expression type mismatch
·        #570 Submodule can't access private and protected variables of the parent Module
·        #598 Some do concurrent related errors missing from errmsg-in.n

     *   Support for COMMON debug metadata support is pending internal review
     *   Conversion of flang2 to be able to be compiled with C++ is complete. We continue to make improvements for type consistency.
     *   Next up: BLOCK construct, g0 edit descriptors
     *   Other changes not related to GitHub issues
·        Insert more architecture-specific constants and types; this exposed a problem with runtime certain code that was no longer being treated as 64-bit. NVIDIA will fix this.

·        Assigned for work:

     *   #253 Intrinsic bit functions return wrong kind for INT8 arguments
     *   #254 ISHFT returns incorrect result when right shifting
     *   #374 SIZE, MIN, MAX intrinsics cannot be used to compute array subscript in constant initialization
     *   #402 Compiler error on regular code
     *   #404 Internal compiler error with polymorphic subroutine parameters and nested derived types
     *   #413 Issues with allocatable/pointer debug metadata
     *   #448 libpgmath should be built with -D_GNU_SOURCE
     *   #463 Error when manually linking LLVM IR with clang
     *   #477 Pull request for module variable import debug test

  *   Outstanding issues:
o   Many issues have been determined to be resolved and have been closed.
o   Please refer to the Issues section on GitHub for flang-compiler/flang<https://github.com/flang-compiler/flang/issues> and flang-compiler/flang-driver<https://github.com/flang-compiler/clang/issues>.

  *   Outstanding pull requests:
o   #513 Pull request for systems without gcc (only clang) cannot build flang (closed per submitter)
o   #521 Add OpenBSD as a recognized OS (pending test on new OpenBSD systems internally)
o   #529 runtime: PoC: generate call to LLVM intrinsic instead of calling runtime functions when possible; handling NINT for a beginning (proposed expansion of this pull request)
o   #530 AArch64: disable test cases invalid on aarch64 (working on)
o   #532 runtime: remove duplicate files (need to validate on all compilers)
o   #536 libpgmath: move includes to separate include directory, plus remove unfortunate duplication of mthdecls.h file (need to validate on all compilers
o   #546 Loosen ties to x86 (working on)
o   #561 flang2: corrected fix for #424 (believe this was already merged)
o   #572 libpgmath: respect LIBPGMATH_WITH_GENERIC setting; fixes #559 (reviewing)
o   #573 libpgmath: make it clang friendly; addresses bug #557 (reviewing)
o   #589 Fix clang++ build after recent changes (reviewing)
o   #592 add support for macOS (awaiting CLA)

  *   Public plan: NVIDIA has published a brief plan for upcoming Flang work on github.io at https://github.com/flang-compiler/flang/wiki/Roadmap.

  *   Creating pull requests: NVIDIA requires contributor agreements from developers wishing to make pull requests. The Individual CLA is here: https://flang-compiler.github.io/files/Flang-ICLA-v4.pdf. The Corporate CLA is here: https://flang-compiler.github.io/files/Flang-CCLA-v2.pdf. Send completed CLAs to flang-cla at nvidia.com<mailto:flang-cla at nvidia.com>. Assuming the pull request builds and passes “make check-flang”, NVIDIA will take on the internal testing of the pull request using the full test suite available internally and provide feedback to the contributor as appropriate. Once we have the quality of the pull request established, it will be incorporated into Flang.

     *   LLVM is switching to a new Apache license with LLVM exceptions that we need to incorporate into our CLAs after it is adopted by LLVM community. The LLVM license can be found at http://llvm.org/foundation/relicensing/LICENSE.txt. A web page describing the relicensing effort can be found at http://llvm.org/foundation/relicensing/.
     *   Johannes Dieterich sent in an ICLA to contribute FreeBSD support to Flang.

  *   Flang DWARF generation: The version of LLVM with enhanced Fortran debug support has been uploaded to github.com/flang-compiler/llvm. Changes for Fortran debug support have been merged into the release_60 branch of Flang’s LLVM fork. Roadmap of items for debug support has been added to the Flang wiki here<https://github.com/flang-compiler/flang/wiki/Flang-Fortran-Debug-Metadata-Plan>.

  *   OpenMP 4.5 support:

     *   OpenMP 4.5 is supported on multicore CPUs, mapping all target regions across all the cores, with the following known limitations:

        *   We map the directives directly for host==device with very predictable behavior and good performance results.
        *   Task depend/priority is not supported
        *   OMP do clauses linear, order(n), and schedule (modifier) are not supported
        *   SIMD construct, Declare SIMD, and SIMD clause: private/reduction/lastprivate/collapse clauses on SIMD construct are supported, SIMD clause/construct are used as a hint to vectorize through metadata generation
        *   There is a bug if target construct is enclosed by task construct

     *   We have made changes to support atomic instructions in Flang.

     *   OpenMP 4.5 target offload to Tesla GPUs

        *   We continue the develop OpenMP target offload.
        *   We have simple programs running, focusing on generating code for OpenMP pragmas in SPMD/SIMT mode for now.
        *   The OpenMP runtime functions of the SPMD/SIMT model are limited in terms of the breadth of OpenMP that can be supported. We are tracking LLVM and Clang 7.0. Clang support for OpenMP target offload is scheduled for LLVM 7.0 and Flang support is therefore dependent on that release of LLVM.
        *   Current work is focused on merging OpenMP offload support into the current development stream, with appearance in Flang in the LLVM 7.0 time frame.
        *   Work on SPEC OMP benchmarks is gated by Clang/LLVM work (no support yet for target teams reductions).
        *   Currently, Flang supports only the combined constructs of OpenMP by generating code in SPMD/SIMT mode as this is the most common pattern used in OpenMP. LLVM's runtime has a special implementation for combined constructs that perform better than non-combined constructs.
        *   We have merged this code base into PGI code base, preparing to migrate to Flang. It will probably be coming in three tranches: Code added, but not compiled (ifdefed out); code added (not ifdefed out) but not enabled; then enabled.
        *   Güray Özen and Simone Atzeni’s paper “OpenMP GPU Offload in Flang and LLVM” was accepted for the LLVM in HPC Workshop at SC 2018. They will also be giving an OpenMP Booth Talk.

  *   Packaging and Binary Releases

     *   Binary release: We will be posting binary releases at least quarterly. Binary releases of Flang for x86-64 and OpenPOWER (LLVM 6.0.1) have been posted to http://flang-compiler.github.com/flang/releases.
     *   Spack: Spack packages for Flang have been reviewed by the Spack team and pulled into Spack. This is for the tagged binary release flang_20180612. Work needs to be submitted for flang_20180921.

        *   Brian Friesen and Chris Earl have used the Spack package to build Flang but ran into some issues. These will be resolved with the flang_20180921 update.

  *   F18 front-end:

     *   Public awareness: Webinars delivered July 2nd and July 11th. Recording from the second webinar is now available now: https://nvmeet.webex.com/nvmeet/ldr.php?RCID=8b42b4ab49dec35519867c7fea8719e0.
     *   On GitHub: The initial source code for a new Fortran 2018 parser has been released on flang-compiler.github.com/f18. It’s recommended to start in the “documentation” directory. Lots of discussion threads on flang-dev about AST form, GNU compatibility, build failures, OpenBLAS, etc.
     *   Status: We continue development on the new Fortran 2018 front-end. Recent work includes:
·        Symbol semantics (POINTER statement, name conflicts)
·        Semantic analysis of data references as they appear in expressions
·        Intrinsics function table definition, pattern matching and unit tests
·        Canonicalization of DO loops (adjusting parse tree to include loop structure, and not just a sequence of statements)

  *   Testing updates

     *   Working to add NCAR Kernels tests to Flang.

  *   Application updates:

     *   MPAS: NVIDIA has a copy of MPAS-O and is working to bring it into our nightly test automation. Alexis Perry reports that the new intrinsics library produces about a 7% performance boost in MPAS. 94% of the performance difference is in three routines, with one of them accounting for half of the difference, where Flang is not vectorizing a loop that GNU gfortran does. The loop has conditionals, which may be why LLVM is not vectorizing it. No progress this week; we need to investigate the failures to vectorize.

     *   Nyx: Chris Daley of LBL gave NVIDIA an example of the application that is exhibiting poor performance with Flang. The good news is that serial performance is competitive with gfortran. NVIDIA has found two issues that account for most of the performance discrepancy. The first is that OpenMP atomics are not currently implemented as native instructions in Flang, which uses a barrier instead. The second issue is that a 4-dimensional array is being zeroed out with array syntax.
·        Atomics support added to Flang
·        Block zero improvements; need to incorporate assembly routines; turned out this was redundant code and the Nyx team has updated the source to remove it; latest version is not reliant on these block zero/copy improvements

     *   S3D: NVIDIA has completed the agreement to obtain S3D. We have received the source code from Sandia but have not built it yet.

  1.  Fortran 2008 features
·        Pointers to internal procedures, required for an important DOE application is complete.
·        SUBMODULE is complete and in Flang. Please let us know of issues with submodules or regressions in code that use MODULE.
·        Completed serial implementation of F2018 DO CONCURRENT (no multi-core implementation planned at this time). We are implementing Fortran 2018 locality specifiers and corresponding constraint checking.
·        BLOCK construct. Will resume work on BLOCK shortly.
·        Support for the G0 Edit descriptor has been requested by LLNL.

This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/attachments/20181029/e3dc85fe/attachment-0001.html>

More information about the flang-dev mailing list