Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c358c764 authored by David Parsons's avatar David Parsons
Browse files

streamline output to stdout

parents 9c66f0c8 da7487de
No related branches found
No related tags found
No related merge requests found
......@@ -74,48 +74,6 @@ namespace aevol {
void init(int init_size, int pop_size = -1);
void stats() {
size_t total_length_ = 0;
size_t* a_total_length_ = new size_t[local_list_unused_dna_.size()];
int32_t nb_dna = 0;
for (std::list<Dna_7 *>::iterator it_dna = list_unused_dna_.begin();
it_dna != list_unused_dna_.end(); it_dna++) {
total_length_ += (*it_dna)->nb_block() * BLOCK_SIZE * sizeof(char);
nb_dna++;
}
for (size_t j = 0; j < local_list_unused_dna_.size(); j++) {
a_total_length_[j] = 0;
for (std::list<Dna_7 *>::iterator it_dna = local_list_unused_dna_[j].begin();
it_dna != local_list_unused_dna_[j].end(); it_dna++) {
total_length_ += (*it_dna)->nb_block() * BLOCK_SIZE * sizeof(char);
a_total_length_[j]+= (*it_dna)->nb_block() * BLOCK_SIZE * sizeof(char);
nb_dna++;
}
a_total_length_[j] /= 1000000;
}
total_length_ /= 1000000;
printf("DNA_FACTORY_STATS -- Number of DNAs %d - Combined size %zu Mb (%zu):: ",
// local_empty,empty_global,
// free_local,free_space_local,free_global,
nb_dna, total_length_,local_list_unused_dna_.size());
for (size_t j = 0; j < local_list_unused_dna_.size(); j++) {
printf("%zu ",a_total_length_[j]);
}
printf("\n");
// empty_global = 0;
// local_empty = 0;
// free_space_local = 0;
// free_local = 0;
// free_global = 0;
delete [] a_total_length_;
}
Dna_7 *get_dna(int request_size);
void give_back(Dna_7 *dna);
......
......@@ -462,9 +462,6 @@ void ExpManager_7::apply_mutations(int indiv_id) {
}
ExpManager_7::~ExpManager_7() {
printf("Destroy SIMD Controller\n");
delete stats_best;
delete stats_mean;
......@@ -2915,9 +2912,10 @@ for (size_t index = 0; index < mutant_list_.size(); index++) {
previous_individuals);
if (AeTime::time() % exp_m_->backup_step() == 0) {
std::cout << "writing light tree for gen : " << AeTime::time()
<< '\n';
std::cout << " Writing light tree for generation " << AeTime::time() << "...";
std::cout.flush();
exp_m_->output_m()->write_light_tree(AeTime::time());
std::cout << " OK" << std::endl;
}
}
......@@ -2932,9 +2930,10 @@ for (size_t index = 0; index < mutant_list_.size(); index++) {
char tree_file_name[50];
sprintf(tree_file_name, "tree/tree_" TIMESTEP_FORMAT ".ae", AeTime::time());
std::cout << "writing 7777 tree for gen : " << AeTime::time()
<< '\n';
std::cout << " Writing tree for generation " << AeTime::time() << "...";
std::cout.flush();
exp_m_->output_m()->tree()->write_to_tree_file(tree_file_name);
std::cout << " OK" << std::endl;
}
}
......@@ -2942,6 +2941,9 @@ std::cout << "writing 7777 tree for gen : " << AeTime::time()
if (AeTime::time() % exp_m_->backup_step() == 0) {
#pragma omp single
{
std::cout << " Writing checkpoint for generation " << AeTime::time() << "...";
std::cout.flush();
for (int indiv_id = 0; indiv_id < (int) exp_m_->nb_indivs(); indiv_id++) {
int x = indiv_id / exp_m_->world()->height();
int y = indiv_id % exp_m_->world()->height();
......@@ -3006,7 +3008,6 @@ std::cout << "writing 7777 tree for gen : " << AeTime::time()
exp_m_->world()->x_best = idx_best / exp_m_->world()->height();
exp_m_->world()->y_best = idx_best % exp_m_->world()->height();
// Create missing directories
exp_m_->WriteDynamicFiles();
std::ofstream last_gener_file(LAST_GENER_FNAME,
......@@ -3014,6 +3015,7 @@ std::cout << "writing 7777 tree for gen : " << AeTime::time()
last_gener_file << AeTime::time() << std::endl;
last_gener_file.close();
std::cout << " OK" << std::endl;
}
}
......
......@@ -100,13 +100,6 @@ AbstractFuzzy* FuzzyFactory_7::createFuzzy() {
}
}
void FuzzyFactory_7::stats() {
int total_length_ =
((flavor_ == FuzzyFlavor::DISCRETE_DOUBLE_TABLE) ? PHENOTYPE_VECTOR_SIZE : 1) * list_unused_fuzzy_.size();
printf("FUZZY_FACTORY_STATS -- Number of Fuzzys %ld - Combined size %d elements\n",list_unused_fuzzy_.size(),
total_length_);
}
AbstractFuzzy* FuzzyFactory_7::get_fuzzy() {
AbstractFuzzy* pop = nullptr;
......
......@@ -59,7 +59,6 @@ class FuzzyFactory_7 {
~FuzzyFactory_7();
void init(int pop_size);
void stats();
AbstractFuzzy* get_fuzzy();
void give_back(AbstractFuzzy* fuzzy);
......
......@@ -551,8 +551,6 @@ void ExpManager::run_evolution() {
ae_logger::init("logger_csv.log");
printf("Launching TRACING...\n");
#else
printf("Launching NOT TRACING...\n");
#endif
#ifdef __TRACING__
......@@ -560,8 +558,6 @@ void ExpManager::run_evolution() {
high_resolution_clock::time_point t_t2,t1,t2;
#endif
printf("Tree activated %d\n",record_tree());
w_max_ = world()->indiv_at(0,0)->w_max();
bool first_run = true;
......@@ -586,8 +582,6 @@ void ExpManager::run_evolution() {
"============================== %" PRId64 " ==============================\n",
AeTime::time());
if (!first_run) {
exp_m_7_->dna_factory_->stats();
exp_m_7_->fuzzy_factory_->stats();
printf(
" Best individual's distance to target (metabolic) : %f (clones %d %ld)\n",
//exp_m_7_->best_indiv->indiv_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment