SpiNNFrontEndCommon 7.3.1
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
compressor.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 The University of Manchester
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
30#include <debug.h>
31#ifdef USE_PAIR
32 #include "pair_minimize.h"
33#else
35#endif
37#include "../common/routing_table.h"
38
46bool run_compressor(int compress_as_much_as_possible, bool *failed_by_malloc,
47 volatile bool *stop_compressing) {
48 // Get the target length of the routing table
49 log_debug("acquire target length");
50 int target_length = 0;
51 if (compress_as_much_as_possible == 0) {
52 target_length = rtr_alloc_max();
53 }
54 log_info("target length of %d", target_length);
55 if (remove_default_routes_minimise(target_length)) {
56 return true;
57 }
58
59 if (*stop_compressing) {
60 log_info("Not compressing as asked to stop");
61 return false;
62 }
63 // Perform the minimisation
64 log_debug("minimise");
65 if (minimise_run(target_length, failed_by_malloc, stop_compressing)) {
67 } else {
68 return false;
69 }
70
71}
bool run_compressor(int compress_as_much_as_possible, bool *failed_by_malloc, volatile bool *stop_compressing)
The callback for setting off the router compressor.
Definition compressor.h:46
SpiNNaker debug header file.
void log_debug(const char *message,...)
This function logs debugging messages. This level of message is normally not printed except when the ...
void log_info(const char *message,...)
This function logs informational messages. This is the lowest level of message normally printed.
bool minimise_run(int target_length, bool *failed_by_malloc, volatile bool *stop_compressing)
Apply the ordered covering algorithm to a routing table.
An ordered covering of routing table entries.
SpiNNaker routing table minimisation.
How to remove default routes from a routing table.
static bool remove_default_routes_minimise(int target_length)
Remove defaultable routes from a routing table if that helps.
int routing_table_get_n_entries(void)
Get the number of entries in the routing table.
Definition rt_single.h:102
uint rtr_alloc_max(void)