From d0cbf23126850d29d08fe0128ded302f123a737f Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 5 Apr 2018 13:36:51 +0100 Subject: [PATCH] Merge development, take out MOLD. --- base/modules/serial/psb_c_vect_mod.F90 | 11 +-- base/modules/serial/psb_d_vect_mod.F90 | 11 +-- base/modules/serial/psb_i_vect_mod.F90 | 11 +-- base/modules/serial/psb_l_vect_mod.F90 | 102 ++++++------------------- base/modules/serial/psb_s_vect_mod.F90 | 11 +-- base/modules/serial/psb_z_vect_mod.F90 | 11 +-- 6 files changed, 30 insertions(+), 127 deletions(-) diff --git a/base/modules/serial/psb_c_vect_mod.F90 b/base/modules/serial/psb_c_vect_mod.F90 index b73a67d3..e93ec8da 100644 --- a/base/modules/serial/psb_c_vect_mod.F90 +++ b/base/modules/serial/psb_c_vect_mod.F90 @@ -235,25 +235,16 @@ contains class(psb_c_vect_type), intent(inout) :: x class(psb_c_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_c_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_c_get_base_vect_default()) -#else - mld = psb_c_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n) diff --git a/base/modules/serial/psb_d_vect_mod.F90 b/base/modules/serial/psb_d_vect_mod.F90 index 5f6c3909..d3d50403 100644 --- a/base/modules/serial/psb_d_vect_mod.F90 +++ b/base/modules/serial/psb_d_vect_mod.F90 @@ -235,25 +235,16 @@ contains class(psb_d_vect_type), intent(inout) :: x class(psb_d_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_d_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_d_get_base_vect_default()) -#else - mld = psb_d_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n) diff --git a/base/modules/serial/psb_i_vect_mod.F90 b/base/modules/serial/psb_i_vect_mod.F90 index e13b2a41..81f104e2 100644 --- a/base/modules/serial/psb_i_vect_mod.F90 +++ b/base/modules/serial/psb_i_vect_mod.F90 @@ -208,25 +208,16 @@ contains class(psb_i_vect_type), intent(inout) :: x class(psb_i_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_i_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_i_get_base_vect_default()) -#else - mld = psb_i_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n) diff --git a/base/modules/serial/psb_l_vect_mod.F90 b/base/modules/serial/psb_l_vect_mod.F90 index a694e187..8c3ff882 100644 --- a/base/modules/serial/psb_l_vect_mod.F90 +++ b/base/modules/serial/psb_l_vect_mod.F90 @@ -167,24 +167,15 @@ contains class(psb_l_vect_type), intent(inout) :: x class(psb_l_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_l_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_l_get_base_vect_default()) -#else - mld = psb_l_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(invect) @@ -199,23 +190,14 @@ contains integer(psb_ipk_) :: info class(psb_l_base_vect_type), pointer :: mld - + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_l_get_base_vect_default()) -#else - mld = psb_l_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n) @@ -227,25 +209,16 @@ contains class(psb_l_vect_type), intent(inout) :: x class(psb_l_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_l_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_l_get_base_vect_default()) -#else - mld = psb_l_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n) @@ -326,6 +299,7 @@ contains res = 'NULL' if (allocated(x%v)) res = x%v%get_fmt() end function l_vect_get_fmt + subroutine l_vect_all(n, x, info, mold) implicit none @@ -338,11 +312,7 @@ contains & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else allocate(psb_l_base_vect_type :: x%v,stat=info) endif @@ -486,21 +456,22 @@ contains class(psb_l_vect_type), intent(inout) :: x class(psb_l_base_vect_type), intent(in), optional :: mold class(psb_l_base_vect_type), allocatable :: tmp + integer(psb_ipk_) :: info + info = psb_success_ if (present(mold)) then -#ifdef HAVE_MOLD allocate(tmp,stat=info,mold=mold) -#else - call mold%mold(tmp,info) -#endif - if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) - end if - call move_alloc(tmp,x%v) + else + allocate(tmp,stat=info,mold=psb_l_get_base_vect_default()) end if + if (allocated(x%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + end if + call move_alloc(tmp,x%v) + end subroutine l_vect_cnv @@ -698,19 +669,11 @@ contains integer(psb_ipk_) :: info class(psb_l_base_multivect_type), pointer :: mld + info = psb_success_ if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_l_get_base_multivect_default()) -#else - mld = psb_l_get_base_multivect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(invect) @@ -723,21 +686,12 @@ contains class(psb_l_multivect_type), intent(out) :: x class(psb_l_base_multivect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_l_base_multivect_type), pointer :: mld + info = psb_success_ if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_l_get_base_multivect_default()) -#else - mld = psb_l_get_base_multivect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(m,n) @@ -834,11 +788,7 @@ contains integer(psb_ipk_), intent(out) :: info if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else allocate(psb_l_base_multivect_type :: x%v,stat=info) endif @@ -997,18 +947,16 @@ contains integer(psb_ipk_) :: info if (present(mold)) then -#ifdef HAVE_MOLD allocate(tmp,stat=info,mold=mold) -#else - call mold%mold(tmp,info) -#endif - if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) - end if - call move_alloc(tmp,x%v) + else + allocate(tmp,stat=info, mold=psb_l_get_base_multivect_default()) + endif + if (allocated(x%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) end if + call move_alloc(tmp,x%v) end subroutine l_vect_cnv diff --git a/base/modules/serial/psb_s_vect_mod.F90 b/base/modules/serial/psb_s_vect_mod.F90 index e6478e71..79e73a00 100644 --- a/base/modules/serial/psb_s_vect_mod.F90 +++ b/base/modules/serial/psb_s_vect_mod.F90 @@ -235,25 +235,16 @@ contains class(psb_s_vect_type), intent(inout) :: x class(psb_s_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_s_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_s_get_base_vect_default()) -#else - mld = psb_s_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n) diff --git a/base/modules/serial/psb_z_vect_mod.F90 b/base/modules/serial/psb_z_vect_mod.F90 index e762f90a..c41fb037 100644 --- a/base/modules/serial/psb_z_vect_mod.F90 +++ b/base/modules/serial/psb_z_vect_mod.F90 @@ -235,25 +235,16 @@ contains class(psb_z_vect_type), intent(inout) :: x class(psb_z_base_vect_type), intent(in), optional :: mold integer(psb_ipk_) :: info - class(psb_z_base_vect_type), pointer :: mld + info = psb_success_ if (allocated(x%v)) & & call x%free(info) if (present(mold)) then -#ifdef HAVE_MOLD allocate(x%v,stat=info,mold=mold) -#else - call mold%mold(x%v,info) -#endif else -#ifdef HAVE_MOLD allocate(x%v,stat=info, mold=psb_z_get_base_vect_default()) -#else - mld = psb_z_get_base_vect_default() - call mld%mold(x%v,info) -#endif endif if (info == psb_success_) call x%v%bld(n)