From fc190c48694774ba579c03b62ea280bd962ead5d Mon Sep 17 00:00:00 2001
From: Andreas Gattringer <andreas.gattringer@univie.ac.at>
Date: Tue, 11 Jul 2023 12:07:44 +0200
Subject: [PATCH] butterflies: log message when ending debug run early

---
 src/modules/butterflies/butterflies_dispersal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/modules/butterflies/butterflies_dispersal.c b/src/modules/butterflies/butterflies_dispersal.c
index 7422d08..b995e3d 100644
--- a/src/modules/butterflies/butterflies_dispersal.c
+++ b/src/modules/butterflies/butterflies_dispersal.c
@@ -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;
 
+
         int32_t eggs_left = eggs;
         const cats_dt_coord max_steps = module_conf->animal_dispersal_max_radius;
 
@@ -71,6 +72,7 @@ static void inline single_random_walk(struct cats_thread_info *ts, struct cats_g
                         return; // we escaped the simulation extent and got lost
                 }
 
+
                 // is the cell a valid dispersal target location?
                 if (!(data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)) {
                         if (debug_rw) {
@@ -220,6 +222,7 @@ butterflies_cell_dispersal(struct cats_grid *grid, struct cats_thread_info *ts,
         if (debug_rw) {
                 fflush(module_conf->debug_rw_file);
                 fclose(module_conf->debug_rw_file);
+                log_message(LOG_IMPORTANT, "Ending simulation early - first cell with random walks complete");
                 exit_cats(EXIT_SUCCESS);
         }
 }
\ No newline at end of file
-- 
GitLab