Skip to content

Commit

Permalink
Fixed MPI dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Dec 11, 2024
1 parent 17f7e70 commit ed5bc4a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ git2 = "0.19"

[features]
strict = []
default = ["mpi"]
default = []
mpi = ["dep:mpi", "dep:mpi-sys"]
suitesparse = []
disable_system_blas_lapack = []
Expand Down Expand Up @@ -97,3 +97,11 @@ required-features = ["mpi"]
[[example]]
name = "mpi_scatter_vector"
required-features = ["mpi"]

[[example]]
name = "distributed_csr_matmul"
required-features = ["mpi"]

[[example]]
name = "cg_distributed"
required-features = ["mpi"]
9 changes: 7 additions & 2 deletions src/sparse/sparse_mat/tools.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
//! Tools for sparse matrix handling
use itertools::{izip, Itertools};
use mpi::datatype::{Partition, PartitionMut};
use mpi::traits::{CommunicatorCollectives, Equivalence};

#[cfg(feature = "mpi")]
use {
mpi::datatype::{Partition, PartitionMut},
mpi::traits::{CommunicatorCollectives, Equivalence},
};

use crate::dense::types::RlstScalar;
use crate::sparse::sparse_mat::SparseMatType;
Expand Down Expand Up @@ -154,6 +158,7 @@ pub fn sort_to_bins<T: Ord>(sorted_keys: &[T], bins: &[T]) -> Vec<usize> {
bin_counts
}

#[cfg(feature = "mpi")]
/// Redistribute an array via an all_to_all_varcount operation.
pub fn redistribute<T: Equivalence, C: CommunicatorCollectives>(
arr: &[T],
Expand Down

0 comments on commit ed5bc4a

Please sign in to comment.