Python - parallel construction of a matrix -
What is the correct method in Python to parallel the creation of Python Matrix M? Ideally, each thread will be responsible for setting the values of a subset of rows. The resulting matrix will be input for a classifier. Can Python Global Interpreter Lock be able to prevent efficient parallel?
I consider the input list composed of the template (I, j, k). I wish i for all tuples for [i, j] = i. I: M [i, j] = k
m = scipy.sparse.dok_matrix ((num_rows, num_cols)) for i, j, k < / Div>
All updates of the matrix can be done concurrently, the list of tuples does not contain incompatible data, i.e. Each matrix element is most often set.
When GIL is out of the way and the matrix can be shared in any number of threads, then it boils down to whether scipy.sparse.dok_matrix is capable of accepting concurrent updates.
Unfortunately neither scipy.sparse.dok_matrix nor the answer seems to be answered.
Comments
Post a Comment