<commit_before>extern crate mpi;

use mpi::traits::*;
use mpi::topology::Rank;

fn main() {
    let universe = mpi::initialize().unwrap();
    let world = universe.world();
    let size = world.size();
    let rank = world.rank();

    let next_rank = if rank + 1 < size { rank + 1 } else { 0 };
    let previous_rank = if rank - 1 >= 0 { rank - 1 } else { size - 1 };

    let (msg, status) = world.send_receive::<_, mpi::topology::Rank>(&rank, previous_rank, next_rank);
    assert!(msg.is_some());
    let msg = msg.unwrap();
    println!("Process {} got message {}.\nStatus is: {:?}", rank, msg, status);
    world.barrier();
    assert_eq!(msg, next_rank);

    if rank > 0 {
        let msg = vec![rank, rank + 1, rank - 1];
        world.process_at_rank(0).send(&msg[..]);
    } else {
        for _ in (1..size) {
            let (msg, status) = world.receive_vec::<Rank>();
            assert!(msg.is_some());
            let msg = msg.unwrap();
            println!("Process {} got long message {:?}.\nStatus is: {:?}", rank, msg, status);

            let x = status.source_rank();
            let v = vec![x, x + 1, x - 1];
            assert_eq!(v, msg);
        }
    }<commit_msg>Remove extra parantheses.<commit_after>extern crate mpi;

use mpi::traits::*;
use mpi::topology::Rank;

fn main() {
    let universe = mpi::initialize().unwrap();
    let world = universe.world();
    let size = world.size();
    let rank = world.rank();

    let next_rank = if rank + 1 < size { rank + 1 } else { 0 };
    let previous_rank = if rank - 1 >= 0 { rank - 1 } else { size - 1 };

    let (msg, status) = world.send_receive::<_, mpi::topology::Rank>(&rank, previous_rank, next_rank);
    assert!(msg.is_some());
    let msg = msg.unwrap();
    println!("Process {} got message {}.\nStatus is: {:?}", rank, msg, status);
    world.barrier();
    assert_eq!(msg, next_rank);

    if rank > 0 {
        let msg = vec![rank, rank + 1, rank - 1];
        world.process_at_rank(0).send(&msg[..]);
    } else {
        for _ in 1..size {
            let (msg, status) = world.receive_vec::<Rank>();
            assert!(msg.is_some());
            let msg = msg.unwrap();
            println!("Process {} got long message {:?}.\nStatus is: {:?}", rank, msg, status);

            let x = status.source_rank();
            let v = vec![x, x + 1, x - 1];
            assert_eq!(v, msg);
        }
    }
{'fraction_non_alphanumeric': 0.18291666666666667, 'fraction_numerical': 0.011666666666666667, 'mean_word_length': 2.3071625344352618, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4591874', 'n_tokens_mistral': 823, 'n_tokens_neox': 779, 'n_words': 218}