同步代码

This commit is contained in:
YuhangQ 2023-04-08 07:26:09 +00:00
parent 3a02172853
commit 72dc154140
4 changed files with 5 additions and 19 deletions

Binary file not shown.

View File

@ -81,11 +81,6 @@ void worker_main(light* S, int num_procs, int rank) {
}
}
int flag;
if(MPI_Test(solved_request, &flag, MPI_STATUS_IGNORE) == MPI_SUCCESS && flag == 0) {
MPI_Cancel(solved_request);
}
} else if(res == 20) {
int flag;
int is_sat = 0;
@ -94,15 +89,5 @@ void worker_main(light* S, int num_procs, int rank) {
// when unknown do nothing.
}
int flag;
if(MPI_Test(model_request, &flag, MPI_STATUS_IGNORE) == MPI_SUCCESS && flag == 0) {
MPI_Cancel(model_request);
}
if(MPI_Test(&S->terminal_request, &flag, MPI_STATUS_IGNORE) == MPI_SUCCESS && flag == 0) {
MPI_Cancel(&S->terminal_request);
}
//delete(S);
MPI_Barrier(MPI_COMM_WORLD);
}

View File

@ -20,7 +20,7 @@ int main(int argc, char **argv) {
light* S = new light();
S->arg_parse(argc, argv);
// 初始化节点关系
// 初始化环形节点关系
S->rank = rank;
S->num_procs = num_procs;
if(rank == 0) {

View File

@ -164,10 +164,8 @@ int light::solve() {
s->clause_sharing_init();
}
while (!terminated) {
usleep(100000);
usleep(500000);
if(OPT(share)) s->do_clause_sharing();
@ -185,6 +183,9 @@ int light::solve() {
terminate_workers();
}
}
if(OPT(share)) s->clause_sharing_end();
// printf("ending solve\n");
// terminate_workers(); //important, need combine nps/dps !!!!!!!!!!!!!!!!