Skip to content
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

Fix using co_reduce(...operator=...) for F2018. #746

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

vehre
Copy link
Collaborator

@vehre vehre commented Jan 11, 2022

In F2018 and with gcc>=12 is has to be co_reduce(...operation=...).

coverage on master
Codecov branch

Summary of changes

Fix using co_reduce(...operator=...) for F2018.

Rationale for changes

gcc >= 12 implements the F2018 change for the co_reduce( operator=...)-parameter to be named 'operation=...'. This patch fixes the different naming by using the pre-processor where operator is used.

Additional info and certifications

This pull request (PR) is a:

  • Bug fix
  • Feature addition
  • Other, Please describe:

I certify that

  • I certify that:
    • I have reviewed and followed the contributing guidelines
    • I will wait at least 24 hours before self-approving the PR to give another
      OpenCoarrays developer a chance to review my proposed code
    • I have not introduced errant white space (no trailing white space or white space errors may
      be introduced)
    • I have added an explanation of what these changes do and why they should be included
    • I have checked to ensure there aren't other open Pull Requests for the same change
    • I have you written new tests for these changes
    • I have successfully tested these changes locally
    • I have commented any non-trivial, non-obvious code changes
    • The commits are logically atomic, self consistent and coherent
    • The commit messages follow best practices
    • Test coverage is maintained or increased after this is merged

Code coverage data

coverage on master

@everythingfunctional
Copy link
Collaborator

Just a quick background question. Is OpenCoarrays intended to work with any compilers other than gfortran? If so, I'd suggest reversing the preprocessor condition so that only gfortran versions less than 12 use the old argument name. Other than that this is a straightforward addition and it looks good to me.

@rouson
Copy link
Member

rouson commented Jan 20, 2022

@everythingfunctional other compiler development teams are considering using OpenCoarrays, but if [Caffeine] progresses quickly enough, then I think it's more likely that other compilers will adopt Caffeine -- at least that's the hope.

@vehre if you agree with the above comment by @everythingfunctional , please make the suggested edit, push again, and I'll merge or possibly you can merge now that the main branch is no longer protected. If so, feel free to do so.

@vehre vehre force-pushed the issue-745-rename-co_reduce-operator-for-F2018 branch from 31e87e9 to 9690a5e Compare January 24, 2022 09:21
@vehre
Copy link
Collaborator Author

vehre commented Jan 24, 2022

I have reversed the preprocessor directives. At least I hope this is what @everythingfunctional meant?!

@everythingfunctional
Copy link
Collaborator

I think that works. Do you know how that evaluates if __GNUC__ isn't defined (e.g. you're using a different compiler)? If it evaluates to false, then yeah, that's perfect, but I'm not sure. Maybe it should be #if defined(__GNUC__) && __GNUC__ < 12?

In F2018 and with gcc>=12 is has to be co_reduce(...operation=...).
@vehre vehre force-pushed the issue-745-rename-co_reduce-operator-for-F2018 branch from 9690a5e to 896f2dd Compare January 25, 2022 11:29
@vehre
Copy link
Collaborator Author

vehre commented Feb 14, 2022

I think that works. Do you know how that evaluates if __GNUC__ isn't defined (e.g. you're using a different compiler)? If it evaluates to false, then yeah, that's perfect, but I'm not sure. Maybe it should be #if defined(__GNUC__) && __GNUC__ < 12?

Updated that, ok for merge now?

Copy link
Collaborator

@everythingfunctional everythingfunctional left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@rouson rouson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rouson rouson merged commit db82afc into main Feb 14, 2022
@rouson rouson deleted the issue-745-rename-co_reduce-operator-for-F2018 branch February 14, 2022 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants