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

overflowing 32-bit integer in ML #598

Closed
pwxy opened this issue Sep 6, 2016 · 5 comments
Closed

overflowing 32-bit integer in ML #598

pwxy opened this issue Sep 6, 2016 · 5 comments
Assignees
Labels

Comments

@pwxy
Copy link

pwxy commented Sep 6, 2016

Hello Ray,

I noticed that in your August 26 17:15:44 check-in for ml_MultiLevelPreconditioner_Smoothers.cpp, you changed the following two lines from:

double local[2];
double global[2];

to:

int local[2];
int global[2];

What was the reason for this change?

Isn't this a bug? Because global[1] stores the "# estim. global nnz =", and for our MHD problems with 8 PDEs per mesh node, for greater than 10 million row matrices we will overflow a 32-bit int (since we will have greater than 2 billion global nnz). I was going to change them back to doubles, but I realized I should check with you first.

thanks
-paul

@pwxy
Copy link
Author

pwxy commented Sep 6, 2016

Hi Ray,

64-bit integers would work too (as an alternative to double). I think Jonathan had switched them from "int" to "double" ~10 years ago to avoid the overflow. I'll let you push the changes to the repo since it affects some of your other code.

thanks
-paul

@rstumin
Copy link
Contributor

rstumin commented Sep 6, 2016

Having some problems compile on cee-compute011 today. Not sure what it is ... it looks like something in the openmpi
changed late last week ... and this seems to be affecting my builds. I've got a couple of other meetings ... but will
try to get to this soon.

-Ray

On 09/06/16 08:16, pwxy wrote:

Hi Ray,

64-bit integers would work too (as an alternative to double). I think Jonathan had switched them from "int" to "double"
~10 years ago to avoid the overflow. I'll let you push the changes to the repo since it affects some of your other code.

thanks
-paul


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#598 (comment), or mute the thread
https://github.com/notifications/unsubscribe-auth/ALR0uT1n3VyUqMrdNv6lw6f4aagJV_LSks5qnYO6gaJpZM4J124Q.

Ray Tuminaro phone: (925) 294-2564
MS 9159 fax: (925) 294-2234
Sandia National Laboratories email: rstumin@sandia.gov
PO Box 969 http://www.cs.sandia.gov/~rstumin
Livermore, CA 94551

@aprokop
Copy link
Contributor

aprokop commented May 14, 2017

This was fixed in 4072573.
The fix was:

-    int local[2];
-    int global[2];
+    long int local[2];
+    long int global[2];

@aprokop aprokop closed this as completed May 14, 2017
@mhoemmen
Copy link
Contributor

Not really a fix, since long int can be 32 bits on some platforms. long long is guaranteed to be >= 64 bits, but requires C99/C++11.

@aprokop
Copy link
Contributor

aprokop commented May 16, 2017

True. But since the last communication was in September, and nobody complained since, and there was a patch dedicated to this...

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

No branches or pull requests

5 participants