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

weird behavior on some Macs #62

Closed
jsocolar opened this issue Mar 19, 2023 · 6 comments
Closed

weird behavior on some Macs #62

jsocolar opened this issue Mar 19, 2023 · 6 comments

Comments

@jsocolar
Copy link
Contributor

Some pretty spooky behavior is bubbling up in users of R package dggridR that I think must have its origins in DGGRID itself. I think the most complete statement of the issue is here, though as noted this looks like the same issue. The issue has only been reported by users of M1 chips, but it isn't clear what the significance of that is--maybe it's specific to the M1 architecture, or maybe it is specific to some other aspect of these machines (e.g. the C++ compiler or goodness knows what else).

@sahrk
Copy link
Owner

sahrk commented Mar 19, 2023

Thanks for the heads up @jsocolar, I think you're probably right that this is a DGGRID issue so I'm going to have to have a look at it. Alas, I hate hunting weird numeric bugs...

@jsocolar
Copy link
Contributor Author

Thanks @sahrk! Happy to run tests on M1 for you if that's helpful, though I'd need relatively complete and explicit instructions for how to run them. Love DGGRID!

@sahrk
Copy link
Owner

sahrk commented Mar 21, 2023

Thanks @sahrk! Happy to run tests on M1 for you if that's helpful

Why I was just about to ask you if you might be willing to do so, thanks!

I'd like to confirm that the problem is with DGGRID and not dggridR. Could you build DGGRID from this repository, if you don't already have it? (See INSTALL.md)

Then put the two attached files geoPts.txt and meta.txt into your current directory and run:

DGGRID/build/src/apps/dggrid/dggrid meta.txt &> output.txt

Then please give me the resulting files output.txt and seqNums.txt.

Note that geoPts.txt contains the problem points from your issue, which are clustered near an icosahedron edge near a vertex (see picture). So I'm betting the ISEA projection is failing in some way.

geoPts
geoPts.txt
meta.txt

@jsocolar
Copy link
Contributor Author

jsocolar commented Apr 9, 2023

Sorry this took me so long! I'm pretty sure I've managed to do the right steps. In case it matters DGGRID did not find GDAL on my system. The two files you requested are attached.
output.txt
seqNums.txt

This was on OS 12.2 with an M1 Pro chip.

@sahrk
Copy link
Owner

sahrk commented Apr 20, 2023

Thanks @jsocolar, that looks perfect and no worries on the time! I don't think the lack of GDAL should matter. I notice that the M1 has a 64 bit long double, vs. the 128 bits on intel Macs, which may somehow be causing the issues. Your output.txt narrowed down where the issue is manifesting; I'm wondering if I could ask you to do another run to narrow it down even more?

To do so, first update to (or download the latest version of) the master branch of DGGRID. Then in DGGRID/src/lib/dglib/include/dglib/DgBase.h line 36 change #define DGDEBUG 0 to #define DGDEBUG 1. Then run make.

Then put the two attached files into your current directory and run:
DGGRID/build/src/apps/dggrid/dggrid transformMeta.txt &> output.txt

Finally, please give me the resulting files output.txt and transformed.txt.

input.txt
transformMeta.txt

@SebKrantz
Copy link
Contributor

SebKrantz commented Jul 10, 2023

Hello @sahrk. I've run this on a normal M1 chip, after building in debug mode. Here is the output.
output.txt

I've also run meta.txt again and get the same error and cell numbers
output_meta.txt
seqNums.txt

It would be very nice if the source of this bug could be found, so we can push out an update to dggridR that will make it work again for Mac users. Curiously I find that v2.0.3 of dggridR, which uses v6.1 of DGGRID (https://github.com/r-barnes/dggridR/blob/v2.0.3/src/DgBase.h) does work with the M1. This version however uses depreciated spatial libraries in R so it will be best to resolve the issue in the current version of DGGRID and release an updated version of dggridR - also for apple silicon users of DGGRID.

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

No branches or pull requests

3 participants