[flang-dev] iso_fortran_env and num_images() Questions

Katherine Rasmussen via flang-dev flang-dev at lists.llvm.org
Mon Jun 15 11:13:11 PDT 2020


Hello,
    I am working for SourceryInstitute and trying to help implement
coarrays in flang. I am working towards making a contribution to flang, the
contribution being adding num_images() to the list of intrinsic functions
that are evaluated by flang. Related to this goal, I have three questions:

First, has the intrinsic module iso_fortran_env been implemented yet?
num_images() is an overloaded function and one of the variants takes a
single scalar argument of type TEAM_TYPE. When I try to run f18 with the
command line option -funparse-with-symbols on a file that has a
num_images() call using the TEAM_TYPE argument and the following code:
     use iso_fortran_env, only : team_type
flang produces these errors:
    num_images4.f90:5:7: error: Error reading module file for module
'iso_fortran_env'
    num_images4.f90:5:7: Could not open 'iso_fortran_env.mod': No such file
or directory

Should I ignore testing num_images() calls with teams or try and complete
the iso_fortran_env module?

Second, after adding num_images() to the list of functions evaluated as
intrinsic in the file flang/lib/Evaluate/intrinsics.cpp, I also edited the
file flang/unittests/Evaluate/intrinsics.cpp. In that file, I wrote test
calls to test the num_images() evaluation. I was able to test the variant
of num_images() that has no parameters and the variant of num_images() that
has the parameter 'team_number' of type integer. I was unable to figure out
how to write a test call that tests the call with an argument of TEAM_TYPE.
Is there anyone who can direct me towards figuring this out?

And last, in addition to adding num_images() test calls to
the unittests/Evaluate/intrinsics.cpp, are there other tests I should write
for the patch I would like to submit to llvm to contribute?

The flang files I have edited (flang/lib/Evaluate/intrinsics.cpp and
flang/unittests/Evaluate/intrinsics.cpp) can be found in the
develop-coarrays branch of sourcery-institute's fork of llvm-project
https://github.com/sourceryinstitute/flang-coarrays/blob/develop-coarrays/flang/lib/Evaluate/intrinsics.cpp
https://github.com/sourceryinstitute/flang-coarrays/blob/develop-coarrays/flang/unittests/Evaluate/intrinsics.cpp

I am also attaching the test file with calls to num_images() that I was
using to test what symbols were being created, this is the file that
creates the error messages described above.

Thank you for your time and help,
     Kate Rasmussen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20200615/dfd0d545/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: num_images4.f90
Type: application/octet-stream
Size: 337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20200615/dfd0d545/attachment.obj>


More information about the flang-dev mailing list