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

Check for NaNs and INFs in input to shr_reprosum_calc #1703

Merged
merged 2 commits into from
Aug 9, 2017

Conversation

worleyph
Copy link
Contributor

@worleyph worleyph commented Aug 6, 2017

In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]

In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]

*********1*********2*********3*********4*********5*********6*********7**
Longer commit message body describing the commit.
Can contain lists as follows:
	* Item 1
	* Item 2
	* Item 3

A good commit message should be written like an email, a subject
followed by a blank line, followed by a more descriptive body.

Can also contain a tag at the bottom describing what type of commit this is.
[BFB] - Bit-For-Bit
[FCC] - Flag Climate Changing
[Non-BFB] - Non Bit-For-Bit
[CC] - Climate Changing
[NML] - Namelist Changing

See confluence for a more detailed description about these tags.
@worleyph
Copy link
Contributor Author

worleyph commented Aug 6, 2017

Tested with

-compset A_WCYCL2000 -res ne30_oEC

on Titan and using PGI. Was BFB (in that the error test was not true, so everything worked as if the test was not there). I also modified the code to insert both some NaNs and some INFs, and the test reported these and then killed the job, as designed.

@golaz golaz added this to the v1.0beta2 milestone Aug 7, 2017
@@ -338,8 +339,14 @@ subroutine shr_reprosum_calc (arr, arr_gsum, nsummands, dsummands, &
logical :: validate ! flag indicating need to
! verify gmax and max_levels
! are accurate/sufficient
integer :: nan_check, inf_check ! flag on whether there are
Copy link
Member

Choose a reason for hiding this comment

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

This was probably meant to be logical :: nan_check, inf_check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - I'll update immediately. My tests still worked though ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just got lucky that assigning logical output to an integer and then testing using the integer gave the same result? At least it was consistent (assignment of logical to integer and evaluating integer as a logical).

New logical variables nan_check and inf_check were mistakenly
declared as integer.
amametjanov added a commit that referenced this pull request Aug 7, 2017
…1703)

Check for NaNs and INFs in input to shr_reprosum_calc:
In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]
@amametjanov amametjanov merged commit b537324 into master Aug 9, 2017
amametjanov added a commit that referenced this pull request Aug 9, 2017
Check for NaNs and INFs in input to shr_reprosum_calc:
In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]
@amametjanov amametjanov deleted the worleyph/cime/add_NaNcheck_to_reprosum branch August 9, 2017 23:34
jgfouca added a commit that referenced this pull request Oct 3, 2017
…amelist-parsing-order

Fix bug in case.run where arg skip-preview-namelist is out of sequence

arg parsing needs to be done after adding arguments
master is broken on acme mira/cetus and blues/anvil without this fix

Test suite: acme_developer on anvil
Test baseline:
Test namelist changes:
Test status:

Fixes #1690

User interface changes?:

Update gh-pages html (Y/N)?:

Code review:
jgfouca pushed a commit that referenced this pull request Oct 25, 2017
Check for NaNs and INFs in input to shr_reprosum_calc:
In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]
jgfouca pushed a commit that referenced this pull request Feb 27, 2018
Check for NaNs and INFs in input to shr_reprosum_calc:
In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]
jgfouca pushed a commit that referenced this pull request Mar 14, 2018
Check for NaNs and INFs in input to shr_reprosum_calc:
In recent development NaNs and INFs are often first
identified when passed to the shr_reprosum_calc routine,
where they either lead to segmentation faults or to
very slow performance (due to the interaction of NaNs and
INFs with the reproducible sum logic). To more readily
identify this error condition (and to prevent false
attributions of error to shr_reprosum_calc), the input array
is checked for the presence of NaNs and INFs. If found,
an appropriate error message is output and the job is
terminated.

[BFB]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants