public static int CalcLocalHalfNxLength(this Mpi mpi, int rank, int nx) { var result = mpi.CalcHalfLocal(rank, nx); if (result.Item1 >= nx) { return(0); } return(result.Item2); }