|
@@ -45,24 +45,10 @@ bool GSATThreadMPI::solve() {
|
|
mpiSync.join();
|
|
mpiSync.join();
|
|
//Si c'est le proc qui à trouvé
|
|
//Si c'est le proc qui à trouvé
|
|
if(find) {
|
|
if(find) {
|
|
- sleep(1); //Laisse le temps aux autres de se couper
|
|
|
|
//Affiche resultat
|
|
//Affiche resultat
|
|
|
|
+ sleep(1); //Attend la fin des autres processus
|
|
printf("-----------------------------------------------------------------------------------------------------------------\n");
|
|
printf("-----------------------------------------------------------------------------------------------------------------\n");
|
|
- printf(GREEN);
|
|
|
|
- printf("s %s\n",find?"SATISFIABLE":"NOT FOUND");
|
|
|
|
- printf(YELLOW);
|
|
|
|
- printf("c real time : %.4f seconds\n", result.calcTime);
|
|
|
|
- printf("c [pid:%6d][process:%2d][thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
|
|
|
|
- getpid(),
|
|
|
|
- world_rank,
|
|
|
|
- result.threadId,
|
|
|
|
- result.nbIteration,
|
|
|
|
- result.heuristicFill,
|
|
|
|
- result.heuristicSolve,
|
|
|
|
- result.nbSatisfiedClausesFill,
|
|
|
|
- result.nbSatisfiedClausesSolve);
|
|
|
|
- printf(RESET);
|
|
|
|
- fflush(stdout);
|
|
|
|
|
|
+ this->printResult();
|
|
}
|
|
}
|
|
return find;
|
|
return find;
|
|
}
|
|
}
|
|
@@ -71,6 +57,24 @@ void GSATThreadMPI::isEnd() {
|
|
end = true;
|
|
end = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void GSATThreadMPI::printResult() {
|
|
|
|
+ printf(GREEN);
|
|
|
|
+ printf("s %s\n",find?"SATISFIABLE":"NOT FOUND");
|
|
|
|
+ printf(YELLOW);
|
|
|
|
+ printf("c real time : %.4f seconds\n", result.calcTime);
|
|
|
|
+ printf("c [pid:%6d][process:%2d][thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
|
|
|
|
+ getpid(),
|
|
|
|
+ world_rank,
|
|
|
|
+ result.threadId,
|
|
|
|
+ result.nbIteration,
|
|
|
|
+ result.heuristicFill,
|
|
|
|
+ result.heuristicSolve,
|
|
|
|
+ result.nbSatisfiedClausesFill,
|
|
|
|
+ result.nbSatisfiedClausesSolve);
|
|
|
|
+ printf(RESET);
|
|
|
|
+ fflush(stdout);
|
|
|
|
+}
|
|
|
|
+
|
|
/* --- Private --- */
|
|
/* --- Private --- */
|
|
|
|
|
|
void GSATThreadMPI::solverThread(int id) {
|
|
void GSATThreadMPI::solverThread(int id) {
|