Skip to main content

processor_name

Function processor_name 

Source
pub fn processor_name() -> Result<String, MpiError>
Expand description

A name identifying the calling processor (MPI_Get_processor_name).

Examples found in repository?
examples/hello.rs (line 11)
6fn main() {
7    let universe = mpi::initialize().unwrap();
8    let world = universe.world();
9    let size = world.size();
10    let rank = world.rank();
11    let processor = mpi::processor_name().unwrap_or_else(|_| "unknown".into());
12
13    println!("Hello from rank {rank} of {size} on {processor}");
14
15    // Make sure the output is interleaved cleanly before exit.
16    world.barrier();
17    if rank == 0 {
18        println!("All {size} processes checked in.");
19    }
20}