INNER CODE UNIT · Rust
rank_to_world_device
NVIDIA/nccl · contrib/nccl4rust/crates/nccl-device/src/lib.rs:196
fn rank_to_world_device(
comm: DevComm<'_>,
team_n_ranks: i32,
team_rank: i32,
team_stride: i32,
rank: i32,
) -> i32 {
unsafe {
sys::nccl4rust_team_rank_to_world(comm.as_raw(), team_n_ranks, team_rank, team_stride, rank)
}
}
/// Translate a rank in `team` to its LSA rank.
///
/// Returns `None` when `rank` is outside the team or the translated rank does
/// not belong to this communicator rank's local LSA team.
#[inline(always)]
pub fn rank_to_lsa(comm: DevComm<'_>, team: Team, rank: i32) -> Option<i32> {