Struct caminos_lib::topology::operations::RemappedServersTopology
source · pub struct RemappedServersTopology { /* private fields */ }
Expand description
Transforms the server indices of a base topology. This does not change the indices of routers.
Example configuration:
ⓘ
RemappedServersTopology{
topology: Mesh{sides:[4,4],servers_per_router:1},
pattern: RandomPermutation,
}
For the same concept on patterns see RemappedNodes.
Implementations§
source§impl RemappedServersTopology
impl RemappedServersTopology
pub fn new(arg: TopologyBuilderArgument<'_>) -> RemappedServersTopology
pub fn map_location_into_base(&self, location: Location) -> Location
pub fn map_location_from_base(&self, location: Location) -> Location
Trait Implementations§
source§impl Debug for RemappedServersTopology
impl Debug for RemappedServersTopology
source§impl Quantifiable for RemappedServersTopology
impl Quantifiable for RemappedServersTopology
source§fn total_memory(&self) -> usize
fn total_memory(&self) -> usize
Get the total memory currently being employed by the implementing type. Both stack and heap.
source§fn print_memory_breakdown(&self)
fn print_memory_breakdown(&self)
Prints by stdout how much memory is used per component.
source§fn forecast_total_memory(&self) -> usize
fn forecast_total_memory(&self) -> usize
Get an estimation on how much memory the type could reach during the simulation.
source§impl Topology for RemappedServersTopology
impl Topology for RemappedServersTopology
fn num_routers(&self) -> usize
fn num_servers(&self) -> usize
source§fn neighbour(&self, router_index: usize, port: usize) -> (Location, usize)
fn neighbour(&self, router_index: usize, port: usize) -> (Location, usize)
Neighbours of a router: Location+link class index
Routers should be before servers
source§fn server_neighbour(&self, server_index: usize) -> (Location, usize)
fn server_neighbour(&self, server_index: usize) -> (Location, usize)
The neighbour of a server: Location+link class index
source§fn distance(&self, origin: usize, destination: usize) -> usize
fn distance(&self, origin: usize, destination: usize) -> usize
Distance from a router to another.
source§fn amount_shortest_paths(&self, origin: usize, destination: usize) -> usize
fn amount_shortest_paths(&self, origin: usize, destination: usize) -> usize
Number of shortest paths from a router to another.
source§fn average_amount_shortest_paths(&self) -> f32
fn average_amount_shortest_paths(&self) -> f32
Average number of shortest paths from a router to another.
fn maximum_degree(&self) -> usize
fn minimum_degree(&self) -> usize
source§fn degree(&self, router_index: usize) -> usize
fn degree(&self, router_index: usize) -> usize
Number of ports used to other routers.
This does not include non-connected ports.
This should not be used as a range of valid ports. A non-connected port can be before some other valid port to a router.
Use
neighbour_router_iter()' or
0..ports()’ to iterate over valid ranges.fn ports(&self, router_index: usize) -> usize
source§fn neighbour_router_iter<'a>(
&'a self,
router_index: usize
) -> Box<dyn Iterator<Item = NeighbourRouterIteratorItem> + 'a>
fn neighbour_router_iter<'a>( &'a self, router_index: usize ) -> Box<dyn Iterator<Item = NeighbourRouterIteratorItem> + 'a>
Iterate over the neighbour routers, skipping non-connected ports and ports towards servers.
You may want to reimplement this when implementing the trait for your type.
source§fn cartesian_data(&self) -> Option<&CartesianData>
fn cartesian_data(&self) -> Option<&CartesianData>
Specific for some topologies, but must be checkable for anyone
source§fn coordinated_routing_record(
&self,
coordinates_a: &[usize],
coordinates_b: &[usize],
rng: Option<&mut StdRng>
) -> Vec<i32>
fn coordinated_routing_record( &self, coordinates_a: &[usize], coordinates_b: &[usize], rng: Option<&mut StdRng> ) -> Vec<i32>
Specific for some topologies, but must be checkable for anyone
source§fn is_direction_change(
&self,
router_index: usize,
input_port: usize,
output_port: usize
) -> bool
fn is_direction_change( &self, router_index: usize, input_port: usize, output_port: usize ) -> bool
Specific for some topologies, but must be checkable for anyone
Indicates if going from input_port to output_port implies a direction change. Used for the bubble routing.
source§fn up_down_distance(
&self,
origin: usize,
destination: usize
) -> Option<(usize, usize)>
fn up_down_distance( &self, origin: usize, destination: usize ) -> Option<(usize, usize)>
For topologies containing the so called up/down paths. Other topologies should return always
None
.
If the return is Some((u,d))
it means there is an initial up sub-path of length u
followed by a down sub-path of length d
starting at origin
and ending at destination
. A return value of None
means there is no up/down path from origin
to destination
.
Some general guidelines, although it is not clear if they must hold always: Read moresource§fn bfs(&self, origin: usize, class_weight: Option<&[usize]>) -> Vec<usize>
fn bfs(&self, origin: usize, class_weight: Option<&[usize]>) -> Vec<usize>
Breadth First Search to compute distances from a router to all others.
It may use weights, but it there are multiple paths with different distances it may give a non-minimal distance, since it is not Dijkstra.
fn compute_distance_matrix( &self, class_weight: Option<&[usize]> ) -> Matrix<usize>
fn floyd(&self) -> Matrix<usize>
source§fn compute_amount_shortest_paths(&self) -> (Matrix<usize>, Matrix<usize>)
fn compute_amount_shortest_paths(&self) -> (Matrix<usize>, Matrix<usize>)
Return a pair of matrices
(D,A)
with D[i,j]
being the distance from i
to j
and A[i,j]
being the number of paths of length D[i,j]
from i
to j
.source§fn components(&self, allowed_classes: &[bool]) -> Vec<Vec<usize>>
fn components(&self, allowed_classes: &[bool]) -> Vec<Vec<usize>>
Find the components of the subtopology induced via the allowed links.
Returns vector
ret
with ret[k]
containing the vertices in the k
-th component.source§fn compute_near_far_matrices(&self) -> (Matrix<usize>, Matrix<usize>)
fn compute_near_far_matrices(&self) -> (Matrix<usize>, Matrix<usize>)
returns a couple matrices
(N,F)
with
N[u,v]
= number of neighbours w of v with D(u,v)>D(u,w)
.
F[u,v]
= number of neighbours w of v with D(u,v)<D(u,w)
.
A router v
with F[u,v]=0
is called a boundary vertex of u.source§fn eccentricity(&self, router_index: usize) -> usize
fn eccentricity(&self, router_index: usize) -> usize
Computes the eccentricy of a router. That is, the greatest possible length of a shortest path from that router to any other.
source§fn dragonfly_size(&self) -> Option<ArrangementSize>
fn dragonfly_size(&self) -> Option<ArrangementSize>
Information for Dragonfly-like networks.
Auto Trait Implementations§
impl !RefUnwindSafe for RemappedServersTopology
impl !Send for RemappedServersTopology
impl !Sync for RemappedServersTopology
impl Unpin for RemappedServersTopology
impl !UnwindSafe for RemappedServersTopology
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more