STL alternative:
```c++
std::vector<PetscInt> i_disp;
i_disp.reserve(size_rank);
i_disp.push_back(0);
std::partial_sum(i_cnt.cbegin(), --i_cnt.cend(), std::back_inserter(i_disp))
```