From 0605579846719b6bb047bbcb7906baa9ce7da313 Mon Sep 17 00:00:00 2001 From: Eric Bylaska Date: Mon, 8 Jun 2009 17:24:58 +0000 Subject: [PATCH] only use processor groups if needed --- src/nwpw/nwpwlib/Parallel/Parallel-mpi.F | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nwpw/nwpwlib/Parallel/Parallel-mpi.F b/src/nwpw/nwpwlib/Parallel/Parallel-mpi.F index 12ef839f3e..69dd9994ee 100644 --- a/src/nwpw/nwpwlib/Parallel/Parallel-mpi.F +++ b/src/nwpw/nwpwlib/Parallel/Parallel-mpi.F @@ -105,6 +105,8 @@ c call MPI_COMM_SIZE(MPI_COMM_WORLD,np,mpierr) integer i,j,icount,ierr integer tmp(2),mpi_group + if (ncolumns.gt.1) then + np_i = np/ncolumns np_j = ncolumns @@ -174,6 +176,8 @@ c call MPI_COMM_SIZE(MPI_COMM_WORLD,np,mpierr) if (.not.MA_pop_stack(tmp(2))) > call errquit('Parallel2d_init:popping stack memory',0, MA_ERR) + + end if return end @@ -197,6 +201,7 @@ c call MPI_COMM_SIZE(MPI_COMM_WORLD,np,mpierr) #include "mpif.h" #endif + if (np_j.gt.1) then #ifdef MPI4 * **** free comm_i and comm_j communicators **** call MPI_Comm_free(stupid_comm_i, stupid_ierr) @@ -214,6 +219,7 @@ c call MPI_COMM_SIZE(MPI_COMM_WORLD,np,mpierr) call MPI_Comm_free(comm_j, mpierr) call MPI_Group_free(group_j,mpierr) #endif + end if return end