Browse Source

Amélioration affichage

Arthur Brandao 6 năm trước cách đây
mục cha
commit
b25502bad0

+ 5 - 3
Partie_1/Hybride/GSATThreadMPI.cpp

@@ -47,12 +47,13 @@ bool GSATThreadMPI::solve() {
 	if(find) {
 		sleep(1); //Laisse le temps aux autres de se couper
 		//Affiche resultat
-		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 [processor:%d][thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+        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,
@@ -85,7 +86,8 @@ void GSATThreadMPI::solverThread(int id) {
         if(solve) {
         	printf(CYAN);
         }
-		printf("c [processor:%d][thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+		printf("c [pid:%6d][process:%2d][thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+			getpid(),
 			world_rank,
 			id,
 		   	gsat[id]->getNbIterations(),

+ 1 - 1
Partie_1/Hybride/Main.cpp

@@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
   
     GSATThreadMPI* gsat = new GSATThreadMPI(nbThread, 3, gsatArg);
     if(world_rank == 0) {
-        printf("c nbProcessors: %d\n", world_size);
+        printf("c nbProcess: %d\n", world_size);
         printf("c nbThreads: %d\n", nbThread);
         printf("c nbVariables: %d\n", gsat->getNbVariables());
         printf("c nbClauses: %d\n", gsat->getNbClauses());

+ 6 - 4
Partie_1/MPI/Main.cpp

@@ -30,7 +30,7 @@ int main(int argc, char* argv[]) {
     gsat->setParameters(argc,argv);
     gsat->initialize();
     if(world_rank == 0) {
-        printf("c nbProcessors: %d\n", world_size);
+        printf("c nbProcess: %d\n", world_size);
         printf("c nbVariables: %d\n",gsat->getNbVariables());
         printf("c nbClauses: %d\n",gsat->getNbClauses());
     }
@@ -54,7 +54,8 @@ int main(int argc, char* argv[]) {
         if(end) {
             printf(CYAN);
         }
-        printf("c [processor:%d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+        printf("c [pid:%6d][process:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+            getpid(),
             world_rank,
             gsat->getNbIterations(),
             gsat->getHeuristicFill(),
@@ -86,12 +87,13 @@ int main(int argc, char* argv[]) {
             }
         }
         //Affiche le resultat
-        printf("--------------------------------------------------------------------------------------------\n");
+        printf("------------------------------------------------------------------------------------------------------\n");
         printf(GREEN);
         printf("s %s\n",end?"SATISFIABLE":"NOT FOUND");
         printf(YELLOW);
         printf("c real time : %.4f seconds\n", gsat->realTime() - startTime);
-        printf("c [processor:%d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+        printf("c [pid:%6d][process:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+            getpid(),
             world_rank,
             gsat->getNbIterations(),
             gsat->getHeuristicFill(),

+ 3 - 3
Partie_1/Thread/GSATThread.cpp

@@ -53,7 +53,7 @@ bool GSATThread::solve(int _maxIteration, bool verbose) {
 	}
 	//Resultat
 	if(verbose) {
-		printf("------------------------------------------------------------------------------------------\n");
+		printf("-----------------------------------------------------------------------------------------\n");
 		this->printResult();
 	}
   	return end;
@@ -72,7 +72,7 @@ void GSATThread::printResult() {
 	}
 	printf(YELLOW);
 	if(end) {
-		printf("c [thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+		printf("c [thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
 			result.threadId,
 			result.nbIteration,
 			result.heuristicFill,
@@ -96,7 +96,7 @@ void GSATThread::solverThread(int id, bool verbose) {
 			if(solve) {
 				printf(CYAN);
 			}
-			printf("c [thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+			printf("c [thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
 				id,
 		   		gsat[id]->getNbIterations(),
 		   		gsat[id]->getHeuristicFill(),

+ 5 - 5
Partie_2/EMA/GSATThread.cpp

@@ -42,17 +42,17 @@ bool GSATThread::solve(bool verbose) {
 	end = false;
 	calcTime = 0;
 	//Lance Initialise
-	printf("--- Initialize ---------------------------------------------------------------------------\n");
+	printf("--- Initialize --------------------------------------------------------------------------\n");
 	this->initBandit(verbose);
 	//Si la reponse n'a pas été trouvé durant l'initialisation
 	if(!end) {
 		//Lance les bandit avec la méthode choisit
-		printf("--- Search -------------------------------------------------------------------------------\n");
+		printf("--- Search ------------------------------------------------------------------------------\n");
 		this->runBandit(verbose);
 	}
 	//Resultat
 	if(verbose) {
-		printf("--- Result -------------------------------------------------------------------------------\n");
+		printf("--- Result ------------------------------------------------------------------------------\n");
 		this->printResult();
 	}
   	return end;
@@ -71,7 +71,7 @@ void GSATThread::printResult() {
 	}
 	printf(YELLOW);
 	if(end) {
-		printf("c [thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+		printf("c [thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
 			result.threadId,
 			result.nbIteration,
 			result.heuristicFill,
@@ -158,7 +158,7 @@ bool GSATThread::calc(int id, bool verbose) {
 		if(solve) {
 			printf(CYAN);
 		}
-		printf("c [thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+		printf("c [thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
 			id,
 		   	gsat[id]->getNbIterations(),
 		   	gsat[id]->getHeuristicFill(),

+ 5 - 5
Partie_2/Moyenne/GSATThread.cpp

@@ -42,17 +42,17 @@ bool GSATThread::solve(bool verbose) {
 	end = false;
 	calcTime = 0;
 	//Lance Initialise
-	printf("--- Initialize ---------------------------------------------------------------------------\n");
+	printf("--- Initialize --------------------------------------------------------------------------\n");
 	this->initBandit(verbose);
 	//Si la reponse n'a pas été trouvé durant l'initialisation
 	if(!end) {
 		//Lance les bandit avec la méthode choisit
-		printf("--- Search -------------------------------------------------------------------------------\n");
+		printf("--- Search ------------------------------------------------------------------------------\n");
 		this->runBandit(verbose);
 	}
 	//Resultat
 	if(verbose) {
-		printf("--- Result -------------------------------------------------------------------------------\n");
+		printf("--- Result ------------------------------------------------------------------------------\n");
 		this->printResult();
 	}
   	return end;
@@ -71,7 +71,7 @@ void GSATThread::printResult() {
 	}
 	printf(YELLOW);
 	if(end) {
-		printf("c [thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+		printf("c [thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
 			result.threadId,
 			result.nbIteration,
 			result.heuristicFill,
@@ -158,7 +158,7 @@ bool GSATThread::calc(int id, bool verbose) {
 		if(solve) {
 			printf(CYAN);
 		}
-		printf("c [thread:%2d][iteration:%5d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
+		printf("c [thread:%2d][iteration:%4d][fill:%d][heuristic:%d]Satisfied clauses (begin: %d)(end:%d)\n",
 			id,
 		   	gsat[id]->getNbIterations(),
 		   	gsat[id]->getHeuristicFill(),