pub struct ParallelNetcdf {
pub path: String,
pub global_dims: Vec<usize>,
pub n_ranks: usize,
pub rank: usize,
pub variables: HashMap<String, Vec<f64>>,
pub var_attrs: HashMap<String, HashMap<String, String>>,
}Expand description
Parallel netCDF stub for distributed array I/O.
Fields§
§path: StringFile path.
global_dims: Vec<usize>Global dimensions [nx, ny, nz].
n_ranks: usizeNumber of MPI ranks (simulated).
rank: usizeCurrent rank.
variables: HashMap<String, Vec<f64>>Variables stored (name -> local data).
var_attrs: HashMap<String, HashMap<String, String>>Variable attributes.
Implementations§
Source§impl ParallelNetcdf
impl ParallelNetcdf
Sourcepub fn new(
path: &str,
global_dims: Vec<usize>,
n_ranks: usize,
rank: usize,
) -> Self
pub fn new( path: &str, global_dims: Vec<usize>, n_ranks: usize, rank: usize, ) -> Self
Create a new parallel netCDF file.
Sourcepub fn set_var_attr(&mut self, var: &str, key: &str, value: &str)
pub fn set_var_attr(&mut self, var: &str, key: &str, value: &str)
Set variable attribute.
Sourcepub fn global_size(&self) -> usize
pub fn global_size(&self) -> usize
Total global size.
Sourcepub fn local_size(&self) -> usize
pub fn local_size(&self) -> usize
Local size for this rank (simple block decomposition along first dim).
Trait Implementations§
Source§impl Clone for ParallelNetcdf
impl Clone for ParallelNetcdf
Source§fn clone(&self) -> ParallelNetcdf
fn clone(&self) -> ParallelNetcdf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParallelNetcdf
impl RefUnwindSafe for ParallelNetcdf
impl Send for ParallelNetcdf
impl Sync for ParallelNetcdf
impl Unpin for ParallelNetcdf
impl UnsafeUnpin for ParallelNetcdf
impl UnwindSafe for ParallelNetcdf
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.