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
Showing
with 39 additions and 48 deletions
......@@ -26,7 +26,7 @@
#include <cpl_string.h>
#include <assert.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "gdal_load.h"
#include "configuration/configuration.h"
#include "misc/misc.h"
......@@ -167,7 +167,7 @@ void verify_raster_geometry(GDALDatasetH dataset, struct simulation_geometry *ge
log_message(LOG_INFO, "GEOM: global projection string not set, ignoring projection '%s'", projection);
} else {
if (strcmp(projection, geometry->projection_string) != 0) {
enum cats_log_level ll;
enum bdc_log_level ll;
if (geometry->ignore_raster_projection) {
ll = LOG_INFO;
} else {
......
......@@ -29,7 +29,7 @@
#endif
#include <cats_ini/cats_ini.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "cats/command_line/command_line_options.h"
#include "configuration/load_vital_rates.h"
......
......@@ -26,7 +26,7 @@
#include "cats_global.h"
#include <math.h>
#include "data/cats_datatypes.h"
#include "logging/logging.h"
#include "bdc_logging/logging.h"
#include "assert.h"
#include "configuration/configuration.h"
#include "inline_overlays.h"
......
......@@ -25,7 +25,7 @@
#include <stdbool.h>
#include <math.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "eigen.h"
#include "matrix_helpers.h"
#include "inline.h"
......
......@@ -24,7 +24,7 @@
#include "dispersal/dispersal.h"
#include "leslie_matrix.h"
#include "bdc_memory/bdc_memory.h"
#include "logging/logging.h"
#include "bdc_logging/logging.h"
#include "configuration/configuration.h"
#include "inline.h"
#include "matrix_helpers.h"
......
......@@ -21,7 +21,7 @@
//
#include <assert.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "bdc_memory/bdc_memory.h"
#include "cats_global.h"
......
......@@ -24,6 +24,7 @@
#include "misc.h"
#include "inline.h"
#include "bdc_memory/bdc_memory.h"
#include "bdc_io/bdc_io.h"
void
......
......@@ -25,7 +25,7 @@
#include <errno.h>
#include <string.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "filesystem.h"
#include "data/error.h"
#ifndef CATS_ON_WINDOWS
......
......@@ -24,20 +24,12 @@
#include <string.h>
#include "data/error.h"
#define TEXT_DIVIDER "=================================================================================================="
const char *cats_version(void);
// this is kept as a macro, so we can print calling function
#define ENSURE_FILE_OPENED(FILE_HANDLE, FILENAME)\
if (! (FILE_HANDLE))\
{\
fprintf(stderr, "ERROR: Couldn't open file %s in %s: %d (%s)\n", FILENAME, __FILE__, __LINE__, __func__);\
exit(E_UNREADABLE_FILE);\
}
void set_program_name(const char *name);
#endif
\ No newline at end of file
......@@ -20,7 +20,7 @@
//
#include <dlfcn.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include <string.h>
#include "configuration/configuration.h"
#include "load_module.h"
......
......@@ -24,7 +24,7 @@
#include <string.h>
#include <stdlib.h>
#include "modules.h"
#include "cats_strings/cats_strings.h"
#include "bdc_strings/bdc_strings.h"
void init_cats_module(struct cats_module *module, int32_t id)
{
......
......@@ -26,6 +26,7 @@
#include "mpi_debug.h"
#include "mpi_grid_helpers.h"
#include "paths/output_paths.h"
#include "bdc_io/bdc_io.h"
char *get_node_name(const struct cats_configuration *conf)
......
......@@ -93,8 +93,8 @@ enum overlay_type get_overlay_type_from_name(const char *name, const struct stri
if (!strcmp(name, "resources")) return OL_RESOURCE;
if (registered_names != NULL) {
for (int32_t i = 0; i < registered_names->count; i++) {
if (!strcmp(name, registered_names->string[i])) {
for (int32_t i = 0; i < get_string_count(registered_names); i++) {
if (!strcmp(name, get_string(registered_names,i))) {
return OL_CUSTOM;
}
}
......
......@@ -22,7 +22,7 @@
#include "cats_global.h"
#include <string.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "misc/filesystem.h"
#include "paths/paths.h"
#include "paths/output_paths.h"
......@@ -32,7 +32,7 @@
bool check_and_create_directory_if_needed(const struct string_array *path)
{
if (path == NULL || path->count == 0) {
if (path == NULL || get_string_count(path) == 0) {
fprintf(stderr, "Unable to check directory - no path specified\n");
log_message(LOG_ERROR, "\tunable to check directory - no path specified");
exit_cats(E_SYSTEM_ERROR);
......@@ -94,8 +94,8 @@ void ensure_needed_directories_exist(const struct cats_configuration *conf, cons
struct string_array *output = new_string_array_init(conf->output.output_directory);
check_and_create_directory_if_needed(output);
free_string_array(&output);
for (int32_t i = 0; i < output_dirs->count; i++) {
struct string_array *path = get_output_directory(conf, output_dirs->string[i]);
for (int32_t i = 0; i < get_string_count(output_dirs); i++) {
struct string_array *path = get_output_directory(conf, get_string(output_dirs,i));
check_and_create_directory_if_needed(path);
free_string_array(&path);
......
......@@ -22,7 +22,7 @@
#include <string.h>
#include <assert.h>
#include <logging/logging.h>
#include <bdc_logging/logging.h>
#include "data/cats_grid.h"
#include "temporal/phase_names.h"
......@@ -30,6 +30,7 @@
#include "output_paths.h"
#include "paths.h"
#include "bdc_io/bdc_io.h"
const char *get_base_output_directory(const struct cats_configuration *conf)
......
......@@ -28,7 +28,7 @@
#include "cats_global.h"
#include "data/cats_grid.h"
#include "configuration/configuration.h"
#include "cats_strings/cats_strings.h"
#include "bdc_strings/bdc_strings.h"
#include "temporal/phase_names.h"
......@@ -60,7 +60,7 @@ char *assemble_filename(struct string_array *path, struct string_array *filename
char *name_string = string_array_paste(filename, filesep);
char *result = NULL;
if (path && path->count > 0) {
if (path && get_string_count(path) > 0) {
char *path_string = string_array_paste(path, "/");
if (extension && strlen(extension)) {
char *fn = compound_string(name_string, extension, ".");
......
......@@ -22,7 +22,7 @@
#pragma once
#include <stdint.h>
#include <cats_strings/cats_strings.h>
#include <bdc_strings/bdc_strings.h>
struct cats_configuration;
struct cats_environment_variable;
......
......@@ -26,6 +26,7 @@
#include "temporal/timeformat.h"
#include "data/species_parameters.h"
#include "path_patterns.h"
#include "bdc_io/bdc_io.h"
char *
......
......@@ -54,9 +54,9 @@ struct timeval *time_difference(struct timeval *start, struct timeval *end)
}
struct cats_timer start_new_timer(void)
struct bdc_timer start_new_timer(void)
{
struct cats_timer t = {0};
struct bdc_timer t = {0};
t.start_clock = clock();
//gettimeofday(&t.start_timeval, NULL);
get_time(&t.start_timeval);
......@@ -64,7 +64,7 @@ struct cats_timer start_new_timer(void)
}
void start_timer(struct cats_timer *t)
void start_timer(struct bdc_timer *t)
{
assert(t != NULL);
t->start_clock = clock();
......@@ -73,7 +73,7 @@ void start_timer(struct cats_timer *t)
}
void stop_timer(struct cats_timer *t)
void stop_timer(struct bdc_timer *t)
{
assert(t != NULL);
clock_t now = clock();
......@@ -97,7 +97,7 @@ void stop_timer(struct cats_timer *t)
}
void log_timer(const struct cats_timer *t, const char *string, int loglevel, const struct simulation_time *time,
void log_timer(const struct bdc_timer *t, const char *string, int loglevel, const struct simulation_time *time,
const struct cats_configuration *conf)
{
const char *phase_default = "?";
......@@ -117,7 +117,7 @@ void log_timer(const struct cats_timer *t, const char *string, int loglevel, con
}
void stop_and_log_timer(struct cats_timer *t, const char *string, int loglevel, const struct simulation_time *time,
void stop_and_log_timer(struct bdc_timer *t, const char *string, int loglevel, const struct simulation_time *time,
const struct cats_configuration *conf)
{
stop_timer(t);
......@@ -127,7 +127,7 @@ void stop_and_log_timer(struct cats_timer *t, const char *string, int loglevel,
void
stop_log_and_restart_timer(struct cats_timer *t, const char *string, int loglevel, const struct simulation_time *time,
stop_log_and_restart_timer(struct bdc_timer *t, const char *string, int loglevel, const struct simulation_time *time,
const struct cats_configuration *conf)
{
stop_timer(t);
......
......@@ -22,28 +22,23 @@
#pragma once
#include "configuration/configuration.h"
#include "bdc_time/bdc_time.h"
struct cats_timer {
clock_t start_clock;
struct timeval start_timeval;
double time_normal;
double time_real;
};
struct simulation_time;
struct cats_timer start_new_timer(void);
struct bdc_timer start_new_timer(void);
void log_timer(const struct cats_timer *t, const char *string, int loglevel, const struct simulation_time *time,
void log_timer(const struct bdc_timer *t, const char *string, int loglevel, const struct simulation_time *time,
const struct cats_configuration *conf);
void start_timer(struct cats_timer *t);
void start_timer(struct bdc_timer *t);
void stop_timer(struct cats_timer *t);
void stop_timer(struct bdc_timer *t);
void stop_and_log_timer(struct cats_timer *t, const char *string, int loglevel, const struct simulation_time *time,
void stop_and_log_timer(struct bdc_timer *t, const char *string, int loglevel, const struct simulation_time *time,
const struct cats_configuration *conf);
void
stop_log_and_restart_timer(struct cats_timer *t, const char *string, int loglevel, const struct simulation_time *time,
stop_log_and_restart_timer(struct bdc_timer *t, const char *string, int loglevel, const struct simulation_time *time,
const struct cats_configuration *conf);
\ No newline at end of file