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

Feature/aoloso/load balance #1650

Merged
merged 7 commits into from
Sep 1, 2022
Merged

Feature/aoloso/load balance #1650

merged 7 commits into from
Sep 1, 2022

Conversation

aoloso
Copy link
Contributor

@aoloso aoloso commented Aug 31, 2022

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@aoloso aoloso added the 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. label Aug 31, 2022
@aoloso aoloso requested a review from a team as a code owner August 31, 2022 20:30
Copy link
Contributor

@atrayano atrayano left a comment

Choose a reason for hiding this comment

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

Should we change line 87 in MAPL_LoadBalance.F90 from real to real(MAPL_r4). My concern is that if we ever compile MAPL with -r8 flag (probably many other pieces will break too. Fortunately, we never do this), the overload won't work

Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

Definitely a case that screams for templates in the language.

@tclune
Copy link
Collaborator

tclune commented Sep 1, 2022

Should we change line 87 in MAPL_LoadBalance.F90 from real to real(MAPL_r4). My concern is that if we ever compile MAPL with -r8 flag (probably many other pieces will break too. Fortunately, we never do this), the overload won't work

I am not worried about anyone using -r8 on MAPL; we'll never support that in our CMake, and I cannot imagine anyone rolling their own build.

But a closely related question on which we (I) never really come to a firm conclusion: what is the right/best way to declare such things. We have these choices:

  1. REAL*4 vs REAL*8
  2. REAL32 vs REAL64
  3. SELECT_REAL_KIND(...) (of which MAPL_R4 and MAPL_R8 are proxies)
  4. C_FLOAT vs C_DOUBLE

None of these is strictly guaranteed to work with all compilers. (1) is not standard conforming. For (2), compilers can return a value of -1 if they don't support a given precision. (3) may return the same KIND for both precision and therefore make the overload illegal. And (4) the compiler may not have a "companion" C compiler. Since all extant machines are IEEE and have companion compilers, (2-4) are effectively equivalent (assuming smart choices for the args in (3).)

@mathomp4 and I have tended towards choosing (2) as it standardizes where the named constants come from rather than each package defining their own (MAPL, ESMF, FMS, ...) ala (3). But (4) has that and in theory is necessary for C interoperability, which is not a high priority. (And in practice is equivalent to (2) anyway.)

Ugh.

@mathomp4 mathomp4 merged commit bf826c7 into develop Sep 1, 2022
@mathomp4 mathomp4 deleted the feature/aoloso/load_balance branch October 4, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants