diff --git a/include/forcing/NetCDFMeshPointsDataProvider.hpp b/include/forcing/NetCDFMeshPointsDataProvider.hpp index 8078a7b6d8..6c2aa100af 100644 --- a/include/forcing/NetCDFMeshPointsDataProvider.hpp +++ b/include/forcing/NetCDFMeshPointsDataProvider.hpp @@ -47,19 +47,6 @@ namespace data_access using time_point_type = std::chrono::time_point; - /** - * @brief Factory method that creates or returns an existing provider for the provided path. - * @param input_path The path to a NetCDF file with lumped catchment forcing values. - * @param log_s An output log stream for messages from the underlying library. If a provider object for - * the given path already exists, this argument will be ignored. - */ - static std::shared_ptr get_shared_provider(std::string input_path, time_point_type sim_start, time_point_type sim_end); - - /** - * @brief Cleanup the shared providers cache, ensuring that the files get closed. - */ - static void cleanup_shared_providers(); - NetCDFMeshPointsDataProvider(std::string input_path, time_point_type sim_start, time_point_type sim_end); @@ -133,9 +120,6 @@ namespace data_access time_point_type sim_end_date_time_epoch; std::chrono::seconds sim_to_data_time_offset; // Deliberately signed--sim should never start before data, yes? - static std::mutex shared_providers_mutex; - static std::map> shared_providers; - std::vector variable_names; std::vector time_vals; std::chrono::seconds time_stride; // the amount of time between stored time values @@ -144,10 +128,6 @@ namespace data_access struct metadata_cache_entry; std::map ncvar_cache; - - boost::compute::detail::lru_cache>> value_cache; - size_t cache_slice_t_size = 1; - size_t cache_slice_c_size = 1; }; } diff --git a/src/forcing/NetCDFMeshPointsDataProvider.cpp b/src/forcing/NetCDFMeshPointsDataProvider.cpp index 4356ab4020..ad477c9875 100644 --- a/src/forcing/NetCDFMeshPointsDataProvider.cpp +++ b/src/forcing/NetCDFMeshPointsDataProvider.cpp @@ -5,9 +5,6 @@ #include #include -std::mutex data_access::NetCDFMeshPointsDataProvider::shared_providers_mutex; -std::map> data_access::NetCDFMeshPointsDataProvider::shared_providers; - namespace data_access { // Out-of-line class definition after forward-declaration so that the @@ -20,28 +17,8 @@ struct NetCDFMeshPointsDataProvider::metadata_cache_entry { double offset; }; -std::shared_ptr NetCDFMeshPointsDataProvider::get_shared_provider(std::string input_path, time_point_type sim_start, time_point_type sim_end) -{ - const std::lock_guard lock(shared_providers_mutex); - std::shared_ptr p; - if(shared_providers.count(input_path) > 0){ - p = shared_providers[input_path]; - } else { - p = std::make_shared(input_path, sim_start, sim_end); - shared_providers[input_path] = p; - } - return p; -} - -void NetCDFMeshPointsDataProvider::cleanup_shared_providers() -{ - const std::lock_guard lock(shared_providers_mutex); - // First lets try just emptying the map... if all goes well, everything will destruct properly on its own... - shared_providers.clear(); -} - NetCDFMeshPointsDataProvider::NetCDFMeshPointsDataProvider(std::string input_path, time_point_type sim_start, time_point_type sim_end) - : value_cache(20), + : sim_start_date_time_epoch(sim_start), sim_end_date_time_epoch(sim_end) {