Skip to content

OMP: Error #134: Cannot set thread affinity mask. #9328

@JohnNapier

Description

@JohnNapier

This issue has been reported in the past, however there were some problems reproducing it. (#6720). I'm providing some code that hopefully helps catch the bug (finally!).

The error appears to be related to the division of a large Series or DataFrame that was built by pd.read_hdf(). To see this, please run the following sample code:

import pandas as pd,numpy as np
# Works
df=pd.DataFrame(np.arange(10000).reshape(-1,4),columns=['a','b','c','d'])
df.to_hdf('hdf5.h5','test')
df=pd.read_hdf('hdf5.h5','test')
x=(df['a']-df['b'])/(df['c']-df['d'])
print 'Done for 10000'

# Does not work
df=pd.DataFrame(np.arange(100000).reshape(-1,4),columns=['a','b','c','d'])
df.to_hdf('hdf5.h5','test')
df=pd.read_hdf('hdf5.h5','test')
x=(df['a']-df['b'])/(df['c']-df['d'])
print 'Done for 100000'

The first operation is carried out, however the second one produces this error when the division is attempted.

OMP: Error #134: Cannot set thread affinity mask.
OMP: System error #87: The parameter is incorrect.

The issue can be avoided by:

  1. operating with Numpy arrays, e.g.
x=(df['a']-df['b']).values/(df['c']-df['d']).values 
  1. or by setting
pd.computation.expressions.set_use_numexpr(False)
  1. or by creating the DataFrame from pd.read_csv().

I'm running Pandas 0.15.2-1, Numpy 1.8.1-2. Enthought's Canopy 1.5.0.2717.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildLibrary building on various platforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions