~alesster/siesta/trunk_new_xc

« back to all changes in this revision

Viewing changes to Src/m_ts_electrode.F90

  • Committer: Nick Papior
  • Date: 2019-08-20 13:23:46 UTC
  • mfrom: (560.1.537 4.1)
  • Revision ID: nickpapior@gmail.com-20190820132346-weqqgh15flh6q6v7
Merged r1097, removed OMP collapse

Show diffs side-by-side

added added

removed removed

Lines of Context:
1285
1285
#ifdef MPI
1286
1286
          call MPI_Reduce(iters(1,1,1,1), iters(1,1,1,2), nq*NEn*nkpnt, &
1287
1287
               MPI_Integer, MPI_Sum, 0, MPI_Comm_World, MPIerror)
 
1288
!$OMP parallel default(shared), private(j,i,iqpt)
1288
1289
#else
1289
 
!$OMP parallel workshare
 
1290
!$OMP parallel default(shared), private(j,i,iqpt)
 
1291
 
 
1292
!$OMP workshare
1290
1293
          iters(:,:,:,2) = iters(:,:,:,1)
1291
 
!$OMP end parallel workshare
 
1294
!$OMP end workshare
1292
1295
#endif
1293
1296
          if ( IONode ) then
1294
 
!$OMP parallel workshare default(shared)
 
1297
!$OMP workshare
1295
1298
             i_mean = sum(iters(:,:,:,2)) / real(nq*NEn*nkpnt,dp)
1296
 
!$OMP end parallel workshare
 
1299
!$OMP end workshare
 
1300
 
 
1301
!$OMP single
1297
1302
             i_std = 0._dp
1298
 
!$OMP parallel do default(shared), &
1299
 
!$OMP&private(j,i,iqpt), collapse(3), &
1300
 
!$OMP&reduction(+:i_std)
 
1303
!$OMP end single ! keep barrier
 
1304
 
 
1305
!$OMP do reduction(+:i_std)
1301
1306
             do j = 1 , nkpnt
1302
1307
             do i = 1 , NEn
1303
1308
             do iqpt = 1 , nq
1305
1310
             end do
1306
1311
             end do
1307
1312
             end do
1308
 
!$OMP end parallel do
 
1313
!$OMP end do
 
1314
 
 
1315
!$OMP master
1309
1316
             i_std = sqrt(i_std/real(NEn*nq*nkpnt,dp))
1310
1317
             ! TODO if new surface-Green function scheme is implemented, fix here
1311
1318
             write(*,'(1x,a,f10.4,'' / '',f10.4)') 'Lopez Sancho, Lopez Sancho & Rubio: &
1312
1319
                  &Mean/std iterations: ', i_mean             , i_std
1313
1320
             write(*,'(1x,a,i10,'' / '',i10)')     'Lopez Sancho, Lopez Sancho & Rubio: &
1314
1321
                  &Min/Max iterations : ', minval(iters(:,:,:,2)) , maxval(iters(:,:,:,2))
 
1322
!$OMP end master
1315
1323
             
1316
1324
          end if
 
1325
!$OMP end parallel
1317
1326
       end if
1318
1327
 
1319
1328
    end do
2031
2040
      if ( is_left ) then
2032
2041
         ! Left, we use the last orbitals
2033
2042
         ioff = 1 - off ! ioff is private in OMP orphaned routines
2034
 
!$OMP do private(j,i), collapse(2)
 
2043
!$OMP do private(j,i)
2035
2044
         do j = off , fS
2036
2045
            do i = off , fS
2037
2046
               to(ioff+i,ioff+j) = from(i,j)
2040
2049
!$OMP end do nowait
2041
2050
      else
2042
2051
         ! Right, the first orbitals
2043
 
!$OMP do private(j,i), collapse(2)
 
2052
!$OMP do private(j,i)
2044
2053
         do j = 1 , tS
2045
2054
            do i = 1 , tS
2046
2055
               to(i,j) = from(i,j)