可以使用的初版代码

This commit is contained in:
YuhangQ 2023-04-09 18:17:44 +08:00
parent 87d7a1d448
commit bd02e58383
2 changed files with 10 additions and 12 deletions

2
run.sh
View File

@ -4,4 +4,4 @@
#valgrind #valgrind
make -j 16 && mpirun -np 4 --allow-run-as-root ./light -i data/class_1_easy_10_0.cnf --share=1 --threads=32 --times=1000 make -j 16 && mpirun -np 9 --allow-run-as-root ./light -i data/WS_500_16_70_10.apx_0.cnf --share=1 --threads=32 --times=1000

View File

@ -119,8 +119,6 @@ bool receive_clauses_from_last_node(vec<clause_store*> &clauses) {
return received; return received;
} }
void sharer::clause_sharing_init() { void sharer::clause_sharing_init() {
MPI_Comm_size(MPI_COMM_WORLD, &num_procs); MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@ -170,14 +168,14 @@ void sharer::do_clause_sharing() {
} }
} }
// 导入当前节点产生的子句 //导入当前节点产生的子句
int percent = sort_clauses(i); // int percent = sort_clauses(i);
if (percent < 75) { // if (percent < 75) {
producers[i]->broaden_export_limit(); // producers[i]->broaden_export_limit();
} // }
else if (percent > 98) { // else if (percent > 98) {
producers[i]->restrict_export_limit(); // producers[i]->restrict_export_limit();
} // }
for (int j = 0; j < consumers.size(); j++) { for (int j = 0; j < consumers.size(); j++) {
if (producers[i]->id == consumers[j]->id) continue; if (producers[i]->id == consumers[j]->id) continue;
@ -186,7 +184,7 @@ void sharer::do_clause_sharing() {
consumers[j]->import_clauses_from(cls); consumers[j]->import_clauses_from(cls);
} }
for (int k = 0; k < cls.size(); k++) { for (int k = 0; k < cls.size(); k++) {
cls[k]->free_clause(); int res = cls[k]->free_clause();
} }
} }