Commit 266db1ed authored by giannozz's avatar giannozz

Safer cleanup of "ortho" communicators. Does not seem to clean communicators

used by scalapack, though


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/[email protected] c92efa57-630b-4861-b058-cf58834340f0
parent d15bc37c
......@@ -133,20 +133,7 @@ CONTAINS
nproc_try = MIN( nproc_try_in, nproc_all )
nproc_try = MAX( nproc_try, 1 )
IF( .NOT. first ) THEN
!
! free resources associated to the communicator
!
CALL mp_comm_free( ortho_comm )
!
#if defined __SCALAPACK
IF( ortho_comm_id > 0 ) THEN
CALL BLACS_GRIDEXIT( ortho_cntx )
ENDIF
ortho_cntx = -1
#endif
!
END IF
IF( .NOT. first ) CALL clean_ortho_group ( )
! find the square closer (but lower) to nproc_try
!
......@@ -300,4 +287,20 @@ CONTAINS
RETURN
END SUBROUTINE init_ortho_group
!
SUBROUTINE clean_ortho_group ( )
!
! free resources associated to the communicator
!
CALL mp_comm_free( ortho_comm )
IF( ortho_comm_id > 0 ) THEN
CALL mp_comm_free( ortho_col_comm )
CALL mp_comm_free( ortho_row_comm )
ENDIF
#if defined __SCALAPACK
IF( ortho_comm_id > 0 ) CALL BLACS_GRIDEXIT( ortho_cntx )
ortho_cntx = -1
#endif
!
END SUBROUTINE clean_ortho_group
!
END MODULE mp_diag
......@@ -88,7 +88,7 @@ CONTAINS
!
USE mp, ONLY : mp_comm_free
!
CALL mp_comm_free( ortho_comm )
CALL clean_ortho_group ( )
CALL mp_comm_free ( intra_pot_comm )
CALL mp_comm_free ( inter_pot_comm )
CALL mp_comm_free ( intra_bgrp_comm )
......@@ -97,6 +97,8 @@ CONTAINS
CALL mp_comm_free ( inter_pool_comm )
CALL mp_world_end( )
!
RETURN
!
END SUBROUTINE mp_global_end
!
END MODULE mp_global
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment