-void gmx_sumli(int gmx_unused nr, int64_t gmx_unused r[], const t_commrec gmx_unused* cr)
-{
-#if !GMX_MPI
- GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumli");
-#else
- if (cr->nc.bUse)
- {
- /* Use two step summing */
- if (cr->nc.rank_intra == 0)
- {
- MPI_Reduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra);
- /* Sum with the buffers reversed */
- MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, cr->nc.comm_inter);
- }
- else
- {
- /* This is here because of the silly MPI specification
- that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
- MPI_Reduce(r, nullptr, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra);
- }
- MPI_Bcast(r, nr, MPI_INT64_T, 0, cr->nc.comm_intra);
- }
- else
- {
- MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, cr->mpi_comm_mygroup);
- }
-#endif
-}
-