Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • development
  • main
  • refactor-libraries
  • 1.0.0
  • 1.0.1
  • 1.0.2
  • 1.0.3
  • 1.1.0
8 results

Target

Select target project
  • bdc/cats
1 result
Select Git revision
  • development
  • main
  • refactor-libraries
  • 1.0.0
  • 1.0.1
  • 1.0.2
  • 1.0.3
  • 1.1.0
8 results
Show changes
Commits on Source (2)
......@@ -301,6 +301,8 @@ void cleanup_configuration(struct cats_configuration **conf_orig)
free(conf->global_stats.populated_by_classes);
free_string_array(&conf->output.needed_output_directories);
free_string_array(&conf->output.needed_module_output_directories);
free_string_array(&conf->overlays.registered_custom_overlay_names);
free(conf->param);
conf->param = NULL;
free(conf->run_name);
......
......@@ -84,7 +84,7 @@ load_configuration_from_file(const char *filename, const struct program_options
conf->command_line_options = *command_line_options;
if (command_line_options->need_conf) {
conf->command_line_options.configuration_file = strdup(command_line_options->configuration_file);
//conf->command_line_options.configuration_file = strdup(command_line_options->configuration_file);
} else {
conf->command_line_options.configuration_file = strdup("auto-generated");
}
......
......@@ -102,6 +102,7 @@ void load_overlay_configuration(struct cats_configuration *conf, struct cats_ini
exit(EXIT_FAILURE);
}
free(type_name);
free(overlay_name);
}
free_string_array(&overlay_names);
......
......@@ -78,6 +78,7 @@ _Noreturn void exit_cats(int status)
exit(status);
}
......
......@@ -65,7 +65,7 @@ cats_dt_rates calculate_lambda(struct cats_configuration *conf, struct lambda_pa
//
double *matrix_copy = NULL;
matrix_copy = copy_matrix(matrix, N, N);
if (silent == false || conf->command_line_options.debug_flags & DEBUG_LAMBDA) {
matrix_copy = copy_matrix(matrix, N, N);
......
......@@ -183,14 +183,6 @@ void butterflies_area_dispersal(struct cats_grid *grid, struct cats_thread_info
butterflies_cell_dispersal(grid, ts, row, col, false, false);
}
}
/*
if (ts->rw_debug_cells_with_adults) {
log_message(LOG_INFO, "thread %d: %ld cells with adults, %ld random walks, %ld deposits",
ts->id, ts->rw_debug_cells_with_adults, ts->rw_debug_random_walks, ts->rw_debug_deposits);
}
*/
}
......@@ -250,9 +242,10 @@ enum action_status bf_action_dispersal(struct cats_grid *grid, struct cats_confi
threaded_action(&butterflies_area_dispersal, grid, conf, TS_DISPERSAL);
struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
for (enum butterfly_stats which = BF_RANDOM_WALK_DEPOSIT_COUNT; which < BF_STAT_MAX; which++) {
for (enum butterfly_stats which = BF_RANDOM_WALK_DEPOSIT_COUNT; which < BF_OUTPUT_STAT_MAX; which++) {
int64_t stat_id = module_conf->stat_ids[which];
log_message(LOG_INFO, "STAT %s: %ld", bf_get_stats_field_name(which), grid->stats.stats[stat_id]);
log_message(LOG_INFO, "STAT %s (%ld): %ld", bf_get_stats_field_name(which), stat_id,
grid->stats.custom_stats[stat_id]);
}
return ACTION_RUN;
......@@ -300,8 +293,7 @@ enum action_status bf_action_generation_update(struct cats_grid *grid, struct ca
int64_t cells_with_eggs_removed = grid->stats.custom_stats[egg_cells_removed_id];
log_message(LOG_INFO, "%ld cells with eggs left, %ld cells with eggs removed", cells_with_eggs,
cells_with_eggs_removed);
grid->stats.custom_stats[egg_cells_id] = 0;
grid->stats.custom_stats[egg_cells_removed_id] = 0;
return ACTION_RUN;
}
......@@ -312,7 +304,6 @@ enum action_status bf_action_overlay_update(struct cats_grid *grid, struct cats_
}
enum action_status bf_action_generation_finish(struct cats_grid *grid, struct cats_configuration *conf)
{
const int module_id = CATS_MODULE_ID;
......@@ -322,7 +313,7 @@ enum action_status bf_action_generation_finish(struct cats_grid *grid, struct ca
data->generation_current--;
assert(data->generation_current >= 0);
// struct conf_data_butterflies *data = CATS_MODULE_DATA;
return ACTION_RUN;
}
......
......@@ -42,6 +42,7 @@ static void inline single_random_walk(struct cats_thread_info *ts, struct cats_g
const struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
const bool debug_rw = module_conf->debug_rw;
const int64_t stat_id_deposits = module_conf->stat_ids[BF_RANDOM_WALK_DEPOSIT_COUNT];
const int64_t stat_id_rw_steps = module_conf->stat_ids[BF_RANDOM_WALK_STEP_COUNT];
int32_t eggs_left = eggs;
const cats_dt_coord max_steps = module_conf->animal_dispersal_max_radius;
......@@ -72,6 +73,8 @@ static void inline single_random_walk(struct cats_thread_info *ts, struct cats_g
return; // we escaped the simulation extent and got lost
}
increase_custom_stat(ts->stats, stat_id_rw_steps, 1);
// is the cell a valid dispersal target location?
if (!(data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)) {
......@@ -214,7 +217,6 @@ butterflies_cell_dispersal(struct cats_grid *grid, struct cats_thread_info *ts,
}
single_random_walk(ts, grid, row, col, eggs_to_disperse_per_female, egg_fraction_step, rw_number);
increase_custom_stat(ts->stats, stat_id_rw, 1);
......
......@@ -26,12 +26,10 @@ const char *bf_get_stats_field_name(enum butterfly_stats which)
return "unpopulated_unfit";
case BF_STAT_EXCLUDED:
return "excluded";
case BF_RANDOM_WALK_DEPOSIT_COUNT:
return "random_walk_deposit_count";
case BF_RANDOM_WALK_COUNT:
return "random_walk_count";
case BF_RANDOM_WALK_STEP_COUNT:
return "random_walk_step_count";
case BF_OUTPUT_STAT_MAX:
......
......@@ -16,9 +16,9 @@ enum butterfly_stats {
BF_RANDOM_WALK_DEPOSIT_COUNT,
BF_RANDOM_WALK_COUNT,
BF_RANDOM_WALK_STEP_COUNT,
BF_OUTPUT_STAT_MAX,
BF_CELLS_WITH_EGGS,
BF_CELLS_WITH_EGGS_REMOVED,
BF_OUTPUT_STAT_MAX,
BF_STAT_MAX
};
......@@ -31,7 +31,6 @@ static inline void increase_custom_stat(struct statistics *stats, int64_t stat_i
assert(stats != NULL);
assert(stat_id >= 0 && stat_id < stats->custom_stat_count);
stats->custom_stats[stat_id] += by;
}
......