Skip to content

Support Fortran 2015 teams #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 93 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
9e47912
Team patch applied
Aug 2, 2017
d32e841
Merge pull request #3 from sourceryinstitute/master
zbeekman Aug 29, 2017
7d1ebae
Add opencoarrays/mpich to download_prerequisites
Aug 30, 2017
3da5660
Merge branch 'master' into teams
Sep 12, 2017
1e14281
Merge branch 'master' into teams
Sep 19, 2017
ad67261
Merge remote-tracking branch 'sourceryinstitute/master' into teams
Sep 20, 2017
eac0dab
Merge branch 'master' into download-opencoarrays-mpich
Sep 20, 2017
b894ff3
Merge remote-tracking branch 'sourceryinstitute/master' into teams
Sep 21, 2017
62bf309
Merge branch 'master' into teams
Oct 6, 2017
7204ca4
Merge pull request #7 from gcc-mirror/master
Oct 20, 2017
71c41bf
Merge pull request #8 from sourceryinstitute/teams
Oct 20, 2017
458897c
Merge pull request #9 from sourceryinstitute/download-opencoarrays-mpich
Oct 20, 2017
eab80f7
Merge remote-tracking branch 'upstream/master'
Oct 20, 2017
14c800d
Revert "Merge pull request #8 from sourceryinstitute/teams"
Oct 20, 2017
008ad61
Undo additional merged commits from download-op...
Oct 21, 2017
e2464eb
Add GitHub issue submission template
Oct 21, 2017
b58758c
Request release tag or git hash in issue template
Oct 21, 2017
b5c1387
Add Markdown README.md with installation info
Oct 22, 2017
818d7ec
Update README.md
Oct 22, 2017
b9951ae
Update README.md
Oct 22, 2017
13f77d5
Merge branch 'master' of https://github.com/gcc-mirror/gcc
Oct 23, 2017
2c5ee35
Update README.md
Oct 24, 2017
e6eeb80
Update README.md
Oct 24, 2017
b97cfc9
Update README.md
Nov 9, 2017
f31c1cf
Removed commented out section for GNU submission
scrasmussen Nov 11, 2017
1223250
removed src_team since during gcc build I was getting a unused variab…
scrasmussen Nov 11, 2017
30afe80
Formatting changes, spaces between function call and parentheses
scrasmussen Nov 11, 2017
dae2f8e
Formatting changes, spaces between function call and parentheses
scrasmussen Nov 11, 2017
8473abb
GNU formatting changes
scrasmussen Nov 11, 2017
f54c1d6
GNU formatting standard fixes
scrasmussen Nov 11, 2017
13913ac
GNU formatting standard, space between func call and paren
scrasmussen Nov 11, 2017
fd0133f
GNU formating and removed commented out code section
scrasmussen Nov 11, 2017
7c3627b
removed print statement left over from developement
scrasmussen Nov 13, 2017
83ff993
Merge pull request #14 from sourceryinstitute/scrasmussen/teamsCleanu…
scrasmussen Nov 13, 2017
f1f7135
Merge branch 'master' of https://github.com/gcc-mirror/gcc
Nov 19, 2017
81b47ac
Initial versions of tests for the form,change, and end teams functions
scrasmussen Nov 19, 2017
cada00d
Merge branch 'master' of https://github.com/gcc-mirror/gcc
Nov 19, 2017
afff591
Merge branch 'master' of github.com/gcc-mirror/gcc
Nov 28, 2017
96ce792
Merge branch 'teams' into master
scrasmussen Nov 28, 2017
082da3c
Merge pull request #15 from sourceryinstitute/master
scrasmussen Nov 28, 2017
e94842e
Transferred the change in array.c
scrasmussen Nov 30, 2017
ad023c8
transferred the changes for check.c
scrasmussen Nov 30, 2017
c806db6
transferred changes for dump-parse-tree.c
scrasmussen Nov 30, 2017
2e8926b
fixed gfortran.h
scrasmussen Nov 30, 2017
a733cd0
transfered the changes for intrinsic.h
scrasmussen Nov 30, 2017
cc0d8fb
transferred the changes for iresolve.c
scrasmussen Nov 30, 2017
e90aa4a
transferred changes for iso-fortran-env.def
scrasmussen Nov 30, 2017
9aec253
transferred changes for parse.c
scrasmussen Nov 30, 2017
02523a8
transferred and slightly simplified changes for resolve.c
scrasmussen Nov 30, 2017
233a776
transferred changes for simplify.c
scrasmussen Nov 30, 2017
ee02252
transferred changes for st.c
scrasmussen Nov 30, 2017
feff0aa
transferred changes for trans-decl.c
scrasmussen Nov 30, 2017
6d14d0f
the second batch of transfers for trans-decl.c
scrasmussen Nov 30, 2017
093b7f8
transferred the changes, dst_team was already there
scrasmussen Nov 30, 2017
a95be81
transferred changes for trans-stmt.h
scrasmussen Nov 30, 2017
3da4a95
transferred changes for trans-types.c
scrasmussen Nov 30, 2017
37a42e7
transferred changes for trans.c
scrasmussen Nov 30, 2017
e56f333
transferred changes for trans.h
scrasmussen Nov 30, 2017
d822a85
transferring more changes
scrasmussen Dec 1, 2017
99b6b47
transferring the changes
scrasmussen Dec 1, 2017
192cbd5
transferring changes
scrasmussen Dec 1, 2017
ee16f0b
Removed duplicate code
scrasmussen Dec 18, 2017
a61b14d
Minimizing code per pull request recommendation
scrasmussen Dec 18, 2017
97c0650
Merge pull request #17 from sourceryinstitute/scrasmussen/teamsTestCases
scrasmussen Dec 19, 2017
e71c089
Merge remote-tracking branch 'upstream/master' into teams
Jan 8, 2018
25d196f
removed tailing whitespaces
scrasmussen Jan 11, 2018
8d021de
removed tailing whitespaces and fixed argument name chars
scrasmussen Jan 11, 2018
27bbaa3
declaration of gfc_check_team_number
scrasmussen Jan 13, 2018
1a5ba15
add gfor_fndecl_caf_team_number
scrasmussen Jan 14, 2018
68933af
added enumb gfc_isym_team_number
scrasmussen Jan 14, 2018
ecc1c09
Added type check for team_number
scrasmussen Jan 14, 2018
9b8c68f
added resolve for team_number
scrasmussen Jan 14, 2018
134e3b0
removed print statement, type is correct
scrasmussen Jan 14, 2018
453e514
add_sym_1 for team_number
scrasmussen Jan 15, 2018
a927a5c
resolve for team_number
scrasmussen Jan 15, 2018
2e99a89
trailing spaces removed
scrasmussen Jan 15, 2018
cc9a4ec
savepoint, adding team_number
scrasmussen Jan 15, 2018
5059b15
add gfor_fndecl_caf_team_number
scrasmussen Jan 15, 2018
2c2b0db
cleaning up, has todo message
scrasmussen Jan 15, 2018
9459649
cleanup
scrasmussen Jan 15, 2018
3d4c113
cleanup
scrasmussen Jan 15, 2018
cbcf5cf
cleanup and putting gfor_fndecl_caf_image_status in a different place
scrasmussen Jan 15, 2018
4a1fac0
renamed files to more natural name
scrasmussen Jan 15, 2018
0e71ba9
Merge remote-tracking branch 'upstream/master' into scrasmussen/teams…
Jan 16, 2018
cb40b68
syntax fix
scrasmussen Jan 16, 2018
7689066
cleaning up
scrasmussen Jan 16, 2018
3ff0490
Merge branch 'scrasmussen/teams-number' into teams
Jan 16, 2018
38f2998
Remove debug output in trans-intrinsic.c
Jan 18, 2018
9c4176a
Fix "team change" statement unit test
Jan 18, 2018
3ea441c
Revise team tests and add team_number test
Jan 18, 2018
5b3cd7f
Remove extraneous comments.
Jan 18, 2018
81a4a71
Complete ChangeLog and add testsuite/ChangeLog
Jan 18, 2018
6bc3241
Edits based on ./contrib/check_GNU_style.sh output
Jan 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!-- Please fill out the issue template included below, failure to do -->
<!-- so may result in immediate closure of your issue. -->

<!-- Fill out all portions of this template that apply. Please delete -->
<!-- any unnecessary sections. -->

<!-- PRO TIP! Submit the pull request *before* you check any -->
<!-- checkboxes. Then, use the gui/web interface to check the -->
<!-- checkboxes! -->

Please make sure to put any logs, terminal output, or code in
[fenced code blocks].

# Defect/Bug Report #

<!-- delete this section if it does not apply -->
The title of the issue should start with `Defect:` followed by a
succinct title.

<!-- THE FOLLOWING INFORMATION IS MANDATORY if you would like our help -->

- GCC fork release tag or git hash: <!-- e.g., teams-20170921 or `git rev-parse --short HEAD` -->
- GCC version used to build this fork: <!-- `gcc --version` -->
- Output of `uname -a`:
- Machine architecture and number of physical cores:

## Observed Behavior ##

## Expected Behavior ##

## Steps to Reproduce ##

# Question #

<!-- delete this section if it does not apply -->
The title of the issue should start with `Question:` followed by a
succinct title. Add the text of your question here. Be specific. Search for
answers on [Google] and [Stack Overflow]
before asking a new question

# Request for Enhancement (RFE) #

<!-- delete this section if it does not apply -->
The title of the issue should start with `RFE:` followed by a succinct
title. If you are willing to help out, please review the [Contributing to GCC]
page.

[links]:#
[Google]: https://www.google.com
[Stack Overflow]: https://stackoverflow.com
[fenced codeblocks]: https://help.github.com/articles/creating-and-highlighting-code-blocks/
[CONTRIBUTING.md]: https://github.com/sourceryinstitute/OpenCoarrays/blob/master/CONTRIBUTING.md
[Helping Out]: https://github.com/sourceryinstitute/OpenCoarrays/blob/master/CONTRIBUTING.md#helping-out
[Contributing to GCC]: https://gcc.gnu.org/contribute.html
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
Overview
========
This repository exists as a staging ground for developing candidate
contributions to the GNU Compiler Collection ([GCC]).

Candidate features currently on this site are listed below. The checked items indicate features
that have been submitted to the relevant GCC developer mailing list for review. We welcome user
feedback from testing these features. Unchecked items are insufficiently mature to submit to GCC.

- [X] The [teams branch] with experimental support for Fortran 2015 teams.
- [X] The [download-opencoarrays-mpich branch] modifying GCC's prequisites download script
to add [OpenCoarrays] and [MPICH] to the list of downloade software.
- [ ] The [issue-#6-iso-fortran-binding-h branch] providing the Fortran 2015 `iso_fortran_binding.h` file.

We welcome code contributions via [pull request] for any listed features or other unsupported
features of the [draft Fortran 2015 standard]:

Installation
============
This fork's [releases] are produced from the [teams branch], which we expect will be of
most interest to users. We recommend building the [latest release] using the [OpenCoarrays]
`install.sh` script as follows:
```bash
# Install a teams-branch release of this GCC fork
git clone https://github.com/sourceryinstitute/opencoarrays
cd oppencoarrays
./install.sh --package gcc \
--from-url https://github.com/sourceryinstitute/gcc/archive/<release-tag>.tar.gz \
--install-version <release-tag>
```
where `<release-tag>` must be replaced with the appropriate string such as teams-20170921. The final
command above peforms the safest but slowest build, which could take several hours to complete.
For a speedier build, add the `--disable-bootstrap`, which might fail if the GCC you are using
to build is too old. Also, for an interactive build, add `--yes-to-all` to instruct the
installer to assume affirmative answers to any queries. If successful, the above steps will
install GCC in the `prerequisites/installations` subdirectory. To see additional installation
options, including choosing another installation path, execute `./install.sh --help`.

Next use the resulting compilers to build [MPICH] 3.2 or later:
```bash

# Install MPICH 3.2 or later using the GCC that was installed above:
export LD_LIBRARY_PATH="${PWD}"/prerequisites/installations/gcc/teams-<release-tag>/lib64

./install.sh --package mpich \
--with-fortran "${PWD}"/prerequisites/installations/gcc/<release-tag>/bin/gfortarn \
--with-c "${PWD}"/prerequisites/installations/gcc/<release-tag>/bin/gcc \
--with-cpp "${PWD}"/prerequisites/installations/gcc/<release-tag>bin/g++

```

Next use the resulting [MPICH] installation to build the [opencoarrays-teams branch] of OpenCoarrays.
```bash
# Install OpenCoarrays using the MPICH just installed:
git checkout opencoarrays-teams
./install.sh \
--with-mpi "${PWD}"/prerequisites/installations/mpich/<mpich-version-number>/
```
after replacing `<mpich-version-number>` with... wait for it... the MPI version number (3.2 or later). :)
Please report any problems with the above steps on our [issues page].


[GCC mirror] README
===================

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software. See the files whose
names start with COPYING for copying permission. The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text. The source of this information is
gcc/doc/install.texi. The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information. An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.

[GCC mirror]: https://github.com/gcc-mirror/gcc
[GCC]: https://gcc.gnu.org/gcc
[OpenCoarrays]: https://www.opendcoarrays.org
[MPICH]: https://www.mpich.org
[teams branch]: https://github.com/sourceryinstitute/gcc/tree/teams
[issue-#6-iso-fortran-binding-h branch]: https://github.com/sourceryinstitute/gcc/tree/issue-#6-iso-fortran-binding-h
[download-opencoarrays-mpich branch]: https://github.com/sourceryinstitute/gcc/tree/download-opencoarrays-mpich
[releases]: https://github.com/sourceryinstitute/gcc/releases/
[issues page]: https://github.com/sourceryinstitute/gcc/issues/
[opencoarrays-teams branch]: https://github.com/sourceryinstitute/opencoarrays/tree/opencoarrays-teams
[pull request]: https://github.com/sourceryinstitute/gcc/pulls
[draft Fortran 2015 standard]: https://bit.ly/fortran-2015-draft
[latest release]: https://github.com/sourceryinstitute/gcc/releases/latest
45 changes: 45 additions & 0 deletions gcc/fortran/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
2018-01-18 Damian Rouson <[email protected]>
Alessandro Fanfarillo <[email protected]>

Partial support for Fortran 2018 teams features.

* array.c (gfc_match_array_ref): add team attribute in coarray
transfers.
* check.c (gfc_check_get_team, gfc_check_team_number): add new
functions for get_team and team_number.
* dump-parse-tree.c (show_code_node): add new statements: form team,
change team, end team, and sync team.
* expr.c (gfc_find_team_co): add new function.
* gfortran.h: add new statements.
* intrinsic.c (add_functions): add get_team and team_number functions.
* intrinsic.h: add get_team and team_number prototypes for check,
simplify, and resolve.
* iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
functions.
* iso-fortran-env.def: add the team_type derived type.
* match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
(gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
add change team, end team, form team, sync team match and functions.
* match.h: add new prototypes for change team, end team, form team,
and sync team.
* parse.c (decode_statement): add cases for change team, end team,
form team, and sync team.
* resolve.c: add cases for exec form team, change team, end team, and
sync team.
* simplify.c (gfc_simplify_get_team): add new function for get team.
* st.c (gfc_free_statement): add cases exec for change team, end team,
form team, sync team.
* trans-decl.c (gfor_fndecl_caf_form_team)
(gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
(gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
(gfor_fndecl_caf_team_number): add functions and definitions.
* trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
new function and team_type argument support.
* trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
(gfc_trans_end_team, gfc_trans_sync_team): add new functions.
* trans-stmt.h: add new prototypes.
* trans-types.c (gfc_get_derived_type): check condition for team_type.
* trans.c (trans_code): new exec cases for form team, change team, end
team, and sync team.
* trans.h: add new prototypes.

2018-01-15 Louis Krupp <[email protected]>

PR fortran/82257
Expand Down
16 changes: 15 additions & 1 deletion gcc/fortran/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ gfc_match_array_ref (gfc_array_ref *ar, gfc_array_spec *as, int init,
bool matched_bracket = false;
gfc_expr *tmp;
bool stat_just_seen = false;
bool team_just_seen = false;

memset (ar, '\0', sizeof (*ar));

Expand Down Expand Up @@ -230,8 +231,21 @@ gfc_match_array_ref (gfc_array_ref *ar, gfc_array_spec *as, int init,
if (m == MATCH_ERROR)
return MATCH_ERROR;

team_just_seen = false;
stat_just_seen = false;
if (gfc_match(" , stat = %e",&tmp) == MATCH_YES && ar->stat == NULL)
if (gfc_match (" , team = %e", &tmp) == MATCH_YES && ar->stat == NULL)
{
ar->team = tmp;
team_just_seen = true;
}

if (ar->team && !team_just_seen)
{
gfc_error ("TEAM= attribute in %C misplaced");
return MATCH_ERROR;
}

if (gfc_match (" , stat = %e",&tmp) == MATCH_YES && ar->stat == NULL)
{
ar->stat = tmp;
stat_just_seen = true;
Expand Down
45 changes: 43 additions & 2 deletions gcc/fortran/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,20 @@ gfc_check_failed_or_stopped_images (gfc_expr *team, gfc_expr *kind)
}


bool
gfc_check_get_team (gfc_expr *level)
{
if (level)
{
gfc_error ("%qs argument of %qs intrinsic at %L not yet supported",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&level->where);
return false;
}
return true;
}


bool
gfc_check_atomic_cas (gfc_expr *atom, gfc_expr *old, gfc_expr *compare,
gfc_expr *new_val, gfc_expr *stat)
Expand Down Expand Up @@ -2264,7 +2278,7 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
return false;
}
}

if (array->rank == 1 || boundary->rank == 0)
{
if (!scalar_check (boundary, 2))
Expand Down Expand Up @@ -2313,7 +2327,7 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
case BT_COMPLEX:
case BT_CHARACTER:
break;

default:
gfc_error ("Missing %qs argument to %qs intrinsic at %L for %qs "
"of type %qs", gfc_current_intrinsic_arg[2]->name,
Expand Down Expand Up @@ -5274,6 +5288,33 @@ gfc_check_num_images (gfc_expr *distance, gfc_expr *failed)
}


bool
gfc_check_team_number (gfc_expr *team)
{
if (flag_coarray == GFC_FCOARRAY_NONE)
{
gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
return false;
}

if (team)
{
/* TODO: this works on any derived type when
it should only work with team_type. */
if (team->ts.type != BT_DERIVED)
{
gfc_error ("TEAM argument at %L to the intrinsic TEAM_NUMBER "
"shall be of type TEAM_TYPE", &team->where);
return false;
}
}
else
return true;

return true;
}


bool
gfc_check_this_image (gfc_expr *coarray, gfc_expr *dim, gfc_expr *distance)
{
Expand Down
16 changes: 16 additions & 0 deletions gcc/fortran/dump-parse-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,22 @@ show_code_node (int level, gfc_code *c)
fputs ("FAIL IMAGE ", dumpfile);
break;

case EXEC_CHANGE_TEAM:
fputs ("CHANGE TEAM", dumpfile);
break;

case EXEC_END_TEAM:
fputs ("END TEAM", dumpfile);
break;

case EXEC_FORM_TEAM:
fputs ("FORM TEAM", dumpfile);
break;

case EXEC_SYNC_TEAM:
fputs ("SYNC TEAM", dumpfile);
break;

case EXEC_SYNC_ALL:
fputs ("SYNC ALL ", dumpfile);
if (c->expr2 != NULL)
Expand Down
20 changes: 19 additions & 1 deletion gcc/fortran/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5065,7 +5065,25 @@ gfc_ref_this_image (gfc_ref *ref)
}

gfc_expr *
gfc_find_stat_co(gfc_expr *e)
gfc_find_team_co (gfc_expr *e)
{
gfc_ref *ref;

for (ref = e->ref; ref; ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
return ref->u.ar.team;

if (e->value.function.actual->expr)
for (ref = e->value.function.actual->expr->ref; ref;
ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
return ref->u.ar.team;

return NULL;
}

gfc_expr *
gfc_find_stat_co (gfc_expr *e)
{
gfc_ref *ref;

Expand Down
Loading