2024-04-27 22:26:47 发布
网友
我正在使用PySAT。有线程数参数吗?或者是一个可以通过这种方式并行化的打包解算器
(目前,我正在使用Glucose4解算器。)
我深入研究了源代码,答案似乎是否定的
PySAT代码库中对线程的唯一引用是一些checks whether the current thread is the ‘main’ one和adjusts 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
n
2^n
True
False
我深入研究了源代码,答案似乎是否定的
PySAT代码库中对线程的唯一引用是一些checks whether the current thread is the ‘main’ one和adjusts signal handling logic based on that的代码。库中的任何内容都不允许用户控制实际解算器使用的并行级别
提问者在评论中提到了最好的解决方法:手动将问题空间拆分为可以并行独立解决的子案例。幸运的是,SAT特别容易采用这种方法
转载意见:
相关问题 更多 >
编程相关推荐