Skip to content

Commit

Permalink
Add is_stored option in MUMPS
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoki MORITA committed Jan 24, 2023
1 parent e0b2322 commit 6f04414
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/eigen/Lanczos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ subroutine monolis_eigen_inverted_standard_lanczos_ &
do iter = 1, maxiter
call monolis_set_RHS(monoMAT, q(:,iter))

monoPRM%is_prec_stored = .true.
call monolis_solve_(monoPRM, monoCOM, monoMAT)

do i = 1, N*NDOF
Expand Down
16 changes: 8 additions & 8 deletions src/main/monolis_solve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -325,27 +325,27 @@ subroutine monolis_timer_finalize(monoPRM, monoCOM)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" max min average std"

time(1) = monoPRM%tprep
call hecmw_time_statistics (monoCOM, time(1), t_max, t_min, t_avg, t_sd)
call monolis_time_statistics (monoCOM, time(1), t_max, t_min, t_avg, t_sd)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" - solution/prepost time:", t_max, t_min, t_avg, t_sd

time(2) = monoPRM%tspmv
call hecmw_time_statistics (monoCOM, time(2), t_max, t_min, t_avg, t_sd)
call monolis_time_statistics (monoCOM, time(2), t_max, t_min, t_avg, t_sd)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" - solution/SpMV time:", t_max, t_min, t_avg, t_sd

time(3) = monoPRM%tdotp
call hecmw_time_statistics (monoCOM, time(3), t_max, t_min, t_avg, t_sd)
call monolis_time_statistics (monoCOM, time(3), t_max, t_min, t_avg, t_sd)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" - solution/inner p time:", t_max, t_min, t_avg, t_sd

time(4) = monoPRM%tprec
call hecmw_time_statistics (monoCOM, time(4), t_max, t_min, t_avg, t_sd)
call monolis_time_statistics (monoCOM, time(4), t_max, t_min, t_avg, t_sd)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" - solution/precond time:", t_max, t_min, t_avg, t_sd

time(5) = monoPRM%tcomm_dotp
call hecmw_time_statistics (monoCOM, time(5), t_max, t_min, t_avg, t_sd)
call monolis_time_statistics (monoCOM, time(5), t_max, t_min, t_avg, t_sd)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" - (comm time/inner p) :", t_max, t_min, t_avg, t_sd

time(6) = monoPRM%tcomm_spmv
call hecmw_time_statistics (monoCOM, time(6), t_max, t_min, t_avg, t_sd)
call monolis_time_statistics (monoCOM, time(6), t_max, t_min, t_avg, t_sd)
if(monoCOM%myrank == 0) write(*,"(a,1p4e10.3)")" - (comm time/spmv) :", t_max, t_min, t_avg, t_sd
endif

Expand All @@ -368,7 +368,7 @@ subroutine monolis_timer_finalize(monoPRM, monoCOM)
monoPRM%tcomm_spmv = time(6)
end subroutine monolis_timer_finalize

subroutine hecmw_time_statistics (monoCOM, time, t_max, t_min, t_avg, t_sd)
subroutine monolis_time_statistics (monoCOM, time, t_max, t_min, t_avg, t_sd)
implicit none
type(monolis_com) :: monoCOM
real(kdouble), intent(in) :: time
Expand Down Expand Up @@ -397,5 +397,5 @@ subroutine hecmw_time_statistics (monoCOM, time, t_max, t_min, t_avg, t_sd)
else
t_sd = dsqrt(tmp - t_avg*t_avg)
endif
end subroutine hecmw_time_statistics
end subroutine monolis_time_statistics
end module mod_monolis_solve
1 change: 1 addition & 0 deletions src/solver/iterative/BiCGSTAB.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ subroutine monolis_solver_BiCGSTAB(monoPRM, monoCOM, monoMAT)
X => monoMAT%X
B => monoMAT%B
iter_RR = 200
omega = 0.0d0

if(monoPRM%is_init_x) X = 0.0d0

Expand Down
1 change: 1 addition & 0 deletions src/solver/iterative/BiCGSTAB_noprec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ subroutine monolis_solver_BiCGSTAB_noprec(monoPRM, monoCOM, monoMAT)
X => monoMAT%X
B => monoMAT%B
iter_RR = 50
omega = 0.0d0

if(monoPRM%is_init_x) X = 0.0d0

Expand Down
14 changes: 14 additions & 0 deletions src/solver/precond/MUMPS.f90
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ subroutine monolis_precond_mumps_clear(monoPRM, monoCOM, monoMAT)
type(monolis_prm) :: monoPRM
type(monolis_com) :: monoCOM
type(monolis_mat) :: monoMAT

if(monoPRM%is_prec_stored) return

is_factored = .false.

#ifdef WITH_MUMPS
if(allocated(offset_list)) deallocate(offset_list)
if(allocated(offset_counts)) deallocate(offset_counts)

if(associated(mumps%IRN_loc)) deallocate(mumps%IRN_loc)
if(associated(mumps%JCN_loc)) deallocate(mumps%JCN_loc)
if(associated(mumps%A)) deallocate(mumps%A)
if(associated(mumps%RHS)) deallocate(mumps%RHS)
#endif
end subroutine monolis_precond_mumps_clear

subroutine monolis_precond_mumps_get_nz(monoMAT, NZ, is_self)
Expand Down
1 change: 1 addition & 0 deletions src/util/def_com.f90
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ subroutine monolis_com_copy(monoCOM, monoCOM_reorder)
monoCOM_reorder%myrank = monoCOM%myrank
monoCOM_reorder%comm = monoCOM%comm
monoCOM_reorder%commsize = monoCOM%commsize
monoCOM_reorder%internal_nnode = monoCOM%internal_nnode

monoCOM_reorder%recv_n_neib = monoCOM%recv_n_neib
monoCOM_reorder%recv_neib_pe => monoCOM%recv_neib_pe
Expand Down
1 change: 1 addition & 0 deletions src/util/def_prm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module mod_monolis_prm
logical :: is_debug = .false.
logical :: is_measurement= .false.
logical :: is_check_diag = .false.
logical :: is_prec_stored= .false.
logical :: show_iterlog = .true.
logical :: show_time = .true.
logical :: show_time_statistics = .false.
Expand Down

0 comments on commit 6f04414

Please sign in to comment.