18 integer,
parameter ::
dp = kind(1.0d0)
38 type (bml_matrix_t),
intent(in) :: h_bml, g_bml
39 type (bml_matrix_t),
intent(inout) :: rho_bml
41 real(
dp),
intent(in) :: threshold
44 integer,
allocatable :: vsize(:)
45 type (bml_matrix_t) :: x_bml
58 do i = 1, gp%totalParts
60 call bml_matrix2submatrix_index(g_bml, &
61 gp%sgraph(i)%nodeInPart, gp%nnodesInPart(i), &
62 gp%sgraph(i)%core_halo_index, &
65 gp%sgraph(i)%lsize = vsize(1)
66 gp%sgraph(i)%llsize = vsize(2)
90 do i = gp%localPartMin(gp%myRank+1), gp%localPartMax(gp%myRank+1)
92 call bml_zero_matrix(bml_matrix_dense, bml_element_real,
dp, &
93 gp%sgraph(i)%lsize, gp%sgraph(i)%lsize, x_bml);
97 call bml_matrix2submatrix(h_bml, x_bml, &
98 gp%sgraph(i)%core_halo_index, gp%sgraph(i)%lsize)
105 gp%maxIter, gp%vv, gp%mineval, gp%maxeval, &
111 call bml_submatrix2matrix(x_bml, rho_bml, &
112 gp%sgraph(i)%core_halo_index, gp%sgraph(i)%lsize, &
113 gp%sgraph(i)%llsize, threshold)
116 call bml_deallocate(x_bml)
137 type (bml_matrix_t),
intent(inout) :: rho_bml
142 call bml_save_domain(rho_bml)
146 call bml_update_domain(rho_bml, gp%localPartMin, gp%localPartMax, &
148 call bml_reorder(rho_bml, gp%reorder);
151 call bml_allgathervparallel(rho_bml)
154 call bml_reorder(rho_bml, gp%order)
157 call bml_restore_domain(rho_bml)
168 type (
subgraph_t),
allocatable :: temp_sgraph(:)
171 integer :: i, j, rid, sid, onum, pnode, ip
174 integer,
allocatable :: tsize(:), torder(:)
179 nparts = gp%totalParts
180 avgparts = nparts /
nranks
183 allocate(temp_sgraph(nparts))
184 allocate(tsize(nparts))
185 allocate(torder(nparts))
188 temp_sgraph(i) = gp%sgraph(i)
190 tsize(i) = temp_sgraph(i)%llsize
196 if (tsize(i) .lt. tsize(j))
then
202 torder(i) = torder(j)
223 gp%sgraph(rid) = temp_sgraph(torder(j))
228 if (sid .le. gp%localPartExtent(i))
then
229 gp%sgraph(rid) = temp_sgraph(torder(
nranks*avgparts+i))
249 gp%nnodesInPart(i) = gp%sgraph(i)%llsize
250 gp%nnodesInPartAll(i) = gp%sgraph(i)%llsize
253 deallocate(temp_sgraph)
266 integer :: i, j, onum, pnode, nparts
268 nparts = gp%totalParts
274 do j = 1, gp%sgraph(i)%llsize
275 pnode = gp%sgraph(i)%nodeInPart(j)
277 gp%reorder(pnode+1) = onum
278 gp%order(onum+1) = pnode
296 type (bml_matrix_t),
intent(in) :: g_bml
297 integer,
intent(in) :: hnode(*)
298 logical,
intent(in) :: djflag
300 integer :: i, j, inode
301 integer,
allocatable :: vsize(:)
309 do i = 1, gp%totalParts
311 do j = 1, gp%nnodesInPart(i)
312 inode = gp%sgraph(i)%nodeInPart(j)
313 gp%sgraph(i)%nodeInPart(j) = hnode(inode+1) - 1
316 call bml_matrix2submatrix_index(g_bml, &
317 gp%sgraph(i)%nodeInPart, gp%nnodesInPart(i), &
318 gp%sgraph(i)%core_halo_index, &
321 gp%sgraph(i)%lsize = vsize(1)
322 gp%sgraph(i)%llsize = vsize(2)
341 type (bml_matrix_t),
intent(in) :: g_bml
342 logical,
intent(in) :: djflag
345 integer,
allocatable :: vsize(:)
353 do i = 1, gp%totalParts
355 call bml_matrix2submatrix_index(g_bml, &
356 gp%sgraph(i)%nodeInPart, gp%nnodesInPart(i), &
357 gp%sgraph(i)%core_halo_index, &
360 gp%sgraph(i)%lsize = vsize(1)
361 gp%sgraph(i)%llsize = vsize(2)
subroutine, public prg_fnormgraph(gp)
Accumulate trace norm across all subgraphs.
integer function, public getnranks()
integer function, public getmyrank()
subroutine, public prg_sp2_submatrix_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval, core_size)
subroutine, public prg_getpartitionhalosfromgraph(gp, g_bml, djflag)
Get core+halo indeces for all partitions only using the graph.
subroutine, public prg_partordering(gp)
Set row ordering bases on parts.
subroutine, public prg_subgraphsp2loop(h_bml, g_bml, rho_bml, gp, threshold)
subroutine, public prg_getgrouppartitionhalosfromgraph(gp, g_bml, hnode, djflag)
Get core+halo indeces for all partitions only using the graph.
subroutine, public prg_balanceparts(gp)
subroutine, public prg_collectmatrixfromparts(gp, rho_bml)
Collect distributed parts into same matrix.
subroutine, public prg_timer_start(itimer, tag)
Start Timing.
integer, public subind_timer
integer, public subext_timer
subroutine, public prg_timer_stop(itimer, verbose)
Stop timing.
integer, public suball_timer
integer, public subsp2_timer