From 50da1c018cc853d1d96e120b5685eaf027faf500 Mon Sep 17 00:00:00 2001 From: cavazzon Date: Sat, 11 Aug 2007 12:21:22 +0000 Subject: [PATCH] - fix for a wrong allocation git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4122 c92efa57-630b-4861-b058-cf58834340f0 --- Modules/ptoolkit.f90 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Modules/ptoolkit.f90 b/Modules/ptoolkit.f90 index d4d5a8b96..17f6d3d83 100644 --- a/Modules/ptoolkit.f90 +++ b/Modules/ptoolkit.f90 @@ -3115,6 +3115,12 @@ END SUBROUTINE END DO END DO +#if defined __MPI + + ALLOCATE( B( ldx, ldx ) ) + ALLOCATE( C( ldx, ldx ) ) + ALLOCATE( BUF_RECV ( ldx, ldx ) ) + ! Compute the inverse of a lower triangular ! along the diagonal of the global array with BLACS(dtrtri) IF( mycol == myrow ) THEN @@ -3131,12 +3137,6 @@ END SUBROUTINE buf_recv = sll END IF -#if defined __MPI - - ALLOCATE( B( ldx, ldx ) ) - ALLOCATE( C( ldx, ldx ) ) - ALLOCATE( BUF_RECV ( ldx, ldx ) ) - ! Broadcast the blocks along the diagonal at the processors under the diagonal IF( myrow >= mycol ) THEN CALL MPI_Comm_split( comm, mycol, myrow, col_comm, ierr ) @@ -3227,6 +3227,18 @@ END SUBROUTINE DEALLOCATE(C) DEALLOCATE(BUF_RECV) +#else + + DO j = 1, ldx + DO i = 1, j-1 + sll ( i, j ) = ( 0.0_DP , 0.0_DP ) + END DO + END DO + CALL ztrtri( 'L', 'N', n, sll, ldx, info ) + IF( info /= 0 ) THEN + CALL errore( ' pztrtri ', ' problem in the local inversion ', info ) + END IF + #endif CONTAINS