并行创建稀疏矩阵
是否有任何算法可以并行高效地创建(元素填充)稀疏(例如 CSR 或坐标)矩阵?
Are there any algorithms that allow efficient creation (element filling) of sparse (e.g. CSR or coordinate) matrix in parallel?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您将矩阵存储为坐标图,则任何具有可用并发字典实现的语言都可以为您完成这项工作。
Java 具有 ConcurrentHashMap,.NET 4 具有 ConcurrentDictionary,两者都允许并行进行多线程非阻塞 (afaik) 元素插入。
If you store your matrix as a coordinate map, any language which has a concurrent dictionary implementation available should do the job for you.
Java's got the
ConcurrentHashMap
, and .NET 4 hasConcurrentDictionary
, both of which allow multi-threaded non-blocking (afaik) element insertion in parallel.没有有效的算法以数据并行方式创建稀疏矩阵。合理的是坐标矩阵类型,它需要在内容填充后进行排序,但这种类型对于矩阵乘积等来说速度很慢。
解决方案是你不构建稀疏矩阵 - 你不将它保存在内存中;当您计算稀疏矩阵的元素时,您会就地进行隐式运算。
There are no efficient algorithms for creating sparse matrices in data-parallel way. Plausible is coordinate matrix type which requires sorting after content filling, but that type is slow for matrix products etc.
Solution is you don't build sparse matrix - you don't keep it in memory; you do implicit operations in place when you're calculating elements of sparse matrix.