我目前不熟悉openMP和Buddy 2.4,当我使用以下代码制作并行BDD时,我一直在努力创建具有开放式MP架构的并行BDD的问题
/* open MP code */
#pragma omp parallel for shared(z) private(tid) num_threads(4)
for(tid=0;tid<32;tid++)
{
int ti = omp_get_thread_num();
z[tid]=z[tid]&z[64-tid-1];
printf("\n z[%d] = z[%d] & z[%d] from thread number : %d, %d \n", tid,tid, 64-tid-1,ti,bdd_nodecount(z[tid]));
}
实际上,我正在将64个bdd和它们存储在前32个BDD&#39中
和在anding之前的前64个BDD的nodecount
Node count for z[0] = 0
Node count for z[1] = 0
Node count for z[2] = 0
Node count for z[3] = 0
Node count for z[4] = 0
Node count for z[5] = 0
Node count for z[6] = 0
Node count for z[7] = 0
Node count for z[8] = 0
Node count for z[9] = 0
Node count for z[10] = 0
Node count for z[11] = 0
Node count for z[12] = 0
Node count for z[13] = 1
Node count for z[14] = 1
Node count for z[15] = 1
Node count for z[16] = 1
Node count for z[17] = 1
Node count for z[18] = 1
Node count for z[19] = 3
Node count for z[20] = 5
Node count for z[21] = 5
Node count for z[22] = 5
Node count for z[23] = 5
Node count for z[24] = 5
Node count for z[25] = 3
Node count for z[26] = 3
Node count for z[27] = 3
Node count for z[28] = 5
Node count for z[29] = 5
Node count for z[30] = 5
Node count for z[31] = 5
Node count for z[32] = 7
Node count for z[33] = 5
Node count for z[34] = 5
Node count for z[35] = 5
Node count for z[36] = 7
Node count for z[37] = 7
Node count for z[38] = 7
Node count for z[39] = 7
Node count for z[40] = 9
Node count for z[41] = 7
Node count for z[42] = 7
Node count for z[43] = 7
Node count for z[44] = 7
Node count for z[45] = 7
Node count for z[46] = 9
Node count for z[47] = 11
Node count for z[48] = 13
Node count for z[49] = 13
Node count for z[50] = 13
Node count for z[51] = 15
Node count for z[52] = 15
Node count for z[53] = 9
Node count for z[54] = 11
Node count for z[55] = 11
Node count for z[56] = 11
Node count for z[57] = 11
Node count for z[58] = 15
Node count for z[59] = 15
Node count for z[60] = 15
Node count for z[61] = 19
Node count for z[62] = 23
Node count for z[63] = 19
问题是代码是完全串行运行的(没有使用openMP),但是在使用openMP时,正在启动垃圾收集,因为正在删除节点。
Garbage collection #2: 10000019 nodes / 10000017 free / 1.3s / 2.1s total
BDD error: Unknown BDD - was not in node table
BDD error: Unknown BDD - was not in node table
BDD error: Unknown BDD - was not in node table
BDD error: Unknown BDD - was not in node table
我无法理解为什么会这样,这里有可能的解决方案[不工作]我已经提出
解决方案1 [不工作]
提供对节点的可能引用和参考。 这部分解决方案不起作用,因为我们必须将bdd转换为BDD,而bddithvar(i)[我在代码的某些部分使用]无法转换为BDD,因此会出现错误转换错误。 / p>
解决方案2 [不工作]
使用部分在Open MP上运行程序
此部分也无效,抛出同样的错误。
解决方案3 [不工作]
将BDD分成两个或多个部分并将部分内容传输到另一个BDD,例如创建2个BDD(z1 [32]和z [64]),将z [64]的一半传输到z1 [32] ]并行运行代码。但仍然犯同样的错误。
解决方案4 [仍在尝试]
通过调试代码专门启动垃圾收集停止 仍在弄清楚如何做到这一点,任何有关这方面的评论都会有所帮助。
解决方案5 [不工作]
可能给特定线程一个特定的任务。 例如,线程1应该执行10个BDD,并且线程2应该执行下一个BDD的等等,但仍然不能正常工作。
我的程序基本上是BDD的,并且有6个循环 首先是64 BDD然后是32,然后是16等等。
因此,如果偶然地清除了前64个BDD并且它总是卡在32个BDD之间,它并没有超越它。
所以我的问题是:为什么垃圾收集会发生,虽然64 BDD包含一些节点值,为什么会发生垃圾收集,是否有任何方法应该停止垃圾收集,任何关于此的评论将不胜感激,谢谢
编辑:这个程序运行完全顺序,但并行地进行垃圾收集