diff --git a/netcdf-examples/src/parallel.rs b/netcdf-examples/src/parallel.rs index 3b93818..48c414d 100644 --- a/netcdf-examples/src/parallel.rs +++ b/netcdf-examples/src/parallel.rs @@ -18,7 +18,7 @@ fn create( ) -> Result<(), Box> { let info = mpi_null_info(); let mut file = - netcdf::create_par_with(path, communicator.as_raw(), info, netcdf::Options::empty())?; + netcdf::create_par_with(path, communicator.as_raw(), info, netcdf::Options::NETCDF4)?; let size = communicator.size() as usize; let rank = communicator.rank(); @@ -45,10 +45,10 @@ fn read( let info = mpi_null_info(); let file = netcdf::open_par_with(path, communicator.as_raw(), info, netcdf::Options::empty())?; - file.access_collective()?; let rank = communicator.rank(); let var = file.variable("output").unwrap(); + var.access_collective()?; let values = var.get::((.., rank as usize))?; for (t, &v) in values.iter().enumerate() { diff --git a/netcdf/src/file.rs b/netcdf/src/file.rs index 3bf2481..9431310 100644 --- a/netcdf/src/file.rs +++ b/netcdf/src/file.rs @@ -317,33 +317,6 @@ impl File { let Self(file) = self; file.close() } - - /// Access all variable in independent mode - /// for parallell reading using MPI. - /// File must have been opened using `open_par` - /// - /// This is the default access mode - #[cfg(feature = "mpi")] - pub fn access_independent(&self) -> error::Result<()> { - let ncid = self.ncid(); - crate::par::set_access_mode( - ncid, - netcdf_sys::NC_GLOBAL, - crate::par::AccessMode::Independent, - ) - } - /// Access all variable in collective mode - /// for parallell reading using MPI. - /// File must have been opened using `open_par` - #[cfg(feature = "mpi")] - pub fn access_collective(&self) -> error::Result<()> { - let ncid = self.ncid(); - crate::par::set_access_mode( - ncid, - netcdf_sys::NC_GLOBAL, - crate::par::AccessMode::Collective, - ) - } } /// Mutable access to file.