Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-29030

Submit a ticket upstream to treecorr about mac vs linux differences

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • faro
    • None

    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 ]

      Attachments

        Activity

          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.

          krughoff Simon Krughoff (Inactive) 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.

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

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

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

          krughoff Simon Krughoff (Inactive) added a comment - - edited See the PR for the fix. I'll kick off a jenkins run .

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

          krughoff Simon Krughoff (Inactive) added a comment - Feel free to pass it on if you don't have the cycles for it

          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?

          jcarlin 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?
          kbechtol 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

          kbechtol 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

            krughoff Simon Krughoff (Inactive)
            krughoff Simon Krughoff (Inactive)
            Jeffrey Carlin
            Jeffrey Carlin, Keith Bechtol, Leanne Guy, Simon Krughoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Jenkins

                No builds found.