use himpp::mpi; fn main() { mpi::sys::init() .or_else(|err| { println!("Initialize failed: {}, exit and try again!", err); mpi::sys::exit().and_then(|_| mpi::sys::init()) }) .unwrap(); // Add your code here mpi::sys::exit().unwrap(); }