28 int const new_group_size)
32 assert(input_size >= new_group_size);
33 int const minimum_output_group_size =
34 std::lround(input_size / new_group_size);
35 int const maximum_output_group_size = (input_size % new_group_size)
36 ? minimum_output_group_size + 1
37 : minimum_output_group_size;
38 return std::lround(input_index / maximum_output_group_size);
44 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
46 MPI_Comm_rank(MPI_COMM_WORLD, &rank_id);
47 int const file_group_id =
getGroupIndex(rank_id, num_procs, n_files);
48 MPI_Comm new_communicator;
49 MPI_Comm_split(MPI_COMM_WORLD, file_group_id, rank_id, &new_communicator);
51 std::move(file_group_id),
""};