# Submit a ticket upstream to treecorr about mac vs linux differences

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
1
• Team:
DM Science
• Urgent?:
No

#### Description

The results from treecorr depend on the underlying OS. I get different answers when running on linux vs macOS. The following snippet shows the issu:

 import numpy as np import treecorr import astropy.units as u   np.random.seed(8675309) ra = (np.random.random(100)*0.001 + 2.)*u.radian # Move off 0/360. discontinuity dec = (np.random.random(100)*0.001 - 0.1)*u.radian # Move off equator e1_res = 2*np.random.random(100) - 1. e2_res = 2*np.random.random(100) - 1.   pos_units = 'radian' nbins = 10 min_sep = 0.25 max_sep = 5. sep_units = 'arcmin'   catTree = treecorr.Catalog(ra=ra, dec=dec, g1=e1_res, g2=e2_res,  dec_units=pos_units, ra_units=pos_units) gg = treecorr.GGCorrelation(nbins=nbins, min_sep=min_sep, max_sep=max_sep,  sep_units=sep_units) gg.process(catTree) print(gg.meanlogr) 

On linux this gives:
[-1.2475868 -0.92888378 -0.62015337 -0.32374653 -0.02487182 0.27114931 0.56765978 0.87045272 1.14202255 1.3647294 ]

On macOS, it gives:
[-1.2475868 -0.92888378 -0.62015337 -0.32359399 -0.02516142 0.27028481 0.56836917 0.87014886 1.14075891 1.3647294 ]

#### Activity

Hide
Simon Krughoff added a comment -

Adding bin_slop to the call to GGCorrelation helps matching the bins, but it does not completely solve the architecture dependence as the xip values still differ between architectures. This is being dealt with by having reduced precision for that one test, but should be looked into.

Show
Simon Krughoff added a comment - Adding bin_slop to the call to GGCorrelation helps matching the bins, but it does not completely solve the architecture dependence as the xip values still differ between architectures. This is being dealt with by having reduced precision for that one test, but should be looked into.
Hide
Simon Krughoff added a comment -

A suggestion was made to use brute=True for cross platform tests. This should make everything repeatable to machine precision

Show
Simon Krughoff added a comment - A suggestion was made to use brute=True for cross platform tests. This should make everything repeatable to machine precision
Hide
Simon Krughoff added a comment - - edited

See the PR for the fix. I'll kick off a jenkins run.

Show
Simon Krughoff added a comment - - edited See the PR for the fix. I'll kick off a jenkins run .
Hide
Simon Krughoff added a comment -

Feel free to pass it on if you don't have the cycles for it

Show
Simon Krughoff added a comment - Feel free to pass it on if you don't have the cycles for it
Hide
Jeffrey Carlin added a comment -

Nice solution - I like having the brute option, but not making it the default. Thanks for sorting this out!

Did you actually need to submit a treecorr ticket, or is the behavior sufficiently well understood for that to be unnecessary?

Show
Jeffrey Carlin added a comment - Nice solution - I like having the brute option, but not making it the default. Thanks for sorting this out! Did you actually need to submit a treecorr ticket, or is the behavior sufficiently well understood for that to be unnecessary?
Hide
Keith Bechtol added a comment - - edited

This work was initially accomplished by https://jira.lsstcorp.org/browse/DM-26988 . Following a refactor, the issue was resolved again in https://jira.lsstcorp.org/browse/DM-31611

Show
Keith Bechtol added a comment - - edited This work was initially accomplished by https://jira.lsstcorp.org/browse/DM-26988 . Following a refactor, the issue was resolved again in https://jira.lsstcorp.org/browse/DM-31611

#### People

Assignee:
Simon Krughoff
Reporter:
Simon Krughoff
Reviewers:
Jeffrey Carlin
Watchers:
Jeffrey Carlin, Keith Bechtol, Leanne Guy, Simon Krughoff