From c9478e6da5e1a44ea02aaf5a2170e68a0a6859ec Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 9 Oct 2026 07:09:23 -0700 Subject: [PATCH] Define result of scalar allreduce and gather helpers in non-MPI builds --- src/common/m_mpi_common.fpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fpp index c54568d27..1ba675345 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fpp @@ -265,6 +265,8 @@ contains allocate (gathered_vector(sum(recounts))) call MPI_GATHERV(my_vector, counts, mpi_p, gathered_vector, recounts, displs, mpi_p, root, MPI_COMM_WORLD, ierr) +#else + gathered_vector = my_vector #endif end subroutine s_mpi_gather_data @@ -373,6 +375,8 @@ contains integer :: ierr !< Generic flag used to identify and report MPI errors call MPI_ALLREDUCE(var_loc, var_glb, 1, mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr) +#else + var_glb = var_loc #endif end subroutine s_mpi_allreduce_sum @@ -440,6 +444,8 @@ contains integer :: ierr !< Generic flag used to identify and report MPI errors call MPI_ALLREDUCE(var_loc, var_glb, 1, mpi_p, MPI_MIN, MPI_COMM_WORLD, ierr) +#else + var_glb = var_loc #endif end subroutine s_mpi_allreduce_min @@ -470,6 +476,8 @@ contains integer :: ierr !< Generic flag used to identify and report MPI errors call MPI_ALLREDUCE(var_loc, var_glb, 1, mpi_p, MPI_MAX, MPI_COMM_WORLD, ierr) +#else + var_glb = var_loc #endif end subroutine s_mpi_allreduce_max