diff --git a/SRC/BPACK_defs.f90 b/SRC/BPACK_defs.f90 index db13c63..88e2dfc 100755 --- a/SRC/BPACK_defs.f90 +++ b/SRC/BPACK_defs.f90 @@ -94,16 +94,16 @@ module BPACK_DEFS real(kind=8), parameter :: BPACK_impedence0 = sqrt(BPACK_mu0/BPACK_eps0) !< free-space wave impedance !>**** solver parameters - integer, parameter:: DIRECT = 1 !< use factored HODLR as direct solver - integer, parameter:: NOPRECON = 2 !< use compressed HODLR as fast matvec - integer, parameter:: HODLRPRECON = 3 !< use factored HODLR as preconditioner + integer, parameter:: DIRECT = 1 !< use factored BPACK as direct solver + integer, parameter:: NOPRECON = 2 !< use compressed BPACK as fast matvec + integer, parameter:: BPACKPRECON = 3 !< use factored BPACK as preconditioner integer, parameter:: LplusMax = 10 - integer, parameter:: HODLR = 1 !< use hodlr solver - integer, parameter:: HMAT = 2 !< use H matrix solver - integer, parameter:: HSS = 3 !< use hss_bf solver - integer, parameter:: HSS_MD = 4 !< use hss_bf_md solver + integer, parameter:: HODLR = 1 !< use hodlr/hodbf solver + integer, parameter:: HMAT = 2 !< use H matrix (lr/bf) solver + integer, parameter:: HSS = 3 !< use hss_bf/shnbf solver + integer, parameter:: HSS_MD = 4 !< use hss_bf_md/shn_bf_md solver !>**** construction parameters integer, parameter:: SVD = 1 @@ -366,7 +366,7 @@ module BPACK_DEFS type matrixblock integer pgno !< process group integer pgno_db !< process group when MPI count is doubled - integer level !< level in HODLR + integer level !< level in BPACK integer col_group !< column group number integer row_group !< row group number integer style !< 1: full block 2: compressed block 4: hierarchical block @@ -415,7 +415,7 @@ module BPACK_DEFS integer Ndim !< dimensionality integer pgno !< process group integer pgno_db !< process group when MPI count is doubled - integer level !< level in HODLR + integer level !< level in BPACK integer, allocatable:: col_group(:) !< column group number per dimension integer, allocatable:: row_group(:) !< row group number per dimension integer style !< 1: full block 2: compressed block 4: hierarchical block @@ -484,7 +484,7 @@ module BPACK_DEFS !>**** Bplus structure type blockplus - integer level !< block level in HODLR + integer level !< block level in BPACK integer col_group !< column group number integer row_group !< row group number integer pgno !< process group number @@ -497,7 +497,7 @@ module BPACK_DEFS !>**** Bplus structure type blockplus_MD - integer level !< block level in HODLR + integer level !< block level in BPACK integer, allocatable:: col_group(:) !< column group number integer, allocatable:: row_group(:) !< row group number integer pgno !< process group number @@ -526,7 +526,7 @@ module BPACK_DEFS integer hardstart !< 1: use X0=alphaA^* as the initial guess 0: use block-diagonal approximation of A with recursive inversion as the intial guess end type schulz_operand - !>**** One level in HODLR + !>**** One level in BPACK type cascadingfactors integer level !< level number integer N_block_forward !< # of forward blocks @@ -538,10 +538,10 @@ module BPACK_DEFS type(blockplus), pointer:: BP_inverse_schur(:) => null() !< schur complement blocks end type cascadingfactors - !>**** HODLR structure + !>**** HODLR/HODBF structure type hobf - integer Maxlevel, N !< HODLR levels and sizes - integer ind_lv, ind_bk !< iterator of level and block number in a HODLR + integer Maxlevel, N !< HODLR/HODBF levels and sizes + integer ind_lv, ind_bk !< iterator of level and block number in a HODLR/HODBF type(cascadingfactors), allocatable::levels(:) ! DT,allocatable::fullmat2D(:,:) !< store the full matrix in 2D block-cyclic fashions end type hobf @@ -569,7 +569,7 @@ module BPACK_DEFS !>**** HSS structure type hssbf integer Maxlevel, N !< HSS levels and sizes - ! ! integer ind_lv,ind_bk ! iterator of level and block number in a HODLR + ! ! integer ind_lv,ind_bk ! iterator of level and block number in a hssbf/shnbf type(blockplus)::BP, BP_inverse !< a single butterfly plus for the entire matrix DT,allocatable::fullmat2D(:,:) !< store the full matrix in 2D block-cyclic fashions end type hssbf @@ -578,7 +578,7 @@ module BPACK_DEFS type hssbf_md integer Maxlevel, Ndim !< HSS_MD levels and dimensionility integer, allocatable:: N(:) !< size per dimension - ! ! integer ind_lv,ind_bk ! iterator of level and block number in a HODLR + ! ! integer ind_lv,ind_bk ! iterator of level and block number in a hssbf_md/shnbf_md type(blockplus_MD)::BP !< a single butterfly plus for the entire matrix end type hssbf_md @@ -608,10 +608,10 @@ module BPACK_DEFS type(butterfly_kerl), allocatable :: vec(:) end type butterfly_vec - !>**** HODLR solver options + !>**** BPACK solver options type Hoption - integer::format !< HODLR or HMAT or format + integer::format !< HODLR, HMAT, HSS, HSS_MD, BLR integer::verbosity !< printlevel -1: no printing except error and warning. 0: default printing. 1: print info for each high-level operation 2: print information for each low-level operation ! options for Bplus, Butterfly or LR @@ -630,8 +630,8 @@ module BPACK_DEFS integer Hextralevel !< extra levels for top partitioning of the H matrix based on MPI counts. integer forwardN15flag !< 1 use N^1.5 algorithm. 0: use NlogN pseudo skeleton algorithm. 2: use NlogN first, if not accurate enough, switch to N^1.5 real(kind=8) tol_comp !< matrix construction tolerance - integer::Nmin_leaf !< leaf sizes of HODLR tree - integer nogeo !< 1: no geometrical information available to hodlr, use NATUTAL or TM_GRAM clustering 0: geometrical points are available for TM or CKD clustering 2: no geometrical information available, but a user-defined distance function and compressibility function is provided. 3: no geometrical information available, but an array of knn*N indicating the knn neighbours of each element is provided. 4: geometrical information available for TM or CKD clustering, and an array of knn*N indicating the knn neighbours of each element is provided + integer::Nmin_leaf !< leaf sizes of BPACK tree + integer nogeo !< 1: no geometrical information available to BPACK, use NATUTAL or TM_GRAM clustering 0: geometrical points are available for TM or CKD clustering 2: no geometrical information available, but a user-defined distance function and compressibility function is provided. 3: no geometrical information available, but an array of knn*N indicating the knn neighbours of each element is provided. 4: geometrical information available for TM or CKD clustering, and an array of knn*N indicating the knn neighbours of each element is provided integer per_geo !< 1: the geomerical points are periodical. 0: the points are not periodical real(kind=8):: periods(Ndim_max) !< the periods in each dimension (currently only supports maximum of 3 dimensions) of the geometry points when per_geo=1 integer xyzsort !< clustering methods given geometrical points: CKD: cartesian kd tree SKD: spherical kd tree (only for 3D points) TM: (2 mins no recursive) @@ -665,7 +665,7 @@ module BPACK_DEFS ! options for solve real(kind=8) tol_itersol !< tolerance for iterative solvers integer n_iter !< maximum number of iterations for iterative solver - integer precon !< DIRECT: use factored HODLR as direct solver, HODLRPRECON: use factored HODLR as preconditioner, NOPRECON: use forward HODLR as fast matvec, + integer precon !< DIRECT: use factored BPACK as direct solver, BPACKPRECON: use factored BPACK as preconditioner, NOPRECON: use forward BPACK as fast matvec, ! options for error checking integer::level_check !< check compression quality by picking random entries at level_check (only work for nmpi=1 now) @@ -683,9 +683,9 @@ module BPACK_DEFS real(kind=8) Time_Direct_LU, Time_Add_Multiply, Time_Multiply, Time_XLUM, Time_Split, Time_Comm, Time_Idle, Time_Factor real(kind=8) Mem_Current, Mem_peak, Mem_Sblock, Mem_SMW, Mem_Direct_inv, Mem_Direct_for, Mem_int_vec, Mem_Comp_for, Mem_Fill, Mem_Factor real(kind=8) Flop_Fill, Flop_Factor, Flop_Sol, Flop_C_Mult, Flop_C_Extract, Flop_Tmp - integer, allocatable:: rankmax_of_level(:), rankmin_of_level(:) !< maximum and minimum ranks observed at each level of HODLR during matrix fill - integer, allocatable:: rankmax_of_level_global(:) !< maximum ranks among all processes observed at each level of HODLR during matrix fill - integer, allocatable:: rankmax_of_level_global_factor(:) !< maximum ranks among all processes observed at each level of HODLR during matrix factorization + integer, allocatable:: rankmax_of_level(:), rankmin_of_level(:) !< maximum and minimum ranks observed at each level of BPACK during matrix fill + integer, allocatable:: rankmax_of_level_global(:) !< maximum ranks among all processes observed at each level of BPACK during matrix fill + integer, allocatable:: rankmax_of_level_global_factor(:) !< maximum ranks among all processes observed at each level of BPACK during matrix factorization integer, allocatable:: Add_random_CNT(:), Mul_random_CNT(:), XLUM_random_CNT(:) !< record number of randomized operations real(kind=8), allocatable:: Add_random_Time(:), Mul_random_Time(:), XLUM_random_Time(:) !< record number of randomized operations integer, allocatable:: leafs_of_level(:) !< number of compressed blocks at each level @@ -912,7 +912,7 @@ end subroutine HMatVec_MD - !> interface of user-defined HODLR/H MatVec routine in Fortran. + !> interface of user-defined HODLR/HODBF/H-LR/H-BF MatVec routine in Fortran. subroutine F_HMatVec(trans, M, N, num_vect, Vin, Vout, quant) import::mesh, proctree, Hstat class(*), pointer :: quant @@ -922,7 +922,7 @@ subroutine F_HMatVec(trans, M, N, num_vect, Vin, Vout, quant) end subroutine F_HMatVec - !> interface of user-defined HODLR/H MatVec (tensor) routine in Fortran. + !> interface of user-defined HODLR/HODBF/H-LR/H-BF MatVec (tensor) routine in Fortran. subroutine F_HMatVec_MD(Ndim,trans, M, N, num_vect, Vin, Vout, quant) import::mesh, proctree, Hstat integer Ndim @@ -933,7 +933,7 @@ subroutine F_HMatVec_MD(Ndim,trans, M, N, num_vect, Vin, Vout, quant) end subroutine F_HMatVec_MD - !> interface of user-defined HODLR/H MatVec routine in C. + !> interface of user-defined HODLR/HODBF/H-LR/H-BF MatVec routine in C. subroutine C_HMatVec(trans, Nin, Nout, num_vect, Vin, Vout, quant) USE, INTRINSIC :: ISO_C_BINDING import::mesh, proctree, Hstat @@ -947,7 +947,7 @@ subroutine C_HMatVec(trans, Nin, Nout, num_vect, Vin, Vout, quant) end subroutine C_HMatVec - !> interface of user-defined HODLR/H MatVec (tensor) routine in C. + !> interface of user-defined HODLR/HODBF/H-LR/H-BF MatVec (tensor) routine in C. subroutine C_HMatVec_MD(Ndim, trans, Nin, Nout, num_vect, Vin, Vout, quant) USE, INTRINSIC :: ISO_C_BINDING import::mesh, proctree, Hstat diff --git a/SRC/BPACK_solve_mul.f90 b/SRC/BPACK_solve_mul.f90 index 88f16ce..7ef4838 100755 --- a/SRC/BPACK_solve_mul.f90 +++ b/SRC/BPACK_solve_mul.f90 @@ -1550,7 +1550,7 @@ subroutine BPACK_MD_Ztfqmr(Ndim, precond, ntotal, nn_loc_md, b, x, err, iter, r0 endif itmax = iter - if(option%precon==HODLRPRECON)then + if(option%precon==BPACKPRECON)then write(*,*)"BPACK_ApplyPrecon has not been changed to BPACK_MD_ApplyPrecon!!" endif call BPACK_ApplyPrecon(precond, nn_loc, b, bb, ptree, bmat, option, stats) @@ -1735,7 +1735,7 @@ subroutine BPACK_ApplyPrecon(precond, nn_loc, x, y, ptree, bmat, option, stats) if (precond == NOPRECON) then y = x - else if (precond == HODLRPRECON) then + else if (precond == BPACKPRECON) then call BPACK_Inv_Mult('N', nn_loc, 1, x, y, bmat, ptree, option, stats) stats%Flop_Sol = stats%Flop_Sol + stats%Flop_Tmp endif diff --git a/SRC/BPACK_structure.f90 b/SRC/BPACK_structure.f90 index 80d6ffe..1646256 100755 --- a/SRC/BPACK_structure.f90 +++ b/SRC/BPACK_structure.f90 @@ -527,7 +527,7 @@ subroutine Cluster_partition(bmat, option, msh, ker, stats, ptree) msh%new2old(ii) = ii end do - !>************Compute Maxlevel of hodlr tree******************* + !>************Compute Maxlevel of BPACK tree******************* nlevel_pre = 0 if (allocated(msh%pretree)) then nlevel_pre = ceiling_safe(log(dble(size(msh%pretree, 1)))/log(2d0)) @@ -1023,7 +1023,7 @@ subroutine Cluster_partition_MD(Ndim, bmat, option, msh, ker, stats, ptree) Ns_max = max(msh(dim_i)%Nunk,Ns_max) end do - !>************Compute Maxlevel of hodlr tree******************* + !>************Compute Maxlevel of BPACK tree******************* nlevel_pre = 0 level = 0; i = 1 do while (int(Ns_max/i) > option%Nmin_leaf) diff --git a/SRC/BPACK_wrapper.f90 b/SRC/BPACK_wrapper.f90 index d3b88ae..f2c9f7f 100755 --- a/SRC/BPACK_wrapper.f90 +++ b/SRC/BPACK_wrapper.f90 @@ -134,9 +134,9 @@ subroutine Bmatvec_user_C(ker, block_o, trans, M, N, num_vect, Vin, ldi, Vout, l end subroutine Bmatvec_user_C !>**** C interface of process tree construction - !> @param nmpi: number of MPIs for one hodlr + !> @param nmpi: number of MPIs for one BPACK !> @param MPIcomm: MPI communicator from C caller - !> @param groupmembers: MPI ranks in MPIcomm for one hodlr + !> @param groupmembers: MPI ranks in MPIcomm for one BPACK !> @param ptree_Cptr: the structure containing process tree subroutine C_BPACK_Createptree(nmpi, groupmembers, MPIcomm, ptree_Cptr) bind(c, name="c_bpack_createptree") implicit none @@ -384,7 +384,7 @@ subroutine C_BPACK_Createoption(option_Cptr) bind(c, name="c_bpack_createoption" type(Hoption), pointer::option allocate (option) - !>**** set default hodlr options + !>**** set default BPACK options call SetDefaultOptions(option) option_Cptr = c_loc(option) @@ -401,7 +401,7 @@ subroutine C_BPACK_Copyoption(option_Cptr, option_Cptr1) bind(c, name="c_bpack_c call c_f_pointer(option_Cptr, option) - !>****copy hodlr options + !>****copy BPACK options allocate (option1) call CopyOptions(option, option1) @@ -995,7 +995,7 @@ end subroutine C_BPACK_Setoption !>**** C interface of matrix construction - !> @param bmat_Cptr: the structure containing HODLR + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param msh_Cptr: the structure containing points and ordering information @@ -1034,7 +1034,7 @@ subroutine C_BPACK_Construct_Element_Compute(bmat_Cptr, option_Cptr, stats_Cptr, real(kind=8) t1, t2, x, y, z, r, theta, phi character(len=1024) :: strings - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures call c_f_pointer(option_Cptr, option) call c_f_pointer(stats_Cptr, stats) call c_f_pointer(ptree_Cptr, ptree) @@ -1059,7 +1059,7 @@ subroutine C_BPACK_Construct_Element_Compute(bmat_Cptr, option_Cptr, stats_Cptr, deallocate(msh%nns) endif - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -1111,7 +1111,7 @@ subroutine C_BPACK_MD_Construct_Element_Compute(Ndim,bmat_Cptr, option_Cptr, sta real(kind=8) t1, t2, x, y, z, r, theta, phi character(len=1024) :: strings - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures call c_f_pointer(option_Cptr, option) call c_f_pointer(stats_Cptr, stats) call c_f_pointer(ptree_Cptr, ptree) @@ -1136,7 +1136,7 @@ subroutine C_BPACK_MD_Construct_Element_Compute(Ndim,bmat_Cptr, option_Cptr, sta deallocate(msh(ii)%nns) endif enddo - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -1160,7 +1160,7 @@ end subroutine C_BPACK_MD_Construct_Element_Compute !> @param tree: the order tree provided by the caller, if incomplete, the init routine will make it complete (inout) !> @param Permutation: return the permutation vector new2old (indexed from 1) (out) !> @param N_loc: number of local row/column indices (out) - !> @param bmat_Cptr: the structure containing HODLR (out) + !> @param bmat_Cptr: the structure containing BPACK (out) !> @param option_Cptr: the structure containing option (in) !> @param stats_Cptr: the structure containing statistics (inout) !> @param msh_Cptr: the structure containing points and ordering information (out) @@ -1214,7 +1214,7 @@ subroutine C_BPACK_Construct_Init(N, Ndim, Locations, nns, nlevel, tree, Permuta call assert(option%xyzsort /= TM_GRAM, 'gram distance based clustering is not supported in this interface') - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures allocate (bmat) ! allocate(option) ! allocate(stats) @@ -1249,7 +1249,7 @@ subroutine C_BPACK_Construct_Init(N, Ndim, Locations, nns, nlevel, tree, Permuta call init_random_seed() if (ptree%MyID == Main_ID .and. option%verbosity >= 0) then - write (*, *) "HODLR_BUTTERFLY_SOLVER" + write (*, *) "BPACK_BUTTERFLY_SOLVER" write (*, *) " " endif @@ -1340,7 +1340,7 @@ subroutine C_BPACK_Construct_Init(N, Ndim, Locations, nns, nlevel, tree, Permuta enddo ! endif - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -1413,7 +1413,7 @@ subroutine C_BPACK_MD_Construct_Init(Ns, Nmax, Ndim, Locations, Permutation, N_l call assert(option%xyzsort /= TM_GRAM, 'gram distance based clustering is not supported in this interface') - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures allocate (bmat) ! allocate(option) ! allocate(stats) @@ -1448,7 +1448,7 @@ subroutine C_BPACK_MD_Construct_Init(Ns, Nmax, Ndim, Locations, Permutation, N_l call init_random_seed() if (ptree%MyID == Main_ID .and. option%verbosity >= 0) then - write (*, *) "HODLR_BUTTERFLY_SOLVER" + write (*, *) "BPACK_BUTTERFLY_SOLVER" write (*, *) " " endif @@ -1501,7 +1501,7 @@ subroutine C_BPACK_MD_Construct_Init(Ns, Nmax, Ndim, Locations, Permutation, N_l ! endif enddo - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -1619,7 +1619,7 @@ end subroutine C_BF_New2Old_Col !> @param tree: the order tree provided by the caller, if incomplete, the init routine will make it complete (inout) !> @param Permutation: return the permutation vector new2old (indexed from 1) (out) !> @param N_loc: number of local row/column indices (out) - !> @param bmat_Cptr: the structure containing HODLR (out) + !> @param bmat_Cptr: the structure containing BPACK (out) !> @param option_Cptr: the structure containing option (in) !> @param stats_Cptr: the structure containing statistics (inout) !> @param msh_Cptr: the structure containing points and ordering information (out) @@ -1673,7 +1673,7 @@ subroutine C_BPACK_Construct_Init_Gram(N, Ndim, Locations, nns, nlevel, tree, Pe call assert(option%xyzsort == TM_GRAM, 'only gram distance based clustering is supported in this interface') - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures allocate (bmat) ! allocate(option) ! allocate(stats) @@ -1708,7 +1708,7 @@ subroutine C_BPACK_Construct_Init_Gram(N, Ndim, Locations, nns, nlevel, tree, Pe call init_random_seed() if (ptree%MyID == Main_ID .and. option%verbosity >= 0) then - write (*, *) "HODLR_BUTTERFLY_SOLVER" + write (*, *) "BPACK_BUTTERFLY_SOLVER" write (*, *) " " endif @@ -1798,7 +1798,7 @@ subroutine C_BPACK_Construct_Init_Gram(N, Ndim, Locations, nns, nlevel, tree, Pe enddo endif - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -1809,7 +1809,7 @@ subroutine C_BPACK_Construct_Init_Gram(N, Ndim, Locations, nns, nlevel, tree, Pe end subroutine C_BPACK_Construct_Init_Gram !>**** C interface of matrix construction via blackbox matvec - !> @param bmat_Cptr: the structure containing HODLR (inout) + !> @param bmat_Cptr: the structure containing BPACK (inout) !> @param option_Cptr: the structure containing option (in) !> @param stats_Cptr: the structure containing statistics (inout) !> @param msh_Cptr: the structure containing points and ordering information (in) @@ -1865,7 +1865,7 @@ subroutine C_BPACK_Construct_Matvec_Compute(bmat_Cptr, option_Cptr, stats_Cptr, option%less_adapt=0 call BPACK_construction_Matvec(bmat, matvec_user_C, Memory, error, option, stats, ker, ptree, msh) option%less_adapt=1 - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -1925,7 +1925,7 @@ subroutine C_BF_Construct_Init(M, N, M_loc, N_loc, nnsr, nnsc, mshr_Cptr, mshc_C type(c_funptr), intent(in), value, target :: C_FuncDistmn type(c_funptr), intent(in), value, target :: C_FuncNearFar - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures allocate (blocks) allocate (msh) allocate (ker) @@ -1957,7 +1957,7 @@ subroutine C_BF_Construct_Init(M, N, M_loc, N_loc, nnsr, nnsc, mshr_Cptr, mshc_C call init_random_seed() ! if(ptree%MyID==Main_ID)then - ! write(*,*) "HODLR_BUTTERFLY_SOLVER" + ! write(*,*) "BPACK_BUTTERFLY_SOLVER" ! write(*,*) " " ! endif @@ -2051,7 +2051,7 @@ subroutine C_BF_Construct_Init(M, N, M_loc, N_loc, nnsr, nnsc, mshr_Cptr, mshc_C M_loc = blocks%M_loc N_loc = blocks%N_loc - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bf_Cptr = c_loc(blocks) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -2097,7 +2097,7 @@ subroutine C_BF_Construct_Matvec_Compute(bf_Cptr, option_Cptr, stats_Cptr, msh_C real(kind=8) t1, t2, error integer ierr - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures call c_f_pointer(option_Cptr, option) call c_f_pointer(stats_Cptr, stats) @@ -2139,7 +2139,7 @@ subroutine C_BF_Construct_Matvec_Compute(bf_Cptr, option_Cptr, stats_Cptr, msh_C call LogMemory(stats, stats%Mem_Fill) stats%Time_Fill = stats%Time_Fill + t2 - t1 stats%Flop_Fill = stats%Flop_Fill + stats%Flop_Tmp - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bf_Cptr = c_loc(blocks) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -2195,7 +2195,7 @@ subroutine C_BF_Construct_Element_Compute(bf_Cptr, option_Cptr, stats_Cptr, msh_ integer:: boundary_map(1,1) integer groupm_start, Nboundall,Ninadmissible - !>**** allocate HODLR solver structures + !>**** allocate BPACK solver structures call c_f_pointer(option_Cptr, option) call c_f_pointer(stats_Cptr, stats) @@ -2264,7 +2264,7 @@ subroutine C_BF_Construct_Element_Compute(bf_Cptr, option_Cptr, stats_Cptr, msh_ call LogMemory(stats, stats%Mem_Fill) stats%Time_Fill = stats%Time_Fill + t2 - t1 ! stats%Flop_Fill = stats%Flop_Fill + stats%Flop_Tmp ! Flop_Fill already counted in BF_compress_NlogN - !>**** return the C address of hodlr structures to C caller + !>**** return the C address of BPACK structures to C caller bf_Cptr = c_loc(blocks) option_Cptr = c_loc(option) stats_Cptr = c_loc(stats) @@ -2274,8 +2274,8 @@ subroutine C_BF_Construct_Element_Compute(bf_Cptr, option_Cptr, stats_Cptr, msh_ end subroutine C_BF_Construct_Element_Compute -!>**** C interface of HODLR factorization - !> @param bmat_Cptr: the structure containing HODLR +!>**** C interface of BPACK factorization + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param ptree_Cptr: the structure containing process tree @@ -2308,17 +2308,17 @@ subroutine C_BPACK_Factor(bmat_Cptr, option_Cptr, stats_Cptr, ptree_Cptr, msh_Cp call BPACK_Factorization(bmat, option, stats, ptree, msh) - ! return the C address of hodlr structures to C caller + ! return the C address of BPACK structures to C caller bmat_Cptr = c_loc(bmat) end subroutine C_BPACK_Factor -!>**** C interface of HODLR solve +!>**** C interface of BPACK solve !> @param x: local solution vector !> @param b: local RHS !> @param Nloc: size of local RHS !> @param Nrhs: number of RHSs - !> @param bmat_Cptr: the structure containing HODLR + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param ptree_Cptr: the structure containing process tree @@ -2766,7 +2766,7 @@ end subroutine C_BF_ExtractElement !> @param pgidx: 1D array containing the process group number of each intersection, the number starts from 0 !> @param Npmap: number of process groups !> @param pmaps: 2D array (Npmapx3) containing number of process rows, number of process columns, and starting process ID in each intersection - !> @param bmat_Cptr: the structure containing HODLR + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param ptree_Cptr: the structure containing process tree @@ -2830,13 +2830,13 @@ subroutine C_BPACK_ExtractElement(bmat_Cptr, option_Cptr, msh_Cptr, stats_Cptr, end subroutine C_BPACK_ExtractElement -!>**** C interface of HODLR-vector multiplication +!>**** C interface of BPACK-vector multiplication !> @param xin: input vector !> @param Ninloc: size of local input vectors !> @param xout: output vector !> @param Noutloc: size of local output vectors !> @param Ncol: number of vectors - !> @param bmat_Cptr: the structure containing HODLR + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param ptree_Cptr: the structure containing process tree @@ -2920,7 +2920,7 @@ end subroutine C_BPACK_Mult !> @param xout: output vector !> @param Noutloc: size of local output vectors !> @param Ncol: number of vectors - !> @param bmat_Cptr: the structure containing HODLR + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param ptree_Cptr: the structure containing process tree @@ -3000,13 +3000,13 @@ end subroutine C_BPACK_MD_Mult -!>**** C interface of HODLR(inverse)-vector multiplication +!>**** C interface of BPACK(inverse)-vector multiplication !> @param xin: input vector !> @param Ninloc: size of local input vectors !> @param xout: output vector !> @param Noutloc: size of local output vectors !> @param Ncol: number of vectors - !> @param bmat_Cptr: the structure containing HODLR + !> @param bmat_Cptr: the structure containing BPACK !> @param option_Cptr: the structure containing option !> @param stats_Cptr: the structure containing statistics !> @param ptree_Cptr: the structure containing process tree diff --git a/SRC/Bplus_factor.f90 b/SRC/Bplus_factor.f90 index f19ebf1..e3b26fd 100755 --- a/SRC/Bplus_factor.f90 +++ b/SRC/Bplus_factor.f90 @@ -14,7 +14,7 @@ ! Developers: Yang Liu ! (Lawrence Berkeley National Lab, Computational Research Division). !> @file Bplus_factor.f90 -!> @brief Low-level subroutines for factorizing a BPACK (H/HODBF/HODLR/HSS-BF) matrix +!> @brief Low-level subroutines for factorizing a BPACK (HMAT-LR/HMAT-BF/BLR/HODBF/HODLR/HSS-BF) matrix @@ -2498,12 +2498,12 @@ subroutine BF_get_rank_ABCD(partitioned_block, rankmax) enddo end subroutine BF_get_rank_ABCD -!>**** Update one off-diagonal block in HODLR compressed as +!>**** Update one off-diagonal block in HODLR/HODBF compressed as ! Bplus/Butterfly/LR by multiplying on it left the inverse of diagonal block ! If LR, call LR_Sblock; if butterfly, call BF_randomized; if Bplus, call Bplus_randomized_constr - !ho_bf1: working HODLR - !level_c: level# of the block in HODLR - !rowblock: block# of the block at this level in HODLR + !ho_bf1: working HODLR/HODBF + !level_c: level# of the block in HODLR/HODBF + !rowblock: block# of the block at this level in HODLR/HODBF !option: containing compression options !stats: statistics !ptree: process tree diff --git a/SRC/C_BPACK_wrapper.h b/SRC/C_BPACK_wrapper.h index 4823d1e..6a02079 100755 --- a/SRC/C_BPACK_wrapper.h +++ b/SRC/C_BPACK_wrapper.h @@ -34,7 +34,7 @@ typedef void*F2Cptr; //pointer passing fortran derived types to c typedef void*C2Fptr; //pointer passing c objects to fortran //------------------------------------------------------------------------------ -//Declartion of FORTRAN subroutines to HODLR code +//Declartion of FORTRAN subroutines to BPACK code extern "C"{ void c_bpack_construct_element_compute(F2Cptr* ho_bf_for, F2Cptr* option,F2Cptr* stats,F2Cptr* msh,F2Cptr* ker,F2Cptr* ptree, void (*C_FuncZmn)(int*, int*, C_DT*,C2Fptr),void (*C_FuncZmnBlock)(int*, int*, int*, int64_t*, int*, int*, C_DT*, int*, int*, int*, int*, int*, C2Fptr), C2Fptr C_QuantApp);