Skip to content

Commit

Permalink
remove some unused public items
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehforsch committed Sep 16, 2023
1 parent 71de21d commit af61f28
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 131 deletions.
5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ name = "voronoi3d"
harness = false
required-features = ["3d"]

[[bench]]
name = "quadtree"
harness = false
required-features = ["3d"]

[[bench]]
name = "sweep"
harness = false
Expand Down
69 changes: 0 additions & 69 deletions benches/quadtree/main.rs

This file was deleted.

6 changes: 0 additions & 6 deletions src/communication/data_by_rank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ impl<T: Clone> DataByRank<T> {
}
}

impl<T> DataByRank<Vec<T>> {
pub fn push(&mut self, rank: Rank, item: T) {
self[rank].push(item);
}
}

impl<T> Index<Rank> for DataByRank<T> {
type Output = T;

Expand Down
14 changes: 0 additions & 14 deletions src/communication/exchange_communicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ impl<T> ExchangeCommunicator<T>
where
T: Equivalence,
{
pub fn send(&mut self, rank: i32, data: T) {
self.blocking_send_vec(rank, vec![data]);
}

pub fn receive(&mut self) -> DataByRank<T> {
let data = self.receive_vec();
data.into_iter()
.map(|(rank, mut data)| {
debug_assert_eq!(data.len(), 1);
(rank, data.remove(0))
})
.collect()
}

pub fn blocking_send_vec(&mut self, rank: i32, data: Vec<T>) {
debug_assert!(!self.pending_data[rank]);
self.pending_data[rank] = true;
Expand Down
1 change: 0 additions & 1 deletion src/communication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub mod exchange_communicator; // public because i (currently) cannot test mpi s
mod identified;
mod plugin;
mod sized_communicator;
pub mod sync_communicator; // public because i (currently) cannot test mpi stuff from within this module, but require an externally run example for it

use bevy_ecs::prelude::Resource;
pub use communicated_option::CommunicatedOption;
Expand Down
14 changes: 0 additions & 14 deletions src/communication/mpi_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use mpi::Count;
use mpi::Tag;
use mpi::Threading;

use super::DataByRank;
use super::Identified;
use super::SizedCommunicator;

Expand Down Expand Up @@ -231,19 +230,6 @@ where
sum
}

pub fn all_gather_vec(&mut self, send: &[S]) -> DataByRank<Vec<S>> {
self.verify_tag();
let world_size = self.world.size() as usize;
let num_elements = send.len();
let mut result_buffer = unsafe { get_buffer::<S>(world_size * num_elements) };
self.world.all_gather_into(send, &mut result_buffer[..]);
let mut data = DataByRank::empty();
for i in 0..world_size {
data.insert(i as Rank, result_buffer.drain(0..num_elements).collect())
}
data
}

fn all_gather_varcount_with_counts(&mut self, send: &[S], counts: &[Count]) -> Vec<S> {
self.verify_tag();
let mut result_buffer: Vec<S> =
Expand Down
1 change: 0 additions & 1 deletion src/dimension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub trait Dimension {
}

pub type Point<D> = <D as Dimension>::Point;
pub type UnitPoint<D> = <D as Dimension>::UnitPoint;
pub type WrapType<D> = <D as Dimension>::WrapType;

#[derive(Clone, Debug, Default)]
Expand Down
17 changes: 0 additions & 17 deletions src/domain/extent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ macro_rules! impl_extent {
)
}

/// Return an extent with slightly increased size
/// but the same center
pub fn pad(self) -> Self {
let dist_to_min = self.min - self.center;
let dist_to_max = self.max - self.center;
const PADDING_FRACTION: f64 = 0.01;
Self {
min: self.center + dist_to_min * (1.0 + PADDING_FRACTION),
max: self.center + dist_to_max * (1.0 + PADDING_FRACTION),
center: self.center,
}
}

pub fn from_positions<'a>(
positions: impl Iterator<Item = &'a $unit_vec>,
) -> Option<Self> {
Expand All @@ -84,10 +71,6 @@ macro_rules! impl_extent {
}
Some(Self::from_min_max(min?, max?))
}

pub fn contains_extent(&self, other: &Self) -> bool {
self.contains(&other.min) && self.contains(&other.max)
}
}

/// A helper struct to enable deserialization of extents.
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ mod particle;
mod peano_hilbert;
mod performance;
pub mod prelude;
pub mod quadtree;
mod quadtree;
mod simulation;
mod simulation_box;
mod simulation_builder;
pub mod simulation_plugin;
pub mod source_systems;
pub mod stages;
mod stages;
pub mod sweep;
/// Compile-time units and quantities for the simulation.
pub mod units;
Expand Down
2 changes: 0 additions & 2 deletions src/quadtree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ pub const NUM_DIMENSIONS: usize = 3;

pub const TWO_TO_NUM_DIMENSIONS: usize = 2i32.pow(NUM_DIMENSIONS as u32) as usize;

pub const MAX_DEPTH: usize = 32;

pub trait LeafDataType: Clone {
fn pos(&self) -> &VecLength;
}
Expand Down

0 comments on commit af61f28

Please sign in to comment.