From f3412de169f958e79bbc8630ecb0c94a6673b687 Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Wed, 7 Dec 2022 18:30:38 +0100 Subject: [PATCH] Dump of Krylov base --- krylov/psb_ckrylovsubspace_mod.F90 | 51 ++++++++++++++++-------------- krylov/psb_dkrylovsubspace_mod.F90 | 51 ++++++++++++++++-------------- krylov/psb_skrylovsubspace_mod.F90 | 51 ++++++++++++++++-------------- krylov/psb_zkrylovsubspace_mod.F90 | 51 ++++++++++++++++-------------- 4 files changed, 108 insertions(+), 96 deletions(-) diff --git a/krylov/psb_ckrylovsubspace_mod.F90 b/krylov/psb_ckrylovsubspace_mod.F90 index 8dd9ecd2..ee8ae829 100644 --- a/krylov/psb_ckrylovsubspace_mod.F90 +++ b/krylov/psb_ckrylovsubspace_mod.F90 @@ -284,6 +284,7 @@ contains integer(psb_lpk_) :: mglob character(len=20) :: name, ch_err complex(psb_spk_), allocatable :: vglobal(:,:) + complex(psb_spk_), allocatable :: w(:) info = psb_success_ @@ -302,30 +303,32 @@ contains end if end if - ! mglob = desc_a%get_global_rows() - ! allocate(vglobal(mglob,kryl%k), stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! do i=1,kryl%k - ! call psb_gather(vglobal(:,i),kryl%v(i),desc_a,info) - ! end do - ! if (iam == psb_root_) then - ! call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! end if - ! if (allocated(vglobal)) deallocate(vglobal, stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if + mglob = desc_a%get_global_rows() + allocate(vglobal(mglob,kryl%k), stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + do i=1,kryl%k + call psb_gather(w,kryl%v(i),desc_a,info) + vglobal(:,i) = w + end do + if (iam == psb_root_) then + call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + end if + if (allocated(vglobal)) deallocate(vglobal, stat=info) + if (allocated(w)) deallocate(w, stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if call psb_erractionrestore(err_act) diff --git a/krylov/psb_dkrylovsubspace_mod.F90 b/krylov/psb_dkrylovsubspace_mod.F90 index 80ea04e5..9cc28b16 100644 --- a/krylov/psb_dkrylovsubspace_mod.F90 +++ b/krylov/psb_dkrylovsubspace_mod.F90 @@ -284,6 +284,7 @@ contains integer(psb_lpk_) :: mglob character(len=20) :: name, ch_err real(psb_dpk_), allocatable :: vglobal(:,:) + real(psb_dpk_), allocatable :: w(:) info = psb_success_ @@ -302,30 +303,32 @@ contains end if end if - ! mglob = desc_a%get_global_rows() - ! allocate(vglobal(mglob,kryl%k), stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! do i=1,kryl%k - ! call psb_gather(vglobal(:,i),kryl%v(i),desc_a,info) - ! end do - ! if (iam == psb_root_) then - ! call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! end if - ! if (allocated(vglobal)) deallocate(vglobal, stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if + mglob = desc_a%get_global_rows() + allocate(vglobal(mglob,kryl%k), stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + do i=1,kryl%k + call psb_gather(w,kryl%v(i),desc_a,info) + vglobal(:,i) = w + end do + if (iam == psb_root_) then + call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + end if + if (allocated(vglobal)) deallocate(vglobal, stat=info) + if (allocated(w)) deallocate(w, stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if call psb_erractionrestore(err_act) diff --git a/krylov/psb_skrylovsubspace_mod.F90 b/krylov/psb_skrylovsubspace_mod.F90 index 83b0b026..13233c96 100644 --- a/krylov/psb_skrylovsubspace_mod.F90 +++ b/krylov/psb_skrylovsubspace_mod.F90 @@ -284,6 +284,7 @@ contains integer(psb_lpk_) :: mglob character(len=20) :: name, ch_err real(psb_spk_), allocatable :: vglobal(:,:) + real(psb_spk_), allocatable :: w(:) info = psb_success_ @@ -302,30 +303,32 @@ contains end if end if - ! mglob = desc_a%get_global_rows() - ! allocate(vglobal(mglob,kryl%k), stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! do i=1,kryl%k - ! call psb_gather(vglobal(:,i),kryl%v(i),desc_a,info) - ! end do - ! if (iam == psb_root_) then - ! call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! end if - ! if (allocated(vglobal)) deallocate(vglobal, stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if + mglob = desc_a%get_global_rows() + allocate(vglobal(mglob,kryl%k), stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + do i=1,kryl%k + call psb_gather(w,kryl%v(i),desc_a,info) + vglobal(:,i) = w + end do + if (iam == psb_root_) then + call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + end if + if (allocated(vglobal)) deallocate(vglobal, stat=info) + if (allocated(w)) deallocate(w, stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if call psb_erractionrestore(err_act) diff --git a/krylov/psb_zkrylovsubspace_mod.F90 b/krylov/psb_zkrylovsubspace_mod.F90 index b045f491..62930f76 100644 --- a/krylov/psb_zkrylovsubspace_mod.F90 +++ b/krylov/psb_zkrylovsubspace_mod.F90 @@ -284,6 +284,7 @@ contains integer(psb_lpk_) :: mglob character(len=20) :: name, ch_err complex(psb_dpk_), allocatable :: vglobal(:,:) + complex(psb_dpk_), allocatable :: w(:) info = psb_success_ @@ -302,30 +303,32 @@ contains end if end if - ! mglob = desc_a%get_global_rows() - ! allocate(vglobal(mglob,kryl%k), stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! do i=1,kryl%k - ! call psb_gather(vglobal(:,i),kryl%v(i),desc_a,info) - ! end do - ! if (iam == psb_root_) then - ! call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if - ! end if - ! if (allocated(vglobal)) deallocate(vglobal, stat=info) - ! if (info /= psb_success_) then - ! info=psb_err_from_subroutine_non_ - ! call psb_errpush(info,name) - ! goto 9999 - ! end if + mglob = desc_a%get_global_rows() + allocate(vglobal(mglob,kryl%k), stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + do i=1,kryl%k + call psb_gather(w,kryl%v(i),desc_a,info) + vglobal(:,i) = w + end do + if (iam == psb_root_) then + call mm_array_write(vglobal,"Krylov basis",info,filename=filename//"_v") + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if + end if + if (allocated(vglobal)) deallocate(vglobal, stat=info) + if (allocated(w)) deallocate(w, stat=info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_non_ + call psb_errpush(info,name) + goto 9999 + end if call psb_erractionrestore(err_act)