PySAT支持并行求解吗?

2024-04-27 22:26:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用PySAT。有线程数参数吗?或者是一个可以通过这种方式并行化的打包解算器

(目前,我正在使用Glucose4解算器。)


Tags: 参数方式线程算器pysatglucose4
1条回答
网友
1楼 · 发布于 2024-04-27 22:26:47

我深入研究了源代码,答案似乎是否定的

PySAT代码库中对线程的唯一引用是一些checks whether the current thread is the ‘main’ oneadjusts signal handling logic based on that的代码。库中的任何内容都不允许用户控制实际解算器使用的并行级别

提问者在评论中提到了最好的解决方法:手动将问题空间拆分为可以并行独立解决的子案例。幸运的是,SAT特别容易采用这种方法

转载意见:

The trick is to case-split on n variables, in that way you can utilize 2^n cores. You solve the same formula in each thread, but with True/False substituted for those variables, and hopefully it's faster

相关问题 更多 >