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

Fix crash with numpy 1.13.3 #430

Merged
merged 1 commit into from Oct 24, 2017

Conversation

Projects
None yet
1 participant
@rainwoodman
Member

rainwoodman commented Oct 24, 2017

Workaround of numpy/numpy#9137.

It only becomes issue in recent versions of numpy where casting
rules are stricter.

Fix crash with numpy 1.13.3
Workaround of numpy/numpy#9137.

It only becomes issue in recent versions of numpy where casting
rules are stricter.
@rainwoodman

This comment has been minimized.

Member

rainwoodman commented Oct 24, 2017

We probably need a release due to this..

@rainwoodman

This comment has been minimized.

Member

rainwoodman commented Oct 24, 2017

Bug report from @modichirag

This is the error on Cori, it runs fine on Edison

Traceback (most recent call last):
  File "cfof-lhd.py", line 73, in <module>
Traceback (most recent call last):
  File "cfof-lhd.py", line 73, in <module>
    fofcat = fmap.make_finer(bs, 2*nc, seed, nsteps=nfsteps, cosmo=cosmo, pk=pk, ofolder=optfolder)
  File "/global/u1/c/chmodi/Programs/cosmo4d/cosmo4d/mapfof.py", line 105, in make_finer
    fofcat = fmap.make_finer(bs, 2*nc, seed, nsteps=nfsteps, cosmo=cosmo, pk=pk, ofolder=optfolder)
  File "/global/u1/c/chmodi/Programs/cosmo4d/cosmo4d/mapfof.py", line 105, in make_finer
    fof = FOF(cat, linking_length=0.2, nmin=12)
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 69, in __init__
    fof = FOF(cat, linking_length=0.2, nmin=12)
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 69, in __init__
    self.run()
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 95, in run
    self.run()
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 95, in run
    self.labels = _assign_labels(minid, comm=self.comm, thresh=self.attrs['nmin'])
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 232, in _assign_labels
    self.labels = _assign_labels(minid, comm=self.comm, thresh=self.attrs['nmin'])
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 232, in _assign_labels
    label = data['fofid'].unique_labels()
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 679, in unique_labels
    label = data['fofid'].unique_labels()
  File "/dev/shm/local/lib/python3.6/site-packages/nbodykit/algorithms/fof.py", line 679, in unique_labels
    label += sum(self.comm.allgather(Nunique)[:self.comm.rank])
TypeError: Cannot cast ufunc add output from dtype('int64') to dtype('bool') with casting rule 'same_kind'
    label += sum(self.comm.allgather(Nunique)[:self.comm.rank])
TypeError: Cannot cast ufunc add output from dtype('int64') to dtype('bool') with casting rule 'same_kind'

This is the corresponding code (the last line giving the error)

    cat = ArrayCatalog({'Position': X, 'Velocity' : V}, BoxSize=pmf.BoxSize, Nmesh=pmf.Nmesh)
    kdd = KDDensity(cat).density
    cat['KDDensity'] = kdd
    cat.save(ofolder + 'dynamic/1', ('Position', 'Velocity', 'KDDensity'))
    if pmf.comm.rank == 0:
        print('High-res dynamic model created')

    #FOF                                                                                                                                                       
    fof = FOF(cat, linking_length=0.2, nmin=12)

@rainwoodman rainwoodman merged commit f98603d into bccp:master Oct 24, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@rainwoodman rainwoodman deleted the rainwoodman:numpy-fof-crash-hotfix branch Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment